Plati la buget din importul de extrase: recunoastere dupa IBAN Trezorerie (TVA 4423, CAM 436, cont unic defalcat din frm_modific2024)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBKZQUq6vimKuAFsrS2D1s
This commit is contained in:
@@ -1675,7 +1675,7 @@ DEFINE CLASS form1 AS form
|
||||
Select actactan_temp
|
||||
IF USED('actactan')
|
||||
* actactan_temp are structura vact (SELECT * FROM vact WHERE 1=2), un camp nou pe actactan nu supravietuieste acestui Append From Dbf - salvez randurile marcate intr-un cursor paralel, cheie pe pozitia in randurile nesterse (Recno() nu coincide cu pozitia din tact dupa un DELETE fara PACK)
|
||||
IF Type('actactan.listoric') = 'L' OR Type('actactan.dublura') = 'L' OR Type('actactan.ngrupa') = 'N'
|
||||
IF Type('actactan.listoric') = 'L' OR Type('actactan.dublura') = 'L' OR Type('actactan.ngrupa') = 'N' OR Type('actactan.cbuget') = 'C'
|
||||
lnSeqMarcaj = 0
|
||||
IF Type('actactan.listoric') = 'L'
|
||||
Create Cursor cIstoricMarcaj (nrseq N(6))
|
||||
@@ -1685,6 +1685,10 @@ DEFINE CLASS form1 AS form
|
||||
Create Cursor cDubluraMarcaj (nrseq N(6))
|
||||
Index On nrseq Tag nrseq
|
||||
ENDIF
|
||||
IF Type('actactan.cbuget') = 'C'
|
||||
Create Cursor cBugetMarcaj (nrseq N(6), cbuget C(3))
|
||||
Index On nrseq Tag nrseq
|
||||
ENDIF
|
||||
IF Type('actactan.ngrupa') = 'N'
|
||||
Create Cursor cGrupaMarcaj (nrseq N(6), ngrupa I, npoz I, csursa C(1))
|
||||
Index On nrseq Tag nrseq
|
||||
@@ -1698,6 +1702,9 @@ DEFINE CLASS form1 AS form
|
||||
IF Type('actactan.dublura') = 'L' AND dublura
|
||||
Insert Into cDubluraMarcaj (nrseq) Values (lnSeqMarcaj)
|
||||
ENDIF
|
||||
IF Type('actactan.cbuget') = 'C' AND !Empty(actactan.cbuget)
|
||||
Insert Into cBugetMarcaj (nrseq, cbuget) Values (lnSeqMarcaj, actactan.cbuget)
|
||||
ENDIF
|
||||
IF Type('actactan.ngrupa') = 'N' AND ngrupa > 0
|
||||
Insert Into cGrupaMarcaj (nrseq, ngrupa, npoz, csursa) Values (lnSeqMarcaj, actactan.ngrupa, actactan.npoz, actactan.csursa_f)
|
||||
ENDIF
|
||||
@@ -1707,7 +1714,7 @@ DEFINE CLASS form1 AS form
|
||||
Append From Dbf('actactan')
|
||||
ENDIF
|
||||
|
||||
Select .F. As ales, a.explicatia4 As iban, Iif(!Empty(Nvl(a.id_jtva_coloana, 0)), 1, 0) As Cu_tva, Cast(0 As N(2)) As tipnota, .F. As listoric, .F. As dublura, Cast(0 As I) As ngrupa, Cast(0 As I) As npoz, Space(1) As csursa_f, a.*, b.denumire As explicatie_tva_2 ;
|
||||
Select .F. As ales, a.explicatia4 As iban, Iif(!Empty(Nvl(a.id_jtva_coloana, 0)), 1, 0) As Cu_tva, Cast(0 As N(2)) As tipnota, .F. As listoric, .F. As dublura, Cast(0 As I) As ngrupa, Cast(0 As I) As npoz, Space(1) As csursa_f, Space(3) As cbuget, a.*, b.denumire As explicatie_tva_2 ;
|
||||
From actactan_temp a Left Join crsExplicatiiTVATemp b On a.id_jtva_coloana = b.id_jtva_coloana ;
|
||||
Into Cursor tact Readwrite
|
||||
|
||||
@@ -1729,6 +1736,15 @@ DEFINE CLASS form1 AS form
|
||||
Endscan
|
||||
Use In cDubluraMarcaj
|
||||
ENDIF
|
||||
IF Used('cBugetMarcaj')
|
||||
Select tact
|
||||
Scan
|
||||
If Seek(Recno(), 'cBugetMarcaj', 'nrseq')
|
||||
Replace cbuget With cBugetMarcaj.cbuget
|
||||
Endif
|
||||
Endscan
|
||||
Use In cBugetMarcaj
|
||||
ENDIF
|
||||
IF Used('cGrupaMarcaj')
|
||||
* renumerotare in ordinea din tact: grupele consecutive devin 1,2,3...
|
||||
lnGrupaNoua = 0
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
*!* marius.mutu
|
||||
*!* CreeazaNote/CompleteazaParteneriROA - la CUI-uri duplicate aleg partenerul cu facturi in perioada curenta, nu ultimul creat
|
||||
|
||||
*!* 15.09.2026
|
||||
*!* marius.mutu
|
||||
*!* CreeazaNote - plata la Trezorerie recunoscuta dupa IBAN (TVA 4423, CAM 436, cont unic defalcat din frm_modific2024)
|
||||
|
||||
*************************************
|
||||
* Clasa ImportNote este fabrica de clase tip Export
|
||||
*************************************
|
||||
@@ -358,7 +362,7 @@ Define Class ExtrasBanca As Custom
|
||||
Local lcCont, lcNumeValuta, lcValuta, ldDataIreg, llMonedaNationala, lnCurs, lnIdPartCoresp
|
||||
Local lnIdTipPart, lnIdValuta, lnSpecial, lnTipPersoana, loDate2, loValuta, llDocumentPereche
|
||||
Local lcRecc, lcRecno, lnRecno
|
||||
Local lcComanda, lcDenumire2, lcPartenerCasa, lcTip2, lnVariante, llExcludeOriginal
|
||||
Local lcAscdBuget, lcComanda, lcDenumire2, lcGrupaBuget, lcPartenerCasa, lcTip2, lnVariante, llExcludeOriginal
|
||||
Local lnDenumire, lnDocument, lnIdPartenerCasa, lnVariante, loPartener
|
||||
Local lcGrupIdLista, lcSqlGrup, lnIdPartAlternativ, lcPartAlternativ
|
||||
Local lcSqlIstoric, llIstoricOk, lcCheieTxt
|
||||
@@ -695,6 +699,7 @@ Define Class ExtrasBanca As Custom
|
||||
Scan
|
||||
lcContD = ""
|
||||
lcContC = ""
|
||||
lcAscdBuget = ""
|
||||
lnIdPartener = NVL(id_part,0)
|
||||
* Cheie invatata din istoric, doar cand CUI/denumire/IBAN nu au gasit partenerul (loop-ul anterior)
|
||||
If Empty(m.lnIdPartener)
|
||||
@@ -712,6 +717,11 @@ Define Class ExtrasBanca As Custom
|
||||
lcContPartener = ""
|
||||
lcTip = Alltrim(tip)
|
||||
lcTip2 = Alltrim(tip_2)
|
||||
lcGrupaBuget = Iif(m.llMonedaNationala And m.lcTip = 'D', GrupaBugetDinIban(iban), '')
|
||||
If !Empty(m.lcGrupaBuget)
|
||||
lcTip2 = This.cTipBuget
|
||||
Replace tip_2 With This.cTipBuget
|
||||
Endif
|
||||
|
||||
lcCodFiscal = Upper(Alltrim(cod_fiscal))
|
||||
lcDenumire = Upper(Alltrim(denumire))
|
||||
@@ -793,7 +803,10 @@ Define Class ExtrasBanca As Custom
|
||||
Case m.lcTip2 = This.cTipTerti && "TRF" && terti (clienti/furnizori)
|
||||
lcContD = "401"
|
||||
Case m.lcTip2 = This.cTipBuget && "BUG" && datorii la buget
|
||||
lcContD = "4481"
|
||||
lcContD = Icase(m.lcGrupaBuget = 'TVA', '4423', m.lcGrupaBuget = 'CAM', '436', '4481')
|
||||
If Inlist(m.lcGrupaBuget, 'TVA', 'CAM')
|
||||
lcAscdBuget = AnaliticBugetActiv(m.lcContD)
|
||||
Endif
|
||||
Case m.lcTip2 = This.cTipTransfer && "TRS" transfer intre conturi
|
||||
lcContD = "581"
|
||||
Case m.lcTip2 = This.cTipDepunere && "DEP" depunere/retragere numerar
|
||||
@@ -838,7 +851,7 @@ Define Class ExtrasBanca As Custom
|
||||
Endif
|
||||
|
||||
Select cActTemp
|
||||
Replace scd With m.lcContD, scc With m.lcContC, id_partd With m.lnIdPartD, id_partc With m.lnIdPartC, partd With m.lcPartD, partc With m.lcPartC
|
||||
Replace scd With m.lcContD, scc With m.lcContC, ascd With m.lcAscdBuget, id_partd With m.lnIdPartD, id_partc With m.lnIdPartC, partd With m.lcPartD, partc With m.lcPartC
|
||||
Replace id_valuta With m.lnIdValuta, nume_val With m.lcNumeValuta
|
||||
If !m.llMonedaNationala
|
||||
IF curs = 0
|
||||
@@ -999,6 +1012,7 @@ Define Class ExtrasBanca As Custom
|
||||
scd, scc, ascd, ascc, id_partd, id_partc, partd, partc, ;
|
||||
id_factd, id_factc, pereched, perechec, ;
|
||||
id_fdoc, fdoc, listoric, ngrupa, npoz, csursa_f, nordine, ;
|
||||
Cast(Iif(m.llMonedaNationala And Alltrim(tip) = 'D', GrupaBugetDinIban(iban), '') As C(3)) As cbuget, ;
|
||||
Cast(gnIdSucursala As N(5) Null) As id_sucursala, Space(200) As sucursala ;
|
||||
From cActTemp ;
|
||||
Order By Data, nordine ;
|
||||
@@ -1387,6 +1401,102 @@ Procedure ImparteRanduriFacturi
|
||||
Use In (Select('cAlocTemp'))
|
||||
Endproc
|
||||
|
||||
* --------------------------------------------------------------------
|
||||
* Solduri per cont/analitic pentru o grupa de buget (TVA/CAM/CU), in cDefalcare (cont, acont, denumire, sold, suma)
|
||||
* --------------------------------------------------------------------
|
||||
Function IncarcaDefalcareBuget
|
||||
Lparameters tcGrupa
|
||||
Local lcConturi, lcSql, llSucces
|
||||
|
||||
Do Case
|
||||
Case m.tcGrupa = 'TVA'
|
||||
lcConturi = "'4423'"
|
||||
Case m.tcGrupa = 'CAM'
|
||||
lcConturi = "'436'"
|
||||
Otherwise
|
||||
lcConturi = "'444','4315','4316','446','4411','4418','4481','447'"
|
||||
Endcase
|
||||
|
||||
If Used('cDefalcare')
|
||||
Use In (Select('cDefalcare'))
|
||||
Endif
|
||||
|
||||
lcSql = [select p.cont, ' ' as acont, p.explicaties as denumire, ] + ;
|
||||
[cast(nvl(vl.preccred,0) - nvl(vl.precdeb,0) as number(15,2)) as sold, cast(0 as number(15,2)) as suma ] + ;
|
||||
[from plcont p left join ] + ;
|
||||
[(select cont, sum(preccred) preccred, sum(precdeb) precdeb from vbal ] + ;
|
||||
[where an = ?gnAn and luna = ?gnLuna ] + m.gcCondSucursala + [ group by cont) vl ] + ;
|
||||
[on vl.cont = p.cont ] + ;
|
||||
[where p.inactiv = 0 and p.an = ?gnAn and p.cont in (] + m.lcConturi + [) ] + ;
|
||||
[and nvl(p.acont,' ') = ' ' and p.cont not in ] + ;
|
||||
[(select cont from plcont where inactiv = 0 and an = ?gnAn ] + ;
|
||||
[and cont in (] + m.lcConturi + [) and nvl(acont,' ') <> ' ') ] + ;
|
||||
[union all ] + ;
|
||||
[select p.cont, p.acont, p.explicaties as denumire, ] + ;
|
||||
[cast(nvl(vla.preccred,0) - nvl(vla.precdeb,0) as number(15,2)) as sold, cast(0 as number(15,2)) as suma ] + ;
|
||||
[from plcont p left join ] + ;
|
||||
[(select cont, acont, sum(preccred) preccred, sum(precdeb) precdeb from vbalana ] + ;
|
||||
[where an = ?gnAn and luna = ?gnLuna ] + m.gcCondSucursala + [ group by cont, acont) vla ] + ;
|
||||
[on vla.cont = p.cont and vla.acont = p.acont ] + ;
|
||||
[where p.inactiv = 0 and p.an = ?gnAn and p.cont in (] + m.lcConturi + [) ] + ;
|
||||
[and nvl(p.acont,' ') <> ' ' ] + ;
|
||||
[order by 1, 2]
|
||||
|
||||
llSucces = goExecutor.oExecuta(m.lcSql, 'cDefalcare')
|
||||
If !m.llSucces
|
||||
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, 'Eroare')
|
||||
Return .F.
|
||||
Endif
|
||||
|
||||
Select cDefalcare
|
||||
Replace All suma With Max(sold, 0)
|
||||
Go Top
|
||||
|
||||
Return .T.
|
||||
Endfunc
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
* Sparge randul tnRec din tact pe conturile/analiticele din cDefalcare cu suma <> 0
|
||||
* --------------------------------------------------------------------
|
||||
Procedure AplicaDefalcareBuget
|
||||
Lparameters tnRec, tcGrupa
|
||||
Local lnGrupa, lnPoz, loR, llCurataPartener
|
||||
|
||||
Select Max(ngrupa) As mgrupa From tact Into Cursor cMaxGrupaBuget
|
||||
lnGrupa = Nvl(cMaxGrupaBuget.mgrupa, 0) + 1
|
||||
Use In (Select('cMaxGrupaBuget'))
|
||||
|
||||
Select tact
|
||||
Try
|
||||
Go m.tnRec
|
||||
Catch
|
||||
Return
|
||||
Endtry
|
||||
Scatter Memo Name loR
|
||||
* contul debit al parintelui nu e cont de buget (ex. 401 recuperat) - partenerul debitului nu se mai aplica analiticelor de buget
|
||||
llCurataPartener = !Inlist(Alltrim(loR.scd), '4423', '436', '444', '4315', '4316', '446', '4411', '4418', '4481', '447')
|
||||
|
||||
lnPoz = 0
|
||||
Select cDefalcare
|
||||
Scan For suma <> 0
|
||||
lnPoz = m.lnPoz + 1
|
||||
Select tact
|
||||
If m.lnPoz > 1
|
||||
Append Blank
|
||||
Gather Memo Name loR
|
||||
Endif
|
||||
Replace scd With Alltrim(cDefalcare.cont), ascd With Alltrim(cDefalcare.acont), ;
|
||||
suma With cDefalcare.suma, ngrupa With m.lnGrupa, npoz With m.lnPoz, csursa_f With 'B'
|
||||
If !Empty(m.tcGrupa) And Empty(loR.cbuget)
|
||||
Replace cbuget With m.tcGrupa
|
||||
Endif
|
||||
If m.llCurataPartener
|
||||
Replace id_partd With 0, partd With ''
|
||||
Endif
|
||||
Select cDefalcare
|
||||
Endscan
|
||||
Endproc
|
||||
|
||||
|
||||
Define Class ExtrasBanca_MT940 As ExtrasBanca
|
||||
cDescription = 'clasa generica import extras MT940'
|
||||
@@ -3449,7 +3559,7 @@ Define Class ExtrasBanca_General As ExtrasBanca
|
||||
* tnTip: 1 (default) = lista tranzactii, 2 = extras de cont
|
||||
|
||||
Local mtextoriginal
|
||||
Local lcComerciant, lcDescriereFacturi, lcFacturi, lcLinie, lnLinie, lnLinii, lnResults
|
||||
Local lcComerciant, lcDescriereFacturi, lcFacturi, lcLinie, lnLinie, lnLinii, lnPozBuget, lnResults
|
||||
LOCAL mcf, mexplicatie, mfilestr, miban, mtert
|
||||
|
||||
lnLinii = Alines(This.aLinii, Filetostr(m.pselectedfile), 1)
|
||||
@@ -3566,8 +3676,10 @@ Define Class ExtrasBanca_General As ExtrasBanca
|
||||
Otherwise
|
||||
Replace tip_2 With ""
|
||||
Endcase
|
||||
mtert = ALLTRIM(syGETWORDNUM(m.mexplicatie, 3, ';'))
|
||||
miban = ALLTRIM(syGETWORDNUM(m.mexplicatie, 4, ';'))
|
||||
* platile la Trezorerie (referinta structurata /RFB/) au 3 campuri suplimentare inaintea tertului
|
||||
lnPozBuget = Iif(';/RFB/' $ m.mexplicatie, 3, 0)
|
||||
mtert = ALLTRIM(syGETWORDNUM(m.mexplicatie, 3 + lnPozBuget, ';'))
|
||||
miban = ALLTRIM(syGETWORDNUM(m.mexplicatie, 4 + lnPozBuget, ';'))
|
||||
mcf = ""
|
||||
IF "C.I.F.:" $ m.mexplicatie
|
||||
mcf = getdigitsfromstring(Alltrim(Substr(m.mexplicatie, At("C.I.F.:", m.mexplicatie) + 7, 13)), 4, 1, ".")
|
||||
@@ -4901,6 +5013,47 @@ Function EsteIbanInListaNeagra
|
||||
Endfunc
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
* Grupa de buget dupa IBAN-ul Trezoreriei: TVA/CAM/CU, gol daca nu e Trezorerie
|
||||
* --------------------------------------------------------------------
|
||||
Function GrupaBugetDinIban
|
||||
Lparameters tcIban
|
||||
Local lcIban
|
||||
lcIban = Upper(Chrtran(Alltrim(Nvl(m.tcIban, '')), ' ', ''))
|
||||
If Len(m.lcIban) < 8 Or !(Substr(m.lcIban, 5, 4) == 'TREZ')
|
||||
Return ''
|
||||
Endif
|
||||
Do Case
|
||||
Case Substr(m.lcIban, 12, 9) == '20A100101'
|
||||
Return 'TVA'
|
||||
Case Substr(m.lcIban, 12, 7) == '20A4703'
|
||||
Return 'CAM'
|
||||
Case Substr(m.lcIban, 12, 4) == '5503'
|
||||
Return 'CU'
|
||||
Otherwise
|
||||
Return ''
|
||||
Endcase
|
||||
Endfunc
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
* Analiticul activ al unui cont de buget, doar daca e exact unul singur
|
||||
* --------------------------------------------------------------------
|
||||
Function AnaliticBugetActiv
|
||||
Lparameters tcCont
|
||||
Local lcAcont
|
||||
PRIVATE pcContBuget
|
||||
pcContBuget = m.tcCont
|
||||
lcAcont = ''
|
||||
If goExecutor.oExecuta([select acont from plcont where inactiv = 0 and an = ?gnAn ] + ;
|
||||
[and cont = ?pcContBuget and nvl(acont,' ') <> ' '], 'cAnaliticBugetActiv')
|
||||
If Reccount('cAnaliticBugetActiv') = 1
|
||||
lcAcont = Alltrim(cAnaliticBugetActiv.acont)
|
||||
Endif
|
||||
Use In (Select('cAnaliticBugetActiv'))
|
||||
Endif
|
||||
Return m.lcAcont
|
||||
Endfunc
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
* Garda E3: salveaza IBAN-ul tertului pe partener doar daca partenerul nu are deja un cont,
|
||||
* IBAN-ul nu e deja pe alt partener activ si nu e din lista neagra
|
||||
* --------------------------------------------------------------------
|
||||
@@ -5702,4 +5855,127 @@ Procedure CompleteazaValutaROA
|
||||
|
||||
Return m.llSucces
|
||||
Endproc
|
||||
|
||||
|
||||
Define Class frmDefalcareBuget As frm_termin_renunt Of "_frm_child.vcx"
|
||||
Caption = 'Defalcare plata la buget'
|
||||
Width = 520
|
||||
Height = 330
|
||||
dData = {}
|
||||
nSuma = 0
|
||||
cGrupa = ''
|
||||
cExplicatie = ''
|
||||
nNerepartizat = 0
|
||||
|
||||
Procedure Init
|
||||
Lparameters tdData, tnSuma, tcGrupa, tcExplicatie
|
||||
Local lcTitluGrupa
|
||||
|
||||
DoDefault()
|
||||
|
||||
This.dData = m.tdData
|
||||
This.nSuma = m.tnSuma
|
||||
This.cGrupa = Upper(Alltrim(Nvl(m.tcGrupa, '')))
|
||||
This.cExplicatie = Alltrim(Nvl(m.tcExplicatie, ''))
|
||||
|
||||
This.NewObject('lblInfo', '_label', '_baza.vcx')
|
||||
With This.lblInfo
|
||||
.Left = 10
|
||||
.Top = 35
|
||||
.Width = 500
|
||||
.Height = 34
|
||||
.AutoSize = .F.
|
||||
.WordWrap = .T.
|
||||
Endwith
|
||||
|
||||
lcTitluGrupa = Icase(This.cGrupa = 'TVA', 'TVA', This.cGrupa = 'CAM', 'CAM', 'Cont unic (buget de stat)')
|
||||
This.lblInfo.Caption = Dtoc(This.dData) + ' Suma OP: ' + Transform(This.nSuma, '999,999,999.99') + ;
|
||||
' ' + m.lcTitluGrupa + ' ' + This.cExplicatie
|
||||
|
||||
This.NewObject('grdDefalcare', '_grid', '_baza.vcx')
|
||||
With This.grdDefalcare
|
||||
.Left = 10
|
||||
.Top = 72
|
||||
.Width = 500
|
||||
.Height = 210
|
||||
.lcamptextneeditabil = .F.
|
||||
.RecordSource = 'cDefalcare'
|
||||
.ColumnCount = 5
|
||||
.Columns(1).ControlSource = 'cDefalcare.cont'
|
||||
.Columns(1).Header1.Caption = 'Cont'
|
||||
.Columns(1).ReadOnly = .T.
|
||||
.Columns(1).Width = 50
|
||||
.Columns(2).ControlSource = 'cDefalcare.acont'
|
||||
.Columns(2).Header1.Caption = 'Analitic'
|
||||
.Columns(2).ReadOnly = .T.
|
||||
.Columns(2).Width = 60
|
||||
.Columns(3).ControlSource = 'cDefalcare.denumire'
|
||||
.Columns(3).Header1.Caption = 'Denumire'
|
||||
.Columns(3).ReadOnly = .T.
|
||||
.Columns(3).Width = 190
|
||||
.Columns(4).ControlSource = 'cDefalcare.sold'
|
||||
.Columns(4).Header1.Caption = 'Sold precedent'
|
||||
.Columns(4).ReadOnly = .T.
|
||||
.Columns(4).Width = 95
|
||||
.Columns(5).ControlSource = 'cDefalcare.suma'
|
||||
.Columns(5).Header1.Caption = 'Suma'
|
||||
.Columns(5).ReadOnly = .F.
|
||||
.Columns(5).Width = 95
|
||||
Bindevent(.Columns(5).Text1, 'Valid', This, 'ActualizeazaNerepartizat')
|
||||
Bindevent(.Columns(5).Text1, 'LostFocus', This, 'ActualizeazaNerepartizat')
|
||||
Endwith
|
||||
|
||||
This.NewObject('lblNerepartizat', '_label', '_baza.vcx')
|
||||
With This.lblNerepartizat
|
||||
.Left = 10
|
||||
.Top = 288
|
||||
.Width = 500
|
||||
.Height = 20
|
||||
.AutoSize = .F.
|
||||
.FontBold = .T.
|
||||
Endwith
|
||||
|
||||
This.ActualizeazaNerepartizat()
|
||||
Endproc
|
||||
|
||||
Procedure ActualizeazaNerepartizat
|
||||
Local lnRepartizat, lnRecno, lcSelect
|
||||
|
||||
If !Used('cDefalcare')
|
||||
Return
|
||||
Endif
|
||||
lcSelect = Select()
|
||||
lnRecno = Recno('cDefalcare')
|
||||
Select cDefalcare
|
||||
Sum suma To lnRepartizat
|
||||
If Between(m.lnRecno, 1, Reccount())
|
||||
Go m.lnRecno
|
||||
Endif
|
||||
Select (m.lcSelect)
|
||||
|
||||
This.nNerepartizat = Round(This.nSuma - m.lnRepartizat, 2)
|
||||
This.lblNerepartizat.Caption = 'Nerepartizat: ' + Transform(This.nNerepartizat, '999,999,999.99')
|
||||
This.lblNerepartizat.ForeColor = Iif(This.nNerepartizat <> 0, Rgb(200, 0, 0), Rgb(0, 130, 0))
|
||||
Endproc
|
||||
|
||||
Procedure inainte_de_do_termin
|
||||
Local llNegativ, lcSelect
|
||||
|
||||
This.ActualizeazaNerepartizat()
|
||||
|
||||
llNegativ = .F.
|
||||
If Used('cDefalcare')
|
||||
lcSelect = Select()
|
||||
Select cDefalcare
|
||||
Locate For suma < 0
|
||||
llNegativ = Found()
|
||||
Select (m.lcSelect)
|
||||
Endif
|
||||
|
||||
If This.nNerepartizat <> 0 Or m.llNegativ
|
||||
AMESSAGEBOX('Mai aveti de repartizat ' + Transform(This.nNerepartizat, '999,999,999.99') + ' lei.', 0 + 48, This.Caption)
|
||||
Return .F.
|
||||
Endif
|
||||
|
||||
Return .T.
|
||||
Endproc
|
||||
Enddefine
|
||||
Reference in New Issue
Block a user