Files
comun/utile/Teste/editare_factura/probe_s9_4_fidelitate.prg
Marius Mutu 8e022d332e #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
2026-09-09 21:38:25 +03:00

71 lines
3.1 KiB
Plaintext

* probe_s9_4_fidelitate.prg - READ-ONLY: ID_FDOC si DATAIREG sunt ajungibile din cursorul pe care
* piciorul de stergere il citeste deja (actactan = select * from vact_tot)? Si ce valori au?
SET SAFETY OFF
SET TALK OFF
PUBLIC gcErrLog
gcErrLog = 'D:\ROA\ROAFACTURARE\COMUN\utile\Teste\editare_factura\probe_s9_4_fidelitate_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
gnIdUtil = 8
*!* 1. coloanele view-ului din care se umple actactan
DO Lista WITH 'coloane VACT_TOT care ne intereseaza', ;
[select column_name, data_type from all_tab_columns where owner = 'MARIUSM_AUTO' ] + ;
[and table_name = 'VACT_TOT' and column_name in ('ID_FDOC','DATAIREG','ID_SET','ID_FACT','ID_FACTD','COD','AN','LUNA') ] + ;
[order by column_name]
*!* 2. exista ID_FDOC pe VANZARI? (alta sursa posibila pentru valoarea documentului vechi)
DO Lista WITH 'cate randuri vact_tot au id_fdoc nenul, pe perioada activa', ;
[select count(*) as total, sum(case when id_fdoc is null then 1 else 0 end) as nule, ] + ;
[sum(case when id_fdoc is not null then 1 else 0 end) as nenule ] + ;
[from ] + gcs + [.vact_tot where sters = 0 and an = 2026 and luna = 8]
*!* 3. valorile reale pentru documentele de test (exact ce ar citi actactan)
DO Lista WITH 'vact_tot pentru codurile de test (1141095=doc 1070, 1140912=doc 1056)', ;
[select cod, id_set, id_fdoc, id_fact, dataireg from ] + gcs + [.vact_tot ] + ;
[where sters = 0 and an = 2026 and luna = 8 and cod in (1141095, 1140912) order by cod, id_act]
*!* 4. cate randuri din vact_tot au dataireg diferita de data_act a documentului
DO Lista WITH 'dataireg vs data_act pe perioada activa (cate difera)', ;
[select count(*) as total, ] + ;
[sum(case when trunc(a.dataireg) = trunc(v.data_act) then 1 else 0 end) as egale, ] + ;
[sum(case when trunc(a.dataireg) <> trunc(v.data_act) then 1 else 0 end) as diferite ] + ;
[from ] + gcs + [.vact_tot a, vanzari v ] + ;
[where a.sters = 0 and a.an = 2026 and a.luna = 8 and v.sters = 0 and v.cod = a.cod]
STRTOFILE('end' + CHR(13) + CHR(10), gcErrLog, 1)
QUIT
PROCEDURE Lista
LPARAMETERS tcTitlu, tcSql
LOCAL lnOk, lnI, lcL
IF USED('v_f')
USE IN v_f
ENDIF
lnOk = goExecutor.oExecuta(tcSql, 'v_f')
IF !lnOk
STRTOFILE('--- ' + tcTitlu + ': EROARE ' + goExecutor.cEroare + CHR(13) + CHR(10), gcErrLog, 1)
RETURN
ENDIF
SELECT v_f
STRTOFILE('--- ' + tcTitlu + ': ' + TRANSFORM(RECCOUNT('v_f')) + ' randuri' + CHR(13) + CHR(10), gcErrLog, 1)
SCAN WHILE RECNO() <= 20
lcL = ''
FOR lnI = 1 TO FCOUNT('v_f')
lcL = lcL + ALLTRIM(FIELD(lnI, 'v_f')) + '=' + ALLTRIM(TRANSFORM(EVALUATE(FIELD(lnI, 'v_f')))) + ' '
ENDFOR
STRTOFILE(' ' + lcL + CHR(13) + CHR(10), gcErrLog, 1)
ENDSCAN
USE IN v_f
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