#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:
62
utile/Teste/editare_factura/probe_s9_4_fdoc.prg
Normal file
62
utile/Teste/editare_factura/probe_s9_4_fdoc.prg
Normal file
@@ -0,0 +1,62 @@
|
||||
* probe_s9_4_fdoc.prg - READ-ONLY: id_fdoc e uniform pe randurile vact_tot ale unui document?
|
||||
* Extractia din StergeDocumentFacturare ia primul rand (GO top, order by id_act), nu max().
|
||||
SET SAFETY OFF
|
||||
SET TALK OFF
|
||||
PUBLIC gcErrLog
|
||||
gcErrLog = 'D:\ROA\ROAFACTURARE\COMUN\utile\Teste\editare_factura\probe_s9_4_fdoc_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
|
||||
QUIT
|
||||
ENDIF
|
||||
|
||||
*!* randurile documentului vechi 1071 (cod 1141096), in ordinea pe care o vede actactan
|
||||
DO Lista WITH 'vact_tot cod 1141096 (doc vechi 1071), order by id_act - primul rand e cel citit', ;
|
||||
[select id_act, id_fdoc, id_set, dataireg from ] + gcs + [.vact_tot ] + ;
|
||||
[where an = 2026 and luna = 8 and cod = 1141096 order by id_act]
|
||||
|
||||
DO Lista WITH 'vact_tot pentru documentul nou 1138', ;
|
||||
[select a.id_act, a.id_fdoc, a.dataireg from ] + gcs + [.vact_tot a, vanzari v ] + ;
|
||||
[where v.id_vanzare = 1138 and a.cod = v.cod and a.sters = 0 order by a.id_act]
|
||||
|
||||
*!* cat de des e id_fdoc neuniform in interiorul unui document
|
||||
DO Lista WITH 'documente cu id_fdoc NEUNIFORM pe perioada activa', ;
|
||||
[select count(*) as documente_neuniforme from (] + ;
|
||||
[select cod from ] + gcs + [.vact_tot where sters = 0 and an = 2026 and luna = 8 ] + ;
|
||||
[group by cod having count(distinct id_fdoc) > 1)]
|
||||
|
||||
DO Lista WITH 'total documente distincte in vact_tot pe perioada activa', ;
|
||||
[select count(distinct cod) as total from ] + gcs + [.vact_tot where sters = 0 and an = 2026 and luna = 8]
|
||||
|
||||
STRTOFILE('end' + CHR(13) + CHR(10), gcErrLog, 1)
|
||||
QUIT
|
||||
|
||||
PROCEDURE Lista
|
||||
LPARAMETERS tcTitlu, tcSql
|
||||
LOCAL lnOk, lnI, lcL
|
||||
IF USED('v_q')
|
||||
USE IN v_q
|
||||
ENDIF
|
||||
lnOk = goExecutor.oExecuta(tcSql, 'v_q')
|
||||
IF !lnOk
|
||||
STRTOFILE('--- ' + tcTitlu + ': EROARE ' + goExecutor.cEroare + CHR(13) + CHR(10), gcErrLog, 1)
|
||||
RETURN
|
||||
ENDIF
|
||||
SELECT v_q
|
||||
STRTOFILE('--- ' + tcTitlu + ': ' + TRANSFORM(RECCOUNT('v_q')) + ' randuri' + CHR(13) + CHR(10), gcErrLog, 1)
|
||||
SCAN WHILE RECNO() <= 20
|
||||
lcL = ''
|
||||
FOR lnI = 1 TO FCOUNT('v_q')
|
||||
lcL = lcL + ALLTRIM(FIELD(lnI, 'v_q')) + '=' + ALLTRIM(TRANSFORM(EVALUATE(FIELD(lnI, 'v_q')))) + ' '
|
||||
ENDFOR
|
||||
STRTOFILE(' ' + lcL + CHR(13) + CHR(10), gcErrLog, 1)
|
||||
ENDSCAN
|
||||
USE IN v_q
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE test_error_handler
|
||||
LPARAMETERS tnError, tcMessage, tcProgram, tnLineNo
|
||||
STRTOFILE('EROARE ' + TRANSFORM(tnError) + ' [' + tcProgram + ':' + TRANSFORM(tnLineNo) + '] ' + tcMessage + CHR(13) + CHR(10), gcErrLog, 1)
|
||||
ENDPROC
|
||||
Reference in New Issue
Block a user