#6 editare factura emisa: S4 runda 3 completa (pagina de articole editabila)

frm_modific2024, pgfArticole.PAGE3 - editare in memorie, fara scriere in Oracle
(aceea ramane S5).

- sub-blocul A: cantitate/pret/pret_cu_tva editabile inline, marcaj lmodificat
  pe linie, coloana valoare pe linie
- sub-blocul B: stergere logica de linii (sters/DynamicForeColor gri) si adaugare
  de linii prin frm_articol_factura, cu alegerea articolului prin caut_articol()
- sub-blocul C: bara de totaluri sub grid (total linii convertit RON la cursul
  documentului, discount de antet editabil, total net), ascunsa pe
  transfer/custodie; verdict de corelatie ACT/RUL informativ, cu 3 stari
- suma ACT: sold net debit-credit, cont pe tip de document (4111 / 418 / 461,
  iar pe rate/contract 4111, 411 sau 461)
- suma RUL: doar ID_TIP_RULAJ = 0, adica miscarile reale; perechile
  ID_TIP_RULAJ = 3 sunt virtuale (tin locul procesului verbal de schimbare de
  pret) si nu intra in suma. Corectie cu liniile nestocate, marcata "ajustat"
- adaugarea de linii pe document in valuta: dialogul primeste tip_valuta si
  cursul documentului de pe tvanz, deci pretul se introduce direct in valuta;
  ofacturare.vc2 ramane neatins
- cei 5 apelanti frm_modific2024 (afisjurcom, anaf_efactura, cele doua .sc2 de
  import) pregatesc cursorul de articole inainte de Createobject, gardat pe
  SET PROCEDURE - registrul jurnal din ROACONT/ROAGEST ramane neschimbat

Teste headless pe MARIUSM_AUTO, suite care isi descopera singure documentele:
test_page3_articole 14/2 (cele 2 = artefact de grid nematerializat headless,
acoperit pe ecran), test_incarca_vanzare_din_nota 5/0,
test_adauga_linie_articol 20/0, test_adauga_linie_valuta 16/0,
test_ui_sterge_linie 8/0, test_verdict_act_rul 26/0.

docs/todos.txt: punctele 13 si 20, scrise de Marius.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SN8snvkk94KuhWwoXUUey3
This commit is contained in:
2026-08-09 20:48:42 +03:00
parent 13b4f65723
commit b9eba29ebe
26 changed files with 3310 additions and 172 deletions

View File

