sync SVN r18105

This commit is contained in:
2026-09-15 20:56:36 +03:00
parent 1416587f12
commit 32d0adf688
3 changed files with 8 additions and 132 deletions

View File

@@ -5855,127 +5855,3 @@ 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