Registratura: adaugare/editare fara erori la partener NULL, lista doar ultimul document, fonturi Arial 10 (M1-M5)
M1 modifica_reg_dg: garda id_part NULL/empty (mesaj + Return .F.), NVL pe id_part/nr_pag, functia intoarce succes. M2 validare partener in toate cele 3 puncte de salvare, INAINTE de blocarea campurilor (Command2.Click salveaza inainte sa blocheze; bara laterala si Page3.Deactivate nu mai salveaza/prompteaza cu partener NULL). M3 do_adauga: documentul nou intra direct in editare (llock=.F., focus cmdDenumire); eliminat mesajul fals "Toate modificarile au efect imediat!". M4 viz_registratura + do_cauta: filtru initial "doar ultimul document" (subquery max(id_reg)); fara criterii de cautare se pastreaza filtrul, nu se incarca toata baza. M5 fonturi: eliminate 154 suprascrieri "Arial Narrow" si rebazate 96 controale baseclass pe COMUN _baza.vcx (textbox/label/checkbox/commandbutton/optiongroup); Init de grid propaga fontul la coloane si headere (fara asta raman Arial 9 - verificat empiric). Teste: harness headless (init env dedicat, form, adaugare+editare cu verificare in baza) + test UI vizual cu screenshots pe fluxul real (19 PASS / 0 FAIL). Diff-uri de audit in docs/diff_runda1_*.patch. M6 (build EXE) BLOCAT headless: roaRegistratura.pjx refera 48 fisiere hardcodate pe "c:\program files\...\vfp 9" (masina 32-bit din 2021) + COMUN\utile\hpdf\ReportOutput\ctl32_progressbar.vcx redenumit _old; necesita repathing o data in VFP9 IDE. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018H9za5A9Tk6wcLFof6seds
This commit is contained in:
111
Teste/test_registratura_form.prg
Normal file
111
Teste/test_registratura_form.prg
Normal file
@@ -0,0 +1,111 @@
|
||||
* test_registratura_form.prg
|
||||
* Test headless: incarcarea listei documentelor (viz_registratura) + instantierea
|
||||
* containerului ct_registratura pe un form ascuns (verifica clase/cursoare/grid).
|
||||
* Rulare: vfp9.exe -A -T "D:\ROA\ROAREGISTRATURA\Teste\test_registratura_form.prg"
|
||||
* Log: D:\ROA\ROAREGISTRATURA\Teste\log_test_form.txt
|
||||
|
||||
SET SAFETY OFF
|
||||
SET TALK OFF
|
||||
|
||||
* mock amessagebox PRIMUL in lista de proceduri (la nume duplicat castiga PRIMUL - testare-ui-vfp.md cap. j)
|
||||
SET PROCEDURE TO D:\ROA\ROAREGISTRATURA\COMUN\utile\Teste\mock_amessagebox.prg ADDITIVE
|
||||
PUBLIC gnMockRaspuns
|
||||
gnMockRaspuns = 6
|
||||
|
||||
PUBLIC gcTestLog
|
||||
gcTestLog = 'D:\ROA\ROAREGISTRATURA\Teste\log_test_form.txt'
|
||||
STRTOFILE('=== test_registratura_form ' + TTOC(DATETIME()) + CHR(13)+CHR(10), gcTestLog)
|
||||
|
||||
ON ERROR DO tlog WITH '*** EROARE ' + TRANSFORM(ERROR()) + ': ' + MESSAGE() + ;
|
||||
' | ' + MESSAGE(1) + ' | prg=' + PROGRAM() + ' lin=' + TRANSFORM(LINENO())
|
||||
|
||||
DO tlog WITH 'Init mediu...'
|
||||
DO D:\ROA\ROAREGISTRATURA\Teste\test_init_env_registratura.prg
|
||||
IF TYPE('gnHandle') # 'N' OR gnHandle <= 0
|
||||
DO tlog WITH 'ESEC conectare (gnHandle=' + TRANSFORM(IIF(TYPE('gnHandle')='N',gnHandle,-999)) + ') - STOP'
|
||||
DO tfinal
|
||||
ENDIF
|
||||
DO tlog WITH 'Conectat, gnHandle=' + TRANSFORM(gnHandle) + ' schema=' + gcS
|
||||
|
||||
* 1) incarcarea cursorului listei
|
||||
DO tlog WITH '--- Test 1: viz_registratura'
|
||||
DO viz_registratura IN oproceduri_roaregistratura.prg
|
||||
IF USED('cRegistratura')
|
||||
SELECT cRegistratura
|
||||
DO tlog WITH 'OK cursor cRegistratura, inregistrari=' + TRANSFORM(RECCOUNT())
|
||||
IF RECCOUNT() > 0
|
||||
GO BOTTOM
|
||||
DO tlog WITH 'Ultimul document: id_reg=' + TRANSFORM(NVL(id_reg,0)) + ;
|
||||
' nr_intern=' + TRANSFORM(NVL(numar_intern,'')) + ;
|
||||
' data_intern=' + TRANSFORM(data_intern) + ;
|
||||
' partener=' + TRANSFORM(NVL(denumire,''))
|
||||
GO TOP
|
||||
SCATTER NAME goRegistratura MEMO
|
||||
ELSE
|
||||
SCATTER NAME goRegistratura MEMO BLANK
|
||||
ENDIF
|
||||
ELSE
|
||||
DO tlog WITH 'ESEC: cursorul cRegistratura NU exista'
|
||||
ENDIF
|
||||
|
||||
* 2) instantierea containerului listei pe un form ascuns
|
||||
DO tlog WITH '--- Test 2: instantiere ct_registratura pe form ascuns'
|
||||
LOCAL loForm
|
||||
loForm = CREATEOBJECT('Form')
|
||||
loForm.Visible = .F.
|
||||
loForm.Width = 810
|
||||
loForm.Height = 420
|
||||
loForm.AddObject('ct1', 'ct_registratura')
|
||||
IF VARTYPE(loForm.ct1) = 'O'
|
||||
DO tlog WITH 'OK ct_registratura instantiat; grid RecordSource=' + ;
|
||||
loForm.ct1.grid_registratura.RecordSource + ;
|
||||
' coloane=' + TRANSFORM(loForm.ct1.grid_registratura.ColumnCount) + ;
|
||||
' font=' + loForm.ct1.grid_registratura.FontName + ;
|
||||
' size=' + TRANSFORM(loForm.ct1.grid_registratura.FontSize)
|
||||
DO tlog WITH 'Coloana1: font=' + loForm.ct1.grid_registratura.Columns(1).FontName + ;
|
||||
' ' + TRANSFORM(loForm.ct1.grid_registratura.Columns(1).FontSize) + ;
|
||||
' | header=' + loForm.ct1.grid_registratura.Columns(1).Header1.FontName + ;
|
||||
' ' + TRANSFORM(loForm.ct1.grid_registratura.Columns(1).Header1.FontSize) + ;
|
||||
' | text1=' + loForm.ct1.grid_registratura.Columns(1).Text1.FontName + ;
|
||||
' ' + TRANSFORM(loForm.ct1.grid_registratura.Columns(1).Text1.FontSize)
|
||||
loForm.ct1.Visible = .T.
|
||||
DO tlog WITH 'nireg (contor afisat)=' + TRANSFORM(loForm.ct1.nireg)
|
||||
ELSE
|
||||
DO tlog WITH 'ESEC: ct_registratura NU s-a instantiat'
|
||||
ENDIF
|
||||
loForm.Release()
|
||||
|
||||
* 3) instantierea zonei partener/nr/data (ct_part_nr_data)
|
||||
DO tlog WITH '--- Test 3: instantiere ct_part_nr_data'
|
||||
loForm = CREATEOBJECT('Form')
|
||||
loForm.Visible = .F.
|
||||
loForm.AddObject('ct2', 'ct_part_nr_data')
|
||||
IF VARTYPE(loForm.ct2) = 'O'
|
||||
DO tlog WITH 'OK ct_part_nr_data; llock=' + TRANSFORM(loForm.ct2.llock) + ;
|
||||
' buton="' + loForm.ct2.Command2.Caption + '"' + ;
|
||||
' txtClient.ReadOnly=' + TRANSFORM(loForm.ct2.txtClient.ReadOnly) + ;
|
||||
' font txtClient=' + loForm.ct2.txtClient.FontName + ;
|
||||
' ' + TRANSFORM(loForm.ct2.txtClient.FontSize)
|
||||
* deblocare/blocare campuri - nu ating baza
|
||||
loForm.ct2.deblocheaza_campuri()
|
||||
DO tlog WITH 'dupa deblocheaza_campuri: txtNumar.ReadOnly=' + TRANSFORM(loForm.ct2.txtNumar.ReadOnly)
|
||||
loForm.ct2.blocheaza_campuri()
|
||||
DO tlog WITH 'dupa blocheaza_campuri: txtNumar.ReadOnly=' + TRANSFORM(loForm.ct2.txtNumar.ReadOnly)
|
||||
ELSE
|
||||
DO tlog WITH 'ESEC: ct_part_nr_data NU s-a instantiat'
|
||||
ENDIF
|
||||
loForm.Release()
|
||||
|
||||
DO tlog WITH '=== FINAL test_registratura_form'
|
||||
DO tfinal
|
||||
|
||||
PROCEDURE tlog
|
||||
LPARAMETERS tcMsg
|
||||
STRTOFILE(TRANSFORM(tcMsg) + CHR(13)+CHR(10), gcTestLog, 1)
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE tfinal
|
||||
ON ERROR
|
||||
CLOSE ALL
|
||||
QUIT
|
||||
ENDPROC
|
||||
Reference in New Issue
Block a user