#13: formular de facturare unificat - etapa curenta
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
This commit is contained in:
116
utile/Teste/facturare_unificat/test_s6_2_compdoc_comanda.prg
Normal file
116
utile/Teste/facturare_unificat/test_s6_2_compdoc_comanda.prg
Normal file
@@ -0,0 +1,116 @@
|
||||
* test_s6_2_compdoc_comanda.prg
|
||||
* Headless, fara formulare: compara documentele deja emise de S6-2 pentru COMANDA -
|
||||
* v1 SSS 654 (id_vanzare 1113) vs v2 SSS 656 (id_vanzare 1114) - CompDoc (schela) + campuri de
|
||||
* configuratie (TIP, IN_VALUTA, ID_VALUTA, MULTIPLICATOR, DISCOUNT_EVIDENTIAT, TVA_INCASARE,
|
||||
* TIP_FACTURA, TIP_SAFT, COEFICIENT_K).
|
||||
*
|
||||
* Rulare: vfp9.exe -A -T "D:\ROA\ROAFACTURARE\COMUN\utile\Teste\facturare_unificat\test_s6_2_compdoc_comanda.prg"
|
||||
* Log: D:\ROA\ROAFACTURARE\COMUN\utile\Teste\facturare_unificat\out\test_s6_2_compdoc_comanda.log
|
||||
* Mediu: ROA_CENTRAL / MARIUSM_AUTO.
|
||||
|
||||
SET SAFETY OFF
|
||||
SET TALK OFF
|
||||
CLOSE DATABASES
|
||||
|
||||
PUBLIC gcLog, gnPass, gnFail
|
||||
gcLog = "D:\ROA\ROAFACTURARE\COMUN\utile\Teste\facturare_unificat\out\test_s6_2_compdoc_comanda.log"
|
||||
STRTOFILE("START " + TTOC(DATETIME()) + CHR(13) + CHR(10), gcLog)
|
||||
gnPass = 0
|
||||
gnFail = 0
|
||||
|
||||
TRY
|
||||
DO "D:\ROA\ROAFACTURARE\COMUN\utile\Teste\test_init_env_auto_roafacturare.prg" WITH 'CENTRAL', 'MARIUSM_AUTO', 'ROMFASTSOFT'
|
||||
IF TYPE('gnHandle') <> 'N' OR gnHandle <= 0
|
||||
DO CLog WITH 'EROARE: conectare Oracle esuata'
|
||||
DO CFinal
|
||||
ENDIF
|
||||
DO CLog WITH 'ENV OK gnHandle=' + TRANSFORM(gnHandle)
|
||||
|
||||
SET PROCEDURE TO "D:\ROA\ROAFACTURARE\COMUN\utile\Teste\facturare_unificat\lib_comparatie_documente.prg" ADDITIVE
|
||||
|
||||
LOCAL nFail
|
||||
nFail = CompDoc('SSS', 654, 'SSS', 656, 'S6-2 comanda v1(654) vs v2(656)')
|
||||
DO Assert WITH nFail >= 0, 'CompDoc a rulat fara eroare Oracle, esecuri raportate=' + TRANSFORM(nFail)
|
||||
DO CLog WITH 'CompDoc esecuri totale=' + TRANSFORM(nFail)
|
||||
|
||||
LOCAL nId1, nId2, lnQ
|
||||
nId1 = CdocGasesteIdVanzare('SSS', 654)
|
||||
nId2 = CdocGasesteIdVanzare('SSS', 656)
|
||||
DO Assert WITH nId1 = 1113, 'jonctiune serie_act+nract gaseste id_vanzare pt SSS 654, e=' + TRANSFORM(nId1)
|
||||
DO Assert WITH nId2 = 1114, 'jonctiune serie_act+nract gaseste id_vanzare pt SSS 656, e=' + TRANSFORM(nId2)
|
||||
|
||||
IF nId1 > 0 AND nId2 > 0
|
||||
lnQ = goExecutor.oExecute([select id_vanzare, tip, in_valuta, id_valuta, multiplicator, ] + ;
|
||||
[discount_evidentiat, tva_incasare, nvl(tip_factura,0) as tip_factura, nvl(tip_saft,0) as tip_saft, ] + ;
|
||||
[nvl(coeficient_k,0) as coeficient_k from vanzari where id_vanzare in (] + TRANSFORM(nId1) + [,] + TRANSFORM(nId2) + [)], 'crsCfg')
|
||||
IF lnQ < 0 OR RECCOUNT('crsCfg') <> 2
|
||||
DO Assert WITH .F., 'citire campuri de configuratie din VANZARI (Reccount asteptat 2)'
|
||||
ELSE
|
||||
LOCAL lnTip1, lnTip2, lnInVal1, lnInVal2, lnIdVal1, lnIdVal2, lnMul1, lnMul2, lnDisc1, lnDisc2
|
||||
LOCAL lnTvaInc1, lnTvaInc2, lnTipFact1, lnTipFact2, lnTipSaft1, lnTipSaft2, lnCoef1, lnCoef2
|
||||
SELECT crsCfg
|
||||
LOCATE FOR id_vanzare = nId1
|
||||
lnTip1 = tip
|
||||
lnInVal1 = in_valuta
|
||||
lnIdVal1 = id_valuta
|
||||
lnMul1 = multiplicator
|
||||
lnDisc1 = discount_evidentiat
|
||||
lnTvaInc1 = tva_incasare
|
||||
lnTipFact1 = tip_factura
|
||||
lnTipSaft1 = tip_saft
|
||||
lnCoef1 = coeficient_k
|
||||
LOCATE FOR id_vanzare = nId2
|
||||
lnTip2 = tip
|
||||
lnInVal2 = in_valuta
|
||||
lnIdVal2 = id_valuta
|
||||
lnMul2 = multiplicator
|
||||
lnDisc2 = discount_evidentiat
|
||||
lnTvaInc2 = tva_incasare
|
||||
lnTipFact2 = tip_factura
|
||||
lnTipSaft2 = tip_saft
|
||||
lnCoef2 = coeficient_k
|
||||
USE IN crsCfg
|
||||
|
||||
DO Assert WITH lnTip1 = lnTip2, 'VANZARI.TIP identic v1=' + TRANSFORM(lnTip1) + ' v2=' + TRANSFORM(lnTip2)
|
||||
DO Assert WITH lnInVal1 = lnInVal2, 'IN_VALUTA identic v1=' + TRANSFORM(lnInVal1) + ' v2=' + TRANSFORM(lnInVal2)
|
||||
DO Assert WITH lnIdVal1 = lnIdVal2, 'ID_VALUTA identic v1=' + TRANSFORM(lnIdVal1) + ' v2=' + TRANSFORM(lnIdVal2)
|
||||
DO Assert WITH lnMul1 = lnMul2, 'MULTIPLICATOR identic v1=' + TRANSFORM(lnMul1) + ' v2=' + TRANSFORM(lnMul2)
|
||||
DO Assert WITH lnDisc1 = lnDisc2, 'DISCOUNT_EVIDENTIAT identic v1=' + TRANSFORM(lnDisc1) + ' v2=' + TRANSFORM(lnDisc2)
|
||||
DO Assert WITH lnTvaInc1 = lnTvaInc2, 'TVA_INCASARE identic v1=' + TRANSFORM(lnTvaInc1) + ' v2=' + TRANSFORM(lnTvaInc2)
|
||||
DO Assert WITH lnTipFact1 = lnTipFact2, 'TIP_FACTURA identic v1=' + TRANSFORM(lnTipFact1) + ' v2=' + TRANSFORM(lnTipFact2)
|
||||
DO Assert WITH lnTipSaft1 = lnTipSaft2, 'TIP_SAFT identic v1=' + TRANSFORM(lnTipSaft1) + ' v2=' + TRANSFORM(lnTipSaft2)
|
||||
DO Assert WITH lnCoef1 = lnCoef2, 'COEFICIENT_K identic v1=' + TRANSFORM(lnCoef1) + ' v2=' + TRANSFORM(lnCoef2)
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
DO CFinal
|
||||
|
||||
CATCH TO loExc
|
||||
DO CLog WITH 'CATCH TOP-LEVEL ErrorNo=' + TRANSFORM(loExc.ErrorNo) + ' Message=' + loExc.Message + ;
|
||||
' Proc=' + loExc.Procedure + ' Line=' + TRANSFORM(loExc.LineNo)
|
||||
DO CFinal
|
||||
ENDTRY
|
||||
|
||||
QUIT
|
||||
|
||||
PROCEDURE Assert
|
||||
LPARAMETERS tlCond, tcMsg
|
||||
IF tlCond
|
||||
gnPass = gnPass + 1
|
||||
DO CLog WITH 'PASS: ' + tcMsg
|
||||
ELSE
|
||||
gnFail = gnFail + 1
|
||||
DO CLog WITH 'FAIL: ' + tcMsg
|
||||
ENDIF
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE CLog
|
||||
LPARAMETERS tcMsg
|
||||
STRTOFILE(tcMsg + CHR(13) + CHR(10), gcLog, 1)
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE CFinal
|
||||
DO CLog WITH 'TOTAL pass=' + TRANSFORM(gnPass) + ' fail=' + TRANSFORM(gnFail)
|
||||
DO CLog WITH 'END ' + TTOC(DATETIME())
|
||||
QUIT
|
||||
ENDPROC
|
||||
Reference in New Issue
Block a user