Squash al branch-ului de lucru plan13-s2. Clase: ofacturare (nucleul formularului unificat), ofacturare_comun, ferestre_cere_date, ocomenzi, caut_ora (lista de preturi in combo-urile de cautare), omodificari. Programe: ofacturare impartit - ofacturare_antet, ofacturare_rutare_scriere si ogrid_latimi sunt fisiere noi; oproceduri_facturare primeste discountul pe linie si cota standard de TVA cand articolul nu are cota pe politica. Documentatie: capcana SQLExec no_data_found, conventia de encoding, depanarea testelor VFP si regulile de lucru - conflictele cu modificarile venite din alte proiecte sunt rezolvate pastrand ambele parti. Loguri de rulare a testelor scoase din versionare; testele raman. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PkyjGyrV2S7932om4kfSiK
148 lines
6.4 KiB
Plaintext
148 lines
6.4 KiB
Plaintext
* probe_defect5.prg
|
|
* Proba unica, ne-permanenta: deschide pe traseul real (frm_facturi.do_editare_unificata) un
|
|
* document cu incasat<>0, tip 1-4, ne-proforma (id_vanzare=1071, gasit prin find_defect5_doc.prg)
|
|
* si logheaza daca apare eroare VFP sau daca formularul se deschide normal. Nu scrie in Oracle.
|
|
* Foloseste acelasi mecanism ca test_s8_pas7_cablare.prg (driverS8p7), copiat aici temporar.
|
|
|
|
SET SAFETY OFF
|
|
SET TALK OFF
|
|
|
|
PUBLIC gcErrLog
|
|
gcErrLog = 'D:\ROA\ROAFACTURARE\COMUN\utile\Teste\editare_factura\probe_defect5_log.txt'
|
|
STRTOFILE('start' + CHR(13) + CHR(10), gcErrLog)
|
|
|
|
ON ERROR DO test_error_handler WITH ERROR(), MESSAGE(), PROGRAM(), LINENO()
|
|
|
|
DO ('D:\ROA\ROAFACTURARE\COMUN\utile\Teste\test_init_env_auto_roafacturare.prg') WITH 'CENTRAL', 'MARIUSM_AUTO', 'ROMFASTSOFT'
|
|
IF gnHandle <= 0
|
|
STRTOFILE('EROARE: conectare esuata' + CHR(13) + CHR(10), gcErrLog, 1)
|
|
QUIT
|
|
ENDIF
|
|
gnIdUtil = 8
|
|
|
|
SET PROCEDURE TO D:\ROA\ROAFACTURARE\COMUN\programe\ofacturare_editare.prg ADDITIVE
|
|
|
|
LOCAL lcProcExistent
|
|
lcProcExistent = SET("PROCEDURE")
|
|
SET PROCEDURE TO "D:\ROA\ROAFACTURARE\COMUN\utile\Teste\mock_amessagebox.prg", &lcProcExistent
|
|
|
|
PUBLIC gcMockUltimMesaj, gnMockUltimTip, gnMockRaspuns
|
|
gcMockUltimMesaj = ''
|
|
gnMockUltimTip = 0
|
|
gnMockRaspuns = 6
|
|
|
|
PUBLIC goDriverS8p7
|
|
goDriverS8p7 = Createobject('driverS8p7')
|
|
_SCREEN.AddObject('tmrS8p7', 'Timer')
|
|
_SCREEN.tmrS8p7.Interval = 150
|
|
Bindevent(_SCREEN.tmrS8p7, 'Timer', goDriverS8p7, 'Executa')
|
|
_SCREEN.tmrS8p7.Enabled = .T.
|
|
|
|
Private poFacturi
|
|
poFacturi = Null
|
|
IF Used('crsfacturi')
|
|
Use In crsfacturi
|
|
ENDIF
|
|
|
|
LOCAL lcSchema, lcSelect, lcOrder, lcFiltru
|
|
lcSchema = ['ales n(1),id_vanzare n(20),id_comanda n(20),dataora t,dataora_exp t,data_act d,data_scad d,sters n(1),dataoras t,numar_act n(14),serie_act c(10),'+] + ;
|
|
['tip n(5),id_part n(10),discount n(17,4),disc_fara_tva n(17,4),discount_evidentiat n(1),text_aditional M,facturat n(1),data_facturat t,'+] + ;
|
|
['explicatie c(240),altele c(200),client c(100),cod n(20),id_util I,utilizator c(30),utils c(30),utilfact c(30),delegat c(70),'+] + ;
|
|
['bidelegat c(30),cnpdelegat c(15),nume_agent c(70),nrinmat c(10),total_fara_tva n(20,4),total_tva n(20,4),total_cu_tva n(20,4),id_gestiune n(10),'+] + ;
|
|
['serie_chit c(20),nr_incasare n(10),incasat n(17,4),in_valuta n(1),sucursala c(100),id_ruta n(10),ruta c(100),curs n(20,4),multiplicator n(10),nume_val c(50),'+] + ;
|
|
['valuta c(50), id_valuta n(5), valval n(20,4), tvaval n(20,4), totval n(20,4),'+] + ;
|
|
['id_delegat n(10),id_agent n(10),id_masina n(10),valoarea N(20,4),nume_gestiune C(50),id_sectie n(5),sectie c(50),id_lucrare n(20), lucrare c(200),'+] + ;
|
|
['tip_incasare n(10),afisare_scadenta n(1),id_ordl n(10),tva_incasare n(1),listare_detaliata n(1),'+] + ;
|
|
['id_facturare n(10),adresa_facturare c(250),email_facturare c(100),adresa_client c(250),email_client c(100),adresa_beneficiar c(250),email_beneficiar c(100),'+] + ;
|
|
['id_beneficiar n(20),beneficiar C(100),tip_factura N(5),ctip_factura C(100), id_ctr N(10), contract C(100),eproforma N(1),tip_saft N(3) null,tip_saftname V(250) null,'+]+;
|
|
['id_livrare N(10),adresa_livrare V(250), denumire_adresa_livrare V(100), email_livrare V(100),institutie_publica N(1) null,efactura N(1) null,cod_fiscal C(20),id_fact N(20)']
|
|
|
|
lcSelect = ['select 0 as ales,id_vanzare,id_comanda,dataora,dataora_exp,data_act,data_scad,sters,dataoras,numar_act,serie_act,'+] + ;
|
|
['tip,id_part,discount,disc_fara_tva,discount_evidentiat,text_aditional,facturat,data_facturat,'+] + ;
|
|
['explicatie,altele,client,cod,id_util,utilizator,utils,utilfact,delegat,bidelegat,cnpdelegat,'+] + ;
|
|
['nume_agent,nrinmat,total_fara_tva,total_tva,total_cu_tva,id_gestiune,serie_chit,nr_incasare,incasat,'+] + ;
|
|
['in_valuta,sucursala,id_ruta,ruta,curs,multiplicator,nume_val,'+] + ;
|
|
['valuta,id_valuta,valval,tvaval,totval,'+] + ;
|
|
['id_delegat,id_agent,id_masina,valoarea,'+] + ;
|
|
['nume_gestiune,id_sectie,sectie,id_lucrare,lucrare,tip_incasare,afisare_scadenta,id_ordl,tva_incasare,listare_detaliata,'+] + ;
|
|
['id_facturare,adresa_facturare,email_facturare,adresa_client,email_client,adresa_beneficiar,email_beneficiar,'+] + ;
|
|
['id_beneficiar, beneficiar, tip_factura, ctip_factura, id_ctr, contract, eproforma,tip_saft,tip_saftname, '+]+;
|
|
['id_livrare,adresa_livrare,denumire_adresa_livrare,email_livrare,institutie_publica,efactura,cod_fiscal,id_fact from fact_vfacturi where ']
|
|
|
|
lcOrder = [data_act,numar_act]
|
|
lcFiltru = [id_vanzare = 1071]
|
|
gencursor('poFacturi', 'crsfacturi', lcSelect, lcFiltru, lcSchema, lcOrder, .F., [], .F., [])
|
|
poFacturi.ca_baza1.afisare()
|
|
|
|
IF !Used('crsfacturi') OR Reccount('crsfacturi') <> 1
|
|
STRTOFILE('EROARE: crsfacturi nu are 1071' + CHR(13) + CHR(10), gcErrLog, 1)
|
|
QUIT
|
|
ENDIF
|
|
STRTOFILE('crsfacturi OK, incasat=' + Transform(crsfacturi.incasat) + ' tip=' + Transform(crsfacturi.tip) + ' eproforma=' + Transform(crsfacturi.eproforma) + CHR(13) + CHR(10), gcErrLog, 1)
|
|
|
|
Select crsfacturi
|
|
Local loFrm
|
|
loFrm = Newobject('frm_facturi', 'D:\ROA\ROAFACTURARE\COMUN\clase\ofacturare_comun.vcx')
|
|
STRTOFILE('Newobject(frm_facturi): ' + Vartype(m.loFrm) + CHR(13) + CHR(10), gcErrLog, 1)
|
|
|
|
Select crsfacturi
|
|
Locate For id_vanzare = 1071
|
|
STRTOFILE('Locate 1071: Found=' + Transform(Found()) + CHR(13) + CHR(10), gcErrLog, 1)
|
|
|
|
goDriverS8p7.Reseteaza()
|
|
STRTOFILE('inainte de do_editare_unificata' + CHR(13) + CHR(10), gcErrLog, 1)
|
|
loFrm.do_editare_unificata()
|
|
STRTOFILE('dupa do_editare_unificata, mesaj amessagebox=[' + gcMockUltimMesaj + '] driver.lGasit=' + Transform(goDriverS8p7.lGasit) + CHR(13) + CHR(10), gcErrLog, 1)
|
|
|
|
_SCREEN.tmrS8p7.Enabled = .F.
|
|
Try
|
|
_SCREEN.RemoveObject('tmrS8p7')
|
|
Catch
|
|
Endtry
|
|
|
|
Try
|
|
loFrm.Release()
|
|
Catch
|
|
Endtry
|
|
|
|
STRTOFILE('done' + CHR(13) + CHR(10), gcErrLog, 1)
|
|
QUIT
|
|
|
|
|
|
PROCEDURE test_error_handler
|
|
LPARAMETERS tnError, tcMessage, tcProgram, tnLineNo
|
|
STRTOFILE('EROARE ' + TRANSFORM(tnError) + ' [' + tcProgram + ':' + TRANSFORM(tnLineNo) + '] ' + tcMessage + CHR(13) + CHR(10), gcErrLog, 1)
|
|
ENDPROC
|
|
|
|
|
|
DEFINE CLASS driverS8p7 AS Custom
|
|
lBusy = .F.
|
|
lGasit = .F.
|
|
|
|
PROCEDURE Reseteaza
|
|
This.lGasit = .F.
|
|
ENDPROC
|
|
|
|
PROCEDURE Executa
|
|
IF This.lBusy OR This.lGasit
|
|
RETURN
|
|
ENDIF
|
|
This.lBusy = .T.
|
|
TRY
|
|
LOCAL lnI, loFrm2
|
|
FOR lnI = 1 TO _SCREEN.FormCount
|
|
IF Upper(_SCREEN.Forms(m.lnI).Class) == 'FRM_FACTURARE_ARTICOLE2'
|
|
loFrm2 = _SCREEN.Forms(m.lnI)
|
|
This.lGasit = .T.
|
|
loFrm2.Release()
|
|
EXIT
|
|
ENDIF
|
|
ENDFOR
|
|
CATCH TO loExcS8p7
|
|
STRTOFILE('DRIVER EROARE ' + TRANSFORM(loExcS8p7.ErrorNo) + ' ' + loExcS8p7.Message + CHR(13) + CHR(10), gcErrLog, 1)
|
|
FINALLY
|
|
This.lBusy = .F.
|
|
ENDTRY
|
|
ENDPROC
|
|
ENDDEFINE
|