@@ -150,7 +150,7 @@ DEFINE CLASS frm_borderou_facturi AS _frmbase OF "_frm_base.vcx"
ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
Anchor = 6, ;
Caption = "Marcheaz<61> \<trimis", ;
Caption = "Marcheaz<61> \<trimis", ;
ForeColor = 0,128,0, ;
Height = 27, ;
Left = 140, ;
@@ -1334,7 +1334,6 @@ DEFINE CLASS frm_facturi AS _frmbase OF "_frm_base.vcx"
*< OBJECTDATA: ObjPath="But_attach1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_editare1" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: do_editare_factura
@@ -1352,7 +1351,7 @@ DEFINE CLASS frm_facturi AS _frmbase OF "_frm_base.vcx"
*<PropValue>
BorderStyle = 1
cbuton2 = but_listare1;but_listare2;But_listare3
cbuton3 = but_modifica1;but_modifica2;But_editare1
cbuton3 = but_modifica1;but_modifica2
cfiltru_initial =
cgridsortlist = grid_facturi,grid_detalii
DoCreate = .T.
@@ -1412,17 +1411,6 @@ DEFINE CLASS frm_facturi AS _frmbase OF "_frm_base.vcx"
Visible = .F.
*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_editare1' AS but_modifica WITH ;
Anchor = 12, ;
caction = do_editare_factura, ;
Caption = "", ;
Left = 650, ;
Name = "But_editare1", ;
TabIndex = 29, ;
ToolTipText = "Editare factura (articole, cantitati, preturi)", ;
Top = 341
*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_listare1' AS but_listare WITH ;
Anchor = 8, ;
Left = 698, ;
@@ -3484,7 +3472,7 @@ DEFINE CLASS frm_facturi AS _frmbase OF "_frm_base.vcx"
Anchor = 12, ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Total <20>n valuta", ;
Caption = "Total <20>n valuta", ;
FontSize = 10, ;
Height = 18, ;
Left = 311, ;
@@ -3798,6 +3786,12 @@ DEFINE CLASS frm_facturi AS _frmbase OF "_frm_base.vcx"
Select a.*, Iif(Nvl(id_jtva_coloana,0)=0,0,1) As cu_Tva From tact a Into Cursor tact Readwrite
update_jtva_coloane("", "crsJtvaTemp", 0)
*!* articolele se incarca ACUM, inainte de Createobject - grid-ul din pagina 3
*!* se leaga o singura data, la construire, pe cursorul deja plin
IncarcaArticoleFactura(m.lnIdVanzare, 'crsArticoleFactura')
Select tact
Omodif = Createobject([frm_modific2024], lnIdSet)
Omodif.Show()
@@ -3858,6 +3852,12 @@ DEFINE CLASS frm_facturi AS _frmbase OF "_frm_base.vcx"
If Used('trul_obinv')
Use In trul_obinv
Endif
If Used('crsJtvaTemp')
Use In crsJtvaTemp
Endif
If Used('crsArticoleFactura')
Use In crsArticoleFactura
Endif
Endif
Select crsfacturi
@@ -4919,7 +4919,18 @@ DEFINE CLASS frm_facturi AS _frmbase OF "_frm_base.vcx"
Do verificare_parteneri With m.lcXMLParteneri, m.llValidare, m.llMFIN, m.llVerificarePlatitorTVA, m.llAutoVerificare, m.llDontCloseCursor, m.llExperimental, m.llServiciuWebANAF
USE IN (SELECT('crsCoduriFiscale'))
USE IN (SELECT('crsCoduriFiscale'))
ENDPROC
PROCEDURE inainte_de_do_modifica
Local lnOptiune
lnOptiune = xmenu('Modificare \<date factura;Editare \<factura (articole, cantitati, preturi)')
Do Case
Case lnOptiune = 1
This.do_modifica()
Case lnOptiune = 2
This.do_editare_factura()
Endcase
ENDPROC
PROCEDURE Init
@@ -5145,7 +5156,7 @@ DEFINE CLASS frm_modifica_articol_factura AS frm_termin_renunt OF "_frm_child.vc
_shape2.Top = 0
_shape2.Width = 64
_shape2.ZOrderSet = 2
Lb_titlu_alb_b121.Caption = "Modific<69> explica<63>ie articol"
Lb_titlu_alb_b121.Caption = "Modific<69> explica<63>ie articol"
Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
Lb_titlu_alb_b121.TabIndex = 5
Lb_titlu_alb_b121.ZOrderSet = 3
@@ -5203,7 +5214,7 @@ DEFINE CLASS frm_modifica_articol_factura AS frm_termin_renunt OF "_frm_child.vc
_edbase1.Name = "_edbase1", ;
_edbase1.Top = 23, ;
_edbase1.Width = 325, ;
_lbbase1.Caption = "Explica<63>ie", ;
_lbbase1.Caption = "Explica<63>ie", ;
_lbbase1.Name = "_lbbase1"
*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
@@ -5437,7 +5448,7 @@ DEFINE CLASS frm_modifica_factura AS frm_termin_renunt OF "_frm_child.vcx"
Text_simplu1.Name = "Text_simplu1", ;
Text_simplu1.Top = 3, ;
Text_simplu1.Width = 177, ;
Lb_simplu1.Caption = "Data <20>i ora expedierii", ;
Lb_simplu1.Caption = "Data <20>i ora expedierii", ;
Lb_simplu1.Name = "Lb_simplu1"
*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
@@ -5487,7 +5498,7 @@ DEFINE CLASS frm_modifica_factura AS frm_termin_renunt OF "_frm_child.vcx"
Top = 128, ;
ZOrderSet = 9, ;
img_cautare.Name = "img_cautare", ;
clb_tx_cautare.Lb_simplu1.Caption = "Ma<4D>ina", ;
clb_tx_cautare.Lb_simplu1.Caption = "Ma<4D>ina", ;
clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
clb_tx_cautare.Name = "clb_tx_cautare", ;
clb_tx_cautare.Text_simplu1.Left = 133, ;
@@ -6977,7 +6988,7 @@ DEFINE CLASS frm_proforme AS _frmbase OF "_frm_base.vcx"
Anchor = 12, ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Total <20>n valuta", ;
Caption = "Total <20>n valuta", ;
FontSize = 10, ;
Height = 18, ;
Left = 311, ;
@@ -7009,7 +7020,7 @@ DEFINE CLASS frm_proforme AS _frmbase OF "_frm_base.vcx"
OPTION1.Top = 5, ;
OPTION1.Value = 1, ;
OPTION2.AutoSize = .T., ;
OPTION2.Caption = "<22>n valuta", ;
OPTION2.Caption = "<22>n valuta", ;
OPTION2.FontCharSet = 238, ;
OPTION2.FontSize = 10, ;
OPTION2.Left = 55, ;
@@ -7017,7 +7028,7 @@ DEFINE CLASS frm_proforme AS _frmbase OF "_frm_base.vcx"
OPTION2.Top = 5, ;
Option3.AutoSize = .T., ;
Option3.BackStyle = 0, ;
Option3.Caption = "<22>n RON", ;
Option3.Caption = "<22>n RON", ;
Option3.FontCharSet = 238, ;
Option3.FontSize = 10, ;
Option3.Height = 18, ;
@@ -7048,7 +7059,7 @@ DEFINE CLASS frm_proforme AS _frmbase OF "_frm_base.vcx"
OPTION1.Top = 5, ;
OPTION1.Value = 0, ;
OPTION2.AutoSize = .T., ;
OPTION2.Caption = "<22>terse", ;
OPTION2.Caption = "<22>terse", ;
OPTION2.FontCharSet = 238, ;
OPTION2.FontSize = 10, ;
OPTION2.ForeColor = 255,0,0, ;
@@ -7057,7 +7068,7 @@ DEFINE CLASS frm_proforme AS _frmbase OF "_frm_base.vcx"
OPTION2.Top = 5, ;
Option3.AutoSize = .T., ;
Option3.BackStyle = 0, ;
Option3.Caption = "Ne<4E>terse", ;
Option3.Caption = "Ne<4E>terse", ;
Option3.FontCharSet = 238, ;
Option3.FontSize = 10, ;
Option3.Height = 18, ;