*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="anaf_efactura.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS anaf_efactura 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_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1._SHAPE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column3._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdDetaliiFacturi.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cNr.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cNr.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cData.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cData.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTrimis._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cDataTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cDataTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cMesajTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cMesajTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cCodFiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cCodFiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTipMesajRaspuns.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTipMesajRaspuns.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cMesajRaspuns.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cMesajRaspuns.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cIdIncarcare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cIdIncarcare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cId.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cId.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cDataRaspuns.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cDataRaspuns.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTest._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cUtilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cUtilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalCuTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalCuTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cJtotcTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cJtotcTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cDiferenta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cDiferenta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxValoareFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxValoareFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxDiscount.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxDiscount.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTaxe.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTaxe.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalDePlata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxTotalDePlata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTipPersoana.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTipPersoana.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cInValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cInValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cInValuta._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cNumeValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cNumeValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotalFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotalFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotalTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotalTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotalCuTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotalCuTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cValVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cValVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTvaVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTvaVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cTotVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxNumeValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cxNumeValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cCurs.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cCurs.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cCreditNote.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cCreditNote.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.grdFacturiEmise.cCreditNote._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.cmdTrimite" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.cmdRaspunsuri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.txtMesajTrimis" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.txtMesajRaspuns" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.edtDetalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.lblMesajTrimis" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.lblMesajRaspuns" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.lblDetalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkValidareOnline" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkTrimis" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkFortareRaspunsuri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkPersFizice" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.Cmd_select_adv1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1._grdfooter1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkPJ" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkNetrimise" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkErori" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkTrimise" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.chkDiferente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.cboAtasamente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page1.lblAtasamente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2._SHAPE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column3._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdDetaliiFacturi.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cNr.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cNr.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cData.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cData.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDataTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDataTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cCodFiscalEmitent.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cCodFiscalEmitent.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTipMesajRaspuns.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTipMesajRaspuns.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cIdDescarcare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cIdDescarcare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalCuTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalCuTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cNumeValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cNumeValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cJtotcTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cJtotcTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDataScad.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDataScad.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDescriere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDescriere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDescriere._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cXFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cXFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDiscount.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDiscount.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTaxe.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTaxe.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cValoareFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cValoareFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotaldePlata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotaldePlata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cId.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cId.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDetaliiPlata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDetaliiPlata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDetaliiPlata._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDiferenta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDiferenta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cIdIncarcare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cIdIncarcare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cProcesat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cProcesat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cProcesat._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDescarcat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDescarcat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cDescarcat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cXClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cXClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cFilePath.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cFilePath.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalTVARON.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cTotalTVARON.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cProcesatServer.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cProcesatServer.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cProcesatServer._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cCreditNote.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cCreditNote.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.grdFacturiPrimite.cCreditNote._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.lblDetalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.edtDetalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.cmdTrimiteMesajFurnizor" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.txtMesajRaspuns" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.txtMesajFurnizor" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.lblMesajRaspuns" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2._grdfooter1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.chkDiferente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page2.chkLipsaRegistru" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3._SHAPE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column3._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdDetaliiFacturi.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cNr.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cNr.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cData.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cData.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDataTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDataTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cCodFiscalBeneficiar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cCodFiscalBeneficiar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTipMesajRaspuns.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTipMesajRaspuns.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cIdDescarcare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cIdDescarcare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalCuTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalCuTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cNumeValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cNumeValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cJtotcTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cJtotcTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDataScad.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDataScad.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDescriere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDescriere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDescriere._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cXClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cXClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDiscount.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDiscount.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTaxe.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTaxe.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cValoareFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cValoareFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotaldePlata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotaldePlata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cId.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cId.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDetaliiPlata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDetaliiPlata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDetaliiPlata._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDiferenta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDiferenta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTest._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cIdIncarcare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cIdIncarcare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cProcesat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cProcesat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cProcesat._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cxFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cxFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDescarcat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDescarcat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cDescarcat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cFilePath.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cFilePath.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalTVARON.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cTotalTVARON.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cProcesatServer.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cProcesatServer.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cProcesatServer._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cCreditNote.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cCreditNote.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.grdFacturiTrimise.cCreditNote._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.lblDetalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.edtDetalii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.txtMesajTrimis" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.txtMesajRaspuns" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.lblMesajTrimis" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.lblMesajRaspuns" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3._grdfooter1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.chkDiferente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page3.chkLipsaRegistru" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.lblToken" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtSaveFurnizoriPath" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtSaveFurnizoriFile" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtSaveClientiPath" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtSaveClientiFile" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtNetworkPath" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtServerPath" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtResponsesPathServer" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.txtResponsesPathLocal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.lblMesajTrimis" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._checkbox2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4.chkValidareOnline" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgfeFactura.Page4._checkbox3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkTest" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_attach1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_grid3
		*m: actualizeaza_grid4
		*m: bifeazatrimismanual		&& Bifeaza o factura ca trimisa manual
		*m: citesteraspunsuri
		*m: do_ataseaza
		*m: gettoken
		*m: ltest_assign
		*m: refreshdetaliifacturi
		*m: refreshlbltoken
		*m: trimitefacturi
		*m: trimitemesajfurnizor
		*p: cmesajfurnizor
		*p: cresponsespath
		*p: lprimaactivareprimite
		*p: lprimaactivaretrimise
		*p: ltest
		*p: nidborderou
		*p: ntip		&& 0=tranzit, 1=cheiaj
		*p: ntrimis
		*p: oanaf
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		Caption = "Form"
		cbuton7 = pgfeFactura.page1.cmdTrimite;pgfeFactura.page1.cmdRaspunsuri
		cmesajfurnizor = 
		cresponsespath = 
		DoCreate = .T.
		FontBold = .F.
		Height = 485
		lprimaactivareprimite = .F.
		lprimaactivaretrimise = .F.
		ltest = .F.
		Name = "anaf_efactura"
		nidborderou = 0
		ntip = 0
		ntrimis = 0
		oanaf = .NULL.
		Width = 792
		WindowState = 2
		_memberdata = <VFPData>
			<memberdata name="nidborderou" display="nIdBorderou"/>
			<memberdata name="trimitefacturi" display="TrimiteFacturi"/>
			<memberdata name="oanaf" display="oAnaf"/>
			<memberdata name="gettoken" display="GetToken"/>
			<memberdata name="citesteraspunsuri" display="CitesteRaspunsuri"/>
			<memberdata name="bifeazatrimismanual" display="BifeazaTrimisManual"/>
			<memberdata name="ntrimis" display="nTrimis"/>
			<memberdata name="refreshlbltoken" display="RefreshLblToken"/>
			<memberdata name="refreshdetaliifacturi" display="RefreshDetaliiFacturi"/>
			<memberdata name="cresponsespath" display="cResponsesPath"/>
			<memberdata name="ltest" display="lTest"/>
			<memberdata name="ltest_assign" display="lTest_Assign"/>
			<memberdata name="trimitemesajfurnizor" display="TrimiteMesajFurnizor"/>
			<memberdata name="lprimaactivaretrimise" display="lPrimaActivareTrimise"/>
			<memberdata name="lprimaactivareprimite" display="lPrimaActivarePrimite"/>
			<memberdata name="cmesajfurnizor" display="cMesajFurnizor"/>
		</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 = "eFactura"
		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_attach1' AS but_attach WITH ;
		Anchor = 9, ;
		Left = 672, ;
		Name = "But_attach1", ;
		ToolTipText = "Atasamente", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		Left = 733, ;
		Name = "But_excel1", ;
		TabIndex = 12, ;
		Top = 1, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Left = 702, ;
		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 = 555, ;
		Name = "But_reset_criterii1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 9, ;
		Left = 644, ;
		Name = "But_verifica1", ;
		ToolTipText = "Verificare valoare cu TVA pe zile si coduri fiscale - Jurnal TVA (Fel doc: Factura, Bon fiscal) fata de eFactura trimise/primite", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'chkTest' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		Caption = "TEST", ;
		ControlSource = "Thisform.lTest", ;
		FontBold = .T., ;
		ForeColor = 255,255,0, ;
		Left = 75, ;
		Name = "chkTest", ;
		ToolTipText = "Trimite eFactura pe serverul Test la ANAF", ;
		Top = 7, ;
		Visible = .F.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura' AS _pageframe WITH ;
		Anchor = 15, ;
		ErasePage = .T., ;
		Height = 485, ;
		Left = 0, ;
		Name = "pgfeFactura", ;
		PageCount = 4, ;
		Top = 26, ;
		Width = 795, ;
		Page1.Caption = "Transmitere eFactura", ;
		Page1.Name = "Page1", ;
		Page1.PageOrder = 1, ;
		Page2.Caption = "Facturi primite in SPV", ;
		Page2.Name = "Page2", ;
		Page2.PageOrder = 3, ;
		Page3.Caption = "Facturi trimise in SPV", ;
		Page3.Name = "Page3", ;
		Page3.PageOrder = 2, ;
		Page4.Caption = "Configurare", ;
		Page4.Name = "Page4", ;
		Page4.PageOrder = 4
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="pageframe" />

	ADD OBJECT 'pgfeFactura.Page1._grdfooter1' AS _grdfooter WITH ;
		Anchor = 14, ;
		ccolwithlabel = cClient, ;
		csourcegrid = grdFacturiEmise, ;
		csumcolumns = cxValoarefaraTVA,cxDiscount,cxTaxe,cxTotaldePlata,cxTotalFaraTVA,cxTotalTVA,cxTotalcuTVA,cJtotcTVA,cDiferenta,cTotalFaraTVA,cTotalTVA,cTotalcuTVA,cValVal,cTVAVal,cTotVal, ;
		ctotallabelexpression = 'Total', ;
		Left = 4, ;
		Name = "_grdfooter1", ;
		Top = 113, ;
		Width = 780
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgfeFactura.Page1._SHAPE1' AS _shape WITH ;
		Anchor = 14, ;
		BackStyle = 0, ;
		FillColor = 255,255,240, ;
		FillStyle = 0, ;
		Height = 80, ;
		Left = 4, ;
		Name = "_SHAPE1", ;
		Top = 298, ;
		Width = 780, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'pgfeFactura.Page1.cboAtasamente' AS _combobox WITH ;
		Anchor = 12, ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "200,0", ;
		Enabled = .F., ;
		Height = 24, ;
		Left = 285, ;
		Name = "cboAtasamente", ;
		RowSource = "Fara atasamente,0,Factura,1,Factura si alte documente,2,Alte documente,3", ;
		RowSourceType = 1, ;
		ToolTipText = "Ataseaza fisier pdf factura (datafact_nrfact_factura.pdf) la xml eFactura, daca fisierul exista deja in directorul atasamente", ;
		Top = 399, ;
		Value = 0, ;
		Width = 243
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'pgfeFactura.Page1.chkDiferente' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 225,225,225, ;
		BackStyle = 1, ;
		Caption = "Trimise (cu diferente Reg. Vz.)", ;
		Height = 25, ;
		Left = 687, ;
		Name = "chkDiferente", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 238
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkErori' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 255,140,140, ;
		BackStyle = 1, ;
		Caption = "Trimise (cu raspuns Erori)", ;
		Height = 25, ;
		Left = 470, ;
		Name = "chkErori", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 211
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkFortareRaspunsuri' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		Caption = "Forteaza rapuns", ;
		FontBold = .F., ;
		ForeColor = 64,128,128, ;
		Left = 667, ;
		Name = "chkFortareRaspunsuri", ;
		ToolTipText = "Se descarca si se proceseaza inclusiv raspunsurile care au fost deja salvate", ;
		Top = 380, ;
		Value = .F., ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkNetrimise' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 255,255,240, ;
		BackStyle = 1, ;
		Caption = "Netrimise", ;
		Height = 25, ;
		Left = 154, ;
		Name = "chkNetrimise", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 117
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkPersFizice' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		Caption = "Inclusiv Pers. Fizice", ;
		FontBold = .F., ;
		ForeColor = 0,128,192, ;
		Left = 7, ;
		Name = "chkPersFizice", ;
		ToolTipText = "Se selecteaza inclusiv facturile pentru persoanele fizice", ;
		Top = 380, ;
		Value = .T., ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkPJ' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackStyle = 1, ;
		Caption = "Pers. Juridice", ;
		ForeColor = 0,128,192, ;
		Height = 25, ;
		Left = 7, ;
		Name = "chkPJ", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 141
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkTrimis' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		Caption = "Trimis", ;
		ControlSource = "crsFacturiEmise.trimis", ;
		Enabled = .F., ;
		FontBold = .T., ;
		ForeColor = 0,64,128, ;
		Left = 13, ;
		Name = "chkTrimis", ;
		ToolTipText = 'Bifeaza o factura ca "Trimisa", daca a fost trimisa manual in eFactura', ;
		Top = 304, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkTrimise' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 255,165,255, ;
		BackStyle = 1, ;
		Caption = "Trimise (fara raspuns)", ;
		Height = 25, ;
		Left = 277, ;
		Name = "chkTrimise", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 187
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.chkValidareOnline' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		Caption = "Validare online", ;
		FontBold = .F., ;
		ForeColor = 0,64,128, ;
		Left = 539, ;
		Name = "chkValidareOnline", ;
		ToolTipText = "Se valideaza xml eFactura online pe serverul ANAF inainte de a se trimite in sistemul eFactura. Alternativ, se valideaza offline cu DukIntegrator", ;
		Top = 380, ;
		Value = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.Cmd_select_adv1' AS cmd_select_adv WITH ;
		Anchor = 6, ;
		ccoloana = ales, ;
		cgrid = thisform.pgfeFactura.page1.grdFacturiEmise, ;
		FontBold = .F., ;
		FontUnderline = .T., ;
		ForeColor = 0,64,128, ;
		Left = 4, ;
		Name = "Cmd_select_adv1", ;
		Top = 397
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pgfeFactura.Page1.cmdRaspunsuri' AS cmd_executa WITH ;
		Anchor = 12, ;
		caction = do_raspunsuri, ;
		Caption = "\<Raspunsuri", ;
		ForeColor = 64,128,128, ;
		Height = 27, ;
		Left = 663, ;
		Name = "cmdRaspunsuri", ;
		ToolTipText = "Citeste raspunsurile pentru facturile trimise", ;
		Top = 397, ;
		Visible = .F., ;
		Width = 117, ;
		ZOrderSet = 3
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pgfeFactura.Page1.cmdTrimite' AS cmd_executa WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "\<Trimite", ;
		ForeColor = 0,64,128, ;
		Height = 27, ;
		Left = 534, ;
		Name = "cmdTrimite", ;
		ToolTipText = "Genereaza xml si trimite la ANAF eFactura pentru facturile selectate / factura curenta", ;
		Top = 397, ;
		Visible = .F., ;
		Width = 117, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pgfeFactura.Page1.edtDetalii' AS _editbox WITH ;
		Anchor = 14, ;
		ControlSource = "crsFacturiEmise.detalii", ;
		Height = 57, ;
		Left = 383, ;
		Name = "edtDetalii", ;
		ReadOnly = .T., ;
		Top = 316, ;
		Width = 396, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi' AS _grdbase WITH ;
		Anchor = 14, ;
		BackColor = 255,255,255, ;
		ColumnCount = 10, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 35, ;
		Height = 112, ;
		lcamptextneeditabil = .F., ;
		Left = 4, ;
		Name = "grdDetaliiFacturi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsdetaliifacturi", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 183, ;
		Width = 780, ;
		ZOrderSet = 1, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ControlSource = "crsdetaliifacturi.nr", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 37, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ControlSource = "crsdetaliifacturi.articol", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 146, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 10, ;
		Column3.ControlSource = "crsdetaliifacturi.detalii", ;
		Column3.CurrentControl = "_editbox1", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 189, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 3, ;
		Column4.ControlSource = "crsdetaliifacturi.cantitate", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 56, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "crsdetaliifacturi.um", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 40, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "crsdetaliifacturi.pret", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 75, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "crsdetaliifacturi.proctva", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 45, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "crsdetaliifacturi.descriere", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 162, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 6, ;
		Column9.ControlSource = "crsdetaliifacturi.valoarefaratva", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 102, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 7, ;
		Column10.ControlSource = "crsdetaliifacturi.discountfaratva", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 109
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column10.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 'pgfeFactura.Page1.grdDetaliiFacturi.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Articol", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column3._editbox1' AS _editbox WITH ;
		FontSize = 10, ;
		Left = 37, ;
		Name = "_editbox1", ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column3.Header1' AS header WITH ;
		Caption = "Detalii", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column3.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 'pgfeFactura.Page1.grdDetaliiFacturi.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cantitate", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "UM", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret unitar", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "% TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descriere", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column8.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdDetaliiFacturi.Column9.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 'pgfeFactura.Page1.grdFacturiEmise' AS _grdbase WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 36, ;
		DeleteMark = .F., ;
		FontShadow = .F., ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 38, ;
		Height = 113, ;
		lcamptextneeditabil = .F., ;
		Left = 4, ;
		Name = "grdFacturiEmise", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsFacturiEmise", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 0, ;
		Width = 780, ;
		ZOrderSet = 1, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "crsFacturiEmise.ales", ;
		Column1.CurrentControl = "_checkbox1", ;
		Column1.FontName = "Arial", ;
		Column1.FontShadow = .F., ;
		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 = "numar_act", ;
		Column2.FontName = "Arial", ;
		Column2.FontShadow = .F., ;
		Column2.FontSize = 10, ;
		Column2.Name = "cNr", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 86, ;
		Column3.Alignment = 6, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "data_act", ;
		Column3.FontName = "Arial", ;
		Column3.FontShadow = .F., ;
		Column3.FontSize = 10, ;
		Column3.Name = "cData", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 69, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 4, ;
		Column4.ControlSource = "client", ;
		Column4.FontName = "Arial", ;
		Column4.FontShadow = .F., ;
		Column4.FontSize = 10, ;
		Column4.Name = "cClient", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 279, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 7, ;
		Column5.ControlSource = "crsFacturiEmise.trimis", ;
		Column5.CurrentControl = "_checkbox1", ;
		Column5.FontShadow = .F., ;
		Column5.FontSize = 10, ;
		Column5.Name = "cTrimis", ;
		Column5.ReadOnly = .T., ;
		Column5.Sparse = .F., ;
		Column5.Width = 43, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 8, ;
		Column6.ControlSource = "data_trimis", ;
		Column6.FontShadow = .F., ;
		Column6.FontSize = 10, ;
		Column6.Name = "cDataTrimis", ;
		Column6.ReadOnly = .T., ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 11, ;
		Column7.ControlSource = "mesaj_trimis", ;
		Column7.FontShadow = .F., ;
		Column7.FontSize = 10, ;
		Column7.Name = "cMesajTrimis", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 379, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 5, ;
		Column8.ControlSource = "cod_fiscal", ;
		Column8.FontShadow = .F., ;
		Column8.FontSize = 10, ;
		Column8.Name = "cCodFiscal", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 108, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 14, ;
		Column9.ControlSource = "tip_mesaj_raspuns", ;
		Column9.FontShadow = .F., ;
		Column9.FontSize = 10, ;
		Column9.Name = "cTipMesajRaspuns", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 117, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 15, ;
		Column10.ControlSource = "mesaj_raspuns", ;
		Column10.FontShadow = .F., ;
		Column10.FontSize = 10, ;
		Column10.Name = "cMesajRaspuns", ;
		Column10.ReadOnly = .T., ;
		Column10.ToolTipText = "Dublu click pentru afisarea detaliilor", ;
		Column10.Width = 174, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 10, ;
		Column11.ControlSource = "id_incarcare", ;
		Column11.FontShadow = .F., ;
		Column11.FontSize = 10, ;
		Column11.Name = "cIdIncarcare", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 101, ;
		Column12.BackColor = 255,255,255, ;
		Column12.ColumnOrder = 13, ;
		Column12.ControlSource = "id_descarcare", ;
		Column12.FontShadow = .F., ;
		Column12.FontSize = 10, ;
		Column12.Name = "cId", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 108, ;
		Column13.BackColor = 255,255,255, ;
		Column13.ColumnOrder = 12, ;
		Column13.ControlSource = "data_raspuns", ;
		Column13.FontShadow = .F., ;
		Column13.FontSize = 10, ;
		Column13.Name = "cDataRaspuns", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 94, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ColumnOrder = 27, ;
		Column14.ControlSource = "crsFacturiEmise.test", ;
		Column14.CurrentControl = "_checkbox1", ;
		Column14.FontShadow = .F., ;
		Column14.FontSize = 10, ;
		Column14.Name = "cTest", ;
		Column14.ReadOnly = .T., ;
		Column14.Sparse = .F., ;
		Column14.Width = 31, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ColumnOrder = 9, ;
		Column15.ControlSource = "utilizator", ;
		Column15.FontShadow = .F., ;
		Column15.FontSize = 10, ;
		Column15.Name = "cUtilizator", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 153, ;
		Column16.BackColor = 255,255,255, ;
		Column16.ColumnOrder = 16, ;
		Column16.ControlSource = "xtotal_cu_tva", ;
		Column16.FontShadow = .F., ;
		Column16.FontSize = 10, ;
		Column16.Format = "RK", ;
		Column16.InputMask = "999 999 999 999.99", ;
		Column16.Name = "cxTotalCuTVA", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 83, ;
		Column17.BackColor = 255,255,255, ;
		Column17.ColumnOrder = 19, ;
		Column17.ControlSource = "jtotctva", ;
		Column17.FontShadow = .F., ;
		Column17.FontSize = 10, ;
		Column17.Format = "RK", ;
		Column17.InputMask = "999 999 999 999.99", ;
		Column17.Name = "cJtotcTVA", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 97, ;
		Column18.BackColor = 255,255,255, ;
		Column18.ColumnOrder = 20, ;
		Column18.ControlSource = "diferenta", ;
		Column18.FontShadow = .F., ;
		Column18.FontSize = 10, ;
		Column18.Format = "RK", ;
		Column18.InputMask = "999 999 999 999.99", ;
		Column18.Name = "cDiferenta", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 91, ;
		Column19.BackColor = 255,255,255, ;
		Column19.ColumnOrder = 21, ;
		Column19.ControlSource = "xvaloare_fara_tva", ;
		Column19.FontShadow = .F., ;
		Column19.FontSize = 10, ;
		Column19.Format = "RK", ;
		Column19.InputMask = "999 999 999 999.99", ;
		Column19.Name = "cxValoareFaraTVA", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 94, ;
		Column20.BackColor = 255,255,255, ;
		Column20.ColumnOrder = 22, ;
		Column20.ControlSource = "xdiscount_fara_tva", ;
		Column20.FontShadow = .F., ;
		Column20.FontSize = 10, ;
		Column20.Format = "RK", ;
		Column20.InputMask = "999 999 999 999.99", ;
		Column20.Name = "cxDiscount", ;
		Column20.ReadOnly = .T., ;
		Column20.Width = 66, ;
		Column21.BackColor = 255,255,255, ;
		Column21.ColumnOrder = 23, ;
		Column21.ControlSource = "xtaxe_fara_tva", ;
		Column21.FontShadow = .F., ;
		Column21.FontSize = 10, ;
		Column21.Name = "cxTaxe", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 59, ;
		Column22.BackColor = 255,255,255, ;
		Column22.ColumnOrder = 24, ;
		Column22.ControlSource = "xtotal_fara_tva", ;
		Column22.FontShadow = .F., ;
		Column22.FontSize = 10, ;
		Column22.Format = "RK", ;
		Column22.InputMask = "999 999 999 999.99", ;
		Column22.Name = "cxTotalFaraTVA", ;
		Column22.ReadOnly = .T., ;
		Column22.Width = 79, ;
		Column23.BackColor = 255,255,255, ;
		Column23.ColumnOrder = 25, ;
		Column23.ControlSource = "xtotal_tva", ;
		Column23.FontShadow = .F., ;
		Column23.FontSize = 10, ;
		Column23.Format = "RK", ;
		Column23.InputMask = "999 999 999 999.99", ;
		Column23.Name = "cxTotalTVA", ;
		Column23.ReadOnly = .T., ;
		Column24.BackColor = 255,255,255, ;
		Column24.ColumnOrder = 26, ;
		Column24.ControlSource = "xtotal_de_plata", ;
		Column24.FontShadow = .F., ;
		Column24.FontSize = 10, ;
		Column24.Format = "RK", ;
		Column24.InputMask = "999 999 999 999.99", ;
		Column24.Name = "cxTotalDePlata", ;
		Column24.ReadOnly = .T., ;
		Column24.Width = 79, ;
		Column25.BackColor = 255,255,255, ;
		Column25.ColumnOrder = 6, ;
		Column25.ControlSource = "IIF(nvl(crsFacturiEmise.tip_persoana,1) = 1, 'PJ', 'PF')", ;
		Column25.FontShadow = .F., ;
		Column25.FontSize = 10, ;
		Column25.Name = "cTipPersoana", ;
		Column25.ReadOnly = .T., ;
		Column26.BackColor = 255,255,255, ;
		Column26.ColumnOrder = 18, ;
		Column26.ControlSource = "in_valuta", ;
		Column26.CurrentControl = "_checkbox1", ;
		Column26.FontShadow = .F., ;
		Column26.FontSize = 10, ;
		Column26.Name = "cInValuta", ;
		Column26.ReadOnly = .T., ;
		Column26.Sparse = .F., ;
		Column26.Width = 51, ;
		Column27.BackColor = 255,255,255, ;
		Column27.ColumnOrder = 34, ;
		Column27.ControlSource = "nume_valuta", ;
		Column27.FontShadow = .F., ;
		Column27.FontSize = 10, ;
		Column27.Name = "cNumeValuta", ;
		Column27.ReadOnly = .T., ;
		Column27.Width = 41, ;
		Column28.BackColor = 255,255,255, ;
		Column28.ColumnOrder = 28, ;
		Column28.ControlSource = "total_fara_tva", ;
		Column28.FontShadow = .F., ;
		Column28.FontSize = 10, ;
		Column28.Format = "RK", ;
		Column28.InputMask = "999 999 999 999.99", ;
		Column28.Name = "cTotalFaraTVA", ;
		Column28.ReadOnly = .T., ;
		Column28.Width = 86, ;
		Column29.BackColor = 255,255,255, ;
		Column29.ColumnOrder = 29, ;
		Column29.ControlSource = "total_tva", ;
		Column29.FontShadow = .F., ;
		Column29.FontSize = 10, ;
		Column29.Format = "RK", ;
		Column29.InputMask = "999 999 999 999.99", ;
		Column29.Name = "cTotalTVA", ;
		Column29.ReadOnly = .T., ;
		Column30.BackColor = 255,255,255, ;
		Column30.ColumnOrder = 30, ;
		Column30.ControlSource = "total_cu_tva", ;
		Column30.FontShadow = .F., ;
		Column30.FontSize = 10, ;
		Column30.Format = "RK", ;
		Column30.InputMask = "999 999 999 999.99", ;
		Column30.Name = "cTotalCuTVA", ;
		Column30.ReadOnly = .T., ;
		Column31.BackColor = 255,255,255, ;
		Column31.ColumnOrder = 31, ;
		Column31.ControlSource = "valval", ;
		Column31.FontShadow = .F., ;
		Column31.FontSize = 10, ;
		Column31.Format = "RK", ;
		Column31.InputMask = "999 999 999 999.99", ;
		Column31.Name = "cValVal", ;
		Column31.ReadOnly = .T., ;
		Column31.Width = 101, ;
		Column32.BackColor = 255,255,255, ;
		Column32.ColumnOrder = 32, ;
		Column32.ControlSource = "tvaval", ;
		Column32.FontShadow = .F., ;
		Column32.FontSize = 10, ;
		Column32.Format = "RK", ;
		Column32.InputMask = "999 999 999 999.99", ;
		Column32.Name = "cTvaVal", ;
		Column32.ReadOnly = .T., ;
		Column32.Width = 75, ;
		Column33.BackColor = 255,255,255, ;
		Column33.ColumnOrder = 33, ;
		Column33.ControlSource = "totval", ;
		Column33.FontShadow = .F., ;
		Column33.FontSize = 10, ;
		Column33.Format = "RK", ;
		Column33.InputMask = "999 999 999 999.99", ;
		Column33.Name = "cTotVal", ;
		Column33.ReadOnly = .T., ;
		Column33.Width = 96, ;
		Column34.BackColor = 255,255,255, ;
		Column34.ColumnOrder = 17, ;
		Column34.ControlSource = "xnume_valuta", ;
		Column34.FontShadow = .F., ;
		Column34.FontSize = 10, ;
		Column34.Name = "cxNumeValuta", ;
		Column34.ReadOnly = .T., ;
		Column34.Width = 53, ;
		Column35.BackColor = 255,255,255, ;
		Column35.ControlSource = "curs", ;
		Column35.FontShadow = .F., ;
		Column35.FontSize = 10, ;
		Column35.Name = "cCurs", ;
		Column35.ReadOnly = .T., ;
		Column35.Width = 69, ;
		Column36.BackColor = 255,255,255, ;
		Column36.ControlSource = "crsFacturiEmise.creditnote", ;
		Column36.CurrentControl = "_checkbox1", ;
		Column36.FontShadow = .F., ;
		Column36.FontSize = 10, ;
		Column36.Name = "cCreditNote", ;
		Column36.ReadOnly = .T., ;
		Column36.Sparse = .F.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.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 'pgfeFactura.Page1.grdFacturiEmise.cClient.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Client", ;
		FontName = "Arial", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cCreditNote._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "crsFacturiEmise.creditnote", ;
		Left = 46, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cCreditNote.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "CreditNote", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cCreditNote.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cCurs.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 'pgfeFactura.Page1.grdFacturiEmise.cData.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data fact. ", ;
		FontName = "Arial", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cDataRaspuns.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data raspuns", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cDiferenta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Diferenta fata de Reg. Vanzari", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cDiferenta.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 'pgfeFactura.Page1.grdFacturiEmise.cId.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id descarcare", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cIdIncarcare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id incarcare", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cInValuta._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Left = 32, ;
		Name = "_checkbox1", ;
		Top = 75
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cInValuta.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 'pgfeFactura.Page1.grdFacturiEmise.cJtotcTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare cu TVA Reg. Vanzari", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cJtotcTVA.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 'pgfeFactura.Page1.grdFacturiEmise.cMesajRaspuns.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Mesaj raspuns", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cMesajTrimis.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Mesaj trimitere", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cNr.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. fact.", ;
		FontName = "Arial", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cNumeValuta.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 'pgfeFactura.Page1.grdFacturiEmise.cTest._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "test", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Left = 44, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 39
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTest.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Test", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTest.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 'pgfeFactura.Page1.grdFacturiEmise.cTipMesajRaspuns.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip mesaj raspuns", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTipPersoana.Header1' AS header WITH ;
		Caption = "Tip persoana", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTipPersoana.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 'pgfeFactura.Page1.grdFacturiEmise.cTotalCuTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total cu TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTotalCuTVA.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 'pgfeFactura.Page1.grdFacturiEmise.cTotalFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTotalFaraTVA.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 'pgfeFactura.Page1.grdFacturiEmise.cTotalTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTotalTVA.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 'pgfeFactura.Page1.grdFacturiEmise.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 'pgfeFactura.Page1.grdFacturiEmise.cTotVal.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 'pgfeFactura.Page1.grdFacturiEmise.cTrimis._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "trimis", ;
		FontShadow = .F., ;
		FontSize = 10, ;
		Left = 50, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.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 'pgfeFactura.Page1.grdFacturiEmise.cTvaVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare TVA in valuta", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cTvaVal.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 'pgfeFactura.Page1.grdFacturiEmise.cUtilizator.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Utilizator trimis", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cUtilizator.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 'pgfeFactura.Page1.grdFacturiEmise.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 'pgfeFactura.Page1.grdFacturiEmise.cValVal.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 'pgfeFactura.Page1.grdFacturiEmise.cxDiscount.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxDiscount.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 'pgfeFactura.Page1.grdFacturiEmise.cxNumeValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valuta xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxNumeValuta.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxTaxe.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Taxe xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxTaxe.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 'pgfeFactura.Page1.grdFacturiEmise.cxTotalCuTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total cu TVA xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxTotalCuTVA.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 'pgfeFactura.Page1.grdFacturiEmise.cxTotalDePlata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total de Plata xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxTotalDePlata.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 'pgfeFactura.Page1.grdFacturiEmise.cxTotalFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total fara TVA xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxTotalFaraTVA.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 'pgfeFactura.Page1.grdFacturiEmise.cxTotalTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxTotalTVA.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 'pgfeFactura.Page1.grdFacturiEmise.cxValoareFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA xml", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page1.grdFacturiEmise.cxValoareFaraTVA.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 'pgfeFactura.Page1.Gridextra1' AS gridextra WITH ;
		allowgridpreferences = .F., ;
		gridexpression = thisform.pgfeFactura.page1.grdFacturiEmise, ;
		Left = 748, ;
		Name = "Gridextra1", ;
		productname = ROA2, ;
		Top = 97
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'pgfeFactura.Page1.Gridextra2' AS gridextra WITH ;
		gridexpression = thisform.pgfeFactura.page1.grdDetaliiFacturi, ;
		Left = 767, ;
		Name = "Gridextra2", ;
		productname = ROA2, ;
		Top = 277
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'pgfeFactura.Page1.lblAtasamente' AS _label WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "Director atasamente", ;
		Height = 18, ;
		Left = 285, ;
		Name = "lblAtasamente", ;
		Top = 381, ;
		Width = 243
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page1.lblDetalii' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Detalii raspuns", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 383, ;
		Name = "lblDetalii", ;
		Top = 300, ;
		Width = 96, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page1.lblMesajRaspuns' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Mesaj raspuns", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 13, ;
		Name = "lblMesajRaspuns", ;
		Top = 352, ;
		Width = 92, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page1.lblMesajTrimis' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Mesaj trimitere", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 13, ;
		Name = "lblMesajTrimis", ;
		Top = 325, ;
		Width = 97, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page1.txtMesajRaspuns' AS _textbox WITH ;
		Anchor = 6, ;
		ControlSource = "crsFacturiEmise.mesaj_raspuns", ;
		Height = 23, ;
		Left = 117, ;
		Name = "txtMesajRaspuns", ;
		ReadOnly = .T., ;
		Top = 350, ;
		Width = 260, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page1.txtMesajTrimis' AS _textbox WITH ;
		Anchor = 6, ;
		ControlSource = "crsFacturiEmise.mesaj_trimis", ;
		Height = 23, ;
		Left = 117, ;
		Name = "txtMesajTrimis", ;
		ReadOnly = .T., ;
		Top = 323, ;
		Width = 260, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2._grdfooter1' AS _grdfooter WITH ;
		Anchor = 14, ;
		ccolwithlabel = cXFurnizor, ;
		csourcegrid = grdFacturiPrimite, ;
		csumcolumns = cValoarefaraTVA,cDiscount,cTaxe,cTotaldePlata,cTotalFaraTVA,cTotalTVA,cTotalcuTVA,cJtotcTVA,cDiferenta, ;
		ctotallabelexpression = 'Total', ;
		Left = 4, ;
		Name = "_grdfooter1", ;
		Top = 113, ;
		Width = 780
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgfeFactura.Page2._SHAPE1' AS _shape WITH ;
		Anchor = 14, ;
		BackStyle = 0, ;
		FillColor = 255,255,240, ;
		FillStyle = 0, ;
		Height = 94, ;
		Left = 4, ;
		Name = "_SHAPE1", ;
		Top = 317, ;
		Width = 780, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'pgfeFactura.Page2.chkDiferente' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 100,255,255, ;
		BackStyle = 1, ;
		Caption = "Cu diferente Reg. Cumparari", ;
		Height = 25, ;
		Left = 7, ;
		Name = "chkDiferente", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 205
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page2.chkLipsaRegistru' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 225,225,225, ;
		BackStyle = 1, ;
		Caption = "Lipsa din Reg. Cumparari", ;
		Height = 25, ;
		Left = 217, ;
		Name = "chkLipsaRegistru", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 190
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page2.cmdTrimiteMesajFurnizor' AS cmd_executa WITH ;
		Anchor = 6, ;
		AutoSize = .F., ;
		Caption = "\<Trimite mesaj", ;
		ForeColor = 0,64,128, ;
		Height = 27, ;
		Left = 272, ;
		Name = "cmdTrimiteMesajFurnizor", ;
		ToolTipText = "Trimite mesaj furnizorului in SPV pentru factura curenta", ;
		Top = 337, ;
		Visible = .T., ;
		Width = 96, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pgfeFactura.Page2.edtDetalii' AS _editbox WITH ;
		Anchor = 14, ;
		ControlSource = "crsFacturiPrimite.detalii", ;
		Height = 66, ;
		Left = 383, ;
		Name = "edtDetalii", ;
		ReadOnly = .T., ;
		Top = 340, ;
		Width = 398, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi' AS _grdbase WITH ;
		Anchor = 14, ;
		BackColor = 255,255,255, ;
		ColumnCount = 10, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 35, ;
		Height = 131, ;
		lcamptextneeditabil = .F., ;
		Left = 4, ;
		Name = "grdDetaliiFacturi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsdetaliifacturi", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 183, ;
		Width = 780, ;
		ZOrderSet = 1, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ControlSource = "crsdetaliifacturi.nr", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 37, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ControlSource = "crsdetaliifacturi.articol", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 146, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 10, ;
		Column3.ControlSource = "crsdetaliifacturi.detalii", ;
		Column3.CurrentControl = "_editbox1", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 189, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 3, ;
		Column4.ControlSource = "crsdetaliifacturi.cantitate", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 56, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "crsdetaliifacturi.um", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 40, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "crsdetaliifacturi.pret", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 75, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "crsdetaliifacturi.proctva", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 45, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "crsdetaliifacturi.descriere", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 162, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 6, ;
		Column9.ControlSource = "crsdetaliifacturi.valoarefaratva", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 102, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 7, ;
		Column10.ControlSource = "crsdetaliifacturi.discountfaratva", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 109
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column10.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 'pgfeFactura.Page2.grdDetaliiFacturi.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Articol", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column3._editbox1' AS _editbox WITH ;
		FontSize = 10, ;
		Left = 37, ;
		Name = "_editbox1", ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Detalii", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column3.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 'pgfeFactura.Page2.grdDetaliiFacturi.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cantitate", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "UM", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret unitar", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "% TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descriere", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column8.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdDetaliiFacturi.Column9.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite' AS _grdbase WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 30, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 37, ;
		Height = 112, ;
		lcamptextneeditabil = .F., ;
		Left = 4, ;
		Name = "grdFacturiPrimite", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsFacturiPrimite", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 0, ;
		Width = 780, ;
		ZOrderSet = 1, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "crsFacturiPrimite.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 = "numar_act", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cNr", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 86, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "data_act", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cData", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 69, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 18, ;
		Column4.ControlSource = "data_raspuns", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cDataTrimis", ;
		Column4.ReadOnly = .T., ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "cod_fiscal_emitent", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cCodFiscalEmitent", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 108, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 20, ;
		Column6.ControlSource = "tip_mesaj_raspuns", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cTipMesajRaspuns", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 130, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 19, ;
		Column7.ControlSource = "id_descarcare", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cIdDescarcare", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 111, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 14, ;
		Column8.ControlSource = "total_cu_tva", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "RK", ;
		Column8.InputMask = "999 999 999 999.99", ;
		Column8.Name = "cTotalCuTVA", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 104, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 17, ;
		Column9.ControlSource = "nume_valuta", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cNumeValuta", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 38, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 15, ;
		Column10.ControlSource = "jtotctva", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Format = "RK", ;
		Column10.InputMask = "999 999 999 999.99", ;
		Column10.Name = "cJtotcTVA", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 99, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 4, ;
		Column11.ControlSource = "data_scad", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cDataScad", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 88, ;
		Column12.BackColor = 255,255,255, ;
		Column12.ColumnOrder = 21, ;
		Column12.ControlSource = "descriere", ;
		Column12.CurrentControl = "_editbox1", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cDescriere", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 160, ;
		Column13.BackColor = 255,255,255, ;
		Column13.ColumnOrder = 11, ;
		Column13.ControlSource = "total_fara_tva", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "RK", ;
		Column13.InputMask = "999 999 999 999.99", ;
		Column13.Name = "cTotalFaraTVA", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 102, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ColumnOrder = 12, ;
		Column14.ControlSource = "total_tva", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Format = "RK", ;
		Column14.InputMask = "999 999 999 999.99", ;
		Column14.Name = "cTotalTVA", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 105, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ColumnOrder = 5, ;
		Column15.ControlSource = "xfurnizor", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cXFurnizor", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 180, ;
		Column16.BackColor = 255,255,255, ;
		Column16.ColumnOrder = 8, ;
		Column16.ControlSource = "discount_fara_tva", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Format = "RK", ;
		Column16.InputMask = "999 999 999 999.99", ;
		Column16.Name = "cDiscount", ;
		Column16.ReadOnly = .T., ;
		Column17.BackColor = 255,255,255, ;
		Column17.ColumnOrder = 9, ;
		Column17.ControlSource = "taxe_fara_tva", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Format = "RK", ;
		Column17.InputMask = "999 999 999 999.99", ;
		Column17.Name = "cTaxe", ;
		Column17.ReadOnly = .T., ;
		Column18.BackColor = 255,255,255, ;
		Column18.ColumnOrder = 7, ;
		Column18.ControlSource = "valoare_fara_tva", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Format = "RK", ;
		Column18.InputMask = "999 999 999 999.99", ;
		Column18.Name = "cValoareFaraTVA", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 102, ;
		Column19.BackColor = 255,255,255, ;
		Column19.ColumnOrder = 10, ;
		Column19.ControlSource = "total_de_plata", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Format = "RK", ;
		Column19.InputMask = "999 999 999 999.99", ;
		Column19.Name = "cTotaldePlata", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 106, ;
		Column20.BackColor = 255,255,255, ;
		Column20.ColumnOrder = 23, ;
		Column20.ControlSource = "id", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cId", ;
		Column20.ReadOnly = .T., ;
		Column21.BackColor = 255,255,255, ;
		Column21.ColumnOrder = 22, ;
		Column21.ControlSource = "detalii_plata", ;
		Column21.CurrentControl = "_editbox1", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cDetaliiPlata", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 145, ;
		Column22.BackColor = 255,255,255, ;
		Column22.ColumnOrder = 16, ;
		Column22.ControlSource = "diferenta", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Format = "RK", ;
		Column22.InputMask = "999 999 999 999.99", ;
		Column22.Name = "cDiferenta", ;
		Column22.ReadOnly = .T., ;
		Column22.Width = 94, ;
		Column23.BackColor = 255,255,255, ;
		Column23.ColumnOrder = 24, ;
		Column23.ControlSource = "id_incarcare", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cIdIncarcare", ;
		Column23.ReadOnly = .T., ;
		Column23.Width = 105, ;
		Column24.BackColor = 255,255,255, ;
		Column24.ColumnOrder = 26, ;
		Column24.ControlSource = "crsFacturiPrimite.procesat", ;
		Column24.CurrentControl = "_CHECKBOX1", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cProcesat", ;
		Column24.ReadOnly = .T., ;
		Column24.Sparse = .F., ;
		Column25.BackColor = 255,255,255, ;
		Column25.ColumnOrder = 27, ;
		Column25.ControlSource = "crsFacturiPrimite.descarcat", ;
		Column25.CurrentControl = "_checkbox1", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cDescarcat", ;
		Column25.ReadOnly = .T., ;
		Column25.Sparse = .F., ;
		Column26.BackColor = 255,255,255, ;
		Column26.ColumnOrder = 25, ;
		Column26.ControlSource = "crsFacturiPrimite.xclient", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cXClient", ;
		Column26.ReadOnly = .T., ;
		Column26.Width = 137, ;
		Column27.BackColor = 255,255,255, ;
		Column27.ColumnOrder = 29, ;
		Column27.ControlSource = "crsFacturiPrimite.filepath", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.Name = "cFilePath", ;
		Column27.ReadOnly = .T., ;
		Column27.Width = 269, ;
		Column28.BackColor = 255,255,255, ;
		Column28.ColumnOrder = 13, ;
		Column28.ControlSource = "total_tva_ron", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.Format = "R", ;
		Column28.InputMask = "999 999 999 999.99", ;
		Column28.Name = "cTotalTVARON", ;
		Column28.ReadOnly = .T., ;
		Column28.Width = 93, ;
		Column29.BackColor = 255,255,255, ;
		Column29.ColumnOrder = 28, ;
		Column29.ControlSource = "crsFacturiPrimite.procesat_server", ;
		Column29.CurrentControl = "_CHECKBOX1", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.Name = "cProcesatServer", ;
		Column29.ReadOnly = .T., ;
		Column29.Sparse = .F., ;
		Column30.Alignment = 2, ;
		Column30.BackColor = 255,255,255, ;
		Column30.ControlSource = "crsFacturiPrimite.creditnote", ;
		Column30.CurrentControl = "_checkbox1", ;
		Column30.FontName = "Arial", ;
		Column30.FontSize = 10, ;
		Column30.Name = "cCreditNote", ;
		Column30.ReadOnly = .T., ;
		Column30.Sparse = .F.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.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 'pgfeFactura.Page2.grdFacturiPrimite.cCodFiscalEmitent.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod fiscal", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cCodFiscalEmitent.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 'pgfeFactura.Page2.grdFacturiPrimite.cCreditNote._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 32, ;
		Name = "_checkbox1", ;
		Top = 75
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cCreditNote.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "CreditNote", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cCreditNote.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 'pgfeFactura.Page2.grdFacturiPrimite.cData.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data fact. ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cData.Text1' AS textbox WITH ;
		Alignment = 3, ;
		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 'pgfeFactura.Page2.grdFacturiPrimite.cDataScad.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data scadenta", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDataScad.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 'pgfeFactura.Page2.grdFacturiPrimite.cDataTrimis.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data primit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDataTrimis.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 'pgfeFactura.Page2.grdFacturiPrimite.cDescarcat._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 44, ;
		Name = "_checkbox1", ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDescarcat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descarcat server", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDescarcat.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 'pgfeFactura.Page2.grdFacturiPrimite.cDescriere._editbox1' AS _editbox WITH ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		Left = 34, ;
		Name = "_editbox1", ;
		SpecialEffect = 1, ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDescriere.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descriere", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDescriere.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 'pgfeFactura.Page2.grdFacturiPrimite.cDetaliiPlata._editbox1' AS _editbox WITH ;
		FontSize = 10, ;
		Left = 48, ;
		Name = "_editbox1", ;
		ReadOnly = .T., ;
		Top = 75
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDetaliiPlata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Detalii plata", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDetaliiPlata.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 'pgfeFactura.Page2.grdFacturiPrimite.cDiferenta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Diferenta fata de Reg. Cumparari", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDiferenta.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cDiscount.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cFilePath.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fisier", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cFilePath.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 'pgfeFactura.Page2.grdFacturiPrimite.cId.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cId.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 'pgfeFactura.Page2.grdFacturiPrimite.cIdDescarcare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id descarcare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cIdDescarcare.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 'pgfeFactura.Page2.grdFacturiPrimite.cIdIncarcare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id incarcare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cIdIncarcare.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 'pgfeFactura.Page2.grdFacturiPrimite.cJtotcTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare cu TVA Reg. Cumparari", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cJtotcTVA.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cNr.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. fact.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cNr.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 'pgfeFactura.Page2.grdFacturiPrimite.cNumeValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cNumeValuta.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 'pgfeFactura.Page2.grdFacturiPrimite.cProcesat._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 48, ;
		Name = "_CHECKBOX1", ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cProcesat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Actualizat baza date", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cProcesat.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 'pgfeFactura.Page2.grdFacturiPrimite.cProcesatServer._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "crsFacturiPrimite.procesat_server", ;
		Left = 44, ;
		Name = "_CHECKBOX1", ;
		Top = 75
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cProcesatServer.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Copiat server/retea", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cProcesatServer.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTaxe.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Taxe", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTaxe.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTipMesajRaspuns.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip mesaj raspuns", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTipMesajRaspuns.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 'pgfeFactura.Page2.grdFacturiPrimite.cTotalCuTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTotalCuTVA.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 'pgfeFactura.Page2.grdFacturiPrimite.cTotaldePlata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total de plata", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTotaldePlata.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTotalFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTotalFaraTVA.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 'pgfeFactura.Page2.grdFacturiPrimite.cTotalTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTotalTVA.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 'pgfeFactura.Page2.grdFacturiPrimite.cTotalTVARON.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA RON", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cTotalTVARON.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 'pgfeFactura.Page2.grdFacturiPrimite.cValoareFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cValoareFaraTVA.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cXClient.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 'pgfeFactura.Page2.grdFacturiPrimite.cXFurnizor.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Furnizor", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page2.grdFacturiPrimite.cXFurnizor.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 'pgfeFactura.Page2.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform.pgfeFactura.page2.grdFacturiPrimite, ;
		Left = 768, ;
		Name = "Gridextra1", ;
		productname = ROA2, ;
		Top = 114
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'pgfeFactura.Page2.Gridextra2' AS gridextra WITH ;
		gridexpression = thisform.pgfeFactura.page2.grdDetaliiFacturi, ;
		Left = 767, ;
		Name = "Gridextra2", ;
		productname = ROA2, ;
		Top = 280
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'pgfeFactura.Page2.lblDetalii' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Detalii raspuns", ;
		FontBold = .T., ;
		Left = 384, ;
		Name = "lblDetalii", ;
		Top = 322, ;
		ZOrderSet = 3
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page2.lblMesajRaspuns' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Mesaj raspuns", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 11, ;
		Name = "lblMesajRaspuns", ;
		Top = 366, ;
		Width = 92, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page2.txtMesajFurnizor' AS _textbox WITH ;
		Anchor = 6, ;
		ControlSource = "thisform.cMesajFurnizor", ;
		Height = 23, ;
		Left = 12, ;
		Name = "txtMesajFurnizor", ;
		ReadOnly = .F., ;
		Top = 339, ;
		Width = 257, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page2.txtMesajRaspuns' AS _textbox WITH ;
		Anchor = 6, ;
		ControlSource = "crsFacturiPrimite.mesaj_raspuns", ;
		Height = 23, ;
		Left = 107, ;
		Name = "txtMesajRaspuns", ;
		ReadOnly = .T., ;
		Top = 364, ;
		Width = 260, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3._grdfooter1' AS _grdfooter WITH ;
		Anchor = 14, ;
		ccolwithlabel = cXClient, ;
		csourcegrid = grdFacturiTrimise, ;
		csumcolumns = cValoarefaraTVA,cDiscount,cTaxe,cTotaldePlata,cTotalFaraTVA,cTotalTVA,cTotalcuTVA,cJtotcTVA,cDiferenta, ;
		ctotallabelexpression = 'Total', ;
		Left = 4, ;
		Name = "_grdfooter1", ;
		Top = 113, ;
		Width = 780
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgfeFactura.Page3._SHAPE1' AS _shape WITH ;
		Anchor = 14, ;
		BackStyle = 0, ;
		FillColor = 255,255,240, ;
		FillStyle = 0, ;
		Height = 94, ;
		Left = 4, ;
		Name = "_SHAPE1", ;
		Top = 317, ;
		Width = 780, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'pgfeFactura.Page3.chkDiferente' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 100,255,255, ;
		BackStyle = 1, ;
		Caption = "Cu diferente Reg. Vanzari", ;
		Height = 25, ;
		Left = 7, ;
		Name = "chkDiferente", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 205
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page3.chkLipsaRegistru' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 6, ;
		AutoSize = .F., ;
		BackColor = 225,225,225, ;
		BackStyle = 1, ;
		Caption = "Lipsa din Reg. Vanzari", ;
		Height = 25, ;
		Left = 217, ;
		Name = "chkLipsaRegistru", ;
		Style = 0, ;
		Top = 151, ;
		Value = .F., ;
		Width = 190
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page3.edtDetalii' AS _editbox WITH ;
		Anchor = 14, ;
		ControlSource = "crsFacturiTrimise.detalii", ;
		Height = 67, ;
		Left = 383, ;
		Name = "edtDetalii", ;
		ReadOnly = .T., ;
		Top = 340, ;
		Width = 398, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi' AS _grdbase WITH ;
		Anchor = 14, ;
		BackColor = 255,255,255, ;
		ColumnCount = 10, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 35, ;
		Height = 131, ;
		lcamptextneeditabil = .F., ;
		Left = 4, ;
		Name = "grdDetaliiFacturi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsdetaliifacturi", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 183, ;
		Width = 780, ;
		ZOrderSet = 1, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ControlSource = "crsdetaliifacturi.nr", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 37, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ControlSource = "crsdetaliifacturi.articol", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 146, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 10, ;
		Column3.ControlSource = "crsdetaliifacturi.detalii", ;
		Column3.CurrentControl = "_editbox1", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 189, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 3, ;
		Column4.ControlSource = "crsdetaliifacturi.cantitate", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 56, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "crsdetaliifacturi.um", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 40, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "crsdetaliifacturi.pret", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 75, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "crsdetaliifacturi.proctva", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 45, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "crsdetaliifacturi.descriere", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 162, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 6, ;
		Column9.ControlSource = "crsdetaliifacturi.valoarefaratva", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 102, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 7, ;
		Column10.ControlSource = "crsdetaliifacturi.discountfaratva", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 109
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column10.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 'pgfeFactura.Page3.grdDetaliiFacturi.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Articol", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column3._editbox1' AS _editbox WITH ;
		FontSize = 10, ;
		Left = 37, ;
		Name = "_editbox1", ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Detalii", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column3.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 'pgfeFactura.Page3.grdDetaliiFacturi.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cantitate", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "UM", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret unitar", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "% TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descriere", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column8.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdDetaliiFacturi.Column9.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 'pgfeFactura.Page3.grdFacturiTrimise' AS _grdbase WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 31, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 37, ;
		Height = 112, ;
		lcamptextneeditabil = .F., ;
		Left = 4, ;
		Name = "grdFacturiTrimise", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsFacturiTrimise", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 0, ;
		Width = 780, ;
		ZOrderSet = 1, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "crsFacturiTrimise.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 = "numar_act", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cNr", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 86, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "data_act", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cData", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 69, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 18, ;
		Column4.ControlSource = "data_raspuns", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cDataTrimis", ;
		Column4.ReadOnly = .T., ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "cod_fiscal_beneficiar", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cCodFiscalBeneficiar", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 108, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 20, ;
		Column6.ControlSource = "tip_mesaj_raspuns", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cTipMesajRaspuns", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 130, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 19, ;
		Column7.ControlSource = "id_descarcare", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cIdDescarcare", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 111, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 14, ;
		Column8.ControlSource = "total_cu_tva", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "RK", ;
		Column8.InputMask = "999 999 999 999.99", ;
		Column8.Name = "cTotalCuTVA", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 104, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 17, ;
		Column9.ControlSource = "nume_valuta", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cNumeValuta", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 38, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 15, ;
		Column10.ControlSource = "jtotctva", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Format = "RK", ;
		Column10.InputMask = "999 999 999 999.99", ;
		Column10.Name = "cJtotcTVA", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 99, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 4, ;
		Column11.ControlSource = "data_scad", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cDataScad", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 88, ;
		Column12.BackColor = 255,255,255, ;
		Column12.ColumnOrder = 21, ;
		Column12.ControlSource = "descriere", ;
		Column12.CurrentControl = "_editbox1", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cDescriere", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 160, ;
		Column13.BackColor = 255,255,255, ;
		Column13.ColumnOrder = 11, ;
		Column13.ControlSource = "total_fara_tva", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "RK", ;
		Column13.InputMask = "999 999 999 999.99", ;
		Column13.Name = "cTotalFaraTVA", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 102, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ColumnOrder = 12, ;
		Column14.ControlSource = "total_tva", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Format = "RK", ;
		Column14.InputMask = "999 999 999 999.99", ;
		Column14.Name = "cTotalTVA", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 105, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ColumnOrder = 5, ;
		Column15.ControlSource = "xclient", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cXClient", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 180, ;
		Column16.BackColor = 255,255,255, ;
		Column16.ColumnOrder = 8, ;
		Column16.ControlSource = "discount_fara_tva", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Format = "RK", ;
		Column16.InputMask = "999 999 999 999.99", ;
		Column16.Name = "cDiscount", ;
		Column16.ReadOnly = .T., ;
		Column17.BackColor = 255,255,255, ;
		Column17.ColumnOrder = 9, ;
		Column17.ControlSource = "taxe_fara_tva", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Format = "RK", ;
		Column17.InputMask = "999 999 999 999.99", ;
		Column17.Name = "cTaxe", ;
		Column17.ReadOnly = .T., ;
		Column18.BackColor = 255,255,255, ;
		Column18.ColumnOrder = 7, ;
		Column18.ControlSource = "valoare_fara_tva", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Format = "RK", ;
		Column18.InputMask = "999 999 999 999.99", ;
		Column18.Name = "cValoareFaraTVA", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 102, ;
		Column19.BackColor = 255,255,255, ;
		Column19.ColumnOrder = 10, ;
		Column19.ControlSource = "total_de_plata", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Format = "RK", ;
		Column19.InputMask = "999 999 999 999.99", ;
		Column19.Name = "cTotaldePlata", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 106, ;
		Column20.BackColor = 255,255,255, ;
		Column20.ColumnOrder = 23, ;
		Column20.ControlSource = "id", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cId", ;
		Column20.ReadOnly = .T., ;
		Column21.BackColor = 255,255,255, ;
		Column21.ColumnOrder = 22, ;
		Column21.ControlSource = "detalii_plata", ;
		Column21.CurrentControl = "_editbox1", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cDetaliiPlata", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 145, ;
		Column22.BackColor = 255,255,255, ;
		Column22.ColumnOrder = 16, ;
		Column22.ControlSource = "diferenta", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Format = "RK", ;
		Column22.InputMask = "999 999 999 999.99", ;
		Column22.Name = "cDiferenta", ;
		Column22.ReadOnly = .T., ;
		Column22.Width = 94, ;
		Column23.BackColor = 255,255,255, ;
		Column23.ColumnOrder = 24, ;
		Column23.ControlSource = "crsFacturiTrimise.test", ;
		Column23.CurrentControl = "_CHECKBOX1", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cTest", ;
		Column23.ReadOnly = .T., ;
		Column23.Sparse = .F., ;
		Column23.Width = 41, ;
		Column24.BackColor = 255,255,255, ;
		Column24.ColumnOrder = 25, ;
		Column24.ControlSource = "crsFacturiTrimise.id_incarcare", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cIdIncarcare", ;
		Column24.ReadOnly = .T., ;
		Column24.Width = 118, ;
		Column25.BackColor = 255,255,255, ;
		Column25.ColumnOrder = 27, ;
		Column25.ControlSource = "crsFacturiTrimise.procesat", ;
		Column25.CurrentControl = "_CHECKBOX1", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cProcesat", ;
		Column25.ReadOnly = .T., ;
		Column25.Sparse = .F., ;
		Column25.Width = 58, ;
		Column26.BackColor = 255,255,255, ;
		Column26.ColumnOrder = 26, ;
		Column26.ControlSource = "crsFacturiTrimise.xfurnizor", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cxFurnizor", ;
		Column26.ReadOnly = .T., ;
		Column26.Width = 147, ;
		Column27.BackColor = 255,255,255, ;
		Column27.ColumnOrder = 28, ;
		Column27.ControlSource = "crsFacturiTrimise.descarcat", ;
		Column27.CurrentControl = "_checkbox1", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.Name = "cDescarcat", ;
		Column27.ReadOnly = .T., ;
		Column27.Sparse = .F., ;
		Column28.BackColor = 255,255,255, ;
		Column28.ColumnOrder = 30, ;
		Column28.ControlSource = "crsFacturiTrimise.filepath", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.Name = "cFilePath", ;
		Column28.ReadOnly = .T., ;
		Column28.Width = 306, ;
		Column29.BackColor = 255,255,255, ;
		Column29.ColumnOrder = 13, ;
		Column29.ControlSource = "total_tva_ron", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.Format = "R", ;
		Column29.InputMask = "999 999 999 999.99", ;
		Column29.Name = "cTotalTVARON", ;
		Column29.ReadOnly = .T., ;
		Column29.Width = 93, ;
		Column30.BackColor = 255,255,255, ;
		Column30.ColumnOrder = 29, ;
		Column30.ControlSource = "crsFacturiTrimise.procesat_server", ;
		Column30.CurrentControl = "_CHECKBOX1", ;
		Column30.FontName = "Arial", ;
		Column30.FontSize = 10, ;
		Column30.Name = "cProcesatServer", ;
		Column30.ReadOnly = .T., ;
		Column30.Sparse = .F., ;
		Column31.BackColor = 255,255,255, ;
		Column31.ControlSource = "crsFacturiTrimise.creditnote", ;
		Column31.CurrentControl = "_checkbox1", ;
		Column31.FontName = "Arial", ;
		Column31.FontSize = 10, ;
		Column31.Name = "cCreditNote", ;
		Column31.ReadOnly = .T., ;
		Column31.Sparse = .F., ;
		Column31.Width = 66
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.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 'pgfeFactura.Page3.grdFacturiTrimise.cCodFiscalBeneficiar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod fiscal", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cCodFiscalBeneficiar.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 'pgfeFactura.Page3.grdFacturiTrimise.cCreditNote._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "crsFacturiTrimise.creditnote", ;
		FontSize = 10, ;
		Left = 38, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 51
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cCreditNote.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Credit Note", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cCreditNote.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 'pgfeFactura.Page3.grdFacturiTrimise.cData.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data fact. ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cData.Text1' AS textbox WITH ;
		Alignment = 3, ;
		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 'pgfeFactura.Page3.grdFacturiTrimise.cDataScad.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data scadenta", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDataScad.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 'pgfeFactura.Page3.grdFacturiTrimise.cDataTrimis.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data primit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDataTrimis.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 'pgfeFactura.Page3.grdFacturiTrimise.cDescarcat._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 48, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDescarcat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descarcat server", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDescarcat.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDescriere._editbox1' AS _editbox WITH ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		Left = 34, ;
		Name = "_editbox1", ;
		SpecialEffect = 1, ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDescriere.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descriere", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDescriere.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 'pgfeFactura.Page3.grdFacturiTrimise.cDetaliiPlata._editbox1' AS _editbox WITH ;
		FontSize = 10, ;
		Left = 48, ;
		Name = "_editbox1", ;
		ReadOnly = .T., ;
		Top = 75
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDetaliiPlata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Detalii plata", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDetaliiPlata.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 'pgfeFactura.Page3.grdFacturiTrimise.cDiferenta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Diferenta fata de Reg. Vanzari", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDiferenta.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cDiscount.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cFilePath.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fisier", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cFilePath.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 'pgfeFactura.Page3.grdFacturiTrimise.cId.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cId.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 'pgfeFactura.Page3.grdFacturiTrimise.cIdDescarcare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id descarcare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cIdDescarcare.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 'pgfeFactura.Page3.grdFacturiTrimise.cIdIncarcare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id incarcare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cIdIncarcare.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 'pgfeFactura.Page3.grdFacturiTrimise.cJtotcTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare cu TVA Reg. Vanzari", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cJtotcTVA.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cNr.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. fact.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cNr.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 'pgfeFactura.Page3.grdFacturiTrimise.cNumeValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cNumeValuta.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 'pgfeFactura.Page3.grdFacturiTrimise.cProcesat._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 53, ;
		Name = "_CHECKBOX1", ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cProcesat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Actualizat baza date", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cProcesat.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 'pgfeFactura.Page3.grdFacturiTrimise.cProcesatServer._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "crsFacturiTrimise.procesat_server", ;
		FontSize = 10, ;
		Left = 50, ;
		Name = "_CHECKBOX1", ;
		ReadOnly = .T., ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cProcesatServer.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Copiat server/retea", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cProcesatServer.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTaxe.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Taxe", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTaxe.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTest._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 42, ;
		Name = "_CHECKBOX1", ;
		Top = 75
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTest.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Test", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTest.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 'pgfeFactura.Page3.grdFacturiTrimise.cTipMesajRaspuns.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip mesaj raspuns", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTipMesajRaspuns.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 'pgfeFactura.Page3.grdFacturiTrimise.cTotalCuTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTotalCuTVA.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 'pgfeFactura.Page3.grdFacturiTrimise.cTotaldePlata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total de plata", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTotaldePlata.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTotalFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTotalFaraTVA.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 'pgfeFactura.Page3.grdFacturiTrimise.cTotalTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTotalTVA.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 'pgfeFactura.Page3.grdFacturiTrimise.cTotalTVARON.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA RON", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cTotalTVARON.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 'pgfeFactura.Page3.grdFacturiTrimise.cValoareFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cValoareFaraTVA.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cXClient.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 'pgfeFactura.Page3.grdFacturiTrimise.cxFurnizor.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Furnizor", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgfeFactura.Page3.grdFacturiTrimise.cxFurnizor.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 'pgfeFactura.Page3.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform.pgfeFactura.page3.grdFacturiTrimise, ;
		Left = 767, ;
		Name = "Gridextra1", ;
		productname = ROA2, ;
		Top = 106
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'pgfeFactura.Page3.Gridextra2' AS gridextra WITH ;
		gridexpression = thisform.pgfeFactura.page3.grdDetaliiFacturi, ;
		Left = 766, ;
		Name = "Gridextra2", ;
		productname = ROA2, ;
		Top = 293
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'pgfeFactura.Page3.lblDetalii' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Detalii raspuns", ;
		FontBold = .T., ;
		Left = 384, ;
		Name = "lblDetalii", ;
		Top = 322, ;
		ZOrderSet = 3
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page3.lblMesajRaspuns' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Mesaj raspuns", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 11, ;
		Name = "lblMesajRaspuns", ;
		Top = 366, ;
		Width = 92, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page3.lblMesajTrimis' AS _label WITH ;
		Anchor = 6, ;
		Caption = "Mesaj trimitere", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 11, ;
		Name = "lblMesajTrimis", ;
		Top = 340, ;
		Width = 97, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page3.txtMesajRaspuns' AS _textbox WITH ;
		Anchor = 6, ;
		ControlSource = "crsFacturiTrimise.mesaj_raspuns", ;
		Height = 23, ;
		Left = 107, ;
		Name = "txtMesajRaspuns", ;
		ReadOnly = .T., ;
		Top = 364, ;
		Width = 271, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page3.txtMesajTrimis' AS _textbox WITH ;
		Anchor = 6, ;
		ControlSource = "crsFacturiTrimise.mesaj_trimis", ;
		Height = 23, ;
		Left = 107, ;
		Name = "txtMesajTrimis", ;
		ReadOnly = .T., ;
		Top = 338, ;
		Width = 271, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Salvare zip eFactura in baza de date", ;
		ControlSource = "m.gnEFACTURA_ZIP_DATABASE", ;
		Enabled = .F., ;
		FontBold = .F., ;
		Left = 407, ;
		Name = "_checkbox1", ;
		ToolTipText = "Daca se salveaza arhivele zip eFactura in baza de date la descarcarea raspunsurilor", ;
		Top = 63, ;
		Value = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page4._checkbox2' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Salvare facturi primite/trimise pe server / director comun retea", ;
		ControlSource = "m.gnEFACTURA_SAVE", ;
		Enabled = .F., ;
		FontBold = .F., ;
		Left = 23, ;
		Name = "_checkbox2", ;
		ToolTipText = "Daca se salveaza facturile TRIMISE/PRIMITE intr-un director comun in retea", ;
		Top = 84, ;
		Value = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page4._checkbox3' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Generare PDF ANAF pe server/in retea", ;
		ControlSource = "m.gnEFACTURA_SAVE_ANAF_PDF", ;
		Enabled = .F., ;
		FontBold = .F., ;
		Left = 407, ;
		Name = "_checkbox3", ;
		ToolTipText = "Daca se genereaza PDF eFactura prin serviciul ANAF la descarcarea raspunsurilor pe server/in retea", ;
		Top = 84, ;
		Value = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page4._label1' AS _label WITH ;
		Caption = "Nume fisier facturi primite", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 395, ;
		Name = "_label1", ;
		Top = 244, ;
		Width = 149, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4._label2' AS _label WITH ;
		Caption = "Director salvare facturi trimise", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 23, ;
		Name = "_label2", ;
		Top = 292, ;
		Width = 173, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4._label3' AS _label WITH ;
		Caption = "Nume fisier facturi trimise", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 395, ;
		Name = "_label3", ;
		Top = 292, ;
		Width = 149, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4._label4' AS _label WITH ;
		Caption = "Director local salvare raspunsuri ", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 23, ;
		Name = "_label4", ;
		Top = 339, ;
		Width = 190, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4._label5' AS _label WITH ;
		Caption = "Director server salvare raspunsuri", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 23, ;
		Name = "_label5", ;
		Top = 196, ;
		Width = 193, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4._label6' AS _label WITH ;
		Caption = "Director server salvare facturi", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 23, ;
		Name = "_label6", ;
		Top = 108, ;
		Width = 168, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4._label7' AS _label WITH ;
		Caption = "Director retea salvare facturi", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 23, ;
		Name = "_label7", ;
		Top = 153, ;
		Width = 163, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4._label8' AS _label WITH ;
		Caption = "Info: dublu click pe Token pentru generare / actualizare token eFactura", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 22, ;
		Name = "_label8", ;
		Top = 29, ;
		Width = 409, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4.chkValidareOnline' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Validare online facturi trimise", ;
		ControlSource = "m.gnEFACTURA_VALIDARE_ONLINE", ;
		Enabled = .F., ;
		FontBold = .F., ;
		Left = 23, ;
		Name = "chkValidareOnline", ;
		ToolTipText = "Se valideaza xml eFactura online pe serverul ANAF inainte de a se trimite in sistemul eFactura. Alternativ, se valideaza offline cu DukIntegrator", ;
		Top = 63, ;
		Value = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgfeFactura.Page4.lblMesajTrimis' AS _label WITH ;
		Caption = "Director salvare facturi primite", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 23, ;
		Name = "lblMesajTrimis", ;
		Top = 244, ;
		Width = 173, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4.lblToken' AS _label WITH ;
		Anchor = 0, ;
		BackColor = 240,240,240, ;
		Caption = "lblToken", ;
		FontBold = .T., ;
		ForeColor = 0,128,0, ;
		Left = 23, ;
		Name = "lblToken", ;
		ToolTipText = "Dublu click pentru generare token sau actualizare data expirare token", ;
		Top = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'pgfeFactura.Page4.txtNetworkPath' AS _textbox WITH ;
		ControlSource = "m.gcEFACTURA_NETWORK_PATH", ;
		Height = 23, ;
		Left = 23, ;
		Name = "txtNetworkPath", ;
		ReadOnly = .T., ;
		ToolTipText = "Director de baza in retea pentru salvare raspunsuri zip eFactura primite", ;
		Top = 171, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4.txtResponsesPathLocal' AS _textbox WITH ;
		ControlSource = "", ;
		Height = 23, ;
		Left = 23, ;
		Name = "txtResponsesPathLocal", ;
		ReadOnly = .T., ;
		ToolTipText = "Director local salvare raspunsuri. Dublu click pentru deschidere director", ;
		Top = 357, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4.txtResponsesPathServer' AS _textbox WITH ;
		ControlSource = "m.gcEFACTURA_RESPONSESPATH", ;
		Height = 23, ;
		Left = 23, ;
		Name = "txtResponsesPathServer", ;
		ReadOnly = .T., ;
		ToolTipText = "Director server/retea pentru salvare raspunsuri zip eFactura primite", ;
		Top = 214, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4.txtSaveClientiFile' AS _textbox WITH ;
		ControlSource = "m.gcEFACTURA_SAVE_CLIENTI_FILE", ;
		Height = 23, ;
		Left = 395, ;
		Name = "txtSaveClientiFile", ;
		ReadOnly = .T., ;
		ToolTipText = "Nume fisier raspunsuri zip eFactura trimise", ;
		Top = 310, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4.txtSaveClientiPath' AS _textbox WITH ;
		ControlSource = "m.gcEFACTURA_SAVE_CLIENTI_PATH", ;
		Height = 23, ;
		Left = 23, ;
		Name = "txtSaveClientiPath", ;
		ReadOnly = .T., ;
		ToolTipText = "Cale director comun in retea pentru salvare raspunsuri zip eFactura trimise", ;
		Top = 310, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4.txtSaveFurnizoriFile' AS _textbox WITH ;
		ControlSource = "m.gcEFACTURA_SAVE_FURNIZORI_FILE", ;
		Height = 23, ;
		Left = 395, ;
		Name = "txtSaveFurnizoriFile", ;
		ReadOnly = .T., ;
		ToolTipText = "Nume fisier raspunsuri zip eFactura primite", ;
		Top = 262, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4.txtSaveFurnizoriPath' AS _textbox WITH ;
		ControlSource = "m.gcEFACTURA_SAVE_FURNIZORI_PATH", ;
		Height = 23, ;
		Left = 23, ;
		Name = "txtSaveFurnizoriPath", ;
		ReadOnly = .T., ;
		ToolTipText = "Cale director comun in retea pentru salvare raspunsuri zip eFactura primite", ;
		Top = 262, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pgfeFactura.Page4.txtServerPath' AS _textbox WITH ;
		ControlSource = "m.gcEFACTURA_SERVER_PATH", ;
		Height = 23, ;
		Left = 23, ;
		Name = "txtServerPath", ;
		ReadOnly = .T., ;
		ToolTipText = "Director de baza pe server pentru salvare raspunsuri zip eFactura primite", ;
		Top = 126, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Activate
		*
	ENDPROC

	PROCEDURE actualizeaza_grid1
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = poFacturiEmise.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer = 11
		
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.pgfeFactura.page1.grdFacturiEmise)
		poFacturiEmise.ca_baza1.cfiltru = lcFiltru
		poFacturiEmise.ca_baza1.afisare()
		restore_grid_tag(Thisform.pgfeFactura.page1.grdFacturiEmise)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = poFacturiPrimite.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer = 11
		
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.pgfeFactura.page2.grdFacturiPrimite)
		poFacturiPrimite.ca_baza1.cfiltru = lcFiltru
		poFacturiPrimite.ca_baza1.afisare()
		restore_grid_tag(Thisform.pgfeFactura.page2.grdFacturiPrimite)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		
	ENDPROC

	PROCEDURE actualizeaza_grid3
		Lparameters lcFiltru
		
		Thisform.LockScreen = .T.
		save_grid_tag(this.pgfeFactura.page1.grdDetaliiFacturi)
		save_grid_tag(this.pgfeFactura.page2.grdDetaliiFacturi)
		save_grid_tag(this.pgfeFactura.page3.grdDetaliiFacturi)
		poFacturiDetalii.ca_baza1.cfiltru = m.lcFiltru
		
		poFacturiDetalii.ca_baza1.afisare()
		
		restore_grid_tag(this.pgfeFactura.page1.grdDetaliiFacturi)
		restore_grid_tag(this.pgfeFactura.page2.grdDetaliiFacturi)
		restore_grid_tag(this.pgfeFactura.page3.grdDetaliiFacturi)
		Thisform.LockScreen = .F.
		
	ENDPROC

	PROCEDURE actualizeaza_grid4
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = poFacturiTrimise.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer = 11
		
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.pgfeFactura.page3.grdFacturiTrimise)
		poFacturiTrimise.ca_baza1.cfiltru = lcFiltru
		poFacturiTrimise.ca_baza1.afisare()
		restore_grid_tag(Thisform.pgfeFactura.page3.grdFacturiTrimise)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		
	ENDPROC

	PROCEDURE bifeazatrimismanual		&& Bifeaza o factura ca trimisa manual
		Local llSucces
		lnTrimis = this.pgfeFactura.page1.chkTrimis.Value
		llSucces = Thisform.oAnaf.BifeazaTrimisManual(crsFacturiEmise.id_fact, m.lnTrimis)
		IF !m.llSucces
			REPLACE trimis WITH Thisform.nTrimis IN crsFacturiEmise
		ELSE
			REPLACE tip_mesaj_raspuns WITH IIF(m.lnTrimis=1, 'FACTURA TRIMISA', ''), mesaj_trimis WITH 	IIF(m.lnTrimis=1, 'TRIMIS MANUAL', '') IN crsFacturiEmise
		ENDIF 
		Thisform.pgfeFactura.page1.grdFacturiEmise.Refresh()
		Return m.llSucces
	ENDPROC

	PROCEDURE citesteraspunsuri
		Local llSucces, lnOptiune, lnZile, llFortareRaspunsuri, llTest
		lnOptiune = xmenu('Ultima zi;Ultimele 2 zile;Ultimele 3 zile;Ultimele 7 zile;Ultimele 15 zile;Ultimele 30 zile;Ultimele 60 zile;Import arhiva zip de pe disc...')
		IF EMPTY(m.lnOptiune)
			RETURN
		ENDIF 
		lnZile = IIF(m.lnOptiune = 1, 1, IIF(m.lnOptiune = 2, 2, IIF(m.lnOptiune = 3, 3, IIF(m.lnOptiune = 4, 7, IIF(m.lnOptiune = 5, 15, IIF(m.lnOptiune = 6, 30, 60))))))
		
		llFortareRaspunsuri = this.pgfeFactura.page1.chkFortareRaspunsuri.Value 
		llTest = This.lTest 
		
		*!*	llSucces = Thisform.oAnaf.RaspunsuriFacturi(m.lnZile, m.llFortareRaspunsuri)
		IF m.lnOptiune = 8
			llSucces = Thisform.oAnaf.AnafeFacturaServer.ImportZipLocal()
		ELSE
			llSucces = efactura_client(m.lnZile, m.llFortareRaspunsuri, m.llTest)
		ENDIF
		
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.pgfeFactura.page2.grdFacturiPrimite)
		save_grid_tag(Thisform.pgfeFactura.page3.grdFacturiTrimise)
		poFacturiPrimite.ca_baza1.afisare()
		poFacturiTrimise.ca_baza1.afisare()
		restore_grid_tag(Thisform.pgfeFactura.page2.grdFacturiPrimite)
		restore_grid_tag(Thisform.pgfeFactura.page3.grdFacturiTrimise)
		Thisform.LockScreen = .F.
		
		Thisform.pgfeFactura.page1.grdFacturiEmise.SetFocus()
		
		Return m.llSucces
		 
		 
	ENDPROC

	PROCEDURE do_ataseaza
		Local lcCursor, lcText, llSucces, lnActivePage, lnId, lnOptiune
		lnActivePage = This.pgfeFactura.ActivePage
		
		If !Inlist(m.lnActivePage, 1, 2, 3)
			AMESSAGEBOX('Alegeti pagina "Transmitere eFactura", "Facturi trimise" sau "Facturi primite"!',0+48,_screen.Caption)
			Return
		ENDIF
		
		Do Case
			Case m.lnActivePage = 1
				lcText = 'Emise'
				lcCursor = 'crsFacturiEmise'
				lnId = crsFacturiEmise.id
			Case m.lnActivePage = 2
				lcText = 'Trimise'
				lcCursor = 'crsFacturiTrimise'
				lnId = crsFacturiTrimise.id
			Case m.lnActivePage = 3
				lcText = 'Primite'
				lcCursor = 'crsFacturiPrimite'
				lnId = crsFacturiPrimite.id
		ENDCASE
		IF EMPTY(NVL(m.lnId,0))
			RETURN
		ENDIF 
		
		lnOptiune = xmenu('Descarcare arhiva zip raspuns ANAF')
		IF m.lnOptiune = 1
			llSucces = Thisform.oAnaf.DownloadDetaliiZip(m.lnId)	
		ENDIF   
	ENDPROC

	PROCEDURE do_cauta
		LOCAL lcfiltru, lcFiltru2, lcFiltru3, lcval1, lcColoana, ldData1, ldData2
		Local lcData1, lcData2, llErori, llNetrimise, llPJ, llTrimise, llDiferente, lnActivePage, lcCond, lcDif1, lcDif2, lcDif3, lcLipsa, lcFiltruBaza1, lcFiltruBaza2, lcFiltruBaza3, lcPJ, lcNetrimise, lcTrimise, lcErori
		
		WAIT WINDOW 'Selectie inregistrari...' NOWAIT 
		
		* Execut Cautarea doar pentru pagina activa
		lnActivePage = this.pgfeFactura.ActivePage
		
		lcFiltru = '' && filtru facturi emise
		lcFiltru2 = '' && filtru facturi primite
		lcFiltru3 = '' && filtru facturi trimise
		
		* Filtre Transmitere eFactura
		WITH this.pgfeFactura.page1
			llPJ = .chkPJ.Value
			llNetrimise = .chkNetrimise.Value 
			llTrimise = .chkTrimise.Value 
			llErori = .chkErori.Value 
			llDiferente = .chkDiferente.Value
		ENDWITH 
		 
		* 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_ACT'$upper(THISFORM.filtru_pretty) OR 'DATA_TRIMIS'$upper(THISFORM.filtru_pretty) )
			lcData1 = '01' + PADL(INT(m.gnLuna),2,'0') + ALLTRIM(STR(m.gnAn))
			*!* data_act pe interval (nu extract(year/month...)) ca sa poata folosi IDX_ANAF_EFACTURA_1(FACTURA_EMISA,XDATA_ACT,DATA_RASPUNS)
			ldData1 = GOMONTH(m.ldData1, 1)
			lcData2 = '01' + PADL(MONTH(m.ldData1),2,'0') + ALLTRIM(STR(YEAR(m.ldData1)))
			lcFiltru = m.lcFiltru + [ and ((extract(year from data_act) = ?gnAn and extract(month from data_act) = ?gnLuna)  OR (trimis = 1 and tip_mesaj_raspuns is null and extract(year from data_act) >=2023))]
			lcFiltru2 = m.lcFiltru2 + [ and ((data_act >= to_date('] + m.lcData1 + [','ddmmyyyy') and data_act < to_date('] + m.lcData2 + [','ddmmyyyy')) or (data_act is null and data_raspuns >= to_date('] + m.lcData1 + [','ddmmyyyy')))]
			lcFiltru3 = m.lcFiltru3 + [ and ((data_act >= to_date('] + m.lcData1 + [','ddmmyyyy') and data_act < to_date('] + m.lcData2 + [','ddmmyyyy')) or (data_act is null and data_raspuns >= to_date('] + m.lcData1 + [','ddmmyyyy')))]
		ENDIF
		
		
		* Facturile trimise/primite de pe serverul TEST/productie ANAF
		lcFiltru = lcFiltru + [ and test = ] + IIF(Thisform.oAnaf.lTest, [1], [0])
		lcFiltru2 = lcFiltru2 + [ and test = ] + IIF(Thisform.oAnaf.lTest, [1], [0])
		lcFiltru3 = lcFiltru3 + [ and test = ] + IIF(Thisform.oAnaf.lTest, [1], [0])
		
		* Filtre buton cautare
		IF LEN(THISFORM.filtru_pretty)>0     
			lcFiltru = m.lcFiltru + " and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"    
			lcFiltru2 = m.lcFiltru2 + " and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"    	
			lcFiltru3 = m.lcFiltru3 + " and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"    		
		ENDIF
		
		* Filtrul de baza (fara bifele paginii 1), pentru numarul independent din caption (NumaraDiferente)
		lcFiltruBaza1 = m.lcFiltru
		
		lcPJ = [(tip_persoana=1)]
		lcNetrimise = [(NVL(trimis,0) = 0)]
		lcTrimise = [(trimis = 1 and data_raspuns IS NULL)]
		lcErori = [(trimis = 1 and tip_mesaj_raspuns = 'ERORI FACTURA')]
		
		IF m.llPJ
			lcFiltru = m.lcfiltru + " and " + m.lcPJ
		ENDIF 
		
		* Bifele Diferente / Lipsa din registrul de TVA, folosite si de NumaraDiferente pentru numarul din caption
		lcLipsa = [(jtotctva is null)]
		lcDif1 = [(jtotctva is null or ABS(decode(creditnote,0,1,-1) * ROUND(NVL(xtotal_cu_tva , 0.00) * decode(in_valuta,1,curs,1), 2)-NVL(jtotctva, 0.00)) > 0.15)]
		lcDif2 = [(jtotctva is not null and (NVL(nume_valuta,'RON') <> 'RON' or ABS(decode(creditnote,0,1,-1) * NVL(total_cu_tva, 0.00)-(NVL(jtotctva, 0.00)-NVL(jtva_ti, 0.00))) > 0.15))]
		lcDif3 = [(jtotctva is not null and (NVL(nume_valuta,'RON') <> 'RON' or ABS(decode(creditnote,0,1,-1) * NVL(total_cu_tva, 0.00)-NVL(jtotctva, 0.00)) > 0.15))]
		
		lcFiltruBaza2 = m.lcFiltru2
		lcCond = []
		WITH this.pgfeFactura.page2
			IF .chkDiferente.Value
				lcCond = m.lcDif2
			ENDIF 
			IF .chkLipsaRegistru.Value
				lcCond = IIF(EMPTY(m.lcCond), m.lcLipsa, m.lcCond + [ or ] + m.lcLipsa)
			ENDIF 
		ENDWITH 
		IF !EMPTY(m.lcCond)
			lcFiltru2 = m.lcFiltru2 + [ and (] + m.lcCond + [)]
		ENDIF 
		
		lcFiltruBaza3 = m.lcFiltru3
		lcCond = []
		WITH this.pgfeFactura.page3
			IF .chkDiferente.Value
				lcCond = m.lcDif3
			ENDIF 
			IF .chkLipsaRegistru.Value
				lcCond = IIF(EMPTY(m.lcCond), m.lcLipsa, m.lcCond + [ or ] + m.lcLipsa)
			ENDIF 
		ENDWITH 
		IF !EMPTY(m.lcCond)
			lcFiltru3 = m.lcFiltru3 + [ and (] + m.lcCond + [)]
		ENDIF 
		
		DO CASE 
			CASE m.llNetrimise
				IF m.llErori 
					lcFiltru = m.lcfiltru + " and (NVL(trimis,0) = 0 or tip_mesaj_raspuns = 'ERORI FACTURA')"
				ELSE
					lcFiltru = m.lcfiltru + " and " + m.lcNetrimise
				ENDIF 	
			CASE m.llTrimise
				lcFiltru = m.lcfiltru + " and " + m.lcTrimise
			CASE m.llErori
				lcFiltru = m.lcfiltru + " and " + m.lcErori
		ENDCASE 
		
		IF m.llDiferente
			lcFiltru = m.lcFiltru + " and (" + m.lcDif1 + ")"
		ENDIF 
		
		If Empty(m.lcFiltru)
			aMessagebox("Alegeti un criteriu!",0+48,"Atentie")
			Return
		Endif
		
		IF !EMPTY(m.lcFiltru) AND LEFT(LOWER(ALLTRIM(m.lcFiltru)),3) = "and"
			lcFiltru = SUBSTR(ALLTRIM(m.lcFiltru),4)
		ENDIF 	
		
		IF !EMPTY(m.lcFiltru2) AND LEFT(LOWER(ALLTRIM(m.lcFiltru2)),3) = "and"
			lcFiltru2 = SUBSTR(ALLTRIM(m.lcFiltru2),4)
		ENDIF 	
		
		IF !EMPTY(m.lcFiltru3) AND LEFT(LOWER(ALLTRIM(m.lcFiltru3)),3) = "and"
			lcFiltru3 = SUBSTR(ALLTRIM(m.lcFiltru3),4)
		ENDIF 	
		
		* Facturi emise
		IF !EMPTY(m.lcFiltru) AND m.lnActivePage = 1
			THISFORM.actualizeaza_grid1(m.lcFiltru)
			IF this.pgfeFactura.ActivePage = 1
				Thisform.RefreshDetaliiFacturi('EMISE')
				SELECT crsFacturiEmise
			ENDIF 
		ENDIF
		
		* Facturi trimise
		IF !EMPTY(m.lcFiltru3) AND m.lnActivePage = 2
			THISFORM.actualizeaza_grid4(m.lcFiltru3)
			IF this.pgfeFactura.ActivePage = 2
				Thisform.RefreshDetaliiFacturi('TRIMISE')
				SELECT crsFacturiTrimise
			ENDIF 
		ENDIF
		
		* Facturi primite
		IF !EMPTY(m.lcFiltru2) AND m.lnActivePage = 3
			THISFORM.actualizeaza_grid2(m.lcFiltru2)
			IF this.pgfeFactura.ActivePage = 3
				Thisform.RefreshDetaliiFacturi('PRIMITE')
				SELECT crsFacturiPrimite
			ENDIF 
		ENDIF
		
		
		This.pgfeFactura.page1._grdfooter1.calctotal()
		This.pgfeFactura.page2._grdfooter1.calctotal()
		This.pgfeFactura.page3._grdfooter1.calctotal()
		
		This.NumaraDiferente(m.lcFiltruBaza1, m.lcFiltruBaza2, m.lcFiltruBaza3, m.lcDif1, m.lcDif2, m.lcDif3, m.lcLipsa, m.lcNetrimise, m.lcTrimise, m.lcErori, m.lcPJ)
		
		WAIT CLEAR 
		
		Return m.lcFiltru
		 
	ENDPROC

	PROCEDURE do_excel
		Local lcCaption, lcCursor, lcSelect, lcSirIdEfact, lcSql, llSucces, lnIdEfactura, lnOptiune
		Local lnPaginaActiva, lnRecno
		lcSelect = Select()
		lnRecno = Recno()
		
		lnPaginaActiva = This.pgfeFactura.ActivePage
		Do Case
			Case m.lnPaginaActiva = 1
		* Facturi emise
				lnOptiune = xmenu('\<Centralizator facturi emise;\<Facturi emise detaliat;Factura \<curenta detaliat')
				lcCursor = 'crsFacturiEmise'
				lcCaption = "emise"
				loGrid = This.pgfeFactura.page1.grdFacturiEmise
		
			Case m.lnPaginaActiva = 2
		* Facturi trimise
				lnOptiune = xmenu('\<Centralizator facturi trimise;\<Facturi trimise detaliat;Factura \<curenta detaliat')
				lcCursor = 'crsFacturiTrimise'
				lcCaption = "trimise"
				loGrid = This.pgfeFactura.page3.grdFACTURITRIMISE
		
			Case m.lnPaginaActiva = 3
		* Facturi primite
				lnOptiune = xmenu('\<Centralizator facturi primite;\<Facturi primite detaliat;Factura curenta detaliat')
				lcCursor = 'crsFacturiPrimite'
				lcCaption = "primite"
				loGrid = This.pgfeFactura.page2.grdFacturiPrimite
		Endcase
		
		If Empty(m.lnOptiune)
			Return
		Endif
		
		Do Case
			Case m.lnOptiune = 1
				goExport.export2xlsxGrid(loGrid, "centralizator_facturi_" + m.lcCaption + '_' + Dtos(Date()))
			Case Inlist(m.lnOptiune, 2, 3)
		
		* Listare facturi primite detaliat
				lnIdEfactura = &lcCursor..Id
				If Empty(m.lnIdEfactura)
					Exit
				Endif
				If m.lnOptiune = 2
					lcSirIdEfact = cursor2lista(m.lcCursor, "id", ",")
				Else
					lcSirIdEfact = Alltrim(Str(m.lnIdEfactura))
				Endif
		
		
				Do Case
					Case m.lnPaginaActiva = 1
		* Facturi emise
		
						TEXT TO lcSqlDetalii TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xclient, cod_fiscal_emitent, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere
		from anaf_vefactura_emis_detaliu
		WHERE id_efactura in (<<m.lcSirIdEfact>>)
		order by data_act, numar_act, id_efactura, nr
						ENDTEXT
		
					Case m.lnPaginaActiva = 2
		* Facturi trimise
		
						TEXT TO lcSqlDetalii TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xclient, cod_fiscal_emitent, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere
		from anaf_vefactura_trimis_detaliu
		WHERE id_efactura in (<<m.lcSirIdEfact>>)
		order by data_act, numar_act, id_efactura, nr
						ENDTEXT
		
					Case m.lnPaginaActiva = 3
		* Facturi primite
						TEXT TO lcSqlDetalii TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xfurnizor, cod_fiscal_emitent, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere
		from anaf_vefactura_primit_detaliu
		WHERE id_efactura in (<<m.lcSirIdEfact>>)
		order by data_act, numar_act, id_efactura, nr
						ENDTEXT
		
				Endcase
		
				llSucces = goExecutor.oExecuta(m.lcSqlDetalii, 'cFacturiDetaliiRap')
				If m.llSucces
					goExport.export2xlsx('cFacturiDetaliiRap', "lista_facturi_" + m.lcCaption + "_" + Dtos(Date()))
				Endif
				Use In (Select('cFacturiDetaliiRap'))
		Endcase
		
		Select (m.lcSelect)
		
		
	ENDPROC

	PROCEDURE do_listare
		Private pcTitlu, pcSubtitlu
		Local lcSelect, lctext, lnOptiune, lnRecno
		Local lcSql, llSucces, lnIdEfactura
		Local lcSirIdEfact, lcSelect
		Local lcFisierPDF
		Local lcCursor, lnPaginaActiva
		Local lcDetalii, lcRaport, llVariable
		
		lcSelect = Select()
		pcTitlu = ''
		pcSubtitlu = ''
		If This.filtru_traducere() # ""
			lctext = " si " + This.filtru_traducere()
		Else
			lctext = ""
		Endif
		pcSubtitlu = This.filtru_pretty_ro + lctext
		
		lcSelect = Select()
		lnRecno = Recno()
		
		lnPaginaActiva = this.pgfeFactura.ActivePage
		DO CASE 
			CASE  m.lnPaginaActiva = 1
				* FACTURI EMISE
				lnOptiune = xmenu('\Centralizator facturi;\Lista facturi - detaliat;\Factura curenta;\-;PDF ANAF facturi alese;PDF ANAF factura curenta')
				lcCursor = 'crsFacturiEmise'
			CASE  m.lnPaginaActiva = 2
				* Facturi TRIMISE
				lnOptiune = xmenu('Centralizator facturi;Lista facturi trimise - detaliat;Factura trimisa curenta;\-;PDF ANAF facturi alese;PDF ANAF factura curenta;\-;Editare in browser')
				lcCursor = 'crsFacturiTrimise'
			CASE  m.lnPaginaActiva = 3
				* Facturi PRIMITE
				lnOptiune = xmenu('Centralizator facturi;Lista facturi primite - detaliat;Factura primita curenta;\-;PDF ANAF facturi alese;PDF ANAF factura curenta;\-;Editare in browser')
				lcCursor = 'crsFacturiPrimite'
		ENDCASE  	
		
		If Empty(m.lnOptiune)
			Return
		Endif
		
		Do Case
			Case m.lnOptiune = 1
				* Centralizator
				lcRaport = 'efact_facturi'
				IF m.lnPaginaActiva = 2
					pcTitlu = 'eFactura Trimise'
				ELSE
					pcTitlu = 'eFactura Primite'		
				ENDIF 
				
				llPrimite = (m.lnPaginaActiva = 3)
		
				SELECT 1 as tip, data_act, numar_act, IIF(m.llPrimite, cod_fiscal_emitent, cod_fiscal_beneficiar) as cod_fiscal, ;
					IIF(m.llPrimite, xfurnizor, xclient) as partener, ;
					total_fara_tva, total_tva, total_tva_ron, total_cu_tva, nume_valuta, id_incarcare, id_descarcare, creditnote ;
					from (m.lcCursor) ;
					ORDER BY data_act, numar_act ;
					into cursor cCentralizator READWRITE 
					
					* Calculez subtotaluri pe valute
					SELECT 2 as tip, nume_valuta, SUM(NVL(total_fara_tva, 0.00)) as total_fara_tva, SUM(NVL(total_tva, 0.00)) as total_tva, SUM(NVL(total_tva_ron, 0.00)) as total_tva_ron, SUM(NVL(total_cu_tva, 0.00)) as total_cu_tva ;
						FROM cCentralizator ;
						GROUP BY nume_valuta ;
						ORDER BY nume_valuta ;
						INTO CURSOR cCentralizator1
		
					SELECT cCentralizator
					APPEND FROM DBF('cCentralizator1')	
		
					* Calculez total general total_tva_ron, daca sunt mai multe valute
					IF RECCOUNT('cCentralizator1') > 1
						SELECT 3 as tip, SUM(NVL(total_tva_ron,0.00)) as total_tva_ron ;
							FROM cCentralizator1 ;
							INTO CURSOR cCentralizator2
		
						SELECT cCentralizator
						APPEND FROM DBF('cCentralizator2')	
						USE IN (SELECT('cCentralizator2'))					
					ENDIF 
					USE IN (SELECT('cCentralizator1'))
				
				Thisform.AlwaysOnTop = .F.
				goExport.export2frx("cCentralizator", m.lcRaport, , , , , , .T.)
				Thisform.AlwaysOnTop = .T.
				USE IN (SELECT('cCentralizator'))
		
			Case Inlist(m.lnOptiune, 2, 3)
				* Listare facturi primite detaliat
				IF m.lnPaginaActiva = 2
					pcTitlu = 'eFactura Trimise'
					lcRaport = 'efact_facturi_trimise_detalii'
					lnIdEfactura = crsFacturiTrimise.Id
				ELSE
					pcTitlu = 'eFactura Primite'		
					lcRaport = 'efact_facturi_primite_detalii'			
					lnIdEfactura = crsFacturiPrimite.Id
				ENDIF 
		
				If Empty(m.lnIdEfactura)
					Exit
				Endif
				If m.lnOptiune = 2
					lcSirIdEfact = cursor2lista(m.lcCursor, "id", ",")
				Else
					lcSirIdEfact = Alltrim(Str(m.lnIdEfactura))
				Endif
		
				IF m.lnPaginaActiva = 2
					TEXT TO lcSql TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xfurnizor, cod_fiscal_emitent, xclient, cod_fiscal_beneficiar, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id_incarcare, id_descarcare, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere, creditnote
			from anaf_vefactura_trimis_detaliu
			WHERE id_efactura in (<<m.lcSirIdEfact>>)
			order by data_act, numar_act, id_efactura, nr
					ENDTEXT
				ELSE
					TEXT TO lcSql TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xfurnizor, cod_fiscal_emitent, xclient, cod_fiscal_beneficiar, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id_incarcare, id_descarcare, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere, creditnote
			from anaf_vefactura_primit_detaliu
			WHERE id_efactura in (<<m.lcSirIdEfact>>)
			order by data_act, numar_act, id_efactura, nr
					ENDTEXT
				ENDIF 
		
				llSucces = goExecutor.oExecuta(m.lcSql, 'cFacturiDetaliuRap')
				If m.llSucces
					* nu afisez descriere sau detalii daca sunt la fel cu articol
					UPDATE cFacturiDetaliuRap SET descriere = '' WHERE articol = descriere
					UPDATE cFacturiDetaliuRap SET detalii = '' WHERE articol = detalii
								
					Thisform.AlwaysOnTop = .F.
					goExport.export2frx([cFacturiDetaliuRap], m.lcRaport, , , , , , .T.)
					Thisform.AlwaysOnTop = .T.
				Endif
		
				Use In (Select('cFacturiDetaliuRap'))
		
			Case m.lnOptiune = 5
				SELECT(m.lcCursor)
				lnRecno = Recno()
				llVariable = .T.
				Scan For ales = 1
					lcDetalii = ALLTRIM(detalii)
					
					If !Empty(m.lcDetalii)
						DO CASE 
							CASE m.lnPaginaActiva = 1
								lcFisierPDF = GetPdfPath('EFACTURA', 'EMISE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(STR(numar_act)) + '_'+ STRTRAN(ALLTRIM(client), ' ', '_',1,100,1)) + '.pdf'
							CASE m.lnPaginaActiva = 2
								lcFisierPDF = GetPdfPath('EFACTURA', 'TRIMISE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xclient), ' ', '_',1,100,1)) + '.pdf'
							OTHERWISE 
								lcFisierPDF = GetPdfPath('EFACTURA', 'PRIMITE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xfurnizor), ' ', '_',1,100,1)) + '.pdf'				
						ENDCASE
		
						lcFisierPDF = Thisform.oAnaf.AnafeFacturaServer.Xml2PdfAnaf(m.lcDetalii, m.lcFisierPdf, m.llVariable)
						If !EMPTY(m.lcFisierPDF) AND File(m.lcFisierPDF)
							open_default_app(m.lcFisierPDF)
						Endif
					Endif
				Endscan
				Try
					Goto m.lnRecno
				Endtry
			Case m.lnOptiune = 6
		
				SELECT(m.lcCursor)
				lcDetalii = ALLTRIM(detalii)	
				llVariable = .T.
				
				If !Empty(m.lcDetalii)
						DO CASE 
							CASE m.lnPaginaActiva = 1
								lcFisierPDF = GetPdfPath('EFACTURA', 'EMISE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(STR(numar_act)) + '_'+ STRTRAN(ALLTRIM(client), ' ', '_',1,100,1)) + '.pdf'
							CASE m.lnPaginaActiva = 2
								lcFisierPDF = GetPdfPath('EFACTURA', 'TRIMISE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xclient), ' ', '_',1,100,1)) + '.pdf'
							OTHERWISE 
								lcFisierPDF = GetPdfPath('EFACTURA', 'PRIMITE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xfurnizor), ' ', '_',1,100,1)) + '.pdf'				
						ENDCASE
					goLog.Log(m.lcFisierPDF)
					lcFisierPDF = Thisform.oAnaf.AnafeFacturaServer.Xml2PdfAnaf(m.lcDetalii, m.lcFisierPdf, m.llVariable)
					If !EMPTY(m.lcFisierPDF) AND File(m.lcFisierPDF)
						open_default_app(m.lcFisierPDF)
					Endif
				ENDIF
				
			CASE m.lnOptiune = 8
				* deschide preview browser cu xml
				SELECT(m.lcCursor)
				lcDetalii = ALLTRIM(detalii) && xml 
				llVariable = .T.	
				
				Local loSender
				loSender = NEWOBJECT("eFacturaXmlPreview", "xmlefactura-preview.prg")
				loSender.webURL = "https://romfast.ro/efactura-generator/"
				loSender.SendXML(m.lcDetalii, m.llVariable)
		Endcase
		
		Select (m.lcSelect)
		
		  
	ENDPROC

	PROCEDURE do_sterge
		Local lcSql, llSucces, lnId
		llSucces = .F.
		*!*	If This.pgfeFactura.ActivePage <> 2
		*!*		Return .F.
		*!*	Endif
		*!*	If Nvl(crsFacturiTrimise.test,0) = 0
		*!*		AMESSAGEBOX('Puteti sterge doar facturi trimise de Test', 0+48,_Screen.Caption)
		*!*		Return .F.
		*!*	ENDIF
		
		lcParola = INPUTBOX('Parola','Parola','')
		IF m.lcParola # TRANSFORM(YEAR(DATE())) + PADL(TRANSFORM(MONTH(DATE())),2,'0') + PADL(TRANSFORM(DAY(DATE())),2,'0')
			RETURN
		ENDIF 
		
		lnPaginaActiva = This.pgfeFactura.ActivePage
		
		Do Case
			Case m.lnPaginaActiva = 1
				lnId = Nvl(crsFacturiEmise.Id, 0)
			Case m.lnPaginaActiva = 2
				lnId = Nvl(crsFacturiTrimise.Id, 0)
			Case m.lnPaginaActiva = 3
				lnId = Nvl(crsFacturiPrimite.Id, 0)
			OTHERWISE 
				RETURN 
		Endcase
		
		
		TEXT TO lcSql TEXTMERGE NOSHOW
		begin
			delete from anaf_efactura_detalii where id_efactura = <<m.lnId>>;
			delete from anaf_efactura where id = <<m.lnId>>;
		end;
		ENDTEXT
		
		If AMessagebox('Doriti sa stergeti mesajul de transmitere al facturii?' + Chr(13) + Chr(10) + ;
				'Atentie, operatia este ireversibila!',4+32,_Screen.Caption)= 6
			llSucces = goExecutor.oExecuta(m.lcSql)
		Endif
		
		This.do_cauta()
		
		Return m.llSucces
		
	ENDPROC

	PROCEDURE do_verifica
		Local lcText, lnActivePage
		lnActivePage = This.pgfeFactura.ActivePage
		If !Inlist(m.lnActivePage, 2, 3)
			AMESSAGEBOX('Alegeti pagina "Facturi trimise" sau "Facturi primite"!',0+48,_screen.Caption)
			Return
		Endif
		Do Case
			Case m.lnActivePage = 2
				lcText = 'Trimise'
				lcJTVA = 'vjv2025'
				lcCursor = 'crsFacturiTrimise'
				lcCodFiscalPart = 'cod_fiscal_beneficiar'
				lcPart = 'xclient'
		
				TEXT TO lcBaza NOSHOW 
		RO24B+RO20B+RO21B+RO11B+RO19B+RO9B+RO5B+ROTI+CESCDD1+CESCDD2+WRSCDD+FODD+FOFDD+WRSCFDD+WRN+CEOPTR+CESVDD+CESVFDD+CESVFS+RO24NB+RO20NB+RO21NB+RO11NB+RO19NB+RO9NB+RO5NB
				ENDTEXT 
		
				TEXT TO lcTVA NOSHOW 
		RO24T+RO20T+RO21T+RO11T+RO19T+RO9T+RO5T+RO24NT+RO20NT++RO21NT+RO11NT+RO19NT+RO9NT+RO5NT
				ENDTEXT 				 				
		
			Case m.lnActivePage = 3
				lcText = 'Primite'
				lcJTVA = 'vjc2025'
				lcCursor = 'crsFacturiPrimite'
				lcCodFiscalPart = 'cod_fiscal_emitent'
				lcPart = 'xfurnizor'
		
				TEXT TO lcBaza NOSHOW 
		RO24B + RO20B + RO21B + RO11B + RO19B + RO09B + RO05B + ROSCN + RO24NB + RO20NB + RO21NB + RO11NB + RO19NB + RO9NB + RO5NB + FO24B + FO20B + FO21B + FO11B + FO19B + FO09B + FOSCN + CEB + CESC + CEN + TI24B + TI20B + TI21B + TI11B + TI19B + TI09B + XX19TIB + XX21TIB + XX11TIB
				ENDTEXT 				
		
				TEXT TO lcTVA NOSHOW 
		RO24T + RO20T + RO21T + RO11T + RO19T + RO09T + RO05T + RO24NT + RO20NT + RO21NT + RO11NT + RO19NT + RO9NT + RO5NT + FO24T + FO20T + FO21T + FO11T + FO19T + FO09T + CET + TI24T + TI20T + TI21T + TI11T + TI19T + TI09T + XX19TIT + XX21TIT + XX11TIT
				ENDTEXT
				
		ENDCASE
		
						
		* Selectez din Jurnalul TVA doar Facturi, Invoice-uri, Facturi simplificate (M), fara Bonuri fiscale cu CUI (C)
		TEXT TO lcSql TEXTMERGE NOSHOW 
		select j.dataact, REGEXP_REPLACE(j.cod_fiscal, '[^[:digit:]]', '') as cod_fiscal, j.denumire, 
					sum(j.totctva) as totctva,
					SUM(<<m.lcBaza>>) as totftva,
					SUM(<<m.lcTVA>>) as tottva
		          from <<m.lcJTVA>> j
		          left join nom_fdoc f on j.id_fdoc = f.id_fdoc  
		         where j.an = <<gnAn>>
		           and j.luna = <<gnLuna>>
		           and extract(year from j.dataact) = <<gnAn>>
		           and extract(month from j.dataact) = <<gnLuna>>
		           and f.tip_doc in ('F', 'INV', 'M')
		         group by j.dataact, j.cod_fiscal, j.denumire 
		ENDTEXT            
		llSucces = goExecutor.oExecuta(m.lcSql, 'cJTVATemp')
		
		*!*	SELECT dataact, SUM(totctva) as totctva FROM cJTVATemp GROUP BY dataact INTO CURSOR cJtvaData
		
		*!*	SELECT data_act, SUM(total_cu_tva) as total_cu_tva FROM (m.lcCursor) GROUP BY data_act INTO CURSOR cCrsData
		
		* Iau doar mesajele TIP FACTURA, nu MESAJ CUMPARATOR
		SELECT NVL(data_act, {}) AS data_act, &lcCodFiscalPart as cod_fiscal, &lcPart as denumire, ;
			SUM(IIF(creditnote = 1,-1,1)*total_fara_tva) as total_fara_tva, ;
			SUM(IIF(creditnote = 1,-1,1)*total_tva) as total_tva, ;
			SUM(IIF(creditnote = 1,-1,1)*total_cu_tva) as total_cu_tva ;
			FROM (m.lcCursor) ;
			WHERE LEFT(UPPER(TIP_MESAJ_RASPUNS), 7) = 'FACTURA' ;
			GROUP BY 1,2,3 ;
			INTO CURSOR cCrsDataPart
		
		*!*	* Diferente pe zile
		*!*	SELECT CAST(NVL(a.dataact, b.data_act) as D) as dataact, CAST(a.totctva as N(16,2)) as jurnal_total_cu_tva, CAST(b.total_cu_tva as N(16,2)) as efactura_total_cu_tva,  ;
		*!*		CAST(NVL(a.totctva, 0) - NVL(b.total_cu_tva,0) as N(16,2)) as diferenta ;
		*!*		FROM cJtvaData a FULL JOIN cCrsData b ON a.dataact = b.data_act ;
		*!*		ORDER BY 1 ;
		*!*		INTO CURSOR Diferente_Data
		
		* Diferente pe zile, cod fiscal
		SELECT CAST(NVL(a.dataact, b.data_act) as D) as dataact, NVL(a.cod_fiscal, b.cod_fiscal) as cod_fiscal, NVL(a.denumire, b.denumire) as denumire,;
			CAST(a.totctva as N(16,2)) as jurnal_total_cu_tva, CAST(b.total_cu_tva as N(16,2)) as efactura_total_cu_tva,  ;
			CAST(NVL(a.totctva, 0) - NVL(b.total_cu_tva,0) as N(16,2)) as diferenta_total_cu_tva, ;	
			CAST(a.totftva as N(16,2)) as jurnal_total_fara_tva, CAST(b.total_fara_tva as N(16,2)) as efactura_total_fara_tva,  ;
			CAST(NVL(a.totftva, 0) - NVL(b.total_fara_tva,0) as N(16,2)) as diferenta_total_fara_tva, ;
			CAST(a.tottva as N(16,2)) as jurnal_total_tva, CAST(b.total_tva as N(16,2)) as efactura_total_tva,  ;
			CAST(NVL(a.tottva, 0) - NVL(b.total_tva,0) as N(16,2)) as diferenta_total_tva ;
			FROM cJTVATemp a FULL JOIN cCrsDataPart b ON a.dataact = b.data_act AND a.cod_fiscal = b.cod_fiscal ;
			ORDER BY 1, 3;
			INTO CURSOR Diferente_Data_Partener
		
		*!*	USE IN (SELECT('cJtvaData'))
		*!*	USE IN (SELECT('cCrsData'))
		USE IN (SELECT('cCrsDataPart'))
		
		CREATE CURSOR cDiferente (dataact D, cod_fiscal C(100) null, denumire C(200) null, ;
			jurnal_total_cu_tva N(20,2) null, efactura_total_cu_tva N(20,2) null, diferenta_total_cu_tva N(20,2) null, ;
			jurnal_total_fara_tva N(20,2) null, efactura_total_fara_tva N(20,2) null, diferenta_total_fara_tva N(20,2) null, ;
			jurnal_total_tva N(20,2) null, efactura_total_tva N(20,2) null, diferenta_total_tva N(20,2) null)
		
		SELECT cDiferente
		*!*	APPEND FROM DBF('Diferente_Data')
		*!*	APPEND BLANK 
		*!*	APPEND BLANK 
		APPEND FROM DBF('Diferente_Data_Partener')
		
		*!*	USE IN (SELECT('Diferente_Data'))
		USE IN (SELECT('Diferente_Data_Partener'))
		
		* goExport.exportMultiTable2Xlsx("Diferente_Data,Diferente_Data_Partener", "verificare_efactura_" + LOWER(m.lcText) + '_' + ALLTRIM(STR(m.gnAn)) + PADL(INT(m.gnLuna),2, '0'))
		goExport.export2xlsx("cDiferente", "verificare_efactura_" + m.gcS + '_'+ LOWER(m.lcText) + '_' + ALLTRIM(STR(m.gnAn)) + PADL(INT(m.gnLuna),2, '0'))
		
		USE IN (SELECT('cDiferente'))
	ENDPROC

	PROCEDURE gettoken
		Local lcToken
		lcToken = this.oAnaf.getToken(.T.)
		Thisform.RefreshLblToken()
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local lnAtasamenteEfactura
		
		lnAtasamenteEfactura = thisform.pgfeFactura.page1.cboAtasamente.Value
		goApp.WriteIni("efactura", "atasamente", ALLTRIM(STR(m.lnAtasamenteEfactura)))
		
		RETURN .T. 
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toAnaf
		Local lcPdfPath, lcSection
		Local lcAtasamente, lnAtasamente
		
		
		This.oAnaf = toAnaf
		This.RefreshLblToken()
		*!*	this.chkTest.ControlSource = "Thisform.oAnaf.lTest"
		this.pgfeFactura.page4.txtResponsesPathLocal.ControlSource = 'Thisform.oANAF.cResponsesPath'
		
		This.pgfeFactura.page1.cmd_select_adv1.Setup()
		
		* Director atasamente. vizibil doar daca este configurata pdfpath
		lcSection = 'pdf_factura_' + m.gcS && [pdf_factura_acn]
		lcPdfPath = goApp.ReadIni(m.lcSection, "pdfpath")
		lcPdfPath = NVL(m.lcPdfPath, '')
		
		lcAtasamente = goApp.ReadIni("efactura", "atasamente") && 0 fara atasamente, 1 factura, 2 toate, 3 fara factura 
		lnAtasamente = INT(VAL(NVL(m.lcAtasamente, 0)))
		IF !BETWEEN(m.lnAtasamente, 0,3) OR EMPTY(m.lcPdfPath) OR !DIRECTORY(m.lcPdfPath)
			lnAtasamente = 0
		ENDIF 
		
		IF !EMPTY(m.lcPdfPath)
			this.pgfeFactura.page1.lblAtasamente.Caption = 'Director atasamente: ' + JUSTPATH(m.lcPdfPath)
			this.pgfeFactura.page1.cboAtasamente.Enabled = .T.
			this.pgfeFactura.page1.cboAtasamente.Value = m.lnAtasamente
		ELSE
			this.pgfeFactura.page1.lblAtasamente.Caption = 'Director atasamente: Nu este configurat'
			this.pgfeFactura.page1.cboAtasamente.Enabled = .F.	
			this.pgfeFactura.page1.cboAtasamente.Value = m.lnAtasamente
		ENDIF 
		
		* Mesajul era trunchiat la 41 de caractere
		This.cMesajFurnizor = SPACE(200) 
		
		* Caption de baza pentru bifele Diferente/Lipsa, refolosit de NumaraDiferente/SeteazaCaptionDiferente
		This.pgfeFactura.page1.chkPJ.Tag = This.pgfeFactura.page1.chkPJ.Caption
		This.pgfeFactura.page1.chkNetrimise.Tag = This.pgfeFactura.page1.chkNetrimise.Caption
		This.pgfeFactura.page1.chkTrimise.Tag = This.pgfeFactura.page1.chkTrimise.Caption
		This.pgfeFactura.page1.chkErori.Tag = This.pgfeFactura.page1.chkErori.Caption
		This.pgfeFactura.page1.chkDiferente.Tag = This.pgfeFactura.page1.chkDiferente.Caption
		This.pgfeFactura.page2.chkDiferente.Tag = This.pgfeFactura.page2.chkDiferente.Caption
		This.pgfeFactura.page2.chkLipsaRegistru.Tag = This.pgfeFactura.page2.chkLipsaRegistru.Caption
		This.pgfeFactura.page3.chkDiferente.Tag = This.pgfeFactura.page3.chkDiferente.Caption
		This.pgfeFactura.page3.chkLipsaRegistru.Tag = This.pgfeFactura.page3.chkLipsaRegistru.Caption
		
		DODEFAULT()  
	ENDPROC

	PROCEDURE ltest_assign
		lparameters tlTest
		This.lTest = tlTest
		
		Thisform.oAnaf.lTest = m.tlTest
		Thisform.oAnaf.AnafeFacturaServer.lTest = m.tlTest
	ENDPROC

	PROCEDURE NumaraDiferente
		LPARAMETERS tcFiltruBaza1, tcFiltruBaza2, tcFiltruBaza3, tcDif1, tcDif2, tcDif3, tcLipsa, tcNetrimise, tcTrimise, tcErori, tcPJ
		LOCAL lnActivePage, lcView, lcFiltruBaza, lcDif, llLipsa, lcSql, llSucces, lnDif, lnLipsa, lnNetrimise, lnTrimise, lnErori, lnPJ, lcCursor, llFaraBife, lnSelect, lnRec
		lnActivePage = This.pgfeFactura.ActivePage
		lnDif = 0
		lnLipsa = 0
		
		*!* fara nicio bifa, cursorul afisat e chiar setul de baza: numaram local, fara interogare
		DO CASE
			CASE m.lnActivePage = 1
				lcCursor = 'crsFacturiEmise'
				llFaraBife = EMPTY(This.pgfeFactura.page1.chkPJ.Value) AND EMPTY(This.pgfeFactura.page1.chkNetrimise.Value) ;
					AND EMPTY(This.pgfeFactura.page1.chkTrimise.Value) AND EMPTY(This.pgfeFactura.page1.chkErori.Value) ;
					AND EMPTY(This.pgfeFactura.page1.chkDiferente.Value)
			CASE m.lnActivePage = 2
				lcCursor = 'crsFacturiTrimise'
				llFaraBife = EMPTY(This.pgfeFactura.page3.chkDiferente.Value) AND EMPTY(This.pgfeFactura.page3.chkLipsaRegistru.Value)
			CASE m.lnActivePage = 3
				lcCursor = 'crsFacturiPrimite'
				llFaraBife = EMPTY(This.pgfeFactura.page2.chkDiferente.Value) AND EMPTY(This.pgfeFactura.page2.chkLipsaRegistru.Value)
			OTHERWISE
				RETURN
		ENDCASE
		
		IF m.llFaraBife AND USED(m.lcCursor)
			lnSelect = SELECT()
			lnRec = RECNO(m.lcCursor)
			IF m.lnActivePage = 1
				SELECT SUM(IIF(NVL(tip_persoana,1) = 1, 1, 0)) as npj, ;
						SUM(IIF(NVL(trimis,0) = 0, 1, 0)) as nnetrimise, ;
						SUM(IIF(NVL(trimis,0) = 1 AND EMPTY(NVL(data_raspuns, {})), 1, 0)) as ntrimise, ;
						SUM(IIF(NVL(trimis,0) = 1 AND ALLTRIM(NVL(tip_mesaj_raspuns,'')) == 'ERORI FACTURA', 1, 0)) as nerori, ;
						SUM(IIF(ISNULL(jtotctva) OR ABS(NVL(diferenta,0)) > 0.15, 1, 0)) as ndif ;
					FROM crsFacturiEmise INTO CURSOR crsNumarBifeLocal NOFILTER
				lnPJ = NVL(crsNumarBifeLocal.npj,0)
				lnNetrimise = NVL(crsNumarBifeLocal.nnetrimise,0)
				lnTrimise = NVL(crsNumarBifeLocal.ntrimise,0)
				lnErori = NVL(crsNumarBifeLocal.nerori,0)
				lnDif = NVL(crsNumarBifeLocal.ndif,0)
				USE IN (SELECT('crsNumarBifeLocal'))
				This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkDiferente, m.lnDif)
				This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkNetrimise, m.lnNetrimise)
				This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkTrimise, m.lnTrimise)
				This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkErori, m.lnErori)
				This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkPJ, m.lnPJ)
			ELSE
				SELECT SUM(IIF(!ISNULL(jtotctva) AND (ALLTRIM(NVL(nume_valuta,'RON')) <> 'RON' OR ABS(NVL(diferenta,0)) > 0.15), 1, 0)) as ndif, ;
						SUM(IIF(ISNULL(jtotctva), 1, 0)) as nlipsa ;
					FROM (m.lcCursor) INTO CURSOR crsNumarBifeLocal NOFILTER
				lnDif = NVL(crsNumarBifeLocal.ndif,0)
				lnLipsa = NVL(crsNumarBifeLocal.nlipsa,0)
				USE IN (SELECT('crsNumarBifeLocal'))
				IF m.lnActivePage = 2
					This.SeteazaCaptionDiferente(This.pgfeFactura.page3.chkDiferente, m.lnDif)
					This.SeteazaCaptionDiferente(This.pgfeFactura.page3.chkLipsaRegistru, m.lnLipsa)
				ELSE
					This.SeteazaCaptionDiferente(This.pgfeFactura.page2.chkDiferente, m.lnDif)
					This.SeteazaCaptionDiferente(This.pgfeFactura.page2.chkLipsaRegistru, m.lnLipsa)
				ENDIF
			ENDIF
			SELECT (m.lcCursor)
			IF m.lnRec > 0 AND m.lnRec <= RECCOUNT()
				GO m.lnRec
			ENDIF
			SELECT (m.lnSelect)
			RETURN
		ENDIF
		
		* Pagina 1: fiecare bifa se numara independent pe filtrul de baza, indiferent de celelalte bife
		IF m.lnActivePage = 1
			lnNetrimise = 0
			lnTrimise = 0
			lnErori = 0
			lnPJ = 0
			
			IF !EMPTY(NVL(m.tcFiltruBaza1,''))
				lcSql = "select count(case when " + m.tcDif1 + " then 1 end) as ndif" + ;
					", count(case when " + m.tcNetrimise + " then 1 end) as nnetrimise" + ;
					", count(case when " + m.tcTrimise + " then 1 end) as ntrimise" + ;
					", count(case when " + m.tcErori + " then 1 end) as nerori" + ;
					", count(case when " + m.tcPJ + " then 1 end) as npj" + ;
					" from anaf_vefactura_emis where 1=1 " + m.tcFiltruBaza1
				
				llSucces = goExecutor.oExecuta(m.lcSql, 'crsNumarDiferente')
				IF m.llSucces
					lnDif = NVL(crsNumarDiferente.ndif,0)
					lnNetrimise = NVL(crsNumarDiferente.nnetrimise,0)
					lnTrimise = NVL(crsNumarDiferente.ntrimise,0)
					lnErori = NVL(crsNumarDiferente.nerori,0)
					lnPJ = NVL(crsNumarDiferente.npj,0)
				ENDIF 
			ENDIF 
			
			This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkDiferente, m.lnDif)
			This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkNetrimise, m.lnNetrimise)
			This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkTrimise, m.lnTrimise)
			This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkErori, m.lnErori)
			This.SeteazaCaptionDiferente(This.pgfeFactura.page1.chkPJ, m.lnPJ)
			RETURN
		ENDIF 
		
		DO CASE
			CASE m.lnActivePage = 2
				lcView = 'anaf_vefactura_trimis'
				lcFiltruBaza = m.tcFiltruBaza3
				lcDif = m.tcDif3
				llLipsa = .T.
			CASE m.lnActivePage = 3
				lcView = 'anaf_vefactura_primit'
				lcFiltruBaza = m.tcFiltruBaza2
				lcDif = m.tcDif2
				llLipsa = .T.
			OTHERWISE
				RETURN
		ENDCASE
		
		* Numarul se reseteaza pe 0 (caption fara paranteza) cand filtrul e gol sau interogarea esueaza
		IF !EMPTY(NVL(m.lcFiltruBaza,'')) AND !EMPTY(NVL(m.lcDif,''))
			lcSql = "select count(case when " + m.lcDif + " then 1 end) as ndif" + ;
				IIF(m.llLipsa, ", count(case when " + m.tcLipsa + " then 1 end) as nlipsa", "") + ;
				" from " + m.lcView + " where 1=1 " + m.lcFiltruBaza
		
			llSucces = goExecutor.oExecuta(m.lcSql, 'crsNumarDiferente')
			IF m.llSucces
				lnDif = NVL(crsNumarDiferente.ndif,0)
				IF m.llLipsa
					lnLipsa = NVL(crsNumarDiferente.nlipsa,0)
				ENDIF 
			ENDIF 
		ENDIF 
		
		DO CASE
			CASE m.lnActivePage = 2
				This.SeteazaCaptionDiferente(This.pgfeFactura.page3.chkDiferente, m.lnDif)
				This.SeteazaCaptionDiferente(This.pgfeFactura.page3.chkLipsaRegistru, m.lnLipsa)
			CASE m.lnActivePage = 3
				This.SeteazaCaptionDiferente(This.pgfeFactura.page2.chkDiferente, m.lnDif)
				This.SeteazaCaptionDiferente(This.pgfeFactura.page2.chkLipsaRegistru, m.lnLipsa)
		ENDCASE
	ENDPROC

	PROCEDURE refreshdetaliifacturi
		Lparameters tcTip
		* tcTip: EMISE/TRIMISE/PRIMITE
		
		Local lcFiltru, lcTip, loGrid, lcCursor, lcDetalii, lnActivePage, lnId
		lnId = 0
		lcCursor = ''
		lcDetalii = ''
		lcTip = Upper(Alltrim(Transform(m.tcTip)))
		lcFiltru = [1=2]
		lnActivePage = This.pgfeFactura.ActivePage
		
		
		Do Case
			Case m.lcTip = 'PRIMITE'
				lcCursor = 'crsFacturiPrimite'
				lcDetalii = crsFacturiPrimite.detalii	
				If !Empty(Nvl(crsFacturiPrimite.Id,0))
					lnId = crsFacturiPrimite.Id
				Endif
			Case m.lcTip = 'EMISE'
				lcCursor = 'crsFacturiEmise'	
				lcDetalii = crsFacturiEmise.detalii
				If !Empty(Nvl(crsFacturiEmise.Id,0))
					lnId = crsFacturiEmise.Id		
				Endif
			Case m.lcTip = 'TRIMISE'
				lcCursor = 'crsFacturiTrimise'	
				lcDetalii = crsFacturiTrimise.detalii
				If !Empty(Nvl(crsFacturiTrimise.Id,0))
					lnId = crsFacturiTrimise.Id
				Endif
		Endcase
		
		IF !EMPTY(m.lnId)
			lcFiltru = [id_efactura = ] + Alltrim(Str(m.lnId))
		ENDIF 	
					
		Thisform.actualizeaza_grid3(m.lcFiltru)
		
		****************************************************************************
		* Actualizez si anaf_efactura.detalii
		* Aduc si xml efactura din anaf_efactura.detalii doar pentru factura curenta, pentru ca dureaza prea mult sa aduc pentru toate facturile
		IF !EMPTY(m.lnId) AND EMPTY(NVL(m.lcDetalii, ''))
			lcSql = [select detalii from anaf_efactura where id = ] + ALLTRIM(STR(m.lnId))
			llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @lcDetalii)
			IF m.llSucces
				REPLACE detalii WITH m.lcDetalii IN &lcCursor
				DO CASE 
					Case m.lnActivePage = 1
						This.pgfeFactura.page1.edtDetalii.Refresh()
					Case m.lnActivePage = 2
						This.pgfeFactura.page3.edtDetalii.Refresh()
					Case m.lnActivePage = 3
						This.pgfeFactura.page2.edtDetalii.Refresh()
				ENDCASE		
			ENDIF 		
		ENDIF 		
		****************************************************************************
		
	ENDPROC

	PROCEDURE refreshlbltoken
		thisform.pgfeFactura.page4.lbltoken.caption = 'Token - expira: ' + TRANSFORM(this.oAnaf.token_expdate)
		
		* Daca mai este o saptamana pana la expirare sau este expirat
		IF BETWEEN(DATE() - this.oAnaf.token_expdate, 0, 7) OR DATE() >= this.oAnaf.token_expdate
			thisform.pgfeFactura.page4.lbltoken.FontBold = .T.
			thisform.pgfeFactura.page4.lbltoken.ForeColor = RGB(255,0,0)
		ENDIF 
		
		thisform.pgfeFactura.page4.lbltoken.Refresh()
		
	ENDPROC

	PROCEDURE SeteazaCaptionDiferente
		LPARAMETERS toCheck, tnNumar
		LOCAL lcBaza
		lcBaza = IIF(EMPTY(NVL(toCheck.Tag,'')), toCheck.Caption, toCheck.Tag)
		toCheck.Caption = ALLTRIM(lcBaza) + IIF(NVL(tnNumar,0) > 0, ' (' + ALLTRIM(STR(tnNumar)) + ')', '')
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		
		* Colorez randurile facturi emise netrimise 
		WITH this.pgfeFactura.page1.grdFacturiEmise
			* backcolor: rosu = ERORI FACTURA, galben = facturi netrimise, roz = facturi trimise fara raspuns, gri = nu e in Registrul de Vanzari, turcuaz = diferenta peste 0.15 lei, alb = se potriveste
			*!* sirul e spart in doua: VFP nu accepta constante sir peste 255 caractere
			.SetAll("DynamicBackColor", ;
				"IIF(ALLTRIM(NVL(tip_mesaj_raspuns,'')) = 'ERORI FACTURA', RGB(255,140,140), IIF(NVL(trimis,0) = 0, RGB(255,255,240), IIF(EMPTY(NVL(data_raspuns, {})), RGB(255,165,255), " + ;
				"IIF(ISNULL(jtotctva), RGB(225,225,225), IIF(ISNULL(diferenta) OR ABS(NVL(diferenta,0)) > 0.15, RGB(100,255,255), RGB(255,255,255))))))", "Column")
		
			* Colorez forecolor pentru Persoane Fizice, si pentru creditnote
			.SetAll("DynamicForeColor","IIF(tip_persoana = 2, RGB(0,128,192), IIF(creditnote = 1, RGB(255,0,0), RGB(0,0,0)))", "Column")
		ENDWITH 
		
		WITH this.pgfeFactura.page3.grdFacturiTrimise
			.SetAll("DynamicBackColor","IIF(ISNULL(jtotctva), RGB(225,225,225), IIF(ISNULL(diferenta) OR ABS(NVL(diferenta,0)) > 0.15, RGB(100,255,255), RGB(255,255,255)))", "Column")
			.SetAll("DynamicForeColor","IIF(creditnote = 1, RGB(225,0,0), RGB(0,0,0))", "Column")	
		ENDWITH 
		
		WITH this.pgfeFactura.page2.grdFacturiPrimite
			.SetAll("DynamicBackColor","IIF(ISNULL(jtotctva), RGB(225,225,225), IIF(ISNULL(diferenta) OR ABS(NVL(diferenta,0)) > 0.15, RGB(100,255,255), RGB(255,255,255)))", "Column")
			.SetAll("DynamicForeColor","IIF(creditnote = 1, RGB(225,0,0), RGB(0,0,0))", "Column")	
		ENDWITH 	
		
		this.WindowState = 2 
		
		this.pgfeFactura.page1.gridextra1.setup()
		this.pgfeFactura.page1.gridextra2.setup()
		this.pgfeFactura.page2.gridextra1.setup()
		this.pgfeFactura.page2.gridextra2.setup()
		this.pgfeFactura.page3.gridextra1.setup()
		this.pgfeFactura.page3.gridextra2.setup()
		
		this.pgfeFactura.page1._grdfooter1.attachtogrid(this.pgfeFactura.page1.grdFacturiEmise)
		this.pgfeFactura.page1._grdfooter1.calctotal()
		this.pgfeFactura.page2._grdfooter1.attachtogrid(this.pgfeFactura.page2.grdFacturiPrimite)
		this.pgfeFactura.page2._grdfooter1.calctotal()
		this.pgfeFactura.page3._grdfooter1.attachtogrid(this.pgfeFactura.page3.grdFacturiTrimise)
		this.pgfeFactura.page3._grdfooter1.calctotal()
		
		this.pgfeFactura.page1.grdFacturiEmise.HeaderHeight = 35
		this.pgfeFactura.page2.grdFacturiPrimite.HeaderHeight = 35
		this.pgfeFactura.page3.grdFacturiTrimise.HeaderHeight = 35
		
		*!* numerele de pe bife apar de la deschidere, numarate local din cursorul deja adus
		This.NumaraDiferente()
		
	ENDPROC

	PROCEDURE trimitefacturi
		Local llSucces, lnRecno, llValidareOnline
		Local llNuTrimiteEFacturaANAF
		llSucces = .F.
		llNuTrimiteEFacturaANAF = .F.
		
		* Suprascriu tipul validarii prin plValidareEFacturaOnline pentru validare in xmlefactura.prg ValidareEFactura
		Private plValidareEFacturaOnline, plFaraValidareEFactura, pnAtasamenteEfactura
		plValidareEFacturaOnline = (This.pgfeFactura.page1.chkValidareOnline.Value=1)
		plFaraValidareEFactura = .F.
		
		pnAtasamenteEfactura = this.pgfeFactura.page1.cboAtasamente.Value
		
		* Verific daca s-au selectat facturi trimise deja
		lnRecno = Recno('crsFacturiEmise')
		Select crsFacturiEmise
		Locate For ales = 1
		IF !FOUND()
			AMessagebox('Selectati facturi! Nu se continua!',0+48,_Screen.Caption)
			Goto m.lnRecno In crsFacturiEmise
			Return
		ENDIF 
		
		* Verific daca s-au selectat facturi trimise, dar la care nu am primit raspuns, data_raspuns = null
		* Se poate continua daca utilizatorul doreste
		Locate For ales = 1 And !EMPTY(NVL(id_incarcare,'')) AND EMPTY(NVL(data_Raspuns, {}))
		IF FOUND()
			IF AMessagebox('Atentie! Ati selectat facturi cu ID Incarcare (deja trimise) la care nu ati primit inca raspuns! Doriti sa le trimiteti din nou?' + CHR(13) + CHR(10) + CHR(13) + CHR(10) +;
				'Puteti trimite din nou doar facturile pentru care aveti raspuns "ERORI FACTURI"' + CHR(13) + CHR(10) + ;
				'Nu trimiteti facturi la care nu ati primit inca raspuns!',4+32,_Screen.Caption) <> 6
				Goto m.lnRecno In crsFacturiEmise
				IF !This.lTest
					RETURN
				ENDIF 
			ENDIF 	
		ENDIF 
		
		* Verific daca s-au selectat facturi trimise, la care nu am primit raspuns, posibil ERORI FACTURA
		* Se poate continua daca utilizatorul doreste
		Locate For ales = 1 And !EMPTY(NVL(id_incarcare,'')) 
		IF FOUND()
			IF AMessagebox('Atentie! Ati selectat facturi cu ID Incarcare (deja trimise)! Doriti sa le trimiteti din nou?' + CHR(13) + CHR(10) + CHR(13) + CHR(10) +;
				'Puteti trimite din nou doar facturile pentru care aveti TIP MESAJ RASPUNS = "ERORI FACTURI"' + CHR(13) + CHR(10) + ;
				'Nu trimiteti facturi la care nu ati primit inca raspuns!',4+32,_Screen.Caption) <> 6
				Goto m.lnRecno In crsFacturiEmise
				IF !This.lTest
					RETURN
				ENDIF 
		
			ENDIF 	
		ENDIF 
		
		* Verific daca s-au selectat facturi validate, tip_mesaj = FACTURA TRIMISA
		* Nu se poate continua
		Locate For ales = 1 And tip_mesaj_raspuns = 'FACTURA TRIMISA'
		If Found()
			AMessagebox('Atentie! Debifati facturile deja trimise cu succes (TIP MESAJ RASPUNS = "FACTURA TRIMISA")! Nu se continua!',0+48,_Screen.Caption)
			Goto m.lnRecno In crsFacturiEmise
			IF !This.lTest
				RETURN
			ENDIF 
		Endif
		Try
			Goto m.lnRecno In crsFacturiEmise
		Catch
			Go Top In crsFacturiEmise
		Endtry
		
		lnOptiune = xmenu('\<Valideaza ' + Iif(m.plValidareEFacturaOnline, 'online','DukIntegrator') + ' si Trimite la ANAF;\<Trimite la ANAF fara validare;Doar valideaza ' + Iif(m.plValidareEFacturaOnline, 'online','DukIntegrator'))
		
		If !Empty(m.lnOptiune)
			plFaraValidareEFactura = (m.lnOptiune = 2)
			llNuTrimiteEFacturaANAF = (m.lnOptiune = 3)
		SET STEP ON 
			llSucces = Thisform.oAnaf.TrimiteFacturi(m.llNuTrimiteEFacturaANAF)
			Thisform.pgfeFactura.page1.grdFacturiEmise.Refresh()
		Endif
		Return m.llSucces
		
		
		
	ENDPROC

	PROCEDURE trimitemesajfurnizor
		Local lnIdIncarcare, lcMesaj, llSucces, loReturn
		lnIdIncarcare = NVL(crsFacturiPrimite.id_incarcare, 0)
		lcMesaj = ALLTRIM(NVL(this.pgfeFactura.page2.txtMesajFurnizor.Value, ''))
		IF (EMPTY(m.lnIdIncarcare) OR EMPTY(m.lcMesaj))
			RETURN 
		ENDIF 
		
		IF !EMPTY(m.lcMesaj)
			IF AMESSAGEBOX('Doriti sa trimiteti mesajul furnizorului in SPV?',4+32,_screen.Caption) = 6
				loReturn = This.oAnaf.AnafeFacturaServer.SendMesaj(m.lnIdIncarcare, m.lcMesaj)
				IF !loReturn.lSucces
					AMESSAGEBOX(loReturn.cResponse,0+64,_SCREEN.Caption)
				ELSE
					AMESSAGEBOX('Mesaj trimis cu succes!',0+64,_SCREEN.Caption)	
				ENDIF 	
			ENDIF 	
			this.pgfeFactura.page2.txtMesajFurnizor.Value = ''
			this.pgfeFactura.page2.txtMesajFurnizor.Refresh()
		ENDIF 	
		 
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		
		* Am pus numar_act = Text pentru ca in facturi emise/primite, numar_act este Character, iar in facturi trimise este Number
		lcStringCriterii= "Nr. factura\numar_act\T\none\" + crlf + ;
			"Data factura\TRUNC(data_act)\D\none\" + crlf + ;	
			"Partener\partener\T\id_part\nom_parteneri" + crlf + ;	
			"Cod fiscal\cod_fiscal\T\none\" + crlf + ;		
			"Pers. juridice\nofiled\E\(tip_persoana=1)\" + crlf + ;			
			"Pers. fizice\nofiled\E\(tip_persoana=2)\" + crlf + ;				
			"Trimis\nofiled\E\(trimis = 1)\"  + crlf + ;
			"Netrimis\nofiled\E\(NVL(trimis,0) = 0)\"  + crlf + ;	
			"Data trimis\TRUNC(data_trimis)\D\none\"  + crlf + ; 
			"Data raspuns\TRUNC(data_raspuns)\D\none\"	
		DODEFAULT()
	ENDPROC

	PROCEDURE Lb_titlu_alb_b121.RightClick
		This.Parent.chkTest.Visible = .T.
	ENDPROC

	PROCEDURE pgfeFactura.Page1.Activate
		this.FontBold = .T.
		Thisform.RefreshDetaliiFacturi('EMISE')
		This.grdFacturiEmise.SetFocus()
		this.edtDetalii.Refresh()
	ENDPROC

	PROCEDURE pgfeFactura.Page1.chkDiferente.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page1.chkErori.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page1.chkNetrimise.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page1.chkPJ.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page1.chkTrimis.Valid
		Local llSucces
		llSucces = Thisform.BifeazaTrimisManual()
		IF m.llSucces
			thisform.nTrimis = this.Value 
		ENDIF  
	ENDPROC

	PROCEDURE pgfeFactura.Page1.chkTrimis.When
		Thisform.nTrimis = this.Value 
	ENDPROC

	PROCEDURE pgfeFactura.Page1.chkTrimise.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page1.cmdRaspunsuri.Click
		Thisform.CitesteRaspunsuri()
		thisform.do_cauta() 
	ENDPROC

	PROCEDURE pgfeFactura.Page1.cmdRaspunsuri.MouseEnter
		Lparameters nButton, nShift, nXCoord, nYCoord
		DoDefault(nButton, nShift, nXCoord, nYCoord)
		
		With Thisform.oAnaf.AnafeFacturaServer
			ldLastRunDate1 = NVL(.dLastRunDate1, {//::})
			ldLastRunDate2 = NVL(.dLastRunDate2, {//::})
			lnLastRunDays = NVL(.nLastRunDays, 0)
			lnLastRunSucces = NVL(.nLastRunSucces, 0)
		ENDWITH
		
		lcToolTip = 'Ultima citire raspunsuri SPV' + CHR(13) + ;
			'Start: ' + TTOC(m.ldLastRunDate1,3) + CHR(13) + ;
			'Final: ' + TTOC(m.ldLastRunDate2,3) + CHR(13) + ;
			'Zile: ' + ALLTRIM(STR(m.lnLastRunDays)) + CHR(13) + ;
			'Succes: ' + IIF(m.lnLastRunSucces = 1, 'DA', 'NU')
		
		This.ToolTipText = m.lcToolTip
	ENDPROC

	PROCEDURE pgfeFactura.Page1.cmdTrimite.Click
		Thisform.TrimiteFacturi()
	ENDPROC

	PROCEDURE pgfeFactura.Page1.Cmd_select_adv1.Click
		Local lnRecno, llFaraPersoaneFizice, lnSelectate
		Local lcData, lcData1, lcData2, lcData3, ldData, lnOptiune, ldDataSelectat
		
		ldData = Date()
		lcData = Dtoc(m.ldData)
		lcData1 = Dtoc(m.ldData-1)
		lcData2 = Dtoc(m.ldData-2)
		lcData3 = Dtoc(m.ldData-3)
		
		lnRecno = Recno('crsFacturiEmise')
		lnOptiune = 1
		lnSelectate = This.nSelectate
		
		If m.lnSelectate = 0
			lnOptiune = xmenu('Toate netrimise;Data factura: ' + m.lcData + ';Data factura: ' + m.lcData1 + ';Data factura: ' + m.lcData2 + ';Data factura: ' + m.lcData3)
			If Empty(m.lnOptiune)
				Return
			Endif
		Endif
		
		DoDefault()
		
		If m.lnSelectate = 0
		* Debifez facturile pentru persoane fizice
			llFaraPersoaneFizice = !(This.Parent.chkPersFizice.Value)
			If m.llFaraPersoaneFizice
				Update crsFacturiEmise Set ales = 0 Where tip_persoana = 2
			Endif
		
		* Debifez facturile cu data factura diferita de cea aleasa
		
			If m.lnOptiune > 1
				ldDataSelectat = Date() - (m.lnOptiune - 2)
				Update crsFacturiEmise Set ales = 0 Where data_act <> m.ldDataSelectat
			Endif
		
		* Debifez facturile cu id incarcare, exceptie cele cu ERORI FACTURA && transmise cu succes
			Update crsFacturiEmise Set ales = 0 Where !Empty(Nvl(id_incarcare,'')) And Alltrim(Nvl(tip_mesaj_raspuns,'')) <> 'ERORI FACTURA' && tip_mesaj_raspuns = 'FACTURA TRIMISA'
		
			Try
				SELECT crsFacturiEmise
				LOCATE FOR ales = 1
				IF !FOUND()
					Goto lnRecno
				ENDIF 	
				this.Parent.grdFacturiEmise.SetFocus()
			Catch
			Endtry
		
		Endif
		
	ENDPROC

	PROCEDURE pgfeFactura.Page1.Deactivate
		this.FontBold = .F.
	ENDPROC

	PROCEDURE pgfeFactura.Page1.grdFacturiEmise.AfterRowColChange
		Lparameters nColIndex
		If Inlist(This.RowColChange, 1, 3)
		
			This.Parent.txtMesajTrimis.Refresh()
			This.Parent.txtMesajRaspuns.Refresh()
			This.Parent.edtDetalii.Refresh()
		* Pot sa marchez/demarchez Trimis o factura emisa daca am trimis-o prin alte metode (am incarcat-o manual pe site-ul ANAF)
			This.Parent.chkTrimis.Enabled = Empty(Nvl(crsFacturiEmise.id_incarcare, ''))
			This.Parent.chkTrimis.Refresh()
		
			Thisform.RefreshDetaliiFacturi('EMISE')	
		Endif
		
		
		
		
		
		
	ENDPROC

	PROCEDURE pgfeFactura.Page1.grdFacturiEmise.cClient.Text1.DblClick
		loRec = nom_parteneri_modifica(crsFacturiEmise.id_client)
	ENDPROC

	PROCEDURE pgfeFactura.Page1.grdFacturiEmise.cCodFiscal.Text1.DblClick
		loRec = nom_parteneri_modifica(crsFacturiEmise.id_client)
	ENDPROC

	PROCEDURE pgfeFactura.Page1.grdFacturiEmise.cIdIncarcare.Text1.DblClick
		Local lcIdIncarcare, llSucces
		
		lcIdIncarcare = ALLTRIM(NVL(crsFacturiEmise.id_incarcare,''))
		
		IF AMESSAGEBOX('Doriti sa modificati ID-ul de Incarcare ANAF?' + CHR(13) + CHR(10) +;
			'ATENTIE! Faceti acest lucru doar daca s-a trimis factura de mai multe ori si factura are acum ID de incarcare al mesajului de eroare "factura duplicata"!',4+32,_screen.Caption) = 6
			lcIdIncarcare = INPUTBOX("Id Incarcare","Id Incarcare", m.lcIdIncarcare)
			IF EMPTY(NVL(m.lcIdIncarcare, ''))
				RETURN
			ENDIF 
			
		
			llSucces = Thisform.oAnaf.SuprascrieIdIncarcare(crsFacturiEmise.id_fact, m.lcIdIncarcare)
			IF m.llSucces
				REPLACE id_incarcare WITH m.lcIdIncarcare, mesaj_trimis WITH 'Transmis cu succes. Index incarcare = ' + m.lcIdIncarcare IN crsFacturiEmise
			ENDIF 
			Thisform.pgfeFactura.page1.grdFacturiEmise.Refresh()
		ENDIF 	 
	ENDPROC

	PROCEDURE pgfeFactura.Page1.grdFacturiEmise.cMesajRaspuns.Text1.DblClick
		AMESSAGEBOX(crsFacturiEmise.detalii)
	ENDPROC

	PROCEDURE pgfeFactura.Page1.lblAtasamente.DblClick
		* Configurez directorul atasamente pdf factura
		IF !thisform.pgfeFactura.page1.cboAtasamente.Enabled
			lcPdfPath = GetDocumentPath("factura")
			IF !EMPTY(NVL(m.lcPdfPath,''))
				thisform.pgfeFactura.page1.lblAtasamente.Caption = 'Director atasamente: ' + JUSTPATH(m.lcPdfPath)
				thisform.pgfeFactura.page1.cboAtasamente.Enabled = .T.
				thisform.pgfeFactura.page1.cboAtasamente.Value = 0
			ENDIF 	
		ENDIF 	
		
	ENDPROC

	PROCEDURE pgfeFactura.Page2.Activate
		this.FontBold = .T.
		
		* Aduc inregistrarile automat la prima activare a paginii
		* La lansarea formularului, intru cu cursorul gol
		IF !Thisform.lPrimaActivarePrimite
			Thisform.lPrimaActivarePrimite = .T.
			Thisform.do_cauta()
		ENDIF 	
		
		Thisform.RefreshDetaliiFacturi('PRIMITE')
		this.grdFacturiPrimite.SetFocus()
		this.edtDetalii.Refresh()
	ENDPROC

	PROCEDURE pgfeFactura.Page2.chkDiferente.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page2.chkLipsaRegistru.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page2.cmdTrimiteMesajFurnizor.Click
		Thisform.TrimiteMesajFurnizor()
	ENDPROC

	PROCEDURE pgfeFactura.Page2.Deactivate
		this.FontBold = .F.
	ENDPROC

	PROCEDURE pgfeFactura.Page2.edtDetalii.DblClick
		Local lcFile, llSucces
		PRIVATE pcDetalii, pnIdEfactura
		
		pnIdEfactura = NVL(crsFacturiPrimite.id,0)
		
		IF !EMPTY(m.pnIdEfactura) AND (EMPTY(NVL(crsFacturiPrimite.detalii,'')) OR UPPER(ALLTRIM(m.gcUserNameApp)) == 'SUPERVIZOR')
			IF AMESSAGEBOX('Doriti sa completati detalii cu xml eFactura?',4+32, _Screen.Caption) = 6
				lcFile = GETFILE('xml')
				IF !EMPTY(m.lcFile) AND FILE(m.lcFile)
					pcDetalii = FILETOSTR(m.lcFile)
					llSucces = goExecutor.oExecuta('update anaf_efactura set detalii = ?pcDetalii where id = ?pnIdEfactura')
				ENDIF 
			ENDIF 
		ENDIF 	
			
		 
	ENDPROC

	PROCEDURE pgfeFactura.Page2.grdFacturiPrimite.AfterRowColChange
		LPARAMETERS nColIndex
		LOCAL lcFiltru
		If Inlist(This.RowColChange, 1, 3)
			This.Parent.edtDetalii.Refresh()
			Thisform.RefreshDetaliiFacturi('PRIMITE')
		Endif
		
	ENDPROC

	PROCEDURE pgfeFactura.Page2.grdFacturiPrimite.cCodFiscalEmitent.Text1.DblClick
		IF !EMPTY(crsFacturiPrimite.detalii)
			IF AMESSAGEBOX('Doriti sa extrageti articolele din detalii si sa completati in baza de date?',4+32,_screen.Caption)=6
				llSucces = Thisform.oAnaf.Detalii2UpdateFactura(crsFacturiPrimite.id, crsFacturiPrimite.detalii)
			ENDIF 
		ENDIF 	
	ENDPROC

	PROCEDURE pgfeFactura.Page2.grdFacturiPrimite.cNr.Text1.RightClick
		lnOptiune = xmenu('Descarcare arhiva zip raspuns ANAF')
		IF m.lnOptiune = 1
			llSucces = Thisform.oAnaf.DownloadDetaliiZip(crsFacturiPrimite.id)	
		ENDIF 
	ENDPROC

	PROCEDURE pgfeFactura.Page3.Activate
		This.FontBold = .T.
		
		* Aduc inregistrarile automat la prima activare a paginii
		* La lansarea formularului, intru cu cursorul gol
		IF !Thisform.lPrimaActivareTrimise
			Thisform.lPrimaActivareTrimise = .T.
			Thisform.do_cauta()
		ENDIF 	
		
		Thisform.RefreshDetaliiFacturi('TRIMISE')
		this.grdFacturiTrimise.SetFocus()
		this.edtDetalii.Refresh()
	ENDPROC

	PROCEDURE pgfeFactura.Page3.chkDiferente.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page3.chkLipsaRegistru.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE pgfeFactura.Page3.Deactivate
		this.FontBold = .F.
	ENDPROC

	PROCEDURE pgfeFactura.Page3.grdFacturiTrimise.AfterRowColChange
		LPARAMETERS nColIndex
		LOCAL lcFiltru
		If Inlist(This.RowColChange, 1, 3)
			This.Parent.edtDetalii.Refresh()
			This.Parent.txtMesajTrimis.Refresh()
			This.Parent.txtMesajRaspuns.Refresh()	
			Thisform.RefreshDetaliiFacturi('TRIMISE')
		Endif
		
	ENDPROC

	PROCEDURE pgfeFactura.Page3.grdFacturiTrimise.cCodFiscalBeneficiar.Text1.DblClick
		IF !EMPTY(crsFacturiTrimise.detalii)
			IF AMESSAGEBOX('Doriti sa extrageti articolele din detalii si sa completati in baza de date?',4+32,_screen.Caption)=6
				llSucces = Thisform.oAnaf.Detalii2UpdateFactura(crsFacturiTrimise.id, crsFacturiTrimise.detalii)
			ENDIF 
		ENDIF 	
	ENDPROC

	PROCEDURE pgfeFactura.Page3.grdFacturiTrimise.cId.Text1.DblClick
		IF !EMPTY(crsFacturiTrimise.detalii)
			IF AMESSAGEBOX('Doriti sa extrageti articolele din detalii si sa completati in baza de date?',4+32,_screen.Caption)=6
				llSucces = Thisform.oAnaf.Detalii2UpdateFactura(crsFacturiTrimise.id, crsFacturiTrimise.detalii)
			ENDIF 
		ENDIF 	
	ENDPROC

	PROCEDURE pgfeFactura.Page4.Activate
		this.FontBold = .T.
	ENDPROC

	PROCEDURE pgfeFactura.Page4.Deactivate
		this.FontBold = .F.
	ENDPROC

	PROCEDURE pgfeFactura.Page4.lblToken.DblClick
		Thisform.GetToken()
	ENDPROC

	PROCEDURE pgfeFactura.Page4.txtResponsesPathLocal.DblClick
		open_default_app(this.value)
	ENDPROC

ENDDEFINE

DEFINE CLASS anaf_efactura_xml 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="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdTrimite" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cFile.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cFile.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cProcesat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cProcesat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cProcesat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cStare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cStare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cMesaj.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cMesaj.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cExtern.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cExtern.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFiles.cExtern._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkTest" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_select_adv1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkErori" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkValidareOnline" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: ltest_assign
		*p: cdirectory
		*p: lsilentios		&& Erori silentios
		*p: ltest
		*p: oanaf
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cdirectory = 
		DoCreate = .T.
		Height = 467
		lsilentios = .F.
		ltest = .F.
		Name = "anaf_efactura_xml"
		oanaf = .NULL.
		Width = 771
		_memberdata = <VFPData>
			<memberdata name="oanaf" display="oAnaf"/>
			<memberdata name="cdirectory" display="cDirectory"/>
			<memberdata name="ltest" display="lTest"/>
			<memberdata name="lsilentios" display="lSilentios"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 780
		_shape2.Anchor = 8
		_shape2.Left = 719
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Caption = "Fisiere xml eFactura"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 739
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'chkErori' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		Caption = "Erori silentioase", ;
		ControlSource = "Thisform.lSilentios", ;
		FontBold = .F., ;
		ForeColor = 0,128,128, ;
		Left = 476, ;
		Name = "chkErori", ;
		ToolTipText = "Programul continua trimiterea cu urmatorul fisier, fara sa intrebe daca se opreste/continua.", ;
		Top = 419, ;
		Visible = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkTest' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		Caption = "Server ANAF Test", ;
		ControlSource = "Thisform.lTest", ;
		FontBold = .F., ;
		ForeColor = 0,128,128, ;
		Left = 476, ;
		Name = "chkTest", ;
		ToolTipText = "Trimite eFactura pe serverul de Test la ANAF", ;
		Top = 401, ;
		Visible = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkValidareOnline' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		Caption = "Validare online", ;
		FontBold = .F., ;
		ForeColor = 0,64,128, ;
		Left = 476, ;
		Name = "chkValidareOnline", ;
		ToolTipText = "Se valideaza xml eFactura online pe serverul ANAF inainte de a se trimite in sistemul eFactura. Alternativ, se valideaza offline cu DukIntegrator", ;
		Top = 437, ;
		Value = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Alignment = 2, ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "\<Alege director/fisier", ;
		FontBold = .T., ;
		ForeColor = 0,128,128, ;
		Height = 27, ;
		Left = 624, ;
		Name = "Cmd_executa1", ;
		ToolTipText = "Genereaza xml si trimite la ANAF eFactura pentru facturile selectate / factura curenta", ;
		Top = 403, ;
		Visible = .T., ;
		Width = 140, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_select_adv1' AS cmd_select_adv WITH ;
		Anchor = 6, ;
		ccoloana = ales, ;
		cgrid = Thisform.grdFiles, ;
		FontBold = .F., ;
		FontUnderline = .T., ;
		ForeColor = 0,64,128, ;
		Height = 27, ;
		Left = 4, ;
		Name = "Cmd_select_adv1", ;
		Top = 402, ;
		Width = 105
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdTrimite' AS cmd_executa WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "\<Trimite", ;
		ForeColor = 0,64,128, ;
		Height = 27, ;
		Left = 624, ;
		Name = "cmdTrimite", ;
		ToolTipText = "Genereaza xml si trimite la ANAF eFactura pentru facturile selectate / factura curenta", ;
		Top = 432, ;
		Visible = .T., ;
		Width = 140, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdFiles' AS _grdbase WITH ;
		Anchor = 15, ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 358, ;
		Left = 4, ;
		Name = "grdFiles", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "cXmlFiles", ;
		RowHeight = 19, ;
		Top = 38, ;
		Width = 757, ;
		Column1.ControlSource = "cXmlFiles.ales", ;
		Column1.CurrentControl = "_checkbox1", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cAles", ;
		Column1.ReadOnly = .F., ;
		Column1.Sparse = .F., ;
		Column1.Width = 30, ;
		Column2.ControlSource = "cXmlFiles.filepath", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cFile", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 322, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "cXmlFiles.procesat", ;
		Column3.CurrentControl = "_checkbox1", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cProcesat", ;
		Column3.ReadOnly = .T., ;
		Column3.Sparse = .F., ;
		Column3.Width = 56, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "cXmlFiles.stare", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cStare", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 102, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "cXmlFiles.mesaj", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cMesaj", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 211, ;
		Column6.ColumnOrder = 3, ;
		Column6.ControlSource = "cXmlFiles.extern", ;
		Column6.CurrentControl = "_checkbox1", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cExtern", ;
		Column6.ReadOnly = .F., ;
		Column6.Sparse = .F., ;
		Column6.Width = 42
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdFiles.cAles._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Left = 13, ;
		Name = "_checkbox1", ;
		Top = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdFiles.cAles.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 'grdFiles.cExtern._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		BackColor = 255,255,255, ;
		Caption = "", ;
		ControlSource = "cXmlFiles.extern", ;
		Left = 22, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 69
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdFiles.cExtern.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 'grdFiles.cFile.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fisier", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFiles.cFile.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 'grdFiles.cMesaj.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Mesaj", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFiles.cMesaj.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 'grdFiles.cProcesat._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Left = 32, ;
		Name = "_checkbox1", ;
		Top = 81
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdFiles.cProcesat.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 'grdFiles.cStare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFiles.cStare.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 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.grdFiles, ;
		Left = 732, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 372
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />
	
	PROCEDURE Init
		LPARAMETERS toAnaf
		
		DODEFAULT()
		
		This.oAnaf = toAnaf
		
		This.grdFiles.SetAll("DynamicBackColor", "IIF(stare = 'EROARE', RGB(255,140,140), RGB(255,255,255))", "Column")
		This.grdFiles.cExtern.DynamicBackColor = "RGB(255,255,225)"
		
		This.gridextra1.setup()
	ENDPROC

	PROCEDURE ltest_assign
		lparameters tlTest
		This.lTest = tlTest
		
		Thisform.oAnaf.lTest = m.tlTest
		
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		
		this.Width = INT(0.7*_screen.Width)
		this.Height = INT(0.7*_screen.Height)
		this.AutoCenter = .T.
	ENDPROC

	PROCEDURE cmdTrimite.Click
		LOCAL lnOptiune, lcMesaj
		Local loAnaf As 'AnafeFacturaServer'
		Local llNuTrimiteEFacturaANAF, llSucces, llSilentios, llExtern
		
		llSilentios = Thisform.lSilentios && erori silentioase
		
		UPDATE cXMLFiles SET ales = 0 WHERE procesat = 1
		
		SELECT cXmlFiles
		LOCATE FOR ales = 1
		IF !FOUND()
			AMESSAGEBOX('Alegeti fisiere (neprocesate)!',0+48,_screen.Caption)
			RETURN
		ENDIF 
		
		
		
		llValidareOnline = (Thisform.chkValidareOnline.Value = 1)
		lnOptiune = xmenu('\<Valideaza ' + Iif(m.llValidareOnline, 'online','DukIntegrator') + ' si Trimite la ANAF;\<Trimite la ANAF fara validare;Doar valideaza ' + Iif(m.llValidareOnline, 'online','DukIntegrator'))
		
		If Empty(m.lnOptiune)
			RETURN
		ENDIF 
		
		llValidare = INLIST(m.lnOptiune,1,3)
		llNuTrimiteEFacturaANAF = (m.lnOptiune = 3)
		
		lcDirectoryProcessed = Thisform.cDirectory + 'procesat\'
		TRY 
			IF !DIRECTORY(m.lcDirectoryProcessed)
				MD (m.lcDirectoryProcessed)
			ENDIF 	
		CATCH TO loEx
			lcMesaj = 'Nu s-a putut crea directorul ' + m.lcDirectoryProcessed + ' ' + loEx.Message
			AMESSAGEBOX(m.lcMesaj,0+48,_screen.Caption)
		ENDTRY 	
		IF !DIRECTORY(m.lcDirectoryProcessed)
			RETURN
		ENDIF 
		
		loAnaf = Thisform.oAnaf
		
		* Scanez fisiere alese si neprocesate
		lcTextImport = ''
		lcLogFile = Thisform.cDirectory + 'send_xml_log_' + TTOC(DATETIME(),1) + '.txt'
		
		CALCULATE CNT() FOR ales = 1 AND procesat = 0 TO lnCnt
		lcCnt = ALLTRIM(STR(m.lnCnt))
		lnIndex = 0
		SELECT cXmlFiles
		SCAN FOR ales = 1 AND procesat = 0
			lnIndex = lnIndex + 1 
			lcFile = ALLTRIM(filepath)
			lcFileErr = ADDBS(JUSTPATH(m.lcFile)) + JUSTSTEM(m.lcFile) + '.err.txt'
			llExtern = (extern = 1)
			WAIT WINDOW PADL(STR(m.lnIndex),10, ' ') + '/' + m.lcCnt + ' ' + JUSTFNAME(m.lcFile) NOWAIT 
			
			lcMesaj = ''
			* sterg fisier eroare
			IF FILE(m.lcFileErr)
				DELETE FILE (m.lcFileErr)
			ENDIF 
			
			IF FILE(m.lcFile)		
				loReturn = loAnaf.TrimiteFacturaXML(m.lcFile, m.llValidare, m.llValidareOnline, m.llNuTrimiteEFacturaANAF, m.llExtern)
				llSucces = loReturn.lSucces
				lcIdIncarcare = loReturn.cIdIncarcare
				lcMesaj = loReturn.cMesaj
				
				lcTextImport = lcTextImport + m.lcFile + ' ' + m.lcMesaj + CHR(13) + CHR(10)
				
				STRTOFILE(m.lcTextImport, lcLogFile, 1)
				
				SELECT cXmlFiles
				REPLACE ales WITH 0, procesat WITH 1, stare WITH IIF(m.llSucces, 'SUCCES', 'EROARE'), mesaj WITH m.lcMesaj
				
				* Mut fisierul trimis intr-un director
				IF m.llSucces AND !m.llNuTrimiteEFacturaANAF
					lcFile2 = m.lcIdIncarcare + '_' + JUSTFNAME(m.lcFile)
					llSucces2 = loAnaf.SaveFile(m.lcFile, .F., m.lcDirectoryProcessed, m.lcFile2)
					TRY 
						DELETE FILE (m.lcFile)
					CATCH TO loEx
						lcMesaj2 = AMESSAGEBOX('Nu s-a putut sterge fisierul ' + m.lcFile + ' ' + loEx.Message,0+48,_screen.Caption)
						STRTOFILE(m.lcMesaj2, lcLogFile, 1)
						
						AMESSAGEBOX(m.lcMesaj2,0+48,_screen.Caption)
					ENDTRY 	
				ELSE 
					* Creez fisier eroare
					IF !m.llSucces
						STRTOFILE(m.lcMesaj, m.lcFileErr)
					ENDIF 	
				ENDIF 
			ELSE
				SELECT cXmlFiles
				REPLACE ales with 0, procesat WITH 1, stare WITH "EROARE", mesaj WITH "Nu exista fisierul"
			ENDIF 	
			
			If !m.llSucces AND !m.llSilentios
				If AMESSAGEBOX('Doriti sa continuati?' + CHR(10) + CHR(10) + m.lcMesaj, 4 + 32, _Screen.Caption) <> 6
					Exit
				Endif
			ENDIF 
		ENDSCAN 	
	ENDPROC

	PROCEDURE Cmd_executa1.Click
		Local laFiles[1], lcFile, lcFileSkeleton, lcMenu, lcPath, lcSendFile, lcSendPath, llSucces, lnFile
		Local lnFiles, lnOptiune
		Local lcTempPath, lcText
		
		llSucces = .T.
		
		lcSendPath = Addbs(NVL(Thisform.oAnaf.cSendPath, ''))
		IF !DIRECTORY(m.lcSendPath)
			lcSendPath = ''
		ENDIF 
		lcSendFile = ''
		lcMenu = Iif(!Empty(m.lcSendPath), 'Directorul ' + m.lcSendPath + ';' , '\-;') + '\<Directorul ...; \<Fisierul...'
		lnOptiune = xmenu(m.lcMenu)
		If Empty(m.lnOptiune)
			Return
		Endif
		Do Case
			Case m.lnOptiune = 1
				If !Directory(m.lcSendPath)
					This.Log('Nu exista directorul ' + m.cSendFacturaPath)
					Return m.llSucces
				ENDIF
				lcFileSkeleton = lcSendPath + '*.xml'
				lcPath = m.lcSendPath
			Case m.lnOptiune = 2
		
				lcTempPath = NVL(getini(m.gcGeneralIniFile, "efactura", "xml_send_path"), '')
				IF !DIRECTORY(m.lcTempPath)
					lcTempPath = ''
				ENDIF 			
				lcText = IIF(!EMPTY(m.lcTempPath), m.lcTempPath, 'Director xml')
				lcSendPath = Getdir(m.lcTempPath, m.lcText, 'Alege directorul cu fisiere xml eFactura',64)
				IF EMPTY(m.lcSendPath)
					RETURN
				ENDIF 
				If !Directory(m.lcSendPath)
					This.Log('Nu exista directorul ' + m.cSendFacturaPath)
					Return m.llSucces
				Endif
				
				setini(m.gcGeneralIniFile, "efactura", "xml_send_path", m.lcSendPath)
				lcFileSkeleton = lcSendPath + '*.xml'
				lcPath = m.lcSendPath
			Case m.lnOptiune = 3
				lcSendFile = Getfile('xml', 'Fisier xml', 'Alege', 0, 'Alege fisierul xml eFactura')
				IF EMPTY(m.lcSendFile)
					RETURN
				ENDIF 
				If !File(m.lcSendFile)
					This.Log('Nu exista fisierul ' + m.lcSendFile)
					Return m.llSucces
				ENDIF
				lcFileSkeleton = m.lcSendFile
				lcPath = JUSTPATH(m.lcSendFile)
		Endcase
		
		lcPath = ADDBS(m.lcPath)
		Thisform.cDirectory = m.lcPath
		
		lnFiles = Adir(laFiles, m.lcFileSkeleton)
		DELETE FROM cXmlFiles
		For lnFile = 1 To m.lnFiles
			lcFile = m.lcPath + laFiles[m.lnFile,1]
			INSERT INTO cXmlFiles (ales, filepath) VALUES (1, m.lcFile)
		ENDFOR 
		
		SELECT cXmlFiles
		GO TOP  
		thisform.grdFiles.Refresh()
		thisform.grdFiles.SetFocus() 
	ENDPROC

	PROCEDURE grdFiles.cFile.Text1.DblClick
		Local lcFile
		
		lcFile = ALLTRIM(NVL(filepath,''))
		
		IF !EMPTY(m.lcFile) AND FILE(m.lcFile)
			open_default_app(m.lcFile)
			open_default_app(JUSTPATH(m.lcFile))
		ENDIF  
	ENDPROC

	PROCEDURE grdFiles.cMesaj.Text1.DblClick
		LOCAL lcFile
		lcFile = cXmlFiles.filepath
		lcFile = ADDBS(JUSTPATH(m.lcFile)) + JUSTSTEM(m.lcFile) + '.err.txt'
		IF FILE(m.lcFile)
			open_default_app(m.lcFile)
		ENDIF 
	ENDPROC

	PROCEDURE Lb_titlu_alb_b121.RightClick
		This.Parent.chkTest.Visible = .T.
	ENDPROC

ENDDEFINE

DEFINE CLASS anaf_spv 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="cmdMesaje" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdAtasamente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cId.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cId.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cDetalii.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cDetalii.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cDataCreare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cDataCreare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cDescarcat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cDescarcat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cDescarcat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cCIF.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cCIF.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cIdSolicitare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cIdSolicitare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cTip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cTip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cCitit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cCitit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cCitit._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cArhivat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cArhivat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdSPV.cArhivat._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_select_adv1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: ltest_assign
		*m: marcheazacitit
		*m: optiunigrid
		*m: updatespv
		*p: cdirectory
		*p: lsilentios		&& Erori silentios
		*p: ltest
		*p: oanaf
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cdirectory = 
		DoCreate = .T.
		Height = 467
		lsilentios = .F.
		ltest = .F.
		Name = "anaf_spv"
		oanaf = .NULL.
		Width = 771
		_memberdata = <VFPData>
			<memberdata name="oanaf" display="oAnaf"/>
			<memberdata name="cdirectory" display="cDirectory"/>
			<memberdata name="ltest" display="lTest"/>
			<memberdata name="lsilentios" display="lSilentios"/>
			<memberdata name="optiunigrid" display="OptiuniGrid"/>
			<memberdata name="marcheazacitit" display="MarcheazaCitit"/>
			<memberdata name="updatespv" display="UpdateSPV"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 780
		_shape2.Anchor = 8
		_shape2.Left = 719
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Caption = "Mesaje SPV"
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		Lb_titlu_alb_b121.Top = 1
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 739
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

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

	ADD OBJECT 'Cmd_select_adv1' AS cmd_select_adv WITH ;
		Anchor = 6, ;
		ccoloana = ales, ;
		cgrid = Thisform.grdSPV, ;
		FontBold = .F., ;
		FontUnderline = .T., ;
		ForeColor = 0,64,128, ;
		Height = 27, ;
		Left = 4, ;
		Name = "Cmd_select_adv1", ;
		TabIndex = 6, ;
		Top = 432, ;
		Width = 105
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdAtasamente' AS cmd_executa WITH ;
		Alignment = 2, ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "\<Descarca atasamente", ;
		FontBold = .T., ;
		ForeColor = 0,64,128, ;
		Height = 27, ;
		Left = 609, ;
		Name = "cmdAtasamente", ;
		TabIndex = 2, ;
		ToolTipText = "Descarca mesajele din SPV si documentele PDF asociate", ;
		Top = 432, ;
		Visible = .T., ;
		Width = 152, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdMesaje' AS cmd_executa WITH ;
		Alignment = 2, ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "\<Descarca mesaje", ;
		FontBold = .T., ;
		ForeColor = 0,128,128, ;
		Height = 27, ;
		Left = 454, ;
		Name = "cmdMesaje", ;
		TabIndex = 1, ;
		ToolTipText = "Descarca mesajele din SPV si documentele PDF asociate", ;
		Top = 432, ;
		Visible = .T., ;
		Width = 152, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdSPV' AS _grdbase WITH ;
		Anchor = 15, ;
		ColumnCount = 10, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		GridLines = 1, ;
		Height = 384, ;
		Left = 4, ;
		Name = "grdSPV", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "cMesajeSPV", ;
		RowHeight = 19, ;
		TabIndex = 3, ;
		Top = 36, ;
		Width = 757, ;
		Column1.ControlSource = "ales", ;
		Column1.CurrentControl = "_checkbox1", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cAles", ;
		Column1.ReadOnly = .F., ;
		Column1.Sparse = .F., ;
		Column1.Width = 30, ;
		Column2.ColumnOrder = 7, ;
		Column2.ControlSource = "Id", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cId", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 110, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "detalii", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDetalii", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 185, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "data_creare", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cDataCreare", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 117, ;
		Column5.ColumnOrder = 9, ;
		Column5.ControlSource = "descarcat", ;
		Column5.CurrentControl = "_checkbox1", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cDescarcat", ;
		Column5.ReadOnly = .F., ;
		Column5.Sparse = .F., ;
		Column5.Width = 68, ;
		Column6.ColumnOrder = 6, ;
		Column6.ControlSource = "cif", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cCIF", ;
		Column6.ReadOnly = .T., ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "id_solicitare", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cIdSolicitare", ;
		Column7.ReadOnly = .T., ;
		Column8.ColumnOrder = 3, ;
		Column8.ControlSource = "tip", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cTip", ;
		Column8.ReadOnly = .T., ;
		Column9.ColumnOrder = 2, ;
		Column9.ControlSource = "citit", ;
		Column9.CurrentControl = "_checkbox1", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cCitit", ;
		Column9.ReadOnly = .F., ;
		Column9.Sparse = .F., ;
		Column9.Width = 40, ;
		Column10.ControlSource = "cMesajeSPV.arhivat", ;
		Column10.CurrentControl = "_checkbox1", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cArhivat", ;
		Column10.ReadOnly = .F., ;
		Column10.Sparse = .F., ;
		Column10.Width = 57
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdSPV.cAles._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "cMesajeSPV.ales", ;
		FontSize = 10, ;
		Left = 13, ;
		Name = "_checkbox1", ;
		Top = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdSPV.cAles.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 'grdSPV.cArhivat._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontSize = 10, ;
		Left = 34, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 45
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

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

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

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

	ADD OBJECT 'grdSPV.cCitit._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		ControlSource = "cMesajeSPV.citit", ;
		FontSize = 10, ;
		Left = 35, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 81
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

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

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

	ADD OBJECT 'grdSPV.cDataCreare.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 'grdSPV.cDescarcat._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		BackColor = 255,255,255, ;
		Caption = "", ;
		ControlSource = "cMesajeSPV.descarcat", ;
		FontSize = 10, ;
		Left = 22, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		Top = 69
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdSPV.cDescarcat.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 'grdSPV.cDetalii.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Detalii", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdSPV.cDetalii.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 'grdSPV.cId.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdSPV.cId.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 'grdSPV.cIdSolicitare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id solicitare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdSPV.cTip.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		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.grdSPV, ;
		Left = 732, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 372
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Lb_shortcuts1' AS lb_shortcuts WITH ;
		Caption = "Dublu click = Bifeaza Citit ;  Click dreapta = Citit/Arhivat/Descarca/Deschide atasament", ;
		Left = 14, ;
		Name = "Lb_shortcuts1", ;
		Top = 15
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru=tcFiltru
		
		If Empty(lcFiltru)
			lcFiltru = poMesaje.ca_baza1.cfiltru
		Endif
		
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		save_grid_tag(Thisform.grdSPV)
		poMesaje.ca_baza1.cfiltru=lcFiltru
		poMesaje.ca_baza1.afisare()
		restore_grid_tag(Thisform.grdSPV)
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru, lcInit, llcautare
		
		* Filtre buton cautare
		IF LEN(This.filtru_pretty) > 0 AND This.filtru_pretty#"none"    
			lcFiltru = "(" + ALLTRIM(THISFORM.filtru_pretty) + ")"    
		ELSE
			lcFiltru = "(arhivat=0)"	
			
			* daca se doreste ca la intrarea in form sa se puna un filtru:
			lcInit = [Nearhivat;nofiled;1;;]
			llcautare = This.but_start_criterii1.lcautare
			This.but_start_criterii1.lcautare = .F.
			This.but_start_criterii1.loadfiltru(m.lcInit)
			This.but_start_criterii1.lcautare = m.llcautare	 	
		ENDIF
		
		IF (THIS.filtru_pretty#"none")
			THISFORM.actualizeaza_grid1(m.lcFiltru)
			IF RECCOUNT('cMesajeSPV')=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			ENDIF
		ENDIF
		
		SELECT cMesajeSPV
		GO TOP 
		
		Return m.lcFiltru
		   
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toAnaf
		
		Local lcInit, llcautare, lnCol, loColumn, loControl
		
		DODEFAULT()
		
		This.oAnaf = toAnaf
		
		This.gridextra1.setup()
		
		* Mesajele necitite au fundal albastru inchis sau deschis, alternativ
		this.grdSPV.SetAll("DynamicBackColor", "IIF(citit = 1, RGB(255,255,255), IIF(MOD(RECNO(),2) = 0, RGB(150,255,250), RGB(125,255,210)))", "Column")
		
		* Right click in grid apare meniu
		FOR lnCol = 1 TO This.grdSPV.ColumnCount
		  loColumn = This.grdSPV.Columns[lnCol]
		  FOR EACH loControl IN loColumn.Controls
		    IF LOWER( loControl.BaseClass ) = 'textbox'
		      BINDEVENT( loControl, 'RightClick', Thisform, 'OptiuniGrid' )
		      BINDEVENT( loControl, 'DblClick', Thisform, 'MarcheazaCitit' )      
		    ENDIF
		  ENDFOR
		ENDFOR
		
		* daca se doreste ca la intrarea in form sa se puna un filtru:
		lcInit = [Nearhivat;nofiled;1;;]
		llcautare = This.but_start_criterii1.lcautare
		This.but_start_criterii1.lcautare = .F.
		This.but_start_criterii1.loadfiltru(m.lcInit)
		This.but_start_criterii1.lcautare = m.llcautare	 
	ENDPROC

	PROCEDURE ltest_assign
		lparameters tlTest
		This.lTest = tlTest
		
		Thisform.oAnaf.lTest = m.tlTest
		
	ENDPROC

	PROCEDURE marcheazacitit
		Local lnId
		
		lnId = NVL(cMesajeSPV.id, 0)
		IF EMPTY(m.lnId)
			RETURN
		ENDIF 
		
		llSucces = Thisform.oAnaf.UpdateSPV(m.lnId, 'citit', 1) 
		IF m.llSucces
			This.UpdateSPV('citit', 1)
		ENDIF 
	ENDPROC

	PROCEDURE optiunigrid
		Local lcTip, llSucces, lnId, lnOptiune, ltDataCreare
		
		lnId = NVL(cMesajeSPV.id, 0)
		IF EMPTY(m.lnId)
			RETURN
		ENDIF 
		
		lnOptiune = xmenu('Marcheaza citit;Arhiveaza;Descarca atasament;Deschide atasament')
		
		DO CASE 
			CASE m.lnOptiune = 1
				llSucces = Thisform.oAnaf.UpdateSPV(m.lnId, 'citit', 1)
				IF m.llSucces
					Thisform.UpdateSPV('citit', 1)
				ENDIF 
			CASE m.lnOptiune = 2
				llSucces = Thisform.oAnaf.UpdateSPV(m.lnId, 'arhivat', 1)
				IF m.llSucces
					Thisform.UpdateSPV('arhivat', 1)
				ENDIF 
		
			CASE m.lnOptiune = 3
				Thisform.oAnaf.DescarcaDetaliiSPV(m.lnId)
			CASE m.lnOptiune = 4
				Thisform.oAnaf.DeschideAtasamentSPV(m.lnId)
		ENDCASE  
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		
		this.WindowState= 2
		
		*!*	this.Width = INT(0.7*_screen.Width)
		*!*	this.Height = INT(0.7*_screen.Height)
		*!*	this.AutoCenter = .T.
	ENDPROC

	PROCEDURE updatespv
		LPARAMETERS tcAtribut, tnValoare
		
		Local lcAtribut, lnValoare
		
		lcAtribut = LOWER(ALLTRIM(m.tcAtribut))
		lnValoare = IIF(!EMPTY(m.tnValoare), m.tnValoare, 0)
		
		REPLACE &lcAtribut WITH m.lnValoare IN cMesajeSPV
		 
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		
		* Am pus numar_act = Text pentru ca in facturi emise/primite, numar_act este Character, iar in facturi trimise este Number
		lcStringCriterii= "Tip\tip\T\none\" + crlf + ;		
			"Detalii\detalii\T\none\" + crlf + ;			
			"Data creare\TRUNC(data_trimis)\D\none\"  + crlf + ; 
			"Citit\nofiled\E\(citit = 1)\"  + crlf + ;
			"Necitit\nofiled\E\(NVL(citit,0) = 0)\"  + crlf + ;	
			"Arhivat\nofiled\E\(arhivat = 1)\"  + crlf + ;
			"Nearhivat\nofiled\E\(NVL(arhivat,0) = 0)\"  + crlf + ;	
			"Descarcat\nofiled\E\(descarcat = 1)\"  + crlf + ;
			"Nedescarcat\nofiled\E\(NVL(descarcat,0) = 0)\"  + crlf + ;	
			"Id\id\T\none\" + crlf + ;		
			"Id solicitare\id_solicitare\T\none\"
		
		DODEFAULT()
	ENDPROC

	PROCEDURE cmdAtasamente.Click
		Local lnRecno
		
		SELECT cMesajeSPV
		lnRecno = RECNO()
		LOCATE FOR ales = 1 or descarcat = 0
		IF !FOUND()
			AMESSAGEBOX('Alegeti cel putin un mesaj!',0+48,_screen.Caption)
		ELSE 
			Thisform.oAnaf.DescarcaDetaliiSPV()
		ENDIF 
		
		TRY 
			SELECT cMesajeSPV
			GOTO m.lnRecno
		CATCH 
		ENDTRY 
		
		 
	ENDPROC

	PROCEDURE cmdMesaje.Click
		Thisform.oAnaf.GetSPV()
		
		Thisform.do_cauta()
		
		Thisform.grdSPV.Refresh()
		Thisform.grdSPV.SetFocus()
	ENDPROC

	PROCEDURE grdSPV.cArhivat._checkbox1.InteractiveChange
		Local llSucces
		
		llSucces = Thisform.oAnaf.UpdateSPV(cMesajeSPV.id, 'arhivat', NVL(this.Value, 0))
		IF m.llSucces
			Thisform.UpdateSPV('arhivat', 1)
		ENDIF     
	ENDPROC

	PROCEDURE grdSPV.cCitit._checkbox1.InteractiveChange
		Local llSucces
		
		llSucces = Thisform.oAnaf.UpdateSPV(cMesajeSPV.id, 'citit', NVL(this.Value, 0))
		IF m.llSucces
			Thisform.UpdateSPV('citit', 1)
		ENDIF   
	ENDPROC

	PROCEDURE grdSPV.cDescarcat._checkbox1.InteractiveChange
		Local llSucces
		
		llSucces = Thisform.oAnaf.UpdateSPV(cMesajeSPV.id, 'descarcat', NVL(this.Value, 0))
		IF m.llSucces
			Thisform.UpdateSPV('descarcat', 1)
		ENDIF  
	ENDPROC

ENDDEFINE

DEFINE CLASS anaf_token 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="_label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="edtToken" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblGenDate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="edtRefreshToken" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblExpDate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label6" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: ctoken
		*p: poanaf
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		ctoken = 
		DoCreate = .T.
		Height = 401
		Name = "anaf_token"
		poanaf = .F.
		Width = 517
		_memberdata = <VFPData>
			<memberdata name="poanaf" display="poAnaf"/>
			<memberdata name="ctoken" display="cToken"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 528
		_shape2.Left = 469
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Caption = "Token acces pentru SPV ANAF eFactura"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 489
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_label1' AS _label WITH ;
		AutoSize = .F., ;
		Caption = "Genereaza token nou (necesita semnatura electronica)", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 12, ;
		Name = "_label1", ;
		Top = 50, ;
		Width = 372, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label2' AS _label WITH ;
		AutoSize = .T., ;
		Caption = "Token", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 14, ;
		Name = "_label2", ;
		Top = 246, ;
		Width = 38, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label3' AS _label WITH ;
		AutoSize = .T., ;
		Caption = "Refresh Token", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 14, ;
		Name = "_label3", ;
		Top = 321, ;
		Width = 90, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label4' AS _label WITH ;
		AutoSize = .T., ;
		Caption = "Actualizare token eFactura (nu necesita semnatura electronica)", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 12, ;
		Name = "_label4", ;
		Top = 109, ;
		Width = 402, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label5' AS _label WITH ;
		AutoSize = .T., ;
		Caption = "Tokenul expira la fiecare 3 luni si se poate reactualiza maxim 1 an fara semnatura electronica", ;
		FontBold = .F., ;
		Height = 34, ;
		Left = 12, ;
		Name = "_label5", ;
		Top = 131, ;
		Width = 408, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label6' AS _label WITH ;
		AutoSize = .T., ;
		Caption = "Apasa Genereaza daca nu exista token sau nu se mai poate actualiza", ;
		FontBold = .F., ;
		Height = 18, ;
		Left = 12, ;
		Name = "_label6", ;
		Top = 69, ;
		Width = 407, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		BackColor = 0,128,128, ;
		Caption = "\<Genereazã", ;
		clistaparametri = "new", ;
		Left = 424, ;
		Name = "Cmd_executa1", ;
		ToolTipText = "Genereaza un token de acces ANAF", ;
		Top = 44, ;
		Width = 84, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa2' AS cmd_executa WITH ;
		BackColor = 0,128,192, ;
		Caption = "\<Actualizare", ;
		clistaparametri = "refresh", ;
		Enabled = .T., ;
		Height = 27, ;
		Left = 424, ;
		Name = "Cmd_executa2", ;
		ToolTipText = "Regenereaza token acces ANAF, fara semnatura electronica", ;
		Top = 105, ;
		Width = 84
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'edtRefreshToken' AS _editbox WITH ;
		Format = "K", ;
		Height = 53, ;
		Left = 12, ;
		Name = "edtRefreshToken", ;
		Top = 340, ;
		Width = 496
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'edtToken' AS _editbox WITH ;
		Format = "K", ;
		Height = 53, ;
		Left = 12, ;
		Name = "edtToken", ;
		Top = 265, ;
		Width = 496
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'lblExpDate' AS _label WITH ;
		AutoSize = .F., ;
		Caption = "Data expirare token:", ;
		Height = 18, ;
		Left = 11, ;
		Name = "lblExpDate", ;
		Top = 221, ;
		Width = 384, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblGenDate' AS _label WITH ;
		AutoSize = .F., ;
		Caption = "Data generare token:", ;
		Height = 18, ;
		Left = 12, ;
		Name = "lblGenDate", ;
		Top = 194, ;
		Width = 384, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />
	
	PROCEDURE do_executa
		Lparameters tcTip
		Do Case
			Case Empty(m.tcTip) Or Lower(Alltrim(Transform(tcTip))) = 'new'
				This.poAnaf.newToken()
			Case Lower(Alltrim(Transform(tcTip))) = 'refresh'
				This.poAnaf.refreshToken()
		Endcase
		this.Refresh()
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toAnaf
		This.poAnaf = toAnaf
		this.edtToken.ControlSource = 'Thisform.poAnaf.AnafeFacturaServer.cToken'
		this.edtRefreshToken.ControlSource = 'Thisform.poAnaf.AnafeFacturaServer.cRefreshToken'
		this.lblGenDate.Caption = 'Data generare token: ' + IIF(!EMPTY(this.poAnaf.AnafeFacturaServer.dTokenGendate), DTOC(this.poAnaf.AnafeFacturaServer.dTokenGendate), '')
		this.lblExpDate.Caption = 'Data expirare token: ' + IIF(!EMPTY(this.poAnaf.AnafeFacturaServer.dTokenExpdate), DTOC(this.poAnaf.AnafeFacturaServer.dTokenExpdate), '')
		DODEFAULT()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_configurare_efactura 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_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkContP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkTipP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkGestiuneP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkSectieP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkVenCheltP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkContractP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboContE" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboContP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboVenCheltE" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboSectieE" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboTipArticoleP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboGestiuneP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboGestiuneE" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboTipArticoleE" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboVenCheltP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboSectieP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblCont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox6" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cconte		&& cont implicit articol client
		*p: ccontp		&& cont implicit articol furnizor
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cconte = 704
		ccontp = 628
		DoCreate = .T.
		Height = 623
		Name = "frm_configurare_efactura"
		Width = 424
		_memberdata = <VFPData>
			<memberdata name="ccontp" display="cContP"/>
			<memberdata name="cconte" display="cContE"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 426
		_shape2.Left = 367
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Caption = "Configurare import eFactura"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 25
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 393
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 23
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare cont contabil din inregistrarile anterioare ale clientului", ;
		ControlSource = "m.gnEFACTURA_CONT_ART_EF", ;
		Left = 12, ;
		Name = "_checkbox1", ;
		TabIndex = 12, ;
		Top = 359
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox2' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare tip articol din inregistrarile anterioare ale clientului", ;
		Enabled = .F., ;
		Left = 12, ;
		Name = "_checkbox2", ;
		TabIndex = 13, ;
		Top = 380
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox3' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare gestiune din inregistrarile anterioare ale clientului", ;
		ControlSource = "m.gnEFACTURA_GEST_ART_EF", ;
		Left = 12, ;
		Name = "_checkbox3", ;
		TabIndex = 14, ;
		Top = 401
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox4' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare sectie din inregistrarile anterioare ale clientului", ;
		Enabled = .F., ;
		Left = 12, ;
		Name = "_checkbox4", ;
		TabIndex = 15, ;
		Top = 424
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox5' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare tip ven/chlt din inregistrarile anterioare ale clientului", ;
		Enabled = .F., ;
		Left = 12, ;
		Name = "_checkbox5", ;
		TabIndex = 16, ;
		Top = 443
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox6' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare contract din inregistrarile anterioare ale clientului", ;
		Enabled = .F., ;
		Left = 12, ;
		Name = "_checkbox6", ;
		TabIndex = 17, ;
		Top = 464
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_label1' AS _label WITH ;
		Caption = "Facturi primite", ;
		FontBold = .T., ;
		Left = 14, ;
		Name = "_label1", ;
		TabIndex = 26, ;
		Top = 41
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label10' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Sectie implicita", ;
		Left = 12, ;
		Name = "_label10", ;
		TabIndex = 32, ;
		Top = 569, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label11' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Tip ven/chlt implicit", ;
		Left = 12, ;
		Name = "_label11", ;
		TabIndex = 34, ;
		Top = 594, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label2' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Tip articole implicit", ;
		Left = 14, ;
		Name = "_label2", ;
		TabIndex = 28, ;
		Top = 224, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label3' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Gestiune implicita", ;
		Left = 14, ;
		Name = "_label3", ;
		TabIndex = 30, ;
		Top = 249, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label4' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Sectie implicita", ;
		Left = 14, ;
		Name = "_label4", ;
		TabIndex = 33, ;
		Top = 274, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label5' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Tip ven/chlt implicit", ;
		Left = 14, ;
		Name = "_label5", ;
		TabIndex = 31, ;
		Top = 296, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label6' AS _label WITH ;
		Caption = "Facturi emise", ;
		FontBold = .T., ;
		Left = 12, ;
		Name = "_label6", ;
		TabIndex = 37, ;
		Top = 335
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label7' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Cont articole implicit", ;
		Left = 12, ;
		Name = "_label7", ;
		TabIndex = 36, ;
		Top = 493, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label8' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Tip articole implicit", ;
		Left = 12, ;
		Name = "_label8", ;
		TabIndex = 35, ;
		Top = 517, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label9' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Gestiune implicita", ;
		Left = 12, ;
		Name = "_label9", ;
		TabIndex = 29, ;
		Top = 543, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 8, ;
		Left = 365, ;
		Name = "But_renunt1", ;
		TabIndex = 24, ;
		Top = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cboContE' AS _cbsearch WITH ;
		BoundColumn = 1, ;
		BoundTo = .T., ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "50,250,50", ;
		ControlSource = "m.gcEFACTURA_CONT_ART_E", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboContE", ;
		RowSource = "cPlContE.cont, explicatie, tip_sold", ;
		RowSourceType = 6, ;
		TabIndex = 18, ;
		Top = 489, ;
		Width = 87, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboContP' AS _cbsearch WITH ;
		BoundColumn = 1, ;
		BoundTo = .T., ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "50,250,50", ;
		ControlSource = "m.gcEFACTURA_CONT_ART_P", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboContP", ;
		RowSource = "cPlContP.cont, explicatie, tip_sold", ;
		RowSourceType = 6, ;
		TabIndex = 7, ;
		Top = 196, ;
		Width = 87, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboGestiuneE' AS _cbsearch WITH ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,50", ;
		ControlSource = "m.gnEFACTURA_ID_GESTIUNE_E", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboGestiuneE", ;
		RowSource = "cGestiuniE.nume_gestiune, cont, id_gestiune", ;
		RowSourceType = 6, ;
		TabIndex = 20, ;
		Top = 539, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboGestiuneP' AS _cbsearch WITH ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,50", ;
		ControlSource = "m.gnEFACTURA_ID_GESTIUNE_P", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboGestiuneP", ;
		RowSource = "cGestiuniP.nume_gestiune, cont, id_gestiune", ;
		RowSourceType = 6, ;
		TabIndex = 9, ;
		Top = 246, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboSectieE' AS _cbsearch WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 1, ;
		ColumnLines = .F., ;
		ColumnWidths = "300", ;
		ControlSource = "m.gnEFACTURA_ID_SECTIE_E", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboSectieE", ;
		RowSource = "cSectiiE.sectie, id_sectie", ;
		RowSourceType = 6, ;
		TabIndex = 21, ;
		Top = 564, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboSectieP' AS _cbsearch WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 1, ;
		ColumnLines = .F., ;
		ColumnWidths = "300", ;
		ControlSource = "m.gnEFACTURA_ID_SECTIE_P", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboSectieP", ;
		RowSource = "cSectiiP.sectie, id_sectie", ;
		RowSourceType = 6, ;
		TabIndex = 10, ;
		Top = 271, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboTipArticoleE' AS _cbsearch WITH ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,50,50", ;
		ControlSource = "m.gnEFACTURA_ID_TIPART_E", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboTipArticoleE", ;
		RowSource = "cTipArticoleE.tip, cont, id", ;
		RowSourceType = 6, ;
		TabIndex = 19, ;
		Top = 514, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboTipArticoleP' AS _cbsearch WITH ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,50,50", ;
		ControlSource = "m.gnEFACTURA_ID_TIPART_P", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboTipArticoleP", ;
		RowSource = "cTipArticoleP.tip, cont, id", ;
		RowSourceType = 6, ;
		TabIndex = 8, ;
		Top = 221, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboVenCheltE' AS _cbsearch WITH ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,50", ;
		ControlSource = "m.gnEFACTURA_ID_VENCHELT_E", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboVenCheltE", ;
		RowSource = "cVenChelE.venchelt, tip, id_venchelt", ;
		RowSourceType = 6, ;
		TabIndex = 22, ;
		Top = 589, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboVenCheltP' AS _cbsearch WITH ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,50", ;
		ControlSource = "m.gnEFACTURA_ID_VENCHELT_P", ;
		Format = "K", ;
		Height = 24, ;
		Left = 144, ;
		Name = "cboVenCheltP", ;
		RowSource = "cVenChelP.venchelt, tip, id_venchelt", ;
		RowSourceType = 6, ;
		TabIndex = 11, ;
		Top = 296, ;
		Width = 178, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'chkContP' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare cont contabil din inregistrarile anterioare ale furnizorului", ;
		ControlSource = "m.gnEFACTURA_CONT_ART_PF", ;
		Left = 14, ;
		Name = "chkContP", ;
		TabIndex = 1, ;
		Top = 65
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkContractP' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare contract din inregistrarile anterioare ale furnizorului", ;
		Enabled = .F., ;
		Left = 14, ;
		Name = "chkContractP", ;
		TabIndex = 6, ;
		Top = 170
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkGestiuneP' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare gestiune din inregistrarile anterioare ale furnizorului", ;
		ControlSource = "m.gnEFACTURA_GEST_ART_PF", ;
		Left = 14, ;
		Name = "chkGestiuneP", ;
		TabIndex = 3, ;
		Top = 107
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkSectieP' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare sectie din inregistrarile anterioare ale furnizorului", ;
		Enabled = .F., ;
		Left = 14, ;
		Name = "chkSectieP", ;
		TabIndex = 4, ;
		Top = 130
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkTipP' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare tip articol din inregistrarile anterioare ale furnizorului", ;
		Enabled = .F., ;
		Left = 14, ;
		Name = "chkTipP", ;
		TabIndex = 2, ;
		Top = 86
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkVenCheltP' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Preluare tip ven/chlt din inregistrarile anterioare ale furnizorului", ;
		Enabled = .F., ;
		Left = 14, ;
		Name = "chkVenCheltP", ;
		TabIndex = 5, ;
		Top = 149
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'lblCont' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Cont articole implicit", ;
		Left = 14, ;
		Name = "lblCont", ;
		TabIndex = 27, ;
		Top = 199, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />
	
	PROCEDURE cboGestiuneE.Valid
		gnEFACTURA_ID_GESTIUNE_E = cGestiuniE.id_gestiune
	ENDPROC

	PROCEDURE cboGestiuneP.Valid
		gnEFACTURA_ID_GESTIUNE_P = cGestiuniP.id_gestiune
		
	ENDPROC

	PROCEDURE cboSectieE.Valid
		gnEFACTURA_ID_SECTIE_E = cSectiiE.id_sectie
	ENDPROC

	PROCEDURE cboSectieP.Valid
		gnEFACTURA_ID_SECTIE_P = cSectiiP.id_sectie
	ENDPROC

	PROCEDURE cboTipArticoleE.Valid
		gnEFACTURA_ID_TIPART_E = cTipArticoleE.id
	ENDPROC

	PROCEDURE cboTipArticoleP.Valid
		gnEFACTURA_ID_TIPART_P = cTipArticoleP.id
		
	ENDPROC

	PROCEDURE cboVenCheltE.Valid
		gnEFACTURA_ID_VENCHELT_E = cVenChelE.id_venchelt
	ENDPROC

	PROCEDURE cboVenCheltP.Valid
		gnEFACTURA_ID_VENCHELT_P = cVenChelP.id_venchelt
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_import_efactura 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="grdDetaliiFacturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cNr.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cNr.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cArticol.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cArticol.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDetalii.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDetalii.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDetalii._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCantitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCantitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cUM.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cUM.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cPret.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cPret.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cProcTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cProcTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDescriere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDescriere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cTip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cTip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cTip._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cGestiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cGestiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cGestiune._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cArticolROA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cArticolROA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cUMROA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cUMROA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cValoareFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cValoareFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodBare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodBare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodClient.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodClient.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodCPV.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodCPV.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodNC8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodNC8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodMatROA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cCodMatROA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cInStoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cInStoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cInStoc._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cPretvTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cPretvTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDiscountFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDiscountFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cTipTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cTipTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDistribuie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDistribuie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDetaliiFacturi.cDistribuie._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cNr.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cNr.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cData.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cData.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDataTrimis.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDataTrimis.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cCodFiscalEmitent.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cCodFiscalEmitent.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTipMesajRaspuns.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTipMesajRaspuns.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdDescarcare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdDescarcare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotalCuTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotalCuTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cNumeValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cNumeValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cJtotcTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cJtotcTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDataScad.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDataScad.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDescriere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDescriere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDescriere._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotalFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotalFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotalTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotalTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cXFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cXFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDiscount.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDiscount.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTaxe.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTaxe.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValoareFaraTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cValoareFaraTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotaldePlata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cTotaldePlata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cId.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cId.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDetaliiPlata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDetaliiPlata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDetaliiPlata._editbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDiferenta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cDiferenta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdIncarcare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdIncarcare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cProcesat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cProcesat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cProcesat._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdFact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdFacturi.cIdFact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblNrAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtNrAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblDataAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDataAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblDataScad" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDataScad" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblSerieAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtSerieAct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblResponsabil" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtResponsabil" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblVenChelt" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtVenChelt" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblSectie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtExplicatia" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtSectie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblContract" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtContract" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblLucrare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtLucrare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblPartener" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtPartener" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkTVAIncasare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblCont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtCont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblCurs" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtCurs" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtCodFiscal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtAcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkDistribuieDiscount" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkDiferente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkLipsaRegistru" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_tip" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_gestiune" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboDeducere" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: cauta_contract
		*m: cauta_lucrare
		*m: cauta_partener
		*m: cauta_responsabil
		*m: cauta_sectie
		*m: cauta_valuta
		*m: cauta_venchelt
		*m: completeazadetaliifactura
		*m: completeazafactura
		*m: creeazanote
		*m: importgeneral
		*m: importmodifica
		*m: listarenir
		*m: modificanote
		*m: numaradiferenteimport
		*m: scrienote
		*p: lprimite
		*p: nidborderou
		*p: ninvaluta
		*p: ntip		&& 0=tranzit, 1=cheiaj
		*p: ntrimis
		*p: oanaf
		*p: ofactura
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		Caption = "Form"
		cbuton7 = pgfeFactura.page1.cmdTrimite;pgfeFactura.page1.cmdRaspunsuri
		DoCreate = .T.
		FontBold = .F.
		Height = 540
		lprimite = .T.
		Name = "frm_import_efactura"
		nidborderou = 0
		ninvaluta = 0
		ntip = 0
		ntrimis = 0
		oanaf = .NULL.
		ofactura = .NULL.
		Width = 792
		WindowState = 2
		_memberdata = <VFPData>
			<memberdata name="nidborderou" display="nIdBorderou"/>
			<memberdata name="oanaf" display="oAnaf"/>
			<memberdata name="ntrimis" display="nTrimis"/>
			<memberdata name="creeazanote" display="CreeazaNote"/>
			<memberdata name="modificanote" display="ModificaNote"/>
			<memberdata name="scrienote" display="ScrieNote"/>
			<memberdata name="ofactura" display="oFactura"/>
			<memberdata name="lprimite" display="lPrimite"/>
			<memberdata name="ninvaluta" display="nInValuta"/>
			<memberdata name="completeazafactura" display="CompleteazaFactura"/>
			<memberdata name="completeazadetaliifactura" display="CompleteazaDetaliiFactura"/>
			<memberdata name="importmodifica" display="ImportModifica"/>
			<memberdata name="importgeneral" display="ImportGeneral"/>
			<memberdata name="listarenir" display="ListareNIR"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = -1
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 822
		_shape1.ZOrderSet = 1
		_shape2.Left = 741
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.ZOrderSet = 4
		Lb_titlu_alb_b121.Caption = "Introducere eFactura in ROA"
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 28
		Lb_titlu_alb_b121.Top = 6
		Lb_titlu_alb_b121.ZOrderSet = 5
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 761
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 27
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 9
		Gridsort1.Left = 780
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 482
	*</PropValue>

	ADD OBJECT '_label1' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Explicatia", ;
		Left = 12, ;
		Name = "_label1", ;
		TabIndex = 32, ;
		Top = 408, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT '_shape3' AS _shape WITH ;
		Anchor = 10, ;
		BackColor = 255,255,245, ;
		BackStyle = 1, ;
		Height = 125, ;
		Left = 7, ;
		Name = "_shape3", ;
		Top = 306, ;
		Width = 780, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'but_cont' AS cmd_executa WITH ;
		AutoSize = .F., ;
		Caption = "Cont", ;
		FontBold = .F., ;
		FontUnderline = .T., ;
		ForeColor = 0,128,192, ;
		Height = 22, ;
		Left = 70, ;
		Name = "but_cont", ;
		SpecialEffect = 2, ;
		TabIndex = 45, ;
		ToolTipText = "Completeaza contul curent pentru toate pozitiile necompletate", ;
		Top = 436, ;
		Width = 60
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		caction = do_excel, ;
		Left = 733, ;
		Name = "But_excel1", ;
		TabIndex = 29, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'but_gestiune' AS cmd_executa WITH ;
		AutoSize = .F., ;
		Caption = "Gestiune", ;
		FontBold = .F., ;
		FontUnderline = .T., ;
		ForeColor = 0,128,192, ;
		Height = 22, ;
		Left = 194, ;
		Name = "but_gestiune", ;
		SpecialEffect = 2, ;
		TabIndex = 46, ;
		ToolTipText = "Completeaza gestiunea curenta pentru toate pozitiile necompletate", ;
		Top = 435, ;
		Width = 60
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		caction = do_listare, ;
		Left = 702, ;
		Name = "But_listare1", ;
		TabIndex = 26, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 554, ;
		Name = "But_nou1", ;
		TabIndex = 8, ;
		Top = 308
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Anchor = 9, ;
		Left = 642, ;
		Name = "But_reset_criterii1", ;
		TabIndex = 24, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'but_tip' AS cmd_executa WITH ;
		AutoSize = .F., ;
		Caption = "Tip", ;
		FontBold = .F., ;
		FontUnderline = .T., ;
		ForeColor = 0,128,192, ;
		Height = 22, ;
		Left = 10, ;
		Name = "but_tip", ;
		SpecialEffect = 2, ;
		TabIndex = 44, ;
		ToolTipText = "Completeaza tipul curent pentru toate pozitiile necompletate", ;
		Top = 435, ;
		Width = 60
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cboDeducere' AS _combobox WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "100,0", ;
		Height = 24, ;
		Left = 525, ;
		Name = "cboDeducere", ;
		RowSource = "Fara deducere, 0,Limitare 50%, 1,Limitare 100%,2", ;
		RowSourceType = 1, ;
		Top = 406, ;
		Value = 0, ;
		Width = 155
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'chkDiferente' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		AutoSize = .F., ;
		BackColor = 100,255,255, ;
		BackStyle = 1, ;
		Caption = "Cu diferente Reg. TVA", ;
		Height = 18, ;
		Left = 190, ;
		Name = "chkDiferente", ;
		Style = 0, ;
		Top = 35, ;
		Value = .F., ;
		Width = 191
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkDistribuieDiscount' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		BackColor = 128,128,255, ;
		BackStyle = 1, ;
		Caption = "Distribuie discount/taxe", ;
		ControlSource = "", ;
		ForeColor = 255,255,255, ;
		Left = 524, ;
		Name = "chkDistribuieDiscount", ;
		TabIndex = 10, ;
		ToolTipText = "Distribuie discount pe articole", ;
		Top = 388, ;
		Value = .F., ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkLipsaRegistru' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		AutoSize = .F., ;
		BackColor = 225,225,225, ;
		BackStyle = 1, ;
		Caption = "Lipsa din Reg. TVA", ;
		Height = 18, ;
		Left = 9, ;
		Name = "chkLipsaRegistru", ;
		Style = 0, ;
		Top = 35, ;
		Value = .F., ;
		Width = 174
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkTVAIncasare' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		Caption = "TVA inc.", ;
		ControlSource = "crsFacturi.TVAIncasare", ;
		Left = 589, ;
		Name = "chkTVAIncasare", ;
		TabIndex = 9, ;
		Top = 314, ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Anchor = 0, ;
		BackColor = 128,128,255, ;
		Caption = "\<Import", ;
		Height = 27, ;
		Left = 698, ;
		Name = "Cmd_executa1", ;
		TabIndex = 20, ;
		Top = 381, ;
		Width = 86, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa2' AS cmd_executa WITH ;
		Anchor = 0, ;
		Caption = "\<Configurare", ;
		FontBold = .F., ;
		ForeColor = 128,0,64, ;
		Height = 27, ;
		Left = 696, ;
		Name = "Cmd_executa2", ;
		TabIndex = 21, ;
		Top = 310, ;
		Width = 86, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa3' AS cmd_executa WITH ;
		AutoSize = .F., ;
		Caption = "Analitic", ;
		FontBold = .F., ;
		FontUnderline = .T., ;
		ForeColor = 0,128,192, ;
		Height = 22, ;
		Left = 131, ;
		Name = "Cmd_executa3", ;
		SpecialEffect = 2, ;
		TabIndex = 47, ;
		ToolTipText = "Completeaza contul analitic curent pentru toate pozitiile necompletate cu acelasi cont", ;
		Top = 435, ;
		Width = 60
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdDetaliiFacturi' AS _grdbase WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 26, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 37, ;
		Height = 76, ;
		lcamptextneeditabil = .F., ;
		Left = 7, ;
		Name = "grdDetaliiFacturi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsdetaliifacturi", ;
		RowHeight = 19, ;
		TabIndex = 23, ;
		Top = 458, ;
		Width = 780, ;
		ZOrderSet = 2, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "crsdetaliifacturi.nr", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNr", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 37, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "crsdetaliifacturi.articol", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cArticol", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 146, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 18, ;
		Column3.ControlSource = "crsdetaliifacturi.detalii", ;
		Column3.CurrentControl = "Text1", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDetalii", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 189, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 9, ;
		Column4.ControlSource = "crsdetaliifacturi.cantitate", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "RK", ;
		Column4.Name = "cCantitate", ;
		Column4.ReadOnly = .F., ;
		Column4.Width = 76, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 15, ;
		Column5.ControlSource = "crsDetaliiFacturi.um_iso", ;
		Column5.CurrentControl = "Text1", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cUM", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 69, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 10, ;
		Column6.ControlSource = "crsdetaliifacturi.pret", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "RK", ;
		Column6.Name = "cPret", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 99, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 13, ;
		Column7.ControlSource = "crsdetaliifacturi.proctva", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cProcTVA", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 39, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 17, ;
		Column8.ControlSource = "crsdetaliifacturi.descriere", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cDescriere", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 162, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 6, ;
		Column9.ControlSource = "crsdetaliifacturi.cont", ;
		Column9.DynamicBackColor = "RGB(255,255,240)", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cCont", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 49, ;
		Column10.BackColor = 255,255,255, ;
		Column10.Bound = .F., ;
		Column10.ColumnOrder = 2, ;
		Column10.ControlSource = "Iif(Seek(crsDetaliiFacturi.id_tip,'cTip','id'),cTip.tip,'')", ;
		Column10.CurrentControl = "_combobox1", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cTip", ;
		Column10.ReadOnly = .F., ;
		Column10.Sparse = .T., ;
		Column10.Width = 139, ;
		Column11.BackColor = 255,255,255, ;
		Column11.Bound = .F., ;
		Column11.ColumnOrder = 8, ;
		Column11.ControlSource = "Iif(Seek(crsDetaliiFacturi.id_gestiune,'cGestiuni','id_gest'),cGestiuni.nume_gestiune,'')", ;
		Column11.CurrentControl = "_combobox1", ;
		Column11.DynamicBackColor = "RGB(255,255,240)", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cGestiune", ;
		Column11.ReadOnly = .F., ;
		Column11.Sparse = .T., ;
		Column11.Width = 143, ;
		Column12.BackColor = 255,255,255, ;
		Column12.ColumnOrder = 4, ;
		Column12.ControlSource = "crsDetaliiFacturi.articol_roa", ;
		Column12.CurrentControl = "Text1", ;
		Column12.DynamicBackColor = "RGB(255,255,240)", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cArticolROA", ;
		Column12.ReadOnly = .F., ;
		Column12.Sparse = .T., ;
		Column12.ToolTipText = "Dublu click = Alege articol ; Click dreapta = Adauga / Alege articol", ;
		Column12.Width = 182, ;
		Column13.BackColor = 255,255,255, ;
		Column13.ColumnOrder = 16, ;
		Column13.ControlSource = "crsDetaliiFacturi.um_roa", ;
		Column13.CurrentControl = "Text1", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "cUMROA", ;
		Column13.ReadOnly = .F., ;
		Column14.BackColor = 255,255,255, ;
		Column14.ColumnOrder = 11, ;
		Column14.ControlSource = "crsdetaliifacturi.valoarefaratva", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Format = "RK", ;
		Column14.Name = "cValoareFaraTVA", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 102, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ColumnOrder = 19, ;
		Column15.ControlSource = "codbare", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cCodBare", ;
		Column15.ReadOnly = .T., ;
		Column16.BackColor = 255,255,255, ;
		Column16.ColumnOrder = 20, ;
		Column16.ControlSource = "codclient", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "cCodClient", ;
		Column16.ReadOnly = .T., ;
		Column17.BackColor = 255,255,255, ;
		Column17.ColumnOrder = 21, ;
		Column17.ControlSource = "codfurnizor", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "cCodFurnizor", ;
		Column17.ReadOnly = .T., ;
		Column18.BackColor = 255,255,255, ;
		Column18.ColumnOrder = 22, ;
		Column18.ControlSource = "codcpv", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "cCodCPV", ;
		Column18.ReadOnly = .T., ;
		Column19.BackColor = 255,255,255, ;
		Column19.ColumnOrder = 23, ;
		Column19.ControlSource = "codnc8", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Name = "cCodNC8", ;
		Column19.ReadOnly = .T., ;
		Column20.BackColor = 255,255,255, ;
		Column20.ColumnOrder = 7, ;
		Column20.ControlSource = "crsdetaliifacturi.acont", ;
		Column20.DynamicBackColor = "RGB(255,255,240)", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cAcont", ;
		Column20.ReadOnly = .F., ;
		Column20.Width = 43, ;
		Column21.BackColor = 255,255,255, ;
		Column21.ColumnOrder = 5, ;
		Column21.ControlSource = "codmat_roa", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cCodMatROA", ;
		Column21.ReadOnly = .T., ;
		Column22.BackColor = 255,255,255, ;
		Column22.ColumnOrder = 24, ;
		Column22.ControlSource = "crsDetaliiFacturi.in_stoc", ;
		Column22.CurrentControl = "_CHECKBOX1", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Name = "cInStoc", ;
		Column22.ReadOnly = .T., ;
		Column22.Sparse = .F., ;
		Column22.Width = 65, ;
		Column23.BackColor = 255,255,255, ;
		Column23.ColumnOrder = 14, ;
		Column23.ControlSource = "crsdetaliifacturi.pretvtva", ;
		Column23.DynamicBackColor = "RGB(255,255,240)", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Format = "RK", ;
		Column23.InputMask = (get_mask(12,gnPPRETV)), ;
		Column23.Name = "cPretvTVA", ;
		Column23.ReadOnly = .F., ;
		Column23.Width = 97, ;
		Column24.BackColor = 255,255,255, ;
		Column24.ColumnOrder = 12, ;
		Column24.ControlSource = "crsdetaliifacturi.discountfaratva", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cDiscountFaraTVA", ;
		Column24.ReadOnly = .T., ;
		Column24.Width = 72, ;
		Column25.BackColor = 255,255,255, ;
		Column25.ColumnOrder = 25, ;
		Column25.ControlSource = "tiptva", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cTipTVA", ;
		Column25.ReadOnly = .T., ;
		Column25.Width = 50, ;
		Column26.BackColor = 255,255,255, ;
		Column26.ControlSource = "crsDetaliiFacturi.distribuie", ;
		Column26.CurrentControl = "_CHECKBOX1", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cDistribuie", ;
		Column26.ReadOnly = .F., ;
		Column26.Sparse = .F., ;
		Column26.Width = 57
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdDetaliiFacturi.cAcont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cAcont.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 'grdDetaliiFacturi.cArticol.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Articol eFactura", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDetaliiFacturi.cArticolROA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Articol ROA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cArticolROA.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 'grdDetaliiFacturi.cCantitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cantitate", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCantitate.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 'grdDetaliiFacturi.cCodBare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod bare", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCodBare.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 'grdDetaliiFacturi.cCodClient.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod client", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCodClient.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 'grdDetaliiFacturi.cCodCPV.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod CPV", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCodCPV.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 'grdDetaliiFacturi.cCodFurnizor.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod furnizor", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCodFurnizor.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 'grdDetaliiFacturi.cCodMatROA.Header1' AS header WITH ;
		Caption = "Codmat ROA", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCodMatROA.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 'grdDetaliiFacturi.cCodNC8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod NC8", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCodNC8.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 'grdDetaliiFacturi.cCont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cCont.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 'grdDetaliiFacturi.cDescriere.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 2,0,0, ;
		Caption = "Descriere", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDetaliiFacturi.cDetalii._editbox1' AS _editbox WITH ;
		Left = 37, ;
		Name = "_editbox1", ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

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

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

	ADD OBJECT 'grdDetaliiFacturi.cDiscountFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Discount fara TVA", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cDiscountFaraTVA.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 'grdDetaliiFacturi.cDistribuie._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "crsDetaliiFacturi.in_stoc", ;
		Left = 39, ;
		Name = "_CHECKBOX1", ;
		ReadOnly = .F., ;
		Top = 45
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdDetaliiFacturi.cDistribuie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Distribuie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cDistribuie.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 'grdDetaliiFacturi.cGestiune._combobox1' AS _combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ControlSource = "crsdetaliifacturi.id_gestiune", ;
		DisplayCount = 20, ;
		FontSize = 10, ;
		Left = 31, ;
		Name = "_combobox1", ;
		ReadOnly = .F., ;
		RowSource = "cGestiuni2.nume_gestiune, id_gestiune", ;
		RowSourceType = 6, ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

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

	ADD OBJECT 'grdDetaliiFacturi.cGestiune.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 'grdDetaliiFacturi.cInStoc._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "crsDetaliiFacturi.in_stoc", ;
		Left = 48, ;
		Name = "_CHECKBOX1", ;
		Top = 33
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdDetaliiFacturi.cInStoc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Gestionabil ROA", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cInStoc.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 'grdDetaliiFacturi.cNr.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDetaliiFacturi.cPret.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret achizitie fara TVA", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cPret.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 'grdDetaliiFacturi.cPretvTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret vanzare cu TVA", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDetaliiFacturi.cProcTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "% TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cProcTVA.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 'grdDetaliiFacturi.cTip._combobox1' AS _combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 4, ;
		BoundTo = .T., ;
		ControlSource = "crsdetaliifacturi.id_tip", ;
		DisplayCount = 20, ;
		FontSize = 10, ;
		Left = 52, ;
		Name = "_combobox1", ;
		ReadOnly = .F., ;
		RowSource = "select cast(alltrim(tip) + ' ' + alltrim(cont) as V(50)) as tip, cont, in_stoc, id from cTip order by ordine into cursor cTipTemp", ;
		RowSourceType = 3, ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

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

	ADD OBJECT 'grdDetaliiFacturi.cTip.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 'grdDetaliiFacturi.cTipTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cTipTVA.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 'grdDetaliiFacturi.cUM.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "UM", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDetaliiFacturi.cUMROA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "UM ROA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cUMROA.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 'grdDetaliiFacturi.cValoareFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare achizitie fara TVA", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDetaliiFacturi.cValoareFaraTVA.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' AS _grdbase WITH ;
		Anchor = 11, ;
		BackColor = 255,255,255, ;
		ColumnCount = 25, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 37, ;
		Height = 245, ;
		lcamptextneeditabil = .F., ;
		Left = 7, ;
		Name = "grdFacturi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsFacturi", ;
		RowHeight = 19, ;
		TabIndex = 22, ;
		Top = 57, ;
		Width = 780, ;
		ZOrderSet = 3, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "crsFacturi.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 = "numar_act", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cNr", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 86, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "data_act", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cData", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 69, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 17, ;
		Column4.ControlSource = "data_raspuns", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cDataTrimis", ;
		Column4.ReadOnly = .T., ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "cod_fiscal", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cCodFiscalEmitent", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 108, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 19, ;
		Column6.ControlSource = "tip_mesaj_raspuns", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cTipMesajRaspuns", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 130, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 18, ;
		Column7.ControlSource = "id_descarcare", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cIdDescarcare", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 111, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 13, ;
		Column8.ControlSource = "total_cu_tva", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "RK", ;
		Column8.InputMask = "999 999 999 999.99", ;
		Column8.Name = "cTotalCuTVA", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 104, ;
		Column9.BackColor = 255,255,255, ;
		Column9.ColumnOrder = 16, ;
		Column9.ControlSource = "nume_valuta", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cNumeValuta", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 38, ;
		Column10.BackColor = 255,255,255, ;
		Column10.ColumnOrder = 14, ;
		Column10.ControlSource = "jtotctva", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Format = "RK", ;
		Column10.InputMask = "999 999 999 999.99", ;
		Column10.Name = "cJtotcTVA", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 99, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 4, ;
		Column11.ControlSource = "data_scad", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cDataScad", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 88, ;
		Column12.BackColor = 255,255,255, ;
		Column12.ColumnOrder = 20, ;
		Column12.ControlSource = "descriere", ;
		Column12.CurrentControl = "_editbox1", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cDescriere", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 160, ;
		Column13.BackColor = 255,255,255, ;
		Column13.ColumnOrder = 11, ;
		Column13.ControlSource = "total_fara_tva", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "RK", ;
		Column13.InputMask = "999 999 999 999.99", ;
		Column13.Name = "cTotalFaraTVA", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 102, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ColumnOrder = 12, ;
		Column14.ControlSource = "total_tva", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Format = "RK", ;
		Column14.InputMask = "999 999 999 999.99", ;
		Column14.Name = "cTotalTVA", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 105, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ColumnOrder = 5, ;
		Column15.ControlSource = "partener", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cXFurnizor", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 180, ;
		Column16.BackColor = 255,255,255, ;
		Column16.ColumnOrder = 8, ;
		Column16.ControlSource = "discount_fara_tva", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Format = "RK", ;
		Column16.InputMask = "999 999 999 999.99", ;
		Column16.Name = "cDiscount", ;
		Column16.ReadOnly = .T., ;
		Column17.BackColor = 255,255,255, ;
		Column17.ColumnOrder = 9, ;
		Column17.ControlSource = "taxe_fara_tva", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Format = "RK", ;
		Column17.InputMask = "999 999 999 999.99", ;
		Column17.Name = "cTaxe", ;
		Column17.ReadOnly = .T., ;
		Column18.BackColor = 255,255,255, ;
		Column18.ColumnOrder = 7, ;
		Column18.ControlSource = "valoare_fara_tva", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Format = "RK", ;
		Column18.InputMask = "999 999 999 999.99", ;
		Column18.Name = "cValoareFaraTVA", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 102, ;
		Column19.BackColor = 255,255,255, ;
		Column19.ColumnOrder = 10, ;
		Column19.ControlSource = "total_de_plata", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Format = "RK", ;
		Column19.InputMask = "999 999 999 999.99", ;
		Column19.Name = "cTotaldePlata", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 106, ;
		Column20.BackColor = 255,255,255, ;
		Column20.ColumnOrder = 22, ;
		Column20.ControlSource = "id", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cId", ;
		Column20.ReadOnly = .T., ;
		Column21.BackColor = 255,255,255, ;
		Column21.ColumnOrder = 21, ;
		Column21.ControlSource = "detalii_plata", ;
		Column21.CurrentControl = "_editbox1", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cDetaliiPlata", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 145, ;
		Column22.BackColor = 255,255,255, ;
		Column22.ColumnOrder = 15, ;
		Column22.ControlSource = "diferenta", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Format = "RK", ;
		Column22.InputMask = "999 999 999 999.99", ;
		Column22.Name = "cDiferenta", ;
		Column22.ReadOnly = .T., ;
		Column22.Width = 94, ;
		Column23.BackColor = 255,255,255, ;
		Column23.ControlSource = "id_incarcare", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cIdIncarcare", ;
		Column23.ReadOnly = .T., ;
		Column23.Width = 105, ;
		Column24.BackColor = 255,255,255, ;
		Column24.ControlSource = "crsFacturi.procesat", ;
		Column24.CurrentControl = "_CHECKBOX1", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cProcesat", ;
		Column24.ReadOnly = .T., ;
		Column24.Sparse = .F., ;
		Column25.BackColor = 255,255,255, ;
		Column25.ControlSource = "crsFacturi.id_fact", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cIdFact", ;
		Column25.ReadOnly = .T.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'grdFacturi.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 'grdFacturi.cCodFiscalEmitent.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod fiscal", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cCodFiscalEmitent.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.cData.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data fact. ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cData.Text1' AS textbox WITH ;
		Alignment = 3, ;
		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.cDataScad.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data scadenta", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cDataScad.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.cDataTrimis.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data primit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cDataTrimis.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.cDescriere._editbox1' AS _editbox WITH ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		Left = 34, ;
		Name = "_editbox1", ;
		SpecialEffect = 1, ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

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

	ADD OBJECT 'grdFacturi.cDescriere.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.cDetaliiPlata._editbox1' AS _editbox WITH ;
		Left = 48, ;
		Name = "_editbox1", ;
		ReadOnly = .T., ;
		Top = 75
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="editbox" />

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

	ADD OBJECT 'grdFacturi.cDetaliiPlata.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.cDiferenta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Diferenta fata de Reg. Cumparari", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

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

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

	ADD OBJECT 'grdFacturi.cId.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.cIdDescarcare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id descarcare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cIdDescarcare.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.cIdFact.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id Fact", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cIdFact.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.cIdIncarcare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id incarcare", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cIdIncarcare.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.cJtotcTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare cu TVA Reg. Cumparari", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdFacturi.cNr.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.cNumeValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cNumeValuta.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.cProcesat._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Left = 48, ;
		Name = "_CHECKBOX1", ;
		Top = 63
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdFacturi.cProcesat.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.cTaxe.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Taxe", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdFacturi.cTipMesajRaspuns.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.cTotalCuTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cTotalCuTVA.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.cTotaldePlata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total de plata", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdFacturi.cTotalFaraTVA.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.cTotalTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdFacturi.cTotalTVA.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.cValoareFaraTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare fara TVA", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdFacturi.cXFurnizor.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 'Gridextra1' AS gridextra WITH ;
		gridexpression = thisform.grdFacturi, ;
		Left = 745, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 296
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Gridextra2' AS gridextra WITH ;
		gridexpression = thisform.grdDetaliiFacturi, ;
		Left = 744, ;
		Name = "Gridextra2", ;
		productname = ROA, ;
		Top = 456
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Lb_shortcuts1' AS lb_shortcuts WITH ;
		Caption = "Articol ROA: Dublu click = Cauta articol ;  Click dreapta = Cauta/Adauga articol", ;
		FontSize = 9, ;
		ForeColor = 128,0,64, ;
		Left = 264, ;
		Name = "Lb_shortcuts1", ;
		TabIndex = 48, ;
		Top = 441
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'lblCont' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Cont", ;
		Left = 186, ;
		Name = "lblCont", ;
		TabIndex = 43, ;
		Top = 336, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblContract' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Contract", ;
		Left = 185, ;
		Name = "lblContract", ;
		TabIndex = 35, ;
		Top = 385, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblCurs' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Curs", ;
		Left = 524, ;
		Name = "lblCurs", ;
		TabIndex = 42, ;
		Top = 336, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblDataAct' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Data doc.", ;
		Left = 12, ;
		Name = "lblDataAct", ;
		TabIndex = 31, ;
		Top = 360, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblDataScad' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Data scad.", ;
		Left = 12, ;
		Name = "lblDataScad", ;
		TabIndex = 33, ;
		Top = 384, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblLucrare' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Lucrare", ;
		Left = 185, ;
		Name = "lblLucrare", ;
		TabIndex = 39, ;
		Top = 360, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblNrAct' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Nr. doc.", ;
		Left = 12, ;
		Name = "lblNrAct", ;
		TabIndex = 30, ;
		Top = 336, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblPartener' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Partener", ;
		Left = 186, ;
		Name = "lblPartener", ;
		TabIndex = 40, ;
		Top = 312, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblResponsabil' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Respons.", ;
		Left = 524, ;
		Name = "lblResponsabil", ;
		TabIndex = 37, ;
		Top = 360, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblSectie' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Sectie", ;
		Left = 356, ;
		Name = "lblSectie", ;
		TabIndex = 36, ;
		Top = 360, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblSerieAct' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Serie doc.", ;
		Left = 12, ;
		Name = "lblSerieAct", ;
		TabIndex = 34, ;
		Top = 312, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblValuta' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Valuta", ;
		Left = 356, ;
		Name = "lblValuta", ;
		TabIndex = 41, ;
		Top = 336, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblVenChelt' AS _label WITH ;
		Anchor = 0, ;
		Caption = "Ven/Chlt", ;
		Left = 356, ;
		Name = "lblVenChelt", ;
		TabIndex = 38, ;
		Top = 385, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'txtAcont' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.Acont", ;
		Format = "K", ;
		Height = 23, ;
		Left = 300, ;
		Name = "txtAcont", ;
		TabIndex = 12, ;
		Top = 334, ;
		Width = 47, ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtCodFiscal' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.CodFiscalROA", ;
		Height = 23, ;
		Left = 445, ;
		Name = "txtCodFiscal", ;
		ReadOnly = .T., ;
		TabIndex = 7, ;
		ToolTipText = "Cod fiscal. Dublu click pentru alegere partener", ;
		Top = 310, ;
		Width = 108, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtCont' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.Cont", ;
		Format = "K", ;
		Height = 23, ;
		Left = 239, ;
		Name = "txtCont", ;
		TabIndex = 11, ;
		Top = 334, ;
		Width = 55, ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtContract' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.contract", ;
		Height = 23, ;
		Left = 239, ;
		Name = "txtContract", ;
		ReadOnly = .T., ;
		TabIndex = 18, ;
		ToolTipText = "Dublu click pentru alegere contract", ;
		Top = 383, ;
		Width = 109, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtCurs' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.cursROA", ;
		Format = "K", ;
		Height = 23, ;
		Left = 584, ;
		Name = "txtCurs", ;
		TabIndex = 14, ;
		Top = 334, ;
		Width = 61, ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtDataAct' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.Data_Act", ;
		Format = "K", ;
		Height = 23, ;
		Left = 72, ;
		Name = "txtDataAct", ;
		TabIndex = 3, ;
		Top = 358, ;
		Width = 100, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtDataScad' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.Data_Scad", ;
		Format = "K", ;
		Height = 23, ;
		Left = 72, ;
		Name = "txtDataScad", ;
		TabIndex = 4, ;
		Top = 382, ;
		Width = 100, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtExplicatia' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.explicatiaROA", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 72, ;
		Name = "txtExplicatia", ;
		TabIndex = 5, ;
		ToolTipText = "Explicatia din Registrul Jurnal", ;
		Top = 406, ;
		Width = 165, ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtLucrare' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.nrord", ;
		Height = 23, ;
		Left = 239, ;
		Name = "txtLucrare", ;
		ReadOnly = .T., ;
		TabIndex = 15, ;
		ToolTipText = "Dublu click pentru alegere lucrare", ;
		Top = 358, ;
		Width = 109, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtNrAct' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.NrActROA", ;
		Format = "K", ;
		Left = 72, ;
		Name = "txtNrAct", ;
		TabIndex = 2, ;
		Top = 334, ;
		Width = 100, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtPartener' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.PartenerROA", ;
		Height = 23, ;
		Left = 239, ;
		Name = "txtPartener", ;
		ReadOnly = .T., ;
		TabIndex = 6, ;
		ToolTipText = "Dublu click pentru alegere partener", ;
		Top = 310, ;
		Width = 203, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtResponsabil' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.nresp", ;
		Height = 23, ;
		Left = 584, ;
		Name = "txtResponsabil", ;
		ReadOnly = .T., ;
		TabIndex = 17, ;
		ToolTipText = "Dublu click pentru alegere Responsabil", ;
		Top = 358, ;
		Width = 109, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtSectie' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.sectie", ;
		Height = 23, ;
		Left = 410, ;
		Name = "txtSectie", ;
		ReadOnly = .T., ;
		TabIndex = 16, ;
		ToolTipText = "Dublu click pentru alegere sectie", ;
		Top = 358, ;
		Width = 109, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtSerieAct' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.SerieActROA", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 72, ;
		Name = "txtSerieAct", ;
		TabIndex = 1, ;
		Top = 310, ;
		Width = 100, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtValuta' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.NumeValutaROA", ;
		Height = 23, ;
		Left = 410, ;
		Name = "txtValuta", ;
		ReadOnly = .T., ;
		TabIndex = 13, ;
		Top = 334, ;
		Width = 45, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtVenChelt' AS _textbox WITH ;
		Anchor = 0, ;
		ControlSource = "crsFacturi.dst_chlt", ;
		Height = 23, ;
		Left = 410, ;
		Name = "txtVenChelt", ;
		ReadOnly = .T., ;
		TabIndex = 19, ;
		ToolTipText = "Dublu click pentru alegere Tip venit/cheltuiala", ;
		Top = 383, ;
		Width = 109, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Activate
		*
	ENDPROC

	PROCEDURE actualizeaza_grid1
		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
		
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Local lcFiltru
		IF !EMPTY(NVL(crsFacturi.id,0))
			lcFiltru = "id_efactura = " + ALLTRIM(STR(crsFacturi.id))
		ELSE 
			lcFiltru = "1=2"
		Endif
		
		SELECT crsDetaliiFacturi
		SET FILTER TO &lcFiltru
		
		* Daca nu exista detaliile, le adaug din baza de date
		LOCATE FOR !EMPTY(NVL(id,0))
		IF !FOUND()
			USE IN (SELECT('crsDetaliiFacturiTemp'))
			
			poFacturiDetalii.ca_baza1.cfiltru = m.lcFiltru
			poFacturiDetalii.ca_baza1.afisare()
			
			SELECT crsDetaliiFacturi
			APPEND FROM DBF('crsDetaliiFacturiTemp')
			LOCATE 
			USE IN (SELECT('crsDetaliiFacturiTemp'))
		ENDIF 
		
		this.grdDetaliiFacturi.refresh()  
	ENDPROC

	PROCEDURE cauta_contract
		IF EMPTY(NVL(crsFacturi.cod_fiscal,''))
			RETURN 
		ENDIF 	
		
		Local llToate, lnIdPart, locauta, lnIdTipCtr
		
		llToate = .F.
		lnIdPart = crsFacturi.IdPartROA
		lnIdTipCtr = IIF(Thisform.lPrimite, -2, -1) && -1 clienti, -2 furnizori
		locauta = caut_contract(lnIdTipCtr, lnIdPart, llToate)
		
		SELECT crsFacturi
		REPLACE contract WITH locauta.numar, Id_Ctr WITH locauta.id_ctr
		
		thisform.txtContract.Refresh() 
	ENDPROC

	PROCEDURE cauta_lucrare
		IF EMPTY(NVL(crsFacturi.cod_fiscal,''))
			RETURN 
		ENDIF 	
		
		Local lcFiltruOriginal, llNou, llToateIreg, locauta
		
		llToateIreg = .F.
		llNou = .T.
		lcFiltruOriginal = ''
		locauta = caut_lucrare(llToateIreg, llNou, lcFiltruOriginal)
		
		SELECT crsFacturi
		REPLACE NrOrd WITH locauta.nrord, Id_Lucrare WITH locauta.id_lucrare
		thisform.txtLucrare.Refresh() 
	ENDPROC

	PROCEDURE cauta_partener
		Local lcCont, lcTitlu, llNou, llToateIreg, locauta
		lcCont = ''
		lcTitlu = 'Alegeti partener'
		llToateIreg = .F.
		llNou = .T.
		locauta = caut_parteneri(lcCont, lcTitlu, llToateIreg, llNou)
		
		IF !EMPTY(NVL(loCauta.id_part, 0))
			SELECT crsFacturi
			REPLACE PartenerROA WITH locauta.denumire, IdPartROA WITH locauta.id_part, codfiscalROA WITH loCauta.cod_fiscal
		ENDIF 	
		
		thisform.txtPartener.Refresh()
		thisform.txtCodFiscal.Refresh()
	ENDPROC

	PROCEDURE cauta_responsabil
		Local loCauta
		
		IF EMPTY(NVL(crsFacturi.cod_fiscal,''))
			RETURN 
		ENDIF 	
		
		loCauta=caut_responsabil()
		
		SELECT crsFacturi
		REPLACE nresp WITH locauta.nume, id_responsabil WITH locauta.id_responsabil
		thisform.txtResponsabil.Refresh() 
		
		
		 
	ENDPROC

	PROCEDURE cauta_sectie
		IF EMPTY(NVL(crsFacturi.cod_fiscal,''))
			RETURN 
		ENDIF 	
		
		Local loCauta
		
		loCauta = caut_sectie()
		
		SELECT crsFacturi
		REPLACE sectie WITH loCauta.sectie, id_Sectie WITH loCauta.id_sectie
		
		This.txtSectie.Refresh()
		 
	ENDPROC

	PROCEDURE cauta_valuta
		IF EMPTY(NVL(crsFacturi.cod_fiscal,''))
			RETURN 
		ENDIF 	
		
		Local loCauta
		
		loCauta = caut_valuta(.F., .F., .T.)
		
		If gnbuton = 1
			SELECT crsFacturi
			REPLACE IdValutaROA WITH loCauta.id_valuta, NumeValutaROA WITH loCauta.nume_val
		Endif
		 
	ENDPROC

	PROCEDURE cauta_venchelt
		IF EMPTY(NVL(crsFacturi.cod_fiscal,''))
			RETURN 
		ENDIF 	
		
		Local loCauta
		
		loCauta = caut_venchelt()
		
		
		SELECT crsFacturi
		REPLACE dst_chlt WITH loCauta.explicatie, id_Venchelt WITH loCauta.id_venchelt
		
		This.txtVenChelt.Refresh()
		
		
	ENDPROC

	PROCEDURE completeazadetaliifactura
		* Completez tip articol, cont, gestiune implicite
		* caut articol, codbare, cod client, cod furnizor articol in nomenclator articole ROA, ca sa gasesc Id Articol ROA
		* caut articol in anaf_efactura, ca sa gasesc Id Articol ROA in efacturile aceluiasi furnizor
		
		* Doar o incercare de completare
		Local lcCont, lcAcont, lnIdGestiune, lnIdTipArt, llPrimite
		Local lcArticol, lcCodBare, lcCodClient, lcCodFurnizor, lcCodMat, lcCodMatF, lcCodMatP, llIdArticol
		Local llNecompletat, lnIdArticol, lnIdPart, lnNr, lcCodFiscal, lcArticolROA
		Local lcAcont0, lcCont0, llCompleteazaCont, llCompleteazaGestiune, lnIdGestiune0, lnIdTipArt0
		Local loArticol
		
		
		llPrimite = Thisform.lPrimite
		llNecompletat = (crsFacturi.completatdet = 0)
		lnIdPart = crsFacturi.IdPartROA
		llIdArticol = .F.
		lcCodFiscal = ALLTRIM(NVL(crsFacturi.cod_fiscal, ''))
		lnIdEFactura = crsFacturi.id
		
		If m.llNecompletat
			If m.llPrimite
				lnIdTipArt0 = m.gnEFACTURA_ID_TIPART_P
				lcCont0 = m.gcEFACTURA_CONT_ART_P
				lcAcont0 = ''
				lnIdGestiune0 = m.gnEFACTURA_ID_GESTIUNE_P
				
				
				* CONT, in facturile anterioare de la acelasi furnizor
				llCompleteazaCont = (m.gnEFACTURA_CONT_ART_PF = 1)
				* GESTIUNE, in facturile anterioare de la acelasi furnizor		
				llCompleteazaGestiune = (m.gnEFACTURA_GEST_ART_PF = 1)
				
			Else
				lnIdTipArt0 = m.gnEFACTURA_ID_TIPART_E
				lcCont0 = m.gcEFACTURA_CONT_ART_E
				lcAcont0 = ''
				lnIdGestiune0 = m.gnEFACTURA_ID_GESTIUNE_E
			
				llCompleteazaCont = (m.gnEFACTURA_CONT_ART_EF = 1)
				llCompleteazaGestiune = (m.gnEFACTURA_GEST_ART_EF = 1)		
			Endif
		
			* ParseEFactura imi trebuie pentru codbare, cofurnizor, codclient.
			* As putea sa le salvez in anaf_efactura_detalii, la descarcare
		
			* (nr, cant, um, articol, descriere, detalii, Pret, proctva, valoarefaratva, codfurnizor, codclient, codbare, codcpv, codnc8)
			Select crsDetaliiFacturi
			Scan For Empty(Nvl(id_articol,0)) OR m.llCompleteazaCont OR m.llCompleteazaGestiune
				lnNr = nr
				lcArticol = articol
				lnIdArticol = id_articol
				lcArticolROA = ALLTRIM(articol_roa)
				lcCodBare = codbare
				lcCodClient = codclient
				lcCodFurnizor = codfurnizor
				lnIdTipArt = m.lnIdTipArt0
				lcCont = m.lcCont0
				lcAcont = m.lcAcont0
				lnIdGestiune = m.lnIdGestiune0
				lcCodmatROA = ALLTRIM(codmat_roa)
				lnInStoc = NVL(in_stoc, 0)
				
				* tcCodMat: primite = efactura.codClient, trimise = efactura.codFurnizor = nom_articole.codmat
				* tcCodMatF: primite = efactura.codFurnizor = nom_articole.codmatf
				* tcCodMatP: trimise = efactura.codClient = parteneri_articole_coduri.cod
				If This.lPrimite
					lcCodMat = m.lcCodClient
					lcCodMatF = m.lcCodFurnizor
					lcCodMatP = ''
				Else
					lcCodMat = m.lcCodFurnizor
					lcCodMatF = ''
					lcCodMatP = m.lcCodClient
				Endif
		
				IF  Empty(Nvl(m.lnIdArticol, 0))
					loArticol = GetArticolByCodDenumire(m.lcArticol, m.lcCodBare, m.lcCodMat, m.lcCodMatF, m.lcCodMatP, m.lnIdPart, m.llIdArticol)
					lnIdArticol = loArticol.id_articol
					lcArticolROA = loArticol.denumire
					lcCodMatROA = ALLTRIM(NVL(loArticol.codmat, ''))
					lcCont = NVL(loArticol.cont, '')
					lcAcont = NVL(loArticol.acont, '')			
					lnInStoc = NVL(loArticol.in_stoc, 0)
				ENDIF 				
		
				IF EMPTY(NVL(m.lnIdArticol,0)) OR m.llCompleteazaCont OR m.llCompleteazaGestiune
					* caut in articolele anterioare de la acelasi furnizor
					loArticol = GetArticolEFByPartDenumire(m.lcCodFiscal, m.llPrimite, m.lcArticol, m.llIdArticol, m.lnIdEfactura)
					
					IF EMPTY(NVL(m.lnIdArticol,0))
						IF !EMPTY(NVL(loArticol.id_articol,0))
							lnIdArticol = loArticol.id_articol
							lcArticolROA = loArticol.articol_roa
							lcCodMatROA = loArticol.codmat_roa
							lnInStoc = NVL(loArticol.in_stoc, 0)
							llCompleteazaArticol = .T.				
						ENDIF 
					ENDIF 
		
					IF m.llCompleteazaCont
						IF !EMPTY(NVL(loArticol.cont, ''))
							lcCont = NVL(loArticol.cont, '')
							lcAcont = NVL(loArticol.acont, '')
						ENDIF 	
					ENDIF 
		
					IF m.llCompleteazaGestiune
						IF !EMPTY(NVL(loArticol.id_gestiune,0))
							lnIdGestiune = loArticol.id_gestiune
						ENDIF 	
					ENDIF 
				ENDIF 
		
			
				Select crsDetaliiFacturi
				If !Empty(Nvl(m.lnIdArticol, 0)) AND EMPTY(NVL(crsDetaliiFacturi.id_articol, 0))
					Replace id_articol With m.lnIdArticol, articol_roa WITH m.lcArticolROA, codmat_roa WITH m.lcCodMatROA, in_stoc WITH m.lnInStoc
				ENDIF
				
				IF EMPTY(NVL(crsDetaliiFacturi.cont,'')) AND !EMPTY(m.lcCont)
					REPLACE cont WITH m.lcCont, acont WITH m.lcAcont
				ENDIF 	
				IF m.llCompleteazaGestiune AND EMPTY(NVL(crsDetaliiFacturi.id_gestiune,0)) AND !EMPTY(NVL(m.lnIdGestiune,0))
					REPLACE id_gestiune WITH m.lnIdGestiune
				ENDIF 	
			ENDSCAN
		
			* Completare valori implicite din optiuni
			* Articole
			Update crsDetaliiFacturi Set id_tip = m.lnIdTipArt0 Where Empty(Nvl(id_tip,0))
			Update crsDetaliiFacturi Set Cont = m.lcCont0 Where Empty(Nvl(Cont,''))
			Update crsDetaliiFacturi Set id_gestiune = m.lnIdGestiune0  Where Empty(Nvl(id_gestiune,0))
			
			GO TOP IN crsDetaliiFacturi
		Endif && llNecompletat
		
		Replace completatdet With 1 In crsFacturi
		
		This.grdDetaliiFacturi.Refresh()
		  
	ENDPROC

	PROCEDURE completeazafactura
		* Facturi primite/emise
		* Completez capul de factura: numar act, data act, partener ROA, cont furnizor/client, id valuta ROA, curs
		* sectie, tip venit/cheltuiala implicita
		
		*!* 18.03.2025
		*!* daca firma nu are TVA la Incasare si este o factura de achizitie, verific daca furnizorul are TVA la incasare
		
		Local lcCodFiscal, lcCont, lcNumarAct, lcPartenerROA, lcSerieAct, llPrimite, llRTVAI, llSucces, llNecompletat
		Local lnIdPartROA, lnInValuta, lnNrAct, lnTvaIncasare, loFactura, loPartener, lcDetalii
		Local lcCodFiscalROA, lcNrAct, lcSql, lnIdSectie, lnIdVenChelt, loSectie, loVenchelt
		
		Private pcCodValuta, pnCurs, pnIdEFactura, pnIdValuta, pdDataAct
		
		llPrimite = Thisform.lPrimite
		
		If m.llPrimite
			lnIdSectie = m.gnEFACTURA_ID_SECTIE_P
			lnIdVenChelt = m.gnEFACTURA_ID_VENCHELT_P
		Else
			lnIdSectie = m.gnEFACTURA_ID_SECTIE_E
			lnIdVenChelt = m.gnEFACTURA_ID_VENCHELT_E
		Endif
		
		pnIdEFactura = Nvl(crsFacturi.Id, 0)
		If Empty(m.pnIdEFactura)
			Return
		Endif
		
		Select crsFacturi
		Scatter Name loFactura MEMO 
		llNecompletat = (crsFacturi.completat = 0)
		lcDetalii = NVL(loFactura.detalii, '')
		
		* Fac vizibila bifa de distribuie discount daca efactura are discount global
		This.chkDistribuieDiscount.Value = (loFactura.discount_fara_tva <> 0 or loFactura.taxe_fara_tva <> 0) 
		This.chkDistribuieDiscount.Visible = (loFactura.discount_fara_tva <> 0 or loFactura.taxe_fara_tva <> 0)
		
		If m.llNecompletat
			If Empty(Nvl(Cont,''))
				lcCont = Iif(Thisform.lPrimite, '401', '4111')
				Replace Cont With m.lcCont
			ENDIF
			
			lcNumarAct = Alltrim(Nvl(loFactura.numar_act, ''))
			If Empty(Nvl(loFactura.NrActROA,0))
				lcNrAct = Alltrim(Right(Alltrim(GetRegExp(m.lcNumarAct, "[0-9]+$",1)),14))
				lnNrAct = Int(Val(RIGHT(m.lcNrAct,14)))
				Replace NrActROA With m.lnNrAct In crsFacturi
			Endif
		
			If Empty(Nvl(loFactura.SerieActROA,''))
				lcNrAct = Nvl(Alltrim(Str(crsFacturi.NrActROA,14,0)), '')
				lcSerieAct = GetRegExp(m.lcNumarAct, "[A-Za-z0-9]+",1)
				lcSerieAct = Strtran(m.lcSerieAct, m.lcNrAct, '')
				Replace SerieActROA With m.lcSerieAct
			Endif
		
		
			pdDataAct = crsFacturi.data_act
		
		* Valuta
			pcCodValuta = Upper(Alltrim(Nvl(crsFacturi.nume_valuta, 'RON')))
			lnInValuta = Iif(m.pcCodValuta <> 'RON', 1, 0)
		
			If m.lnInValuta = 1 And Empty(Nvl(loFactura.IdValutaROA, 0))
				pnIdValuta = 0
				pnCurs = 0.0000
		
				llSucces = goExecutor.oSelecteaza2Value("select id_valuta from vnom_valute where nume_val2 = ?pcCodValuta AND INACTIV = 0", @pnIdValuta)
				If !m.llSucces
					Return
				Endif
		
				Select crsFacturi
				Replace IdValutaROA With m.pnIdValuta, NumeValutaROA With m.pcCodValuta
		
				llSucces = goExecutor.oSelecteaza2Value("SELECT  last_value(curs) over (partition by id_valuta order by data DESC) FROM CURS  WHERE ?pdDataAct BETWEEN DATA AND DATA2", @pnCurs)
				If !m.llSucces
					Return
				Endif
		
				Select crsFacturi
				Replace CursROA With m.pnCurs
			Endif
		
		* Partener
			If Empty(Nvl(loFactura.IdPartROA, 0))
				lcCodFiscal = Alltrim(crsFacturi.cod_fiscal)
				lcPartenerROA = ''
				lnIdPartROA = Null
		
				loPartener = GetPartenerByCodFiscal(m.lcCodFiscal)
				If !Isnull(loPartener)
		* Partener existent
					lcPartenerROA = Alltrim(Nvl(loPartener.denumire,''))
					lnIdPartROA = loPartener.id_part
					lcCodFiscalROA = ALLTRIM(NVL(loPartener.cod_fiscal, ''))
		
					Select crsFacturi
					Replace IdPartROA With m.lnIdPartROA,PartenerROA With m.lcPartenerROA, codFiscalROA WITH m.lcCodFiscalROA
				Endif
		
		* TVA Incasare
				lnTvaIncasare = Nvl(goCalendar.tva_incasare, 0)
				* daca firma nu are TVA la Incasare si este o factura de achizitie, verific daca furnizorul are TVA la incasare
				If m.lnTvaIncasare = 0 AND m.llPrimite
					llRTVAI = VERIFICA_RTVAI_DATA(m.lcCodFiscal, m.pdDataAct)
					lnTvaIncasare = Iif(m.llRTVAI, 1, 0)
				Endif
				Select crsFacturi
				Replace TVAIncasare With m.lnTvaIncasare
		
			Endif
		
		* Completare valori din optiuni
			If Empty(Nvl(loFactura.id_sectie, 0)) And !Empty(Nvl(m.lnIdSectie,0))
				loSectie = GetSectieById(m.lnIdSectie)
				Replace id_sectie With m.lnIdSectie, sectie With loSectie.sectie In crsFacturi
			Endif
			If Empty(Nvl(loFactura.id_venchelt, 0)) And !Empty(Nvl(m.lnIdVenChelt,0))
				loVenchelt = GetVencheltById(m.lnIdVenChelt)
				Replace id_venchelt With m.lnIdVenChelt, dst_chlt With loVenchelt.explicatie In crsFacturi
			Endif
		Endif && llNecompletat
		
		Select crsFacturi
		Replace completat With 1
		
		
		***************
		****************************************************************************
		* Actualizez si anaf_efactura.detalii
		* Aduc si xml efactura din anaf_efactura.detalii doar pentru factura curenta, pentru ca dureaza prea mult sa aduc pentru toate facturile
		***************
		IF EMPTY(m.lcDetalii)
			lcSql = [select detalii from anaf_efactura where id = ] + ALLTRIM(STR(m.pnIdEFactura))
			llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @lcDetalii)
			IF m.llSucces
				SELECT crsFacturi
				REPLACE detalii WITH m.lcDetalii
			ENDIF 		
		ENDIF 		
		***************
		
		With This
			.txtSerieAct.Refresh
			.txtNrAct.Refresh
			.txtdataAct.Refresh
			.txtDatascad.Refresh
			.txtPartener.Refresh
			.txtCodFiscal.Refresh
			.txtCont.Refresh
			.txtValuta.Refresh
			.txtCurs.Refresh
			.txtLucrare.Refresh
			.txtContract.Refresh
			.txtSectie.Refresh
			.txtVenChelt.Refresh
			.txtResponsabil.Refresh
			.chkTVAIncasare.Refresh
			.chkDistribuieDiscount.Refresh
		Endwith
		 
	ENDPROC

	PROCEDURE creeazanote
	ENDPROC

	PROCEDURE do_cauta
		Local lcCond, lcDif, lcLipsa, lcFiltruBaza
		lcFiltru = '' && filtru facturi primite
		
		* 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_ACT'$upper(THISFORM.filtru_pretty) OR 'DATA_TRIMIS'$upper(THISFORM.filtru_pretty) )
			lcData1 = '01' + PADL(INT(m.gnLuna),2,'0') + ALLTRIM(STR(m.gnAn))
			*!* data_act pe interval (nu extract(year/month...)) ca sa poata folosi IDX_ANAF_EFACTURA_1(FACTURA_EMISA,XDATA_ACT,DATA_RASPUNS)
			ldData1 = GOMONTH(m.ldData1, 1)
			lcData2 = '01' + PADL(MONTH(m.ldData1),2,'0') + ALLTRIM(STR(YEAR(m.ldData1)))
			lcFiltru = m.lcFiltru + [ and ((data_act >= to_date('] + m.lcData1 + [','ddmmyyyy') and data_act < to_date('] + m.lcData2 + [','ddmmyyyy')) or (data_act is null and data_raspuns >= to_date('] + m.lcData1 + [','ddmmyyyy')))]
		ENDIF
		
		* Filtre buton cautare
		IF LEN(THISFORM.filtru_pretty)>0     
			lcFiltru = m.lcFiltru + " and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"    	
		ENDIF
		
		* Filtrul de baza (fara chkDiferente/chkLipsaRegistru), pentru numarul independent din caption
		lcFiltruBaza = m.lcFiltru
		
		* Bifele Diferente / Lipsa din registrul de TVA
		lcLipsa = [(jtotctva is null)]
		lcDif = [(jtotctva is not null and (NVL(nume_valuta,'RON') <> 'RON' or ABS(decode(creditnote,0,1,-1) * NVL(total_cu_tva,0.00) - (NVL(jtotctva,0.00) - NVL(jtva_ti,0.00))) > 0.15))]
		lcCond = []
		IF this.chkDiferente.Value
			lcCond = m.lcDif
		ENDIF 
		IF this.chkLipsaRegistru.Value
			lcCond = IIF(EMPTY(m.lcCond), m.lcLipsa, m.lcCond + [ or ] + m.lcLipsa)
		ENDIF 
		IF !EMPTY(m.lcCond)
			lcFiltru = m.lcFiltru + [ and (] + m.lcCond + [)]
		ENDIF 
		
		If Empty(m.lcFiltru)
			aMessagebox("Alegeti un criteriu!",0+48,"Atentie")
			Return
		Endif
		
		IF !EMPTY(m.lcFiltru) AND LEFT(LOWER(ALLTRIM(m.lcFiltru)),3) = "and"
			lcFiltru = SUBSTR(ALLTRIM(m.lcFiltru),4)
		ENDIF 	
		
		
		* Facturi primite
		IF !EMPTY(m.lcFiltru)
			THISFORM.actualizeaza_grid1(m.lcFiltru)
			THISFORM.actualizeaza_grid2()	
			SELECT crsFacturi
		ENDIF
		
		
		This.NumaraDiferenteImport(m.lcFiltruBaza, m.lcDif, m.lcLipsa)
		
		Return m.lcFiltru
		
	ENDPROC

	PROCEDURE do_excel
		Private pcTitlu, pcSubtitlu
		Local lcSelect, lctext, lnOptiune, lnRecno
		Local lcSql, llSucces, lnIdEfactura
		Local lcSirIdEfact, lcSelect
		Local lcFisierPDF
		Local lcCursor, lnPaginaActiva
		Local lcDetalii, lcRaport, llVariable
		
		lcSelect = Select()
		pcTitlu = ''
		pcSubtitlu = ''
		If This.filtru_traducere() # ""
			lctext = " si " + This.filtru_traducere()
		Else
			lctext = ""
		Endif
		pcSubtitlu = This.filtru_pretty_ro + lctext
		
		lcSelect = Select()
		lnRecno = Recno()
		
		llPrimite = this.lPrimite
		
		
		DO CASE 
			CASE !m.llPrimite
				* Facturi TRIMISE
				lnOptiune = xmenu('Centralizator facturi;Facturi trimise;Factura curenta')
				lcCursor = 'crsFacturi'
				lcCaption = "emise"
				loGrid = This.grdFacturi
			CASE  m.llPrimite
				* Facturi PRIMITE
				lnOptiune = xmenu('Centralizator facturi;Facturi primite;Factura curenta')
				lcCursor = 'crsFacturi'
				lcCaption = "primite"
				loGrid = This.grdFacturi		
		ENDCASE  	
		
		If Empty(m.lnOptiune)
			Return
		Endif
		
		Do Case
			Case m.lnOptiune = 1
				* Centralizator
				goExport.export2xlsxGrid(loGrid, "centralizator_facturi_" + m.lcCaption + '_' + Dtos(Date()))
		
			Case Inlist(m.lnOptiune, 2, 3)
		
		* Listare facturi primite detaliat
				lnIdEfactura = &lcCursor..Id
				If Empty(m.lnIdEfactura)
					Exit
				Endif
				If m.lnOptiune = 2
					lcSirIdEfact = cursor2lista(m.lcCursor, "id", ",")
				Else
					lcSirIdEfact = Alltrim(Str(m.lnIdEfactura))
				Endif
		
		
				Do Case
					Case !m.llPrimite
		* Facturi trimise
		
						TEXT TO lcSqlDetalii TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xclient, cod_fiscal_emitent, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere
		from anaf_vefactura_trimis_detaliu
		WHERE id_efactura in (<<m.lcSirIdEfact>>)
		order by data_act, numar_act, id_efactura, nr
						ENDTEXT
		
					Case m.llPrimite
		* Facturi primite
						TEXT TO lcSqlDetalii TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xfurnizor, cod_fiscal_emitent, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere
		from anaf_vefactura_primit_detaliu
		WHERE id_efactura in (<<m.lcSirIdEfact>>)
		order by data_act, numar_act, id_efactura, nr
						ENDTEXT
		
				Endcase
		
				llSucces = goExecutor.oExecuta(m.lcSqlDetalii, 'cFacturiDetaliiRap')
				If m.llSucces
					goExport.export2xlsx('cFacturiDetaliiRap', "lista_facturi_" + m.lcCaption + "_" + Dtos(Date()))
				Endif
				Use In (Select('cFacturiDetaliiRap'))
		Endcase
		
		Select (m.lcSelect)
		
		  
		  
	ENDPROC

	PROCEDURE do_executa
		* IMPORT / creare note contabile
		LOCAL lnIdEFactura, llSucces
		Local lcCont, lcFacturi_dublate, lcMesajFact_dubl, lcSerieAct, lnIdPart, lnNrAct, lnOptiune
		
		
		lnIdEFactura = Nvl(crsFacturi.Id, 0)
		If Empty(m.lnIdEFactura)
			Return
		Endif
		
		* Salvare anaf_efactura_detalii.id_articol, id_gestiune, cont
		llSucces = UpdateEFacturaArticolROA(m.lnIdEFactura)
		
		IF !m.llSucces
			RETURN 
		ENDIF 
		
		IF EMPTY(NVL(crsFacturi.IdPartROA, 0))
			AMESSAGEBOX('Completati partenerul ROA',0+48,_screen.Caption)
			RETURN 
		ENDIF 
		
		* Daca factura are articole gestionabile, lansez formularul de modificare note + rulaje
		* Altfel, lansez formularul achizitie/vanzare generala (doar note contabile)
		* Verific daca exista deja factura
		lcCont = ALLTRIM(NVL(crsFacturi.cont, ''))
		lnIdPart = crsFacturi.IdPartROA
		lcSerieAct = crsFacturi.SerieActROA
		lnNrAct = crsFacturi.NrActROA
		lcMesajFact_dubl = ''
		lcFacturi_dublate = facturi_duplicate(m.lcCont, m.lnIdPart, m.lcSerieAct, m.lnNrAct, m.lcMesajFact_dubl)
		IF !EMPTY(m.lcFacturi_dublate)
			IF AMESSAGEBOX(m.lcFacturi_dublate + CHR(13) + 'Doriti sa continuati?',4+32,_screen.Caption) <> 6
				RETURN 
			ENDIF 
		ENDIF 		
		lnOptiune = xmenu('Import contabilitate;Import gestiune')
		IF EMPTY(m.lnOptiune)
			RETURN
		ENDIF 
		
		
		
		IF m.lnOptiune = 1
			Thisform.ImportGeneral() && factura achizitie/vanzare generala (doar note contabile)
		ELSE
			Thisform.ImportModifica() && formularul de modificare note + rulaje gestiuni
		ENDIF 
		
		 
	ENDPROC

	PROCEDURE do_listare
		Private pcTitlu, pcSubtitlu
		Local lcSelect, lctext, lnOptiune, lnRecno
		Local lcSql, llSucces, lnIdEfactura
		Local lcSirIdEfact, lcSelect
		Local lcFisierPDF
		Local lcCursor, lnPaginaActiva
		Local lcDetalii, lcRaport, llVariable
		
		lcSelect = Select()
		pcTitlu = ''
		pcSubtitlu = ''
		If This.filtru_traducere() # ""
			lctext = " si " + This.filtru_traducere()
		Else
			lctext = ""
		Endif
		pcSubtitlu = This.filtru_pretty_ro + lctext
		
		lcSelect = Select()
		lnRecno = Recno()
		
		llPrimite = this.lPrimite
		
		
		DO CASE 
			CASE !m.llPrimite
				* Facturi TRIMISE
				lnOptiune = xmenu('Centralizator facturi;Lista facturi trimise - detaliat;Factura trimisa curenta;\-;PDF ANAF facturi alese;PDF ANAF factura curenta')
				lcCursor = 'crsFacturi'
			CASE  m.llPrimite
				* Facturi PRIMITE
				lnOptiune = xmenu('Centralizator facturi;Lista facturi primite - detaliat;Factura primita curenta;\-;PDF ANAF facturi alese;PDF ANAF factura curenta;\-;\<NIR')
				lcCursor = 'crsFacturi'
		ENDCASE  	
		
		If Empty(m.lnOptiune)
			Return
		Endif
		
		Do Case
			Case m.lnOptiune = 1
				* Centralizator
				lcRaport = 'efact_facturi'
				IF !m.llPrimite
					pcTitlu = 'eFactura Trimise'
				ELSE
					pcTitlu = 'eFactura Primite'		
				ENDIF 
			
		
				SELECT 1 as tip, data_act, numar_act, IIF(m.llPrimite, cod_fiscal_emitent, cod_fiscal_beneficiar) as cod_fiscal, ;
					IIF(m.llPrimite, xfurnizor, xclient) as partener, ;
					total_fara_tva, total_tva, total_tva_ron, total_cu_tva, nume_valuta, id_incarcare, id_descarcare, creditnote ;
					from (m.lcCursor) ;
					ORDER BY data_act, numar_act ;
					into cursor cCentralizator READWRITE 
					
					* Calculez subtotaluri pe valute
					SELECT 2 as tip, nume_valuta, SUM(NVL(total_fara_tva, 0.00)) as total_fara_tva, SUM(NVL(total_tva, 0.00)) as total_tva, SUM(NVL(total_tva_ron, 0.00)) as total_tva_ron, SUM(NVL(total_cu_tva, 0.00)) as total_cu_tva ;
						FROM cCentralizator ;
						GROUP BY nume_valuta ;
						ORDER BY nume_valuta ;
						INTO CURSOR cCentralizator1
		
					SELECT cCentralizator
					APPEND FROM DBF('cCentralizator1')	
		
					* Calculez total general total_tva_ron, daca sunt mai multe valute
					IF RECCOUNT('cCentralizator1') > 1
						SELECT 3 as tip, SUM(NVL(total_tva_ron,0.00)) as total_tva_ron ;
							FROM cCentralizator1 ;
							INTO CURSOR cCentralizator2
		
						SELECT cCentralizator
						APPEND FROM DBF('cCentralizator2')	
						USE IN (SELECT('cCentralizator2'))					
					ENDIF 
					USE IN (SELECT('cCentralizator1'))
				
				Thisform.AlwaysOnTop = .F.
				goExport.export2frx("cCentralizator", m.lcRaport, , , , , , .T.)
				Thisform.AlwaysOnTop = .T.
				USE IN (SELECT('cCentralizator'))
		
			Case Inlist(m.lnOptiune, 2, 3)
				* Listare facturi primite detaliat
				IF !m.llPrimite
					pcTitlu = 'eFactura Trimise'
					lcRaport = 'efact_facturi_trimise_detalii'
					lnIdEfactura = crsFacturi.Id
				ELSE
					pcTitlu = 'eFactura Primite'		
					lcRaport = 'efact_facturi_primite_detalii'			
					lnIdEfactura = crsFacturi.Id
				ENDIF 
		
				If Empty(m.lnIdEfactura)
					Exit
				Endif
				If m.lnOptiune = 2
					lcSirIdEfact = cursor2lista(m.lcCursor, "id", ",")
				Else
					lcSirIdEfact = Alltrim(Str(m.lnIdEfactura))
				Endif
		
				IF !m.llPrimite
					TEXT TO lcSql TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xfurnizor, cod_fiscal_emitent, xclient, cod_fiscal_beneficiar, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id_incarcare, id_descarcare, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere, creditnote
			from anaf_vefactura_trimis_detaliu
			WHERE id_efactura in (<<m.lcSirIdEfact>>)
			order by data_act, numar_act, id_efactura, nr
					ENDTEXT
				ELSE
					TEXT TO lcSql TEXTMERGE NOSHOW
		select data_act, numar_act, data_scad, xfurnizor, cod_fiscal_emitent, xclient, cod_fiscal_beneficiar, total_fara_tva, total_tva, total_cu_tva, discount_fara_tva, taxe_fara_tva, valoare_fara_tva, total_de_plata, nume_valuta, xdescriere, detalii_plata, id_incarcare, id_descarcare, id, id_efactura, nr, articol, detalii, cantitate, um, pret, proctva, descriere, creditnote
			from anaf_vefactura_primit_detaliu
			WHERE id_efactura in (<<m.lcSirIdEfact>>)
			order by data_act, numar_act, id_efactura, nr
					ENDTEXT
				ENDIF 
		
				llSucces = goExecutor.oExecuta(m.lcSql, 'cFacturiDetaliuRap')
				If m.llSucces
					* nu afisez descriere sau detalii daca sunt la fel cu articol
					UPDATE cFacturiDetaliuRap SET descriere = '' WHERE articol = descriere
					UPDATE cFacturiDetaliuRap SET detalii = '' WHERE articol = detalii
								
					Thisform.AlwaysOnTop = .F.
					goExport.export2frx([cFacturiDetaliuRap], m.lcRaport, , , , , , .T.)
					Thisform.AlwaysOnTop = .T.
				Endif
		
				Use In (Select('cFacturiDetaliuRap'))
		
			Case m.lnOptiune = 5
				loAnaf = Createobject('AnafeFacturaServer')
				SELECT(m.lcCursor)
				lnRecno = Recno()
				llVariable = .T.
				Scan For ales = 1
					lcDetalii = ALLTRIM(detalii)
					
					If !Empty(m.lcDetalii)
						DO CASE 
							CASE !m.llPrimite
								lcFisierPDF = GetPdfPath('EFACTURA', 'TRIMISE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xclient), ' ', '_',1,100,1)) + '.pdf'
							OTHERWISE 
								lcFisierPDF = GetPdfPath('EFACTURA', 'PRIMITE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xfurnizor), ' ', '_',1,100,1)) + '.pdf'				
						ENDCASE
		
						lcFisierPDF = loAnaf.Xml2PdfAnaf(m.lcDetalii, m.lcFisierPdf, m.llVariable)
						
						If !EMPTY(m.lcFisierPDF) AND File(m.lcFisierPDF)
							open_default_app(m.lcFisierPDF)
						Endif
					Endif
				Endscan
				Try
					Goto m.lnRecno
				Endtry
			Case m.lnOptiune = 6
				loAnaf = Createobject('AnafeFacturaServer')
				SELECT(m.lcCursor)
				lcDetalii = ALLTRIM(detalii)	
				llVariable = .T.
				
				If !Empty(m.lcDetalii)
						DO CASE 
							CASE !m.llPrimite
								lcFisierPDF = GetPdfPath('EFACTURA', 'TRIMISE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xclient), ' ', '_',1,100,1)) + '.pdf'
							OTHERWISE 
								lcFisierPDF = GetPdfPath('EFACTURA', 'PRIMITE') + 'efactura_' + WindowsSpecialCharacters(DTOS(data_act) + '_' + ALLTRIM(numar_act) + '_'+ STRTRAN(ALLTRIM(xfurnizor), ' ', '_',1,100,1)) + '.pdf'				
						ENDCASE
					goLog.Log(m.lcFisierPDF)
					lcFisierPDF = loAnaf.Xml2PdfAnaf(m.lcDetalii, m.lcFisierPdf, m.llVariable)			
					If !EMPTY(m.lcFisierPDF) AND File(m.lcFisierPDF)
						open_default_app(m.lcFisierPDF)
					Endif
				ENDIF
			Case m.lnOptiune = 8
				* Listare NIR
				This.ListareNIR()		
		Endcase
		
		Select (m.lcSelect)
		
		  
	ENDPROC

	PROCEDURE do_sterge
		Local lcSql, llSucces, lnId
		llSucces = .F.
		If This.pgfeFactura.ActivePage <> 2
			Return .F.
		Endif
		If Nvl(crsFacturiTrimise.test,0) = 0
			AMESSAGEBOX('Puteti sterge doar facturi trimise de Test', 0+48,_Screen.Caption)
			Return .F.
		ENDIF
		
		lnId = NVL(crsFacturiTrimise.Id, 0)
		
		TEXT TO lcSql TEXTMERGE NOSHOW
		begin
			delete from anaf_efactura_detalii where id_efactura = <<m.lnId>>;
			delete from anaf_efactura where id = <<m.lnId>>;
		end;
		ENDTEXT
		
		If AMessagebox('Doriti sa stergeti mesajul de transmitere al facturii?' + CHR(13) + CHR(10) + ;
			'Atentie, operatia este ireversibila!',4+32,_Screen.Caption)= 6
			llSucces = goExecutor.oExecuta(m.lcSql)
		Endif
		
		this.do_cauta()
		
		Return m.llSucces
		
	ENDPROC

	PROCEDURE importgeneral
		Local lcDenumireTax, lcDetalii, lcDetaliiPlata, lcExplicatie, lcNumeValuta, lcTipJ, lcXML, lcCodValuta, ldDataIreg, lcExplicatia
		Local lcXMLFacturaDetalii, llAcont, llCalcTVA, llCursorCreat, llPlata, llPrimite, llSucces
		Local lnTVAIncasare, llTaxareInversa, lnDeducere, lnDiscountFaraTVA, lnIdJtva, lnIdSet, lnInValuta, lnTaxeFaraTVA
		Local lnTotalCuTVA, lnTotalFaraTVA, lnTotalTVA, lnTotaldePlata, lnValoareFaraTVA, loFactura, lnTotalFaraTVA, lnTotalTVA
		Local lcCont, lcAcont, loRec
		Local lcContTVA, lcTitlu, lnPTVA
		Local lcContCredit, lcContDebit, lcFiltru
		Local lcScc, lcScd, lnCurs, lnIdValuta, lnIdEfactura, llDistribuieArticole
		Local lcContDiscount, lcContTaxe, lcSqlIdFact, lcXmlDisc, llDistribuieDiscountTaxe, lnProcTVA
		Local lnProcent, lnRecno, lnTotalCuTVAx, lnTotalFaraTVAx, lnValoareFaraTVA0, loFactParse, loJtva
		
		
		PRIVATE pnId, pnIdArticol, pnIdEFactura, pnIdFact, pnNrAct, pdDataAct, pnIdPart
		
		lcXML = ''
		lnDeducere = Thisform.cboDeducere.Value && 0 = fara, 1 = deducere 50%, 2 = deducere 100%
		llCalcTVA = .T.
		llPlata = .T.
		llAcont = .F.
		llCursorCreat = .T.
		llPrimite = Thisform.lPrimite
		lcTipJ = Iif(Thisform.lPrimite, 'JC', 'JV')
		
		SELECT crsFacturi
		SCATTER NAME loFactura MEMO 
		
		*!*	* Salvare anaf_efactura_detalii.id_articol, id_gestiune, cont
		*!*	llSucces = UpdateEFacturaArticolROA(loFactura.id)
		 
		lnIdEfactura = loFactura.Id
		lcCont = NVL(loFactura.cont, '')
		lcAcont = NVL(loFactura.acont, '')
		IF EMPTY(m.lcCont)
			lcCont = IIF(thisform.lPrimite, '401', '4111')
		ENDIF 
		
		lnIdValuta = loFactura.IdValutaROA
		lnCurs = loFactura.cursROA
		lcCodValuta = Upper(Alltrim(Nvl(loFactura.nume_valuta, 'RON')))
		lnInValuta = Iif(m.lcCodValuta <> 'RON', 1, 0)
		lnTVAIncasare = loFactura.TVAIncasare
		llTaxareInversa = .F.
		lnTotalFaraTVA = loFactura.total_fara_tva
		lnTotalTVA = loFactura.total_tva
		lnTotalCuTVA = loFactura.total_cu_tva
		
		lnDiscountFaraTVA = loFactura.discount_fara_tva && discount la nivelul facturii
		lnTaxeFaraTVA = loFactura.taxe_fara_tva && taxe la nivelul facturii
		llDistribuieDiscountTaxe = This.chkDistribuieDiscount.Value and (m.lnDiscountFaraTVA <> 0 or m.lnTaxeFaraTVA <> 0)
		lcExplicatia = ALLTRIM(LEFT(loFactura.explicatiaROA, 100))
		
		* Verific daca exista bife pe articole sa distribui valoarea pe restul articolelor (discount-uri, taxe)
		SELECT crsDetaliiFacturi
		lnRecno = RECNO()
		LOCATE for distribuie = 1 
		llDistribuieArticole = FOUND()
		TRY 
			GOTO m.lnRecno
		CATCH 
			GO TOP 	
		ENDTRY 	
		llDistribuieDiscountTaxe = m.llDistribuieDiscountTaxe or m.llDistribuieArticole
		
		
		Create Cursor cDetaliiDiscTaxeTemp (valoare N(20,6), procentTVA N(5,2), discount N(1), motivdiscount V(200), motivdiscountcod V(50)) && discount : discount = 1 / taxe : discount = 0
		If m.lnDiscountFaraTVA <> 0 OR m.lnTaxeFaraTVA <> 0
			lcDetalii = loFactura.detalii
			loFactParse = ParseEfactura(m.lcDetalii, .T.)
		
			lcXmlDisc = loFactParse.FacturaDetaliiDisc
			Xmltocursor(m.lcXmlDisc, 'cDetaliiDiscTaxeTemp', 8192)
		ENDIF 
		
		IF thisform.lPrimite 
			lcTitlu = 'Factura de achizitie - Furnizori ' + m.lcCont
			lcContTVA = IIF(m.lnTVAIncasare = 0, '4426', '4428')
			lnIdSet = 10456
			lcContDebit = ''
			lcContCredit = m.lcCont
			lcScd = ''
			lcScc = m.lcCont
			lcContDiscount = '767'
			lcContTaxe = '6588' && alte cheltuieli de exploatare	
		ELSE
			lcTitlu = 'Factura de vanzare - Clienti ' + m.lcCont
			lcContTVA = IIF(m.lnTVAIncasare = 0, '4427', '4428')
			lnIdSet = 10464   
			lcContDebit = m.lcCont
			lcContCredit = ''
			lcScd = m.lcCont
			lcScc = ''
			lcContDiscount = '667'
			lcContTaxe = '7588' && alte venituri de exploatare	
		ENDIF 
		
		* Creez cursoarele actactan (care se crea in pmenu.lans, cu partener, tva incasare) si cnote_contabile folosite in introducere_compacta
		Do update_jtva_coloane With (m.lcTipJ)
		
		llSucces = goExecutor.oExecuta([select t.*, 0 As pozitie_1, 0 As pozitie_2, CAST(0 as NUMBER(4)) as nr_nota from vact_tot t where 1=2], [actactan])
		If !m.llSucces
			Return
		Endif
		
		Select crsDetaliiFacturi
		lcFiltru = FILTER('crsDetaliiFacturi')
		UPDATE crsDetaliiFacturi SET valoarefaratva =  ROUND(NVL(cantitate,0)*NVL(pret,0),2) - NVL(discountfaratva,0) WHERE EMPTY(NVL(valoarefaratva,0)) AND &lcFiltru
		Go Top
		ldDataIreg = loFactura.data_Act
		IF Month(m.ldDataIreg) <> m.gnluna Or Year(m.ldDataIreg) <> m.gnAn
			ldDataIreg = ultimazi()
		ENDIF
		
		SELECT * FROM crsDetaliiFacturi WHERE &lcFiltru INTO CURSOR crsDetaliiFacturi2 READWRITE 
		
		* Adaug articol DISCOUNT/TAXE global
		If Reccount('cDetaliiDiscTaxeTemp') > 0 AND !m.llDistribuieDiscountTaxe
			Insert Into crsDetaliiFacturi2 (id_efactura, articol, cantitate, Pret, valoarefaratva, proctva, Cont, tiptva) ;
				SELECT m.lnIdEfactura, CAST(IIF(!EMPTY(NVL(motivdiscount,'')), UPPER(ALLTRIM(motivdiscount)), IIF(discount = 1, 'DISCOUNT', 'TAXE')) as V(100)) As articol, ;
				IIF(discount = 1, -1, 1) As cantitate, valoare As Pret, IIF(discount = 1, -1, 1) * valoare As valoarefaratva, procentTVA As proctva, ;
				CAST(IIF(discount = 1, m.lcContDiscount, m.lcContTaxe) As C(4)) As cont, tiptva ;
				FROM cDetaliiDiscTaxeTemp
		ENDIF 			
		
		If m.llPrimite
			Select *, Cast(NVL(Cont, '') As C(4)) As scd, Cast(NVL(acont, '') As C(4)) as ascd, Cast(NVL(loFactura.Cont, '') As C(4)) As scc, Cast(NVL(loFactura.Acont, '') As C(4)) as ascc, ;
				IIF(INLIST(NVL(cont, ''), '667', '767', '609', '709'), 1, 0) as discount ;
				from crsDetaliiFacturi2 ;
				WHERE &lcFiltru ;
				INTO Cursor crsDetaliiFacturiTemp Readwrite
		Else
			Select *, Cast(NVL(loFactura.Cont, '') As C(4)) As scd, Cast(NVL(loFactura.Acont, '') As C(4)) as ascd, Cast(NVL(Cont, '') As C(4)) As scc, Cast(NVL(acont, '') As C(4)) as ascc, ;
				IIF(INLIST(NVL(cont, ''), '667', '767', '609', '709'), 1, 0) as discount ;	
				from crsDetaliiFacturi2 ;
				WHERE &lcFiltru ;
				INTO Cursor crsDetaliiFacturiTemp Readwrite
		ENDIF
		
		* Distribui discount-ul/taxele (transport) globale pe articole
		* Calculez valoarea articolelor pe procente TVA
		* calculez procent discount/taxa pe valoare articole
		* maresc/diminuez pretul articolelor cu procentul de distribuit
		* Adaug articolele tip discount/taxe care trebuie distribuite
		IF m.llDistribuieArticole
			INSERT INTO cDetaliiDiscTaxeTemp (valoare, procentTVA, discount, motivdiscount) ;
				SELECT ABS(valoarefaratva) as valoare, proctva as procentTVA, IIF(SIGN(valoarefaratva) = -1, 1, 0) as discount, IIF(SIGN(valoarefaratva) = -1, 'DISCOUNT', 'TAXE') AS motivdiscount ;
					FROM crsDetaliiFacturiTemp ;
					WHERE distribuie = 1
		
			DELETE FROM crsDetaliiFacturiTemp WHERE distribuie = 1				
		ENDIF 
		
		If Reccount('cDetaliiDiscTaxeTemp') > 0 AND m.llDistribuieDiscountTaxe
			Select proctva, Sum(valoarefaratva) As valoarefaratva ;
				FROM crsDetaliiFacturiTemp ;
				GROUP By proctva ;
				INTO Cursor cTotaluriPeTva
		
			SELECT procenttva, SUM(IIF(discount = 1, -1, 1) * valoare) as valoare ;
				FROM cDetaliiDiscTaxeTemp ;
				GROUP BY procenttva ;
				into cursor cDetaliiDiscTaxeTemp2
				
			Select a.proctva, a.valoarefaratva, b.valoare, Round(b.valoare / a.valoarefaratva, 6) As procent ;
				FROM cTotaluriPeTva a Join cDetaliiDiscTaxeTemp2 b On a.proctva = b.procentTVA ;
				INTO Cursor cProcentePeTVA
		
			USE IN (SELECT('cDetaliiDiscTaxeTemp2'))
			Use In (Select('cTotaluriPeTva'))
		
			Select cProcentePeTVA
			Scan
				lnProcTVA = proctva
				lnProcent = (1+procent)
				Update crsDetaliiFacturiTemp  Set Pret = Round(Pret * m.lnProcent, 4), valoarefaratva = Round(valoarefaratva * m.lnProcent, 2)
			Endscan
		
			Use In (Select('cProcentePeTVA'))
		ENDIF && llDistribuieDiscountTaxe
		
		USE IN (SELECT('cDetaliiDiscTaxeTemp'))
		USE IN (SELECT('crsDetaliiFacturi2'))
		
		*************************************************************************************************
		
		SELECT actactan
		APPEND BLANK
		REPLACE id_set WITH m.lnIdSet, tva_incasare WITH loFactura.TvaIncasare, ;
			dataireg WITH m.ldDataIreg, dataact WITH loFactura.Data_Act, datascad WITH loFactura.Data_Scad, nract WITH loFactura.NrActROA, serie_act With UPPER(loFactura.SerieActROA), ;
			id_fdoc WITH thisform.nIdFdoc, fdoc WITH thisform.cFdoc, id_sectie WITH loFactura.id_Sectie, sectie WITH loFactura.sectie, ;
			nrord WITH loFactura.nrord, id_lucrare WITH loFactura.id_Lucrare, contract WITH loFactura.contract, id_ctr WITH loFactura.id_ctr,;
			dst_chlt WITH loFactura.dst_chlt, id_venchelt WITH loFactura.id_Venchelt, nresp WITH loFactura.nresp, id_responsabil WITH loFactura.id_responsabil, ;
			explicatia with m.lcExplicatia, scd WITH m.lcScd, scc WITH m.lcScc
			* Nu completez explicatia cu denumirea primului articol pentru ca se completeaza si pe nota de TVA. Nu doresc explicatii completate in nota contabila.
		
		If m.llPrimite
			Select actactan
			Replace id_partc With loFactura.IdPartROA, partc With loFactura.PartenerROA
		ELSE
			Select actactan
			Replace id_partd With loFactura.IdPartROA, partd With loFactura.PartenerROA
		ENDIF 
		
		Select Cast(0 As N(5)) As id_note, MAX(articol) As explicatie, ;
			scd, ascd, scc, ascc, m.lnIdSet As id_set, Cast(0 As I) As ordine, m.lnInValuta As in_valuta, 1 As cu_tva, proctva As ptva, tiptva, ;
			CAST(0 As I) As id_jtax, Space(200) As denumiretax, ;
			m.lcTipJ As tipjurnal, Cast(Null As I) As taxcode, Cast(Null As C(5)) As paymentcode, ;
			SUM(ValoareFaraTVA) As ValoareFaraTVA, ;
			CAST(0 As N(16,4)) As suma, Cast(0 As N(16,4)) As suma_val, Cast(0 As N(5)) As id_valuta, Cast('' As C(5)) As nume_val, Cast(0 As N(16,4)) As Curs, discount ;
			from crsDetaliiFacturiTemp ;
			group By scd, ascd, scc, ascc, proctva, tiptva, discount ;
			INTO Cursor cnote_contabile Readwrite
		
		IF m.lnDeducere = 1 AND NVL(goCalendar.impozit_profit,0) = 1 && Deducere 50%	cheltuieli si TVA pentru Platitorii de Impozit pe Profit
			* La deducere TVA 50%, pun 2 note si pentru firmele impozit profic cu cheltuieli deductibile si nedeductibile
			UPDATE cnote_contabile SET explicatie = 'CHELTUIELI DEDUCTIBILE'
		
			* 22.08.2025
			* Am introdus Calendar.impozit_profit
			* Platitorii impozit venit, pentru limitare deducere 50% nu le trebuie 2 note CHELTUIELI DEDUCTIBILE si NEDEDUCTIBILE
			SELECT * FROM cnote_contabile INTO CURSOR cnote_contabile2 READWRITE 
			UPDATE cnote_contabile2 SET explicatie = 'CHELTUIELI NEDEDUCTIBILE'
		
			SELECT cnote_contabile
			APPEND FROM DBF('cnote_contabile2')
			USE IN (SELECT('cnote_contabile2'))
		
			* Pun suma la jumatate pe fiecare nota
			UPDATE cnote_contabile SET ValoareFaraTVA = ROUND(ValoareFaraTVA/2, m.gnPA)
		ENDIF 
		
		* Completez explicatia pe fiecare grup de note, din prima aparitie a grupului
		*!*	* Era buna o functie analitica Oracle: first over (partition by order by )
		*!*	SELECT cnote_contabile
		*!*	SCAN
		*!*		SCATTER NAME loRec
		*!*		SELECT crsDetaliiFacturiTemp
		*!*		LOCATE FOR proctva = loRec.ptva AND NVL(scd,'x') = NVL(loRec.scd, 'x') AND NVL(ascd,'x') = NVL(loRec.ascd, 'x') AND NVL(scc,'x') = NVL(loRec.scc, 'x') AND NVL(ascc,'x') = NVL(loRec.ascc, 'x')
		*!*		IF FOUND()
		*!*			REPLACE explicatie WITH  Left(crsDetaliiFacturiTemp.articol, 100) IN cnote_contabile
		*!*		ENDIF 	
		*!*	ENDSCAN 
		
		USE IN (SELECT('crsDetaliiFacturiTemp'))
		
		IF m.gnNeplatitoare_tva = 1
		    * Neplatitori de TVA, repartizez TVA pe articole
		    * Neplatitor TVA, trebuie sa aiba procent TVA = 0, si la facturile primite
		    CALCULATE SUM(valoarefaratva) FOR ptva = 0 TO lnValoareFaraTVA0
		
		    lnTotalFaraTVAx = m.lnTotalFaraTVA - m.lnValoareFaraTVA0
		    lnTotalCuTVAx   = m.lnTotalCuTVA   - m.lnValoareFaraTVA0
		
		    IF m.lnTotalFaraTVAx = 0
		        * Total zero - factura cu discount 100% sau compensare completa
		        CALCULATE SUM(ABS(valoarefaratva)) FOR ptva <> 0 TO lnTotalAbsValoare
		
		        IF m.lnTotalAbsValoare <> 0
		            lnTVADeDistribuit = m.lnTotalCuTVAx - m.lnTotalFaraTVAx
		
		            UPDATE cnote_contabile SET ptva = 0, ;
		            	valoarefaratva = valoarefaratva + ROUND(ROUND(ABS(valoarefaratva) / m.lnTotalAbsValoare, 6) * m.lnTVADeDistribuit * IIF(valoarefaratva >= 0, 1, -1), m.gnPA) ;
		                WHERE ptva <> 0
		        ELSE
		            UPDATE cnote_contabile SET ptva = 0 WHERE ptva <> 0
		        ENDIF
		    ELSE
		        * Cazul normal - logica originala
		        UPDATE cnote_contabile SET ptva = 0, ;
		            valoarefaratva = ROUND(ROUND(ValoareFaraTVA / m.lnTotalFaraTVAx, 6) * m.lnTotalCuTVAx, m.gnPA) ;
		            WHERE ptva <> 0
		    ENDIF
		
		    * Actualizez totalurile, ca sa nu recalculeze diferente baza si TVA
		    lnTotalFaraTVA = m.lnTotalCuTVA
		    lnTotalTVA = 0
		ENDIF	
		
		If m.lnInValuta = 1
			Update cnote_contabile Set suma_val = ValoareFaraTVA, id_valuta = m.lnIdValuta, nume_val = m.lcCodValuta, Curs = m.lnCurs
		Else
			Update cnote_contabile Set suma = ValoareFaraTVA
		Endif
		
		* Articole tip discount 667/767
		* inversez conturile, partenerii si suma
		SELECT cnote_contabile
		SCAN FOR discount = 1
			SCATTER NAME loRec
			* baza 4111 = 667 negativ => 667 = 4111 pozitiv. inversez conturile si partenerii si suma (suma este negativa la reducere)
			REPLACE scd WITH loRec.scc, ascd WITH loRec.ascc, scc WITH loRec.scd, ascc WITH loRec.ascd
			*REPLACE id_partd WITH loRec.id_partc, partd WITH loRec.partc, id_partc WITH loRec.id_partd, partc WITH loRec.id_partd
			REPLACE suma WITH -loRec.suma, suma_val WITH -loRec.suma_val
		ENDSCAN 
		
		* Completex IdJTVA
		lnPTVA = GetProcTvaStandard()
		Select cnote_contabile
		SCAN
			llTaxareInversa = (UPPER(ALLTRIM(NVL(tiptva,''))) = 'AE')
			lnProcTVA = ptva && pentru neplatitorii de TVA, am mereu procent tva = 0
					
			lnIdJtva = ProcentTva2IdJtva(m.lnProcTVA, m.lcTipJ, m.llTaxareInversa, m.lnTvaIncasare)
			loJtva = GeJtvaColoana(m.lnIdJtva, m.lnTVAIncasare, m.lcTipJ)
			lcDenumireTax = loJtva.denumire
		
			* TVA Taxare Inversa la facturi primite este 0 in eFactura, dar trebuie sa fie 4426 = 4427 in note contabile
			* Maresc totalul cu tva cu tva taxare inversa calculat
			IF m.llTaxareInversa
				SELECT cnote_contabile
				REPLACE ptva WITH m.lnPTVA
		
				IF thisform.lPrimite
					lnTotalCuTVA = lnTotalCuTVA + ROUND(suma*m.lnPTVA/100, m.gnPC)
				ENDIF 	
			ENDIF 
				
			Select cnote_contabile
			Replace id_jtax With m.lnIdJtva, denumiretax With lcDenumireTax
		Endscan
		
		USE IN (SELECT('xcont'))
		CREATE CURSOR xcont (contPart C(4), idPart N(10) NULL, numePart V(250))
		INSERT INTO xcont (contpart, idpart, numepart) VALUES (m.lcCont, loFactura.IdPartROA, loFactura.PartenerROA)
			
		DO introducere_compacta WITH 'achi_mat',lcContDebit, m.lcContCredit,m.llCalcTVA, m.llPlata, m.lcTitlu,m.lcContTVA,m.lnIdSet, m.llAcont, m.lnDeducere, m.llCursorCreat, m.lnTotalCuTVA
		
		
		* Salvare anaf_efactura_detalii.id_fact la importul eFactura achizitie
		pnIdFact = 0
		pnNrAct = loFactura.NrActROA
		pdDataAct = loFactura.Data_Act
		pnIdPart = loFactura.IdPartROA
		lcSqlIdFact = 'SELECT MIN(id_fact) as id_fact from act where sters = 0 and an=?gnAn and luna = ?gnLuna and nract = ?pnNrAct and dataact = ?pdDataAct and ' + IIF(m.llPrimite, 'id_partc', 'id_partd') + '=?pnIdPart'
			
		llSucces = goExecutor.oSelecteaza2Value(m.lcSqlIdFact, @pnIdFact)
		
		IF TYPE('pnIdFact') = 'N' AND NVL(m.pnIdFact,0) <> 0
			llSucces = UpdateEFacturaIdFact(m.lnIdEfactura, m.pnIdFact)				
		ENDIF 
		
		USE IN (SELECT('xcont'))
		  
	ENDPROC

	PROCEDURE importmodifica
		Local Omodif As [frm_modific2024]
		Local lcCodValuta, lcCont, lcContCredit, lcContDebit, lcContTVA, lcCursor, lcDenumireTax, lcAcont, lcExplicatia
		Local lcExplicatie, lcFiltru, lcSql, lcTitlu, ldDataIreg, llRul, llSucces, llTaxareInversa, lnIdJtva
		Local lnIdSet, lnInValuta, lnSucces, lnTVAIncasare, lnTotalCuTVA, loFactura, loRec
		Local lcAcontTVA, lcTipJ, ldDataAct, llN100, llN50, llNeexigibil, llPrimite, lnCurs, lnIdGestiune
		Local lnIdGestiune0, lnIdPart, lnIdTipDoc, lnIdValuta, lnNnir, lnTaxCode
		Local lcAcontx, lcContx, lcGestiune, lcListaCont, lnDiferentaBaza, lnDiferentaTVA, lnTotalFaraTVA
		Local lnTotalTVA, loJtva, loTotal, loRec, lnIdEfactura
		Local lcContDiscount, lcDetalii, lcXmlDisc, llDistribuieDiscountTaxe, lnDiscount, lnDiscountFaraTVA
		Local lnPret, lnProcTVA, lnProcent, lnValoareArticol, lnValoareFaraTVA, loFactParse, lcContTaxe, llDistribuieArticole
		
		LOCAL lcMesaj, lcMesajTemp, lcRaspuns
		lcMesaj = ''
		lcMesajTemp = ''
		
			
		Private pdDataOra, pnIdFact
		pnIdFact = 0
		pdDataOra = Datetime()
		lnIdSet = 99999
		llRul = .T.
		llPrimite = Thisform.lPrimite
		lcTipJ = Iif(Thisform.lPrimite, 'JC', 'JV')
		
		Select crsFacturi
		Scatter Name loFactura Memo
		
		lnIdEfactura = loFactura.Id
		lcCont = Nvl(loFactura.Cont, '')
		lcAcont = Nvl(loFactura.acont, '')
		If Empty(m.lcCont)
			lcCont = Iif(Thisform.lPrimite, '401', '4111')
		Endif
		
		lcCodValuta = Upper(Alltrim(Nvl(loFactura.nume_valuta, 'RON')))
		lnIdValuta = loFactura.IdValutaROA
		lnCurs = loFactura.cursROA
		
		lnInValuta = Iif(m.lcCodValuta <> 'RON', 1, 0)
		lnTVAIncasare = loFactura.TVAIncasare
		llTaxareInversa = .F.
		lnTotalTVA = loFactura.total_tva
		lnTotalFaraTVA = loFactura.total_fara_tva
		lnTotalCuTVA = loFactura.total_cu_tva
		ldDataAct = loFactura.data_act
		lnIdPart = loFactura.IdPartROA
		lnDiscountFaraTVA = loFactura.discount_fara_tva && discount la nivelul facturii
		lnTaxeFaraTVA = loFactura.taxe_fara_tva && taxe la nivelul facturii
		llDistribuieDiscountTaxe = This.chkDistribuieDiscount.Value and (m.lnDiscountFaraTVA <> 0 or m.lnTaxeFaraTVA <> 0)
		lcExplicatia = Alltrim(LEFT(loFactura.explicatiaROA, 100))
		
		* Verific daca exista bife pe articole sa distribui valoarea pe restul articolelor (discount-uri, taxe)
		SELECT crsDetaliiFacturi
		lnRecno = RECNO()
		LOCATE for distribuie = 1 
		llDistribuieArticole = FOUND()
		TRY 
			GOTO m.lnRecno
		CATCH 
			GO TOP 	
		ENDTRY 	
		llDistribuieDiscountTaxe = m.llDistribuieDiscountTaxe or m.llDistribuieArticole
		
		Create Cursor cDetaliiDiscTaxeTemp (valoare N(20,6), procentTVA N(5,2), discount N(1), motivdiscount V(200), motivdiscountcod V(50)) && discount : discount = 1 / taxe : discount = 0
		If m.lnDiscountFaraTVA <> 0 OR m.lnTaxeFaraTVA <> 0
			lcDetalii = loFactura.detalii
			loFactParse = ParseEfactura(m.lcDetalii, .T.)
		
			lcXmlDisc = loFactParse.FacturaDetaliiDisc
			Xmltocursor(m.lcXmlDisc, 'cDetaliiDiscTaxeTemp', 8192)
		ENDIF 
		
		llN50 = .F.
		llN100 = .F.
		llNeexigibil= .F.
		
		If Thisform.lPrimite
			lcTitlu = 'Factura de achizitie - Furnizori ' + m.lcCont
			lcContTVA = Iif(m.lnTVAIncasare = 0, '4426', '4428')
			lcAcontTVA = ''
			lnIdSet = 99999
			lcContDebit = ''
			lcContCredit = m.lcCont
			lnIdGestiune0 = m.gnEFACTURA_ID_GESTIUNE_P
			lcContDiscount = '767'
			lcContTaxe = '6588' && alte cheltuieli de exploatare
		Else
			lcTitlu = 'Factura de vanzare - Clienti ' + m.lcCont
			lcContTVA = Iif(m.lnTVAIncasare = 0, '4427', '4428')
			lcAcontTVA = ''
			lnIdSet = 99999
			lcContDebit = m.lcCont
			lcContCredit = ''
			lnIdGestiune0 = m.gnEFACTURA_ID_GESTIUNE_E
			lcContDiscount = '667'
			lcContTaxe = '7588'	&& alte venituri de exploatare
		Endif
		
		
		* Verifica conturi analitice
		lcListaCont = cursor2listac("crsDetaliiFacturi","cont",",")
		
		
		lcSql = [select CONT, ACONT FROM vplcont_ANALITIC where inactiv = 0 and an = ?gnAn and cont in (] + m.lcListaCont + [) order by cont ]
		llSucces = goExecutor.oExecuta(m.lcSql, 'cContAnaliticTemp')
		If !m.llSucces
			Return
		ENDIF
		
		Select crsDetaliiFacturi
		Scan
			lcContx = Alltrim(Nvl(Cont, ''))
			lcAcontx = Alltrim(Nvl(acont, ''))
			If Empty(m.lcContx)
				AMESSAGEBOX('Completati conturile pentru toate articolele!', 0+48, _Screen.Caption)
				This.grdDetaliiFacturi.cCont.SetFocus()
				Return
			Endif
		
			If Empty(m.lcAcontx)
				Select cContAnaliticTemp
				Locate For Cont = m.lcContx
				If Found()
					AMESSAGEBOX('Completati analiticul pentru contul ' + m.lcContx + '!', 0+48, _Screen.Caption)
					This.grdDetaliiFacturi.cAcont.SetFocus()
					Return
				Endif
			Else
				Select cContAnaliticTemp
				Locate For Cont = m.lcContx And acont = m.lcAcontx
				If !Found()
					AMESSAGEBOX('Analiticul ' + m.lcContx + '.' + m.lcAcontx + ' nu exista in planul de conturi!', 0+48, _Screen.Caption)
					This.grdDetaliiFacturi.cAcont.SetFocus()
					Return
				Endif
		
			Endif
		
			* Verificare ArticolRoa si Gestiune daca sunt lipsa
			Select crsDetaliiFacturi
			If LEFT(lcContx, 1) = '3'
				DO CASE 
					CASE (Empty(NVL(id_articol,0)) AND Empty(NVL(id_gestiune,0)))
				       lcMesajTemp = lcMesajTemp  + ALLTRIM(STR(nr)) + [ "] + ALLTRIM(NVL(articol, '')) + [" (articol ROA si gestiune)] + CHR(13) + CHR(10)
				    CASE Empty(NVL(id_articol,0))
				    	lcMesajTemp = lcMesajTemp + ALLTRIM(STR(nr))  + [ "] + ALLTRIM(NVL(articol,'')) + [" (articol ROA)] + CHR(13) + CHR(10) 
				    CASE EMPTY(NVL(id_gestiune,0))
				    	lcMesajTemp = lcMesajTemp  + ALLTRIM(STR(nr))  + [ "] + ALLTRIM(NVL(articol,'')) + [" (gestiune)] + CHR(13) + CHR(10) 
				ENDCASE  
		
		    ENDIF
		ENDSCAN
		
		
		IF !EMPTY(lcMesajTemp)
		    lcMesajTemp = " Urmatoarele randuri nu au completate Articolul ROA/Gestiunea si nu vor fi importate in rulaje " + CHR(13) + CHR(10) + CHR(13) + CHR(10) + ;
		    	lcMesajTemp + CHR(13) + CHR(10) + ;
		    	"Doriti sa continuati?" 
		
		    lcRaspuns = AMESSAGEBOX(lcMesajTemp, 4 + 48, _Screen.Caption)
		
		    IF lcRaspuns = 7 
		        RETURN
		    ENDIF
		ENDIF
		
		
		Use In (Select('cContAnaliticTemp'))
		
		Select crsDetaliiFacturi
		lcFiltru = Filter('crsDetaliiFacturi')
		Update crsDetaliiFacturi Set valoarefaratva =  Round(Nvl(cantitate,0)*Nvl(Pret,0),2) - NVL(discountfaratva,0) Where Empty(Nvl(valoarefaratva,0)) And &lcFiltru
		Go Top
		ldDataIreg = loFactura.data_act
		If Month(m.ldDataIreg) <> m.gnluna Or Year(m.ldDataIreg) <> m.gnAn
			ldDataIreg = ultimazi()
		Endif
		
		SELECT * FROM crsDetaliiFacturi WHERE &lcFiltru INTO CURSOR crsDetaliiFacturi2 READWRITE 
		
		* Adaug articol DISCOUNT/TAXE global
		If Reccount('cDetaliiDiscTaxeTemp') > 0 AND !m.llDistribuieDiscountTaxe
			Insert Into crsDetaliiFacturi2 (id_efactura, articol, cantitate, Pret, valoarefaratva, proctva, cont, tiptva) ;
				SELECT m.lnIdEfactura, CAST(IIF(!EMPTY(NVL(motivdiscount,'')), UPPER(ALLTRIM(motivdiscount)), IIF(discount = 1, 'DISCOUNT', 'TAXE')) as V(100)) As articol, ;
				IIF(discount = 1, -1, 1) As cantitate, valoare As Pret, IIF(discount = 1, -1, 1) * valoare As valoarefaratva, procentTVA As proctva, ;
				CAST(IIF(discount = 1, m.lcContDiscount, m.lcContTaxe) As C(4)) As Cont, tiptva ;
				FROM cDetaliiDiscTaxeTemp
		ENDIF 			
		
		If m.llPrimite
			Select *, ;
				Cast(Nvl(Cont, '') As C(4)) As scd, Cast(Nvl(acont, '') As C(4)) As ascd, Cast(Nvl(loFactura.Cont, '') As C(4)) As scc, Cast(Nvl(loFactura.acont, '') As C(4)) As ascc, ;
				m.lcContTVA As scd2, m.lcAcontTVA As ascd2, Cast(Nvl(loFactura.Cont, '') As C(4)) As scc2, Cast(Nvl(loFactura.acont, '') As C(4)) As ascc2, ;
				IIF(Inlist(Nvl(Cont, ''), '667', '767', '609', '709'), 1, 0) As discount ;
				from crsDetaliiFacturi2 ;
				WHERE &lcFiltru ;
				INTO Cursor crsDetaliiFacturiTemp Readwrite
		Else
			Select *, Cast(Nvl(loFactura.Cont, '') As C(4)) As scd, Cast(Nvl(loFactura.acont, '') As C(4)) As ascd, Cast(Nvl(Cont, '') As C(4)) As scc, Cast(Nvl(acont, '') As C(4)) As ascc, ;
				Cast(Nvl(loFactura.Cont, '') As C(4)) As scd2, Cast(Nvl(loFactura.acont, '') As C(4)) As ascd2, m.lcContTVA As scc2, m.lcAcontTVA As ascc2, ;
				IIF(Inlist(Nvl(Cont, ''), '667', '767', '609', '709'), 1, 0) As discount ;
				from crsDetaliiFacturi2 ;
				WHERE &lcFiltru ;
				INTO Cursor crsDetaliiFacturiTemp Readwrite
		Endif
		
		USE IN (SELECT('crsDetaliiFacturi2'))
		
		IF m.gnNeplatitoare_tva = 1
		    CALCULATE SUM(valoarefaratva) FOR proctva = 0 TO lnValoareFaraTVA0
		    
		    lnTotalFaraTVAx = m.lnTotalFaraTVA - m.lnValoareFaraTVA0
		    lnTotalCuTVAx   = m.lnTotalCuTVA   - m.lnValoareFaraTVA0
		
		    IF m.lnTotalFaraTVAx = 0
		        * Total zero - factura cu discount 100% sau compensare completa
		        * Redistribuim TVA proportional cu valoarea absoluta
		        CALCULATE SUM(ABS(valoarefaratva)) FOR proctva <> 0 TO lnTotalAbsValoare
		        
		        IF m.lnTotalAbsValoare <> 0
		            * TVA de redistribuit = diferenta dintre totalCuTVA si totalFaraTVA
		            * (in cazul nostru ambele 0, deci lnTVADeDistribuit = 0 si nu facem nimic)
		            lnTVADeDistribuit = m.lnTotalCuTVAx - m.lnTotalFaraTVAx  && = 0 in cazul tau
		            
		            UPDATE crsDetaliiFacturiTemp SET proctva = 0, ;
		                valoarefaratva = valoarefaratva + ;
		                    ROUND(ROUND(ABS(valoarefaratva) / m.lnTotalAbsValoare, 6) * m.lnTVADeDistribuit * IIF(valoarefaratva >= 0, 1, -1), m.gnPA) ;
		                WHERE proctva <> 0
		            UPDATE crsDetaliiFacturiTemp SET pret = pret + ;
		                ROUND(ROUND(ABS(pret) / m.lnTotalAbsValoare, 6) * m.lnTVADeDistribuit * IIF(pret >= 0, 1, -1), 6) ;
		                WHERE proctva <> 0
		            UPDATE crsDetaliiFacturiTemp SET discountfaratva = discountfaratva + ;
		                ROUND(ROUND(ABS(discountfaratva) / m.lnTotalAbsValoare, 6) * m.lnTVADeDistribuit * IIF(discountfaratva >= 0, 1, -1), 6) ;
		                WHERE proctva <> 0 AND ABS(discountfaratva) > 0
		        ENDIF
		        * Daca si lnTVADeDistribuit = 0, nu e nimic de facut, zero ramane zero
		    ELSE
		        * Cazul normal - totalul != 0, logica originala
		        UPDATE crsDetaliiFacturiTemp SET proctva = 0, valoarefaratva = ROUND(ROUND(ValoareFaraTVA / m.lnTotalFaraTVAx, 6) * m.lnTotalCuTVAx, m.gnPA) WHERE proctva <> 0
		        UPDATE crsDetaliiFacturiTemp SET pret = ROUND(ROUND(pret / m.lnTotalFaraTVAx, 6) * m.lnTotalCuTVAx, 6) WHERE proctva <> 0
		        UPDATE crsDetaliiFacturiTemp SET discountfaratva = ROUND(ROUND(discountfaratva / m.lnTotalFaraTVAx, 6) * m.lnTotalCuTVAx, m.gnPA) WHERE proctva <> 0
		    ENDIF
		    
		    lnTotalFaraTVA = m.lnTotalCuTVA
		    lnTotalTVA = 0
		ENDIF
		
		* Discount la nivel de linie factura
		* Pretul unitar este pretul de lista, nediminuat cu discount-ul
		* Recalculez pretul unitar
		SELECT crsDetaliiFacturiTemp
		SCAN
			lnValoareFaraTVA = valoarefaratva
			lnValoareArticol = ROUND(cantitate * pret, m.gnPC)
			lnDiscount =  m.lnValoareArticol - m.lnValoareFaraTVA
			IF m.lnDiscount <> 0
				lnPret = pret - ROUND(m.lnDiscount / cantitate, 4)
				REPLACE pret WITH m.lnPret
			ENDIF  
		ENDSCAN 
		
		* Distribui discount-ul/taxele (transport) globale pe articolele GESTIONABILE
		* Calculez valoarea articolelor pe procente TVA
		* calculez procent discount/taxa pe valoare articole
		* maresc/diminuez pretul articolelor cu procentul de distribuit
		* Adaug articolele tip discount/taxe care trebuie distribuite
		IF m.llDistribuieArticole
			INSERT INTO cDetaliiDiscTaxeTemp (valoare, procentTVA, discount, motivdiscount) ;
				SELECT ABS(valoarefaratva) as valoare, proctva as procentTVA, IIF(SIGN(valoarefaratva) = -1, 1, 0) as discount, IIF(SIGN(valoarefaratva) = -1, 'DISCOUNT', 'TAXE') AS motivdiscount ;
					FROM crsDetaliiFacturiTemp ;
					WHERE distribuie = 1
		
			DELETE FROM crsDetaliiFacturiTemp WHERE distribuie = 1				
		ENDIF 
		
		If Reccount('cDetaliiDiscTaxeTemp') > 0 AND m.llDistribuieDiscountTaxe
			Select proctva, Sum(valoarefaratva) As valoarefaratva ;
				FROM crsDetaliiFacturiTemp ;
				WHERE in_stoc = 1 ;
				GROUP By proctva ;
				INTO Cursor cTotaluriPeTva
		
			SELECT procenttva, SUM(IIF(discount = 1, -1, 1) * valoare) as valoare ;
				FROM cDetaliiDiscTaxeTemp ;
				GROUP BY procenttva ;
				into cursor cDetaliiDiscTaxeTemp2
				
			Select a.proctva, a.valoarefaratva, b.valoare, Round(b.valoare / a.valoarefaratva, 6) As procent ;
				FROM cTotaluriPeTva a Join cDetaliiDiscTaxeTemp2 b On a.proctva = b.procentTVA ;
				INTO Cursor cProcentePeTVA
		
			USE IN (SELECT('cDetaliiDiscTaxeTemp2'))
			Use In (Select('cTotaluriPeTva'))
		
			Select cProcentePeTVA
			Scan
				lnProcTVA = proctva
				lnProcent = (1+procent)
				Update crsDetaliiFacturiTemp  Set Pret = Round(Pret * m.lnProcent, 4), valoarefaratva = Round(valoarefaratva * m.lnProcent, 2) WHERE in_stoc = 1
			Endscan
		
			Use In (Select('cProcentePeTVA'))
		ENDIF && llDistribuieDiscountTaxe
		
		USE IN (SELECT('cDetaliiDiscTaxeTemp'))
		
		
		*************************************
		* GESTIUNE
		*************************************
		lcSql = [select * from vrul_tot where 1=2]
		lcCursor = [cRulTemp]
		
		llSucces = goExecutor.oExecuta(m.lcSql, m.lcCursor)
		If m.llSucces
			Select *, ;
				CAST(0 As N(20,6)) As valoarectva, ;
				CAST(0 As N(20,6)) As valoarevctva ;
				From cRulTemp ;
				Into Cursor trul Readwrite
		
			* iau doar articolele cu id_articol, id_gestiune si gestionabile (in_stoc = 1)
			Select d.id_articol, d.articol_roa As denumire, codmat_roa As codmat, um_roa as um, d.cantitate As cant, d.Pret, Round(d.Pret * d.proctva/100, m.gnPC) As tva, ;
				d.proctva, 1 + Round(d.proctva/100,2) As proc_tva, 1 + Round(d.proctva/100,2) As proc_tvav, d.pretv, d.tvav, d.pretvtva, ;
				d.Cont, d.acont, CAST(Nvl(d.id_gestiune, m.lnIdGestiune0) AS N(5)) As id_gestiune, g.nume_gestiune, g.cgest, ;
				Round(d.valoarefaratva, gnPC) As valoare, ;
				Round(d.valoarefaratva * d.proctva/100, gnPC) As valtva, ;
				Round(d.valoarefaratva, gnPC) + Round(d.valoarefaratva * d.proctva/100, gnPC) As valoarectva, ;
				CAST(0 As N(20,6)) As adaos, ;
				CAST(0 As N(20,6)) As valoarev, ;
				CAST(0 As N(20,6)) As valtvav, ;
				CAST(0 As N(20,6)) As valoarevctva, ;
				CAST(0 As N(20,6)) As valoare_adaos, ;
				CAST(0 As N(20,6)) As valtva_adaos ;
				FROM crsDetaliiFacturiTemp d Left Join cGestiuni g On Nvl(d.id_gestiune, m.lnIdGestiune0) = g.id_gestiune ;
				WHERE !Empty(Nvl(d.id_articol,0)) And !Empty(Nvl(g.id_gestiune,0)) AND Nvl(d.in_stoc,0) = 1 ;
				INTO Cursor cArticoleGest Readwrite
		
			Update cArticoleGest Set valoarevctva = Round(pretvtva* cant, m.gnPC) Where pretv <> 0
			Update cArticoleGest Set valtvav = Round(valoarevctva * proctva/(100 + proctva), m.gnPC) Where pretv <> 0
			Update cArticoleGest Set valoarev = valoarevctva - valtvav Where pretv <> 0
			Update cArticoleGest Set adaos = pretv-Pret, valoare_adaos = valoarev - valoare Where pretv <> 0
			Update cArticoleGest Set valtva_adaos = Round(valoare_adaos * proctva/100, m.gnPC) Where pretv <> 0
		
		
			Update cArticoleGest Set id_articol = 0, denumire = 'NECUNOSCUT' Where Empty(Nvl(id_articol,0))
			* DE COMPLETAT serie, lot
		
			lnIdTipDoc = 1 && NIR
			lnIdGestiune = Null
			Select cArticoleGest
			Locate For !Empty(Nvl(id_gestiune, 0))
			If Found()
				lnIdGestiune = id_gestiune
			Endif
			lnNnir = 0
		
			Select trul
			Append From Dbf('cArticoleGest')
			Replace All nnir With m.lnNnir, serie_act With loFactura.SerieActROA, nract With loFactura.NrActROA, dataact With loFactura.data_act
			Replace All nrord With loFactura.nrord, id_lucrare With loFactura.id_lucrare
			Replace All id_responsabil With loFactura.id_responsabil, nresp With loFactura.nresp
			REPLACE ALL id_sectie WITH loFactura.id_Sectie, sectie WITH loFactura.sectie
			
			
			If m.lnInValuta = 1
				Replace All Curs With m.lnCurs, id_valuta With m.lnIdValuta, nume_val With m.lcCodValuta
			Endif
			Replace All id_tip_rulaj With 0, tip_rulaj With "Intrare", id_set WITH m.lnIdSet
			* serie, lot, daca exista in detalii factura
		
			Use In (Select('cArticoleGest'))
		Endif && llSucces
		
		*************************************
		* CONTABILITATE
		*************************************
		* tip 1 = baza, 2 = TVA, 3 = adaos comercial marfa 371
		Select 1 As tip, Cast(0 As N(5)) As id_note, Max(Upper(articol)) As explicatia, ;
			scd, ascd, scc, ascc, m.lnIdSet As id_set, Cast(0 As I) As ordine, m.lnInValuta As in_valuta, 1 As cu_tva, proctva As ptva, 1 + Round(proctva/100,2) As proc_tva, tiptva, ;
			CAST(0 As I) As id_jtax, Space(50) As denumiretax, ;
			CAST(0 As I) As id_jtva_coloana , Space(50) As explicatie_Tva , ;
			m.lcTipJ As tipjurnal, Cast(Null As I) As taxcode, Cast(Null As C(5)) As paymentcode, ;
			SUM(valoarefaratva) As valoarefaratva, ;
			CAST(0 As N(16,4)) As suma, Cast(0 As N(16,4)) As suma_val, Cast(0 As N(5)) As id_valuta, Cast('' As C(5)) As nume_val, Cast(0 As N(16,4)) As Curs, ;
			id_gestiune As id_gestin, Space(100) As gestin, lnNnir As nnir, discount ;
			from crsDetaliiFacturiTemp ;
			group By proctva, tiptva, scd, ascd, scc, ascc, id_gestiune, discount ;
			UNION ;
			Select 2 As tip, Cast(0 As N(5)) As id_note, Max(Upper(articol)) As explicatia, ;
			scd2 As scd, ascd2 As ascd, scc2 As scc, ascc2 As ascc, m.lnIdSet As id_set, Cast(0 As I) As ordine, m.lnInValuta As in_valuta, 1 As cu_tva, proctva As ptva, 1 + Round(proctva/100,2) As proc_tva, tiptva, ;
			CAST(0 As I) As id_jtax, Space(50) As denumiretax, ;
			CAST(0 As I) As id_jtva_coloana , Space(50) As explicatie_Tva , ;
			m.lcTipJ As tipjurnal, Cast(Null As I) As taxcode, Cast(Null As C(5)) As paymentcode, ;
			SUM(Round(proctva/100 * valoarefaratva, gnPC)) As valoarefaratva, ;
			CAST(0 As N(16,4)) As suma, Cast(0 As N(16,4)) As suma_val, Cast(0 As N(5)) As id_valuta, Cast('' As C(5)) As nume_val, Cast(0 As N(16,4)) As Curs, ;
			id_gestiune As id_gestin, Space(100) As gestin, lnNnir As nnir, discount ;
			from crsDetaliiFacturiTemp ;
			group By proctva, tiptva, scd2, ascd2, scc2, ascc2, id_gestiune, discount ;
			UNION ;
			Select 3 As tip, Cast(0 As N(5)) As id_note, 'VALOARE ADAOS FARA TVA' As explicatia, ;
			cont As scd, acont As ascd, '378 ' As scc, Space(4) As ascc, m.lnIdSet As id_set, Cast(0 As I) As ordine, m.lnInValuta As in_valuta, 0 As cu_tva, proc_tvav As ptva, proc_tvav As proc_tva, '  ' as tiptva, ;
			CAST(0 As I) As id_jtax, Space(50) As denumiretax, ;
			CAST(0 As I) As id_jtva_coloana , Space(50) As explicatie_Tva , ;
			m.lcTipJ As tipjurnal, Cast(Null As I) As taxcode, Cast(Null As C(5)) As paymentcode, ;
			SUM(valoare_adaos) As valoarefaratva, ;
			CAST(0 As N(16,4)) As suma, Cast(0 As N(16,4)) As suma_val, Cast(0 As N(5)) As id_valuta, Cast('' As C(5)) As nume_val, Cast(0 As N(16,4)) As Curs, ;
			id_gestiune As id_gestin, Space(100) As gestin, lnNnir As nnir, 0 As discount ;
			from trul ;
			WHERE Cont = '371' And valoare_adaos <> 0 ;
			group By Cont, acont, proc_tvav, id_gestiune ;
			UNION ;
			Select 4 As tip, Cast(0 As N(5)) As id_note, 'VALOARE TVA ADAOS' As explicatia, ;
			cont As scd, acont As ascd, '4428' As scc, Space(4) As ascc, m.lnIdSet As id_set, Cast(0 As I) As ordine, m.lnInValuta As in_valuta, 0 As cu_tva, proc_tvav As ptva, proc_tvav As proc_tva, '  ' as tiptva, ;
			CAST(0 As I) As id_jtax, Space(50) As denumiretax, ;
			CAST(0 As I) As id_jtva_coloana , Space(50) As explicatie_Tva , ;
			m.lcTipJ As tipjurnal, Cast(Null As I) As taxcode, Cast(Null As C(5)) As paymentcode, ;
			SUM(Round(proc_tvav/100 * valoare_adaos, gnPC)) As valoarefaratva, ;
			CAST(0 As N(16,4)) As suma, Cast(0 As N(16,4)) As suma_val, Cast(0 As N(5)) As id_valuta, Cast('' As C(5)) As nume_val, Cast(0 As N(16,4)) As Curs, ;
			id_gestiune As id_gestin, Space(100) As gestin, lnNnir As nnir, 0 As discount ;
			from trul ;
			WHERE Cont = '371' And valoare_adaos <> 0 ;
			group By Cont, acont, proc_tvav, id_gestiune ;
			ORDER By 1, 11, 4, 6 ;
			INTO Cursor cnote_contabile Readwrite
		* ordonat dupa tip, procent tva, scd, scc
		
		Update cnote_contabile Set gestin = '', id_gestin = 0 Where Isnull(id_gestin) && in act nu se permite null pe id_gestin
		DELETE FROM cnote_contabile WHERE NVL(valoarefaratva, 0) = 0
		
		* Discount global, la nivelul documentului
		If m.lnInValuta = 1
			Update cnote_contabile Set suma_val = valoarefaratva, suma = Round(suma_val * m.lnCurs, m.gnPC), id_valuta = m.lnIdValuta, nume_val = m.lcCodValuta, Curs = m.lnCurs
		Else
			Update cnote_contabile Set suma = valoarefaratva
		Endif
		
		* Articole tip discount 667/767/609/709
		* inversez conturile, partenerii si suma
		Select cnote_contabile
		Scan For discount = 1 And tip  = 1
			Scatter Name loRec
			*!*		DO CASE
			*!*			CASE tip = 1 && baza 4111 = 667 negativ => 667 = 4111 pozitiv. inversez conturile si partenerii si suma (suma este negativa la reducere)
			Replace scd With loRec.scc, ascd With loRec.ascc, scc With loRec.scd, ascc With loRec.ascd
			*			REPLACE id_partd WITH loRec.id_partc, partd WITH loRec.partc, id_partc WITH loRec.id_partd, partc WITH loRec.id_partd
			Replace suma With -loRec.suma, suma_val With -loRec.suma_val
			*!*			CASE tip = 2 && TVA 4111 = 4427, nu fac nimic, semnul este deja negativ
			*
			*!*		ENDCASE
		Endscan
		
		
		* Adaug diferenta dintre totalul facturii si totalul notelor pe prima linie baza si TVA, care nu este discount
		Select Sum(Iif(tip = 1, Iif(discount = 0, suma, -suma), 0.00)) As valoareftva, Sum(Iif(tip = 2, suma, 0.00)) As valoaretva From cnote_contabile Into Cursor cTotaluri
		
		Select cTotaluri
		Scatter Name loTotal
		lnDiferentaBaza = (m.lnTotalFaraTVA - loTotal.valoareftva)
		lnDiferentaTVA = (m.lnTotalTVA - loTotal.valoaretva)
		If lnDiferentaBaza <> 0
			Select cnote_contabile
			Locate For tip = 1 And discount = 0
			If Found()
				Replace suma With suma + m.lnDiferentaBaza
			Else
				Locate For tip = 1 And discount = 0
				If Found()
					Replace suma With suma - m.lnDiferentaBaza
				Endif
			Endif
		Endif
		If m.lnDiferentaTVA <> 0
			Select cnote_contabile
			Locate For tip = 2 And discount = 0
			If Found()
				Replace suma With suma + m.lnDiferentaTVA
			Endif
		Endif
		Use In (Select('cTotaluri'))
		
		* Completez Gestin
		Select * From cGestiuni C Where id_gestiune In (Select Distinct id_gestin From cnote_contabile WHERE !EMPTY(NVL(id_gestin,0))) Into Cursor cGestiuniTemp NOFILTER 
		Select cGestiuniTemp
		Scan
			lnIdGestiune = id_gestiune
			lcGestiune = nume_gestiune
			Update cnote_contabile Set gestin  = m.lcGestiune Where id_gestin = m.lnIdGestiune And Empty(gestin)
		Endscan
		Use In (Select('cGestiuniTemp'))
		
		Update cnote_contabile Set gestin = '', id_gestin = 0 Where Isnull(id_gestin) && in act nu se permite null pe id_gestin
		
		* Completex IdJTVA
		Do update_jtva_coloane With m.lcTipJ, '', 6
		
		Select cnote_contabile
		Scan For Inlist(tip, 1, 2)
			llTaxareInversa = (UPPER(ALLTRIM(NVL(tiptva,''))) = 'AE')
			lnIdJtva = ProcentTva2IdJtva(ptva, m.lcTipJ, m.llTaxareInversa, m.lnTVAIncasare)
			loJtva = GeJtvaColoana(m.lnIdJtva, m.lnTVAIncasare, m.lcTipJ)
			lcDenumireTax = loJtva.denumire
			If cnote_contabile.tip = 2 && TVA
				lnIdJtva = loJtva.id_tva
				loJtva = GeJtvaColoana(m.lnIdJtva, m.lnTVAIncasare, m.lcTipJ)
				lcDenumireTax = loJtva.denumire
			Endif
		
			If m.gl406
				lnTaxCode = GetTaxCodeIdPart(m.gnAn, m.gnluna, m.ldDataAct, m.lnIdJtva, m.lnIdPart, m.llN50, m.llN100, m.llNeexigibil)
			Endif
		
			Select cnote_contabile
			Replace id_jtax With m.lnIdJtva, denumiretax With lcDenumireTax, id_jtva_coloana With m.lnIdJtva, explicatie_Tva With m.lcDenumireTax
			
			If m.gl406
				Replace taxcode With m.lnTaxCode
			ENDIF
		
			IF cnote_contabile.tip = 1
				UPDATE trul SET id_jtva_coloana = m.lnIdJtva WHERE proc_tva*100-100 = cnote_contabile.ptva AND EMPTY(NVL(id_jtva_coloana, 0))
		
				If m.gl406
					UPDATE trul SET taxcode = m.lnTaxCode WHERE proc_tva*100-100 = cnote_contabile.ptva AND EMPTY(NVL(taxcode, 0))
				ENDIF		
			ENDIF 	
		Endscan
		
		
		**************************************************************************************
		* FORMULAR MODIFICARE NOTE
		**************************************************************************************
		If m.llSucces
			lcSql = [select * from vact_tot where 1=2]
			lcCursor = [v_act]
		
			llSucces = goExecutor.oExecuta(m.lcSql, m.lcCursor)
		Endif
		If m.llSucces
			Select .F. As ales, T.*, Cast(0 As N(2)) As tipnota, 1 As cu_tva From v_act T Into Cursor tact Readwrite
			Use In (Select('v_act'))
		Endif
		
		lcSql = [select * from vrul_obinv_tot where 1=2]
		lcCursor = [cRulTemp]
		
		llSucces = goExecutor.oExecuta(m.lcSql, m.lcCursor)
		If m.llSucces
			Select *, ;
				CAST(0 As N(20,6)) As valoarectva, ;
				CAST(0 As N(20,6)) As valoarevctva ;
				From cRulTemp ;
				Into Cursor trul_obinv Readwrite
		ENDIF 		
		USE IN (SELECT('cRulTemp'))
		
		update_jtva_coloane("", "crsJtvaTemp", 1)
					
		If m.llSucces
			Do nrord With "trul"
		
			Private poGeneratorNumere
			poGeneratorNumere = Createobject('oGeneratorNumere')
			IF RECCOUNT('trul') > 0 OR RECCOUNT('trul_obinv') > 0
				poGeneratorNumere.creeaza_cursor_serii(m.lnIdTipDoc)
				lnNnir = poGeneratorNumere.aloca_numar(m.lnIdTipDoc, m.lnIdGestiune)
			ELSE
				lnNnir = 0
			ENDIF 	
		
			Select tact
			Append From Dbf('cnote_contabile')
			Replace All id_set With m.lnIdSet, tva_incasare With loFactura.TVAIncasare, ;
				dataireg With m.ldDataIreg, dataact With loFactura.data_act, datascad With loFactura.Data_Scad, serie_act With loFactura.SerieActROA, nract With loFactura.NrActROA, ;
				id_fdoc With Thisform.nIdFdoc, fdoc With Thisform.cFdoc, id_sectie With loFactura.id_sectie, sectie With loFactura.sectie, ;
				nrord With loFactura.nrord, id_lucrare With loFactura.id_lucrare, contract With loFactura.contract, id_ctr With loFactura.id_ctr,;
				dst_chlt With loFactura.dst_chlt, id_venchelt With loFactura.id_venchelt, nresp With loFactura.nresp, id_responsabil With loFactura.id_responsabil
		
			Update tact Set explicatia = m.lcExplicatia && nu doresc explicatia primul articol pe baza, tva, discount
		
			Update tact Set id_partc = loFactura.IdPartROA, partc = loFactura.PartenerROA Where scc = m.lcCont
			Update tact Set id_partd = loFactura.IdPartROA, partd = loFactura.PartenerROA Where scd = m.lcCont
			UPDATE tact SET id_sucursala = Nvl(m.gnIdSucursala, 0)
		
			UPDATE trul SET id_sucursala = Nvl(m.gnIdSucursala, 0)	
			UPDATE trul_obinv SET id_sucursala = Nvl(m.gnIdSucursala, 0)		
		
			Update tact Set nnir = m.lnNnir
			Update trul Set nnir = m.lnNnir
			Update trul_obinv Set nnir = m.lnNnir	
		
			Select tact
			Go Top
		
			Select trul
			Go Top
			Omodif = Createobject([frm_modific2024], m.lnIdSet)
			*!*		DO FORM frm_modific2024 NAME omodif LINKED WITH m.lnIdSet NOSHOW
			Omodif.Show()
		
			If m.gnButon=1
				If Thisform.do_deschide_tranzactie()
					Replace id_jtva_coloana With Null, proc_tva With 0 For cu_tva = 0 In tact
					Select * From tact Into Cursor actactan Readwrite
					Select * From trul Into Cursor rul_temp Readwrite			
					Select * From trul_obinv Into Cursor rul_temp_obinv Readwrite						
		
					Replace All id_util With gnIdUtil, sters With 0 In actactan
					Replace All id_util With gnIdUtil, sters With 0 In rul_temp
					Replace All id_util With gnIdUtil, sters With 0 In rul_temp_obinv			
		
					lnSucces  = oscrie_in_fisiere(0, .F., m.llRul)
					llSucces = (m.lnSucces > 0)
		 
					IF m.llSucces
						* Salvare anaf_efactura_detalii.id_fact la importul eFactura achizitie
						llSucces = goExecutor.oSelecteaza2Value('SELECT PACK_CONTAFIN.GET_IDFACT() FROM DUAL', @pnIdFact)
						
						IF m.llSucces AND TYPE('pnIdFact') = 'N' AND NVL(m.pnIdFact,0) <> 0
							llSucces = UpdateEFacturaIdFact(m.lnIdEfactura, m.pnIdFact)		
							IF m.llSucces
								UPDATE crsFacturi SET id_fact = m.pnIdFact WHERE id = m.lnIdEfactura
							ENDIF 		
						ENDIF 
					ENDIF 			
					
					Thisform.do_inchide_tranzactie(Iif(m.llSucces,1, 2))
		
				ENDIF 
		
				IF m.llSucces
					Thisform.ListareNIR(m.pnIdFact)
				ENDIF 
				
			Else
				poGeneratorNumere.dezaloca_numar(m.lnIdTipDoc)
			ENDIF && gnButon=1
		Endif
		
		
		Release poGeneratorNumere
		
		Use In (Select('crsDetaliiFacturiTemp'))
		Use In (Select('tAct'))
		Use In (Select('actactan'))
		Use In (Select('trul'))
		Use In (Select('rul_temp'))
		Use In (Select('trul_obinv'))
		Use In (Select('rul_temp_obinv'))
		USE IN (SELECT('crsJtvaTemp'))
		
	ENDPROC

	PROCEDURE Init
		Lparameters tlPrimite
		
		Local lcFdoc, lcSql, llSucces, lnIdFdoc
		
		This.lPrimite = m.tlPrimite
		
		* Fel document
		lnIdFdoc = null
		lcFdoc = ''
		lcSql = [SELECT ID_FDOC FROM NOM_FDOC WHERE STERS = 0 AND INACTIV = 0 AND FEL_DOCUMENT = 'FACTURA']
		llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @lnIdFdoc)
		If m.llSucces
			lcFdoc = 'FACTURA'
		ELSE
			AMESSAGEBOX('Creati Fel document: FACTURA in Definirea Companiei!',0+48,_screen.Caption)
			Return
		ENDIF
		
		ADDPROPERTY(this, 'nIdFdoc', m.lnIdFdoc)
		ADDPROPERTY(this, 'cFdoc', m.lcFdoc)
		
		* Colorez cu gri facturile care nu sunt in Registrul TVA si cu turcuaz diferentele de valoare peste 0.15 lei
		this.grdFacturi.SetAll("DynamicBackColor","IIF(ISNULL(jtotctva), RGB(225,225,225), IIF(ISNULL(diferenta) OR ABS(NVL(diferenta,0)) > 0.15, RGB(100,255,255), RGB(255,255,255)))", "Column") 
		
		* Colorez cu rosu Credit Note
		this.grdFacturi.SetAll("DynamicForeColor","IIF(creditnote = 1, RGB(225,0,0), RGB(0,0,0))", "Column")
		this.gridextra1.setup()
		this.gridextra2.setup()
		
		* Caption de baza pentru bifele Diferente/Lipsa, refolosit de NumaraDiferenteImport
		This.chkDiferente.Tag = This.chkDiferente.Caption
		This.chkLipsaRegistru.Tag = This.chkLipsaRegistru.Caption
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		Local lcActiveControlName
		
		lcActiveControlName = ''
		IF TYPE('this.ActiveControl.name') = 'C'
			lcActiveControlName = UPPER(this.ActiveControl.name)
		ENDIF 	
		
		IF nKeyCode = 13 AND nShiftAltCtrl = 0 AND m.lcActiveControlName = 'GRDFACTURI' && ENTER
			TRY 
				this.txtSerieAct.SetFocus()
			CATCH 
			ENDTRY 	
			NODEFAULT
		ELSE 
			DODEFAULT(nKeyCode, nShiftAltCtrl)	
		ENDIF 		 
	ENDPROC

	PROCEDURE listarenir
		LPARAMETERS tnIdFact
		
		
		Local llSucces, lnTip
		PRIVATE pnIdFact, pnNnir
		
		IF !EMPTY(NVL(m.tnIdFact,0))
			pnIdFact = m.tnIdFact
		ELSE
			pnIdFact = NVL(crsFacturi.id_fact, 0)
		ENDIF 
		
		lnTip = IIF(!EMPTY(NVL(crsdetaliifacturi.pretvtva,0)), 7, 1)
		IF !EMPTY(m.pnIdFact)
			pnNnir = 0
			llSucces = goExecutor.oSelecteaza2Value([SELECT MIN(nnir) as nnir FROM rul WHERE id_fact = ?pnIdfact], @pnNnir)
			IF m.llSucces AND !EMPTY(NVL(m.pnNnir,0))
				DO listare_nir_tot WITH m.pnNnir, m.pnNnir, m.lnTip
			ELSE
				AMESSAGEBOX('Nu s-a gasit numarul de NIR pentru Id Fact ' + TRANSFORM(m.pnIdFact),0+48,_Screen.Caption)	
			ENDIF 
		ELSE
			AMESSAGEBOX('Factura nu are Id Fact. Nu se poate lista NIR-ul.',0+48,_Screen.Caption)	
		ENDIF 	
		    
	ENDPROC

	PROCEDURE modificanote
		Local loForm As [frm_modific2007]
		Local llMaximize, llNotaNoua, lnIdSet, llSucces, lcSelect
		Local lcSql, lnSucces, lnTaxCode
		Local ldDataAct, llFurnizorTVAI, lnIdJtva
		*:Global gcAcces
		Private pnCod
		
		llSucces = .T.
		lnIdSet = 90023
		lcSelect = Select()
		
		* cursor cActTemp (denumire, iban, nr, data, suma, explicatie, scd, scc, id_partd, id_partc, partd, partc, id_fdoc, fdoc)
		update_jtva_coloane("JV", 'crsExplicatiiTVATemp', 1)
		
		lcSql = [SELECT * FROM vact WHERE 1=2]
		llSucces = goExecutor.oExecuta(m.lcSql, 'actactan_temp')
		If m.llSucces
			Select actactan_temp
			IF USED('actactan')
				Append From Dbf('actactan')
			ENDIF 	
		
			Select .F. As ales, a.explicatia4 As iban, Iif(!Empty(Nvl(a.id_jtva_coloana, 0)), 1, 0) As Cu_tva, Cast(0 As N(2)) As tipnota, a.*, b.denumire As explicatie_tva_2 ;
				From actactan_temp a Left Join crsExplicatiiTVATemp b On a.id_jtva_coloana = b.id_jtva_coloana ;
				Into Cursor tact Readwrite
		
			Update tact Set explicatie_tva = explicatie_tva_2, explicatia4 = '', id_Set = m.lnIdSet
			UPDATE tAct SET nract = INT(VAL(DTOS(dataact) + ALLTRIM(STR(RECNO())))) WHERE EMPTY(NVL(nract,0))
		
		
			* Completare nract pentru notele retragere de numerar 5311 = 581 adaugate suplimentar, la fel ca in notele 581 = 5121
			SELECT nract FROM tAct WHERE nract < 0 INTO CURSOR cNrActNegativ 
			SELECT cNrActNegativ
			SCAN
				lnNractNegativ = nract
				lnRec = -1*m.lnNractNegativ
				SELECT tAct
				LOCATE FOR RECNO() = m.lnRec
				IF FOUND()
					lnNract = nract
					LOCATE FOR nract = m.lnNrActNegativ
					IF FOUND()
						REPLACE nract WITH m.lnNract
					ENDIF 
				ENDIF 
			ENDSCAN 
			USE IN (SELECT('cNrActNegativ'))
		
			* Actualizez taxcode SAFT in functie de furnizori RTVAI
			IF m.gl406
				SELECT tact 
				SCAN FOR !EMPTY(id_jtva_coloana)
					lnIdJtva = id_jtva_coloana
					ldDataAct = dataact
					llFurnizorTVAI = .F.
					lnTaxCode = GetTaxCode(m.gnAn, m.gnLuna, m.ldDataAct, m.lnIdJtva, m.llFurnizorTVAI)
					SELECT tact 
					REPLACE taxcode WITH m.lnTaxCode 
				ENDSCAN 
		
				UPDATE tact SET paymentcode = '42' WHERE LEFT(scd,3) = '512' OR LEFT(scc,3) = '512' && plata in contul bancar
			ENDIF 
		Endif && llSucces
		
		If m.llSucces
			gcAcces = "1;2;3;4;"   
			Select tact
			Go Top
			llNotaNoua = .T.
			llMaximize = .T.
			loForm = Createobject([frm_modific2007], m.lnIdSet, m.llNotaNoua)
			loForm.lb_titlu_alb_b121.Caption = 'Import extrase bancare, deconturi curieri, procesatori plati'
			Select tact
			loForm.Show(1, m.llMaximize)
		
			If buton = 1
				Use In (Select('actactan'))
		
				Update tact Set id_jtva_coloana = Null, PROC_TVA = 0 Where Cu_tva = 0
		
				lnSucces = SQLSetprop(m.gnhandle, "Transactions", 2)
				llSucces = (m.lnSucces > 0)
				If m.llSucces
					* Generez coduri distinct pentru fiecare document.
					* La vizualizare note este de preferat sa nu vad incasari si plati in acelasi document!!??
					
					lcSql = [SELECT seq_cod.nextval FROM dual]
					Select distinct dataact, nract From tact Into Cursor cCodTemp
					Select cCodTemp
					Scan
						Wait Window 'Salvare nota ' + Transform(Recno()) + '/' + Transform(Reccount()) Nowait
						pnCod = 0
						llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @pnCod)
						If m.llSucces
							Update tact Set cod = m.pnCod Where EMPTY(NVL(cod,0)) AND NVL(nract,0) = NVL(cCodTemp.nract,0) AND NVL(dataact, DATE()) = NVL(cCodTemp.dataact, DATE())
		
							Select * From tact Where cod = m.pnCod Into Cursor actactan Readwrite
		
							Select actactan
							lnSucces  = OSCRIE_IN_FISIERE(0, .F., .F., .T.)
							llSucces = (m.lnSucces > 0)
							Use In (Select('actactan'))
							If !m.llSucces
								Exit
							Endif
						Else
							Exit
						Endif
					Endscan && cCodTemp
					Use In (Select('cCodTemp'))
				Endif && llSucces
		
		
				If !m.llSucces
					lcSql = "ROLLBACK"
				Else
					lcSql = "COMMIT"
				Endif
				lnSucces = goExecutor.oExecute(m.lcSql)
				llSucces = (m.lnSucces > 0)
				If !m.llSucces
					AMESSAGEBOX(lcSql + Chr(13) + goExecutor.cEroare, 0 + 16, "Eroare")
				Endif
		
				lnSucces = SQLSetprop(gnhandle, "Transactions", 1)
				llSucces = (m.lnSucces > 0)
				If !m.llSucces
					AMESSAGEBOX('Programul nu a reusit sa treaca pe tranzactie automata. Iesiti din program si intrati din nou!', 0 + 48, 'Atentie!')
				Endif
			Else
				llSucces = .F.
			Endif && buton = 1
		Endif && llSucces
		
		Use In (Select('crsExplicatiiTVATemp'))
		Select (m.lcSelect)
		Return m.llSucces
		 
	ENDPROC

	PROCEDURE NumaraDiferenteImport
		LPARAMETERS tcFiltruBaza, tcDif, tcLipsa
		LOCAL lcView, lcSql, llSucces, lnDif, lnLipsa, lnSelect, lnRec
		lnDif = 0
		lnLipsa = 0
		
		*!* fara nicio bifa, cursorul afisat e chiar setul de baza: numaram local, fara interogare
		IF EMPTY(This.chkDiferente.Value) AND EMPTY(This.chkLipsaRegistru.Value) AND USED('crsFacturi')
			lnSelect = SELECT()
			lnRec = RECNO('crsFacturi')
			SELECT SUM(IIF(!ISNULL(jtotctva) AND (ALLTRIM(NVL(nume_valuta,'RON')) <> 'RON' OR ABS(NVL(diferenta,0)) > 0.15), 1, 0)) as ndif, ;
					SUM(IIF(ISNULL(jtotctva), 1, 0)) as nlipsa ;
				FROM crsFacturi INTO CURSOR crsNumarBifeLocal NOFILTER
			lnDif = NVL(crsNumarBifeLocal.ndif,0)
			lnLipsa = NVL(crsNumarBifeLocal.nlipsa,0)
			USE IN (SELECT('crsNumarBifeLocal'))
			This.chkDiferente.Caption = ALLTRIM(IIF(EMPTY(NVL(This.chkDiferente.Tag,'')), This.chkDiferente.Caption, This.chkDiferente.Tag)) + IIF(m.lnDif > 0, ' (' + ALLTRIM(STR(m.lnDif)) + ')', '')
			This.chkLipsaRegistru.Caption = ALLTRIM(IIF(EMPTY(NVL(This.chkLipsaRegistru.Tag,'')), This.chkLipsaRegistru.Caption, This.chkLipsaRegistru.Tag)) + IIF(m.lnLipsa > 0, ' (' + ALLTRIM(STR(m.lnLipsa)) + ')', '')
			SELECT crsFacturi
			IF m.lnRec > 0 AND m.lnRec <= RECCOUNT()
				GO m.lnRec
			ENDIF
			SELECT (m.lnSelect)
			RETURN
		ENDIF
		
		lcView = IIF(This.lPrimite, 'anaf_vefactura_primit', 'anaf_vefactura_trimis')
		
		* Numarul se reseteaza pe 0 (caption fara paranteza) cand filtrul e gol sau interogarea esueaza
		IF !EMPTY(NVL(m.tcFiltruBaza,'')) AND !EMPTY(NVL(m.tcDif,''))
			lcSql = "select count(case when " + m.tcDif + " then 1 end) as ndif" + ;
				", count(case when " + m.tcLipsa + " then 1 end) as nlipsa" + ;
				" from " + m.lcView + " where 1=1 " + m.tcFiltruBaza
			
			llSucces = goExecutor.oExecuta(m.lcSql, 'crsNumarDiferenteImport')
			IF m.llSucces
				lnDif = NVL(crsNumarDiferenteImport.ndif,0)
				lnLipsa = NVL(crsNumarDiferenteImport.nlipsa,0)
			ENDIF 
		ENDIF 
		
		This.chkDiferente.Caption = ALLTRIM(IIF(EMPTY(NVL(This.chkDiferente.Tag,'')), This.chkDiferente.Caption, This.chkDiferente.Tag)) + IIF(m.lnDif > 0, ' (' + ALLTRIM(STR(m.lnDif)) + ')', '')
		This.chkLipsaRegistru.Caption = ALLTRIM(IIF(EMPTY(NVL(This.chkLipsaRegistru.Tag,'')), This.chkLipsaRegistru.Caption, This.chkLipsaRegistru.Tag)) + IIF(m.lnLipsa > 0, ' (' + ALLTRIM(STR(m.lnLipsa)) + ')', '')
	ENDPROC

	PROCEDURE scrienote
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		
		this.WindowState = 2 
		this.grdFacturi.HeaderHeight = 35
		
		SELECT crsFacturi
		GO TOP 
		Thisform.CompleteazaFactura() && cap factura
		Thisform.actualizeaza_grid2()
		Thisform.CompleteazaDetaliiFactura() && detalii factura
		*!* numerele de pe bife apar de la deschidere, numarate local din cursorul deja adus
		This.NumaraDiferenteImport()
		
		
	ENDPROC

	PROCEDURE but_cont.Click
		Local lcCont
		
		lcCont = ALLTRIM(NVL(crsDetaliiFacturi.cont,''))
		IF !EMPTY(m.lcCont)
			UPDATE crsDetaliiFacturi SET cont = m.lcCont WHERE EMPTY(NVL(cont,''))
		ENDIF 	 
		
		thisform.grdDetaliiFacturi.Refresh()
	ENDPROC

	PROCEDURE but_gestiune.Click
		Local lnIdGestiune
		
		lnIdGestiune = NVL(crsDetaliiFacturi.id_gestiune, 0)
		IF !EMPTY(m.lnIdGestiune)
			UPDATE crsDetaliiFacturi SET id_gestiune = m.lnIdGestiune WHERE EMPTY(NVL(id_gestiune, 0))
		ENDIF 	 
		
		thisform.grdDetaliiFacturi.Refresh()
	ENDPROC

	PROCEDURE But_nou1.Click
		* Adaug partener ROA nou
		Local loDate As "empty"
		Local lcPartener, lnIdPartener, loDate2, loFactura, lcCodFiscal
		Local llCNP, lnTipPersoana
		
		
		SELECT crsFacturi
		SCATTER NAME loFactura
		If Empty(Nvl(loFactura.Id,0))
			Return
		Endif
		SET STEP ON 
		llCNP = ValidCNP(loFactura.cod_fiscal)
		
		lnTipPersoana = IIF(m.llCNP, 2, 1) && 1 && 1 = juridica, 2 = fizica
		loDate = CREATEOBJECT("empty")
		ADDPROPERTY(loDate, "denumire", ALLTRIM(loFactura.partener))
		ADDPROPERTY(loDate, "cod_fiscal", ALLTRIM(loFactura.cod_fiscal))
		ADDPROPERTY(loDate, "id_tip_part", IIF(thisform.lPrimite,17,16))
		ADDPROPERTY(loDate, "lSilentios", .F.)
		loDate2 = nom_parteneri_nou(, , , m.lnTipPersoana, , m.loDate)
		* Extrag adresa 
		*!*	lcDetalii = loFactura.detalii
		*!*	loFactParse = ParseEfactura(m.lcDetalii, .T.)
		
		IF TYPE('loDate2') = 'O' AND TYPE('loDate2.id_part') = 'N'
			lnIdPartener = Nvl(loDate2.id_part, 0)
			lcPartener = Alltrim(Nvl(loDate2.denumire, ''))
			lcCodFiscal = ALLTRIM(NVL(loDate2.cod_fiscal, ''))
			IF !EMPTY(m.lnIdPartener)
				SELECT crsFacturi
				REPLACE PartenerROA WITH lcPartener, IdPartROA WITH lnIdPartener, CodFiscalROA WITH m.lcCodFiscal
			ENDIF 	
		ENDIF 
		
		thisform.txtPartener.Refresh()  
		thisform.txtCodFiscal.Refresh() 
		
		TEXT TO lcText
		banca, cont_banca, motiv_inactiv, inactiv, eliberatde, dataeliberat, email, web, fax, id_adresa, adresa, telefon, telefon2, id_loc, localitate, ] + ;
				[judet, id_judet, sector, apart, etaj, scara, bloc, strada, numar, codpostal, id_tara, tara, categorie_entitate, dataora, utilizator, swift_banca, adresa_banca, institutie_publica
		ENDTEXT 
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		
		lcStringCriterii= "Nr. factura\numar_act\N\none\" + crlf + ;
			"Data factura\TRUNC(data_act)\D\none\" + crlf + ;	
			"Partener\partener\T\id_part\nom_parteneri" + crlf + ;	
			"Cod fiscal\cod_fiscal\T\none\" + crlf + ;		
			"Trimis\nofiled\E\(trimis = 1)\"  + crlf + ;
			"Data trimis\TRUNC(data_trimis)\D\none\"  + crlf + ; 
			"Data raspuns\TRUNC(data_raspuns)\D\none\"	
		DODEFAULT()
	ENDPROC

	PROCEDURE but_tip.Click
		Local lnIdTip, lcCont
		
		lnIdTip = crsDetaliiFacturi.id_tip
		lcCont = ALLTRIM(NVL(crsDetaliiFacturi.cont,''))
		
		UPDATE crsDetaliiFacturi SET id_tip = m.lnIdTip, cont = m.lcCont WHERE EMPTY(NVL(id_tip,0))
		
		thisform.grdDetaliiFacturi.Refresh()
	ENDPROC

	PROCEDURE chkDiferente.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE chkLipsaRegistru.Valid
		Thisform.do_cauta()
	ENDPROC

	PROCEDURE Cmd_executa2.Click
		lcSql = "select cont, explicatie, tip_sold from vplcont_used where an=?gnAn and tip_cont = 0 order by cont"
		llSucces = goExecutor.oExecuta(m.lcSql, "crsPlCont")
		
		Select Cont, explicatie, tip_sold From crsPlCont Into Cursor cPlContP Order By Cont
		Select Cont, explicatie, tip_sold From crsPlCont Into Cursor cPlContE Order By Cont
		
		lcSql = "select id_gestiune, nume_gestiune, cont, acont, cgest, nume_tip from vnom_gestiuni where inactiv = 0 order by nume_gestiune"
		llSucces = goExecutor.oExecuta(m.lcSql, "crsGestiuni")
		SELECT crsGestiuni
		APPEND BLANK  
		Select id_gestiune, nume_gestiune, Cont From crsGestiuni Order By nume_gestiune Into Cursor cGestiuniP NOFILTER 
		Select id_gestiune, nume_gestiune, Cont From crsGestiuni Order By nume_gestiune Into Cursor cGestiuniE NOFILTER 
		
		
		lcSql = "select id_sectie, sectie from vnom_sectii where inactiv = 0 order by sectie"
		llSucces = goExecutor.oExecuta(m.lcSql, "crsSectii")
		SELECT crsSectii
		APPEND BLANK  
		Select id_sectie, sectie From crsSectii Into Cursor cSectiiP Order By sectie
		Select id_sectie, sectie From crsSectii Into Cursor cSectiiE Order By sectie
		
		
		lcSql = "select id_venchelt, explicatie as venchelt, decode(tip_venchelt, 1, 'VENIT', 'CHELTUIALA') as tip from vnom_venchel where inactiv = 0 order by explicatie"
		llSucces = goExecutor.oExecuta(m.lcSql, "crsVenChel")
		SELECT crsVenChel
		APPEND BLANK 
		Select id_venchelt, venchelt, tip From crsVenChel Into Cursor cVenChelP Order By venchelt
		Select id_venchelt, venchelt, tip From crsVenChel Into Cursor cVenChelE Order By venchelt
		
		gcEFACTURA_CONT_ART_E = ALLTRIM(gcEFACTURA_CONT_ART_E)
		gcEFACTURA_CONT_ART_P = ALLTRIM(gcEFACTURA_CONT_ART_P)
		gnEFACTURA_ID_SECTIE_E = INT(gnEFACTURA_ID_SECTIE_E)
		gnEFACTURA_ID_SECTIE_P = INT(gnEFACTURA_ID_SECTIE_P)
		gnEFACTURA_ID_GESTIUNE_E = INT(gnEFACTURA_ID_GESTIUNE_E)
		gnEFACTURA_ID_GESTIUNE_P = INT(gnEFACTURA_ID_GESTIUNE_P)
		gnEFACTURA_ID_VENCHELT_E = INT(gnEFACTURA_ID_VENCHELT_E)
		gnEFACTURA_ID_VENCHELT_P = INT(gnEFACTURA_ID_VENCHELT_P)
		gnEFACTURA_ID_TIPART_E = INT(gnEFACTURA_ID_TIPART_E)
		gnEFACTURA_ID_TIPART_P = INT(gnEFACTURA_ID_TIPART_P)
		
		gnEFACTURA_CONT_ART_EF = INT(m.gnEFACTURA_CONT_ART_EF)
		gnEFACTURA_CONT_ART_PF = INT(m.gnEFACTURA_CONT_ART_PF)
		gnEFACTURA_GEST_ART_EF = INT(m.gnEFACTURA_GEST_ART_EF)
		gnEFACTURA_GEST_ART_PF = INT(m.gnEFACTURA_GEST_ART_PF)
		
		loConf = Createobject("frm_configurare_efactura")
		loConf.Show(1)
		
		
		If gnButon = 1
			scrie_optiune('EFACTURA_CONT_ART_E', ALLTRIM(m.gcEFACTURA_CONT_ART_E), 'CONT ARTICOLE IMPLICIT FACTURI EMISE')
			scrie_optiune('EFACTURA_CONT_ART_P', ALLTRIM(m.gcEFACTURA_CONT_ART_P), 'CONT ARTICOLE IMPLICIT FACTURI PRIMITE')
			scrie_optiune('EFACTURA_ID_SECTIE_E', ALLTRIM(STR(INT(m.gnEFACTURA_ID_SECTIE_E))), 'ID SECTIE IMPLICIT FACTURI EMISE')
			scrie_optiune('EFACTURA_ID_SECTIE_P', ALLTRIM(STR(INT(m.gnEFACTURA_ID_SECTIE_P))), 'ID SECTIE IMPLICIT FACTURI PRIMITE')
			scrie_optiune('EFACTURA_ID_GESTIUNE_E', ALLTRIM(STR(INT(m.gnEFACTURA_ID_GESTIUNE_E))), 'ID GESTIUNE IMPLICIT FACTURI EMISE')
			scrie_optiune('EFACTURA_ID_GESTIUNE_P', ALLTRIM(STR(INT(m.gnEFACTURA_ID_GESTIUNE_P))), 'ID GESTIUNE IMPLICIT FACTURI PRIMITE')
			scrie_optiune('EFACTURA_ID_VENCHELT_E', ALLTRIM(STR(INT(m.gnEFACTURA_ID_VENCHELT_E))), 'ID VENIT/CHELT IMPLICIT FACTURI EMISE')
			scrie_optiune('EFACTURA_ID_VENCHELT_P', ALLTRIM(STR(INT(m.gnEFACTURA_ID_VENCHELT_P))), 'ID VENIT/CHELT IMPLICIT FACTURI PRIMITE')
			scrie_optiune('EFACTURA_ID_TIPART_E', ALLTRIM(STR(INT(m.gnEFACTURA_ID_TIPART_E))), 'ID TIP ARTICOL IMPLICIT FACTURI EMISE')
			scrie_optiune('EFACTURA_ID_TIPART_P', ALLTRIM(STR(INT(m.gnEFACTURA_ID_TIPART_P))), 'ID TIP ARTICOL IMPLICIT FACTURI PRIMITE')
			
			scrie_optiune('EFACTURA_CONT_ART_EF', ALLTRIM(STR(m.gnEFACTURA_CONT_ART_EF)), 'PRELUARE CONT ARTICOL DIN FACTURILE EMISE ANTERIOARE')	
			scrie_optiune('EFACTURA_CONT_ART_PF', ALLTRIM(STR(m.gnEFACTURA_CONT_ART_PF)), 'PRELUARE CONT ARTICOL DIN FACTURILE PRIMITE ANTERIOARE')	
			scrie_optiune('EFACTURA_GEST_ART_EF', ALLTRIM(STR(m.gnEFACTURA_GEST_ART_EF)), 'PRELUARE GESTIUNE ARTICOL DIN FACTURILE EMISE ANTERIOARE')	
			scrie_optiune('EFACTURA_GEST_ART_PF', ALLTRIM(STR(m.gnEFACTURA_GEST_ART_PF)), 'PRELUARE GESTIUNE ARTICOL DIN FACTURILE PRIMITE ANTERIOARE')			
		Endif
		
		Use In (Select('crsPlCont'))
		Use In (Select('cPlContP'))
		Use In (Select('cPlContE'))
		Use In (Select('crsGestiuni'))
		Use In (Select('cGestiuniP'))
		Use In (Select('cGestiuniE'))
		Use In (Select('crsSectii'))
		Use In (Select('cSectiiP'))
		Use In (Select('cSectiiE'))
		Use In (Select('crsVenchel'))
		Use In (Select('cVenChelP'))
		Use In (Select('cVenChelE'))
		
	ENDPROC

	PROCEDURE Cmd_executa3.Click
		Local lcCont
		
		lcCont = ALLTRIM(NVL(crsDetaliiFacturi.cont,''))
		lcAcont = ALLTRIM(NVL(crsDetaliiFacturi.acont,''))
		IF !EMPTY(m.lcAcont)
			UPDATE crsDetaliiFacturi SET acont = m.lcAcont WHERE cont = m.lcCont AND EMPTY(NVL(acont,''))
		ENDIF 	 
		
		thisform.grdDetaliiFacturi.Refresh()
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cAcont.Text1.Click
		This.LostFocus(.T.)
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cAcont.Text1.LostFocus
		LPARAMETERS PlClick
		Local lcAcont, lcCont, llReturn
		
		SELECT crsDetaliiFacturi
		lcCont = cont
		lcAcont = acont
		IF EMPTY(m.lcCont)
			RETURN
		ENDIF 
		llReturn = verific_analitic(m.plClick, m.lcCont, m.lcAcont,'acont','crsDetaliiFacturi') && in oOperatii_comune.prg 
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cArticolROA.Text1.DblClick
		_cliptext = ALLTRIM(NVL(crsdetaliifacturi.articol,''))
		loArticol = caut_articol() && ocautare.prg
		REPLACE id_articol WITH loArticol.id_articol, articol_roa WITH loArticol.denumire, um_roa WITH loArticol.um, codmat_roa WITH loArticol.codmat, in_stoc WITH loArticol.in_stoc IN crsDetaliiFacturi
		
		
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cArticolROA.Text1.InteractiveChange
		_cliptext = ALLTRIM(NVL(crsdetaliifacturi.articol,''))
		loArticol = caut_articol() && ocautare.prg
		REPLACE id_articol WITH loArticol.id_articol, articol_roa WITH loArticol.denumire, um_roa WITH loArticol.um, codmat_roa WITH loArticol.codmat, in_stoc WITH loArticol.in_stoc IN crsDetaliiFacturi
		
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cArticolROA.Text1.RightClick
		Local lnOptiune, lnIdArticol, loDate
		Local lcArticol, lcCodUMISO, llSucces, loArticol
		
		lnIdArticol = 0
		
		lnOptiune = xmenu("\<Adauga articol;\<Cauta articol")
		IF EMPTY(m.lnOptiune)
			RETURN
		ENDIF  
		
		IF m.lnOptiune = 1
			lcArticol = ALLTRIM(NVL(crsdetaliifacturi.articol,''))
			lcCodUMISO = ALLTRIM(NVL(crsdetaliifacturi.um,''))
			lcCont = ALLTRIM(NVL(crsdetaliifacturi.cont,''))
			lcAcont = ALLTRIM(NVL(crsdetaliifacturi.acont,''))	
			lcCodBare = ALLTRIM(NVL(crsdetaliifacturi.codbare,''))			
			lcCodCPV = ALLTRIM(NVL(crsdetaliifacturi.codcpv,''))
			lcCodNC8 = ALLTRIM(NVL(crsdetaliifacturi.codnc8,''))
			
			IF Thisform.lPrimite
				lnIdClient = 0
				lcClient = ''
				lcCodClient = ''	
				lnIdFurnizor = NVL(crsFacturi.IdPartROA, 0)
				lcFurnizor = ALLTRIM(NVL(crsFacturi.PartenerROA, ''))
				lcCodFurnizor = ALLTRIM(NVL(crsdetaliifacturi.codfurnizor,''))
			ELSE 
				lnIdClient = NVL(crsFacturi.IdPartROA, 0)
				lcClient = ALLTRIM(NVL(crsFacturi.PartenerROA, ''))
				lcCodClient = ALLTRIM(NVL(crsdetaliifacturi.codclient,''))
				lnIdFurnizor = 0
				lcFurnizor = ''
				lcCodFurnizor = ''		
			ENDIF 
			
				
			loDate = CREATEOBJECT("empty")
			ADDPROPERTY(loDate, "denumire", m.lcArticol)
			ADDPROPERTY(loDate, "cod_um_iso", m.lcCodUMISO)
			ADDPROPERTY(loDate, "cont", m.lcCont)
			ADDPROPERTY(loDate, "acont", m.lcAcont)	
			ADDPROPERTY(loDate, "cod_um_iso", m.lcCodUMISO)
			ADDPROPERTY(loDate, "codbare", m.lcCodBare)
			ADDPROPERTY(loDate, "codcpv", m.lcCodCPV)
			ADDPROPERTY(loDate, "codnc8", m.lcCodNC8)			
			
			IF !EMPTY(m.lcCodClient)
				ADDPROPERTY(loDate, "id_client", m.lnIdClient)	
				ADDPROPERTY(loDate, "client", m.lcClient)		
				ADDPROPERTY(loDate, "cod_client", m.lcCodClient)	
			ENDIF 	
		
			IF !EMPTY(m.lcCodFurnizor)
				ADDPROPERTY(loDate, "id_furnizor", m.lnIdFurnizor)	
				ADDPROPERTY(loDate, "furnizor", m.lcFurnizor)		
				ADDPROPERTY(loDate, "cod_furnizor", m.lcCodFurnizor)	
			ENDIF 	
		
			llSucces = nom_articole_nou(@lnIdArticol, loDate)
			IF m.llSucces AND !EMPTY(m.lnIdArticol)
				loArticol = GetArticolById(m.lnIdArticol)
				IF !ISNULL(loArticol)
					REPLACE id_articol WITH loArticol.id_articol, articol_roa WITH loArticol.denumire, um_roa WITH loArticol.um, codmat_roa WITH loArticol.codmat, in_stoc WITH loArticol.in_stoc IN crsDetaliiFacturi		
				ENDIF 
			ENDIF 
		ELSE
			_cliptext = ALLTRIM(NVL(crsdetaliifacturi.articol,''))
			loArticol = caut_articol() && ocautare.prg
			REPLACE id_articol WITH loArticol.id_articol, articol_roa WITH loArticol.denumire, um_roa WITH loArticol.um, codmat_roa WITH loArticol.codmat, in_stoc WITH loArticol.in_stoc IN crsDetaliiFacturi
		ENDIF  
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cCont.Text1.LostFocus
		Local lnSucces
		Local lcCont
		
		lcCont = ALLTRIM(NVL(crsDetaliiFacturi.cont, ''))
		lnSucces = verific_cont(m.lcCont) 
		IF m.lnSucces < 0
			RETURN .F.
		ENDIF  
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cPretvTVA.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		
		TRY 
			IF m.nkeyCode = 13
				NODEFAULT 
				SKIP 1 IN crsDetaliiFacturi 
			ENDIF 	
		CATCH
			NODEFAULT 
			GO BOTTOM in crsDetaliiFacturi
		ENDTRY 
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cPretvTVA.Text1.Valid
		SELECT crsdetaliifacturi
		lnPretvTva = pretvtva
		lnProcTva = proctva
		lnTvav = ROUND(m.lnPretvTva * m.lnProcTva / (100 + m.lnProcTva), m.gnPPRETV)
		lnPretv = m.lnPretvTva - m.lnTvav
		REPLACE pretv WITH m.lnPretv, tvav WITH m.lnTvav 
		
	ENDPROC

	PROCEDURE grdDetaliiFacturi.cTip._combobox1.InteractiveChange
		IF !EMPTY(NVL(cTipTemp.cont, ''))
			REPLACE cont WITH cTipTemp.cont, in_stoc WITH cTipTemp.in_stoc IN crsDetaliiFacturi
			this.Parent.Parent.cCont.Text1.Refresh()
		ENDIF 	
	ENDPROC

	PROCEDURE grdFacturi.AfterRowColChange
		LPARAMETERS nColIndex
		
		If Inlist(This.RowColChange, 1, 3)
			Thisform.CompleteazaFactura() && cap factura
			Thisform.actualizeaza_grid2()
			Thisform.CompleteazaDetaliiFactura() && detalii factura
		Endif
		
	ENDPROC

	PROCEDURE Lb_titlu_alb_b121.RightClick
		This.Parent.chkTest.Visible = .T.
	ENDPROC

	PROCEDURE txtAcont.Click
		This.LostFocus(.T.)
	ENDPROC

	PROCEDURE txtAcont.LostFocus
		LPARAMETERS PlClick
		Local lcAcont, lcCont, llReturn
		
		lcCont = crsFacturi.cont
		lcAcont = crsFacturi.acont
		IF EMPTY(m.lcCont)
			RETURN
		ENDIF 
		llReturn = verific_analitic(m.plClick, m.lcCont, m.lcAcont,'acont','crsFacturi') && in oOperatii_comune.prg 
		This.Refresh()
		RETURN m.llReturn 
		
	ENDPROC

	PROCEDURE txtCodFiscal.DblClick
		Thisform.cauta_partener()
		
	ENDPROC

	PROCEDURE txtCont.LostFocus
		Local lnSucces
		Local lcCont
		
		lcCont = ALLTRIM(NVL(crsFacturi.cont, ''))
		lnSucces = verific_cont(m.lcCont) 
		IF m.lnSucces < 0
			RETURN .F.
		ENDIF  
		
	ENDPROC

	PROCEDURE txtContract.DblClick
		Thisform.Cauta_contract()
	ENDPROC

	PROCEDURE txtContract.GotFocus
		IF EMPTY(NVL(crsFacturi.Id_ctr, 0))
			Thisform.cauta_contract()
		ENDIF 	 
	ENDPROC

	PROCEDURE txtLucrare.DblClick
		Thisform.cauta_lucrare()
	ENDPROC

	PROCEDURE txtLucrare.GotFocus
		IF EMPTY(NVL(crsFacturi.Id_Lucrare, 0))
			Thisform.cauta_lucrare()
		ENDIF 	 
	ENDPROC

	PROCEDURE txtPartener.DblClick
		Thisform.cauta_partener()
		
	ENDPROC

	PROCEDURE txtPartener.GotFocus
		IF EMPTY(NVL(crsFacturi.IdPartROA, 0))
			Thisform.cauta_partener()
		ENDIF 	 
	ENDPROC

	PROCEDURE txtResponsabil.DblClick
		Thisform.Cauta_responsabil()
	ENDPROC

	PROCEDURE txtResponsabil.GotFocus
		IF EMPTY(NVL(crsFacturi.Id_responsabil, 0))
			Thisform.cauta_responsabil()
		ENDIF 	 
	ENDPROC

	PROCEDURE txtSectie.DblClick
		Thisform.Cauta_Sectie()
	ENDPROC

	PROCEDURE txtSectie.GotFocus
		IF EMPTY(NVL(crsFacturi.Id_Sectie, 0))
			Thisform.cauta_sectie()
		ENDIF 	 
	ENDPROC

	PROCEDURE txtValuta.DblClick
		thisform.cauta_valuta()
	ENDPROC

	PROCEDURE txtValuta.GotFocus
		IF EMPTY(NVL(crsFacturi.cod_fiscal,''))
			RETURN 
		ENDIF 	
		
		IF !EMPTY(NVL(crsFacturi.IdValutaROA,0))
			RETURN 
		ENDIF 
		
		thisform.cauta_valuta()
	ENDPROC

	PROCEDURE txtVenChelt.DblClick
		Thisform.Cauta_venchelt()
	ENDPROC

	PROCEDURE txtVenChelt.GotFocus
		IF EMPTY(NVL(crsFacturi.Id_VenChelt, 0))
			Thisform.cauta_venchelt()
		ENDIF 	 
	ENDPROC

ENDDEFINE
