*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="obalanta.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS frm_balanta AS formtermin OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="oMenuShortcut" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtprecdeb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtpreccred1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtcont2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdenumire.Header2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb.Header3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred.Header4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cruldeb.Header5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cruldeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.crulcred.Header6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.crulcred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotdeb.Header7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotdeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotcred.Header8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotcred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csoldcred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csoldcred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csolddeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csolddeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cacont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cacont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCod.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCod.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblsld1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbldebit" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblcredit" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cktotal4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ckanalitic" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cktotal2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cktotal1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cktotal3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cksold1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboSucursale" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_acont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modiparam1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: adauga_linie
		*m: afisactual
		*m: butapend
		*m: butdrept
		*m: calculeaza
		*m: calculeaza_orizontal
		*m: calculeaza_vertical
		*m: cfield_assign
		*m: conditieistoricact
		*m: do_situatii_cont
		*m: fisacont
		*m: in_bal
		*m: meniu_as
		*m: reconstruct
		*m: rulcred
		*m: ruldeb
		*m: ruldebcred
		*m: sterge_linie
		*m: totcred
		*m: totdeb
		*m: totdebcred
		*p: calias
		*p: cbal
		*p: ccont
		*p: cfield
		*p: cprocedurainainte
		*p: lcentru
		*p: nan1
		*p: nan2
		*p: nluna1
		*p: nluna2
		*p: nnewvalue
		*p: noldvalue
		*p: oafbalana
	*</DefinedPropArrayMethod>

	*<PropValue>
		AlwaysOnTop = .F.
		BackColor = 255,255,255
		BorderStyle = 1
		calias = TBALANTA
		cbal = 
		cbuton4 = but_reface1
		cfield = 
		cprocedurainainte = balanta
		DoCreate = .T.
		FontCharSet = 1
		FontName = "Arial"
		FontSize = 10
		Height = 478
		lactiv1 = .F.
		lactiv2 = .F.
		lactiv3 = .F.
		lactiv4 = .F.
		lcentru = .F.
		Name = "frm_balanta"
		nan1 = 2000
		nan2 = 2000
		nluna1 = 1
		nluna2 = 1
		nnewvalue = 0
		noldvalue = 0
		ScrollBars = 0
		Width = 1024
		WindowType = 1
		_shape1.Anchor = 10
		_shape1.BorderStyle = 0
		_shape1.Height = 35
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 1056
		_shape1.ZOrderSet = 1
		_shape2.Comment = "*:OnResize=RT"
		_shape2.Height = 36
		_shape2.Left = 845
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 177
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Balanta de verificare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 18
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Comment = "*:OnResize=RT"
		BUT_TERMIN1.Left = 992
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 17
		BUT_TERMIN1.Top = 4
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Left = 12
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 252
	*</PropValue>

	ADD OBJECT '_label1' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Rulaje", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 637, ;
		Name = "_label1", ;
		TabIndex = 40, ;
		Top = 48, ;
		Width = 126, ;
		ZOrderSet = 31
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label2' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Total sume", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 765, ;
		Name = "_label2", ;
		TabIndex = 41, ;
		Top = 48, ;
		Width = 126, ;
		ZOrderSet = 32
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label3' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Afisare", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 183, ;
		Name = "_label3", ;
		TabIndex = 32, ;
		Top = 40, ;
		Width = 46, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 963, ;
		Name = "But_excel1", ;
		TabIndex = 16, ;
		Top = 4, ;
		Visible = .F., ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 933, ;
		Name = "But_listare1", ;
		TabIndex = 15, ;
		Top = 4, ;
		Visible = .F., ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 876, ;
		Name = "But_modifica1", ;
		TabIndex = 13, ;
		Top = 4, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modiparam1' AS but_modiparam WITH ;
		Anchor = 9, ;
		caction = do_situatii_cont, ;
		Left = 904, ;
		Name = "But_modiparam1", ;
		TabIndex = 14, ;
		ToolTipText = "Situatii cont", ;
		Top = 4
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 846, ;
		Name = "But_reface1", ;
		TabIndex = 12, ;
		Top = 4, ;
		Visible = .F., ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cboSucursale' AS _combobox WITH ;
		Alignment = 0, ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 10, ;
		Name = "cboSucursale", ;
		RowSource = "", ;
		RowSourceType = 1, ;
		TabIndex = 5, ;
		ToolTipText = "", ;
		Top = 132, ;
		Visible = .F., ;
		Width = 171
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		BackStyle = 0, ;
		Caption = "Sintetice", ;
		Comment = "*:OnResize=RT", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 308, ;
		Name = "Check1", ;
		SpecialEffect = 0, ;
		Style = 1, ;
		TabIndex = 43, ;
		Top = 47, ;
		Visible = .T., ;
		Width = 71
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Ck_acont' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = acont, ;
		Caption = "", ;
		Comment = "*:OnResize=ST", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 146, ;
		Name = "Ck_acont", ;
		TabIndex = 45, ;
		ToolTipText = "Selectie analitic", ;
		Top = 87
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_cont' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = cont, ;
		Caption = "", ;
		Comment = "*:OnResize=ST", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 146, ;
		Name = "Ck_cont", ;
		TabIndex = 44, ;
		ToolTipText = "Selectie cont", ;
		Top = 60
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_denumire' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = denumire, ;
		Caption = "Denumire", ;
		Comment = "*:OnResize=ST", ;
		FontBold = .T., ;
		FontCharSet = 1, ;
		Left = 10, ;
		Name = "Ck_denumire", ;
		TabIndex = 4, ;
		ToolTipText = "Selectie denumire", ;
		Top = 110
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ckanalitic' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Analitice", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 184, ;
		Name = "ckanalitic", ;
		TabIndex = 7, ;
		Top = 70, ;
		Value = 0, ;
		Width = 69, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'cksold1' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "\<Solduri la 1 ian.", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 184, ;
		Name = "cksold1", ;
		TabIndex = 8, ;
		Top = 84, ;
		Value = 0, ;
		Width = 109, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'cktotal1' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total clase (gr.1)", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 184, ;
		Name = "cktotal1", ;
		TabIndex = 9, ;
		Top = 98, ;
		Value = 0, ;
		Width = 116, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'cktotal2' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total grupe (gr.2)", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 184, ;
		Name = "cktotal2", ;
		TabIndex = 10, ;
		Top = 112, ;
		Value = 0, ;
		Width = 117, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'cktotal3' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total conturi (gr.3)", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 184, ;
		Name = "cktotal3", ;
		TabIndex = 11, ;
		Top = 126, ;
		Value = 0, ;
		Width = 124, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'cktotal4' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Conturi", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 184, ;
		Name = "cktotal4", ;
		TabIndex = 6, ;
		Top = 56, ;
		Value = 1, ;
		Width = 60, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Ct1' AS ct WITH ;
		Height = 25, ;
		Left = 83, ;
		Name = "Ct1", ;
		SpecialEffect = 0, ;
		TabIndex = 3, ;
		Top = 84, ;
		Width = 59, ;
		ZOrderSet = 15, ;
		Shape1.Name = "Shape1", ;
		Text1.Height = 21, ;
		Text1.Left = 1, ;
		Text1.Name = "Text1", ;
		Text1.Top = 1, ;
		Text1.Width = 13, ;
		Text2.Left = 14, ;
		Text2.Name = "Text2", ;
		Text2.Top = 1, ;
		Text3.Left = 26, ;
		Text3.Name = "Text3", ;
		Text3.Top = 1, ;
		Text4.Height = 21, ;
		Text4.Left = 39, ;
		Text4.Name = "Text4", ;
		Text4.Top = 1, ;
		Text4.Width = 14, ;
		Line1.Left = 14, ;
		Line1.Name = "Line1", ;
		Line1.Top = -9, ;
		Line2.Left = 26, ;
		Line2.Name = "Line2", ;
		Line2.Top = -9, ;
		Line3.Left = 39, ;
		Line3.Name = "Line3", ;
		Line3.Top = -9
		*< END OBJECT: ClassLib="ferestre_cere_date.vcx" BaseClass="container" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 15, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		Height = 311, ;
		Left = 9, ;
		Name = "Grid1", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "TBALANTA", ;
		RowHeight = 20, ;
		TabIndex = 19, ;
		Top = 157, ;
		Width = 1007, ;
		ZOrderSet = 21, ;
		Column1.Alignment = 0, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "CONT", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Format = "", ;
		Column1.InputMask = "", ;
		Column1.Name = "ccont", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 29, ;
		Column2.Alignment = 0, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "DENUMIRE", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cdenumire", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 141, ;
		Column3.Alignment = 1, ;
		Column3.BackColor = 187,235,255, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "PRECDEB", ;
		Column3.DynamicForeColor = "IIF(PRECDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Format = "r", ;
		Column3.InputMask = (get_mask(16,gnPA)), ;
		Column3.Name = "cprecdeb", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 72, ;
		Column4.Alignment = 1, ;
		Column4.BackColor = 187,235,255, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "PRECCRED", ;
		Column4.DynamicForeColor = "IIF(PRECCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "r", ;
		Column4.InputMask = (get_mask(16,gnPA)), ;
		Column4.Name = "cpreccred", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 72, ;
		Column5.Alignment = 1, ;
		Column5.BackColor = 236,249,255, ;
		Column5.ColumnOrder = 8, ;
		Column5.ControlSource = "RULDEB", ;
		Column5.DynamicForeColor = "IIF(RULDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "R", ;
		Column5.InputMask = (get_mask(16,gnPA)), ;
		Column5.Name = "cruldeb", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 72, ;
		Column6.Alignment = 1, ;
		Column6.BackColor = 236,249,255, ;
		Column6.ColumnOrder = 9, ;
		Column6.ControlSource = "RULCRED", ;
		Column6.DynamicForeColor = "IIF(RULCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "R", ;
		Column6.InputMask = (get_mask(16,gnPA)), ;
		Column6.Name = "crulcred", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 73, ;
		Column7.Alignment = 1, ;
		Column7.BackColor = 187,235,255, ;
		Column7.ColumnOrder = 10, ;
		Column7.ControlSource = "TOTDEB", ;
		Column7.DynamicForeColor = "IIF(TOTDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Format = "r", ;
		Column7.InputMask = (get_mask(16,gnPA)), ;
		Column7.Name = "ctotdeb", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 83, ;
		Column8.Alignment = 1, ;
		Column8.BackColor = 187,235,255, ;
		Column8.ColumnOrder = 11, ;
		Column8.ControlSource = "TOTCRED", ;
		Column8.DynamicForeColor = "IIF(TOTCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "r", ;
		Column8.InputMask = (get_mask(16,gnPA)), ;
		Column8.Name = "ctotcred", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 85, ;
		Column9.Alignment = 1, ;
		Column9.BackColor = 236,249,255, ;
		Column9.ColumnOrder = 13, ;
		Column9.ControlSource = "SOLDCRED", ;
		Column9.DynamicForeColor = "IIF(SOLDCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Format = "r", ;
		Column9.InputMask = (get_mask(16,gnPA)), ;
		Column9.Name = "csoldcred", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 70, ;
		Column10.Alignment = 1, ;
		Column10.BackColor = 236,249,255, ;
		Column10.ColumnOrder = 12, ;
		Column10.ControlSource = "SOLDDEB", ;
		Column10.DynamicForeColor = "IIF(SOLDDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Format = "r", ;
		Column10.InputMask = (get_mask(16,gnPA)), ;
		Column10.Name = "csolddeb", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 66, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 2, ;
		Column11.ControlSource = "ACONT", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cacont", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 40, ;
		Column12.BackColor = 236,249,255, ;
		Column12.ColumnOrder = 4, ;
		Column12.ControlSource = "precdeb1", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Format = "RK", ;
		Column12.InputMask = (get_mask(18,gnPA)), ;
		Column12.Name = "cprecdeb1", ;
		Column12.ReadOnly = .T., ;
		Column12.Visible = .T., ;
		Column12.Width = 100, ;
		Column13.BackColor = 236,249,255, ;
		Column13.ColumnOrder = 5, ;
		Column13.ControlSource = "preccred1", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "RK", ;
		Column13.InputMask = (get_mask(18,gnPA)), ;
		Column13.Name = "cpreccred1", ;
		Column13.ReadOnly = .T., ;
		Column13.Visible = .T., ;
		Column13.Width = 108, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ControlSource = "sucursala", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cSucursala", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 164, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ControlSource = "cod", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cCod", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 86
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'Grid1.cacont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cacont.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cCod.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cCod.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.ccont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.ccont.Text1' AS textbox WITH ;
		Alignment = 0, ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cdenumire.Header2' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header2"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cdenumire.Text1' AS textbox WITH ;
		Alignment = 0, ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cpreccred.Header4' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec.Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header4"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cpreccred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cpreccred1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Credit 1 ian. ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cpreccred1.Text1' AS textbox WITH ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cprecdeb.Header3' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec.Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header3"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cprecdeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cprecdeb1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Debit 1 ian.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cprecdeb1.Text1' AS textbox WITH ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.crulcred.Header6' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rul.Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header6"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.crulcred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderColor = 0,0,0, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cruldeb.Header5' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rul.Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header5"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cruldeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.csoldcred.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.csoldcred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.csolddeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.csolddeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cSucursala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sucursala", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cSucursala.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.ctotcred.Header8' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header8"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.ctotcred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.ctotdeb.Header7' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header7"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.ctotdeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		Left = 627, ;
		Name = "Gridextra1", ;
		Top = 269
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Label1' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Selectie cont", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .T., ;
		FontCharSet = 1, ;
		Height = 18, ;
		Left = 8, ;
		Name = "Label1", ;
		TabIndex = 31, ;
		Top = 38, ;
		Width = 85, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label2' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "De la", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 9, ;
		Name = "Label2", ;
		TabIndex = 34, ;
		Top = 61, ;
		Width = 32, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label3' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Analitic", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 9, ;
		Name = "Label3", ;
		TabIndex = 35, ;
		Top = 87, ;
		Width = 50, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label4' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "la", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 86, ;
		Name = "Label4", ;
		TabIndex = 33, ;
		Top = 61, ;
		Width = 12, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label5' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Solduri", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 893, ;
		Name = "Label5", ;
		TabIndex = 42, ;
		Top = 48, ;
		Width = 127, ;
		ZOrderSet = 34
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label8' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Total precedente", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 509, ;
		Name = "Label8", ;
		TabIndex = 37, ;
		Top = 48, ;
		Width = 127, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblcredit' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Credit", ;
		Comment = "*:OnResize=RT", ;
		Height = 17, ;
		Left = 308, ;
		Name = "lblcredit", ;
		TabIndex = 38, ;
		Top = 94, ;
		Width = 71, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbldebit' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Debit", ;
		Comment = "*:OnResize=RT", ;
		Height = 17, ;
		Left = 308, ;
		Name = "lbldebit", ;
		TabIndex = 39, ;
		Top = 70, ;
		Width = 71, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblsld1' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Solduri 1 Ian.", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 380, ;
		Name = "lblsld1", ;
		TabIndex = 36, ;
		Top = 48, ;
		Visible = .T., ;
		Width = 123, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'oMenuShortcut' AS menulib WITH ;
		Left = 264, ;
		Name = "oMenuShortcut", ;
		TabIndex = 22, ;
		Top = 0, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="utility.vcx" BaseClass="container" />

	ADD OBJECT 'Text1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.sprecdeb", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 509, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 23, ;
		Top = 67, ;
		Width = 127, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text2' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.spreccred", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 509, ;
		Name = "Text2", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 25, ;
		Top = 91, ;
		Width = 127, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text3' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.srulcred", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 637, ;
		Name = "Text3", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 27, ;
		Top = 91, ;
		Width = 127, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text4' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.sruldeb", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 637, ;
		Name = "Text4", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 29, ;
		Top = 67, ;
		Width = 127, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text5' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.stotdeb", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 765, ;
		Name = "Text5", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 28, ;
		Top = 67, ;
		Width = 127, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text6' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.stotcred", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 765, ;
		Name = "Text6", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 30, ;
		Top = 91, ;
		Width = 127, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text7' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.ssolddeb", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 893, ;
		Name = "Text7", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 20, ;
		Top = 67, ;
		Width = 127, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text8' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.ssoldcred", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 893, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 26, ;
		Top = 91, ;
		Width = 127, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtcont' AS _textbox WITH ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		Height = 25, ;
		Left = 41, ;
		Name = "txtcont", ;
		SpecialEffect = 1, ;
		TabIndex = 1, ;
		Top = 58, ;
		Width = 44, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtcont2' AS _textbox WITH ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		Format = "k", ;
		Height = 25, ;
		Left = 97, ;
		Name = "txtcont2", ;
		SpecialEffect = 1, ;
		TabIndex = 2, ;
		Top = 58, ;
		Width = 44, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtpreccred1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.spreccred1", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPA)), ;
		Left = 380, ;
		Name = "txtpreccred1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 24, ;
		Top = 91, ;
		Visible = .T., ;
		Width = 127, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtprecdeb1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.sprecdeb1", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPA)), ;
		Left = 380, ;
		Name = "txtprecdeb1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 21, ;
		Top = 67, ;
		Visible = .T., ;
		Width = 127, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE adauga_linie
		LOCAL lcIdSucursala, lnIdSucursala, lcSucursala
		Private pcbal,pcCont,pcSCont,pcACont,pnButon
		Store "" To pcbal,pcCont,pcSCont,pcACont
		pnButon=1
		pcbal=This.CALIas
		
		STORE "" TO locauta
		lnIdSucursala = NULL
		lcSucursala = ''
		IF glEMama
			llToateIreg = .F.
			llNou = .F.
			llBlank = .T.
			loCauta = caut_sucursala(llToateIreg, llNou, llBlank)
			lnIdSucursala = loCauta.id_sucursala
			lcSucursala = loCauta.sucursala
		ELSE 
			lnIdSucursala = gnIdSucursala && pentru o sucursala este id-ul firmei, iar pe firma independenta este null	
		ENDIF 
		lcIdSucursala = IIF(NVL(lnIdSucursala,0) = 0, 'NULL', ALLTRIM(STR(lnIdSucursala)))
		
		pcCont=SELECT_CONT()
		If pnButon=2
			Return
		Endif
		If Empty(pcCont)
			Return
		Endif
		
		pcSCont=Left(pcCont,4)
		lnPos=At(".",pcCont)
		If lnPos>0
			pcACont=Padr(Substr(pcCont,lnPos+1),4," ")
		Endif
		
		
		
		pcexec=[begin PACK_INREGISTRARI.balinsproc(]+lcIdSucursala+[,]+Alltrim(Str(gnAn))+[,]+Alltrim(Str(gnLuna))+;
			[,']+Alltrim(pcSCont)+[',']+Alltrim(pcACont)+['); end;]
		lnSucces=goExecutor.oexecute(pcexec)
		If lnSucces < 0
			lcTextEroare = goExecutor.cEroare
			aMessagebox(lcTextEroare,48,"Eroare")
			Return
		Endif
		
		If !Empty(pcACont)
			Thisform.ckanalitic.Value=1
		Endif
		
		Thisform.MousePointer=11
		Thisform.LockScreen=.T.
		Thisform.reconstruct
		Thisform.afisactual
		Select (pcbal)
		Locate For Cont=pcSCont And acont=pcACont AND NVL(id_sucursala,0) = NVL(lnIdSucursala,0)
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
		Thisform.grid1.SetFocus
		
	ENDPROC

	PROCEDURE afisactual
		#Define CRLF Chr(13) + Chr(10)
		
		
		Private lcbal,lcacont  && ,lccont1,lccont2 - le-am pus inainte de do form
		lcbal=Thisform.calias
		
		Local T1
		T1=""
		T='.t.'
		
		lccont1=Alltrim(This.txtcont.Value)
		lccont2=Alltrim(This.txtcont2.Value)
		
		If Empty(lccont2)
			lccont2 = lccont1
		Endif
		
		*lcacont=ALLTRIM(this.txtacont.value)
		lcacont1=Alltrim(This.ct1.text1.Value)
		lcacont2=Alltrim(This.ct1.text2.Value)
		lcacont3=Alltrim(This.ct1.text3.Value)
		lcacont4=Alltrim(This.ct1.text4.Value)
		
		Do Case
			Case Len(lccont1)=1
				*T=[G1="]+LCCONT+["]
				T = T + [ and VAL(LEFT(G1,1))>=VAL(lcCont1)]
			Case Len(lccont1)=2
				*T=[G2="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G2),2,'0'))>=VAL(lcCont1)]
			Case Len(lccont1)=3
				*T=[G3="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G3),3,'0'))>=VAL(lcCont1)]
			Case Len(lccont1)=4
				*T=[G4="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G4),4,'0'))>=VAL(lcCont1)]
		Endcase
		
		Do Case
			Case Len(lccont2)=1
				*T=[G1="]+LCCONT+["]
				T = T + [ and VAL(LEFT(G1,1))<=VAL(lcCont2)]
			Case Len(lccont2)=2
				*T=[G2="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G2),2,'0'))<=VAL(lcCont2)]
			Case Len(lccont2)=3
				*T=[G3="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G3),3,'0'))<=VAL(lcCont2)]
			Case Len(lccont2)=4
				*T=[G4="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G4),4,'0'))<=VAL(lcCont2)]
		Endcase
		
		
		&& SOLDURI LA 1 IANUARIE
		If This.cksold1.Value=0
			With Thisform.grid1
				.cprecdeb1.Visible=.F.
				.cpreccred1.Visible=.F.
			Endwith
			With Thisform
				.lblsld1.Visible=.F.
				.txtprecdeb1.Visible=.F.
				.txtpreccred1.Visible=.F.
				.lbldebit.Left=.text1.Left-.lbldebit.Width
				.lblcredit.Left=.text2.Left-.lblcredit.Width
				.check1.Left=.label8.Left-.lbldebit.Width
			Endwith
		Else
		
			With Thisform.grid1
				.cprecdeb1.Visible=.T.
				.cpreccred1.Visible=.T.
			Endwith
			With Thisform
				.lblsld1.Visible=.T.
				.txtprecdeb1.Visible=.T.
				.txtpreccred1.Visible=.T.
				.lbldebit.Left=.txtprecdeb1.Left-.lbldebit.Width
				.lblcredit.Left=.txtpreccred1.Left-.lblcredit.Width
				.check1.Left=.lblsld1.Left-.lbldebit.Width
			Endwith
		Endif
		&& SOLDURI LA 1 IANUARIE ^
		
		
		*/-----------------------------------------------------
		&&& conditia de filtrare pt balanta sintetica
		llTotal1=Iif(This.cktotal1.Value=1,.T.,.F.)
		llTotal2=Iif(This.cktotal2.Value=1,.T.,.F.)
		llTotal3=Iif(This.cktotal3.Value=1,.T.,.F.)
		llTotal4=Iif(This.cktotal4.Value=1,.T.,.F.)
		llAnalitic=Iif(This.ckanalitic.Value=1,.T.,.F.)
		
		
		If glEMama
			lnIdSucursala = crsSucursale.ID_SUCURSALA
			llBalantaCentralizata = lnIdSucursala = -1 && BALANTA CENTRALIZATA
			llBalantaDefalcata = lnIdSucursala = -2 && BALANTA DEFALCATA
			llBalantaGrup =  lnIdSucursala = -3 && BALANTA GRUP (FARA ID SUCURSALA)
		Else
			lnIdSucursala = Null
			llBalantaCentralizata = .F. && BALANTA CENTRALIZATA
			llBalantaDefalcata = .F.
			llBalantaGrup =  .F. && BALANTA GRUP (FARA ID SUCURSALA)
		Endif
		
		*!* PE MAMA TOTALURILE SUNT CALCULATE DOAR PE CONTURILE CENTRALIZATE
		*!* DEZACTIVEZ BIFELE DE TOTALURI DACA NU ALEG BALANTA CENTRALIZATA
		If glEMama
			With This
				.cktotal1.Enabled = llBalantaCentralizata
				.cktotal2.Enabled = llBalantaCentralizata
				.cktotal3.Enabled = llBalantaCentralizata
			Endwith
		Endif
		
		
		lclista=[]
		*!* ARAT TOTALURILE PE CLASE/GRUPE DOAR DACA SUNT PE BALANTA CENTRALIZATA SAU PE SUCURSALA/FIRMA INDEPENDENTA
		If llBalantaCentralizata Or !glEMama
			If llTotal1
				lclista=lclista+[,1]
			Endif
			If llTotal2
				lclista=lclista+[,2]
			Endif
			If llTotal3
				lclista=lclista+[,3]
			Endif
		Endif
		If glEMama
			If llTotal4
				If llBalantaCentralizata
					lclista=lclista + [,6] && conturi sintetice din balanta centralizata
				Else
					lclista=lclista + [,4] && conturi sintetice din balanta normala
				Endif
			Endif
			If llAnalitic
				If llBalantaCentralizata
					lclista=lclista + [,7] && conturi analitice din balanta centralizata
				Else
					lclista=lclista + [,5] && conturi analitice din balanta normala
				Endif
			Endif
		
		Else
			If llTotal4
				lclista=lclista+[,4]
			Endif
			If llAnalitic
				lclista=lclista+[,5]
			Endif
		Endif
		
		
		
		If !Empty(lclista)
			If Left(lclista,1)=","
				lclista=Substr(lclista,2)
			Endif
			T = T + [ AND INLIST(BNIVEL,]+lclista+[)]
		Else
			T = T + [ AND .F.]
		Endif
		
		lccond2=[]
		
		If !Empty(lcacont1)
			lccond2= lccond2 + [ and SUBSTR(acont,1,1)="]+lcacont1+["]
		Endif
		If !Empty(lcacont2)
			lccond2= lccond2 + [ and SUBSTR(acont,2,1)="]+lcacont2+["]
		Endif
		If !Empty(lcacont3)
			lccond2= lccond2 + [ and SUBSTR(acont,3,1)="]+lcacont3+["]
		Endif
		If !Empty(lcacont4)
			lccond2= lccond2 + [ and SUBSTR(acont,4,1)="]+lcacont4+["]
		Endif
		
		T= T + lccond2
		If Thisform.ck_cont.Value = 1
			T = T + Thisform.ck_cont.filtru_vfp
		Endif
		If Thisform.ck_acont.Value = 1
			T = T + Thisform.ck_acont.filtru_vfp
		Endif
		If Thisform.ck_denumire.Value = 1
			T = T + Thisform.ck_denumire.filtru_vfp
		Endif
		
		
		*!* 12.02.2008
		*!* ARAT CONTURILE DE PE O SUCURSALA SAU DOAR CONTURILE DE PE MAMA
		lcSucursale = ""
		If glEMama
			Do Case
				Case llBalantaGrup
					lcSucursale = " and Nvl(id_sucursala,0) = 0"
				Case Nvl(lnIdSucursala,0) > 0
					lcSucursale = " and id_sucursala = " + Alltrim(Str(lnIdSucursala))
			Endcase
		Endif
		T = T + lcSucursale
		*!* 12.02.2008 ^
		*!*Messagebox(T + CRLF + CRLF + GETCALLSTACK())
		T=[SET FILT TO ]+T
		Select (lcbal)
		*!*	Copy To C:\BAL.Dbf
		&T
		
		Local lcFor
		lcFor = [INLIST(bnivel, 4, 6)] && TOTALURI PE CONTURI SINTETICE - 4 = SUCURSALA/FIRMA INDEPENDENTA; 6 = MAMA
		If This.check1.Value = 1 && TOTALURI PE CONTURI ANALITICE - 5 = SUCURSALA/FIRMA INDEPENDENTA; 7 = MAMA
			lcFor = [INLIST(bnivel, 5, 7)]
		Endif
		*!*	SELECT * FROM (lcbal) INTO TABLE c:\lcbal.dbf
		Select (lcbal)
		Sum PRECDEB1,PRECCRED1, iif(precdeb>=preccred, abs(precdeb-preccred), 0.00), iif(precdeb<preccred, abs(precdeb-preccred),0.00),;
			precdeb,preccred,ruldeb,rulcred,totdeb,totcred,solddeb,soldcred For &lcFor ;
			to m.sprecdeb1,m.spreccred1,m.ssoldideb, m.ssoldicred, m.sprecdeb,m.spreccred,m.sruldeb,m.srulcred,m.stotdeb,m.stotcred,m.ssolddeb,m.ssoldcred
		
		
		
		With Thisform
			.text1.Refresh
			.text2.Refresh
			.text3.Refresh
			.text4.Refresh
			.text5.Refresh
			.text6.Refresh
			.text7.Refresh
			.text8.Refresh
			.txtpreccred1.Refresh
			.txtprecdeb1.Refresh
		Endwith
		
		Select (lcbal)
		Go Top
		This.grid1.Refresh
		
	ENDPROC

	PROCEDURE butapend
		*!*	LOCAL lbMenu[4]
		*!*	PRIVATE lcbal
		*!*	lcbal=THISFORM.calias
		
		
		*!*	lbMenu=""
		*!*	lbMenu[1]="\<Deblocare"
		*!*	IF THISFORM.grid1.READONLY
		*!*		lbMenu[2]="\Adaug Blanc"
		*!*	ELSE
		*!*		lbMenu[2]="\<Adaug Blanc"
		*!*	ENDIF
		*!*	lbMenu[3]="\-"
		*!*	lbMenu[4]="\<Revenire"
		
		
		*!*	THISFORM.oMenuShortcut.ShowMenu(@lbMenu)
		
		*!*	DO CASE
		*!*		CASE BAR()=1
		
		*!*			SELECT (lcbal)
		*!*			SET FILTER TO !DELETED()
		*!*			THISFORM.grid1.READONLY=.F.
		*!*			THISFORM.grid1.DELETEMARK=.T.
		
		*!*		CASE BAR()=2
		*!*			this.adauga_linie()
		*!*		CASE BAR()=4
		*!*	*SELE BAL
		*!*			SELECT (lcbal)
		*!*			SET FILTER TO !DELETED()
		*!*			THISFORM.grid1.READONLY=.T.
		*!*			THISFORM.grid1.DELETEMARK=.F.
		*!*	ENDCASE
		
		
		
		
		
	ENDPROC

	PROCEDURE butdrept
		*return
		Private lcsel,lccont
		lcsel=This.CALIAS
		
		Local laMenu[9]
		Select (lcsel)
		lccont = ALLTRIM(Cont)
		
		laMenu=""
		
		laMenu[1]="\<Fisa cont "+Alltrim(lccont)
		laMenu[2]="\-"
		laMenu[3]="\<Rulaj Debit"
		laMenu[4]="R\<ulaj Credit"
		laMenu[5]="Ru\<laje Deb&Cred"
		laMenu[6]="\-"
		laMenu[7]="\<Total Debit"
		laMenu[8]="T\<otal Credit"
		laMenu[9]="Tot\<al Deb&Cred"
		
		Thisform.oMenuShortcut.ShowMenu(@laMenu)
		
		Do Case
		Case Bar()=1
			Thisform.fisacont
		Case Bar()=3
			Thisform.ruldeb
		Case Bar()=4
			Thisform.rulcred
		Case Bar()=5
			Thisform.ruldebcred
		Case Bar()=7
			Thisform.totdeb
		Case Bar()=8
			Thisform.totcred
		Case Bar()=9
			Thisform.totdebcred
		Endcase
		
		*laMenu[1]="\<Copiaza"
		*laMenu[2]="Re\<da"
		*laMenu[3]="\-"
		*CASE BAR()=1
		*	SYS(1500,'_MED_copy','_MEDIT')
		*CASE BAR()=2
		*	SYS(1500,'_MED_paste','_MEDIT')
		
		Thisform.txtcont.Refresh
		
	ENDPROC

	PROCEDURE calculeaza
		*!* nu calculez daca gridul este readonly
		IF THIS.GRId1.ReadOnly
			RETURN
		ENDIF 
		LOCAL lnIdSucursala
		Private pcSufix,pcAlias,pnOldValue,pcVar,pnValoare,pnRec,pcOldAlias,pcFiltru,pcAcont
		pcSufix=Thisform.cField
		pcAlias=Thisform.cAlias
		pnOldValue=Thisform.noldvalue
		
		Select (pcAlias)
		pcVar=pcAlias+[.]+pcSufix
		pnValoare=Evaluate(pcVar)
		pcAcont=Upper(Alltrim(acont))
		lnIdSucursala = id_sucursala
		
		This.nnewvalue=pnValoare
		lnNewValue=This.nnewvalue
		pcFiltru=Filter()
		pnRec=Recno()
		pcField=This.cField
		
		If lnNewValue!=pnOldValue
			If Empty(This.ccont) && o linie cu totaluri
				Wait Window "Nu puteti modifica totalul." Timeout 1
				Select (pcAlias)
				Replace &pcVar With pnOldValue
				This.nnewvalue=pnOldValue
				Return
			Endif
			lcDbf=Dbf(pcAlias)
			Use (lcDbf) In 0 Again Shared Alias TBALANTAR
			Select TBALANTAR
			Goto pnRec
			pcOldAlias=This.cAlias
			This.cAlias="TBALANTAR"
		*	If Inlist(lcField,"PRECDEB","PRECCRED","RULDEB","RULCRED") && NU CALCULEZ DECAT PT PRECEDENTE SI RULAJE
			Thisform.calculeaza_orizontal() && calculez pentru linia curenta
		*	Endif
			If Empty(pcAcont)			&& cont2003 oracle
				Thisform.calculeaza_vertical()  && calculez pentru linia cu totaluri
			Endif
			Use In TBALANTAR
			This.cAlias=pcOldAlias
			Select (pcOldAlias)
			This.in_bal(lnIdSucursala, This.ccont,pcAcont,.T.)	&& introduc in bal noua valoare si recalculez
		*!*		Select (lcAlias)
		*!*		Set Filter To &lcFilter
		Endif
		This.afisactual
	ENDPROC

	PROCEDURE calculeaza_orizontal
		PARAMETERS tcAlias
		PRIVATE lcAlias
		
		IF EMPTY(tcAlias)
			lcAlias=thisform.calias 
		ELSE
			lcAlias=ALLTRIM(tcalias)
		ENDIF 
		*WAIT WINDOW 'calculeaza orizontal '+lcalias
		*!*	SELECT (lcAlias)
		*!*	lcCont=CONT
		*!*	lcG1=G1
		*!*	lcG2=G2
		*!*	lcG3=G3
		*!*	lcG4=G4
		*!*	lcCond=[left(cont,]+ALLTRIM(STR(LEN(lccont)))+[)=]+lccont+[ AND G1=]+lcG1+[ AND G2=]+lcG2+[ AND G3=]+lcG3+[ AND G4=]+lcG4
		*!*	WAIT WINDOW lcCond
		
		SELECT (lcAlias)
		IF FLOCK()
			REPLACE totdeb WITH precdeb+ruldeb,totcred WITH preccred+rulcred
			REPLACE solddeb WITH IIF(totdeb-totcred>=0,ABS(totdeb-totcred),0),soldcred WITH IIF(totdeb-totcred<0,ABS(totdeb-totcred),0)
			UNLOCK
		*	brow
		ENDIF 
				
		
		
		
		
	ENDPROC

	PROCEDURE calculeaza_vertical
		Private lccont,lcAlias,lnRec,lnDifValue,lcField,lnValoare,laarray
		
		lcAlias=This.calias
		Select (lcAlias)
		lnRec=Recno()
		lccont=Alltrim(This.ccont)
		*WAIT WINDOW 'lccont= '+lccont
		lcField=This.cfield
		lnDifValue=This.nnewvalue- This.noldvalue
		*WAIT WINDOW 'lndifvalue = '+STR(lndifValue)
		*WAIT WINDOW 'calculeaza vertical '+lcalias
		
		lnlung=4
		Dimension laarray[lnlung]
		Store Space(4) To laarray
		For i=1 To lnlung-1
		*	WAIT WINDOW 'i= '+STR(i)
			laarray[i] = Substr(lccont,1,i)
		*	WAIT WINDOW laArray[i]
			lcVar="G"+Alltrim(Str(i))
			lcVar1="G"+Alltrim(Str(i+1))
			LCCOND=[LOCATE FOR LEFT(]+lcVar+[,]+Alltrim(Str(i))+[)="]+Left(laarray[I],i)+[" AND EMPTY(]+lcVar1+[)]
		*	WAIT WINDOW lccond
			Select (lcAlias)
			&LCCOND
			If Found()
				If Flock()
					lnValoare=Evaluate(lcField)+lnDifValue
					Replace &lcField With lnValoare
					This.calculeaza_orizontal(lcAlias) && calculez pentru liniile cu totaluri
					Unlock
				Endif
			Endif
		Endfor
		
		Select (lcAlias)
		Goto lnRec
	ENDPROC

	PROCEDURE cfield_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		THIS.cfield = m.vNewVal
		
		PRIVATE lcAlias,lcSufix,lcVar
		lcAlias=thisform.calias 
		lcSufix=this.cField
		lcVar=lcAlias+[.]+lcSufix
		lcCont=lcAlias+[.cont]
		THISFORM.nOldValue=EVALUATE(lcVar)
		thisform.ccont=EVALUATE(lcCont)
		*WAIT WINDOW 'ccont '+thisform.ccont
		
	ENDPROC

	PROCEDURE conditieistoricact
		Local lcConditie
		lcConditie = ""
		
		If glEMama
			lnIdSucursala = crsSucursale.ID_SUCURSALA
			llBalantaCentralizata = lnIdSucursala = -1 && BALANTA CENTRALIZATA
			llBalantaDefalcata = lnIdSucursala = -2 && BALANTA DEFALCATA
			llBalantaGrup =  lnIdSucursala = -3 && BALANTA GRUP (FARA ID SUCURSALA)
			Do Case
				Case !Empty(Nvl(tbalanta.ID_SUCURSALA,0))
					lcConditie = " and id_sucursala = " + Alltrim(Str(tbalanta.ID_SUCURSALA))
				Case llBalantaDefalcata
					If Empty(Nvl(tbalanta.ID_SUCURSALA,0))
						lcConditie = " and id_sucursala is null"
					Else
						lcConditie = " and id_sucursala = " + Alltrim(Str(tbalanta.ID_SUCURSALA))
					Endif
				Case llBalantaGrup
					lcConditie = " and id_sucursala is null"
			Endcase
		Else
			lcConditie = gcCondSucursala 
		Endif
		Return lcConditie
		
	ENDPROC

	PROCEDURE Destroy
		USE IN (SELECT('crsSucursale'))
	ENDPROC

	PROCEDURE do_excel
		If gcNumeProgram = [ROAMANAGER]
			x= xmenu("\<Standard;\<Formatat")
		Else
			x= 1
		Endif
		
		Do Case
		Case x=1
			Local i,xlsheet,XLApp,tmpsheet, lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
			lcAlias = This.grid1.RecordSource
			lcFiltru = Filter(lcAlias)
			If Empty(lcFiltru)
				lcFiltru = '.T.'
			Endif
		
			exista_excel=.T.
			lcColumnList = ''
			lcHeaderList = ''
			lcSelect = ''
			llSelect = .T.
			lcType = 'CURSOR'
			lcFrom = lcAlias
			lcWhere = lcFiltru
			lcOrder = 'g5,sucursala'
			lcOutput = 'crsBal'
		
			get_schema_grid(This.grid1,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
			&lcSelect
		*!*	MESSAGEBOX(p3)
			If Used(lcOutput)
				Do export_xls With lcOutput In oproceduri_comune.prg
				Use In (lcOutput)
			Endif
		Case x=2
			lcTabel = Thisform.grid1.RecordSource
		
			Select (lcTabel)
			lcFiltru = Filter(lcTabel)
			If Empty(lcFiltru)
				lcFiltru = '.T.'
			Endif
			lcFiltru = Filter()
			lcFiltru = Strtran(lcFiltru,'.AND.',' AND ')
			lcFiltru = Substr(lcFiltru,9,Len(lcFiltru)-8)
		
		
			Select g1, g2, g3, g4, Cont, acont, denumire, precdeb, preccred, ruldeb, rulcred, totdeb, totcred, solddeb, soldcred, ;
				SPACE(9) As cont_acont, sucursala ;
				FROM (lcTabel) ;
				WHERE &lcFiltru Order By g5, sucursala ;
				INTO Cursor cExcel Readwrite
		
			Select cExcel
			Replace All cont_acont With Alltrim(Cont)+ Iif(!Empty(acont),"_"+Alltrim(acont),"")
		
			Do lanseaza_excel_balanta With "cExcel" In viz_bal.prg
		
			If Used("cExcel")
				Use In cExcel
			Endif
		Endcase
		Return
		
		*!*	On Error Do exportare With Thisform.grid1.RecordSource,p1,p2
		*!*	tmpsheet = Getobject('','excel.sheet')
		*!*	On Error
		
		*!*	If exista_excel
		*!*		Wait Window "Se transmit datele catre Excel..." Nowait
		
		*!*		XLApp = tmpsheet.Application
		
		*!*		XLApp.workbooks.Close()
		*!*		XLApp.workbooks.Add()
		*!*		poExcel = XLApp.ActiveSheet
		*!*		Go Top
		*!*		poExcel.Cells(1,1).Font.Size=16
		*!*		poExcel.Cells(1,1).Font.Bold=.T.
		*!*		poExcel.Cells(1,1)=Thisform.titluFRUMOS1.Caption+" Luna "+Alltrim(Str(gnLuna))+"/"+Alltrim(Str(gnAn))
		*!*		nRows = 3
		*!*		With Thisform.grid1
		*!*			For nCol = 1 To .ColumnCount
		*!*				nColumn = .Columns(nCol).ColumnOrder
		*!*				poExcel.Columns(nColumn).ColumnWidth = .Columns(nCol).Width/7.5
		*!*				For lnobjcol=1 To .Columns(nCol).Objects.Count
		*!*					If Upper(.Columns(nCol).Objects(lnobjcol).BaseClass)='HEADER'
		*!*						poExcel.Cells(nRows,nColumn) = .Columns(nCol).Objects(lnobjcol).Caption
		*!*						Exit
		*!*					Endif
		*!*				Endfor
		*!*				poExcel.Cells(nRows,nColumn).Font.Bold = .T.
		*!*				poExcel.Cells(nRows,nColumn).Interior.ColorIndex = 16
		*!*			Endfor
		*!*			Scan
		*!*				nRows = nRows + 1
		*!*				For nCol = 1 To .ColumnCount
		*!*					nColumn = .Columns(nCol).ColumnOrder
		*!*					If At('CHECK',Upper(.Columns(nCol).CurrentControl))>0
		*!*						poExcel.Cells(nRows,nColumn)=Iif(Eval(.Columns(nCol).ControlSource)==0,'NU','DA')
		*!*					Else
		*!*						poExcel.Cells(nRows,nColumn) = IIF(empty(Eval(.Columns(nCol).ControlSource)),'',Eval(.Columns(nCol).ControlSource))
		*!*					Endif
		*!*				Endfor
		*!*			Endscan
		*!*		Endwith
		
		*!*		XLApp.Visible = .T.
		*!*	Endif
	ENDPROC

	PROCEDURE do_listare
		*!* 24.01.2011
		*!* marius.mutu
		*!* balanta cumulata
		
		*!* 04.08.2011
		*!* marius.mutu
		*!* listare foxypreview
		
		Private pcPerioadaRef	&&, pcDataOra
		Local lnOptiuneRaport, Tlist
		
		
		
		lnOptiuneRaport = xmenu('4 egalitati (Total sume precedente/Rulaje curente) ;' + ;
			'4 egalitati (Solduri initiale/Rulaje curente);' + ;
			'4 egalitati (Solduri 1 ianuarie/Total rulaje);' + ;
			'\-;' + ;
			'5 egalitati (A3);' + ;
			'6 egalitati (A3)')
		
		If Empty(m.lnOptiuneRaport)
			Return
		Endif
		
		*!*	pcDataOra = ''
		*!*	pcDataOra = get_ora(2)
		*!* 24.01.2011
		If !Empty(This.nAn2)
			pcPerioadaRef = 'Perioada ' + Padl(Alltrim(Str(This.nLuna1)),2,'0') + "/" + Alltrim(Str(This.nAn1)) + " - " + Padl(Alltrim(Str(This.nLuna2)),2,'0') + "/" + Alltrim(Str(This.nAn2))
		Else
			pcPerioadaRef = 'Luna ' + Padl(Alltrim(Str(gnLuna)),2,'0') + "/" + Alltrim(Str(gnAn))
		Endif
		*!* 24.01.2011 ^
		
		LNG1=Thisform.cktotal1.Value
		LNG2=Thisform.cktotal3.Value
		LNG3=Thisform.cktotal3.Value
		LNG4=Thisform.cktotal4.Value
		LNG5=Thisform.ckanalitic.Value
		
		*!* DACA SUNT PE FIRMA MAMA SI SE LISTEAZA CONTURILE DEFALCATE SAU DOAR DE PE O SUCURSALA
		*!* AFISEZ "TOATE SUCURSALELE" / "SUCURSALA X"
		lcSucursala = ''
		If glEMama
			Do Case
				Case crsSucursale.id_sucursala = -2 && BALANTA CENTRALIZATA
					lcSucursala = ' * TOATE SUCURSALELE * '
				Case crsSucursale.id_sucursala > 0
					lcSucursala = ' * ' + Strtran(Upper(Alltrim(crsSucursale.sucursala)),'BALANTA') + ' * '
			Endcase
		Endif
		LCBAL=Thisform.CALIas
		Select (LCBAL)
		
		LCPARTIALA=Iif(!Empty(Thisform.TXTcont.Value)," PARTIALA "," ")
		LCPARTIALA = lcSucursala + LCPARTIALA
		
		Do Case
			Case LNG5=1
				m.titlu='- ANALITICA'+LCPARTIALA+'-'
				Select (LCBAL)
				&T
				Replace All bifa With .F.
		
				Select Distinct Cont,bnivel,bifa From &LCBAL ;
					WHERE bnivel= 5 ;
					INTO Cursor listbal Readwrite
		
				If _Tally # 0
					Do Form frm_list_balana
		
					Select listbal
					Scan For bifa
						Scatter Name olist
						Select (LCBAL)
						Replace All bifa With .T. For Cont=olist.Cont And Inlist(bnivel, 5, 7) && total analitice pe firma sucursala/mama
						Select listbal
					Endscan
					Release olist
		
					Select (LCBAL)
					Tlist = T + ' and !bifa '
					&Tlist
				Endif
				Use In listbal
				Select (LCBAL)
		
			Case LNG4=1 And LNG5=0
				m.titlu='- SINTETICA'+LCPARTIALA+'-'
			Otherwise
				If Empty(LCPARTIALA)
					m.titlu=""
				Else
					m.titlu='-'+LCPARTIALA+'-'
				Endif
		Endcase
		
		lcRaport = ""
		Do Case
			Case m.lnOptiuneRaport = 1
				lcRaport="rapbal_a4_4_14_6_30" && A4 4 EGALITATI (TSP, RLC ,TS, SF)
		
			Case m.lnOptiuneRaport = 2
				lcRaport="rapbal_a4_4_14_6_30_a" && A4 4 EGALITATI (SI, RLC, TS, SF)
		
			Case m.lnOptiuneRaport = 3
				lcRaport="rapbal_a4_4_14_6_30_a1" && A4 4 EGALITATI (SI, TR, TS, SF)
		
			Case m.lnOptiuneRaport = 5
				lcRaport="rapbal_a3_5_14_6_30_a" && A3 5 EGALITATI (SI, TSP, RLC, TS, SF)
		
			Case m.lnOptiuneRaport = 6
				lcRaport="rapbal_a3_6_14_6_30_b" && A3 6 EGALITATI (SI, TSP,  RLC, TR, TS, SF)
		Endcase
		
		This.AlwaysOnTop = .F.
		*!* 04.08.2011
		*!*	goExport.export2frx(lcbal,lcRaport)
		goExport.export2frx(LCBAL,lcRaport, , , , , , .T.)
		*!* 04.08.2011 ^
		This.AlwaysOnTop = .T.
		*!*	If Reccount(LCBAL)>0
		*!*		This.AlwaysOnTop = .F.
		*!*		Report Format (lcRaport) To Printer Prompt Preview
		*!*		This.AlwaysOnTop = .T.
		*!*	Else
		*!*		amessagebox("Nu exista inregistrari pentru listare!",48,"Atentie")
		*!*	Endif
		
	ENDPROC

	PROCEDURE do_reface
		x= xmenu('Refacere \<lunara;Refacere cu \<precedente')
		lcSursa = [BALANTA]
		lnLuna = gnLuna
		lnAn = gnAn
		lcCont = []
		
		Do Case
		Case x = 1
			lcLunar = [0]
			*lcExec = [begin pack_refaceri.refac_balanta('] + gcS + [',] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,0); end;]
		Case x = 2
			lcLunar = [1]
			*lcExec = [begin pack_refaceri.refac_balanta('] + gcS + [',] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,1); end;]
		Otherwise
			Return
		Endcase
		
		*!*	lnSucces = goExecutor.oExecute(lcExec)
		*!*	If lnSucces < 0
		*!*		Messagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*		Return
		*!*	Endif
		
		lnSucces = refacere(lcSursa,lcLunar,lcCont,lnLuna,lnAn) && IN orefaceri.prg
		IF lnSucces > 0
			aMessagebox('Refacerea s-a terminat!',0+64,"Info refacere")
			Thisform.reconstruct
			Thisform.afisactual
			Do inainte With this.cProceduraInainte In oinainte_de.prg
		ENDIF 
	ENDPROC

	PROCEDURE do_situatii_cont
		Local lnOptiune
		Local lcBal, lcCont
		lcBal = Thisform.calias
		Select (m.lcBal)
		lcCont = Alltrim(Nvl(Cont, ''))
		If Empty(m.lcCont)
			AMESSAGEBOX('Alegeti un cont din balanta!', 0 + 48, _Screen.Caption)
			Return
		Endif
		
		lnOptiune = xmenu('Fisa cont;\-;Rulaj debit;Rulaj Credit;Rulaje Debit&Credit;\-;Total Debit;Total Credit;Total Debit&Credit')
		If Empty(m.lnOptiune)
			Return
		Endif
		Do Case
			Case m.lnOptiune = 1
				Thisform.fisacont
			Case m.lnOptiune = 3
				Thisform.RULDEB
			Case m.lnOptiune = 4
				Thisform.RULCRED
			Case m.lnOptiune = 5
				Thisform.RULDEBCRED
			Case m.lnOptiune = 7
				Thisform.TOTDEB
			Case m.lnOptiune = 8
				Thisform.TOTCRED
			Case m.lnOptiune = 9
				Thisform.TOTDEBCRED
		Endcase
	ENDPROC

	PROCEDURE fisacont
		Private lcbal
		lcbal=Thisform.calias
		*!*	modificare v 2.0.110
		*!*	lcCondSucursala = Thisform.conditieistoricact()
		*!*	modificare v 2.0.110	^
		Select (lcbal)
		Scatter Name locont
		*!*	modificare v 2.0.110
		If Empty(Substr(Nvl(locont.Cont,''),1,4))
			amessagebox("Nu exista contul in selectie!",48,"Atentie")
		Else
			lcCondSucursala = Thisform.conditieistoricact()
		*!*	modificare v 2.0.110	^
		
			Private pcselect1,pcfiltru1,pcorder1,pcschema1,poact
			Store "" To poact
			*!*	pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,NRACT N(14),DATAACT D,'+]+;
			*!*		['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
			*!*		['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
			*!*		['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
			*!*		['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
			*!*		['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
			*!*		['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
			*!*		['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1=['']
			pcselect1=['select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora, explicatie_tva from vact where 1=2']
			*!*	modificare v 2.0.110
			*!*		pcfiltru1=[(luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[) and (SCD=]+Substr(locont.Cont,1,4)+ lcCondSucursala + [ or scc=]+Substr(locont.Cont,1,4)+[)]
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[ and (SCD=']+ALLTRIM(Substr(locont.Cont,1,4))+[' or scc=']+ALLTRIM(Substr(locont.Cont,1,4))+[')] + lcCondSucursala
			*!*	modificare v 2.0.110	^
			pcorder1=[dataact,serie_act,nract]
			llAfisare=.F.
			*!*	gencursor('poact','act',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			gencursor('poact','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact.ca_baza1.afisare()
		
			*!*	SELE ACT
			*!*	SET FILTER TO SCD=SUBSTR(locont.CONT,1,4) AND !DELETED()
			*!*	Do NRORD With "ACT"
			*!*	ORC=Createobj("AFDEBCRED")
			*!*	ORC.LABELTITLU.Caption="FISA CONTULUI "+locont.Cont
			*!*	ORC.ALI = 'ACT'
			*!*	ORC.Show(1)
		
			Do NRORD With "ACN1"
			Select acn1
			Go Top
			ORC=Createobject("frm_debcred")
			ORC.lb_titlu_alb_b121.Caption=Thisform.lb_titlu_alb_b121.Caption+" - FISA CONTULUI "+locont.Cont
			ORC.lb_titlu1.Caption="FISA CONTULUI "+locont.Cont
			ORC._grdbase1.RemoveObject("cUtil")
			ORC._grdbase1.RemoveObject("cDataOra")
			ORC.Show(1)
		
			*!*	SELECT act
			*!*	SET FILTER TO
			Use In acn1
			Release poact
			Select(lcbal)
		*!*	modificare v 2.0.110
		Endif
		*!*	modificare v 2.0.110	^
		
	ENDPROC

	PROCEDURE inainte_de_do_excel
		If Thisform.lactiv1
			This.do_excel
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_listare
		If Thisform.lactiv2
			This.do_listare
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_modifica
		*!* NU POT FACE MODIFICARI DACA NU AM DREPT PE MODIFICARE SAU INTR-O LUNA INCHISA
		If !Thisform.lactiv3 Or glLunaInchisa
			Return
		Endif
		
		*!* NU POT FACE MODIFICARI PE BALANTA CUMULATA - NU AM ID_BAL
		IF glEMama
			IF crsSucursale.ID_SUCURSALA = -1
				aMessageBox('Nu se pot face modificari pe balanta centralizata!' + CRLF + 'Selectati balanta defalcata pe sucursale',0+64,'Balanta')
				RETURN
			ENDIF 	
		ENDIF 
		
		Thisform.meniu_as
		Thisform.grID1.SetFocus
	ENDPROC

	PROCEDURE inainte_de_do_reface
		If Thisform.lactiv4 And !glLunaInchisa
			This.do_reface()
		Endif
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Thisform.WindowState = 2
		
		If .F.
			lnLungimeBanda = Thisform.but_termin1.Width + 10
			lnPozitieButon = Thisform.but_termin1.Left
			lnLungimeButon = Thisform.but_termin1.Width + 1		&&	30 + 1 (spatiu)
			lnOffsetBanda = 6					&& diferenta dintre _shape2.left si but_termin1.left
		
		
			If Thisform.lactiv2
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.but_listare1.Left = lnPozitieButon
			Endif
			If Thisform.lactiv1
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.but_excel1.Left = lnPozitieButon
			Endif
			If Thisform.lactiv3 And !glLunaInchisa
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.but_modifica1.Left = lnPozitieButon
			Endif
			If Thisform.lactiv4 And !glLunaInchisa
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.BUT_reface1.Left = lnPozitieButon
			Endif
			With Thisform._shape2
				* With Thisform.banda_alba
				.Width = lnLungimeBanda
				.Left = lnPozitieButon - lnOffsetBanda
			Endwith
		Endif && .F.
		
		If This.BUT_reface1.Visible
			This.BUT_reface1.Visible=!glLunaInchisa
		Endif
		If This.but_modifica1.Visible
			This.but_modifica1.Visible=!glLunaInchisa
		Endif
		
		Public sz
		This.calias=This.grid1.RecordSource && TBALANTA
		Private lcbal
		lcbal=Thisform.calias
		
		Select(lcbal)
		Go Top
		
		Store 0.0000 To m.sprecdeb1,m.spreccred1,m.ssoldideb, m.ssoldicred, m.sprecdeb,m.spreccred,m.sruldeb,m.srulcred,m.stotdeb,m.stotcred,m.ssolddeb,m.ssoldcred
		
		If .F.
			With Thisform.grid1
				.cprecdeb1.Width=0
				.cpreccred1.Width=0
			Endwith
		Endif
		
		IF glEMama
			lnSucces = ccsucursale_mama() && IN updateserver.prg && vnom_sucursale_mama
		
			CREATE CURSOR crsSucursale (id_sucursala n(5), sucursala c(100))
			INSERT INTO crsSucursale (id_sucursala, sucursala) VALUES (-1, 'Balanta centralizata')
			INSERT INTO crsSucursale (id_sucursala, sucursala) VALUES (-2, 'Balanta pe sucursale')	
			INSERT INTO crsSucursale (id_sucursala, sucursala) VALUES (-3, 'Balanta grup')		
			SELECT crsSucursale
			APPEND FROM DBF('vnom_sucursale_mama')
			REPLACE ALL sucursala WITH 'Balanta ' + PROPER(ALLTRIM(sucursala)) FOR id_sucursala > 0
		
			close_ccsucursale_mama()
			SELECT crsSucursale
			GO TOP 
			WITH this.cboSucursale
				.RowSourceType = 6
				.RowSource = "crsSucursale.sucursala"
				.Visible = .T.
				this.cboSucursale.Value = crsSucursale.sucursala
			EndWith
		Else 
			this.grid1.cSucursala.Visible = .F.	 
		ENDIF 	
		*!* Locale
		*!* goLocale.SetLocale( thisform )
		*!* Locale ^
		this.gridextra1.setup()
		*MESSAGEBOX(this.grid1.cdenumire.text1.FontName + ' ' + TRANSFORM(this.grid1.cdenumire.text1.FontName))
		
		Thisform.afisactual
		
		
	ENDPROC

	PROCEDURE in_bal
		Parameters tnIdSucursala, tcCont,tcAcont,tlCalculeaza
		Private lcCont,lcField,lcOldAlias,lcTabela
		LOCAL lcIdSucursala
		
		lcOldAlias=Alias()
		lcField=This.cfield
		lnvalue=This.nnewvalue
		lnOldValue=This.noldvalue
		
		If lnvalue=lnOldValue
			Return
		Endif
		
		If Empty(tcAcont)
			lcAcont=""
		Else
			lcAcont=Upper(Alltrim(tcAcont))
		Endif
		
		If Empty(tcCont)
			lcCont=""
		Else
			lcCont=Upper(Alltrim(tcCont))
		Endif
		
		lcIdSucursala = ALLTRIM(STR(NVL(tnIdSucursala,0)))
		If !Empty(lcAcont)
			lcTabela = "balana"
			lcCond = [NVL(id_sucursala,0) = ] + lcIdSucursala + [ AND TRIM(UPPER(cont))=']+lcCont+[' and TRIM(UPPER(acont))=']+lcAcont+[' and an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnLuna))
		Else
			lcTabela = "bal"
			lcCond = [NVL(id_sucursala,0) = ] + lcIdSucursala + [ AND TRIM(UPPER(cont))=']+lcCont+[' and an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnLuna))
		Endif
		
		*!*	If !EXISTACAMP(lcTabela,lcField) && DACA NU EXISTA CAMPUL NU FAC NIMIC
		*!*		Return
		*!*	Endif
		
		&& setare zecimale
		pcexec=[update ] + ALLTRIM(lcTabela) + [ set ] + ALLTRIM(lcField) + [=] + ALLTRIM(STR(lnvalue,24,4)) + [ ] + ;
				[where ]+lcCond
		
				
		lnSucces=goExecutor.oexecute(pcexec)
		If lnSucces < 0
			lcTextEroare = goExecutor.cEroare
			aMessagebox(lcTextEroare,48,"Eroare")
			Return
		Endif
		
		If tlCalculeaza
			This.calculeaza_orizontal()
		Endif
		
		If !Empty(lcOldAlias)
			Select (lcOldAlias)
		Endif
	ENDPROC

	PROCEDURE meniu_as
		Private lcbal
		lcbal=Thisform.calias
		
		If Thisform.grid1.ReadOnly
			lcText=[\<Deblocare;]
			lcText=lcText+[\-;]
			lcText=lcText+[\Adauga Blanc;]
			lcText=lcText+[\Sterge]
		Else
			lcText=[\<Revenire;]
			lcText=lcText+[\-;]
			lcText=lcText+[\<Adauga Blanc;]
			lcText=lcText+[\<Sterge]
		Endif
		lnOpt=xmenu(lcText)
		Do Case
		Case lnOpt=1
			With Thisform.grid1
				.ReadOnly=!.ReadOnly
				.ccont.ReadOnly=.T.
				.cacont.ReadOnly=.T.
				.cdenumire.ReadOnly=.T.
		&& cont2003 oracle
				.ctotdeb.ReadOnly=.T.
				.ctotcred.ReadOnly=.T.
				.csolddeb.ReadOnly=.T.
				.csoldcred.ReadOnly=.T.
			Endwith
		Case lnOpt=3
			This.adauga_linie()
		Case lnOpt=4
			This.sterge_linie()
		Endcase
		
	ENDPROC

	PROCEDURE reconstruct
		*!*	LOCAL llsucces
		*!*	llSucces=save_grid_tag(this.grid1)
		*!*	IF llsucces
		*!*		lctabel=make_tbalanta()
		*!*		restore_grid_tag(this.grid1)
		*!*	ENDIF
		save_grid_tag(This.grid1)
		lcTabel=make_tbalanta(this.lCentru,this.nLuna1,this.nAn1,this.nLuna2,this.nAn2,this.cBal)
		restore_grid_tag(This.grid1)
	ENDPROC

	PROCEDURE Release
		Private lcbal
		lcbal=Thisform.calias
		
		Release m.sprecdeb,m.spreccred,m.sruldeb,m.srulcred,m.stotdeb,m.stotcred,m.ssolddeb,m.ssoldcred
		
		Select (lcbal)
		Set Filter To
		DoDefault()
		
	ENDPROC

	PROCEDURE Resize
		*THIS.RESIZER1.ONREsize 
		Thisform.Check1.Refresh() && CU ANCHOR SE MUTA LA POZITIA ANTERIOARA
										&& FARA ANCHOR NU SE MAI MUTA DELOC
										&& LE-AM MUTAT MANUAL
		DODEFAULT()
	ENDPROC

	PROCEDURE rulcred
		Private lcbal
		Local ORC As "frm_debcred"
		Local lcAcont, lcCondSucursala, lcCont, llAfisare
		*:Global LOCONT
		lcbal = Thisform.calias
		lcCondSucursala = Thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		Thisform.AlwaysOnTop = .F.
		If LOCONT.RULCRED == 0 Then
			AMESSAGEBOX('Rulaj Credit = 0', 0 + 64, _Screen.Caption)
		Else
			Private pcselect1, pcfiltru1, pcorder1, pcschema1, poact
			Store "" To poact
			lcCont = Alltrim(Nvl(LOCONT.Cont, ''))
			lcAcont = Alltrim(Nvl(LOCONT.acont, ''))
		
			pcschema1 = ['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+] + ;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+] + ;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+] + ;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+] + ;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+] + ;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+] + ;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+] + ;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1 = ['']
			pcselect1 = ["select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora, explicatie_tva from vact where 2=2"]
			pcfiltru1 = [luna = ] + Alltrim(Str(gnLuna)) + [ and an = ] + Alltrim(Str(gnAn)) + [ and scc = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascc = '] + m.lcAcont + ['], []) + lcCondSucursala
			pcorder1 = [dataact, serie_act, nract]
			llAfisare = .F.
			gencursor('poact', 'acn1', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfisare)
			poact.ca_baza1.afisare()
			*!*		Sele ACT
			*!*		Set Filter To SCC=Substr(LOCONT.cont,1,4) And !Deleted()
			*!*		ORC=Createobj("AFDEBCRED")
			*!*		With ORC
			*!*			.ali='act'
			*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - RULAJ CREDIT"
			*!*		Endwith
			ORC = Createobj("frm_debcred")
			With ORC
				.lb_titlu_alb_b121.Caption = "SITUATIE ANALITICA - RULAJ CREDIT"
				.lb_titlu1.Caption = "SITUATIE ANALITICA - RULAJ CREDIT"
				._grdbase1.RemoveObject("cUtil")
				._grdbase1.RemoveObject("cDataOra")
			Endwith
			ORC.Show(1)
			Use In acn1
			*!*		SELECT ACT
			*!*		SET FILTER TO
			*!*		Select act
			*!*		Use
			Release poact
		Endif
		
		Thisform.AlwaysOnTop = .T.
		Select (lcbal)
		Release LOCONT
	ENDPROC

	PROCEDURE ruldeb
		Private lcbal
		Local ORC As "frm_debcred"
		Local lcAcont, lcCondSucursala, lcCont, llAfisare
		*:Global LOCONT
		lcbal = Thisform.calias
		lcCondSucursala = Thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		Thisform.AlwaysOnTop = .F.
		If LOCONT.RULDEB == 0 Then
			AMESSAGEBOX('Rulaj Debit = 0', 0 + 64, _Screen.Caption)
		Else
			Private pcselect1, pcfiltru1, pcorder1, pcschema1, poact
			Store "" To poact
		
			lcCont = Alltrim(Nvl(LOCONT.Cont, ''))
			lcAcont = Alltrim(Nvl(LOCONT.acont, ''))
		
			pcschema1 = ['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+] + ;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+] + ;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+] + ;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+] + ;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+] + ;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+] + ;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+] + ;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1 = ['']
			pcselect1 = ['select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora,explicatie_tva from vact where 2=2']
			pcfiltru1 = [luna=] + Alltrim(Str(gnLuna)) + [ and an=] + Alltrim(Str(gnAn)) + lcCondSucursala + [ and scd = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascd = '] + m.lcAcont + ['], [])
			pcorder1 = [dataact, serie_act, nract]
			llAfisare = .F.
			gencursor('poact', 'acn1', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfisare)
			poact.ca_baza1.afisare()
		
			*!*		Sele ACT
			*!*		Set Filter To SCD=Substr(LOCONT.Cont,1,4) And !Deleted()
			*!*		ORC=Createobj("AFDEBCRED")
			*!*		With ORC
			*!*			.ali='act'
			*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - RULAJ DEBIT"
			*!*		Endwith
			*!*		ORC.Show(1)
			*!*		Select act
			*!*		Use
			ORC = Createobj("frm_debcred")
			With ORC
				.lb_titlu_alb_b121.Caption = "SITUATIE ANALITICA - RULAJ DEBIT"
				.lb_titlu1.Caption = "SITUATIE ANALITICA - RULAJ DEBIT"
				._grdbase1.RemoveObject("cUtil")
				._grdbase1.RemoveObject("cDataOra")
			Endwith
			ORC.Show(1)
		
			Use In acn1
			Release poact
		Endif
		Release ORC
		Thisform.AlwaysOnTop = .T.
		
		*!*	SELECT ACT
		*!*	SET FILTER TO
		
		Select(lcbal)
		Release LOCONT
	ENDPROC

	PROCEDURE ruldebcred
		Private lcbal
		lcbal=Thisform.calias
		lcCondSucursala = thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		If LOCONT.RULCRED=0 And LOCONT.RULDEB=0 Then
			AMESSAGEBOX('Nu exista rulaje in luna.',0+64,_Screen.Caption)
		Else
			Private pcselect1,pcfiltru1,pcschema1,poact,poact1,poact2
			Store "" To poact,poact1,poact2
			
			lcCont = Alltrim(Nvl(LOCONT.Cont, ''))
			lcAcont = Alltrim(Nvl(LOCONT.acont, ''))
				
		*!*		pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,NRACT N(14),DATAACT D,'+]+;
		*!*			['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
		*!*			['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
		*!*			['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
		*!*			['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
		*!*			['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
		*!*			['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
		*!*			['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
		*!*		pcschema1=['']
		*!*		pcselect1=["select dataact,serie_act,nract,suma,explicatia,scd,ascd,scc,ascc,partd,partc,dataireg,fdoc from vact where 2=2"]
		*!*		pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn)) + lcCondSucursala 
		*!*		pcorder1=[dataact, serie_act,nract]
		*!*		llAfisare=.F.
		*!*		gencursor('poact','act',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
		*!*		poact.ca_baza1.afisare()
		*!*		Sele ACT
		*!*	*DO NRORD WITH "ACT"
		*!*		Sele 0
		
			pcselect1=["select * from vact where 2=2"]
			pcschema1=['']
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[ and scd = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascd = '] + m.lcAcont + ['], [])+lcCondSucursala 
			pcorder1=[dataact, nract]
			llAfisare=.F.
			gencursor('poact1','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact1.ca_baza1.afisare()
		*!*			USE &DATE/ACT.DBF;
		*!*			AGAIN ALIAS ACn1
		*!*			SET FILTER TO SCD=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
		
			pcselect1=["select * from vact where 2=2"]
			pcschema1=['']
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[ and scc = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascc = '] + m.lcAcont + ['], [])+lcCondSucursala 
			pcorder1=[dataact, serie_act, nract]
			llAfisare=.F.
			gencursor('poact2','acn2',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact2.ca_baza1.afisare()
		*!*			SELE 0
		*!*			USE &DATE/ACT.DBF;
		*!*			AGAIN ALIAS ACn2
		*!*			SET FILTER TO SCC=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
		
		*!*		ORC=Createobj("AFDEBsiCRED")
		*!*		ORC.Caption="SITUATIE ANALITICA - Rulaje Cont "+LOCONT.Cont
		*!*		ORC.Show(1)
			orc=CREATEOBJECT("frm_debsicred")
			orc.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - Rulaje Cont "+LOCONT.Cont
			orc.show(1)
			Sele acn1
			Use
			Sele acn2
			Use
		
		*!*		modificare
		*!*		Select ACT
			USE IN (SELECT('act'))
			Release poact,poact1,poact2,ORC
		*!*
		Endif
		
		Select(lcbal)
		Release LOCONT
		
	ENDPROC

	PROCEDURE sterge_linie
		LOCAL lcIdSucursala
		Private lcbal,lcContS,lcContA
		lcbal=This.calias
		
		Select (lcbal)
		lcContS=Alltrim(Cont)
		lcContA=Alltrim(acont)
		
		If Empty(lcContS) And Empty(lcContA)
			aMessagebox("Nu puteti sterge un total!",0+48,"Atentie")
			Return
		Endif
		
		lcIdSucursala = IIF(NVL(id_sucursala,0) = 0, 'NULL', ALLTRIM(STR(id_sucursala)))
		pcexec=[begin pack_inregistrari.baldelproc(] + lcIdSucursala + [,] + ALLTRIM(STR(gnLuna)) + [,] + ALLTRIM(STR(gnAn))+ [,']+lcContS+[',']+lcContA+['); end;]
		lnSucces=goExecutor.oexecute(pcexec)
		If lnSucces < 0
			lcTextEroare = goExecutor.cEroare
			If "ORA-20000"$lcTextEroare
				lnPozi=At("ORA-20000",lcTextEroare)+11
				lnPozf=At("ORA",lcTextEroare,2)
				lcTextEroare=Substr(lcTextEroare,lnPozi,lnPozf-lnPozi)
			Endif
			aMessagebox(lcTextEroare,48,"Eroare")
			Return
		Endif
		
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		This.reconstruct
		This.afisactual
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
		
	ENDPROC

	PROCEDURE totcred
		Private lcbal
		Local ORC As "frm_debcred"
		Local lcAcont, lcCondSucursala, lcCont, llAfisare
		*:Global LOCONT, pcorder1
		lcbal = Thisform.calias
		lcCondSucursala = Thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		lcCont = Alltrim(Nvl(LOCONT.Cont, ''))
		lcAcont = Alltrim(Nvl(LOCONT.acont, ''))
		Thisform.AlwaysOnTop = .F.
		
		If LOCONT.TOTCRED == 0 Then
			AMESSAGEBOX('Total Credit = 0', 0 + 64, _Screen.Caption)
		Else
			Private pcselect1, pcfiltru1, pcschema1, poact
			Store "" To poact
			pcschema1 = ['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+] + ;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+] + ;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+] + ;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+] + ;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+] + ;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+] + ;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+] + ;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1 = ['']
			pcselect1 = ["select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora,explicatie_tva from vact where 2=2"]
			pcfiltru1 = [scc = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascc = '] + m.lcAcont + ['], []) + lcCondSucursala
		
			pcorder1 = [dataact, serie_act,nract]
			llAfisare = .F.
			gencursor('poact', 'acn1', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfisare)
			poact.ca_baza1.afisare()
		
			*!*		Sele ACTAN
			*!*	*		DO NRORD WITH "ACTAN"
			*!*		*	sum suma to totsum
			*!*			SET FILTER TO SCC=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
			*!*		ORC=Createobj("AFDEBCRED")
			*!*		With ORC
			*!*			.ali='actan'
			*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - TOTAL CREDIT"
			*!*		Endwith
			*!*		ORC.Show(1)
			ORC = Createobj("frm_debcred")
			With ORC
				.lb_titlu_alb_b121.Caption = "SITUATIE ANALITICA - TOTAL CREDIT"
				.lb_titlu1.Caption = "SITUATIE ANALITICA - TOTAL CREDIT"
				._grdbase1.RemoveObject("cUtil")
				._grdbase1.RemoveObject("cDataOra")
			Endwith
			ORC.Show(1)
			*!*			SELECT ACTAN
			*!*			SET FILTER TO
			*!*	  	modificare
			*!*		Select ACTAN
			*!*		Use
			Use In acn1
			Release poact
			*!*
		Endif
		Release ORC
		Thisform.AlwaysOnTop = .T.
		
		Select (lcbal)
		
	ENDPROC

	PROCEDURE totdeb
		Private lcbal
		Local orc As "frm_debcred"
		Local lcAcont, lcCondSucursala, lcCont, llAfisare
		*:Global LOCONT, pcorder1
		lcbal = Thisform.calias
		lcCondSucursala = Thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		lcCont = Alltrim(Nvl(LOCONT.Cont, ''))
		lcAcont = Alltrim(Nvl(LOCONT.acont, ''))
		Thisform.AlwaysOnTop = .F.
		If LOCONT.TOTDEB == 0 Then
			AMESSAGEBOX('Total Debit = 0', 0 + 64, _Screen.Caption)
		Else
			Private pcselect1, pcfiltru1, pcschema1, poact
			Store "" To poact
			pcschema1 = ['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+] + ;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+] + ;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+] + ;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+] + ;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+] + ;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+] + ;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+] + ;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1 = ['']
			pcselect1 = ["select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora,explicatie_tva from vact where 2=2"]
			pcfiltru1 = [scd = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascd = '] + m.lcAcont + ['], []) + lcCondSucursala	
			pcorder1 = [dataact, serie_act, nract]
			llAfisare = .F.
			gencursor('poact', 'acn1', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfisare)
			poact.ca_baza1.afisare()
		
			*!*		Sele ACTAN
			*!*	*		DO NRORD WITH "ACTAN"
			*!*	*	sum suma to totsum
			*!*		SET FILTER TO SCD=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
			*!*	*		DO NRORD WITH "ACTAN"
			*!*		ORC=Createobj("AFDEBCRED")
			*!*		With ORC
			*!*			.ali='actan'
			*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - TOTAL DEBIT"
			*!*		Endwith
			*!*		ORC.Show(1)
			orc = Createobject("frm_debcred")
			With orc
				.lb_titlu_alb_b121.Caption = "SITUATIE ANALITICA - TOTAL DEBIT"
				.lb_titlu1.Caption = "SITUATIE ANALITICA - TOTAL DEBIT"
				._grdbase1.RemoveObject("cUtil")
				._grdbase1.RemoveObject("cDataOra")
			Endwith
			orc.Show(1)
			*!*		SELECT ACTAN
			*!*		SET FILTER TO
		
			*!* modificare
			*!*		Select ACTAN
			*!*		Use
			Use In acn1
			Release poact
			*!*
		Endif
		
		Thisform.AlwaysOnTop = .T.
		Select (lcbal)
		Release LOCONT
		
	ENDPROC

	PROCEDURE totdebcred
		Private lcbal
		Local orc As "frm_debsicred"
		Local lcAcont, lcCondSucursala, lcCont, llAfisare
		*:Global LOCONT, pcorder1
		lcbal = Thisform.calias
		lcCondSucursala = Thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		lcCont = Alltrim(Nvl(LOCONT.Cont, ''))
		lcAcont = Alltrim(Nvl(LOCONT.acont, ''))
		Thisform.AlwaysOnTop = .F.
		If LOCONT.TOTCRED == 0 And LOCONT.TOTDEB == 0 Then
			AMESSAGEBOX('Contul ' + Alltrim(LOCONT.Cont) + ' este neutilizat!', 0 + 64, _Screen.Caption)
		Else
			Private pcselect1, pcfiltru1, pcschema1, poact, poact1, poact2
			Store "" To poact, poact1, poact2
			*!*		pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,NRACT N(14),DATAACT D,'+]+;
			*!*			['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
			*!*			['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
			*!*			['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
			*!*			['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
			*!*			['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
			*!*			['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
			*!*			['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1 = ['']
			*!*		pcselect1=["select * from ] + gcS + [.vact where 2=2"]
			*!*		pcfiltru1=[2=2]
			*!*		pcorder1=[]
			*!*		llAfisare=.F.
			*!*		gencursor('poact','actan',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			*!*		poact.ca_baza1.afisare()
		
			*!*		Sele ACTan
			*!*	*	DO NRORD WITH "ACTan"
			Sele 0
			&&	 to_char(dataact,'DD/MM/YYYY') as
			pcselect1 = ["select dataact,serie_act,nract,suma,explicatia,scd,ascd,scc,ascc,partd,partc,dataireg,fdoc from vact where 2=2"]
			pcfiltru1 = [scd = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascd = '] + m.lcAcont + ['], []) + lcCondSucursala
			pcorder1 = [dataact,serie_act, nract]
			llAfisare = .F.
			gencursor('poact1', 'acn1', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfisare)
			poact1.ca_baza1.afisare()
			*!*			USE &DATEan/ACTan.DBF;
			*!*			AGAIN ALIAS ACn1
			*!*			SET FILTER TO SCD=SUBSTR(locont.CONT,1,4) AND !DELETED()
		
			pcselect1 = ["select dataact,serie_act,nract,suma,explicatia,scd,ascd,scc,ascc,partd,partc,dataireg,fdoc from vact where 2=2"]
			pcfiltru1 = [scc = '] + m.lcCont + ['] + Iif(!Empty(m.lcAcont), [ and ascc = '] + m.lcAcont + ['], []) + lcCondSucursala
			pcorder1 = [dataact, serie_act,nract]
			llAfisare = .F.
			gencursor('poact2', 'acn2', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfisare)
			poact2.ca_baza1.afisare()
			*!*			SELE 0
			*!*			USE &DATEan/ACTan.DBF;
			*!*			AGAIN ALIAS ACn2
			*!*			SET FILTER TO SCC=SUBSTR(locont.CONT,1,4) AND !DELETED()
			*!*		ORC=Createobj("AFDEBsiCRED")
			*!*		ORC.Caption="SITUATIE ANALITICA - Total Cont "+LOCONT.Cont
			*!*		ORC.Show(1)
			orc = Createobject("frm_debsicred")
			orc.lb_titlu_alb_b121.Caption = "SITUATIE ANALITICA - Total Cont " + LOCONT.Cont
			orc.Show(1)
		
			Sele acn1
			Use
			Sele acn2
			Use
			*!*	  	modificare
			*!*		Select ACTan
			*!*		Use
			Release poact, poact1, poact2
			Release orc
			*!*
		Endif
		
		Thisform.AlwaysOnTop = .T.
		Select (lcbal)
		
	ENDPROC

	PROCEDURE cboSucursale.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Check1.Refresh
		With Thisform
			If Thisform.Cksold1.Value = 0 && FARA SOLDURI 1 IANUARIE
				.lbldebit.Left=.text1.Left-.lbldebit.Width
				.lblcredit.Left=.text2.Left-.lblcredit.Width
				.check1.Left=.label8.Left-.lbldebit.Width
			Else
				.lbldebit.Left=.txtprecdeb1.Left-.lbldebit.Width
				.lblcredit.Left=.txtpreccred1.Left-.lblcredit.Width
				.check1.Left=.lblsld1.Left-.lbldebit.Width
			Endif
		Endwith
		
	ENDPROC

	PROCEDURE Check1.Valid
		thisform.afisactual 
		IF this.Value = 1
			this.Caption = 'Analitice'
		ELSE 
			this.Caption = 'Sintetice'
		ENDIF 
	ENDPROC

	PROCEDURE ckanalitic.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE cksold1.Valid
		thisform.afisactual 
		
	ENDPROC

	PROCEDURE cktotal1.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE cktotal2.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE cktotal3.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE cktotal4.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE Ck_acont.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ck_cont.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ck_denumire.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ct1.Text1.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ct1.Text2.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ct1.Text3.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ct1.Text4.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.DblClick
			thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.GotFocus
		lcSufix="cont"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.Valid
		thisform.nnewvalue=this.value
		LOCAL lcCont
		lcCont=thisform.noldvalue
		RETURN .T.
		thisform.in_bal(lcCont)
		
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.GotFocus
		lcSufix="denumire"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.Valid
		RETURN .T.
		PRIVATE lcbal
		lcBal=thisform.calias 
		LOCAL lcCont,lcAcont
		
		
		thisform.nnewvalue=this.value
		SELECT (lcBal)
		lcCont=cont
		lcAcont=acont
		
		thisform.in_bal(lcCont,lcAcont)
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.GotFocus
		lcSufix="PRECCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.cpreccred1.Text1.GotFocus
		lcSufix="PRECCRED1"
		thisform.cField=lcSufix
	ENDPROC

	PROCEDURE Grid1.cpreccred1.Text1.Valid
		thisform.calculeaza
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.GotFocus
		lcSufix="PRECDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.cprecdeb1.Text1.GotFocus
		lcSufix="PRECDEB1"
		thisform.cField=lcSufix
	ENDPROC

	PROCEDURE Grid1.cprecdeb1.Text1.Valid
		thisform.calculeaza
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.GotFocus
		lcSufix="RULCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.Valid
		thisform.calculeaza
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.GotFocus
		lcSufix="RULDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.GotFocus
		lcSufix="SOLDCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.GotFocus
		lcSufix="SOLDDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.Valid
		thisform.calculeaza
		
		
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.GotFocus
		lcSufix="TOTCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.GotFocus
		lcSufix="TOTDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.DblClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.Init
		*!*	this.SetAll("DynamicForeCOlor",;
		*!*	"IIF(!EMPTY(cont),RGB(0,0,0),IIF(nivel=1,RGB(0,0,255),RGB(0,128,128)))","Column")
		
		this.SetAll("DynamicForeCOlor","IIF(BNIVEL<3,RGB(0,0,255),RGB(0,0,0))","Column")
		this.SetAll("DynamicForeCOlor","IIF(difana=1,RGB(128,0,255),RGB(0,0,0))","Column")
		
		this.SetAll("DynamicFontbold","IIF(INLIST(BNIVEL,1,3),.t.,.f.)","Column")
		
	ENDPROC

	PROCEDURE Text1.Refresh
		THIS.FORECOLOR=IIF(M.SPRECDEB>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text2.Refresh
		THIS.FORECOLOR=IIF(M.SPRECCRED>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text3.Refresh
		THIS.FORECOLOR=IIF(M.SRULCRED>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text4.Refresh
		THIS.FORECOLOR=IIF(M.SRULDEB>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text5.Refresh
		THIS.FORECOLOR=IIF(M.STOTDEB>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text6.Refresh
		THIS.FORECOLOR=IIF(M.STOTCRED>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text7.Init
		sum solddeb to m.ssolddeb
		this.refresh
	ENDPROC

	PROCEDURE Text8.Init
		sum soldcred to m.ssoldcred
		this.refresh
	ENDPROC

	PROCEDURE txtcont.Valid
		thisform.txtcont2.Value = this.Value 
		thisform.afisactual
		
	ENDPROC

	PROCEDURE txtcont2.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE txtpreccred1.Refresh
		THIS.FORECOLOR=IIF(M.SPRECCRED1>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE txtprecdeb1.Refresh
		THIS.FORECOLOR=IIF(M.SPRECDEB1>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_balanta_original AS formtermin OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="oMenuShortcut" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.txtprecdeb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.txtpreccred1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Text6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.lblsld1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.lbldebit" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p1.lblcredit" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.cktotal4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.ckanalitic" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.cktotal2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.cktotal1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.cktotal3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.cksold1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.Ck_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.cboSucursale" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.Ck_acont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P2.Ck_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p3.Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.p3.Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P4.Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P4.cboRaport" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf.P4.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Resizer1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtcont2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdenumire.Header2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb.Header3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred.Header4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cruldeb.Header5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cruldeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.crulcred.Header6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.crulcred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotdeb.Header7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotdeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotcred.Header8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ctotcred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csoldcred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csoldcred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csolddeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.csolddeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cacont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cacont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cprecdeb1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cpreccred1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSucursala.Text1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: adauga_linie
		*m: afisactual
		*m: butapend
		*m: butdrept
		*m: calculeaza
		*m: calculeaza_orizontal
		*m: calculeaza_vertical
		*m: cfield_assign
		*m: conditieistoricact
		*m: fisacont
		*m: in_bal
		*m: meniu_as
		*m: reconstruct
		*m: rulcred
		*m: ruldeb
		*m: ruldebcred
		*m: sterge_linie
		*m: totcred
		*m: totdeb
		*m: totdebcred
		*p: calias
		*p: cbal
		*p: ccont
		*p: cfield
		*p: cprocedurainainte
		*p: lcentru
		*p: nan1
		*p: nan2
		*p: nluna1
		*p: nluna2
		*p: nnewvalue
		*p: noldvalue
		*p: oafbalana
	*</DefinedPropArrayMethod>

	*<PropValue>
		AlwaysOnTop = .F.
		BackColor = 255,255,255
		BorderStyle = 1
		calias = TBALANTA
		cbal = 
		cbuton4 = but_reface1
		cfield = 
		cprocedurainainte = balanta
		DoCreate = .T.
		FontCharSet = 238
		FontName = "Segoe UI"
		FontSize = 10
		Height = 478
		lactiv1 = .F.
		lactiv2 = .F.
		lactiv3 = .F.
		lactiv4 = .F.
		lcentru = .F.
		Name = "frm_balanta"
		nan1 = 2000
		nan2 = 2000
		nluna1 = 1
		nluna2 = 1
		nnewvalue = 0
		noldvalue = 0
		ScrollBars = 0
		Width = 806
		WindowType = 1
		_shape1.Anchor = 10
		_shape1.BorderStyle = 0
		_shape1.Height = 35
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 828
		_shape1.ZOrderSet = 1
		_shape2.Comment = "*:OnResize=RT"
		_shape2.Height = 36
		_shape2.Left = 648
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 153
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Balanta de verificare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Comment = "*:OnResize=RT"
		BUT_TERMIN1.Left = 768
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 4
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 739, ;
		Name = "But_excel1", ;
		Top = 4, ;
		Visible = .F., ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 709, ;
		Name = "But_listare1", ;
		Top = 4, ;
		Visible = .F., ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 679, ;
		Name = "But_modifica1", ;
		Top = 4, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 649, ;
		Name = "But_reface1", ;
		Top = 4, ;
		Visible = .F., ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ct1' AS ct WITH ;
		Height = 25, ;
		Left = 67, ;
		Name = "Ct1", ;
		SpecialEffect = 0, ;
		TabIndex = 3, ;
		Top = 113, ;
		Width = 59, ;
		ZOrderSet = 15, ;
		Shape1.Name = "Shape1", ;
		Text1.Height = 21, ;
		Text1.Left = 1, ;
		Text1.Name = "Text1", ;
		Text1.Top = 1, ;
		Text1.Width = 13, ;
		Text2.Left = 14, ;
		Text2.Name = "Text2", ;
		Text2.Top = 1, ;
		Text3.Left = 26, ;
		Text3.Name = "Text3", ;
		Text3.Top = 1, ;
		Text4.Height = 21, ;
		Text4.Left = 39, ;
		Text4.Name = "Text4", ;
		Text4.Top = 1, ;
		Text4.Width = 14, ;
		Line1.Left = 14, ;
		Line1.Name = "Line1", ;
		Line1.Top = -9, ;
		Line2.Left = 26, ;
		Line2.Name = "Line2", ;
		Line2.Top = -9, ;
		Line3.Left = 39, ;
		Line3.Name = "Line3", ;
		Line3.Top = -9
		*< END OBJECT: ClassLib="ferestre_cere_date.vcx" BaseClass="container" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 14, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		Height = 322, ;
		Left = 0, ;
		Name = "Grid1", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "TBALANTA", ;
		RowHeight = 20, ;
		TabIndex = 4, ;
		Top = 143, ;
		Width = 799, ;
		ZOrderSet = 21, ;
		Column1.Alignment = 0, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "CONT", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Format = "", ;
		Column1.InputMask = "", ;
		Column1.Name = "ccont", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 29, ;
		Column2.Alignment = 0, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "DENUMIRE", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cdenumire", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 141, ;
		Column3.Alignment = 1, ;
		Column3.BackColor = 187,235,255, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "PRECDEB", ;
		Column3.DynamicForeColor = "IIF(PRECDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Format = "r", ;
		Column3.InputMask = (get_mask(16,gnPA)), ;
		Column3.Name = "cprecdeb", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 72, ;
		Column4.Alignment = 1, ;
		Column4.BackColor = 187,235,255, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "PRECCRED", ;
		Column4.DynamicForeColor = "IIF(PRECCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "r", ;
		Column4.InputMask = (get_mask(16,gnPA)), ;
		Column4.Name = "cpreccred", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 72, ;
		Column5.Alignment = 1, ;
		Column5.BackColor = 236,249,255, ;
		Column5.ColumnOrder = 8, ;
		Column5.ControlSource = "RULDEB", ;
		Column5.DynamicForeColor = "IIF(RULDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "R", ;
		Column5.InputMask = (get_mask(16,gnPA)), ;
		Column5.Name = "cruldeb", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 72, ;
		Column6.Alignment = 1, ;
		Column6.BackColor = 236,249,255, ;
		Column6.ColumnOrder = 9, ;
		Column6.ControlSource = "RULCRED", ;
		Column6.DynamicForeColor = "IIF(RULCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "R", ;
		Column6.InputMask = (get_mask(16,gnPA)), ;
		Column6.Name = "crulcred", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 73, ;
		Column7.Alignment = 1, ;
		Column7.BackColor = 187,235,255, ;
		Column7.ColumnOrder = 10, ;
		Column7.ControlSource = "TOTDEB", ;
		Column7.DynamicForeColor = "IIF(TOTDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Format = "r", ;
		Column7.InputMask = (get_mask(16,gnPA)), ;
		Column7.Name = "ctotdeb", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 83, ;
		Column8.Alignment = 1, ;
		Column8.BackColor = 187,235,255, ;
		Column8.ColumnOrder = 11, ;
		Column8.ControlSource = "TOTCRED", ;
		Column8.DynamicForeColor = "IIF(TOTCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "r", ;
		Column8.InputMask = (get_mask(16,gnPA)), ;
		Column8.Name = "ctotcred", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 85, ;
		Column9.Alignment = 1, ;
		Column9.BackColor = 236,249,255, ;
		Column9.ColumnOrder = 13, ;
		Column9.ControlSource = "SOLDCRED", ;
		Column9.DynamicForeColor = "IIF(SOLDCRED>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Format = "r", ;
		Column9.InputMask = (get_mask(16,gnPA)), ;
		Column9.Name = "csoldcred", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 70, ;
		Column10.Alignment = 1, ;
		Column10.BackColor = 236,249,255, ;
		Column10.ColumnOrder = 12, ;
		Column10.ControlSource = "SOLDDEB", ;
		Column10.DynamicForeColor = "IIF(SOLDDEB>=0, RGB(0,0,0), RGB(255,0,0))", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Format = "r", ;
		Column10.InputMask = (get_mask(16,gnPA)), ;
		Column10.Name = "csolddeb", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 66, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 2, ;
		Column11.ControlSource = "ACONT", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cacont", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 40, ;
		Column12.BackColor = 236,249,255, ;
		Column12.ColumnOrder = 4, ;
		Column12.ControlSource = "precdeb1", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Format = "RK", ;
		Column12.InputMask = (get_mask(18,gnPA)), ;
		Column12.Name = "cprecdeb1", ;
		Column12.ReadOnly = .T., ;
		Column12.Visible = .F., ;
		Column12.Width = 0, ;
		Column13.BackColor = 236,249,255, ;
		Column13.ColumnOrder = 5, ;
		Column13.ControlSource = "preccred1", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "RK", ;
		Column13.InputMask = (get_mask(18,gnPA)), ;
		Column13.Name = "cpreccred1", ;
		Column13.ReadOnly = .T., ;
		Column13.Visible = .F., ;
		Column13.Width = 0, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ControlSource = "sucursala", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cSucursala", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 164
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'Grid1.cacont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cacont.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.ccont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.ccont.Text1' AS textbox WITH ;
		Alignment = 0, ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cdenumire.Header2' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header2"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cdenumire.Text1' AS textbox WITH ;
		Alignment = 0, ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cpreccred.Header4' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec.Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header4"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cpreccred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cpreccred1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Credit 1 ian. ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cpreccred1.Text1' AS textbox WITH ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cprecdeb.Header3' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec.Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header3"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cprecdeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cprecdeb1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Debit 1 ian.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cprecdeb1.Text1' AS textbox WITH ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.crulcred.Header6' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rul.Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header6"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.crulcred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderColor = 0,0,0, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cruldeb.Header5' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rul.Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header5"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cruldeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.csoldcred.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.csoldcred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.csolddeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.csolddeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 236,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cSucursala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sucursala", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cSucursala.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.ctotcred.Header8' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header8"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.ctotcred.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.ctotdeb.Header7' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header7"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.ctotdeb.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 187,235,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		Left = 627, ;
		Name = "Gridextra1", ;
		Top = 377
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Label1' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Selectie cont", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		FontCharSet = 1, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 8, ;
		Name = "Label1", ;
		TabIndex = 13, ;
		Top = 67, ;
		Width = 75, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label2' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "De la", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 9, ;
		Name = "Label2", ;
		TabIndex = 13, ;
		Top = 90, ;
		Width = 32, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label3' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Analitic", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 9, ;
		Name = "Label3", ;
		TabIndex = 13, ;
		Top = 116, ;
		Width = 45, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label4' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "la", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 89, ;
		Name = "Label4", ;
		TabIndex = 13, ;
		Top = 90, ;
		Width = 12, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'oMenuShortcut' AS menulib WITH ;
		Left = 264, ;
		Name = "oMenuShortcut", ;
		TabIndex = 6, ;
		Top = 0, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="utility.vcx" BaseClass="container" />

	ADD OBJECT 'Optiongroup1' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 10, ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		Height = 79, ;
		Left = 396, ;
		Name = "Optiongroup1", ;
		SpecialEffect = 1, ;
		TabIndex = 11, ;
		Top = 60, ;
		Value = 1, ;
		Width = 203, ;
		ZOrderSet = 4, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "\<Balanta", ;
		Option1.ControlSource = "", ;
		Option1.FontName = "Courier New", ;
		Option1.FontSize = 8, ;
		Option1.Height = 16, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 71, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "\<Rulaj Debit", ;
		Option2.ControlSource = "", ;
		Option2.Enabled = .F., ;
		Option2.FontName = "Courier New", ;
		Option2.FontSize = 8, ;
		Option2.Height = 16, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 18, ;
		Option2.Width = 99, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "R\<ulaj Credit", ;
		Option3.ControlSource = "", ;
		Option3.Enabled = .F., ;
		Option3.FontName = "Courier New", ;
		Option3.FontSize = 8, ;
		Option3.Height = 16, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 31, ;
		Option3.Width = 106, ;
		Option4.AutoSize = .T., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "Tota\<l Debit", ;
		Option4.ControlSource = "", ;
		Option4.Enabled = .F., ;
		Option4.FontName = "Courier New", ;
		Option4.FontSize = 8, ;
		Option4.Height = 16, ;
		Option4.Left = 5, ;
		Option4.Name = "Option4", ;
		Option4.Top = 44, ;
		Option4.Width = 99, ;
		Option5.AutoSize = .T., ;
		Option5.BackStyle = 0, ;
		Option5.Caption = "T\<otal Credit", ;
		Option5.ControlSource = "", ;
		Option5.Enabled = .F., ;
		Option5.FontName = "Courier New", ;
		Option5.FontSize = 8, ;
		Option5.Height = 16, ;
		Option5.Left = 5, ;
		Option5.Name = "Option5", ;
		Option5.Top = 58, ;
		Option5.Width = 106, ;
		Option6.AutoSize = .T., ;
		Option6.BackStyle = 0, ;
		Option6.Caption = "Option6", ;
		Option6.FontName = "Courier New", ;
		Option6.FontSize = 8, ;
		Option6.Height = 16, ;
		Option6.Left = 120, ;
		Option6.Name = "Option6", ;
		Option6.Top = 5, ;
		Option6.Width = 71, ;
		Option7.AutoSize = .T., ;
		Option7.BackStyle = 0, ;
		Option7.Caption = "Option7", ;
		Option7.FontName = "Courier New", ;
		Option7.FontSize = 8, ;
		Option7.Height = 16, ;
		Option7.Left = 120, ;
		Option7.Name = "Option7", ;
		Option7.Top = 18, ;
		Option7.Width = 71, ;
		Option8.AutoSize = .T., ;
		Option8.BackStyle = 0, ;
		Option8.Caption = "Option8", ;
		Option8.FontName = "Courier New", ;
		Option8.FontSize = 8, ;
		Option8.Height = 16, ;
		Option8.Left = 120, ;
		Option8.Name = "Option8", ;
		Option8.Top = 31, ;
		Option8.Width = 71, ;
		Option9.AutoSize = .T., ;
		Option9.BackStyle = 0, ;
		Option9.Caption = "Option9", ;
		Option9.FontName = "Courier New", ;
		Option9.FontSize = 8, ;
		Option9.Height = 16, ;
		Option9.Left = 120, ;
		Option9.Name = "Option9", ;
		Option9.Top = 44, ;
		Option9.Width = 71, ;
		Option10.AutoSize = .T., ;
		Option10.BackStyle = 0, ;
		Option10.Caption = "Option10", ;
		Option10.FontName = "Courier New", ;
		Option10.FontSize = 8, ;
		Option10.Height = 16, ;
		Option10.Left = 120, ;
		Option10.Name = "Option10", ;
		Option10.Top = 58, ;
		Option10.Width = 78
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'pf' AS pageframe WITH ;
		Anchor = 15, ;
		Comment = "*:OnResize=ST", ;
		ErasePage = .T., ;
		Height = 111, ;
		Left = 1, ;
		Name = "pf", ;
		PageCount = 4, ;
		TabIndex = 5, ;
		Top = 35, ;
		Width = 800, ;
		ZOrderSet = 11, ;
		Page1.BackColor = 255,255,255, ;
		Page1.Caption = "Total sume", ;
		Page1.FontBold = .T., ;
		Page1.FontCharSet = 238, ;
		Page1.FontSize = 10, ;
		Page1.Name = "p1", ;
		Page2.BackColor = 255,255,255, ;
		Page2.Caption = "Selectii", ;
		Page2.FontBold = .T., ;
		Page2.FontCharSet = 238, ;
		Page2.FontSize = 10, ;
		Page2.Name = "P2", ;
		Page3.BackColor = 255,255,255, ;
		Page3.Caption = "Fise de cont ", ;
		Page3.FontBold = .T., ;
		Page3.FontCharSet = 238, ;
		Page3.FontSize = 10, ;
		Page3.Name = "p3", ;
		Page4.BackColor = 255,255,255, ;
		Page4.Caption = "Listare", ;
		Page4.FontBold = .T., ;
		Page4.FontCharSet = 238, ;
		Page4.FontSize = 10, ;
		Page4.Name = "P4"
		*< END OBJECT: BaseClass="pageframe" />

	ADD OBJECT 'pf.p1.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		BackStyle = 0, ;
		Caption = "Sintetice", ;
		Comment = "*:OnResize=RT", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 199, ;
		Name = "Check1", ;
		SpecialEffect = 0, ;
		Style = 1, ;
		Top = 6, ;
		Visible = .T., ;
		Width = 71
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf.p1.Label2' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Rulaje", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 405, ;
		Name = "Label2", ;
		Top = 7, ;
		Width = 126, ;
		ZOrderSet = 31
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.p1.Label4' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Total sume", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 533, ;
		Name = "Label4", ;
		Top = 7, ;
		Width = 126, ;
		ZOrderSet = 32
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.p1.Label5' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Solduri", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 661, ;
		Name = "Label5", ;
		Top = 7, ;
		Width = 127, ;
		ZOrderSet = 34
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.p1.Label8' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Total precedente", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 277, ;
		Name = "Label8", ;
		TabIndex = 19, ;
		Top = 7, ;
		Width = 127, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.p1.lblcredit' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Credit", ;
		Comment = "*:OnResize=RT", ;
		Height = 17, ;
		Left = 199, ;
		Name = "lblcredit", ;
		TabIndex = 20, ;
		Top = 53, ;
		Width = 71, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.p1.lbldebit' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Debit", ;
		Comment = "*:OnResize=RT", ;
		Height = 17, ;
		Left = 199, ;
		Name = "lbldebit", ;
		TabIndex = 20, ;
		Top = 29, ;
		Width = 71, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.p1.lblsld1' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Solduri 1 Ian.", ;
		Comment = "*:OnResize=RT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 148, ;
		Name = "lblsld1", ;
		TabIndex = 19, ;
		Top = 7, ;
		Visible = .F., ;
		Width = 123, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.p1.Shape1' AS shape WITH ;
		Anchor = 10, ;
		BackColor = 236,249,255, ;
		BorderStyle = 3, ;
		Comment = "*:OnResize=ST", ;
		Height = 76, ;
		Left = 2, ;
		Name = "Shape1", ;
		Top = 1, ;
		Width = 790
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'pf.p1.Text1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.sprecdeb", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 277, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 6, ;
		Top = 26, ;
		Width = 127, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.Text2' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.spreccred", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 277, ;
		Name = "Text2", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 7, ;
		Top = 50, ;
		Width = 127, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.Text3' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.srulcred", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 405, ;
		Name = "Text3", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 8, ;
		Top = 50, ;
		Width = 127, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.Text4' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.sruldeb", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 405, ;
		Name = "Text4", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 10, ;
		Top = 26, ;
		Width = 127, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.Text5' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.stotdeb", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 533, ;
		Name = "Text5", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 9, ;
		Top = 26, ;
		Width = 127, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.Text6' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.stotcred", ;
		DisabledBackColor = 187,235,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 533, ;
		Name = "Text6", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 11, ;
		Top = 50, ;
		Width = 127, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.Text7' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.ssolddeb", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 661, ;
		Name = "Text7", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 6, ;
		Top = 26, ;
		Width = 127, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.Text8' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.ssoldcred", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(15,gnPA)), ;
		Left = 661, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 7, ;
		Top = 50, ;
		Width = 127, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.txtpreccred1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.spreccred1", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPA)), ;
		Left = 148, ;
		Name = "txtpreccred1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 7, ;
		Top = 50, ;
		Visible = .F., ;
		Width = 127, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.p1.txtprecdeb1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "m.sprecdeb1", ;
		DisabledBackColor = 236,249,255, ;
		Enabled = .T., ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPA)), ;
		Left = 148, ;
		Name = "txtprecdeb1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 6, ;
		Top = 26, ;
		Visible = .F., ;
		Width = 127, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf.P2.cboSucursale' AS _combobox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 134, ;
		Name = "cboSucursale", ;
		RowSource = "", ;
		RowSourceType = 1, ;
		TabIndex = 15, ;
		ToolTipText = "", ;
		Top = 23, ;
		Visible = .F., ;
		Width = 193
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'pf.P2.Ck_acont' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		camp_nume = acont, ;
		Caption = "Selectie analitic", ;
		Comment = "*:OnResize=ST", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 651, ;
		Name = "Ck_acont", ;
		Top = 41
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.Ck_cont' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		camp_nume = cont, ;
		Caption = "Selectie cont", ;
		Comment = "*:OnResize=ST", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 651, ;
		Name = "Ck_cont", ;
		Top = 25
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.Ck_denumire' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		camp_nume = denumire, ;
		Caption = "Selectie denumire", ;
		Comment = "*:OnResize=ST", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 651, ;
		Name = "Ck_denumire", ;
		Top = 56
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.ckanalitic' AS checkbox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Conturi analitice", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 501, ;
		Name = "ckanalitic", ;
		TabIndex = 4, ;
		Top = 25, ;
		Value = 0, ;
		Width = 112, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.cksold1' AS checkbox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "\<Solduri la 1 ian.", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 651, ;
		Name = "cksold1", ;
		TabIndex = 4, ;
		Top = 10, ;
		Value = 0, ;
		Width = 109, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.cktotal1' AS checkbox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total clase (gr.1)", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 336, ;
		Name = "cktotal1", ;
		TabIndex = 2, ;
		Top = 10, ;
		Value = 0, ;
		Width = 116, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.cktotal2' AS checkbox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total grupe (gr.2)", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 336, ;
		Name = "cktotal2", ;
		TabIndex = 3, ;
		Top = 25, ;
		Value = 0, ;
		Width = 117, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.cktotal3' AS checkbox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total conturi (gr.3)", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 336, ;
		Name = "cktotal3", ;
		TabIndex = 5, ;
		Top = 41, ;
		Value = 0, ;
		Width = 124, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.cktotal4' AS checkbox WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Conturi", ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		FontBold = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 501, ;
		Name = "cktotal4", ;
		TabIndex = 6, ;
		Top = 10, ;
		Value = 1, ;
		Width = 60, ;
		ZOrderSet = 37
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf.P2.Shape1' AS shape WITH ;
		Anchor = 10, ;
		BackColor = 236,249,255, ;
		BorderStyle = 3, ;
		Comment = "*:OnResize=ST", ;
		Height = 76, ;
		Left = 2, ;
		Name = "Shape1", ;
		Top = 1, ;
		Width = 790
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'pf.p3.Optiongroup1' AS optiongroup WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 8, ;
		Comment = "*:OnResize=RT", ;
		ControlSource = "", ;
		Height = 61, ;
		Left = 377, ;
		Name = "Optiongroup1", ;
		SpecialEffect = 1, ;
		Top = 12, ;
		Value = 8, ;
		Width = 385, ;
		ZOrderSet = 3, ;
		Option1.AutoSize = .F., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "\<Rulaj Debit", ;
		Option1.ControlSource = "", ;
		Option1.Enabled = .T., ;
		Option1.FontCharSet = 1, ;
		Option1.FontName = "Arial", ;
		Option1.FontSize = 10, ;
		Option1.Height = 19, ;
		Option1.Left = 112, ;
		Option1.Name = "Option3", ;
		Option1.TabIndex = 3, ;
		Option1.Top = 5, ;
		Option1.Value = 0, ;
		Option1.Width = 99, ;
		Option2.AutoSize = .F., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "R\<ulaj Credit", ;
		Option2.ControlSource = "", ;
		Option2.Enabled = .T., ;
		Option2.FontCharSet = 1, ;
		Option2.FontName = "Arial", ;
		Option2.FontSize = 10, ;
		Option2.Height = 19, ;
		Option2.Left = 112, ;
		Option2.Name = "Option4", ;
		Option2.TabIndex = 4, ;
		Option2.Top = 24, ;
		Option2.Value = 0, ;
		Option2.Width = 106, ;
		Option3.AutoSize = .F., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Tota\<l Debit", ;
		Option3.ControlSource = "", ;
		Option3.Enabled = .T., ;
		Option3.FontCharSet = 1, ;
		Option3.FontName = "Arial", ;
		Option3.FontSize = 10, ;
		Option3.Height = 19, ;
		Option3.Left = 257, ;
		Option3.Name = "Option6", ;
		Option3.TabIndex = 6, ;
		Option3.Top = 5, ;
		Option3.Width = 99, ;
		Option4.AutoSize = .F., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "T\<otal Credit", ;
		Option4.ControlSource = "", ;
		Option4.Enabled = .T., ;
		Option4.FontCharSet = 1, ;
		Option4.FontName = "Arial", ;
		Option4.FontSize = 10, ;
		Option4.Height = 19, ;
		Option4.Left = 257, ;
		Option4.Name = "Option7", ;
		Option4.TabIndex = 7, ;
		Option4.Top = 24, ;
		Option4.Value = 0, ;
		Option4.Width = 106, ;
		Option5.AutoSize = .F., ;
		Option5.BackStyle = 0, ;
		Option5.Caption = "Ru\<laje Deb&Cred", ;
		Option5.FontCharSet = 1, ;
		Option5.FontName = "Arial", ;
		Option5.FontSize = 10, ;
		Option5.Height = 19, ;
		Option5.Left = 112, ;
		Option5.Name = "Option5", ;
		Option5.TabIndex = 5, ;
		Option5.Top = 43, ;
		Option5.Value = 0, ;
		Option5.Width = 120, ;
		Option6.AutoSize = .F., ;
		Option6.BackStyle = 0, ;
		Option6.Caption = "Tot\<al Deb&Cred", ;
		Option6.FontCharSet = 1, ;
		Option6.FontName = "Arial", ;
		Option6.FontSize = 10, ;
		Option6.Height = 19, ;
		Option6.Left = 257, ;
		Option6.Name = "Option8", ;
		Option6.TabIndex = 8, ;
		Option6.Top = 43, ;
		Option6.Value = 0, ;
		Option6.Width = 114, ;
		Option7.AutoSize = .F., ;
		Option7.BackStyle = 0, ;
		Option7.Caption = "\<Fisa cont", ;
		Option7.FontCharSet = 1, ;
		Option7.FontName = "Arial", ;
		Option7.FontSize = 10, ;
		Option7.Height = 19, ;
		Option7.Left = 12, ;
		Option7.Name = "Option2", ;
		Option7.TabIndex = 2, ;
		Option7.Top = 25, ;
		Option7.Value = 0, ;
		Option7.Width = 70, ;
		Option8.AutoSize = .F., ;
		Option8.BackStyle = 0, ;
		Option8.Caption = "Balanta", ;
		Option8.FontCharSet = 1, ;
		Option8.FontName = "Arial", ;
		Option8.FontSize = 10, ;
		Option8.Height = 19, ;
		Option8.Left = 12, ;
		Option8.Name = "Option1", ;
		Option8.TabIndex = 1, ;
		Option8.Top = 5, ;
		Option8.Value = 1, ;
		Option8.Width = 61
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'pf.p3.Shape1' AS shape WITH ;
		Anchor = 10, ;
		BackColor = 236,249,255, ;
		BorderStyle = 3, ;
		Comment = "*:OnResize=ST", ;
		Height = 76, ;
		Left = 2, ;
		Name = "Shape1", ;
		Top = 1, ;
		Width = 786
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'pf.P4.cboRaport' AS combobox WITH ;
		Anchor = 9, ;
		BoundTo = .T., ;
		ColumnCount = 1, ;
		Comment = "*:OnResize=RT", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 578, ;
		Name = "cboRaport", ;
		RowSource = "4 egalitati 14-6-30 (A4),4 egalitati 14-6-30/A (A4),4 egalitati special (A4),5 egalitati 14-6-30/a (A3),6 egalitati 14-6-30/b (A3)", ;
		RowSourceType = 1, ;
		Style = 2, ;
		Top = 20, ;
		Width = 200
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'pf.P4.Label2' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Raport balanta", ;
		Comment = "*:OnResize=RT", ;
		FontBold = .F., ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 479, ;
		Name = "Label2", ;
		TabIndex = 13, ;
		Top = 25, ;
		Width = 86, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pf.P4.Shape1' AS shape WITH ;
		Anchor = 10, ;
		BackColor = 236,249,255, ;
		BorderStyle = 3, ;
		Comment = "*:OnResize=ST", ;
		Height = 76, ;
		Left = 2, ;
		Name = "Shape1", ;
		Top = 1, ;
		Width = 786
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Resizer1' AS resizer WITH ;
		Left = 792, ;
		Name = "Resizer1", ;
		TabIndex = 16, ;
		Top = 405, ;
		ZOrderSet = 12, ;
		Label1.Name = "Label1"
		*< END OBJECT: ClassLib="resizer.vcx" BaseClass="control" />

	ADD OBJECT 'txtcont' AS _textbox WITH ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		Height = 25, ;
		Left = 44, ;
		Name = "txtcont", ;
		SpecialEffect = 1, ;
		TabIndex = 1, ;
		Top = 87, ;
		Width = 44, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtcont2' AS _textbox WITH ;
		Comment = "*:OnResize=LT", ;
		ControlSource = "", ;
		Format = "k", ;
		Height = 25, ;
		Left = 100, ;
		Name = "txtcont2", ;
		SpecialEffect = 1, ;
		TabIndex = 2, ;
		Top = 87, ;
		Width = 44, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE adauga_linie
		LOCAL lcIdSucursala, lnIdSucursala, lcSucursala
		Private pcbal,pcCont,pcSCont,pcACont,pnButon
		Store "" To pcbal,pcCont,pcSCont,pcACont
		pnButon=1
		pcbal=This.CALIas
		
		STORE "" TO locauta
		lnIdSucursala = NULL
		lcSucursala = ''
		IF glEMama
			llToateIreg = .F.
			llNou = .F.
			llBlank = .T.
			loCauta = caut_sucursala(llToateIreg, llNou, llBlank)
			lnIdSucursala = loCauta.id_sucursala
			lcSucursala = loCauta.sucursala
		ELSE 
			lnIdSucursala = gnIdSucursala && pentru o sucursala este id-ul firmei, iar pe firma independenta este null	
		ENDIF 
		lcIdSucursala = IIF(NVL(lnIdSucursala,0) = 0, 'NULL', ALLTRIM(STR(lnIdSucursala)))
		
		pcCont=SELECT_CONT()
		If pnButon=2
			Return
		Endif
		If Empty(pcCont)
			Return
		Endif
		
		pcSCont=Left(pcCont,4)
		lnPos=At(".",pcCont)
		If lnPos>0
			pcACont=Padr(Substr(pcCont,lnPos+1),4," ")
		Endif
		
		
		
		pcexec=[begin PACK_INREGISTRARI.balinsproc(]+lcIdSucursala+[,]+Alltrim(Str(gnAn))+[,]+Alltrim(Str(gnLuna))+;
			[,']+Alltrim(pcSCont)+[',']+Alltrim(pcACont)+['); end;]
		lnSucces=goExecutor.oexecute(pcexec)
		If lnSucces < 0
			lcTextEroare = goExecutor.cEroare
			aMessagebox(lcTextEroare,48,"Eroare")
			Return
		Endif
		
		If !Empty(pcACont)
			Thisform.pf.p2.ckanalitic.Value=1
		Endif
		
		Thisform.MousePointer=11
		Thisform.LockScreen=.T.
		Thisform.reconstruct
		Thisform.afisactual
		Select (pcbal)
		Locate For Cont=pcSCont And acont=pcACont AND NVL(id_sucursala,0) = NVL(lnIdSucursala,0)
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
		Thisform.grid1.SetFocus
		
	ENDPROC

	PROCEDURE afisactual
		#Define CRLF Chr(13) + Chr(10)
		
		
		Private lcbal,lcacont  && ,lccont1,lccont2 - le-am pus inainte de do form
		lcbal=Thisform.calias
		
		Local T1
		T1=""
		T='.t.'
		
		lccont1=Alltrim(This.txtcont.Value)
		lccont2=Alltrim(This.txtcont2.Value)
		
		If Empty(lccont2)
			lccont2 = lccont1
		Endif
		
		*lcacont=ALLTRIM(this.txtacont.value)
		lcacont1=Alltrim(This.ct1.text1.Value)
		lcacont2=Alltrim(This.ct1.text2.Value)
		lcacont3=Alltrim(This.ct1.text3.Value)
		lcacont4=Alltrim(This.ct1.text4.Value)
		
		Do Case
			Case Len(lccont1)=1
				*T=[G1="]+LCCONT+["]
				T = T + [ and VAL(LEFT(G1,1))>=VAL(lcCont1)]
			Case Len(lccont1)=2
				*T=[G2="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G2),2,'0'))>=VAL(lcCont1)]
			Case Len(lccont1)=3
				*T=[G3="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G3),3,'0'))>=VAL(lcCont1)]
			Case Len(lccont1)=4
				*T=[G4="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G4),4,'0'))>=VAL(lcCont1)]
		Endcase
		
		Do Case
			Case Len(lccont2)=1
				*T=[G1="]+LCCONT+["]
				T = T + [ and VAL(LEFT(G1,1))<=VAL(lcCont2)]
			Case Len(lccont2)=2
				*T=[G2="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G2),2,'0'))<=VAL(lcCont2)]
			Case Len(lccont2)=3
				*T=[G3="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G3),3,'0'))<=VAL(lcCont2)]
			Case Len(lccont2)=4
				*T=[G4="]+LCCONT+["]
				T = T + [ and VAL(PADR(ALLTRIM(G4),4,'0'))<=VAL(lcCont2)]
		Endcase
		
		
		&& SOLDURI LA 1 IANUARIE
		If This.pf.p2.cksold1.Value=0
			With Thisform.grid1
				.cprecdeb1.Visible=.F.
				.cpreccred1.Visible=.F.
			Endwith
			With Thisform.pf.p1
				.lblsld1.Visible=.F.
				.txtprecdeb1.Visible=.F.
				.txtpreccred1.Visible=.F.
				.lbldebit.Left=.text1.Left-.lbldebit.Width
				.lblcredit.Left=.text2.Left-.lblcredit.Width
				.check1.Left=.label8.Left-.lbldebit.Width
			Endwith
		Else
		
			With Thisform.grid1
				.cprecdeb1.Visible=.T.
				.cpreccred1.Visible=.T.
			Endwith
			With Thisform.pf.p1
				.lblsld1.Visible=.T.
				.txtprecdeb1.Visible=.T.
				.txtpreccred1.Visible=.T.
				.lbldebit.Left=.txtprecdeb1.Left-.lbldebit.Width
				.lblcredit.Left=.txtpreccred1.Left-.lblcredit.Width
				.check1.Left=.lblsld1.Left-.lbldebit.Width
			Endwith
		Endif
		&& SOLDURI LA 1 IANUARIE ^
		
		*/-----------------------------------------------------
		&&& conditia de filtrare pt balanta sintetica
		llTotal1=Iif(This.pf.p2.cktotal1.Value=1,.T.,.F.)
		llTotal2=Iif(This.pf.p2.cktotal2.Value=1,.T.,.F.)
		llTotal3=Iif(This.pf.p2.cktotal3.Value=1,.T.,.F.)
		llTotal4=Iif(This.pf.p2.cktotal4.Value=1,.T.,.F.)
		llAnalitic=Iif(This.pf.p2.ckanalitic.Value=1,.T.,.F.)
		
		
		If glEMama
			lnIdSucursala = crsSucursale.ID_SUCURSALA
			llBalantaCentralizata = lnIdSucursala = -1 && BALANTA CENTRALIZATA
			llBalantaDefalcata = lnIdSucursala = -2 && BALANTA DEFALCATA
			llBalantaGrup =  lnIdSucursala = -3 && BALANTA GRUP (FARA ID SUCURSALA)
		Else
			lnIdSucursala = Null
			llBalantaCentralizata = .F. && BALANTA CENTRALIZATA
			llBalantaDefalcata = .F.
			llBalantaGrup =  .F. && BALANTA GRUP (FARA ID SUCURSALA)
		Endif
		
		*!* PE MAMA TOTALURILE SUNT CALCULATE DOAR PE CONTURILE CENTRALIZATE
		*!* DEZACTIVEZ BIFELE DE TOTALURI DACA NU ALEG BALANTA CENTRALIZATA
		If glEMama
			With This.pf.p2
				.cktotal1.Enabled = llBalantaCentralizata
				.cktotal2.Enabled = llBalantaCentralizata
				.cktotal3.Enabled = llBalantaCentralizata
			Endwith
		Endif
		
		
		lclista=[]
		*!* ARAT TOTALURILE PE CLASE/GRUPE DOAR DACA SUNT PE BALANTA CENTRALIZATA SAU PE SUCURSALA/FIRMA INDEPENDENTA
		If llBalantaCentralizata Or !glEMama
			If llTotal1
				lclista=lclista+[,1]
			Endif
			If llTotal2
				lclista=lclista+[,2]
			Endif
			If llTotal3
				lclista=lclista+[,3]
			Endif
		Endif
		If glEMama
			If llTotal4
				If llBalantaCentralizata
					lclista=lclista + [,6] && conturi sintetice din balanta centralizata
				Else
					lclista=lclista + [,4] && conturi sintetice din balanta normala
				Endif
			Endif
			If llAnalitic
				If llBalantaCentralizata
					lclista=lclista + [,7] && conturi analitice din balanta centralizata
				Else
					lclista=lclista + [,5] && conturi analitice din balanta normala
				Endif
			Endif
		
		Else
			If llTotal4
				lclista=lclista+[,4]
			Endif
			If llAnalitic
				lclista=lclista+[,5]
			Endif
		Endif
		
		
		
		If !Empty(lclista)
			If Left(lclista,1)=","
				lclista=Substr(lclista,2)
			Endif
			T = T + [ AND INLIST(BNIVEL,]+lclista+[)]
		Else
			T = T + [ AND .F.]
		Endif
		
		lccond2=[]
		
		If !Empty(lcacont1)
			lccond2= lccond2 + [ and SUBSTR(acont,1,1)="]+lcacont1+["]
		Endif
		If !Empty(lcacont2)
			lccond2= lccond2 + [ and SUBSTR(acont,2,1)="]+lcacont2+["]
		Endif
		If !Empty(lcacont3)
			lccond2= lccond2 + [ and SUBSTR(acont,3,1)="]+lcacont3+["]
		Endif
		If !Empty(lcacont4)
			lccond2= lccond2 + [ and SUBSTR(acont,4,1)="]+lcacont4+["]
		Endif
		
		T= T + lccond2
		If Thisform.pf.p2.ck_cont.Value = 1
			T = T + Thisform.pf.p2.ck_cont.filtru_vfp
		Endif
		If Thisform.pf.p2.ck_acont.Value = 1
			T = T + Thisform.pf.p2.ck_acont.filtru_vfp
		Endif
		If Thisform.pf.p2.ck_denumire.Value = 1
			T = T + Thisform.pf.p2.ck_denumire.filtru_vfp
		Endif
		
		
		*!* 12.02.2008
		*!* ARAT CONTURILE DE PE O SUCURSALA SAU DOAR CONTURILE DE PE MAMA
		lcSucursale = ""
		If glEMama
			Do Case
				Case llBalantaGrup
					lcSucursale = " and Nvl(id_sucursala,0) = 0"
				Case Nvl(lnIdSucursala,0) > 0
					lcSucursale = " and id_sucursala = " + Alltrim(Str(lnIdSucursala))
			Endcase
		Endif
		T = T + lcSucursale
		*!* 12.02.2008 ^
		*!*Messagebox(T + CRLF + CRLF + GETCALLSTACK())
		T=[SET FILT TO ]+T
		Select (lcbal)
		*!*	Copy To C:\BAL.Dbf
		&T
		
		Local lcFor
		lcFor = [INLIST(bnivel, 4, 6)] && TOTALURI PE CONTURI SINTETICE - 4 = SUCURSALA/FIRMA INDEPENDENTA; 6 = MAMA
		If This.pf.p1.check1.Value = 1 && TOTALURI PE CONTURI ANALITICE - 5 = SUCURSALA/FIRMA INDEPENDENTA; 7 = MAMA
			lcFor = [INLIST(bnivel, 5, 7)]
		Endif
		*!*	SELECT * FROM (lcbal) INTO TABLE c:\lcbal.dbf
		Select (lcbal)
		Sum PRECDEB1,PRECCRED1,precdeb,preccred,ruldeb,rulcred,totdeb,totcred,solddeb,soldcred For &lcFor ;
			to m.sprecdeb1,m.spreccred1,m.sprecdeb,m.spreccred,m.sruldeb,m.srulcred,m.stotdeb,m.stotcred,m.ssolddeb,m.ssoldcred
		
		
		
		With Thisform.pf.p1
			.text1.Refresh
			.text2.Refresh
			.text3.Refresh
			.text4.Refresh
			.text5.Refresh
			.text6.Refresh
			.text7.Refresh
			.text8.Refresh
			.txtpreccred1.Refresh
			.txtprecdeb1.Refresh
		Endwith
		
		Select (lcbal)
		Go Top
		This.grid1.Refresh
		
	ENDPROC

	PROCEDURE butapend
		*!*	LOCAL lbMenu[4]
		*!*	PRIVATE lcbal
		*!*	lcbal=THISFORM.calias
		
		
		*!*	lbMenu=""
		*!*	lbMenu[1]="\<Deblocare"
		*!*	IF THISFORM.grid1.READONLY
		*!*		lbMenu[2]="\Adaug Blanc"
		*!*	ELSE
		*!*		lbMenu[2]="\<Adaug Blanc"
		*!*	ENDIF
		*!*	lbMenu[3]="\-"
		*!*	lbMenu[4]="\<Revenire"
		
		
		*!*	THISFORM.oMenuShortcut.ShowMenu(@lbMenu)
		
		*!*	DO CASE
		*!*		CASE BAR()=1
		
		*!*			SELECT (lcbal)
		*!*			SET FILTER TO !DELETED()
		*!*			THISFORM.grid1.READONLY=.F.
		*!*			THISFORM.grid1.DELETEMARK=.T.
		
		*!*		CASE BAR()=2
		*!*			this.adauga_linie()
		*!*		CASE BAR()=4
		*!*	*SELE BAL
		*!*			SELECT (lcbal)
		*!*			SET FILTER TO !DELETED()
		*!*			THISFORM.grid1.READONLY=.T.
		*!*			THISFORM.grid1.DELETEMARK=.F.
		*!*	ENDCASE
		
		
		
		
		
	ENDPROC

	PROCEDURE butdrept
		*return
		Private lcsel,lccont
		lcsel=This.CALIAS
		
		Local laMenu[9]
		Select (lcsel)
		lccont=Cont
		
		laMenu=""
		
		laMenu[1]="\<Fisa cont "+Alltrim(lccont)
		laMenu[2]="\-"
		laMenu[3]="\<Rulaj Debit"
		laMenu[4]="R\<ulaj Credit"
		laMenu[5]="Ru\<laje Deb&Cred"
		laMenu[6]="\-"
		laMenu[7]="\<Total Debit"
		laMenu[8]="T\<otal Credit"
		laMenu[9]="Tot\<al Deb&Cred"
		
		Thisform.oMenuShortcut.ShowMenu(@laMenu)
		
		Do Case
		Case Bar()=1
			Thisform.fisacont
		Case Bar()=3
			Thisform.ruldeb
		Case Bar()=4
			Thisform.rulcred
		Case Bar()=5
			Thisform.ruldebcred
		Case Bar()=7
			Thisform.totdeb
		Case Bar()=8
			Thisform.totcred
		Case Bar()=9
			Thisform.totdebcred
		Endcase
		
		*laMenu[1]="\<Copiaza"
		*laMenu[2]="Re\<da"
		*laMenu[3]="\-"
		*CASE BAR()=1
		*	SYS(1500,'_MED_copy','_MEDIT')
		*CASE BAR()=2
		*	SYS(1500,'_MED_paste','_MEDIT')
		
		Thisform.txtcont.Refresh
		
	ENDPROC

	PROCEDURE calculeaza
		*!* nu calculez daca gridul este readonly
		IF THIS.GRId1.ReadOnly
			RETURN
		ENDIF 
		LOCAL lnIdSucursala
		Private pcSufix,pcAlias,pnOldValue,pcVar,pnValoare,pnRec,pcOldAlias,pcFiltru,pcAcont
		pcSufix=Thisform.cField
		pcAlias=Thisform.cAlias
		pnOldValue=Thisform.noldvalue
		
		Select (pcAlias)
		pcVar=pcAlias+[.]+pcSufix
		pnValoare=Evaluate(pcVar)
		pcAcont=Upper(Alltrim(acont))
		lnIdSucursala = id_sucursala
		
		This.nnewvalue=pnValoare
		lnNewValue=This.nnewvalue
		pcFiltru=Filter()
		pnRec=Recno()
		pcField=This.cField
		
		If lnNewValue!=pnOldValue
			If Empty(This.ccont) && o linie cu totaluri
				Wait Window "Nu puteti modifica totalul." Timeout 1
				Select (pcAlias)
				Replace &pcVar With pnOldValue
				This.nnewvalue=pnOldValue
				Return
			Endif
			lcDbf=Dbf(pcAlias)
			Use (lcDbf) In 0 Again Shared Alias TBALANTAR
			Select TBALANTAR
			Goto pnRec
			pcOldAlias=This.cAlias
			This.cAlias="TBALANTAR"
		*	If Inlist(lcField,"PRECDEB","PRECCRED","RULDEB","RULCRED") && NU CALCULEZ DECAT PT PRECEDENTE SI RULAJE
			Thisform.calculeaza_orizontal() && calculez pentru linia curenta
		*	Endif
			If Empty(pcAcont)			&& cont2003 oracle
				Thisform.calculeaza_vertical()  && calculez pentru linia cu totaluri
			Endif
			Use In TBALANTAR
			This.cAlias=pcOldAlias
			Select (pcOldAlias)
			This.in_bal(lnIdSucursala, This.ccont,pcAcont,.T.)	&& introduc in bal noua valoare si recalculez
		*!*		Select (lcAlias)
		*!*		Set Filter To &lcFilter
		Endif
		This.afisactual
	ENDPROC

	PROCEDURE calculeaza_orizontal
		PARAMETERS tcAlias
		PRIVATE lcAlias
		
		IF EMPTY(tcAlias)
			lcAlias=thisform.calias 
		ELSE
			lcAlias=ALLTRIM(tcalias)
		ENDIF 
		*WAIT WINDOW 'calculeaza orizontal '+lcalias
		*!*	SELECT (lcAlias)
		*!*	lcCont=CONT
		*!*	lcG1=G1
		*!*	lcG2=G2
		*!*	lcG3=G3
		*!*	lcG4=G4
		*!*	lcCond=[left(cont,]+ALLTRIM(STR(LEN(lccont)))+[)=]+lccont+[ AND G1=]+lcG1+[ AND G2=]+lcG2+[ AND G3=]+lcG3+[ AND G4=]+lcG4
		*!*	WAIT WINDOW lcCond
		
		SELECT (lcAlias)
		IF FLOCK()
			REPLACE totdeb WITH precdeb+ruldeb,totcred WITH preccred+rulcred
			REPLACE solddeb WITH IIF(totdeb-totcred>=0,ABS(totdeb-totcred),0),soldcred WITH IIF(totdeb-totcred<0,ABS(totdeb-totcred),0)
			UNLOCK
		*	brow
		ENDIF 
				
		
		
		
		
	ENDPROC

	PROCEDURE calculeaza_vertical
		Private lccont,lcAlias,lnRec,lnDifValue,lcField,lnValoare,laarray
		
		lcAlias=This.calias
		Select (lcAlias)
		lnRec=Recno()
		lccont=Alltrim(This.ccont)
		*WAIT WINDOW 'lccont= '+lccont
		lcField=This.cfield
		lnDifValue=This.nnewvalue- This.noldvalue
		*WAIT WINDOW 'lndifvalue = '+STR(lndifValue)
		*WAIT WINDOW 'calculeaza vertical '+lcalias
		
		lnlung=4
		Dimension laarray[lnlung]
		Store Space(4) To laarray
		For i=1 To lnlung-1
		*	WAIT WINDOW 'i= '+STR(i)
			laarray[i] = Substr(lccont,1,i)
		*	WAIT WINDOW laArray[i]
			lcVar="G"+Alltrim(Str(i))
			lcVar1="G"+Alltrim(Str(i+1))
			LCCOND=[LOCATE FOR LEFT(]+lcVar+[,]+Alltrim(Str(i))+[)="]+Left(laarray[I],i)+[" AND EMPTY(]+lcVar1+[)]
		*	WAIT WINDOW lccond
			Select (lcAlias)
			&LCCOND
			If Found()
				If Flock()
					lnValoare=Evaluate(lcField)+lnDifValue
					Replace &lcField With lnValoare
					This.calculeaza_orizontal(lcAlias) && calculez pentru liniile cu totaluri
					Unlock
				Endif
			Endif
		Endfor
		
		Select (lcAlias)
		Goto lnRec
	ENDPROC

	PROCEDURE cfield_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		THIS.cfield = m.vNewVal
		
		PRIVATE lcAlias,lcSufix,lcVar
		lcAlias=thisform.calias 
		lcSufix=this.cField
		lcVar=lcAlias+[.]+lcSufix
		lcCont=lcAlias+[.cont]
		THISFORM.nOldValue=EVALUATE(lcVar)
		thisform.ccont=EVALUATE(lcCont)
		*WAIT WINDOW 'ccont '+thisform.ccont
		
	ENDPROC

	PROCEDURE conditieistoricact
		Local lcConditie
		lcConditie = ""
		
		If glEMama
			lnIdSucursala = crsSucursale.ID_SUCURSALA
			llBalantaCentralizata = lnIdSucursala = -1 && BALANTA CENTRALIZATA
			llBalantaDefalcata = lnIdSucursala = -2 && BALANTA DEFALCATA
			llBalantaGrup =  lnIdSucursala = -3 && BALANTA GRUP (FARA ID SUCURSALA)
			Do Case
				Case !Empty(Nvl(tbalanta.ID_SUCURSALA,0))
					lcConditie = " and id_sucursala = " + Alltrim(Str(tbalanta.ID_SUCURSALA))
				Case llBalantaDefalcata
					If Empty(Nvl(tbalanta.ID_SUCURSALA,0))
						lcConditie = " and id_sucursala is null"
					Else
						lcConditie = " and id_sucursala = " + Alltrim(Str(tbalanta.ID_SUCURSALA))
					Endif
				Case llBalantaGrup
					lcConditie = " and id_sucursala is null"
			Endcase
		Else
			lcConditie = gcCondSucursala 
		Endif
		Return lcConditie
		
	ENDPROC

	PROCEDURE Destroy
		USE IN (SELECT('crsSucursale'))
	ENDPROC

	PROCEDURE do_excel
		If gcNumeProgram = [ROAMANAGER]
			x= xmenu("\<Standard;\<Formatat")
		Else
			x= 1
		Endif
		
		Do Case
		Case x=1
			Local i,xlsheet,XLApp,tmpsheet, lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
			lcAlias = This.grid1.RecordSource
			lcFiltru = Filter(lcAlias)
			If Empty(lcFiltru)
				lcFiltru = '.T.'
			Endif
		
			exista_excel=.T.
			lcColumnList = ''
			lcHeaderList = ''
			lcSelect = ''
			llSelect = .T.
			lcType = 'CURSOR'
			lcFrom = lcAlias
			lcWhere = lcFiltru
			lcOrder = 'g5,sucursala'
			lcOutput = 'crsBal'
		
			get_schema_grid(This.grid1,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
			&lcSelect
		*!*	MESSAGEBOX(p3)
			If Used(lcOutput)
				Do export_xls With lcOutput In oproceduri_comune.prg
				Use In (lcOutput)
			Endif
		Case x=2
			lcTabel = Thisform.grid1.RecordSource
		
			Select (lcTabel)
			lcFiltru = Filter(lcTabel)
			If Empty(lcFiltru)
				lcFiltru = '.T.'
			Endif
			lcFiltru = Filter()
			lcFiltru = Strtran(lcFiltru,'.AND.',' AND ')
			lcFiltru = Substr(lcFiltru,9,Len(lcFiltru)-8)
		
		
			Select g1, g2, g3, g4, Cont, acont, denumire, precdeb, preccred, ruldeb, rulcred, totdeb, totcred, solddeb, soldcred, ;
				SPACE(9) As cont_acont, sucursala ;
				FROM (lcTabel) ;
				WHERE &lcFiltru Order By g5, sucursala ;
				INTO Cursor cExcel Readwrite
		
			Select cExcel
			Replace All cont_acont With Alltrim(Cont)+ Iif(!Empty(acont),"_"+Alltrim(acont),"")
		
			Do lanseaza_excel_balanta With "cExcel" In viz_bal.prg
		
			If Used("cExcel")
				Use In cExcel
			Endif
		Endcase
		Return
		
		*!*	On Error Do exportare With Thisform.grid1.RecordSource,p1,p2
		*!*	tmpsheet = Getobject('','excel.sheet')
		*!*	On Error
		
		*!*	If exista_excel
		*!*		Wait Window "Se transmit datele catre Excel..." Nowait
		
		*!*		XLApp = tmpsheet.Application
		
		*!*		XLApp.workbooks.Close()
		*!*		XLApp.workbooks.Add()
		*!*		poExcel = XLApp.ActiveSheet
		*!*		Go Top
		*!*		poExcel.Cells(1,1).Font.Size=16
		*!*		poExcel.Cells(1,1).Font.Bold=.T.
		*!*		poExcel.Cells(1,1)=Thisform.titluFRUMOS1.Caption+" Luna "+Alltrim(Str(gnLuna))+"/"+Alltrim(Str(gnAn))
		*!*		nRows = 3
		*!*		With Thisform.grid1
		*!*			For nCol = 1 To .ColumnCount
		*!*				nColumn = .Columns(nCol).ColumnOrder
		*!*				poExcel.Columns(nColumn).ColumnWidth = .Columns(nCol).Width/7.5
		*!*				For lnobjcol=1 To .Columns(nCol).Objects.Count
		*!*					If Upper(.Columns(nCol).Objects(lnobjcol).BaseClass)='HEADER'
		*!*						poExcel.Cells(nRows,nColumn) = .Columns(nCol).Objects(lnobjcol).Caption
		*!*						Exit
		*!*					Endif
		*!*				Endfor
		*!*				poExcel.Cells(nRows,nColumn).Font.Bold = .T.
		*!*				poExcel.Cells(nRows,nColumn).Interior.ColorIndex = 16
		*!*			Endfor
		*!*			Scan
		*!*				nRows = nRows + 1
		*!*				For nCol = 1 To .ColumnCount
		*!*					nColumn = .Columns(nCol).ColumnOrder
		*!*					If At('CHECK',Upper(.Columns(nCol).CurrentControl))>0
		*!*						poExcel.Cells(nRows,nColumn)=Iif(Eval(.Columns(nCol).ControlSource)==0,'NU','DA')
		*!*					Else
		*!*						poExcel.Cells(nRows,nColumn) = IIF(empty(Eval(.Columns(nCol).ControlSource)),'',Eval(.Columns(nCol).ControlSource))
		*!*					Endif
		*!*				Endfor
		*!*			Endscan
		*!*		Endwith
		
		*!*		XLApp.Visible = .T.
		*!*	Endif
	ENDPROC

	PROCEDURE do_listare
		*!* 24.01.2011
		*!* marius.mutu
		*!* balanta cumulata
		
		*!* 04.08.2011
		*!* marius.mutu
		*!* listare foxypreview
		
		Private pcPerioadaRef	&&, pcDataOra
		Local Tlist
		
		*!*	pcDataOra = ''
		*!*	pcDataOra = get_ora(2)
		*!* 24.01.2011
		IF !EMPTY(this.nAn2)
			pcPerioadaRef = 'Perioada ' + Padl(Alltrim(Str(this.nLuna1)),2,'0') + "/" + Alltrim(Str(this.nAn1)) + " - " + Padl(Alltrim(Str(this.nLuna2)),2,'0') + "/" + Alltrim(Str(this.nAn2))
		ELSE 	
			pcPerioadaRef = 'Luna ' + Padl(Alltrim(Str(gnLuna)),2,'0') + "/" + Alltrim(Str(gnAn))
		ENDIF 	
		*!* 24.01.2011 ^
		Local lcOptiuneRaport
		Local Tlist
		lcOptiuneRaport = Upper(Alltrim(Thisform.pf.p4.cboRaport.Value))
		
		LNG1=Thisform.pf.p2.cktotal1.Value
		LNG2=Thisform.pf.p2.cktotal3.Value
		LNG3=Thisform.pf.p2.cktotal3.Value
		LNG4=Thisform.pf.p2.cktotal4.Value
		LNG5=Thisform.pf.p2.ckanalitic.Value
		
		*!* DACA SUNT PE FIRMA MAMA SI SE LISTEAZA CONTURILE DEFALCATE SAU DOAR DE PE O SUCURSALA
		*!* AFISEZ "TOATE SUCURSALELE" / "SUCURSALA X"
		lcSucursala = ''
		IF glEMama
			DO CASE 
				CASE crsSucursale.id_sucursala = -2 && BALANTA CENTRALIZATA
					lcSucursala = ' * TOATE SUCURSALELE * '
				CASE crsSucursale.id_sucursala > 0
					lcSucursala = ' * ' + Strtran(UPPER(Alltrim(crsSucursale.sucursala)),'BALANTA') + ' * '
			ENDCASE 	
		ENDIF 
		LCBAL=Thisform.CALIas
		Select (LCBAL)
		
		LCPARTIALA=Iif(!Empty(Thisform.TXTcont.Value)," PARTIALA "," ")
		LCPARTIALA = lcSucursala + LCPARTIALA
		
		Do Case
		Case LNG5=1
			m.titlu='- ANALITICA'+LCPARTIALA+'-'
			Select (LCBAL)
			&T
			Replace All bifa With .F.
		
			Select Distinct Cont,bnivel,bifa From &LCBAL ;
				WHERE bnivel= 5 ;
				INTO Cursor listbal Readwrite
		
			If _Tally # 0
				Do Form frm_list_balana
		
				Select listbal
				Scan For bifa
					Scatter Name olist
					Select (LCBAL)
					Replace All bifa With .T. For Cont=olist.Cont AND INLIST(bnivel, 5, 7) && total analitice pe firma sucursala/mama
					Select listbal
				Endscan
				Release olist
		
				Select (LCBAL)
				Tlist = T + ' and !bifa '
				&Tlist
			Endif
			Use In listbal
			Select (LCBAL)
		
		Case LNG4=1 And LNG5=0
			m.titlu='- SINTETICA'+LCPARTIALA+'-'
		Otherwise
			If Empty(LCPARTIALA)
				m.titlu=""
			Else
				m.titlu='-'+LCPARTIALA+'-'
			Endif
		Endcase
		
		lcRaport = ""
		Do Case
		Case lcOptiuneRaport = Upper("4 Egalitati 14-6-30 (A4)")
			lcRaport="rapbal_a4_4_14_6_30" && A4 4 EGALITATI (TSP, RLC ,TS, SF)
		
		Case lcOptiuneRaport = Upper("4 Egalitati 14-6-30/A (A4)")
			lcRaport="rapbal_a4_4_14_6_30_a" && A4 4 EGALITATI (SI, RLC, TS, SF)
		
		Case lcOptiuneRaport = Upper("4 egalitati special (A4)")
			lcRaport="rapbal_a4_4_14_6_30_a1" && A4 4 EGALITATI (SI, TR, TS, SF)
		
		Case lcOptiuneRaport = Upper("5 Egalitati 14-6-30/a (A3)")
			lcRaport="rapbal_a3_5_14_6_30_a" && A3 5 EGALITATI (SI, TSP, RLC, TS, SF)
		
		Case lcOptiuneRaport = Upper("6 Egalitati 14-6-30/b (A3)")
			lcRaport="rapbal_a3_6_14_6_30_b" && A3 6 EGALITATI (SI, TSP,  RLC, TR, TS, SF)
		Endcase
		
		This.AlwaysOnTop = .F.
		*!* 04.08.2011
		*!*	goExport.export2frx(lcbal,lcRaport)
		goExport.export2frx(lcbal,lcRaport, , , , , , .T.)
		*!* 04.08.2011 ^
		This.AlwaysOnTop = .T.
		*!*	If Reccount(LCBAL)>0
		*!*		This.AlwaysOnTop = .F.
		*!*		Report Format (lcRaport) To Printer Prompt Preview
		*!*		This.AlwaysOnTop = .T.
		*!*	Else
		*!*		amessagebox("Nu exista inregistrari pentru listare!",48,"Atentie")
		*!*	Endif
	ENDPROC

	PROCEDURE do_reface
		x= xmenu('Refacere \<lunara;Refacere cu \<precedente')
		lcSursa = [BALANTA]
		lnLuna = gnLuna
		lnAn = gnAn
		lcCont = []
		
		Do Case
		Case x = 1
			lcLunar = [0]
			*lcExec = [begin pack_refaceri.refac_balanta('] + gcS + [',] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,0); end;]
		Case x = 2
			lcLunar = [1]
			*lcExec = [begin pack_refaceri.refac_balanta('] + gcS + [',] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,1); end;]
		Otherwise
			Return
		Endcase
		
		*!*	lnSucces = goExecutor.oExecute(lcExec)
		*!*	If lnSucces < 0
		*!*		Messagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*		Return
		*!*	Endif
		
		lnSucces = refacere(lcSursa,lcLunar,lcCont,lnLuna,lnAn) && IN orefaceri.prg
		IF lnSucces > 0
			aMessagebox('Refacerea s-a terminat!',0+64,"Info refacere")
			Thisform.reconstruct
			Thisform.afisactual
			Do inainte With this.cProceduraInainte In oinainte_de.prg
		ENDIF 
	ENDPROC

	PROCEDURE fisacont
		Private lcbal
		lcbal=Thisform.calias
		*!*	modificare v 2.0.110
		*!*	lcCondSucursala = Thisform.conditieistoricact()
		*!*	modificare v 2.0.110	^
		Select (lcbal)
		Scatter Name locont
		*!*	modificare v 2.0.110
		If Empty(Substr(Nvl(locont.Cont,''),1,4))
			amessagebox("Nu exista contul in selectie!",48,"Atentie")
		Else
			lcCondSucursala = Thisform.conditieistoricact()
		*!*	modificare v 2.0.110	^
		
			Private pcselect1,pcfiltru1,pcorder1,pcschema1,poact
			Store "" To poact
			*!*	pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,NRACT N(14),DATAACT D,'+]+;
			*!*		['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
			*!*		['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
			*!*		['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
			*!*		['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
			*!*		['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
			*!*		['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
			*!*		['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1=['']
			pcselect1=['select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora, explicatie_tva from ] + gcS + [.vact where 1=2']
			*!*	modificare v 2.0.110
			*!*		pcfiltru1=[(luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[) and (SCD=]+Substr(locont.Cont,1,4)+ lcCondSucursala + [ or scc=]+Substr(locont.Cont,1,4)+[)]
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[ and (SCD=']+Substr(locont.Cont,1,4)+[' or scc=']+Substr(locont.Cont,1,4)+[')] + lcCondSucursala
			*!*	modificare v 2.0.110	^
			pcorder1=[dataact,serie_act,nract]
			llAfisare=.F.
			*!*	gencursor('poact','act',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			gencursor('poact','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact.ca_baza1.afisare()
		
			*!*	SELE ACT
			*!*	SET FILTER TO SCD=SUBSTR(locont.CONT,1,4) AND !DELETED()
			*!*	Do NRORD With "ACT"
			*!*	ORC=Createobj("AFDEBCRED")
			*!*	ORC.LABELTITLU.Caption="FISA CONTULUI "+locont.Cont
			*!*	ORC.ALI = 'ACT'
			*!*	ORC.Show(1)
		
			Do NRORD With "ACN1"
			Select acn1
			Go Top
			ORC=Createobject("frm_debcred")
			ORC.lb_titlu_alb_b121.Caption=Thisform.lb_titlu_alb_b121.Caption+" - FISA CONTULUI "+locont.Cont
			ORC.lb_titlu1.Caption="FISA CONTULUI "+locont.Cont
			ORC._grdbase1.RemoveObject("cUtil")
			ORC._grdbase1.RemoveObject("cDataOra")
			ORC.Show(1)
		
			*!*	SELECT act
			*!*	SET FILTER TO
			Use In acn1
			Release poact
			Select(lcbal)
		*!*	modificare v 2.0.110
		Endif
		*!*	modificare v 2.0.110	^
		
	ENDPROC

	PROCEDURE inainte_de_do_excel
		If Thisform.lactiv1
			This.do_excel
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_listare
		If Thisform.lactiv2
			This.do_listare
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_modifica
		*!* NU POT FACE MODIFICARI DACA NU AM DREPT PE MODIFICARE SAU INTR-O LUNA INCHISA
		If !Thisform.lactiv3 Or glLunaInchisa
			Return
		Endif
		
		*!* NU POT FACE MODIFICARI PE BALANTA CUMULATA - NU AM ID_BAL
		IF glEMama
			IF crsSucursale.ID_SUCURSALA = -1
				aMessageBox('Nu se pot face modificari pe balanta centralizata!' + CRLF + 'Selectati balanta defalcata pe sucursale',0+64,'Balanta')
				RETURN
			ENDIF 	
		ENDIF 
		
		Thisform.meniu_as
		Thisform.grID1.SetFocus
	ENDPROC

	PROCEDURE inainte_de_do_reface
		If Thisform.lactiv4 And !glLunaInchisa
			This.do_reface()
		Endif
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Thisform.WindowState = 2
		
		If .F.
			lnLungimeBanda = Thisform.but_termin1.Width + 10
			lnPozitieButon = Thisform.but_termin1.Left
			lnLungimeButon = Thisform.but_termin1.Width + 1		&&	30 + 1 (spatiu)
			lnOffsetBanda = 6					&& diferenta dintre _shape2.left si but_termin1.left
		
		
			If Thisform.lactiv2
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.but_listare1.Left = lnPozitieButon
			Endif
			If Thisform.lactiv1
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.but_excel1.Left = lnPozitieButon
			Endif
			If Thisform.lactiv3 And !glLunaInchisa
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.but_modifica1.Left = lnPozitieButon
			Endif
			If Thisform.lactiv4 And !glLunaInchisa
				lnPozitieButon = lnPozitieButon - lnLungimeButon
				lnLungimeBanda = lnLungimeBanda + lnLungimeButon
				Thisform.BUT_reface1.Left = lnPozitieButon
			Endif
			With Thisform._shape2
				* With Thisform.banda_alba
				.Width = lnLungimeBanda
				.Left = lnPozitieButon - lnOffsetBanda
			Endwith
		Endif && .F.
		
		If This.BUT_reface1.Visible
			This.BUT_reface1.Visible=!glLunaInchisa
		Endif
		If This.but_modifica1.Visible
			This.but_modifica1.Visible=!glLunaInchisa
		Endif
		
		Public sz
		This.calias=This.grid1.RecordSource && TBALANTA
		Private lcbal
		lcbal=Thisform.calias
		
		Select(lcbal)
		Go Top
		
		Store 0.0000 To m.sprecdeb1,m.spreccred1,m.sprecdeb,m.spreccred,m.sruldeb,m.srulcred,m.stotdeb,m.stotcred,m.ssolddeb,m.ssoldcred
		
		If .F.
			With Thisform.grid1
				.cprecdeb1.Width=0
				.cpreccred1.Width=0
			Endwith
		Endif
		
		IF glEMama
			lnSucces = ccsucursale_mama() && IN updateserver.prg && vnom_sucursale_mama
		
			CREATE CURSOR crsSucursale (id_sucursala n(5), sucursala c(100))
			INSERT INTO crsSucursale (id_sucursala, sucursala) VALUES (-1, 'Balanta centralizata')
			INSERT INTO crsSucursale (id_sucursala, sucursala) VALUES (-2, 'Balanta pe sucursale')	
			INSERT INTO crsSucursale (id_sucursala, sucursala) VALUES (-3, 'Balanta grup')		
			SELECT crsSucursale
			APPEND FROM DBF('vnom_sucursale_mama')
			REPLACE ALL sucursala WITH 'Balanta ' + PROPER(ALLTRIM(sucursala)) FOR id_sucursala > 0
		
			close_ccsucursale_mama()
			SELECT crsSucursale
			GO TOP 
			WITH this.pf.p2.cboSucursale
				.RowSourceType = 6
				.RowSource = "crsSucursale.sucursala"
				.Visible = .T.
				this.pf.p2.cboSucursale.Value = crsSucursale.sucursala
			EndWith
		Else 
			this.grid1.cSucursala.Visible = .F.	 
		ENDIF 	
		*!* Locale
		*!* goLocale.SetLocale( thisform )
		*!* Locale ^
		this.gridextra1.setup()
		*MESSAGEBOX(this.grid1.cdenumire.text1.FontName + ' ' + TRANSFORM(this.grid1.cdenumire.text1.FontName))
		
		Thisform.afisactual
		
		
	ENDPROC

	PROCEDURE in_bal
		Parameters tnIdSucursala, tcCont,tcAcont,tlCalculeaza
		Private lcCont,lcField,lcOldAlias,lcTabela
		LOCAL lcIdSucursala
		
		lcOldAlias=Alias()
		lcField=This.cfield
		lnvalue=This.nnewvalue
		lnOldValue=This.noldvalue
		
		If lnvalue=lnOldValue
			Return
		Endif
		
		If Empty(tcAcont)
			lcAcont=""
		Else
			lcAcont=Upper(Alltrim(tcAcont))
		Endif
		
		If Empty(tcCont)
			lcCont=""
		Else
			lcCont=Upper(Alltrim(tcCont))
		Endif
		
		lcIdSucursala = ALLTRIM(STR(NVL(tnIdSucursala,0)))
		If !Empty(lcAcont)
			lcTabela = "balana"
			lcCond = [NVL(id_sucursala,0) = ] + lcIdSucursala + [ AND TRIM(UPPER(cont))=']+lcCont+[' and TRIM(UPPER(acont))=']+lcAcont+[' and an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnLuna))
		Else
			lcTabela = "bal"
			lcCond = [NVL(id_sucursala,0) = ] + lcIdSucursala + [ AND TRIM(UPPER(cont))=']+lcCont+[' and an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnLuna))
		Endif
		
		*!*	If !EXISTACAMP(lcTabela,lcField) && DACA NU EXISTA CAMPUL NU FAC NIMIC
		*!*		Return
		*!*	Endif
		
		&& setare zecimale
		pcexec=[update ] + ALLTRIM(lcTabela) + [ set ] + ALLTRIM(lcField) + [=] + ALLTRIM(STR(lnvalue,24,4)) + [ ] + ;
				[where ]+lcCond
		
				
		lnSucces=goExecutor.oexecute(pcexec)
		If lnSucces < 0
			lcTextEroare = goExecutor.cEroare
			aMessagebox(lcTextEroare,48,"Eroare")
			Return
		Endif
		
		If tlCalculeaza
			This.calculeaza_orizontal()
		Endif
		
		If !Empty(lcOldAlias)
			Select (lcOldAlias)
		Endif
	ENDPROC

	PROCEDURE meniu_as
		Private lcbal
		lcbal=Thisform.calias
		
		If Thisform.grid1.ReadOnly
			lcText=[\<Deblocare;]
			lcText=lcText+[\-;]
			lcText=lcText+[\Adauga Blanc;]
			lcText=lcText+[\Sterge]
		Else
			lcText=[\<Revenire;]
			lcText=lcText+[\-;]
			lcText=lcText+[\<Adauga Blanc;]
			lcText=lcText+[\<Sterge]
		Endif
		lnOpt=xmenu(lcText)
		Do Case
		Case lnOpt=1
			With Thisform.grid1
				.ReadOnly=!.ReadOnly
				.ccont.ReadOnly=.T.
				.cacont.ReadOnly=.T.
				.cdenumire.ReadOnly=.T.
		&& cont2003 oracle
				.ctotdeb.ReadOnly=.T.
				.ctotcred.ReadOnly=.T.
				.csolddeb.ReadOnly=.T.
				.csoldcred.ReadOnly=.T.
			Endwith
		Case lnOpt=3
			This.adauga_linie()
		Case lnOpt=4
			This.sterge_linie()
		Endcase
		
	ENDPROC

	PROCEDURE reconstruct
		*!*	LOCAL llsucces
		*!*	llSucces=save_grid_tag(this.grid1)
		*!*	IF llsucces
		*!*		lctabel=make_tbalanta()
		*!*		restore_grid_tag(this.grid1)
		*!*	ENDIF
		save_grid_tag(This.grid1)
		lcTabel=make_tbalanta(this.lCentru,this.nLuna1,this.nAn1,this.nLuna2,this.nAn2,this.cBal)
		restore_grid_tag(This.grid1)
	ENDPROC

	PROCEDURE Release
		Private lcbal
		lcbal=Thisform.calias
		
		Release m.sprecdeb,m.spreccred,m.sruldeb,m.srulcred,m.stotdeb,m.stotcred,m.ssolddeb,m.ssoldcred
		
		Select (lcbal)
		Set Filter To
		DoDefault()
		
	ENDPROC

	PROCEDURE Resize
		*THIS.RESIZER1.ONREsize 
		Thisform.pf.p1.Check1.Refresh() && CU ANCHOR SE MUTA LA POZITIA ANTERIOARA
										&& FARA ANCHOR NU SE MAI MUTA DELOC
										&& LE-AM MUTAT MANUAL
		DODEFAULT()
	ENDPROC

	PROCEDURE rulcred
		Private lcbal
		lcbal=Thisform.calias
		lcCondSucursala = thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		Thisform.AlwaysOnTop= .F.
		If LOCONT.RULCRED==0 Then
			OST=Createobj("stop")
			OST.LABEL2.Caption="Contul "+LOCONT.Cont+":"
			OST.LABEL3.Caption="Rulaj Credit = 0"
			OST.Show(1)
		Else
			Private pcselect1,pcfiltru1,pcorder1,pcschema1,poact
			Store "" To poact
			pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1=['']
			pcselect1=["select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora, explicatie_tva from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[ and SCC=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+['] + lcCondSucursala 
			pcorder1=[dataact, serie_act, nract]
			llAfisare=.F.
			gencursor('poact','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact.ca_baza1.afisare()
		*!*		Sele ACT
		*!*		Set Filter To SCC=Substr(LOCONT.cont,1,4) And !Deleted()
		*!*		ORC=Createobj("AFDEBCRED")
		*!*		With ORC
		*!*			.ali='act'
		*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - RULAJ CREDIT"
		*!*		Endwith
			ORC=Createobj("frm_debcred")
			With ORC
					.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - RULAJ CREDIT"
					.lb_titlu1.caption="SITUATIE ANALITICA - RULAJ CREDIT"
					._grdbase1.removeobject("cUtil")
					._grdbase1.removeobject("cDataOra")
			Endwith
			ORC.Show(1)
			USE IN acn1
		*!*		SELECT ACT
		*!*		SET FILTER TO
		*!*		Select act
		*!*		Use
			Release poact
		Endif
		
		Thisform.AlwaysOnTop= .T.
		Select (lcbal)
		Release LOCONT
	ENDPROC

	PROCEDURE ruldeb
		Private lcbal
		lcbal=Thisform.calias
		lcCondSucursala = thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		Thisform.AlwaysOnTop= .F.
		If LOCONT.RULDEB==0 Then
			OST=Createobj("stop")
			OST.LABEL2.Caption="Contul "+LOCONT.Cont+":"
			OST.LABEL3.Caption="Rulaj Debit = 0"
			OST.Show(1)
		Else
			Private pcselect1,pcfiltru1,pcorder1,pcschema1,poact
			Store "" To poact
			pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1=['']
			pcselect1=['select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora,explicatie_tva from ] + gcS + [.vact where 2=2']
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+ lcCondSucursala + [ and SCD=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+[']
			pcorder1=[dataact, serie_act, nract]
			llAfisare=.F.
			gencursor('poact','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact.ca_baza1.afisare()
		
		*!*		Sele ACT
		*!*		Set Filter To SCD=Substr(LOCONT.Cont,1,4) And !Deleted()
		*!*		ORC=Createobj("AFDEBCRED")
		*!*		With ORC
		*!*			.ali='act'
		*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - RULAJ DEBIT"
		*!*		Endwith
		*!*		ORC.Show(1)
		*!*		Select act
		*!*		Use
			ORC=Createobj("frm_debcred")
			With ORC
					.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - RULAJ DEBIT"
					.lb_titlu1.caption="SITUATIE ANALITICA - RULAJ DEBIT"
					._grdbase1.removeobject("cUtil")
					._grdbase1.removeobject("cDataOra")
			Endwith
			ORC.Show(1)	
		
			USE IN acn1
			Release poact
		Endif
		Release ORC
		Thisform.AlwaysOnTop= .T.
		
		*!*	SELECT ACT
		*!*	SET FILTER TO
		
		Select(lcbal)
		Release LOCONT
	ENDPROC

	PROCEDURE ruldebcred
		Private lcbal
		lcbal=Thisform.calias
		lcCondSucursala = thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		If LOCONT.RULCRED=0 And LOCONT.RULDEB=0 Then
			OST=Createobj("stop")
			OST.LABEL2.Caption="Contul "+LOCONT.Cont+":"
			OST.LABEL3.Caption="Nu exista rulaje in luna."
			OST.Show(1)
		Else
			Private pcselect1,pcfiltru1,pcschema1,poact,poact1,poact2
			Store "" To poact,poact1,poact2
			pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1=['']
			pcselect1=["select dataact,serie_act,nract,suma,explicatia,scd,ascd,scc,ascc,partd,partc,dataireg,fdoc from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn)) + lcCondSucursala 
			pcorder1=[dataact, serie_act,nract]
			llAfisare=.F.
			gencursor('poact','act',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact.ca_baza1.afisare()
			Sele ACT
		*DO NRORD WITH "ACT"
			Sele 0
		
			pcselect1=["select dataact,nract,suma,explicatia,scd,ascd,scc,ascc,partd,partc,dataireg,fdoc from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[ and SCD=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+[']+lcCondSucursala 
			pcorder1=[dataact, nract]
			llAfisare=.F.
			gencursor('poact1','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact1.ca_baza1.afisare()
		*!*			USE &DATE/ACT.DBF;
		*!*			AGAIN ALIAS ACn1
		*!*			SET FILTER TO SCD=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
		
			pcselect1=["select * from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))+[ and SCC=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+[']+lcCondSucursala 
			pcorder1=[dataact, serie_act, nract]
			llAfisare=.F.
			gencursor('poact2','acn2',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact2.ca_baza1.afisare()
		*!*			SELE 0
		*!*			USE &DATE/ACT.DBF;
		*!*			AGAIN ALIAS ACn2
		*!*			SET FILTER TO SCC=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
		
		*!*		ORC=Createobj("AFDEBsiCRED")
		*!*		ORC.Caption="SITUATIE ANALITICA - Rulaje Cont "+LOCONT.Cont
		*!*		ORC.Show(1)
			orc=CREATEOBJECT("frm_debsicred")
			orc.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - Rulaje Cont "+LOCONT.Cont
			orc.show(1)
			Sele acn1
			Use
			Sele acn2
			Use
		
		*!*		modificare
			Select ACT
			Use
			Release poact,poact1,poact2,ORC
		*!*
		Endif
		
		Select(lcbal)
		Release LOCONT
		
	ENDPROC

	PROCEDURE sterge_linie
		LOCAL lcIdSucursala
		Private lcbal,lcContS,lcContA
		lcbal=This.calias
		
		Select (lcbal)
		lcContS=Alltrim(Cont)
		lcContA=Alltrim(acont)
		
		If Empty(lcContS) And Empty(lcContA)
			aMessagebox("Nu puteti sterge un total!",0+48,"Atentie")
			Return
		Endif
		
		lcIdSucursala = IIF(NVL(id_sucursala,0) = 0, 'NULL', ALLTRIM(STR(id_sucursala)))
		pcexec=[begin pack_inregistrari.baldelproc(] + lcIdSucursala + [,] + ALLTRIM(STR(gnLuna)) + [,] + ALLTRIM(STR(gnAn))+ [,']+lcContS+[',']+lcContA+['); end;]
		lnSucces=goExecutor.oexecute(pcexec)
		If lnSucces < 0
			lcTextEroare = goExecutor.cEroare
			If "ORA-20000"$lcTextEroare
				lnPozi=At("ORA-20000",lcTextEroare)+11
				lnPozf=At("ORA",lcTextEroare,2)
				lcTextEroare=Substr(lcTextEroare,lnPozi,lnPozf-lnPozi)
			Endif
			aMessagebox(lcTextEroare,48,"Eroare")
			Return
		Endif
		
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		This.reconstruct
		This.afisactual
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
		
	ENDPROC

	PROCEDURE totcred
		Private lcbal
		lcbal=Thisform.calias
		lcCondSucursala = thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		Thisform.AlwaysOnTop= .F.
		
		If LOCONT.TOTCRED==0 Then
			OST=Createobj("stop")
			OST.LABEL2.Caption="Contul "+LOCONT.Cont+":"
			OST.LABEL3.Caption="Total Credit = 0"
			OST.Show(1)
		Else
			Private pcselect1,pcfiltru1,pcschema1,poact
			Store "" To poact
			pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1=['']
			pcselect1=["select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora,explicatie_tva from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[SCC=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+['] + lcCondSucursala 
			pcorder1=[dataact, serie_act,nract]
			llAfisare=.F.
			gencursor('poact','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact.ca_baza1.afisare()
		
		*!*		Sele ACTAN
		*!*	*		DO NRORD WITH "ACTAN"
		*!*		*	sum suma to totsum
		*!*			SET FILTER TO SCC=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
		*!*		ORC=Createobj("AFDEBCRED")
		*!*		With ORC
		*!*			.ali='actan'
		*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - TOTAL CREDIT"
		*!*		Endwith
		*!*		ORC.Show(1)
			ORC=Createobj("frm_debcred")
			With ORC
					.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - TOTAL CREDIT"
					.lb_titlu1.caption="SITUATIE ANALITICA - TOTAL CREDIT"
					._grdbase1.removeobject("cUtil")
					._grdbase1.removeobject("cDataOra")
			Endwith
			ORC.Show(1)	
		*!*			SELECT ACTAN
		*!*			SET FILTER TO
		*!*	  	modificare
		*!*		Select ACTAN
		*!*		Use
			USE IN acn1
			Release poact
		*!*
		Endif
		Release ORC
		Thisform.AlwaysOnTop= .T.
		
		Select (lcbal)
		
	ENDPROC

	PROCEDURE totdeb
		Private lcbal
		lcbal=Thisform.calias
		lcCondSucursala = thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		Thisform.AlwaysOnTop= .F.
		If LOCONT.TOTDEB==0 Then
			OST=Createobj("stop")
			OST.LABEL2.Caption="Contul "+LOCONT.Cont+":"
			OST.LABEL3.Caption="Total Debit = 0"
			OST.Show(1)
		Else
			Private pcselect1,pcfiltru1,pcschema1,poact
			Store "" To poact
			pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
				['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
				['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
				['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
				['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
				['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
				['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
				['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
			pcschema1=['']
			pcselect1=["select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,util,dataora,explicatie_tva from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[SCD=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+['] + lcCondSucursala 
			pcorder1=[dataact, serie_act, nract]
			llAfisare=.F.
			gencursor('poact','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact.ca_baza1.afisare()
		
		*!*		Sele ACTAN
		*!*	*		DO NRORD WITH "ACTAN"
		*!*	*	sum suma to totsum
		*!*		SET FILTER TO SCD=SUBSTR(LOCONT.CONT,1,4) AND !DELETED()
		*!*	*		DO NRORD WITH "ACTAN"
		*!*		ORC=Createobj("AFDEBCRED")
		*!*		With ORC
		*!*			.ali='actan'
		*!*			.LABELTITLU.Caption="SITUATIE ANALITICA - TOTAL DEBIT"
		*!*		Endwith
		*!*		ORC.Show(1)
			orc=CREATEOBJECT("frm_debcred")
			With ORC
					.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - TOTAL DEBIT"
					.lb_titlu1.caption="SITUATIE ANALITICA - TOTAL DEBIT"
					._grdbase1.removeobject("cUtil")
					._grdbase1.removeobject("cDataOra")
			ENDWITH
			orc.show(1)
		*!*		SELECT ACTAN
		*!*		SET FILTER TO
		
		*!* modificare
		*!*		Select ACTAN
		*!*		Use
			USE IN acn1
			Release poact
		*!*
		Endif
		
		Thisform.AlwaysOnTop= .T.
		Select (lcbal)
		Release LOCONT
		
	ENDPROC

	PROCEDURE totdebcred
		Private lcbal
		lcbal=Thisform.calias
		lcCondSucursala = thisform.conditieistoricact()
		Select (lcbal)
		Local c
		Scatter Name LOCONT
		Thisform.AlwaysOnTop= .F.
		If LOCONT.TOTCRED==0 And LOCONT.TOTDEB==0 Then
			OST=Createobj("stop")
			OST.LABEL2.Caption="Contul "+LOCONT.Cont
			OST.LABEL3.Caption="este neutilizat!"
			OST.Show(1)
		Else
			Private pcselect1,pcfiltru1,pcschema1,poact,poact1,poact2
			Store "" To poact,poact1,poact2
		*!*		pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,NRACT N(14),DATAACT D,'+]+;
		*!*			['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
		*!*			['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
		*!*			['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
		*!*			['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
		*!*			['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
		*!*			['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
		*!*			['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
				pcschema1=['']
		*!*		pcselect1=["select * from ] + gcS + [.vact where 2=2"]
		*!*		pcfiltru1=[2=2]
		*!*		pcorder1=[]
		*!*		llAfisare=.F.
		*!*		gencursor('poact','actan',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
		*!*		poact.ca_baza1.afisare()
		
		*!*		Sele ACTan
		*!*	*	DO NRORD WITH "ACTan"
			Sele 0
		&&	 to_char(dataact,'DD/MM/YYYY') as
			pcselect1=["select dataact,serie_act,nract,suma,explicatia,scd,ascd,scc,ascc,partd,partc,dataireg,fdoc from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[SCD=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+['] + lcCondSucursala 
			pcorder1=[dataact,serie_act, nract]
			llAfisare=.F.
			gencursor('poact1','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact1.ca_baza1.afisare()
		*!*			USE &DATEan/ACTan.DBF;
		*!*			AGAIN ALIAS ACn1
		*!*			SET FILTER TO SCD=SUBSTR(locont.CONT,1,4) AND !DELETED()
		
			pcselect1=["select dataact,serie_act,nract,suma,explicatia,scd,ascd,scc,ascc,partd,partc,dataireg,fdoc from ] + gcS + [.vact where 2=2"]
			pcfiltru1=[SCC=']+ALLTRIM(Substr(LOCONT.Cont,1,4))+['] + lcCondSucursala 
			pcorder1=[dataact, serie_act,nract]
			llAfisare=.F.
			gencursor('poact2','acn2',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poact2.ca_baza1.afisare()
		*!*			SELE 0
		*!*			USE &DATEan/ACTan.DBF;
		*!*			AGAIN ALIAS ACn2
		*!*			SET FILTER TO SCC=SUBSTR(locont.CONT,1,4) AND !DELETED()
		*!*		ORC=Createobj("AFDEBsiCRED")
		*!*		ORC.Caption="SITUATIE ANALITICA - Total Cont "+LOCONT.Cont
		*!*		ORC.Show(1)
			orc=CREATEOBJECT("frm_debsicred")
			orc.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - Total Cont "+LOCONT.Cont
			orc.show(1)
		
			Sele acn1
			Use
			Sele acn2
			Use
		*!*	  	modificare
		*!*		Select ACTan
		*!*		Use
			Release poact,poact1,poact2
			Release ORC
		*!*
		Endif
		
		Thisform.AlwaysOnTop= .T.
		Select (lcbal)
		
	ENDPROC

	PROCEDURE Ct1.Text1.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ct1.Text2.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ct1.Text3.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Ct1.Text4.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.DblClick
			thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.GotFocus
		lcSufix="cont"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.Valid
		thisform.nnewvalue=this.value
		LOCAL lcCont
		lcCont=thisform.noldvalue
		RETURN .T.
		thisform.in_bal(lcCont)
		
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.GotFocus
		lcSufix="denumire"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cdenumire.Text1.Valid
		RETURN .T.
		PRIVATE lcbal
		lcBal=thisform.calias 
		LOCAL lcCont,lcAcont
		
		
		thisform.nnewvalue=this.value
		SELECT (lcBal)
		lcCont=cont
		lcAcont=acont
		
		thisform.in_bal(lcCont,lcAcont)
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.GotFocus
		lcSufix="PRECCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cpreccred.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.cpreccred1.Text1.GotFocus
		lcSufix="PRECCRED1"
		thisform.cField=lcSufix
	ENDPROC

	PROCEDURE Grid1.cpreccred1.Text1.Valid
		thisform.calculeaza
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.GotFocus
		lcSufix="PRECDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cprecdeb.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.cprecdeb1.Text1.GotFocus
		lcSufix="PRECDEB1"
		thisform.cField=lcSufix
	ENDPROC

	PROCEDURE Grid1.cprecdeb1.Text1.Valid
		thisform.calculeaza
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.GotFocus
		lcSufix="RULCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.crulcred.Text1.Valid
		thisform.calculeaza
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.GotFocus
		lcSufix="RULDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.cruldeb.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.GotFocus
		lcSufix="SOLDCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.csoldcred.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.GotFocus
		lcSufix="SOLDDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.csolddeb.Text1.Valid
		thisform.calculeaza
		
		
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.GotFocus
		lcSufix="TOTCRED"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.ctotcred.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.GotFocus
		lcSufix="TOTDEB"
		thisform.cField=lcSufix
		
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.ctotdeb.Text1.Valid
		thisform.calculeaza
		
	ENDPROC

	PROCEDURE Grid1.DblClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE Grid1.Init
		*!*	this.SetAll("DynamicForeCOlor",;
		*!*	"IIF(!EMPTY(cont),RGB(0,0,0),IIF(nivel=1,RGB(0,0,255),RGB(0,128,128)))","Column")
		
		this.SetAll("DynamicForeCOlor","IIF(BNIVEL<3,RGB(0,0,255),RGB(0,0,0))","Column")
		this.SetAll("DynamicForeCOlor","IIF(difana=1,RGB(128,0,255),RGB(0,0,0))","Column")
		
		this.SetAll("DynamicFontbold","IIF(INLIST(BNIVEL,1,3),.t.,.f.)","Column")
		
	ENDPROC

	PROCEDURE Optiongroup1.Option1.Click
		PRIVATE lcbal
		lcbal=thisform.calias 
		
		THIS.PARENT.OPTION2.ENABLED=.F.
		THIS.PARENT.OPTION3.ENABLED=.F.
		THIS.PARENT.OPTION4.ENABLED=.F.
		THIS.PARENT.OPTION5.ENABLED=.F.
		
		SELECT(LCBAL)
		SET FILTER TO !DELETED()
		THISFORM.GRID1.ACTIVATECELL(1,1)
	ENDPROC

	PROCEDURE Optiongroup1.Option2.Click
		THISFORM.RULDEB
	ENDPROC

	PROCEDURE Optiongroup1.Option3.Click
		THISFORM.RULCRED
	ENDPROC

	PROCEDURE Optiongroup1.Option4.Click
		THISFORM.TOTDEB
	ENDPROC

	PROCEDURE Optiongroup1.Option5.Click
		THISFORM.TOTCRED
	ENDPROC

	PROCEDURE pf.p1.Check1.Refresh
		With Thisform.pf.p1
			If Thisform.pf.p2.Cksold1.Value = 0 && FARA SOLDURI 1 IANUARIE
				.lbldebit.Left=.text1.Left-.lbldebit.Width
				.lblcredit.Left=.text2.Left-.lblcredit.Width
				.check1.Left=.label8.Left-.lbldebit.Width
			Else
				.lbldebit.Left=.txtprecdeb1.Left-.lbldebit.Width
				.lblcredit.Left=.txtpreccred1.Left-.lblcredit.Width
				.check1.Left=.lblsld1.Left-.lbldebit.Width
			Endif
		Endwith
		
	ENDPROC

	PROCEDURE pf.p1.Check1.Valid
		thisform.afisactual 
		IF this.Value = 1
			this.Caption = 'Analitice'
		ELSE 
			this.Caption = 'Sintetice'
		ENDIF 
	ENDPROC

	PROCEDURE pf.p1.Click
		WITH THIS
			.text1.Refresh
			.text2.Refresh
			.text3.Refresh
			.text4.Refresh
			.text5.Refresh
			.text6.Refresh
			.text7.Refresh
			.text8.Refresh
		ENDWITH 
	ENDPROC

	PROCEDURE pf.p1.Text1.Refresh
		THIS.FORECOLOR=IIF(M.SPRECDEB>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.p1.Text2.Refresh
		THIS.FORECOLOR=IIF(M.SPRECCRED>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.p1.Text3.Refresh
		THIS.FORECOLOR=IIF(M.SRULCRED>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.p1.Text4.Refresh
		THIS.FORECOLOR=IIF(M.SRULDEB>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.p1.Text5.Refresh
		THIS.FORECOLOR=IIF(M.STOTDEB>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.p1.Text6.Refresh
		THIS.FORECOLOR=IIF(M.STOTCRED>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.p1.Text7.Init
		sum solddeb to m.ssolddeb
		this.refresh
	ENDPROC

	PROCEDURE pf.p1.Text8.Init
		sum soldcred to m.ssoldcred
		this.refresh
	ENDPROC

	PROCEDURE pf.p1.txtpreccred1.Refresh
		THIS.FORECOLOR=IIF(M.SPRECCRED1>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.p1.txtprecdeb1.Refresh
		THIS.FORECOLOR=IIF(M.SPRECDEB1>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE pf.P2.cboSucursale.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE pf.P2.ckanalitic.Click
		
		
	ENDPROC

	PROCEDURE pf.P2.ckanalitic.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE pf.P2.cksold1.Valid
		thisform.afisactual 
		
	ENDPROC

	PROCEDURE pf.P2.cktotal1.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE pf.P2.cktotal2.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE pf.P2.cktotal3.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE pf.P2.cktotal4.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE pf.P2.Ck_acont.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE pf.P2.Ck_cont.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE pf.P2.Ck_denumire.Valid
		thisform.afisactual 
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option1.Click
		*!*	lcbal=thisform.calias 
		
		*!*	THIS.PARENT.OPTION2.ENABLED=.F.
		*!*	THIS.PARENT.OPTION3.ENABLED=.F.
		*!*	THIS.PARENT.OPTION4.ENABLED=.F.
		*!*	THIS.PARENT.OPTION5.ENABLED=.F.
		
		*!*	SELECT(LCBAL)
		*!*	SET FILTER TO !DELETED()
		THISFORM.GRID1.SetFocus 
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option2.Click
		thisform.fisacont
		THIS.parent.Value=8 && balanta
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option3.Click
		THISFORM.RULDEB
		THIS.parent.Value=8 && balanta
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option4.Click
		THISFORM.RULCRED
		THIS.parent.Value=8 && balanta
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option5.Click
		THISFORM.RULDEBCRED
		THIS.parent.Value=8 && balanta
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option6.Click
		THISFORM.TOTDEB
		THIS.parent.Value=8 && balanta
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option7.Click
		THISFORM.TOTCRED
		THIS.parent.Value=8 && balanta
	ENDPROC

	PROCEDURE pf.p3.Optiongroup1.Option8.Click
		THISFORM.TOTDEBCRED
		THIS.parent.Value=8 && balanta
	ENDPROC

	PROCEDURE pf.P4.cboRaport.Init
		this.Value = '4 egalitati 14-6-30 (A4)'
	ENDPROC

	PROCEDURE txtcont.Valid
		thisform.txtcont2.Value = this.Value 
		thisform.afisactual
		
	ENDPROC

	PROCEDURE txtcont2.Valid
		thisform.afisactual
	ENDPROC

ENDDEFINE
