*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="ofacturare_comun.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS frm_borderou_facturi AS _frmbase 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_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValval.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValval.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cInValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cInValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cInValuta._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValcTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValcTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cnrfact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cnrfact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cdatafact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cdatafact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValftva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValftva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cSerieFact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cSerieFact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTipFactura.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTipFactura.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdBorderou.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdBorderou.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cId.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cId.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cData.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cData.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cTrimis._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cDataTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cDataTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cConfirmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cConfirmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cConfirmat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cDataConfirmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cDataConfirmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cEmailClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdBorderou.cEmailClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_select_adv1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Sfsplitterh1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra2" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: bifeaza
		*p: nidborderou
		*p: ntip		&& 0=tranzit, 1=cheiaj
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		FontBold = .F.
		Height = 471
		Name = "frm_borderou_facturi"
		nidborderou = 0
		ntip = 0
		Width = 792
		WindowState = 2
		_memberdata = <VFPData>
			<memberdata name="nidborderou" display="nIdBorderou"/>
			<memberdata name="bifeaza" display="Bifeaza"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = -1
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 822
		_shape1.ZOrderSet = 0
		_shape2.Left = 741
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Caption = "Borderouri facturi"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 10
		Lb_titlu_alb_b121.ZOrderSet = 2
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 761
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 9
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 3
		Gridsort1.Left = 780
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 449
	*</PropValue>

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Left = 732, ;
		Name = "But_listare1", ;
		TabIndex = 8, ;
		Top = 1, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Anchor = 9, ;
		Left = 644, ;
		Name = "But_reset_criterii1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="..\..\..\roafacturare\comun\clase\ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 673, ;
		Name = "But_start_criterii1", ;
		TabIndex = 6, ;
		Top = 1, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="..\..\..\roafacturare\comun\clase\ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 9, ;
		Left = 703, ;
		Name = "But_sterge1", ;
		TabIndex = 7, ;
		Top = 1, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Anchor = 6, ;
		Caption = "Marcheazã \<trimis", ;
		ForeColor = 0,128,0, ;
		Height = 27, ;
		Left = 140, ;
		Name = "Cmd_executa1", ;
		Top = 428, ;
		Width = 128, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_select_adv1' AS cmd_select_adv WITH ;
		Anchor = 6, ;
		ccoloana = ales, ;
		cgrid = thisform.grdBorderou, ;
		FontBold = .T., ;
		Height = 27, ;
		Left = 5, ;
		Name = "Cmd_select_adv1", ;
		TabIndex = 2, ;
		Top = 428, ;
		Width = 128, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdBorderou' AS _grdbase WITH ;
		Anchor = 5, ;
		BackColor = 255,255,255, ;
		ColumnCount = 9, ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 384, ;
		lcamptextneeditabil = .F., ;
		Left = 5, ;
		Name = "grdBorderou", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsBorderou", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 38, ;
		Width = 700, ;
		ZOrderSet = 8, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "ales", ;
		Column1.CurrentControl = "_checkbox1", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cAles", ;
		Column1.ReadOnly = .F., ;
		Column1.Sparse = .F., ;
		Column1.Width = 26, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "id_borderou", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cId", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 40, ;
		Column3.Alignment = 6, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "data_borderou", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cData", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 117, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 4, ;
		Column4.ControlSource = "client", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cClient", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 263, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ControlSource = "trimis", ;
		Column5.CurrentControl = "_checkbox1", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cTrimis", ;
		Column5.ReadOnly = .F., ;
		Column5.Sparse = .F., ;
		Column5.Width = 43, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ControlSource = "data_trimis", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cDataTrimis", ;
		Column6.ReadOnly = .T., ;
		Column7.BackColor = 255,255,255, ;
		Column7.ControlSource = "confirmat", ;
		Column7.CurrentControl = "_checkbox1", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cConfirmat", ;
		Column7.ReadOnly = .F., ;
		Column7.Sparse = .F., ;
		Column7.Width = 58, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ControlSource = "data_confirmat", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cDataConfirmat", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 84, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ControlSource = "email_client", ;
		Column9.Name = "cEmailClient", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 267
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdBorderou.cAles._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 17, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 62
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdBorderou.cAles.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grdBorderou.cConfirmat._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "confirmat", ;
		FontSize = 10, ;
		Left = 30, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdBorderou.cConfirmat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Confirmat", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdBorderou.cConfirmat.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grdBorderou.cDataConfirmat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data confirmat", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdBorderou.cDataConfirmat.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdBorderou.cDataTrimis.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data trimis", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdBorderou.cDataTrimis.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdBorderou.cEmailClient.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Email", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdBorderou.cTrimis._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "trimis", ;
		FontSize = 10, ;
		Left = 50, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdBorderou.cTrimis.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Trimis", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdBorderou.cTrimis.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdFacturi' AS _grdbase WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 11, ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 384, ;
		lcamptextneeditabil = .F., ;
		Left = 711, ;
		Name = "grdFacturi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsFacturiBorderou", ;
		RowHeight = 19, ;
		TabIndex = 11, ;
		Top = 38, ;
		Width = 76, ;
		ZOrderSet = 7, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 7, ;
		Column1.ControlSource = "valval", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cValval", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 81, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ColumnOrder = 9, ;
		Column2.ControlSource = "in_valuta", ;
		Column2.CurrentControl = "_checkbox1", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cInValuta", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 49, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "total_cu_tva", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cValcTVA", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 86, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 3, ;
		Column4.ControlSource = "numar_act", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cnrfact", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 87, ;
		Column5.Alignment = 6, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "data_act", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cdatafact", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 85, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "total_fara_tva", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "Rk", ;
		Column6.InputMask = (get_mask(12,gnZ)), ;
		Column6.Name = "cValftva", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 101, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 2, ;
		Column7.ControlSource = "serie_act", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cSerieFact", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 72, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 8, ;
		Column8.ControlSource = "valuta", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cValuta", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 47, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 10, ;
		Column9.ControlSource = "ctip_factura", ;
		Column9.DynamicBackColor = "RGB(225,255,255)", ;
		Column9.FontSize = 10, ;
		Column9.Format = "!K", ;
		Column9.Name = "cTipFactura", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 118, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 1, ;
		Column10.ControlSource = "client", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cClient", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 121, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ControlSource = "id_borderou", ;
		Column11.Name = "cIdBorderou", ;
		Column11.ReadOnly = .T.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdFacturi.cClient.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Client", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cClient.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdFacturi.cdatafact.Header1' AS header WITH ;
		Caption = "Data factura", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdFacturi.cIdBorderou.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id borderou", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdFacturi.cInValuta._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 17, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 62
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdFacturi.cInValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "In valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cInValuta.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdFacturi.cnrfact.Header1' AS header WITH ;
		Caption = "Numar factura", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdFacturi.cSerieFact.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie factura", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cSerieFact.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdFacturi.cTipFactura.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cTipFactura.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdFacturi.cValcTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdFacturi.cValftva.Header1' AS header WITH ;
		Caption = "Valoare (fara TVA)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdFacturi.cValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 240,240,240, ;
		Caption = "Valuta", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cValuta.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdFacturi.cValval.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'Gridextra2' AS gridextra WITH ;
		gridexpression = Thisform.grdBorderou, ;
		Left = 504, ;
		Name = "Gridextra2", ;
		Top = 108
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Sfsplitterh1' AS sfsplitterh WITH ;
		Anchor = 5, ;
		BackColor = 192,192,192, ;
		cobject1name = grdBorderou, ;
		cobject2name = grdFacturi, ;
		Height = 384, ;
		Left = 706, ;
		Name = "Sfsplitterh1", ;
		TabIndex = 12, ;
		Top = 38, ;
		Width = 5, ;
		ZOrderSet = 12, ;
		gripper.GripperDot1.Name = "GripperDot1", ;
		gripper.GripperDot1.ShapeDark.Name = "ShapeDark", ;
		gripper.GripperDot1.ShapeLight.Name = "ShapeLight", ;
		gripper.GripperDot1.ShapeMiddle.Name = "ShapeMiddle", ;
		gripper.GripperDot2.Name = "GripperDot2", ;
		gripper.GripperDot2.ShapeDark.Name = "ShapeDark", ;
		gripper.GripperDot2.ShapeLight.Name = "ShapeLight", ;
		gripper.GripperDot2.ShapeMiddle.Name = "ShapeMiddle", ;
		gripper.GripperDot3.Name = "GripperDot3", ;
		gripper.GripperDot3.ShapeDark.Name = "ShapeDark", ;
		gripper.GripperDot3.ShapeLight.Name = "ShapeLight", ;
		gripper.GripperDot3.ShapeMiddle.Name = "ShapeMiddle", ;
		gripper.GripperDot4.Name = "GripperDot4", ;
		gripper.GripperDot4.ShapeDark.Name = "ShapeDark", ;
		gripper.GripperDot4.ShapeLight.Name = "ShapeLight", ;
		gripper.GripperDot4.ShapeMiddle.Name = "ShapeMiddle", ;
		gripper.GripperDot5.Name = "GripperDot5", ;
		gripper.GripperDot5.ShapeDark.Name = "ShapeDark", ;
		gripper.GripperDot5.ShapeLight.Name = "ShapeLight", ;
		gripper.GripperDot5.ShapeMiddle.Name = "ShapeMiddle", ;
		gripper.Name = "gripper"
		*< END OBJECT: ClassLib="sfsplitter.vcx" BaseClass="control" />
	
	PROCEDURE Activate
		*
	ENDPROC

	PROCEDURE actualizeaza_grid1
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = poBorderou.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer = 11
		
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grdBorderou)
		poBorderou.ca_baza1.cfiltru = lcFiltru
		poBorderou.ca_baza1.afisare()
		restore_grid_tag(Thisform.grdBorderou)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		If Reccount('crsBorderou')>0
			Thisform.grdBorderou.SetFocus()
		Endif
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = pofacturi.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer = 11
		
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grdFacturi)
		pofacturi.ca_baza1.cfiltru = lcFiltru
		pofacturi.ca_baza1.afisare()
		restore_grid_tag(Thisform.grdFacturi)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		If Reccount('crsFacturi')>0
			Thisform.grdFacturi.SetFocus()
		Endif
	ENDPROC

	PROCEDURE bifeaza
		Lparameters tcTip, tlAles
		* tcTip: TRIMIS/CONFIRMAT
		* tlAles: .T. borderourile bifate, .F. borderoul curent
		
		Local lcTip, llSucces, lnValoare, lnRecno
		Local lcFilter, lcSql
		Private pnIdBorderou, pnValoare
		llSucces = .F.
		lcTip = Upper(Alltrim(Transform(m.tcTip)))
		If !Inlist(m.lcTip, 'TRIMIS', 'CONFIRMAT')
			Return m.llSucces
		Endif
		pnIdBorderou = crsBorderou.id_borderou
		lnRecno = Recno('crsBorderou')
		lcFilter = "id_borderou = " + Alltrim(Str(m.pnIdBorderou))
		If m.tlAles
			Select crsBorderou
			Locate For ales = 1
			If !Found()
				Locate For id_borderou = m.pnIdBorderou
			Else
				lcFilter = "ales = 1"
			Endif
		Endif
		
		If Empty(m.pnIdBorderou)
			Return m.llSucces
		Endif
		
		If lcTip = 'TRIMIS'
			lcSql = 'begin pack_fact_borderou.BifeazaTrimis(?pnIdBorderou, ?pnValoare, ?gnIdUtil); end;'
		Else
			lcSql = 'begin pack_fact_borderou.BifeazaConfirmat(?pnIdBorderou, ?pnValoare, ?gnIdUtil); end;'
		Endif
		
		Select crsBorderou
		Scan For &lcFilter
			pnIdBorderou = id_borderou
			If lcTip = 'TRIMIS'
				lnValoare = Iif(m.tlAles, Nvl(crsBorderou.trimis, 0), Iif(Empty(Nvl(crsBorderou.trimis, 0)), 1, 0)) && valoare inainte de bifa
				pnValoare = Iif(!m.tlAles, Nvl(crsBorderou.trimis, 0), 1)
		
				llSucces = goExecutor.oExecuta(m.lcSql)
				If m.llSucces
					Replace trimis With m.pnValoare, data_trimis With Iif(m.pnValoare = 1, Datetime(), {//::})
				Else
					Replace trimis With m.lnValoare, data_trimis With Iif(m.lnValoare = 1, Datetime(), {//::})
				Endif
			Else
				lnValoare = Iif(m.tlAles, Nvl(crsBorderou.confirmat, 0), Iif(Empty(Nvl(crsBorderou.confirmat, 0)), 1, 0)) && valoare inainte de bifa
				pnValoare = Iif(!m.tlAles, Nvl(crsBorderou.confirmat, 0), 1)
		
				llSucces = goExecutor.oExecuta(m.lcSql)
				If m.llSucces
					Replace confirmat With m.pnValoare, data_confirmat With Iif(m.pnValoare = 1, Datetime(), {//::})
				Else
					Replace confirmat With m.lnValoare, data_confirmat With Iif(m.lnValoare = 1, Datetime(), {//::})
				Endif
			Endif
		Endscan
		
		Select crsBorderou
		Try
			If m.lnRecno > 0
				Goto lnRecno
			Else
				Go Top
			Endif
		Catch
			Go Top
		Endtry
		Thisform.grdBorderou.Refresh()
		Return m.llSucces
		
	ENDPROC

	PROCEDURE do_cauta
		LOCAL lcfiltru, lcval1, lcColoana, ldData1, ldData2
		
		lcFiltru=''
		
		* DACA FILTRUL NU CONTINE DATA_ACT, SELECTEZ DOAR INREGISTRARILE DIN LUNA CURENTA PANA LA ZI
		* ESTE POSIBIL SA GENEREZ UN BORDEROU IN LUNA APRILIE PENTRU FACTURI DIN LUNA MARTIE, DECI AFISEZ SI BORDEROURI CU DATA >= LUNA CURENTA
		ldData1 = DATE(m.gnAn, m.gnLuna, 1)
		ldData2 = DATE()
		
		IF !('DATA_BORDEROU'$upper(THISFORM.filtru_pretty))
			lcFiltru = m.lcFiltru + [ and TRUNC(data_borderou) between to_date('] + DTOC(m.ldData1,1) + [', 'yyyymmdd') and SYSDATE]
		ENDIF
		
		* Filtre buton cautare
		IF LEN(THISFORM.filtru_pretty)>0     
			lcFiltru = m.lcFiltru + " and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"    
		ENDIF
		
		If Empty(m.lcFiltru)
			aMessagebox("Alegeti un criteriu!",0+48,"Atentie")
			This.cb_tx_cautare1.criteriu.SetFocus()
			Return
		Endif
		
		IF !EMPTY(m.lcFiltru) AND LEFT(LOWER(ALLTRIM(m.lcFiltru)),3) = "and"
			lcFiltru = SUBSTR(ALLTRIM(m.lcFiltru),4)
		ENDIF 	
		
		IF !EMPTY(m.lcFiltru)
			THISFORM.actualizeaza_grid1(m.lcFiltru)
		ENDIF
		
		IF !EMPTY(m.lcFiltru)
			THISFORM.actualizeaza_grid2(m.lcFiltru)
		ENDIF
		
		
		SELECT crsBorderou
		Return m.lcFiltru
		
	ENDPROC

	PROCEDURE do_listare
		Local lnOptiune, lcSelect, lnRecno
		Local lcIds, llListare, llPdf, llSucces
		lcSelect = SELECT()
		lnRecno = RECNO()
		
		lnOptiune = xmenu('Listare borderouri;Generare PDF-uri borderouri;Trimite borderouri si documente atasate pe email')
		If Empty(m.lnOptiune)
			Return
		ENDIF
		
		* Borderourile alese sau borderou curent daca nu este ales nici un borderou
		Select crsBorderou
		lcIds = Alltrim(Str(id_borderou))
		Locate For ales = 1
		If Found()
			Select id_borderou From crsBorderou Where ales = 1 Into Cursor cBorderouTemp
			lcIds = ''
			Select cBorderouTemp
			Scan
				lcIds = lcIds + ',' + Alltrim(Str(id_borderou))
			Endscan
			lcIds = Iif(!Empty(m.lcIds), Substr(m.lcIds, 2), '')
			Use In (Select('cBorderouTemp'))
		Endif
		If Empty(m.lcIds)
			Return
		Endif
		Do Case
			Case m.lnOptiune = 1
				* Listare borderouri fara salvare pdf borderouri
				llPdf = .F.
				llListare = .T.
				llSucces = rap_borderou_clienti(m.lcIds, m.llPdf, m.llListare, 'crsFacturiBorderou') && In oproceduri_rapoarte_fact.prg
			Case m.lnOptiune = 2
				* Salvare pdf borderouri individuale
				llPdf = .T.
				llListare = .F.
				llSucces = rap_borderou_clienti(m.lcIds, m.llPdf, m.llListare, 'crsFacturiBorderou') && In oproceduri_rapoarte_fact.prg
			Case m.lnOptiune = 3
				If AMESSAGEBOX('Se vor trimite emailuri pentru borderourile selectate. Doriti sa continuati?', 4 + 32, _Screen.Caption) = 6
					Do email_borderou_facturi With m.lcIds, 'crsFacturiBorderou' In oproceduri_facturare.prg
				Endif
			Otherwise
				*	
		ENDCASE
		
		SELECT (m.lcSelect)
		TRY
			GOTO lnRecno
		CATCH
			GO TOP 
		ENDTRY 
		
		this.WindowState = 2
	ENDPROC

	PROCEDURE do_sterge
		Local llSucces
		Local lcMesaj, lcWhere, lnRecno
		Private pnIdBorderou
		Select crsBorderou
		pnIdBorderou = crsBorderou.id_borderou
		lnRecno = Recno()
		llSucces = .F.
		If Empty(m.pnIdBorderou)
			Return m.llSucces
		Endif
		
		Select crsBorderou
		Locate For ales = 1
		If !Found()
			Goto m.lnReno
			lcWhere = 'id_borderou = ' + Alltrim(Str(m.pnIdBorderou))
			lcMesaj = 'Doriti sa stergeti borderoul ' + Alltrim(Str(m.pnIdBorderou)) + '?'
		Else
			lcWhere = 'ales = 1'
			lcMesaj = 'Doriti sa stergeti borderourile alese?'
		Endif
		
		If AMESSAGEBOX(m.lcMesaj, 4 + 32, _Screen.Caption) <> 6
			Return m.llSucces
		Endif
		
		Select Distinct id_borderou From crsBorderou Where &lcWhere Into Cursor crsBorderouStergere
		Select crsBorderouStergere
		Scan
			pnIdBorderou = crsBorderouStergere.id_borderou
			llSucces = goExecutor.oExecuta('begin pack_fact_borderou.StergeBorderou(?pnIdBorderou, ?gnIdUtil); end;')
			If m.llSucces
				Delete From crsBorderou Where id_borderou = m.pnIdBorderou
				Delete From crsFacturiBorderou Where id_borderou = m.pnIdBorderou
				Try
					Select crsBorderou
					Skip - 1
				Endtry
			Endif
		Endscan
		
		Use In (Select('crsBorderouStergere'))
		
		Select crsBorderou
		This.grdBorderou.SetFocus()
		
		Return m.llSucces
		
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		* FACTURI ALBASTRU PENTRU BORDEROUL CURENT
		this.grdFacturi.SetAll("DynamicForeColor","IIF(crsFacturiBorderou.id_borderou = Thisform.nIdBorderou, RGB(100,100,255), RGB(0,0,0))", "Column")
		
		* BORDEROU VERDE NETRIMIS
		* BORDEROU ALBASTRU TRIMIS SI NECONFIRMAT
		* BORDEROU NEGRU TRIMIS SI CONFIRMAT
		this.grdBorderou.SetAll("DynamicForeColor","IIF(NVL(crsBorderou.trimis,0) = 0, RGB(0,128,0), IIF(NVL(crsBorderou.confirmat,0) = 0, RGB(0,0,128), RGB(0,0,0)))", "Column")
		this.gridextra1.setup()
		this.gridextra2.setup()
		this.WindowState = 2
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		this.WindowState = 2 
		
		
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		
		lcStringCriterii= "Id borderou\id_borderou\N\none\" + crlf + ;
			"Data borderou\TRUNC(data_borderou)\D\none\" + crlf + ;	
			"Client\client\T\client_id\nom_parteneri" + crlf + ;	
			"Trimis\nofiled\E\(trimis = 1)\" + crlf + ;
			"Netrimis\nofiled\E\(NVL(trimis,0) = 0)\" + crlf + ;	
			"Confirmat\nofiled\E\(confirmat = 1)\" + crlf + ;
			"Neconfirmat\nofiled\E\(NVL(confirmat,0) = 0)\"
		DODEFAULT()
	ENDPROC

	PROCEDURE Cmd_executa1.Click
		Thisform.Bifeaza('TRIMIS', .T.)
	ENDPROC

	PROCEDURE grdBorderou.AfterRowColChange
		Lparameters nColIndex
		If Inlist(This.RowColChange, 0, 1, 3)
			thisform.nIdBorderou = crsBorderou.id_borderou
			* Ma pozitionez pe prima factura din borderou
			SELECT crsFacturiBorderou
			LOCATE FOR id_borderou = thisform.nIdBorderou
			IF !FOUND()
				GO TOP 
			ENDIF 
			Thisform.grdFacturi.Refresh()
			SELECT crsBorderou
		Endif
	ENDPROC

	PROCEDURE grdBorderou.cConfirmat._checkbox1.Valid
		Thisform.Bifeaza('CONFIRMAT')
	ENDPROC

	PROCEDURE grdBorderou.cTrimis._checkbox1.Valid
		Thisform.Bifeaza('TRIMIS')
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_facturi AS _frmbase 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="grid_facturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataora.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataora.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAltele.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAltele.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cCod.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cCod.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNumar_act.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNumar_act.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtils.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtils.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataoras.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataoras.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDisc_fara_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDisc_fara_tva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDiscount_evidentiat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDiscount_evidentiat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDelegat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDelegat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNume_agent.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNume_agent.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNrinmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNrinmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cText_aditional.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cText_aditional.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_cu_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_cu_tva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_fara_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_fara_tva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_tva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cData_act.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cData_act.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cIn_valuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cIn_valuta._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSerie_act.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSerie_act.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cRuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cRuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSectie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSectie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cLucrare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cLucrare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAdresaFacturare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAdresaFacturare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cListareDetaliata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cListareDetaliata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cListareDetaliata.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cBeneficiar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cBeneficiar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTipFactura.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTipFactura.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cContract.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cContract.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cValval.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cValval.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTVAVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTVAVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotval.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotval.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEmailFacturare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEmailFacturare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEproforma.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEproforma.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEproforma._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTipSaft.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTipSaft.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAdresaLivrare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAdresaLivrare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDenumireAdresaLivrare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDenumireAdresaLivrare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEmailLivrare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEmailLivrare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEfactura.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEfactura.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cEfactura._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cInstitutiePublica.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cInstitutiePublica.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cInstitutiePublica._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cCodFiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cCodFiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_lista_preturi.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_lista_preturi.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCantitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCantitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cProc_tvav.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cProc_tvav.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUtils.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUtils.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDataoras.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDataoras.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUM.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUM.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_Gestiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_Gestiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_cu_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_cu_tva._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCurs.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCurs.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPretAchizitie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPretAchizitie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCodbare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCodbare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cIdArticol.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cIdArticol.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatie._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCodmatc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCodmatc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatieTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatieTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatieTVAEx.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatieTVAEx.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cTaxName.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cTaxName.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cLot.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cLot.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_select_adv1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_copiaza1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_total_ron" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_total_val" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtTotalValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtTotalLei" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_attach1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_listare_cc
		*m: do_listare_centr
		*m: do_listare_document
		*m: do_listeaza_formular
		*m: do_modifica_explicatie
		*m: iscopy
		*p: cfiltru_initial
		*p: ndetalii
		*p: nvanzari
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cbuton2 = but_listare1;but_listare2;But_listare3
		cbuton3 = but_modifica1;but_modifica2
		cfiltru_initial = 
		cgridsortlist = grid_facturi,grid_detalii
		DoCreate = .T.
		Height = 588
		Name = "frm_facturi"
		ndetalii = 0
		nvanzari = 0
		Width = 757
		WindowState = 2
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 791
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 639
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 119
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "LISTA FACTURI, AVIZE SI PROFORME"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 20
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 727
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 16
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Left = 192
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 6
	*</PropValue>

	ADD OBJECT 'But_attach1' AS but_attach WITH ;
		Anchor = 9, ;
		caction = , ;
		Left = 668, ;
		Name = "But_attach1", ;
		Picture = ..\grafice\attach_sus.bmp, ;
		ToolTipText = "Borderou documente electronice & trimitere pe eMail ", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_copiaza1' AS but_copiaza WITH ;
		Anchor = 8, ;
		Left = 552, ;
		Name = "But_copiaza1", ;
		Picture = ..\grafice\copy_sus.bmp, ;
		ToolTipText = "Copiere (CTRL+K)  * Se foloseste si pentru generarea unei facturi din proforma prin copiere", ;
		Top = 1, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 8, ;
		Left = 698, ;
		Name = "But_listare1", ;
		Picture = ..\grafice\listare_sus.bmp, ;
		TabIndex = 17, ;
		Top = 1, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'but_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		Caption = "", ;
		Left = 609, ;
		Name = "but_modifica1", ;
		Picture = ..\grafice\modific_sus.bmp, ;
		TabIndex = 27, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica2' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = do_modifica_explicatie, ;
		Caption = "", ;
		Left = 710, ;
		Name = "But_modifica2", ;
		TabIndex = 27, ;
		ToolTipText = "Modificare explicatie articol", ;
		Top = 341
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Anchor = 9, ;
		Left = 492, ;
		Name = "But_reset_criterii1", ;
		Picture = ..\grafice\reset_sus.bmp, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 521, ;
		Name = "But_start_criterii1", ;
		Picture = ..\grafice\find_sus.bmp, ;
		Top = 1
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 582, ;
		Name = "But_sterge1", ;
		Picture = ..\grafice\sterg_sus.bmp, ;
		TabIndex = 19, ;
		Top = 1, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 9, ;
		Left = 639, ;
		Name = "But_verifica1", ;
		ToolTipText = "Vericare coduri fiscale pe serverul ANAF", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_select_adv1' AS cmd_select_adv WITH ;
		Anchor = 6, ;
		ccoloana = ales, ;
		cgrid = thisform.grid_facturi, ;
		Left = 9, ;
		Name = "Cmd_select_adv1", ;
		TabIndex = 28, ;
		Top = 335, ;
		Width = 111
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grid_detalii' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 27, ;
		DeleteMark = .F., ;
		HeaderHeight = 33, ;
		Height = 183, ;
		HighlightStyle = 2, ;
		Left = 6, ;
		Name = "grid_detalii", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsDetalii", ;
		RowHeight = 19, ;
		SelectedItemBackColor = 0,0,255, ;
		TabIndex = 15, ;
		Top = 372, ;
		Width = 744, ;
		ZOrderSet = 7, ;
		Column1.ControlSource = "nume_lista_preturi", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNume_lista_preturi", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 104, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "denumire", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cDenumire", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 163, ;
		Column3.ColumnOrder = 8, ;
		Column3.ControlSource = "cantitate", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Format = "rk", ;
		Column3.InputMask = (get_mask(12,gnPCant)), ;
		Column3.Name = "cCantitate", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 61, ;
		Column4.ColumnOrder = 11, ;
		Column4.ControlSource = "pret", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "rk", ;
		Column4.InputMask = (get_mask(14,gnPPretV)), ;
		Column4.Name = "cPret", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 59, ;
		Column5.ColumnOrder = 13, ;
		Column5.ControlSource = "proc_tvav", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "rk", ;
		Column5.InputMask = "9 999.99", ;
		Column5.Name = "cProc_tvav", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 42, ;
		Column6.ColumnOrder = 12, ;
		Column6.ControlSource = "discount_unitar", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "rk", ;
		Column6.InputMask = (get_mask(14,gnPPretV)), ;
		Column6.Name = "cDiscount_unitar", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 91, ;
		Column7.ColumnOrder = 22, ;
		Column7.ControlSource = "utils", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cUtils", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 131, ;
		Column8.ColumnOrder = 23, ;
		Column8.ControlSource = "dataoras", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cDataoras", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 103, ;
		Column9.ColumnOrder = 9, ;
		Column9.ControlSource = "um", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cUM", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 39, ;
		Column10.ColumnOrder = 20, ;
		Column10.ControlSource = "cont", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cCont", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 43, ;
		Column11.ColumnOrder = 21, ;
		Column11.ControlSource = "nume_gestiune", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cNume_Gestiune", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 106, ;
		Column12.ColumnOrder = 18, ;
		Column12.ControlSource = "discount_unitar_val", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.InputMask = (get_mask(14,gnPval)), ;
		Column12.Name = "cDiscount_unitar_val", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 95, ;
		Column13.ColumnOrder = 17, ;
		Column13.ControlSource = "pret_val", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.InputMask = (get_mask(14,gnPval)), ;
		Column13.Name = "cPret_val", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 83, ;
		Column14.ColumnOrder = 14, ;
		Column14.ControlSource = "pret_cu_tva", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cPret_cu_tva", ;
		Column14.ReadOnly = .T., ;
		Column14.Sparse = .F., ;
		Column14.Width = 90, ;
		Column15.ColumnOrder = 15, ;
		Column15.ControlSource = "nume_val", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cNume_val", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 45, ;
		Column16.ColumnOrder = 16, ;
		Column16.ControlSource = "curs", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.InputMask = (get_mask(14,gnPCurs)), ;
		Column16.Name = "cCurs", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 56, ;
		Column17.ColumnOrder = 6, ;
		Column17.ControlSource = "serie", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "cSerie", ;
		Column17.ReadOnly = .T., ;
		Column18.ColumnOrder = 10, ;
		Column18.ControlSource = "pret_achizitie", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.InputMask = (get_mask(14,gnPPret)), ;
		Column18.Name = "cPretAchizitie", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 80, ;
		Column19.ColumnOrder = 2, ;
		Column19.ControlSource = "codmat", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Name = "cCodmat", ;
		Column19.ReadOnly = .T., ;
		Column20.ColumnOrder = 5, ;
		Column20.ControlSource = "codbare", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cCodbare", ;
		Column20.ReadOnly = .T., ;
		Column21.ColumnOrder = 24, ;
		Column21.ControlSource = "id_articol", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cIdArticol", ;
		Column21.ReadOnly = .T., ;
		Column22.ColumnOrder = 19, ;
		Column22.ControlSource = "explicatie", ;
		Column22.CurrentControl = "_editbox1", ;
		Column22.Format = "K", ;
		Column22.Name = "cExplicatie", ;
		Column22.ReadOnly = .T., ;
		Column22.Sparse = .F., ;
		Column22.Width = 155, ;
		Column23.ColumnOrder = 4, ;
		Column23.ControlSource = "codmatc", ;
		Column23.Name = "cCodmatc", ;
		Column23.ReadOnly = .T., ;
		Column24.ColumnOrder = 25, ;
		Column24.ControlSource = "jtva_coloana", ;
		Column24.Name = "cExplicatieTVA", ;
		Column24.ReadOnly = .T., ;
		Column24.Width = 124, ;
		Column25.ColumnOrder = 26, ;
		Column25.ControlSource = "jtva_coloana_ex", ;
		Column25.Name = "cExplicatieTVAEx", ;
		Column25.ReadOnly = .T., ;
		Column25.Width = 113, ;
		Column26.ColumnOrder = 27, ;
		Column26.ControlSource = "taxname", ;
		Column26.Name = "cTaxName", ;
		Column26.ReadOnly = .T., ;
		Column26.Width = 159, ;
		Column27.ColumnOrder = 7, ;
		Column27.ControlSource = "lot", ;
		Column27.Name = "cLot", ;
		Column27.ReadOnly = .T., ;
		Column27.Width = 92
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'grid_detalii.cCodbare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod bare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cCodmat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod material", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

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

	ADD OBJECT 'grid_detalii.cDataoras.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora stergerii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grid_detalii.cDiscount_unitar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount unitar", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cDiscount_unitar_val.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount unitar in valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cExplicatie._editbox1' AS _editbox WITH ;
		BorderStyle = 0, ;
		Left = 86, ;
		Name = "_editbox1", ;
		SpecialEffect = 1, ;
		Top = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'grid_detalii.cExplicatie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cExplicatieTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie TVA", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cExplicatieTVAEx.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie TVA 2", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cIdArticol.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id articol", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cLot.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lot", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grid_detalii.cNume_lista_preturi.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Politica preturi", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

	ADD OBJECT 'grid_detalii.cPret_cu_tva._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 32, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_detalii.cPret_cu_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cPret_val.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret in valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cPretAchizitie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret achizitie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_detalii.cProc_tvav.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grid_detalii.cTaxName.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Taxa SAFT", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grid_detalii.cUtils.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Operator stergere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 44, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		HeaderHeight = 36, ;
		Height = 293, ;
		HighlightStyle = 2, ;
		Left = 6, ;
		Name = "grid_facturi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsFacturi", ;
		RowHeight = 19, ;
		SelectedItemBackColor = 0,0,255, ;
		TabIndex = 14, ;
		Top = 36, ;
		Width = 744, ;
		ZOrderSet = 6, ;
		Column1.ColumnOrder = 34, ;
		Column1.ControlSource = "dataora", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cDataora", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 116, ;
		Column2.ColumnOrder = 33, ;
		Column2.ControlSource = "utilizator", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cUtilizator", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 122, ;
		Column3.ColumnOrder = 8, ;
		Column3.ControlSource = "altele", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cAltele", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 96, ;
		Column4.ColumnOrder = 37, ;
		Column4.ControlSource = "cod", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cCod", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 81, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "numar_act", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.InputMask = "9999999999999999", ;
		Column5.Name = "cNumar_act", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 68, ;
		Column6.ColumnOrder = 7, ;
		Column6.ControlSource = "explicatie", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cExplicatie", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 119, ;
		Column7.ColumnOrder = 5, ;
		Column7.ControlSource = "client", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cClient", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 112, ;
		Column8.ColumnOrder = 35, ;
		Column8.ControlSource = "utils", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cUtils", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 107, ;
		Column9.ColumnOrder = 36, ;
		Column9.ControlSource = "dataoras", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cDataoras", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 99, ;
		Column10.ColumnOrder = 9, ;
		Column10.ControlSource = "disc_fara_tva", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.InputMask = (get_mask(14,gnPc)), ;
		Column10.Name = "cDisc_fara_tva", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 104, ;
		Column11.ColumnOrder = 22, ;
		Column11.ControlSource = "discount_evidentiat", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cDiscount_evidentiat", ;
		Column11.ReadOnly = .T., ;
		Column11.Sparse = .F., ;
		Column11.Width = 110, ;
		Column12.ColumnOrder = 18, ;
		Column12.ControlSource = "delegat", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cDelegat", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 109, ;
		Column13.ColumnOrder = 17, ;
		Column13.ControlSource = "nume_agent", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "cNume_agent", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 115, ;
		Column14.ColumnOrder = 19, ;
		Column14.ControlSource = "nrinmat", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cNrinmat", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 72, ;
		Column15.ColumnOrder = 21, ;
		Column15.ControlSource = "left(text_aditional,200)", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cText_aditional", ;
		Column15.ReadOnly = .T., ;
		Column16.ColumnOrder = 12, ;
		Column16.ControlSource = "total_cu_tva", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.InputMask = (get_mask(14,gnPc)), ;
		Column16.Name = "cTotal_cu_tva", ;
		Column16.ReadOnly = .T., ;
		Column17.ColumnOrder = 10, ;
		Column17.ControlSource = "total_fara_tva", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.InputMask = (get_mask(14,gnPc)), ;
		Column17.Name = "cTotal_fara_tva", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 88, ;
		Column18.ColumnOrder = 11, ;
		Column18.ControlSource = "total_tva", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.InputMask = (get_mask(14,gnPc)), ;
		Column18.Name = "cTotal_tva", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 83, ;
		Column19.ColumnOrder = 2, ;
		Column19.ControlSource = "data_act", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Name = "cData_act", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 56, ;
		Column20.ColumnOrder = 13, ;
		Column20.ControlSource = "in_valuta", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cIn_valuta", ;
		Column20.ReadOnly = .T., ;
		Column20.Sparse = .F., ;
		Column20.Width = 37, ;
		Column21.ColumnOrder = 3, ;
		Column21.ControlSource = "serie_act", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cSerie_act", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 50, ;
		Column22.ColumnOrder = 23, ;
		Column22.ControlSource = "sucursala", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Name = "cSucursala", ;
		Column22.ReadOnly = .T., ;
		Column23.ColumnOrder = 1, ;
		Column23.ControlSource = "ales", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cAles", ;
		Column23.ReadOnly = .F., ;
		Column23.Sparse = .F., ;
		Column23.Width = 31, ;
		Column24.ColumnOrder = 20, ;
		Column24.ControlSource = "ruta", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cRuta", ;
		Column24.ReadOnly = .T., ;
		Column24.Width = 94, ;
		Column25.ColumnOrder = 14, ;
		Column25.ControlSource = "sectie", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cSectie", ;
		Column25.ReadOnly = .T., ;
		Column26.ColumnOrder = 15, ;
		Column26.ControlSource = "lucrare", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cLucrare", ;
		Column26.ReadOnly = .T., ;
		Column27.ColumnOrder = 31, ;
		Column27.ControlSource = "adresa_facturare", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.Name = "cAdresaFacturare", ;
		Column27.ReadOnly = .T., ;
		Column27.Width = 225, ;
		Column28.ColumnOrder = 24, ;
		Column28.ControlSource = "listare_detaliata", ;
		Column28.CurrentControl = "Check1", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.Name = "cListareDetaliata", ;
		Column28.ReadOnly = .T., ;
		Column28.Sparse = .F., ;
		Column28.Width = 58, ;
		Column29.ColumnOrder = 25, ;
		Column29.ControlSource = "beneficiar", ;
		Column29.FontSize = 10, ;
		Column29.Name = "cBeneficiar", ;
		Column29.ReadOnly = .T., ;
		Column29.Width = 166, ;
		Column30.ColumnOrder = 26, ;
		Column30.ControlSource = "ctip_factura", ;
		Column30.FontSize = 10, ;
		Column30.Name = "cTipFactura", ;
		Column30.ReadOnly = .T., ;
		Column30.Width = 139, ;
		Column31.ColumnOrder = 16, ;
		Column31.ControlSource = "contract", ;
		Column31.FontSize = 10, ;
		Column31.Name = "cContract", ;
		Column31.ReadOnly = .T., ;
		Column31.Width = 119, ;
		Column32.ColumnOrder = 27, ;
		Column32.ControlSource = "valuta", ;
		Column32.FontSize = 10, ;
		Column32.Name = "cValuta", ;
		Column32.ReadOnly = .T., ;
		Column33.ColumnOrder = 28, ;
		Column33.ControlSource = "valval", ;
		Column33.FontSize = 10, ;
		Column33.Name = "cValval", ;
		Column33.ReadOnly = .T., ;
		Column33.Width = 98, ;
		Column34.ColumnOrder = 29, ;
		Column34.ControlSource = "tvaval", ;
		Column34.FontSize = 10, ;
		Column34.Name = "cTVAVal", ;
		Column34.ReadOnly = .T., ;
		Column34.Width = 98, ;
		Column35.ColumnOrder = 30, ;
		Column35.ControlSource = "totval", ;
		Column35.FontSize = 10, ;
		Column35.Name = "cTotval", ;
		Column35.ReadOnly = .T., ;
		Column35.Width = 96, ;
		Column36.ColumnOrder = 32, ;
		Column36.ControlSource = "email_facturare", ;
		Column36.FontSize = 10, ;
		Column36.Name = "cEmailFacturare", ;
		Column36.ReadOnly = .T., ;
		Column36.Width = 172, ;
		Column37.ColumnOrder = 38, ;
		Column37.ControlSource = "eproforma", ;
		Column37.CurrentControl = "_checkbox1", ;
		Column37.FontSize = 10, ;
		Column37.Name = "cEproforma", ;
		Column37.ReadOnly = .T., ;
		Column37.Sparse = .F., ;
		Column37.Width = 55, ;
		Column38.ColumnOrder = 39, ;
		Column38.ControlSource = "tip_saftname", ;
		Column38.FontSize = 10, ;
		Column38.Name = "cTipSaft", ;
		Column38.ReadOnly = .T., ;
		Column38.Width = 125, ;
		Column39.ColumnOrder = 40, ;
		Column39.ControlSource = "adresa_livrare", ;
		Column39.FontSize = 10, ;
		Column39.Name = "cAdresaLivrare", ;
		Column39.ReadOnly = .T., ;
		Column39.Width = 142, ;
		Column40.ColumnOrder = 41, ;
		Column40.ControlSource = "denumire_adresa_livrare", ;
		Column40.FontSize = 10, ;
		Column40.Name = "cDenumireAdresaLivrare", ;
		Column40.ReadOnly = .T., ;
		Column40.Width = 137, ;
		Column41.ColumnOrder = 42, ;
		Column41.ControlSource = "email_livrare", ;
		Column41.FontSize = 10, ;
		Column41.Name = "cEmailLivrare", ;
		Column41.ReadOnly = .T., ;
		Column41.Width = 169, ;
		Column42.ColumnOrder = 43, ;
		Column42.ControlSource = "efactura", ;
		Column42.CurrentControl = "_checkbox1", ;
		Column42.FontSize = 10, ;
		Column42.Name = "cEfactura", ;
		Column42.ReadOnly = .T., ;
		Column42.Sparse = .F., ;
		Column42.Width = 52, ;
		Column43.ColumnOrder = 44, ;
		Column43.ControlSource = "institutie_publica", ;
		Column43.CurrentControl = "_checkbox1", ;
		Column43.FontSize = 10, ;
		Column43.Name = "cInstitutiePublica", ;
		Column43.ReadOnly = .T., ;
		Column43.Sparse = .F., ;
		Column43.Width = 57, ;
		Column44.ColumnOrder = 6, ;
		Column44.ControlSource = "cod_fiscal", ;
		Column44.FontSize = 10, ;
		Column44.Name = "cCodFiscal", ;
		Column44.ReadOnly = .T., ;
		Column44.Width = 103
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid_facturi.cAdresaFacturare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Adresa facturare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cAdresaLivrare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Adresa livrare comanda", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cAles._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 19, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 50
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

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

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

	ADD OBJECT 'grid_facturi.cBeneficiar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Beneficiar", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

	ADD OBJECT 'grid_facturi.cCodFiscal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod fiscal", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cContract.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Contract", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cData_act.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data act", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cDataora.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora introducerii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cDataoras.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora stergerii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grid_facturi.cDenumireAdresaLivrare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire adresa livrare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cDisc_fara_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount pe factura (fara TVA)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cDiscount_evidentiat._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 49, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 50
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_facturi.cDiscount_evidentiat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount evidentiat pe factura", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cEfactura._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 22, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 71
		*< END OBJECT: ClassLib="..\..\..\roaimob\comun\clase\_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_facturi.cEfactura.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "eFactura", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cEfactura.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 0,0,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cEmailFacturare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Email facturare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cEmailLivrare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Email adresa livrare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cEproforma._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "eproforma", ;
		FontSize = 10, ;
		Left = 17, ;
		Name = "_checkbox1", ;
		Top = 107
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_facturi.cEproforma.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Proforma", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grid_facturi.cIn_valuta._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 31, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 38
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_facturi.cIn_valuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "In valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cInstitutiePublica._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 25, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 71
		*< END OBJECT: ClassLib="..\..\..\roaimob\comun\clase\_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_facturi.cInstitutiePublica.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inst. publ.", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cInstitutiePublica.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 0,0,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cListareDetaliata.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 21, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 72, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grid_facturi.cListareDetaliata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Listare detaliata", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cListareDetaliata.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 0,0,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

	ADD OBJECT 'grid_facturi.cNumar_act.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Numar act", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

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

	ADD OBJECT 'grid_facturi.cSerie_act.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie act", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grid_facturi.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., ;
		SelectedBackColor = 0,0,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cText_aditional.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Text aditional", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cTipFactura.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cTipSaft.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip SAFT", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cTotal_cu_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cTotal_fara_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total fara TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cTotal_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cTotval.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare cu TVA in valuta", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cTVAVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare TVA in valuta", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cUtilizator.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Operator introducere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cUtils.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Operator stergere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valuta", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cValval.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA in valuta", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'Gridextra2' AS gridextra WITH ;
		gridexpression = Thisform.grid_detalii, ;
		Left = 737, ;
		Name = "Gridextra2", ;
		Top = 544
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'lb_total_ron' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total lei", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 556, ;
		Name = "lb_total_ron", ;
		TabIndex = 22, ;
		Top = 565, ;
		Visible = .F., ;
		Width = 47, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lb_total_val' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total în valuta", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 311, ;
		Name = "lb_total_val", ;
		TabIndex = 23, ;
		Top = 565, ;
		Visible = .F., ;
		Width = 81, ;
		ZOrderSet = 18
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'txtTotalLei' AS textbox WITH ;
		Anchor = 12, ;
		ControlSource = "thisform.nDetalii", ;
		FontSize = 10, ;
		Format = "rk", ;
		Height = 23, ;
		InputMask = (get_mask(16,gnPc)), ;
		Left = 608, ;
		Name = "txtTotalLei", ;
		ReadOnly = .T., ;
		TabIndex = 25, ;
		Top = 562, ;
		Visible = .F., ;
		Width = 139, ;
		ZOrderSet = 20
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtTotalValuta' AS textbox WITH ;
		Anchor = 12, ;
		ControlSource = "thisform.nDetalii", ;
		FontSize = 10, ;
		Format = "rk", ;
		Height = 23, ;
		InputMask = (get_mask(16,gnPVal)), ;
		Left = 395, ;
		Name = "txtTotalValuta", ;
		ReadOnly = .T., ;
		TabIndex = 24, ;
		Top = 562, ;
		Visible = .F., ;
		Width = 139, ;
		ZOrderSet = 19
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = pofacturi.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer = 11
		
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grid_facturi)
		pofacturi.ca_baza1.cfiltru = lcFiltru
		pofacturi.ca_baza1.afisare()
		restore_grid_tag(Thisform.grid_facturi)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		If Reccount('crsFacturi')>0
			Thisform.grid_facturi.SetFocus()
		Endif
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Lparameters lcFiltru
		
		Local lcFiltru2,lcCursor
		If Empty(lcFiltru)
			lcFiltru2 = poDetalii.ca_baza1.cfiltru
		Else
			lcFiltru2 = lcFiltru
		Endif
		
		&& DACA FILTRUL NU CONTINE STERS, SELECTEZ DOAR INREGISTRARILE NESTERSE
		DO CASE 
			CASE !'STERS'$upper(Thisform.filtru_pretty_ro_full) OR 'STERS=0'$upper(Thisform.filtru_pretty_ro_full)	
				lcFiltru2 = lcFiltru2 + [ and STERS=0]
			CASE 'STERS=1'$upper(Thisform.filtru_pretty_ro_full)		
				lcFiltru2 = lcFiltru2 + [ and STERS=1]
			CASE 'STERS IN (0,1)'$upper(Thisform.filtru_pretty_ro_full)		
				lcFiltru2 = lcFiltru2 + [ and STERS IN (0,1)]		
		ENDCASE 
		
		lcCursor = Thisform.grid_detalii.RecordSource
		Thisform.MousePointer = 11
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grid_detalii)
		poDetalii.ca_baza1.cfiltru = lcFiltru2
		*!*	modificare	v 2.0.67
		If Reccount('crsfacturi') = 0 OR (!EMPTY(lcFiltru) AND lcFiltru = [1=2])
			Select (lcCursor)
			Delete All
		Else
		*!*	modificare	v 2.0.67	^
			poDetalii.ca_baza1.afisare()
		*!*	modificare	v 2.0.67
		Endif
		*!*	modificare	v 2.0.67	^
		restore_grid_tag(Thisform.grid_detalii)
		
		*!*	Select crsDetalii
		
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru =  []
		
		&& DACA FILTRUL NU CONTINE DATA_ACT, SELECTEZ DOAR INREGISTRARILE DIN LUNA CURENTA
		IF !(' DATA_ACT '$upper(THISFORM.filtru_pretty))
			lcFiltru = This.cfiltru_initial + lcFiltru
		ENDIF
		
		&& DACA FILTRUL NU CONTINE STERS, SELECTEZ DOAR INREGISTRARILE NESTERSE
		If !'STERS'$upper(Thisform.filtru_pretty)
			lcFiltru = [ AND STERS = 0] + lcFiltru
		ENDIF
		
		&& DACA SUNT PE O SUCURSALA - SELECTEZ DOAR INREGISTRARILE DE PE SUCURSALA CURENTA
		IF !ISNULL(m.gnIdSucursala)
			lcFiltru = gcCondSucursala + lcFiltru
		ENDIF 
		
		*!*	afisez doar documentele cu tipul 2,6,26 ( facturi/aviz pe baza de contract )
		if m.gcNumeProgram = "ROACONTRACTE"
			lcFiltru = [ and tip in (2,6,26,52)] + m.lcFiltru
		endif
		
		IF LEN(THISFORM.filtru_pretty)>0     
			lcFiltru = m.lcFiltru+" and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"    
		ENDIF
		
		IF !EMPTY(lcFiltru)
			lcFiltru = SUBSTR(lcFiltru, 6)
		ENDIF 	
		
		Thisform.actualizeaza_grid1(m.lcFiltru)
		
		If Reccount('crsFacturi')=0
			aMessagebox('Cautarea nu a intors rezultate!',0+48,'Info cautare')
			Thisform.actualizeaza_grid2([1=2])
		Else
			Select crsFacturi
			lcFiltru = [id_vanzare=]+Alltrim(Str(id_vanzare))
			Thisform.actualizeaza_grid2(lcFiltru)
			Thisform.grid_facturi.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_copiaza
		#DEFINE T1 1 && 'POLITICA PRETURI'
		#DEFINE T5 5 && 'POLITICA PRETURI - INVOICE'
		#DEFINE T7 7 && 'CREDIT NOTE'
		#DEFINE T10 10 && 'POLITICA PRETURI - FACTURA VALUTA'
		#DEFINE T22 22 && 'AVIZ DIN POLITICA DE PRETURI'
		#DEFINE T23 23 && 'TRANSFER'
		
		
		*!*	 2,3,4,8, -1,-2, -3, -4, -11, -12,44,45,47,48,49,-8,51 > 1
		#DEFINE T2 2 && 'CONTRACT'
		#DEFINE T3 3 && 'COMANDA'
		#DEFINE T4 4 && 'FACT. DIN AVIZ'
		#DEFINE T8 8 && 'RETUR FACTURA IN LEI'
		#DEFINE T_1 -1 && 'MATERII PRIME SI MATERIALE'
		#DEFINE T_2 -2 && 'PRODUSE'
		#DEFINE T_3 -3 && 'MARFURI LA PRET DE ACHIZITIE'
		#DEFINE T_4 -4 && 'MARFURI LA PRET DE VANZARE'
		#DEFINE T_11 -11 && 'MARFURI LA PRET DE ACHIZITIE *'
		#DEFINE T_12 -12 && 'DEVIZE AUTO' 
		#DEFINE T43 43 && 'BONURI FISCALE MAGAZINE'
		#DEFINE T44 44 && 'HOTEL'
		#DEFINE T45 45 && 'RESTAURANT'
		#DEFINE T47 47 && 'CLIENTI IN CUSTODIE - COMANDA (K)'
		#DEFINE T48 48 && 'FACT. CUSTODIE CU DESCARCARE PE BAZA DE K'
		#DEFINE T49 49 && 'FACT. CUSTODIE FARA DESCARCARE PE BAZA DE K'          
		#DEFINE T_8 -8 && 'FACTURA DE RETUR - VALORICA'
		#DEFINE T51 51 && 'COMERCIAL-FACTURARE' 
		
		*!*	6 > 10
		#DEFINE T6 6 && 'CONTRACT - VALUTA'
		
		*!*	9 > 5
		#DEFINE T9 9 && 'RETUR INVOICE'
		       
		*!*	21, 24, 26, 30,-7,-9,-10,-13, 28, 29,42 > 22
		#DEFINE T21 21 && 'AVIZ PE BAZA DE COMANDA'
		#DEFINE T24 24 && 'AVIZ DE RETUR'
		#DEFINE T26 26 && 'AVIZ PE BAZA DE CONTRACT'
		#DEFINE T30 30 && 'AVIZ PE BAZA DE NIR'
		#DEFINE T_7 -7 && 'AVIZ DE RETUR - VALORIC'
		#DEFINE T_9 -9 && 'PROTOCOL CU TVA - AVIZ EXPEDITIE'
		#DEFINE T_10 -10 && 'SPONSORIZARE - AVIZ EXPEDITIE'
		#DEFINE T_13 -13 && 'RETUR MARFA IN CUSTODIE'        
		#DEFINE T28 28 && 'CLIENTI DEBITORI - COMANDA'
		#DEFINE T29 29 && 'CLIENTI DEBITORI - POLITICA PRETURI'
		#DEFINE T42 42 && 'CLIENTI IN CUSTODIE - COMANDA' 
		  
		*!*	25,27,41,-6 > 23
		#DEFINE T25 25 && 'TRANSFER PE BAZA DE COMANDA'
		#DEFINE T27 27 && 'TRANSFER PE BAZA DE LUCRARE'
		#DEFINE T41 41 && 'RETUR TRANSFER' 
		#DEFINE T_6 -6 && 'RETUR TRANSFER DIN GESTIUNE VALORICA'
		
		LOCAL loFactura
		
		IF !This.IsCopy(crsFacturi.tip)
			RETURN
		ENDIF 
		
		* Copiez orice document, dar il tratez ca pe un caz simplu (factura din lista de preturi, aviz din lista de preturi, transfer simplu)
		* De exemplu, factura din contract sau din comanda, nu are sens sa fie copiata, dar o tratez ca pe o factura din lista de preturi
		SELECT crsFacturi
		SCATTER NAME loFactura MEMO
		
		DO CASE 
			CASE INLIST(loFactura.tip,T1,T5,T7,T10,T22,T23)
				*
			CASE INLIST(loFactura.tip,T2,T3,T4,T8,T_1,T_2,T_3,T_4,T_11,T_12,T43,T44,T45,T47,T48,T49,T_8,T51)	
				loFactura.tip = T1
			CASE INLIST(loFactura.tip,T6)
				loFactura.tip = T10
			CASE INLIST(loFactura.tip,T9)
				loFactura.tip = T5
			CASE INLIST(loFactura.tip,T21,T24,T26,T30,T_7,T_9,T_10,T_13,T28,T29,T42)
				lnTip = T22
			CASE INLIST(loFactura.tip,T25,T27,T41,T_6)
				loFactura.tip = T10		
			OTHERWISE 			
				loFactura.tip = T1	
		ENDCASE 
		
		DO copiere_factura WITH loFactura IN oproceduri_facturare.prg
		
		This.do_cauta()
	ENDPROC

	PROCEDURE do_listare
		*!* 26.11.2019
		*!* marius.mutu
		*!* listare recapitulatie
		
		Local llDeclConformitate, lnOptiune, lnOptiune2
		Local laPlugin[1], lcListaPlugin, lcPlugin, lcPluginOptiune, lcPluginPath, lnPlugin, lnPlugins
		Local laPluginApp[1], laPluginComun[1], lcPluginAppPath, lcPluginComunPath, lnPluginsApp, lnPluginsComun
		Local laController[1], lcIds, lcPluginTemplate, llFxpExists, llListare, llPdf, llSucces, lnFiles
		Local lnI, ltFxpTime, ltPrgTime
		llDeclConformitate = Inlist(Nvl(crsFacturi.tip, 0), 3, 21)
		Private pcsubtitlu
		pcsubtitlu = ''
		*******************************************
		* Plugin listare facturi
		*******************************************
		lcPluginComunPath = gcAppPath + 'comun\plugin\'
		lnPluginsComun = Adir(laPluginComun, lcPluginComunPath + 'LISTARE_FACTURI_*.prg')
		
		lcPluginAppPath = gcAppPath + 'plugin\'
		lnPluginsApp = Adir(laPluginApp, lcPluginAppPath + 'LISTARE_FACTURI_*.prg')
		
		lnPlugins = m.lnPluginsComun + m.lnPluginsApp
		If m.lnPlugins > 0
			Declare laPlugin[m.lnplugins]
		Endif
		For lnPlugin = 1 To m.lnPluginsComun
			laPlugin[m.lnPlugin] = lcPluginComunPath + laPluginComun[m.lnPlugin, 1]
		Endfor
		
		For lnPlugin = 1 To lnPluginsApp
			laPlugin[m.lnPluginsComun + m.lnPlugin] = lcPluginAppPath + laPluginApp[m.lnPlugin, 1]
		Endfor
		
		lcListaPlugin = []
		For lnPlugin = 1 To m.lnPlugins
			lcPlugin = laPlugin[m.lnPlugin] && LISTARE_FACTURI_OMV_PETROM_PDF_SI_XML.prg
			lcPluginOptiune = Juststem(Strtran(lcPlugin, 'LISTARE_FACTURI_', '')) && OMV_PETROM_PDF_SI_XML
			lcPluginOptiune = Alltrim(Strtran(lcPluginOptiune, '_', ' ')) && OMV PETROM PDF SI XML
			lcListaPlugin = lcListaPlugin + ';' + m.lcPluginOptiune
		Endfor
		*******************************************
		
		lnOptiune = xmenu('Listare document;' + ;
			  'Listare document - silentios;' + ;
			  'Listare recapitulatie;' + ;
			  'Listare recapitulatie - silentios;' + ;	  
			  '\-;' + ;
			  'Centralizator documente;' + ;
			  'Centralizator documente grupate;' + ;
			  'Centralizator articole;' + ;
			  'Centralizator transferuri articole pe gestiuni;' + ;
			  '\-;' + ;
			  '\<Generare borderou electronic pe clienti si listare;' + ;
			  'Borderou trimiteri recomandate cu AR;' + ;
			  Iif(!m.llDeclConformitate, '\', '') + 'Declaratie de conformitate;' + ;
			  '\-;' + ;
			  'Email document (generare pdf) + documente asociate;' + ;
			  'Email document, recapitulatie (generare pdf) + documente asociate;' + ;
			  '\-;' + ;
			  'Generare si validare fisier xml eFactura' + ;
			  IIF(!Empty(m.lcListaPlugin), ';\-' + m.lcListaPlugin, ''))
		
		Thisform.AlwaysOnTop = .F.
		Do Case
			Case m.lnOptiune = 1
				* tnIdVanzare, tlSilent, tlJustPDF, tcTipDocument
				This.do_listare_document(0, .F., .F., 'FACTURA')
			Case m.lnOptiune = 2
				* tnIdVanzare, tlSilent, tlJustPDF, tcTipDocument
				This.do_listare_document(0, .T., .F., 'FACTURA') && silentios	
			Case m.lnOptiune = 3
				This.do_listare_document(0, .F., .F., 'RECAPITULATIE')
			Case m.lnOptiune = 4
				This.do_listare_document(0, .T., .F., 'RECAPITULATIE') && silentios	
			Case m.lnOptiune = 6
				Do rap_factav_doc  In oproceduri_rapoarte_fact.prg
			Case m.lnOptiune = 7
				Do rap_factav_grupate_doc  In oproceduri_rapoarte_fact.prg
			Case m.lnOptiune = 8
				Do rap_factav_art In oproceduri_rapoarte_fact.prg
			Case m.lnOptiune = 9
				Do rap_transf_art In oproceduri_rapoarte_fact.prg
			Case m.lnOptiune = 11
				* Generare borderouri
				lcIds = generare_borderou_facturi() && In oproceduri_facturare.prg
		
				If !Empty(m.lcIds)
					* Listare borderouri si salvare pdf borderouri individuale
					llPdf = .T.
					llListare = .T.
					llSucces = rap_borderou_clienti(m.lcIds, m.llPdf, m.llListare) && In oproceduri_rapoarte_fact.prg
				Endif && lcIds
		
			Case m.lnOptiune = 12
				Do rap_borderou_ar In oproceduri_rapoarte_fact.prg
			Case m.lnOptiune = 13
				This.do_listare_cc()
			Case INLIST(m.lnOptiune,15,16) && email facturi, recapitulatii
				Select crsFacturi
				lnRecno = Recno()
				lcWhere = 'recno() = ' + Alltrim(Str(m.lnRecno))
				Locate For ales = 1
				If Found()
					lcWhere = 'ales = 1'
				Endif
				Goto m.lnRecno
				
				Select F.id_vanzare, F.data_act, F.numar_act, F.serie_act, F.total_fara_tva, F.total_tva, F.total_cu_tva, F.client, F.email_facturare ;
					From crsFacturi F ;
					Where &lcWhere ;
					Into Cursor cEmailTemp Readwrite
				IF lnOptiune = 15	
					Do wrap_email_facturi With Thisform, 'cEmailTemp', 2, 0, 1 In oproceduri_facturare.prg && factura cu generare daca nu exista si documente asociate
				ELSE
					Do wrap_email_facturi With Thisform, 'cEmailTemp', 2, 2, 1 In oproceduri_facturare.prg && factura si recapitulatia cu generare daca nu exista si documente asociate
				ENDIF 	
				USE IN (SELECT('cEmailTemp'))
			Case m.lnOptiune = 18
				* plValidareEfacturaOnline se verifica in xmlefactura.prg
				lnOptiune2 = xmenu('Validare DukIntegrator;Validare online ANAF')
				PRIVATE plValidareEfacturaOnline
		
				plValidareEfacturaOnline = (m.lnOptiune2 = 2)
		
				* tnIdVanzare, tlSilent, tlJustPDF, tcTipDocument, tlEFactura
				This.do_listare_document(0, .F., .F., 'FACTURA', .T.) && XML EFACTURA
			Case m.lnOptiune >= 19 && plugin-uri
				lnPlugin = m.lnOptiune - 19
				lcPlugin = laPlugin[m.lnPlugin]
				lcPluginTemplate = Strtran(m.lcPlugin, '\PLUGIN\', '\PLUGINTEMPLATE\', 1, 1, 1)
				If File(m.lcPluginTemplate)
					Copy File (lcPluginTemplate)  To (m.lcPlugin)
				Endif
		
				*% Try compiling PRG if newer than FXP
				If .T.
					lnFiles = Adir(laController, Forceext(m.lcPlugin, '*'))
					ltPrgTime = Datetime()
					ltFxpTime = ltPrgTime
					llFxpExists = .F.
					For lnI = 1 To lnFiles
						Do Case
							Case ".PRG" $ Upper(laController[lnI, 1])
								ltPrgTime = Ctot(Dtoc(laController[lnI, 3]) + " " + laController[lnI, 4])
							Case ".FXP" $ Upper(laController[lnI, 1])
								llFxpExists = .T.
								ltFxpTime = Ctot(Dtoc(laController[lnI, 3]) + " " + laController[lnI, 4])
						Endcase
					Next lnI
					If (ltPrgTime > ltFxpTime) Or Not llFxpExists
						Try
							Compile (m.lcPlugin)
						Catch
							Strtofile("Error: " + Message(), "compile_error.txt")
						Endtry
					Endif
				Endif
				Do (m.lcPlugin) With Thisform
		Endcase
		
		Thisform.AlwaysOnTop = .F.
		Thisform.WindowState = 2 && nu stiu de ce se micsoreaza fereastra dupa listare factura
		
	ENDPROC

	PROCEDURE do_listare_cc
		If Reccount('crsfacturi')>0
			Private poDate,poDateGestiuneDest,pnCod
			Local lnDiscount,lnProcTvav
			Select crsfacturi
		*!*	modificare	v 2.0.67
		*!*		PRIVATE pnTipFacturare
		*!*		pnTipFacturare = 0
		*!*	modificare	v 2.0.67	^
			lnTip = tip
			pnCod = cod
			lnSters = sters
		
			If lnSters = 0
				poDate=Createobject("oDateFactura",0,0)
				Select crsfacturi
				poDate.tip = lnTip
				
				poDate.text_aditional = Nvl(text_aditional,[])
				poDate.nrinmat = nrinmat
		*!*		modificare v 2.0.84
		*!*			poDate.listaid = Iif(poDate.tip = 2,Alltrim(Str(id_ctr)),Iif(poDate.tip = 3,Alltrim(Str(id_comanda)), [0]))
				poDate.listaid = Iif(poDate.tip = 3,Alltrim(Str(id_comanda)), [0])
		*!*		modificare v 2.0.84	^
				poDate.nr_incasare = nr_incasare
				poDate.serie_chit = NVL(serie_chit,[])		&&	modificare v 2.0.80
				poDate.incasat = incasat
				poDate.in_valuta = in_valuta
				AddProperty(poDate,"id_comanda_aviz",0)
				ADDPROPERTY(poDate,"cod",pnCod)
				AddProperty(poDate,"decl_conf",1)
			
		
				Thisform.AlwaysOnTop = .F.
				listeaza_oconformitate()
				Thisform.AlwaysOnTop = .T.
		
				If Used('crsfactura')
					Use In crsfactura
				Endif
			Else
				amessagebox("Nu puteti lista aceasta factura, deoarece a fost stearsa!",0+48,"Atentie")
			Endif
			Release poDate,pnCod	&&	,pnTipFacturare	*!*	modificare v 2.0.67
		Endif
		
	ENDPROC

	PROCEDURE do_listare_centr
		Thisform.AlwaysOnTop=.F.
		PRIVATE pcSubtitlu
		STORE '' TO pcSubtitlu
		pcSubtitlu = This.filtru_pretty_ro_full
		Do rap_listfactav_centr.mpr 
		
		Thisform.AlwaysOnTop=.T.
		Thisform.Refresh()
		
	ENDPROC

	PROCEDURE do_listare_document
		*!* 09.02.2016
		*!* marius.mutu
		*!* adaugat parametri tnIdVanzare, tlSilent, tlJustPDF pentru listare silentioasa (fara previzualizare) si listare doar in format pdf
		*!* intorc poDate pentru folosirea informatiilor despre factura (ex: poDate.email_factura in pluginul de trimitere email cu atasament factura)
		
		*!* 21.11.2019
		*!* marius.mutu
		*!* + tcTipDocument - pentru listare FACTURA si RECAPITULATIE
		
		*!*28.05.2022
		*!* marius.mutu
		*!* + tlEFactura - generare xml EFactura
		
		Lparameters tnIdVanzare, tlSilent, tlJustPDF, tcTipDocument, tlEfactura
		* tcTipDocument: FACTURA/RECAPITULATIE/EFACTURA
		* tnIdVanzare, tlSilent, tlJustPDF: se apeleaza thisform.do_listare_document cu parametri din plugin-uri de listare facturi cu email
		* tlEFactura: se genereaza xml EFactura
		
		Local loDate, llSalvarePDF
		Local lcFiltru, lcWhere, llJustPDFX, llSilentX
		loDate = Null
		
		llSalvarePDF = GetPDFSalvareAutomata(m.tcTipDocument)
		
		If Reccount('crsfacturi') > 0
			Local lnNrInreg, lnRecno, lnSters, lnId_Vanzare, lnId_vanzare2
			Select crsFacturi
			lnRecno = Recno()
			lnSters = sters
			lnId_Vanzare = id_vanzare
			Select crsFacturi
			Locate For ales = 1 And sters = 0
			If Found()
				lcWhere = "ales = 1 and sters = 0" + Iif(!Empty(m.tnIdVanzare), ' and id_vanzare = ' + Alltrim(Str(m.tnIdVanzare)), '')
			Else
				lcWhere = "sters = 0 and id_vanzare = " + Alltrim(Str(Iif(!Empty(m.tnIdVanzare), m.tnIdVanzare, m.lnId_Vanzare)))
			Endif
		
			Calculate Cnt() For &lcWhere To lnNrInreg
			If lnNrInreg = 0
				amessagebox("Nu puteti lista aceste documente, deoarece au fost sterse!", 0 + 48, "Atentie")
			Else
				Thisform.AlwaysOnTop = .F.
		
				SELECT id_vanzare FROM crsFacturi Where &lcWhere Order By numar_act INTO CURSOR crsFacturiOrd
				SELECT crsFacturiOrd
				SCAN
					lnIdVanzare2 = id_vanzare
					loDate = listeaza_formular(m.lnIdVanzare2, m.tlSilent, m.tlJustPDF, m.tcTipDocument, m.tlEFactura)
		
					If !m.tlJustPDF AND m.llSalvarePDF && daca am optiunea automata de salvare si nu listez exact in format pdf, salvez si in format pdf
						llSilentX = .T.
						llJustPDFX = .T.
						loDate = listeaza_formular(m.lnIdVanzare2, m.llSilentX, m.llJustPDFX, m.tcTipDocument)
					Endif						
				ENDSCAN 
				
		*!*			copiaza_structura_cursor([crsfacturi], [crsfacturiord])
		*!*			Insert Into crsfacturiord Select * From crsFacturi Where &lcWhere Order By numar_act
		*!*			Select crsfacturiord
		*!*			Scan
		*!*				lnId_vanzare2 = id_vanzare
		*!*				lcFiltru = [id_vanzare=] + Alltrim(Str(lnId_vanzare2))
		*!*				Thisform.actualizeaza_grid2(lcFiltru)
		
		*!*				loDate = Thisform.do_listeaza_formular([crsfacturiord], m.tlSilent, m.tlJustPDF, m.tcTipDocument)
		*!*				If !m.tlJustPDF AND m.llSalvarePDF && daca am optiunea automata de salvare si nu listez exact in format pdf, salvez si in format pdf
		*!*					llSilentX = .T.
		*!*					llJustPDFX = .T.
		*!*					loDate = Thisform.do_listeaza_formular([crsfacturiord], m.llSilentX, m.llJustPDFX, m.tcTipDocument)
		*!*				Endif			
		*!*			Endscan
				Thisform.AlwaysOnTop = .T.
				Use In (Select('crsfacturiord'))
			Endif
		
			Select crsFacturi
			Go m.lnRecno
			If m.lnNrInreg <> 0
				lcFiltru = [id_vanzare=] + Alltrim(Str(m.lnId_Vanzare))
				Thisform.actualizeaza_grid2(m.lcFiltru)
			Endif
		Endif
		
		Return loDate
	ENDPROC

	PROCEDURE do_listeaza_formular
		*!* 09.02.2016
		*!* marius.mutu
		*!* adaugat parametri tlSilent, tlJustPDF pentru listare silentioasa (fara previzualizare) si listare doar in format pdf
		*!* intorc poDate pentru folosirea informatiilor despre factura (ex: poDate.email_factura in pluginul de trimitere email cu atasament factura)
		
		*!* 21.11.2019
		*!* marius.mutu
		*!* + tcTipDocument - pentru listare FACTURA si RECAPITULATIE
		
		*!* 16.12.2019
		*!* marius.mutu
		*!* + poDate.cTextTVA pentru listare FACTURA
		
		*!* 30.01.2020
		*!* marius.mutu
		*!* +poDate.id_util pentru listarea facturii poDate.nume_responsabil cel care a introdus factura in loc de gnIdUtil - cel care o (re)listeaza
		
		*!*	modificare	v 2.0.23
		Lparameters tcNumeCursor, tlSilent, tlJustPDF, tcTipDocument
		* tlSilent: listare fara previzualizare
		* tlJustPDF: listare doar pdf, fara previzualizare/imprimanta - pentru atasament la email
		* tcTipDocument: FACTURA/RECAPITULATIE
		
		Local lcNumeCursor, lnIdVanzare, lcTipDocument
		Local lcCursor, lcProcedura, lcRaport, lcSql, lnSucces
		LOCAL loEx as Exception 
		*:Global ocomanda
		lcNumeCursor = tcNumeCursor
		*!*	modificare	v 2.0.23	^
		Local lnTip
		Private poDate, poDateGestiuneDest, pnCod, pnid_comanda_aviz, pnIdGestiuneRetur
		Local lnDiscount, lnDiscountVal, lnProcTvav
		lcTipDocument = Iif(Type('tcTipDocument') = 'C' And !Empty(m.tcTipDocument), Upper(Alltrim(m.tcTipDocument)), 'FACTURA') && FACTURA/RECAPITULATIE
		
		*!*	modificare	v 2.0.23
		*!*	Select crsfacturi
		Select (lcNumeCursor)
		*!*	modificare	v 2.0.23	^
		lnTip = tip
		pnCod = cod
		*!*	modificare	v 2.0.67
		*!*	PRIVATE pnTipFacturare
		*!*	pnTipFacturare = 0
		*!*	modificare	v 2.0.67	^
		pnid_comanda_aviz = 0
		
		poDate = Createobject("oDateFactura", 0, 0)
		*!*	modificare	v 2.0.23
		*!*	Select crsfacturi
		Select (lcNumeCursor)
		poDate.nid_vanzare = id_vanzare
		*!*	modificare	v 2.0.23	^
		poDate.nRelistare = 1	&&	modificare	v 2.0.58
		poDate.tip = lnTip
		poDate.nract = numar_act
		poDate.serie_act = Alltrim(serie_act)
		poDate.dataact = Iif(Type('data_act') = 'T', Ttod(data_act), data_act)
		poDate.discount_evidentiat = discount_evidentiat
		poDate.text_aditional = Nvl(text_aditional, [])
		poDate.nrinmat = nrinmat
		poDate.nume_delegat = delegat
		poDate.bidelegat = bidelegat
		poDate.cnpdelegat = cnpdelegat
		poDate.dataora_exp = dataora_exp	&&	modificare v 2.0.80
		*!*	modificare	v 2.0.67
		*!*	poDate.listaid = Iif(poDate.tip = 2,Alltrim(Str(id_ctr)),Iif(Inlist(poDate.tip, 3, 21, 28, 42),Alltrim(Str(id_comanda)), [0]))
		poDate.listaid = Iif(Inlist(poDate.tip, 3, 21, 28, 42, 47), Alltrim(Str(id_comanda)), [])		&&	modificare v 2.0.93 : am adaugat 47
		*!*	modificare	v 2.0.67	^
		poDate.ntip_incasare = tip_incasare			&&	modificare v 2.0.84
		poDate.nr_incasare = nr_incasare
		poDate.serie_chit = Nvl(serie_chit, [])		&&	modificare v 2.0.80
		poDate.incasat = incasat
		poDate.in_valuta = in_valuta
		poDate.afisare_scadenta = afisare_scadenta	&&	modificare	ROACONTRACTE v 2.0.38
		poDate.descriere = altele			&&	modificare	v 2.0.44 && nr/data comandaaviz
		poDate.id_ordl = id_ordl			&&	modificare	v 2.0.98
		poDate.tva_incasare = tva_incasare	&&	modificare	v 2.2.0
		poDate.id_facturare = id_facturare
		poDate.nListareDetaliata = listare_detaliata
		
		poDate.nListareSilentioasa = Iif(m.tlSilent, 1, 0)
		poDate.nListareJustPDF = Iif(m.tlJustPDF, 1, 0)
		
		poDate.nIdBeneficiar = id_beneficiar
		poDate.nTipFactura = tip_factura
		poDate.id_util = id_util
		poDate.eProforma = eproforma
		poDate.id_ctr = id_ctr
		poDate.contract = ALLTRIM(NVL(contract,''))
		
		If poDate.in_valuta = 1
			*!*	modificare	v 2.0.56
			poDate.nume_valuta = nume_val
			poDate.Curs = Curs
			poDate.multiplicator = multiplicator
			*!*	*!*	modificare	v 2.0.51
			*!*	*!*		poDate.nume_valuta = nume_val
			*!*	*!*		poDate.Curs = Curs
			*!*		lcNumeCrsCurs = [crscursval]
			*!*		lcSql = [select a.curs, b.nume_val from ] + gcS + [.vanzari_cursuri a left join nom_valute b on a.id_valuta = b.id_valuta ] + ;
			*!*			[where a.id_vanzare = ] + Alltrim(Str(lnIdVanzare))
			*!*		lnSucces = goExecutor.oExecute(lcSql,lcNumeCrsCurs)
			*!*		If lnSucces < 0
			*!*			amessagebox("Nu a putut fi citit cursul! Reincercati listarea!" + Chr(13) + Chr(10) + Chr(13) + Chr(10) + goExecutor.cEroare,48,"Atentie")
			*!*			Return
			*!*		Else
			*!*			Select (lcNumeCrsCurs)
			*!*			poDate.nume_valuta = nume_val
			*!*			poDate.Curs = Curs
			*!*			Use In (lcNumeCrsCurs)
			*!*		Endif
			*!*		Select (lcNumeCursor)
			*!*	*!*	modificare	v 2.0.51	^
			*!*	modificare	v 2.0.56	^
			poDate.totftvaconv		=	total_fara_tva
			poDate.tottvaconv		=	total_tva
			poDate.totctvaconv		=	poDate.totftvaconv + poDate.tottvaconv
			lnDiscountVal = discount
			lnDiscount = Round(lnDiscountVal * poDate.Curs / poDate.multiplicator, gnPc)
		Else
			lnDiscount = discount
			lnDiscountVal = 0
		Endif
		poDate.nValVal = valval
		poDate.nTvaVal = tvaval
		poDate.nTotVal = totval
		poDate.cValuta = ALLTRIM(nume_val)
		poDate.Curs = Curs
		poDate.multiplicator = multiplicator
		
		Do Case
			Case m.lcTipDocument = 'FACTURA'
				If !Pemstatus(poDate, "id_comanda_aviz", 5)
					AddProperty(poDate, "id_comanda_aviz", 0)
				Endif
				If Inlist(poDate.tip, 3, 21, 28, 42, 47) && factura / aviz din comanda	&&	modificare v 2.0.93 : am adaugat 47
					*!*	modificare	v 2.0.23
					*!*		poDate.id_comanda_aviz = crsfacturi.id_comanda
					Select (lcNumeCursor)
					poDate.id_comanda_aviz = id_comanda
					*!*	modificare	v 2.0.46
					If Inlist(poDate.tip, 21, 28)
						lcSql = [select nr_fact from fact_vdetalii_fact where id_vanzare_aviz = ] + Alltrim(Str(poDate.nid_vanzare))
						lnSucces = goExecutor.oExecute(lcSql, [crsnrfact])
						If lnSucces < 0
							amessagebox(goExecutor.oPrelucrareEroare(), 16, "Eroare")
						Else
							If Reccount('crsnrfact') > 0
								Select crsnrfact
								AddProperty(poDate, [descriere2], Alltrim(nr_fact))
							Endif
							Use In crsnrfact
						Endif
					Endif
					Select (lcNumeCursor)
					*!*	modificare	v 2.0.46	^
					*!*	modificare	v 2.0.23	^
				Else
					If poDate.tip = 4 && factura din aviz
						*!*	modificare v 2.0.56 : am adaugat vc.sters = 0 and v.sters = 0
						*!*	modificare	v 2.0.23
						*!*			lcsql="select max(v.id_comanda) as id_comanda  from vanzari_coresp vc "+;
						*!*				"join vanzari v on vc.id_vanzare_aviz = v.id_vanzare where vc.id_vanzare_fact ="+Transform(crsfacturi.id_vanzare)
						lcSql = [select max(v.id_comanda) as id_comanda  from vanzari_coresp vc ] + ;
							[join vanzari v on vc.id_vanzare_aviz = v.id_vanzare where vc.sters = 0 and v.sters = 0 and vc.id_vanzare_fact =] + Alltrim(Str(poDate.nid_vanzare))
						*!*	modificare	v 2.0.23	^
						lnSucces = goExecutor.oSelect2Value(lcSql, @pnid_comanda_aviz)
						If lnSucces < 0
							amessagebox(goExecutor.oPrelucrareEroare(), 16, "Eroare")
							poDate.id_comanda_aviz = 0
						Else
							poDate.id_comanda_aviz = Nvl(pnid_comanda_aviz, 0)
						Endif
						*!*	modificare	v 2.0.46
						Select (lcNumeCursor)
						poDate.descriere = Alltrim(altele)
						*!*	modificare	v 2.0.46	^
					Endif
				Endif
		
				*!*	modificare	v 2.0.28
				If Inlist(lnTip, 23, 25, 27, 30, 41, -6) && AVIZE SUBUNITATI 23,25,27,30; AVIZE SUBUNITATI RETUR 41, AVIZ RETUR VALORIC -6
					*!*	If Inlist(lnTip,23,25,27,41)
					*!*	modificare	v 2.0.28	^
					poDateGestiuneDest = Createobject("oDateGestiune")
					poDateGestiuneDest.id_gestiune = id_gestiune
		
					If Inlist(m.lnTip, 41, -6) && AVIZE SUBUNITATI RETUR (GESTIUNEA DESTINATIE ESTE DEPOZIT, TREBUIE GESTIUNEA SURSA DIN VANZARI_DETALII)
						pnIdGestiuneRetur = 0
						lcSql = [select min(id_gestiune) from vanzari_detalii where id_vanzare = ] + + Alltrim(Str(poDate.nid_vanzare))
						lnSucces = goExecutor.oSelect2Value(lcSql, @pnIdGestiuneRetur)
						If lnSucces < 0
							Messagebox(goExecutor.cEroare, 0 + 16, _Screen.Caption)
						Else
							poDateGestiuneDest.id_gestiune	= m.pnIdGestiuneRetur
							poDate.id_client = m.pnIdGestiuneRetur
						Endif
					Endif
		
					Select crsdetalii
					*!*	modificare	v 2.0.16
					poDate.id_client = id_gestiune
					*!*	modificare	v 2.0.16	^
					poDate.nume_client = nume_gestiune
		
					If !Isnull(pnCod)
						lcSql = [select r.id_responsabil, p.denumire as nresp from rul r left join nom_parteneri p on r.id_responsabil = p.id_part where r.cod = ] + Alltrim(Str(m.pnCod)) + [ and rownum = 1]
						*		lcSql = [select /*+ index(rul IDX_RUL_005) */ r.id_responsabil, p.denumire as nresp from rul r left join nom_parteneri p on r.id_responsabil = p.id_part where r.cod = ?pnCod and rownum = 1]
						If Used('crsresp')
							Use In crsresp
						Endif
						lcCursor = [crsresp]
						lnSucces = goExecutor.oExecute(lcSql, lcCursor)
						If lnSucces < 0
							amessagebox(goExecutor.oPrelucrareEroare(), 16, "Eroare")
							Return
						Else
							Select (lcCursor)
							poDate.id_responsabil = id_responsabil
							poDate.responsabil = nresp
							Use In (lcCursor)
						Endif
		
						*!*		modificare	v 2.0.21
						If Inlist(lnTip, 23, 25)
							lcSql = [select id_partd from act where cod = ] + Alltrim(Str(m.pnCod)) + [ and scd = '357' ] + ;
								[and id_gestin = ] + Alltrim(Str(poDateGestiuneDest.id_gestiune)) + [ and rownum = 1]
							lnSucces = goExecutor.oExecute(lcSql, lcCursor)
							If lnSucces < 0
								amessagebox(goExecutor.oPrelucrareEroare(), 16, "Eroare")
								Return
							Else
								If Reccount(lcCursor) > 0
									Select (lcCursor)
									poDate.id_part_rez = id_partd
								Endif
								Use In (lcCursor)
							Endif
						Endif
						*!*		modificare	v 2.0.21	^
					Endif
				Else
					poDate.id_client = id_part
					poDate.nume_client = client
				Endif
				If !Isnull(pnCod)
					*!*	modificare	v 2.0.95
					*!*	modificare	v 2.0.98 : am adaugat id_ordl
					If poDate.tip = -12 And !Isnull(poDate.id_ordl)
						lcSql = [select a.datascad,b.nr_dosar,c1.denumire as asigurator,d.inspector from ] + ;
							[(select MAX(id_lucrare) as id_lucrare,MAX(datascad) as datascad from act where cod = ] + Alltrim(Str(pnCod)) + [) a ] + ;
							[left join dev_ordl b on a.id_lucrare = b.id_lucrare and b.sters = 0 ] + ;
							[left join dev_nom_asiguratori c on b.id_asigurator = c.id_asigurator ] + ;
							[left join nom_parteneri c1 on c.id_part = c1.id_part ] + ;
							[left join dev_nom_inspectori d on b.id_inspector = d.id_inspector]
						lcCursor = [crsdatascad]
						If Used(lcCursor)
							Use In (lcCursor)
						Endif
						lnSucces = goExecutor.oExecute(lcSql, lcCursor)
						If lnSucces < 0
							amessagebox(goExecutor.oPrelucrareEroare(), 16, "Eroare")
							Return
						Else
							Select (lcCursor)
							Scatter Name ocomanda Memo
							poDate.datascad = datascad
							Use In (lcCursor)
						Endif
					Else
						*!*	modificare	v 2.0.95	^
						*!*			lcSql = [select /*+ index(act idx_cod) */ datascad from act where cod = ] + ALLTRIM(STR(pnCod))
						lcSql = [select datascad from act where cod = ] + Alltrim(Str(m.pnCod))
						lcCursor = [crsdatascad]
						If Used(lcCursor)
							Use In (lcCursor)
						Endif
						lnSucces = goExecutor.oExecute(lcSql, lcCursor)
						If lnSucces < 0
							amessagebox(goExecutor.oPrelucrareEroare(), 16, "Eroare")
							Return
						Else
							Select (lcCursor)
							poDate.datascad = datascad
							Use In (lcCursor)
						Endif
						*!*	modificare	v 2.0.95
					Endif
					*!*	modificare	v 2.0.95	^
				Endif
		
				Use In (Select('crsfactura'))
		
		*!*			* Text TVA de afisat in partea de sus a facturii, daca este o singura explicatie de TVA pe toate liniile din crsDetalii
		*!*			ADDPROPERTY(poDate, 'cTextTVA', '')
		*!*			IF TYPE('gnTextTVAFactura') = 'N' AND m.gnTextTVAFactura = 1
		*!*				SELECT distinct jtva_coloana_ex, jtva_coloana FROM crsDetalii INTO CURSOR cTextTVATemp
		*!*				IF RECCOUNT('cTextTVATemp') = 1
		*!*					SELECT cTextTVATemp
		*!*					GO TOP 
		*!*					poDate.cTextTVA = IIF(!EMPTY(NVL(jtva_coloana_ex, '')), ALLTRIM(jtva_coloana_ex), ALLTRIM(NVL(jtva_coloana,'')))
		*!*				ENDIF 
		*!*				USE IN (SELECT('cTextTVATemp'))
		*!*			ENDIF 	
		
				Select crsdetalii
				Calculate Max(proc_tvav) To lnProcTvav
		SET STEP ON 
				creeaza_facturacrs([crsfactura])
		
				prelucreaza_facturacrs([crsdetalii], [crsfactura], lnProcTvav, lnDiscount, lnDiscountVal)
		
				creeaza_cursor_seturi(pnCod)
		
				listeaza_ofacturare() && ofacturare.prg
		
				Use In (Select('crsfactura'))
		
				Use In (Select('crsfacturaset'))
			Case m.lcTipDocument = 'RECAPITULATIE'
					Select (lcNumeCursor)
					poDate.id_client = id_part
					poDate.nume_client = client
		
					Do Case
						Case poDate.tip = 51 && FACTURA ACN
		*!*						TRY 
								Do Case
									Case poDate.nTipFactura = 0 && TRANZIT
										do listeaza_recapitulatie_tranzit in proceduri_acnpro.prg
									Case poDate.nTipFactura = 1 && CHEIAJ
										do listeaza_recapitulatie_cheiaj in proceduri_acnpro.prg
									Case poDate.nTipFactura = 6 && PENALITATI
										do listeaza_recapitulatie_penalitati in proceduri_acnpro.prg
									Otherwise && CHIRII / APA / ALTELE
										do listeaza_recapitulatie_alte in proceduri_acnpro.prg
								ENDCASE
		*!*						CATCH TO loEx
		*!*							AMESSAGEBOX('Listati recapitulatia din programul "ROAACNPRO"!' + CHR(13) + CHR(10) + loEx.Message,0+48,_SCREEN.Caption)
		*!*						ENDTRY 	
						OTHERWISE 
							 DO listeaza_recapitulatie WITH 'crsDetalii', 'recapitulatie.frx' in ofacturare.prg
							* am facu si o recapitulatie generica, pentru ca am pus recapitulatia in meniul de listare pentru ACN
					ENDCASE 
		
		Endcase
		
		Release pnCod, lnTip	&&	,pnTipFacturare	*!*	modificare	v 2.0.67
		
		Return poDate && intorc poDate pentru folosirea informatiilor despre factura (ex: poDate.email_factura in pluginul de trimitere email cu atasament factura)
		
	ENDPROC

	PROCEDURE do_modifica
		Local ofrmmodificare As "frm_modifica_factura"
		Local lcSql, lnSucces
		SET STEP ON 
		PRIVATE poRec, pneFactura
		If Reccount('crsfacturi') > 0
			Local lnRecno, lnNrInreg, lnNrInregMod
			lnNrInregMod = 0
			Select crsfacturi
			lnRecno = Recno()
			Calculate Cnt() For ales = 1 And sters = 0 To lnNrInreg
			Do Case
				Case lnNrInreg = 0
					Go lnRecno
					Scatter Name poRec Memo
					poRec.text_aditional = NVL(poRec.text_aditional, '')
					poRec.data_act = NVL(poRec.data_act, {})
					poRec.data_scad = NVL(poRec.data_scad, {})
					poRec.numar_act = NVL(poRec.numar_act, 0)
					poRec.serie_act = NVL(poRec.serie_act, '')
				Case lnNrInreg = 1
					Locate For ales = 1
					Scatter Name poRec Memo
					poRec.text_aditional = NVL(poRec.text_aditional, '')			
					poRec.data_act = NVL(poRec.data_act, {})
					poRec.data_scad = NVL(poRec.data_scad, {})
					poRec.numar_act = NVL(poRec.numar_act, 0)
					poRec.serie_act = NVL(poRec.serie_act, '')			
				Otherwise
					Scatter Name poRec Memo Blank
					poRec.id_ruta = Null
					poRec.id_delegat = Null
					poRec.id_agent = Null
					poRec.id_masina = Null
					poRec.dataora_exp = {}
					poRec.id_facturare = Null
					poRec.listare_detaliata = 0
					poRec.tip_saft = NULL
					poRec.text_aditional = '' && MAXIM 250 CARACTERE!!! (nu se grupeaza dupa campuri MEMO)
					poRec.eFactura = 0
					poRec.data_act = NVL(poRec.data_act, {})
					poRec.data_scad = NVL(poRec.data_scad, {})
					poRec.numar_act = NVL(poRec.numar_act, 0)
					poRec.serie_act = NVL(poRec.serie_act, '')			
			ENDCASE
			
			 lcSql = [select count(*) as lneFactura from anaf_efactura where id_fact = ] + ALLTRIM(STR(poRec.id_fact))
			 pneFactura = 0
		     llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @pneFactura)
		     	
			If poRec.sters = 0 AND NVL(m.pnEFactura,0) = 0
				ofrmmodificare = Createobject("frm_modifica_factura", Iif((lnNrInreg > 1) Or (lnNrInreg <= 1 And Inlist(poRec.tip, 23, 25, 27, 30, 41, -6)), 0, 1))
				ofrmmodificare.Show(1)
				Release ofrmmodificare
				If gnButon = 1
					IF poRec.tip_saft = 0
						poRec.tip_saft = null
					ENDIF 	
					lcFiltru = Iif(lnNrInreg = 0, [id_vanzare = poRec.id_vanzare], [ales = 1 And sters = 0])
					Select crsfacturi
					Scan For &lcFiltru
						TEXT TO lcSql NOSHOW TEXTMERGE
						begin pack_facturare.modifica_date_factura(<<Alltrim(Str(poRec.id_vanzare))>>,
							<<Alltrim(Nvl(Str(poRec.id_ruta),[NULL]))>>,
							<<Alltrim(Nvl(Str(poRec.id_delegat),[NULL]))>>,
							<<Alltrim(Nvl(Str(poRec.id_agent),[NULL]))>>,
							<<Alltrim(Nvl(Str(poRec.id_masina),[NULL]))>>,
							to_date('<<TTOC(poRec.dataora_exp,1)>>','YYYYMMDDHH24:MI:SS'),
							<<Alltrim(Nvl(Str(poRec.id_facturare),[NULL]))>>,
							<<ALLTRIM(STR(NVL(poRec.listare_detaliata,0)))>>,
							?poRec.text_aditional,
							?poRec.tip_saft,
							?poRec.efactura,
							?poRec.data_act,
							?poRec.data_scad,
							?poRec.numar_act,
							?poRec.serie_act);
							end;
						ENDTEXT
		
						lnSucces = goExecutor.oExecute(lcSql)
						If lnSucces < 0
							amessagebox(goExecutor.oPrelucrareEroare(), 16, "Eroare")
						Else
							lnNrInregMod = lnNrInregMod + 1
						Endif
					ENDSCAN && lcFiltru
		
					If lnNrInregMod > 0
						Thisform.do_cauta()
					Endif
					Select crsfacturi
					Go lnRecno
				Endif
			Else
				amessagebox("Nu puteti face modificari pe inregistrarile sterse sau facturile trimise in eFactura!", 48, "Atentie")
			Endif
			Release poRec, lnRecno, lnNrInreg
		Endif
		
	ENDPROC

	PROCEDURE do_modifica_explicatie
		If Reccount('crsDetalii') > 0
		
			update_saft_taxtable()
			
			Select crsDetalii
			Scatter Name poRec Memo
			poRec.explicatie = NVL(poRec.explicatie, ' ')
			If poRec.sters = 0
				ofrmmodificare = Createobject("frm_modifica_articol_factura")
				ofrmmodificare.Show()
				If gnButon = 1
					Thisform.actualizeaza_grid2()
				Endif
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_sterge
		pcNl = Alltrim(Str(gnLuna))
		pcAn = Alltrim(Str(gnAn))
		
		If Reccount('crsfacturi') = 0
			amessagebox("Nu exista inregistrari pentru stergere!",0+48,"Atentie")
			Return
		Endif
		
		Local lnCod, llSters, lnSucces, llRul, llEProforma
		Private pnIdVanzare, pnAn, pnLuna
		Store 0 To pnIdVanzare,pnAn,pnLuna
		Store .F. To llSters, llRul
		lnSucces = 0
		
		If glLunaInchisa
			Return
		Endif
		
		Select crsfacturi
		lnRecno = Recno()
		pnIdVanzare = id_vanzare
		lnCod = cod
		pnAn = Year(data_act)
		pnLuna = Month(data_act)
		lnSters = sters
		llEProforma = (eproforma = 1)
		
		If lnSters = 1
			amessagebox("Acest document este deja sters!",0+48,"Atentie")
			Return
		Endif
		
		If amessagebox("Sunteti sigur ca doriti sa stergeti aceasta inregistrare?",4+32,"Confirmare stergere")=7
			Return
		Endif
		
		Local lcConditieSters
		lcConditieSters = [ STERS = 0 AND ]
		
		If (pnAn * 12) + pnLuna <> (gnAn * 12) + gnLuna
			amessagebox('Nu puteti sterge decat inregistrari din luna curenta!',0,'Atentie!')
			Return
		Endif
		
		* STERGERE PROFORMA
		IF m.llEProforma
			lcSql = [begin pack_facturare.sterge_proforma(?pnIdVanzare,?gnIdUtil); end;]
			IF goExecutor.oExecuta(lcSql)
				Thisform.actualizeaza_grid1()
				Thisform.actualizeaza_grid2()
				If Reccount('crsfacturi')>0
					lnRecno = Min(Reccount('crsfacturi'),Iif(lnRecno>1,lnRecno-1,1))
					Select crsfacturi
					Go lnRecno
				ENDIF
			ENDIF 
			RETURN 
		ENDIF 
		
		* STERGERE FACTURA/AVIZ				
		*** verificare restrictie stergere documente cu referinte (incasari/plati)
		llReferinteDocumente = ReferinteDocumenteNota(pnAn, pnLuna, lnCod) &&  && odocumente.prg
		If llReferinteDocumente
			amessagebox("Documentul are referinte (incasari/plati). Nu poate fi sters.", 0+48,"Stergere")
			Return
		Endif
		
		Use In (SELECT('actactan'))
		
		lcSql = [select * from ] + gcs + [.vact_tot where ] + lcConditieSters + [ an = ] + Transform(gnAn) + [ and luna = ] + Transform(gnLuna) + [ and cod = ] + Alltrim(Str(lnCod)) + [ order by id_act]
		lcCursor = [v_act]
		*!*	modificare	v 2.1.4
		*!*	lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		If goExecutor.oExecuta(lcSql,lcCursor)
		*!*	goExecutor.oReset()
		*!*	If lnSucces < 0
		*!*		amessagebox(goExecutor.cEroare,0+16,"Eroare")
		*!*	Endif
		*!*	If lnSucces > 0
			Select * From v_act Into Cursor actactan
			Use In v_act
		*!*	Endif
		*!*	If lnSucces > 0 && AND llRul
			lcSql = [select * from ] + gcs + [.vrul_tot where ] + lcConditieSters + [ an = ] + Transform(gnAn) + [ and luna = ] + Transform(gnLuna) + [ and cod = ] + Alltrim(Str(lnCod)) + [ order by id_rul]
			lcCursor = [v_rul]
		*!*		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
			If goExecutor.oExecuta(lcSql,lcCursor)
		*!*		goExecutor.oReset()
		*!*		If lnSucces < 0
		*!*			amessagebox(goExecutor.cEroare,0+16,"Eroare")
		*!*		Endif
				If Reccount(lcCursor)>0
					llRul = .T.
				Endif
		*!*		If lnSucces > 0
				lcSql = [select * from ] + gcs + [.vrul_obinv_tot where ] + lcConditieSters + [ an = ] + Transform(gnAn) + [ and luna = ] + Transform(gnLuna) + [ and cod = ] + Alltrim(Str(lnCod)) + [ order by id_rul_obinv]
				lcCursor = [v_rul_obinv]
		*!*			lnSucces = goExecutor.oExecute(lcSql,lcCursor)
				If goExecutor.oExecuta(lcSql,lcCursor)
		*!*			goExecutor.oReset()
		*!*			If lnSucces < 0
		*!*				amessagebox(goExecutor.cEroare,0+16,"Eroare")
		*!*			Endif
					If Reccount(lcCursor)>0
						llRul = .T.
					Endif
		*!*		Endif
		*!*		If lnSucces > 0
					Select * From v_rul Into Cursor rul_temp
					Use In v_rul
					Select * From v_rul_obinv Into Cursor rul_temp_obinv
					Use In v_rul_obinv
		*!*		Endif
		*!*	Endif
		*!*	If lnSucces > 0
					If Reccount('actactan')>0
						overif=Createobject('verificare')
						overif.Show(1)
						Clear Class 'verificare'
		
						If buton = 1
							lnSucces = SQLSetprop(gnhandle,"Transactions",2)
							If lnSucces > 0
								Local lcCaleDateMenu
								lcCaleDateMenu=gcAppPath+[\COMUN\DATEMENU\]
								If !Used('INFISIERE')
									Use &lcCaleDateMenu.INFISIERE In 0 Alias INFISIERE
								Endif
								lnSucces  = OSCRIE_IN_FISIERE(2,.F.,llRul)
								If Used('infisiere')
									Use In INFISIERE
								Endif
								If lnSucces < 0
									If lnSucces <> -5
										amessagebox(goExecutor.cEroare,0+16,"Eroare")
									Endif
									lcSql = "ROLLBACK"
								Else
									Local lnIdSet,lnIdFact,lnIdFactD
									Select actactan
									GO top
									lnIdSet = id_set
									lnIdFact = id_fact
									lnIdFactD = id_factd
		*!*	modificare	v 2.2.5
		*!*								lcSql = [begin ] + gcs + [.pack_facturare.sterge_factura(?pnIdVanzare,?gnLuna,?gnAn,?gnIdUtil);] + ;
		*!*									gcs + [.pack_contafin.finalizeaza_stergere_nota(?pnLuna,?pnAn,Null,] + Alltrim(Str(lnIdSet)) + [,] + ;
		*!*									ALLTRIM(Str(lnCod)) + [,] + Alltrim(Str(lnIdFact)) + [,] + Alltrim(Str(lnIdFactD)) + [,?gnIdUtil); end;]
									lcSql = [begin pack_contafin.finalizeaza_stergere_nota(?pnLuna,?pnAn,Null,] + Alltrim(Str(lnIdSet)) + [,] + ;
										ALLTRIM(Str(lnCod)) + [,] + Alltrim(Str(lnIdFact)) + [,] + Alltrim(Str(lnIdFactD)) + [,?gnIdUtil); end;]
		*!*	modificare	v 2.2.5	^
		*!*						lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		*!*						If lnSucces<0
		*!*							amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
		*!*							lcSql = "ROLLBACK"
		*!*						Else
		*!*							lcSql = "COMMIT"
		*!*						Endif
									If goExecutor.oExecuta(lcSql,lcCursor)
										lcSql = "COMMIT"
									Else
										lcSql = "ROLLBACK"
									Endif
								Endif
								goExecutor.oExecuta(lcSql)
		*!*					lnSucces = goExecutor.oExecute(lcSql)
		*!*					If lnSucces < 0
		*!*						amessagebox(lcSql + Chr(13) + goExecutor.cEroare,0+16,"Eroare")
		*!*					Endif
								lnSucces = SQLSetprop(gnhandle,"Transactions",1)
								If lnSucces < 0
									amessagebox('Programul nu a reusit sa treaca pe tranzactie automata. Iesiti din program si intrati din nou!',0,'Atentie!')
								Else
									Thisform.actualizeaza_grid1()
									Thisform.actualizeaza_grid2()
									If Reccount('crsfacturi')>0
										lnRecno = Min(Reccount('crsfacturi'),Iif(lnRecno>1,lnRecno-1,1))
										Select crsfacturi
										Go lnRecno
									Endif
								Endif
		
							Endif
						Endif
					Else
						lcSql = [begin ] + gcs + [.pack_facturare.sterge_factura(?pnIdVanzare,?gnLuna,?gnAn,?gnIdUtil); end;]
		*!*			lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		*!*			If lnSucces<0
		*!*				amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
		*!*			Else
						If goExecutor.oExecuta(lcSql,lcCursor)
							Thisform.actualizeaza_grid1()
							Thisform.actualizeaza_grid2()
							If Reccount('crsfacturi')>0
								lnRecno = Min(Reccount('crsfacturi'),Iif(lnRecno>1,lnRecno-1,1))
								Select crsfacturi
								Go lnRecno
							Endif
						Endif
					Endif
				Endif
			Endif
		Endif
		*!*	modificare	v 2.1.4		^
		
		If Used('actactan')
			Use In actactan
		Endif
		If Used('rul_temp')
			Use In rul_temp
		Endif
		If Used('rul_temp_obinv')
			Use In rul_temp_obinv
		Endif
		Release pnIdVanzare
	ENDPROC

	PROCEDURE do_verifica
		Local lcFilter, lcWhere, llAutoVerificare, llDontCloseCursor, llExperimental, llMFIN, ldData
		Local llServiciuWebANAF, llValidare, llVerificarePlatitorTVA, lnOptiune
		
		lnOptiune = xmenu('Verifica codurile fiscale la fiecare \<data a facturilor;Verifica doar la \<inceputul lunii;Verifica doar la \<sfarsitul lunii')
		IF EMPTY(m.lnOptiune)
			RETURN
		ENDIF 
		llDontCloseCursor = .F.
		llExperimental = .F.
		llVerificarePlatitorTVA = .F. && verific VIES pentru toti partenerii
		llMFIN = .T. && verific MFIN pentru toata lumea
		llValidare = .T. && verific algoritmul codurilor fiscale
		llAutoVerificare = .T. && lanseaza verificarea automata la activate-ul formularului de verificare
		llServiciuWebANAF = .T.
		
		lcFilter = Filter("crsFacturi")
		lcWhere = Iif(!Empty(m.lcFilter), m.lcFilter, ".T.")
		IF m.lnOptiune = 1
			Select distinct cod_fiscal, data_act as data, client as denumire, adresa_facturare as adresa_roa, IIF(LEFT(UPPER(cod_fiscal), 2) = "RO", "RO", "  ") AS ATRIBUT_FISCAL, .T. AS IsCIF, .F. AS codvalid ;
				From crsFacturi ;
				Where &lcWhere ;
				Into Cursor crsCoduriFiscale ;
				Order By denumire, cod_fiscal  ;
				Readwrite
		ELSE
			ldData = DATE(m.gnAn, m.gnLuna, 1)
			IF m.lnOptiune = 3
				ldData = GOMONTH(m.ldData,1) - 1
			ENDIF 
		
			Select distinct cod_fiscal, m.ldData as data, client as denumire, adresa_facturare as adresa_roa, IIF(LEFT(UPPER(cod_fiscal), 2) = "RO", "RO", "  ") AS ATRIBUT_FISCAL, .T. AS IsCIF, .F. AS codvalid ;
				From crsFacturi ;
				Where &lcWhere ;
				Into Cursor crsCoduriFiscale ;
				Order By denumire, cod_fiscal  ;
				Readwrite
		ENDIF 	
		
		
		Local lcXMLParteneri
		lcXMLParteneri = ""
		Cursortoxml('crsCoduriFiscale', "lcXMLParteneri", 1, 0, 0, "1")
		
		Do verificare_parteneri With m.lcXMLParteneri, m.llValidare, m.llMFIN, m.llVerificarePlatitorTVA, m.llAutoVerificare, m.llDontCloseCursor, m.llExperimental, m.llServiciuWebANAF
		
		USE IN (SELECT('crsCoduriFiscale')) 
	ENDPROC

	PROCEDURE Init
		Local lcData, lcFiltruInitial
		*:Global gcAcces
		If glLunaInchisa
			gcAcces = Strtran(gcAcces, [4;], [])	&&	nu are drept de stergere
			Thisform.but_sterge1.Visible = .F.
		Endif
		DoDefault()
		
		lcData = Alltrim(Str(gnAn)) + Padl(Alltrim(Str(gnLuna)), 2, [0]) + [01]
		lcFiltruInitial = [ and data_act between to_date('] + lcData + [','YYYYMMDD') ] + ;
			[and last_day(to_date('] + lcData + [','YYYYMMDD')) ]
		Thisform.cfiltru_initial = lcFiltruInitial
		Thisform.grid_facturi.cAles.ReadOnly = .F.
		
		* SAFT
		This.grid_detalii.cTaxName.Visible = m.gl406
		this.grid_facturi.cTipSaft.Visible = m.gl406
		
		This.gridextra1.Setup()
		This.gridextra2.Setup()
		this.grid_facturi.HeaderHeight = 38 && cred ca se reseteaza dupa gridextra.setup
		this.grid_detalii.HeaderHeight = 33 && cred ca se reseteaza dupa gridextra.setup
	ENDPROC

	PROCEDURE iscopy
		LPARAMETERS tnTip
		
		LOCAL lnTip, lnTipFacturaContract
		lnTip = IIF(TYPE('tnTip') = 'N', m.tnTip, 0)
		RETURN .T. && POT SA COPIEZ ORICE, TRATEZ TIPURILE IN DO_COPIAZA
		
		*!*	RETURN INLIST(m.lnTip, 1,5,7,10,22,23,43) && pot sa copii doar avize si facturi pret de lista, transfer simplu, bon fiscal magazin
		
		
	ENDPROC

	PROCEDURE But_attach1.Click
		Local lnOptiune, lcBorderouIds, lcVanzareIds, lcMeniu
		Local llListare, llPdf, llSucces, loEx as Exception
		
		lcMeniu = '\<Centralizator borderouri electronice;\<Generare borderou electronic pe clienti si listare'
		
		* Facturile selectate
		Select id_vanzare From crsfacturi Where ales = 1 Into Cursor crsDocTemp
		lcVanzareIds = ''
		Select crsDocTemp
		Scan
			lcVanzareIds = lcVanzareIds + ',' + Alltrim(Str(id_vanzare))
		Endscan
		lcVanzareIds = Iif(!Empty(m.lcVanzareIds), Substr(m.lcVanzareIds,2), '')
		Use In (Select('crsDocTemp'))
		
		*-------------------------------------------------------------
		* Optiuni suplimentare meniu
		* Afisez optiuni suplimentare la meniul Borderou, in caz ca exista in programul curent (ex: ROAACNPRO)
		* Apelez meniu_borderou_plus(@lcListaMeniu, @lcListaProceduri) care este definit sau nu in programul curent
		lcListaMeniu = '' && lista optiuni suplimentare meniu, separate prin |
		lcListaProceduri = '' && lista proceduri suplimentare meniu separate prin |
		lnOptiuniPlus = 0
		* Daca nu exista procedura meniu_borderou_plus in program, intorc o lista goala. nu dau eroare.
		Try
			lnOptiuniPlus = meniu_borderou_plus(@lcListaMeniu, @lcListaProceduri)
		CATCH TO loEx
			*	
		ENDTRY
		
		lcMeniuPlus = ''
		IF !(EMPTY(m.lnOptiuniPlus) OR EMPTY(m.lcListaMeniu) OR EMPTY(m.lcListaProceduri))
			FOR lnOptiunePlus = 1 TO m.lnOptiuniPlus
				lcTitlu = ALLTRIM(GETWORDNUM(m.lcListaMeniu, m.lnOptiunePlus, '|'))
		
				lcMeniuPlus = m.lcMeniuPlus + ';' + m.lcTitlu
			ENDFOR 
		ENDIF && empty
		
		lcMeniu = m.lcMeniu + IIF(!EMPTY(m.lcMeniuPlus), ';\-' + m.lcMeniuPlus, '')
		*-------------------------------------------------------------
		
		lnOptiune = xmenu(m.lcMeniu)
		
		If Empty(m.lnOptiune)
			Return
		Endif
		
		DO CASE 
			CASE m.lnOptiune = 1
				Do vizualizare_borderou_facturi In oproceduri_facturare.prg
			CASE m.lnOptiune = 2
				* Generare borderouri
				lcBorderouIds = generare_borderou_facturi() && In oproceduri_facturare.prg
		
				If !Empty(m.lcBorderouIds)
					* Listare borderouri si salvare pdf borderouri individuale
					llPdf = .T.
					llListare = .T.
					llSucces = rap_borderou_clienti(m.lcBorderouIds, m.llPdf, m.llListare) && In oproceduri_rapoarte_fact.prg
		
					* Vizualizare centralizator borderouri
					Do vizualizare_borderou_facturi In oproceduri_facturare.prg
				Endif && lcIds
			OTHERWISE 
				lnOptiunePlus = m.lnOptiune - 3
				lcProcedura = ALLTRIM(GETWORDNUM(m.lcListaProceduri, m.lnOptiunePlus, '|'))			
				TRY 
					llSucces = &lcProcedura(lcVanzareIds)
				CATCH TO loEx
					goApp.ShowErrorEx(loEx)
				ENDTRY 	
		ENDCASE 
		
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		*!*	DEBUG
		*!*	SUSPEND
		lcStringCriterii="Data act\data_act\D\none\" + crlf + ;
			"Numar act\numar_act\N\none\" + crlf + ;
			"Serie act\serie_act\T\none\"+ crlf + ;
			"Explicatie\explicatie\T\none\"+ crlf + ;	
			"Client\client\T\id_part\nom_parteneri"+ crlf + ;
			"Beneficiar\beneficiar\T\id_beneficiar\nom_parteneri"+ crlf + ;	
			"Gestiune\nume_gestiune\T\id_gestiune\nom_gestiune"+ crlf + ;	
			"Sectie\sectie\T\id_sectie\nom_sectie" + crlf + ;
			"Lucrare\lucrare\T\id_lucrare\nom_lucrare" + crlf + ;
			"Contract\contract\T\id_ctr\nom_contracte" + crlf + ;	
			IIF(m.glEMama, "Sucursala\sucursala\T\ID_SUCURSALA\nom_sucursala"+ crlf, "")  + ;	&& aleg sucursale doar daca sunt pe mama	
			"Data introducere\trunc(dataora)\D\none\" + crlf + ;
			"Oper. introducere\utilizator\T\id_util\nom_utilizator" + crlf + ;	
			"Ruta\ruta\T\id_ruta\nom_ruta" + crlf + ;		
			"Tip\ctip_factura\T\tip_factura\nom_tipfactura" + crlf + ;
			"Tip SAFT\tip_saftname\T\none\"+ crlf + ;	
			"In valuta\nofiled\E\(in_valuta=1)\" + crlf + ; 
			"In lei\nofiled\E\(in_valuta=0)\" + crlf + ; 		
			"Total cu TVA lei\total_cu_tva\N|get_mask(12,gnPA)\none\" + crlf + ;	
			"Total cu TVA valuta\totval\N|get_mask(12,gnPval)\none\" + crlf + ;		
			"Sterse&nesterse\nofiled\E\(STERS in (0,1))\" + crlf + ; 	
			"Sterse\nofiled\E\(STERS=1)\" + crlf + ; 	
			"Nesterse\nofiled\E\(STERS=0)\" + crlf + ; 	 
			"Facturi&Avize\nofiled\E\(eproforma = 0)\" + crlf + ; 	
			"Proforme\nofiled\E\(eproforma=1)\" + crlf + ; 
			"eFactura\nofiled\E\(efactura=1)\" + crlf + ; 
			"Inst. publ.\nofiled\E\(institutie_publica=1)\"				
		
		DODEFAULT()
		
	ENDPROC

	PROCEDURE grid_detalii.Init
		This.SetAll("DynamicForeColor", "IIF(sters=1, RGB(255,0,0), RGB(0,0,0))", "Column")
		This.SetAll("ReadOnly",.T.,"Column")
		For i = 1 To This.ColumnCount
			lcColor='this.Columns(' + Alltrim(Str(i)) + ').DynamicBackColor'
			lcControlSource1 = 'this.Columns(' + Alltrim(Str(i)) + ').controlsource'
			lcControlSource = &lcControlSource1
			lcSet = lcColor + [ = "IIF(ISNULL(] + lcControlSource + [),RGB(255,255,225),RGB(255,255,255))"]
			&lcSet
		Endfor
	ENDPROC

	PROCEDURE grid_facturi.AfterRowColChange
		Lparameters nColIndex
		If Inlist(This.RowColChange,0,1,3)
			Local lnIdPol
			Select crsFacturi
			lnId_vanzare = id_vanzare
			lcFiltru = [id_vanzare=]+Alltrim(Str(lnId_vanzare))
			Thisform.but_copiaza1.Visible = Thisform.IsCopy(crsFacturi.tip)
			
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
	ENDPROC

	PROCEDURE grid_facturi.Init
		This.SetAll("DynamicForeColor", "IIF(eproforma = 1, IIF(sters=1 or total_cu_tva < 0, RGB(255,100,100), RGB(0,100,100)), IIF(sters=1 or total_cu_tva < 0, RGB(255,0,0), RGB(0,0,0)))", "Column")
		This.SetAll("ReadOnly",.T.,"Column")
		For i = 1 To This.ColumnCount
			lcColor='this.Columns(' + Alltrim(Str(i)) + ').DynamicBackColor'
			lcControlSource1 = 'this.Columns(' + Alltrim(Str(i)) + ').controlsource'
			lcControlSource = &lcControlSource1
			lcSet = lcColor + [ = "IIF(ISNULL(] + lcControlSource + [),RGB(255,255,225),RGB(255,255,255))"]
			&lcSet
		Endfor
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_modifica_articol_factura AS frm_termin_renunt OF "_frm_child.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cbo_saft" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbSaft" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: ntip_selectie		&& 0 - cautare in toti delegatii; 1 - cautare in delegatii clientului
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 370
		Name = "frm_modifica_articol_factura"
		nid = .F.
		ntip_selectie = 0
		orec = .F.
		Width = 376
		_shape1.Name = "_shape1"
		_shape1.ZOrderSet = 1
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Modificã explicaþie articol"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Left = 344
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Name = "Gridsort1"
		But_renunt1.Left = 315
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 4
		But_renunt1.Top = 1
		But_renunt1.ZOrderSet = 6
	*</PropValue>

	ADD OBJECT '_shape3' AS _shape WITH ;
		BackStyle = 0, ;
		Height = 37, ;
		Left = 13, ;
		Name = "_shape3", ;
		Top = 323, ;
		Width = 348, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'cbo_saft' AS _cbbase WITH ;
		BoundColumn = 4, ;
		BoundTo = .T., ;
		ColumnCount = 3, ;
		ColumnWidths = "500,150,50", ;
		ControlSource = "poRec.taxcode", ;
		Height = 24, ;
		Left = 82, ;
		Name = "cbo_saft", ;
		RowSource = "Select taxname, tip, procent_taxa, taxcode From saft_taxtable where tva = 1 order by taxcode Into Cursor crsTaxTableX", ;
		RowSourceType = 3, ;
		TabIndex = 2, ;
		Top = 329, ;
		Width = 266, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Height = 288, ;
		Left = 13, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 36, ;
		Width = 348, ;
		ZOrderSet = 7, ;
		_edbase1.ControlSource = "porec.explicatie", ;
		_edbase1.Height = 253, ;
		_edbase1.Left = 10, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.Top = 23, ;
		_edbase1.Width = 325, ;
		_lbbase1.Caption = "Explicaþie", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'lbSaft' AS _label WITH ;
		Caption = "Cod taxa", ;
		Left = 24, ;
		Name = "lbSaft", ;
		TabIndex = 6, ;
		Top = 332, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />
	
	PROCEDURE inainte_de_do_termin
		Local llReturn
		If amessagebox("Doriti sa salvati modificarile?",4+32,"Confirmare salvare explicatie") = 6
			lcSql = [begin pack_facturare.modifica_explicatie_articol(] + Alltrim(Str(poRec.id_vanzare_det)) + [,] + ;
				['] + Nvl(Alltrim(OracleSpecialCharacters(poRec.explicatie)),'') + [',?gnIdUtil,?poRec.taxcode); end;]
			llReturn = goExecutor.oExecuta(lcSql)
		Else
			llReturn = .F.
		Endif
		Return llReturn
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Local lnLungimeMax, lcSql
		lcSql = [select pack_facturare.citeste_lungcampexplart() as lungime from dual]
		lcCursor = Sys(2015)
		If goExecutor.oExecuta(lcSql,lcCursor)
			Select (lcCursor)
			lnLungimeMax = lungime
			Use In (lcCursor)
			With Thisform.Ed_tx_simplu1
				._lbbase1.Caption = ._lbbase1.Caption + [ ( maxim ] + Alltrim(Str(lnLungimeMax)) + [ caractere )]
				._edbase1.MaxLength = lnLungimeMax
			Endwith
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_modifica_factura AS frm_termin_renunt OF "_frm_child.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="shpTipFactura" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_delegat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_masina" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_agent" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_ruta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_dataora_exp" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_adresa_facturare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkDetaliat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtNrAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboTipFactura" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblTipFactura" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtSerieAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDataAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDataScad" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkSerieAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkNrAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkDataAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkDataScad" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_cauta_adresa
		*m: do_cauta_agent
		*m: do_cauta_delegat
		*m: do_cauta_masina
		*m: do_cauta_ruta
		*p: nid
		*p: ntip_selectie		&& 0 - cautare in toti delegatii; 1 - cautare in delegatii clientului
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 412
		Name = "frm_modifica_factura"
		nid = .F.
		ntip_selectie = 0
		orec = .F.
		Width = 613
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 615
		_shape1.ZOrderSet = 2
		_shape2.Height = 29
		_shape2.Left = 546
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "Modifica date factura"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 20
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Left = 582
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 18
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Name = "Gridsort1"
		But_renunt1.Left = 553
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 19
		But_renunt1.Top = 1
		But_renunt1.ZOrderSet = 7
	*</PropValue>

	ADD OBJECT 'cboTipFactura' AS _combobox WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 1, ;
		ColumnLines = .F., ;
		ColumnWidths = "150", ;
		ControlSource = "poRec.tip_saft", ;
		Height = 24, ;
		Left = 145, ;
		Name = "cboTipFactura", ;
		RowSource = "select tip_saftname, cod from saft_tip_facturi into cursor cTipFacturaX", ;
		RowSourceType = 3, ;
		TabIndex = 7, ;
		Top = 216, ;
		Width = 179, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="..\..\..\roagest\comun\clase\_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'chkDataAct' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Data factura", ;
		Enabled = .F., ;
		Height = 18, ;
		Left = 376, ;
		Name = "chkDataAct", ;
		TabIndex = 12, ;
		Top = 106, ;
		Value = .F., ;
		Width = 89
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkDataScad' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Data scadenta", ;
		Enabled = .F., ;
		Height = 18, ;
		Left = 376, ;
		Name = "chkDataScad", ;
		TabIndex = 13, ;
		Top = 134, ;
		Value = .F., ;
		Width = 103
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkDetaliat' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		Caption = "Listare detaliata", ;
		ControlSource = "poRec.listare_detaliata", ;
		Left = 13, ;
		Name = "chkDetaliat", ;
		TabIndex = 9, ;
		ToolTipText = "Se listeaza articolele detaliat pe factura sau se cumuleaza cantitatea pe articole", ;
		Top = 380, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkNrAct' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Numar factura", ;
		Enabled = .F., ;
		Height = 18, ;
		Left = 376, ;
		Name = "chkNrAct", ;
		TabIndex = 11, ;
		Top = 78, ;
		Value = .F., ;
		Width = 100
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkSerieAct' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Serie factura", ;
		Enabled = .F., ;
		Height = 18, ;
		Left = 376, ;
		Name = "chkSerieAct", ;
		TabIndex = 10, ;
		Top = 50, ;
		Value = .F., ;
		Width = 92
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'clb_adresa_facturare' AS ct_clb_cautare WITH ;
		cconditie = ISNULL(porec.id_facturare), ;
		cprocedura = thisform.do_cauta_adresa, ;
		cvar_afisata = porec.adresa_facturare, ;
		Left = 12, ;
		Name = "clb_adresa_facturare", ;
		TabIndex = 5, ;
		Top = 156, ;
		ZOrderSet = 13, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Adresa facturare", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 133, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Top = 3, ;
		clb_tx_cautare.Text_simplu1.Width = 177
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_dataora_exp' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 13, ;
		Name = "Clb_dataora_exp", ;
		TabIndex = 6, ;
		Top = 185, ;
		Width = 314, ;
		ZOrderSet = 12, ;
		Text_simplu1.ControlSource = "poRec.dataora_exp", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 133, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 177, ;
		Lb_simplu1.Caption = "Data ºi ora expedierii", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_agent' AS ct_clb_cautare WITH ;
		cconditie = ISNULL(porec.id_agent), ;
		cprocedura = thisform.do_cauta_agent, ;
		cvar_afisata = porec.nume_agent, ;
		Left = 12, ;
		Name = "Ct_clb_agent", ;
		TabIndex = 2, ;
		Top = 72, ;
		ZOrderSet = 10, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Agent", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 133, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Width = 177
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_delegat' AS ct_clb_cautare WITH ;
		cconditie = ISNULL(porec.id_delegat), ;
		cprocedura = thisform.do_cauta_delegat, ;
		cvar_afisata = porec.delegat, ;
		Left = 12, ;
		Name = "Ct_clb_delegat", ;
		TabIndex = 3, ;
		Top = 100, ;
		ZOrderSet = 8, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Delegat", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 133, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Width = 177
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_masina' AS ct_clb_cautare WITH ;
		cconditie = isnull(porec.id_masina), ;
		cprocedura = thisform.do_cauta_masina, ;
		cvar_afisata = porec.nrinmat, ;
		Left = 12, ;
		Name = "Ct_clb_masina", ;
		TabIndex = 4, ;
		Top = 128, ;
		ZOrderSet = 9, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Maºina", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 133, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Top = 3, ;
		clb_tx_cautare.Text_simplu1.Width = 177
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_ruta' AS ct_clb_cautare WITH ;
		cconditie = ISNULL(porec.id_ruta), ;
		cprocedura = thisform.do_cauta_ruta, ;
		cvar_afisata = porec.ruta, ;
		Left = 12, ;
		Name = "Ct_clb_ruta", ;
		TabIndex = 1, ;
		Top = 44, ;
		ZOrderSet = 11, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Ruta", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 133, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Width = 177
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Height = 135, ;
		Left = 13, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 8, ;
		Top = 241, ;
		Width = 468, ;
		ZOrderSet = 15, ;
		_EDBASE1.ControlSource = "poRec.text_aditional", ;
		_EDBASE1.Height = 103, ;
		_EDBASE1.Left = 10, ;
		_EDBASE1.MaxLength = 1000, ;
		_EDBASE1.Name = "_EDBASE1", ;
		_EDBASE1.Top = 23, ;
		_EDBASE1.Width = 445, ;
		_LBBASE1.AutoSize = .T., ;
		_LBBASE1.Caption = "Text aditional (se listeaza la sfarsitul articolelor, max. 1000 caractere)", ;
		_LBBASE1.Height = 18, ;
		_LBBASE1.Left = 8, ;
		_LBBASE1.Name = "_LBBASE1", ;
		_LBBASE1.Top = 6, ;
		_LBBASE1.Width = 404, ;
		_LBBASE1.WordWrap = .F.
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'lblTipFactura' AS _label WITH ;
		Caption = "Tip factura", ;
		Left = 20, ;
		Name = "lblTipFactura", ;
		TabIndex = 21, ;
		Top = 219, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="..\..\..\roagest\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'shpTipFactura' AS _shape WITH ;
		BackStyle = 0, ;
		Height = 29, ;
		Left = 13, ;
		Name = "shpTipFactura", ;
		Top = 213, ;
		Width = 314, ;
		ZOrderSet = 1
		*< END OBJECT: ClassLib="..\..\..\roagest\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'txtDataAct' AS _textbox WITH ;
		ControlSource = "poRec.data_act", ;
		Enabled = .F., ;
		Height = 23, ;
		Left = 482, ;
		Name = "txtDataAct", ;
		TabIndex = 16, ;
		Top = 104, ;
		Width = 120
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtDataScad' AS _textbox WITH ;
		ControlSource = "poRec.data_scad", ;
		Enabled = .F., ;
		Height = 23, ;
		Left = 482, ;
		Name = "txtDataScad", ;
		TabIndex = 17, ;
		Top = 132, ;
		Width = 120
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtNrAct' AS _textbox WITH ;
		ControlSource = "poRec.numar_act", ;
		Enabled = .F., ;
		Height = 23, ;
		Left = 482, ;
		Name = "txtNrAct", ;
		TabIndex = 15, ;
		Top = 76, ;
		Width = 120
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtSerieAct' AS _textbox WITH ;
		ControlSource = "poRec.serie_act", ;
		Enabled = .F., ;
		Height = 23, ;
		Left = 482, ;
		Name = "txtSerieAct", ;
		TabIndex = 14, ;
		Top = 48, ;
		Width = 120
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Destroy
		USE IN (SELECT('cTipFactura'))
		DODEFAULT()
	ENDPROC

	PROCEDURE do_cauta_adresa
		Local locauta
		locauta = caut_adresa(poRec.id_part)
		IF ISNULL(loCauta)
			RETURN
		ENDIF
		If !Empty(locauta.id_adresa)
			poRec.adresa_facturare = Alltrim(locauta.adresa)
			poRec.id_facturare = locauta.id_adresa
		
			Thisform.clb_adresa_facturare.Refresh()
			Thisform.but_TERMIN1.SetFocus()
		Else
			poRec.adresa_facturare = []
			poRec.id_facturare = Null
		Endif
	ENDPROC

	PROCEDURE do_cauta_agent
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Agenti??cTipuriParteneri=>]+ALLTRIM(STR(gnIdTipAgenti))+[??lAdaugCorespondente=>1]))
		If !Empty(Nvl(loCauta.id_part,0)) And !Empty(loCauta.denumire)
			poRec.id_agent = loCauta.id_part
			poRec.nume_agent = Alltrim(loCauta.denumire)
			Thisform.ct_clb_agent.Refresh()
			Thisform.ct_clb_delegat.SetFocus()
		Else
			poRec.id_agent = Null
			poRec.nume_agent = []
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_delegat
		Local loCauta
		*!*	If Inlist(poRec.tip,23,25)
		*!*		loCauta=caut_delegati()
		*!*	Else
		*!*	modificare	v 2.0.27
		*!*		loCauta=caut_delegati()
			If thisform.ntip_selectie = 0
				loCauta=caut_delegati()
			Else
				loCauta=caut_delegati_hash(poRec.id_part,.T.)
			EndIf
		*!*	modificare	v 2.0.27	^
		*!*	Endif
		If !Empty(loCauta.id_responsabil)
			poRec.id_delegat = loCauta.id_responsabil
			poRec.delegat = Alltrim(loCauta.nume)
			Thisform.ct_clb_delegat.Refresh()
			Thisform.ct_clb_masina.SetFocus()
		Else
			poRec.id_delegat = Null
			poRec.delegat = []
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_masina
		locauta=caut_masina_gs()
		If !Empty(locauta.id_masina)
			poRec.nrinmat = Alltrim(locauta.nrinmat)
			poRec.id_masina = locauta.id_masina
		
			Thisform.ct_clb_masina.Refresh()
			Thisform.clb_adresa_facturare.SetFocus()
		Else
			poRec.nrinmat = []
			poRec.id_masina = Null
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_ruta
		Local locauta
		lcFiltru = [2=2]
		lcSchema = [id_ruta n(20),ruta c(64)]
		lcOrder = [ruta]
		lccoloane = [ruta]
		lcTitlu = [ALEGETI RUTA]
		lcTitluColoane = [Ruta]
		lcSelect = [select id_ruta,ruta from fact_nom_rute]
		lcFiltruOriginal = [sters = 0]
		lcNumeProc = [nom_nomrute]
		llToateIreg = .F.
		lcPrimaColoana = [ruta]
		lnPornire = 1
		lcIdColumn = "id_ruta"
		loCauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal)&&, lcPrimaColoana, lnPornire, , lcIdColumn)
		
		If !Empty(locauta.id_ruta)
			poRec.ruta = Alltrim(locauta.ruta)
			poRec.id_ruta = locauta.id_ruta
			Thisform.ct_clb_ruta.Refresh()
		Else
			poRec.ruta = []
			poRec.id_ruta = Null
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local llReturn
		If Empty(poRec.dataora_exp)
			amessagebox("Trebuie sa completati data si ora expedierii!",48,"Atentie")
			This.clb_dataora_exp.SetFocus()
			llReturn = .F.
		Else
			llReturn = .T.
		ENDIF
		
		Return llReturn
	ENDPROC

	PROCEDURE Init
		Lparameters tnTip
		Thisform.ntip_selectie = Iif(Empty(tnTip),0,tnTip)
		This.shpTipFactura.Visible = m.gl406 && Tip factura SAFT
		This.lblTipFactura.Visible = m.gl406
		This.cboTipFactura.Visible = m.gl406
		
		this.chkSerieAct.Enabled = !EMPTY(NVL(poRec.numar_act,0))
		this.chkNrAct.Enabled = !EMPTY(NVL(poRec.numar_act,0))
		this.chkDataAct.Enabled = !EMPTY(NVL(poRec.numar_act,0))
		this.chkDataScad.Enabled = !EMPTY(NVL(poRec.numar_act,0))
		
		DoDefault()
		
	ENDPROC

	PROCEDURE Load
		IF !USED('saft_tip_facturi')
			update_saft_tip_facturi()
		ENDIF 	
	ENDPROC

	PROCEDURE chkDataAct.Valid
		thisform.txtDataAct.Enabled = this.Value
	ENDPROC

	PROCEDURE chkDataScad.Click
		thisform.txtDataScad.Enabled = this.Value
	ENDPROC

	PROCEDURE chkNrAct.Valid
		thisform.txtNrAct.Enabled = this.Value
	ENDPROC

	PROCEDURE chkSerieAct.Valid
		thisform.txtSerieAct.Enabled = this.Value
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_proforme AS _frmbase 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="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataora.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataora.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAltele.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAltele.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNumar_act.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cNumar_act.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtils.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cUtils.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataoras.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDataoras.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDiscount.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDiscount.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDiscount_evidentiat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cDiscount_evidentiat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cText_aditional.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cText_aditional.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_fara_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_fara_tva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_tva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_cu_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cTotal_cu_tva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cData_act.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cData_act.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cListareDetaliata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cListareDetaliata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAdresaFacturare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_facturi.cAdresaFacturare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_lista_preturi.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_lista_preturi.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCantitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCantitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cProc_tvav.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cProc_tvav.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUtils.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUtils.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDataoras.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDataoras.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUM.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cUM.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_Gestiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_Gestiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cDiscount_unitar_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_cu_tva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cPret_cu_tva._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cNume_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCurs.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_detalii.cCurs.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_sucursala" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_utilizator" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_dataora" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_data_act" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_client" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_total_val" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_total_ron" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtTotalValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtTotalLei" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_explicatie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_sterse" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_in_valuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_numar_act" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra2" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cfiltru_initial
		*p: ndetalii
		*p: nvanzari
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cfiltru_initial = 
		cgridsortlist = grid_facturi,grid_detalii
		DoCreate = .T.
		Height = 588
		Name = "frm_proforme"
		ndetalii = 0
		nvanzari = 0
		Width = 790
		WindowState = 2
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 791
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 688
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 105
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "LISTA PROFORME"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 15
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 760
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 12
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Left = 192
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 6
	*</PropValue>

	ADD OBJECT '_shape3' AS _shape WITH ;
		Anchor = 10, ;
		BackStyle = 0, ;
		Height = 40, ;
		Left = 9, ;
		Name = "_shape3", ;
		Top = 35, ;
		Width = 770, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 8, ;
		Left = 727, ;
		Name = "But_listare1", ;
		TabIndex = 13, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 693, ;
		Name = "But_sterge1", ;
		TabIndex = 14, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_client' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = client, ;
		Caption = "Partener", ;
		Comment = "*:OnResize=LT", ;
		Left = 88, ;
		Name = "Ck_client", ;
		TabIndex = 3, ;
		Top = 38
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_data_act' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = data_act, ;
		Caption = "Data act", ;
		Left = 19, ;
		Name = "Ck_data_act", ;
		TabIndex = 1, ;
		tip = D, ;
		Top = 38, ;
		Value = 1, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_dataora' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = dataora, ;
		Caption = "Dataora introducere", ;
		Left = 251, ;
		Name = "Ck_dataora", ;
		TabIndex = 7, ;
		tip = T, ;
		Top = 38, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_explicatie' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = explicatie, ;
		Caption = "Explicatie", ;
		Comment = "*:OnResize=LT", ;
		Left = 88, ;
		Name = "Ck_explicatie", ;
		TabIndex = 4, ;
		Top = 54
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_numar_act' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = NUMAR_ACT, ;
		Caption = "Nr. act", ;
		Left = 19, ;
		mask = (replicate('9',15)), ;
		Name = "Ck_numar_act", ;
		TabIndex = 2, ;
		Top = 54
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_sucursala' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = sucursala, ;
		Caption = "Sucursala", ;
		Comment = "*:OnResize=LT", ;
		Left = 166, ;
		Name = "Ck_sucursala", ;
		TabIndex = 5, ;
		Top = 38, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_utilizator' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = utilizator, ;
		Caption = "Operator introducere", ;
		FontCharSet = 238, ;
		Left = 166, ;
		Name = "Ck_utilizator", ;
		TabIndex = 6, ;
		Top = 54, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 8, ;
		Left = 599, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 10, ;
		Top = 41, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 8, ;
		Left = 687, ;
		Name = "Cmd_reset1", ;
		TabIndex = 17, ;
		Top = 41, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grid_detalii' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 16, ;
		DeleteMark = .F., ;
		HeaderHeight = 31, ;
		Height = 243, ;
		HighlightStyle = 2, ;
		Left = 6, ;
		Name = "grid_detalii", ;
		Panel = 1, ;
		RecordSource = "crsDetalii", ;
		RowHeight = 19, ;
		TabIndex = 11, ;
		Top = 312, ;
		Width = 774, ;
		ZOrderSet = 7, ;
		Column1.ControlSource = "nume_lista_preturi", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNume_lista_preturi", ;
		Column1.Width = 114, ;
		Column2.ControlSource = "denumire", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cExplicatie", ;
		Column2.Width = 163, ;
		Column3.ControlSource = "cantitate", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Format = "rk", ;
		Column3.InputMask = (get_mask(12,gnPCant)), ;
		Column3.Name = "cCantitate", ;
		Column3.Width = 61, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "pret", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "rk", ;
		Column4.InputMask = (get_mask(14,gnPPretV)), ;
		Column4.Name = "cPret", ;
		Column4.Width = 59, ;
		Column5.ColumnOrder = 7, ;
		Column5.ControlSource = "proc_tvav", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "rk", ;
		Column5.InputMask = "9 999.99", ;
		Column5.Name = "cProc_tvav", ;
		Column5.Width = 45, ;
		Column6.ColumnOrder = 6, ;
		Column6.ControlSource = "discount_unitar", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "rk", ;
		Column6.InputMask = (get_mask(14,gnPPretV)), ;
		Column6.Name = "cDiscount_unitar", ;
		Column6.Width = 98, ;
		Column7.ColumnOrder = 15, ;
		Column7.ControlSource = "utils", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cUtils", ;
		Column7.Width = 128, ;
		Column8.ColumnOrder = 16, ;
		Column8.ControlSource = "dataoras", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cDataoras", ;
		Column8.Width = 103, ;
		Column9.ColumnOrder = 4, ;
		Column9.ControlSource = "um", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cUM", ;
		Column9.Width = 36, ;
		Column10.ColumnOrder = 13, ;
		Column10.ControlSource = "cont", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cCont", ;
		Column10.Width = 46, ;
		Column11.ColumnOrder = 14, ;
		Column11.ControlSource = "nume_gestiune", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cNume_Gestiune", ;
		Column11.Width = 92, ;
		Column12.ColumnOrder = 12, ;
		Column12.ControlSource = "discount_unitar_val", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.InputMask = (get_mask(14,gnPval)), ;
		Column12.Name = "cDiscount_unitar_val", ;
		Column12.Width = 91, ;
		Column13.ColumnOrder = 11, ;
		Column13.ControlSource = "pret_val", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.InputMask = (get_mask(14,gnPval)), ;
		Column13.Name = "cPret_val", ;
		Column13.Width = 89, ;
		Column14.ColumnOrder = 8, ;
		Column14.ControlSource = "pret_cu_tva", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cPret_cu_tva", ;
		Column14.Sparse = .F., ;
		Column14.Width = 74, ;
		Column15.ColumnOrder = 9, ;
		Column15.ControlSource = "nume_val", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cNume_val", ;
		Column15.Width = 56, ;
		Column16.ColumnOrder = 10, ;
		Column16.ControlSource = "curs", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.InputMask = (get_mask(14,gnPCurs)), ;
		Column16.Name = "cCurs", ;
		Column16.Width = 65
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'grid_detalii.cCantitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_detalii.cCont.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_detalii.cCurs.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_detalii.cDataoras.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora stergerii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cDataoras.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_detalii.cDiscount_unitar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount unitar", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cDiscount_unitar.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_detalii.cDiscount_unitar_val.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount unitar in valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cDiscount_unitar_val.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_detalii.cExplicatie.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_detalii.cNume_Gestiune.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_detalii.cNume_lista_preturi.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Politica preturi", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cNume_lista_preturi.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_detalii.cNume_val.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_detalii.cPret.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_detalii.cPret_cu_tva._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 32, ;
		Name = "_checkbox1", ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_detalii.cPret_cu_tva.Header1' AS header WITH ;
		Caption = "Pret cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cPret_val.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret in valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cPret_val.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_detalii.cProc_tvav.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cProc_tvav.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_detalii.cUM.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_detalii.cUtils.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Operator stergere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_detalii.cUtils.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 18, ;
		DeleteMark = .F., ;
		HeaderHeight = 33, ;
		Height = 197, ;
		HighlightStyle = 2, ;
		Left = 6, ;
		Name = "grid_facturi", ;
		Panel = 1, ;
		RecordSource = "crsFacturi", ;
		RowHeight = 19, ;
		TabIndex = 10, ;
		Top = 81, ;
		Width = 774, ;
		ZOrderSet = 6, ;
		Column1.ColumnOrder = 14, ;
		Column1.ControlSource = "dataora", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cDataora", ;
		Column1.Width = 116, ;
		Column2.ColumnOrder = 13, ;
		Column2.ControlSource = "utilizator", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cUtilizator", ;
		Column2.Width = 122, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "altele", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cAltele", ;
		Column3.Width = 96, ;
		Column4.ColumnOrder = 2, ;
		Column4.ControlSource = "numar_act", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cNumar_act", ;
		Column4.Width = 76, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "explicatie", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cExplicatie", ;
		Column5.Width = 119, ;
		Column6.ColumnOrder = 3, ;
		Column6.ControlSource = "client", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cClient", ;
		Column6.Width = 134, ;
		Column7.ColumnOrder = 15, ;
		Column7.ControlSource = "utils", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cUtils", ;
		Column7.Width = 105, ;
		Column8.ColumnOrder = 16, ;
		Column8.ControlSource = "dataoras", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cDataoras", ;
		Column8.Width = 99, ;
		Column9.ColumnOrder = 6, ;
		Column9.ControlSource = "discount", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.InputMask = (get_mask(14,gnPc)), ;
		Column9.Name = "cDiscount", ;
		Column9.Width = 83, ;
		Column10.ColumnOrder = 11, ;
		Column10.ControlSource = "discount_evidentiat", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cDiscount_evidentiat", ;
		Column10.Sparse = .F., ;
		Column10.Width = 117, ;
		Column11.ColumnOrder = 10, ;
		Column11.ControlSource = "text_aditional", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cText_aditional", ;
		Column11.Width = 96, ;
		Column12.ColumnOrder = 7, ;
		Column12.ControlSource = "total_fara_tva", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.InputMask = (get_mask(14,gnPc)), ;
		Column12.Name = "cTotal_fara_tva", ;
		Column12.Width = 86, ;
		Column13.ColumnOrder = 8, ;
		Column13.ControlSource = "total_tva", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.InputMask = (get_mask(14,gnPc)), ;
		Column13.Name = "cTotal_tva", ;
		Column13.Width = 79, ;
		Column14.ColumnOrder = 9, ;
		Column14.ControlSource = "total_cu_tva", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.InputMask = (get_mask(14,gnPc)), ;
		Column14.Name = "cTotal_cu_tva", ;
		Column14.Width = 96, ;
		Column15.ColumnOrder = 1, ;
		Column15.ControlSource = "data_act", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cData_act", ;
		Column15.Width = 65, ;
		Column16.ColumnOrder = 12, ;
		Column16.ControlSource = "sucursala", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "cSucursala", ;
		Column16.Width = 109, ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "cListareDetaliata", ;
		Column17.ReadOnly = .T., ;
		Column17.Sparse = .F., ;
		Column17.Width = 66, ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "cAdresaFacturare", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 201
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid_facturi.cAdresaFacturare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Adresa facturare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grid_facturi.cAltele.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_facturi.cClient.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cData_act.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data act", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cData_act.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ControlSource = "data_act", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cDataora.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora introducerii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cDataora.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cDataoras.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora stergerii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cDataoras.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cDiscount.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount pe proforma", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cDiscount.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cDiscount_evidentiat._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 49, ;
		Name = "_checkbox1", ;
		Top = 50
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_facturi.cDiscount_evidentiat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount evidentiat pe proforma", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cExplicatie.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cListareDetaliata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Listare detaliata", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_facturi.cNumar_act.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Numar act", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cNumar_act.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grid_facturi.cText_aditional.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Text aditional", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cText_aditional.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cTotal_cu_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cTotal_cu_tva.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cTotal_fara_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total fara TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cTotal_fara_tva.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cTotal_tva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cTotal_tva.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cUtilizator.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Operator introducere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cUtilizator.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_facturi.cUtils.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Operator stergere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_facturi.cUtils.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'Gridextra2' AS gridextra WITH ;
		gridexpression = Thisform.grid_detalii, ;
		Left = 745, ;
		Name = "Gridextra2", ;
		Top = 475
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'lb_total_ron' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total lei", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 585, ;
		Name = "lb_total_ron", ;
		TabIndex = 17, ;
		Top = 565, ;
		Visible = .F., ;
		Width = 47, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lb_total_val' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total în valuta", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 311, ;
		Name = "lb_total_val", ;
		TabIndex = 18, ;
		Top = 565, ;
		Visible = .F., ;
		Width = 81, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'opt_in_valuta' AS _optiongrup WITH ;
		AutoSize = .F., ;
		ButtonCount = 3, ;
		Height = 28, ;
		Left = 380, ;
		Name = "opt_in_valuta", ;
		ndefault = 1, ;
		TabIndex = 8, ;
		Top = 33, ;
		Value = 1, ;
		Width = 190, ;
		ZOrderSet = 23, ;
		OPTION1.AutoSize = .T., ;
		OPTION1.Caption = "Toate", ;
		OPTION1.FontSize = 10, ;
		OPTION1.Left = 5, ;
		OPTION1.Name = "OPTION1", ;
		OPTION1.Top = 5, ;
		OPTION1.Value = 1, ;
		OPTION2.AutoSize = .T., ;
		OPTION2.Caption = "În valuta", ;
		OPTION2.FontCharSet = 238, ;
		OPTION2.FontSize = 10, ;
		OPTION2.Left = 55, ;
		OPTION2.Name = "OPTION2", ;
		OPTION2.Top = 5, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "În RON", ;
		Option3.FontCharSet = 238, ;
		Option3.FontSize = 10, ;
		Option3.Height = 18, ;
		Option3.Left = 124, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5, ;
		Option3.Value = 0, ;
		Option3.Width = 61
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'opt_sterse' AS _optiongrup WITH ;
		AutoSize = .F., ;
		ButtonCount = 3, ;
		Height = 28, ;
		Left = 381, ;
		Name = "opt_sterse", ;
		ndefault = 3, ;
		TabIndex = 9, ;
		Top = 52, ;
		Value = 3, ;
		Width = 199, ;
		ZOrderSet = 22, ;
		OPTION1.AutoSize = .T., ;
		OPTION1.Caption = "Toate", ;
		OPTION1.FontSize = 10, ;
		OPTION1.Left = 5, ;
		OPTION1.Name = "OPTION1", ;
		OPTION1.Top = 5, ;
		OPTION1.Value = 0, ;
		OPTION2.AutoSize = .T., ;
		OPTION2.Caption = "ªterse", ;
		OPTION2.FontCharSet = 238, ;
		OPTION2.FontSize = 10, ;
		OPTION2.ForeColor = 255,0,0, ;
		OPTION2.Left = 54, ;
		OPTION2.Name = "OPTION2", ;
		OPTION2.Top = 5, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Neºterse", ;
		Option3.FontCharSet = 238, ;
		Option3.FontSize = 10, ;
		Option3.Height = 18, ;
		Option3.Left = 123, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5, ;
		Option3.Value = 1, ;
		Option3.Width = 71
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'txtTotalLei' AS textbox WITH ;
		Anchor = 12, ;
		ControlSource = "thisform.nDetalii", ;
		FontSize = 10, ;
		Format = "rk", ;
		Height = 23, ;
		InputMask = (get_mask(16,gnPc)), ;
		Left = 640, ;
		Name = "txtTotalLei", ;
		ReadOnly = .T., ;
		TabIndex = 19, ;
		Top = 562, ;
		Visible = .F., ;
		Width = 139, ;
		ZOrderSet = 19
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtTotalValuta' AS textbox WITH ;
		Anchor = 12, ;
		ControlSource = "thisform.nDetalii", ;
		FontSize = 10, ;
		Format = "rk", ;
		Height = 23, ;
		InputMask = (get_mask(16,gnPVal)), ;
		Left = 395, ;
		Name = "txtTotalValuta", ;
		ReadOnly = .T., ;
		TabIndex = 20, ;
		Top = 562, ;
		Visible = .F., ;
		Width = 139, ;
		ZOrderSet = 19
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = pofacturi.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer = 11
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grid_facturi)
		pofacturi.ca_baza1.cfiltru = lcFiltru
		pofacturi.ca_baza1.afisare()
		restore_grid_tag(Thisform.grid_facturi)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		If Reccount('crsFacturi')>0
			Thisform.grid_facturi.SetFocus()
		Endif
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Lparameters lcFiltru
		
		Local lcFiltru2
		If Empty(lcFiltru)
			lcFiltru2 = poDetalii.ca_baza1.cfiltru
		Else
			lcFiltru2 = lcFiltru
		Endif
		
		Do Case
		Case Thisform.opt_sterse.Value = 2
			lcFiltru2 = lcFiltru2 + [ and STERS=1]
		Case Thisform.opt_sterse.Value = 3
			lcFiltru2 = lcFiltru2 + [ and STERS=0]
		Endcase
		
		Thisform.MousePointer = 11
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grid_detalii)
		poDetalii.ca_baza1.cfiltru = lcFiltru2
		poDetalii.ca_baza1.afisare()
		restore_grid_tag(Thisform.grid_detalii)
		
		*!*	Select crsDetalii
		
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru =  [2=2]+ gcCondSucursala
		
		If Thisform.ck_data_act.Value=1
			lcFiltru = lcFiltru + Thisform.ck_data_act.filtru
		Endif
		
		If Thisform.ck_dataora.Value=1
			lcFiltru = lcFiltru + Thisform.ck_dataora.filtru
		Endif
		
		If Thisform.ck_numar_act.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_numar_act.filtru
		Endif
		
		If Thisform.ck_utilizator.Value=1
			lcFiltru = lcFiltru + Thisform.ck_utilizator.filtru
		Endif
		
		If Thisform.ck_explicatie.Value=1
			lcFiltru = lcFiltru + Thisform.ck_explicatie.filtru
		Endif
		
		If Thisform.ck_client.Value=1
			lcFiltru = lcFiltru + Thisform.ck_client.filtru
		Endif
		
		If Thisform.ck_sucursala.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_sucursala.filtru
		Endif
		
		*!*	modificare	v 2.0.46
		Do Case
		Case Thisform.opt_in_valuta.Value = 2
			lcFiltru = lcFiltru + [ and in_valuta=1]
		Case Thisform.opt_in_valuta.Value = 3
			lcFiltru = lcFiltru + [ and in_valuta=0]
		EndCase
		*!*	modificare	v 2.0.46	^
		
		* inregistrari sterse
		Do Case
		Case Thisform.opt_sterse.Value = 2
			lcFiltru = lcFiltru + [ and STERS=1]
		Case Thisform.opt_sterse.Value = 3
			lcFiltru = lcFiltru + [ and STERS=0]
		Endcase
		
		Thisform.actualizeaza_grid1(lcFiltru)
		*!*	Select crsDetalii
		*!*	Calculate Sum(Round(cantitate*(Pret-discount_unitar),gnPC)) To Thisform.nVanzari
		*!*	Thisform.txtVanzari.Refresh
		
		If Reccount('crsFacturi')=0
			aMessagebox('Cautarea nu a intors rezultate!',0+48,'Info cautare')
			Thisform.actualizeaza_grid2([1=2])
			Thisform.ck_dataora.SetFocus()
		Else
			Select crsFacturi
			lcFiltru = [id_proforma=]+Alltrim(Str(id_proforma))
			Thisform.actualizeaza_grid2(lcFiltru)
			Thisform.grid_facturi.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_listare
		If Reccount('crsfacturi')>0
			Private poDate,pnIdProforma
			Local lnDiscount,lnProcTvav
			Select crsfacturi
		*!*	modificare	v 2.0.67
		*!*		Private pnTipFActurare
		*!*		pnTipFActurare = 0
		*!*	modificare	v 2.0.67	^
			lnTip = tip
			lnSters = sters
			pnIdProforma = id_proforma
		
			If lnSters = 0
		*!*			poDate=Createobject("oDateFactura",0,0)
		*!*			Select crsfacturi
		*!*			poDate.tip = lnTip
		*!*			poDate.eProforma = 1
		*!*			poDate.nract = numar_act
		*!*			poDate.dataact = Iif(Type('data_act')='T',Ttod(data_act),data_act)
		*!*			poDate.id_client = id_part
		*!*			poDate.discount_evidentiat = discount_evidentiat
		*!*			poDate.text_aditional = Nvl(text_aditional,[])
		*!*			lnDiscount = discount
		*!*			poDate.listaid = Iif(poDate.tip = 2,Alltrim(Str(id_ctr)),Iif(poDate.tip = 3,Alltrim(Str(id_comanda)), [0]))
		
				poDate=Createobject("oDateFactura",0,0)
				Select crsfacturi
				poDate.nRelistare = 1	&&	modificare	ROAFACTURARE v 2.0.58
				poDate.eProforma = 1
				poDate.tip = lnTip
				poDate.nract = numar_act
				poDate.dataact = Iif(Type('data_act')='T',Ttod(data_act),data_act)
				poDate.discount_evidentiat = discount_evidentiat
				poDate.text_aditional = Nvl(text_aditional,[])
				poDate.dataora_exp = dataora
		*!*	modificare v 2.0.68
		*!*			poDate.listaid = Iif(poDate.tip = 2,Alltrim(Str(id_ctr)),Iif(Inlist(poDate.tip, 3, 21),Alltrim(Str(id_comanda)), [0]))
				poDate.listaid = Iif(Inlist(poDate.tip, 3, 21),Alltrim(Str(id_comanda)), [0])
		*!*	modificare v 2.0.68	^
				poDate.in_valuta = in_valuta
				poDate.id_client = id_part		
				If poDate.in_valuta = 1
					poDate.nume_valuta = nume_val
					poDate.Curs = Curs
					poDate.multiplicator = multiplicator
					poDate.totftvaconv		=	total_fara_tva
					poDate.tottvaconv		=	total_tva
					poDate.totctvaconv		=	poDate.totftvaconv + poDate.tottvaconv
					lnDiscountVal = discount
					lnDiscount = Round(lnDiscountVal * poDate.Curs / poDate.multiplicator,gnPc)
				Else
					lnDiscount = discount
					lnDiscountVal = 0
				Endif
				poDate.nListareDetaliata = listare_detaliata
				If Used('crsfactura')
					Use In crsfactura
				Endif
		
				Select crsdetalii
				Calculate Max(proc_tvav) To lnProcTvav
		
				creeaza_facturacrs([crsfactura])
		
				prelucreaza_facturacrs([crsdetalii],[crsfactura],lnProcTvav,lnDiscount,lnDiscountVal)
		
				creeaza_cursor_seturi_proforme(pnIdProforma)
		
				Thisform.AlwaysOnTop = .F.
				listeaza_ofacturare()
				Thisform.AlwaysOnTop = .T.
		
				If Used('crsfactura')
					Use In crsfactura
				Endif
			Else
				amessagebox("Nu puteti lista aceasta proforma, deoarece a fost stearsa!",0+48,"Atentie")
			Endif
			Release poDate	&&	,pnTipFacturare	*!*	modificare	v 2.0.67
		Endif
		
	ENDPROC

	PROCEDURE do_reset
		With Thisform
			For i=1 To .Objects.Count
				If Upper(.Objects(i).BaseClass)='CHECKBOX'
					.Objects(i).Value=0
				Endif
			Endfor
		Endwith
		Thisform.opt_sterse.Value = Thisform.opt_sterse.ndefault
		*!*	Thisform.ck_dataora.Value = 1
		*!*	Thisform.ck_dataora.filtru = Thisform.cfiltru_initial
		*!*	Thisform.ck_dataora.SetFocus()
		Thisform.ck_data_act.Value = 1
		Thisform.ck_data_act.filtru = Thisform.cfiltru_initial
		Thisform.ck_data_act.SetFocus()
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('crsfacturi') = 0
			amessagebox("Nu exista inregistrari pentru stergere!",0+48,"Atentie")
			Return
		Endif
		
		Private pnIdProforma
		Store 0 To pnIdProforma
		lnSucces = 0
		
		If glLunaInchisa
			Return
		Endif
		
		Select crsfacturi
		pnIdProforma = id_proforma
		lnSters = sters
		lnRecno = Recno()
		
		If lnSters = 1
			amessagebox("Aceasta proforma este deja stearsa!",0+48,"Atentie")
			Return
		Endif
		
		If amessagebox("Sunteti sigur ca doriti sa stergeti aceasta inregistrare?",4+32,"Confirmare stergere")=7
			Return
		Endif
		
		lcSql = [begin ] + gcS + [.pack_facturare.sterge_proforma(?pnIdProforma,?gnIdUtil); end;]
		lnSucces = goExecutor.oExecute(lcSql)
		If lnSucces<0
			amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
		Else
			Thisform.actualizeaza_grid1
			Thisform.actualizeaza_grid2
			If Reccount('crsfacturi')>0
				lnRecno = Min(Reccount('crsfacturi'),Iif(Thisform.opt_sterse.Value=3,Iif(lnRecno>1,lnRecno-1,1),lnRecno))
				SELECT crsfacturi
				Go lnRecno
			Endif
		Endif
		
		Release pnIdProforma
	ENDPROC

	PROCEDURE Init
		If glLunaInchisa
			gcAcces=Strtran(gcAcces,[4;],[])	&&	nu are drept de stergere
			Thisform.but_sterge1.Visible = .F.
		Endif
		DoDefault()
		lcData = Alltrim(Str(gnAn)) + Padl(Alltrim(Str(gnLuna)),2,[0]) + [01]
		*!*	lcFiltruInitial = [ and dataora between to_date('] + lcData + [  00:00:00','YYYYMMDD HH24:MI:SS') ] + ;
		*!*		[and last_day(to_date('] + lcData + [  23:59:59','YYYYMMDD HH24:MI:SS')) ]
		lcFiltruInitial = [ and data_act between to_date('] + lcData + [','YYYYMMDD') ] + ;
			[and last_day(to_date('] + lcData + [','YYYYMMDD')) ]
		Thisform.cfiltru_initial = lcFiltruInitial
		*!*	Thisform.ck_dataora.filtru = lcFiltruInitial
		Thisform.ck_data_act.filtru = lcFiltruInitial
		
		
		this.gridextra1.setup()
		this.gridextra2.setup()
	ENDPROC

	PROCEDURE grid_detalii.Init
		This.SetAll("DynamicForeColor", "IIF(sters=1, RGB(255,0,0), RGB(0,0,0))", "Column")
		This.SetAll("ReadOnly",.T.,"Column")
		For i = 1 To This.ColumnCount
			lcColor='this.Columns(' + Alltrim(Str(i)) + ').DynamicBackColor'
			lcControlSource1 = 'this.Columns(' + Alltrim(Str(i)) + ').controlsource'
			lcControlSource = &lcControlSource1
			lcSet = lcColor + [ = "IIF(ISNULL(] + lcControlSource + [),RGB(255,255,225),RGB(255,255,255))"]
			&lcSet
		Endfor
	ENDPROC

	PROCEDURE grid_facturi.AfterRowColChange
		Lparameters nColIndex
		If Inlist(This.RowColChange,1,3)
			Local lnIdPol
			Select crsFacturi
			lnId_proforma = id_proforma
			lcFiltru = [a.id_proforma=]+Alltrim(Str(lnId_proforma))
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
	ENDPROC

	PROCEDURE grid_facturi.Init
		This.SetAll("DynamicForeColor", "IIF(sters=1, RGB(255,0,0), RGB(0,0,0))", "Column")
		This.SetAll("ReadOnly",.T.,"Column")
		For i = 1 To This.ColumnCount
			lcColor='this.Columns(' + Alltrim(Str(i)) + ').DynamicBackColor'
			lcControlSource1 = 'this.Columns(' + Alltrim(Str(i)) + ').controlsource'
			lcControlSource = &lcControlSource1
			lcSet = lcColor + [ = "IIF(ISNULL(] + lcControlSource + [),RGB(255,255,225),RGB(255,255,255))"]
			&lcSet
		Endfor
	ENDPROC

ENDDEFINE
