*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="frm_import_extrase_banca.scx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
#INCLUDE "comun.h"

DEFINE CLASS dataenvironment AS dataenvironment 
 	*< CLASSDATA: Baseclass="dataenvironment" Timestamp="" Scale="" Uniqueid="" ClassIcon="1" />

	*<PropValue>
		DataSource = .NULL.
		Height = 200
		Left = 1
		Name = "Dataenvironment"
		Top = 220
		Width = 520
	*</PropValue>

ENDDEFINE

DEFINE CLASS form1 AS form 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cIBAN.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cIBAN.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cCodFiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cCodFiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cTip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cTip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cCont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cExtensie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cExtensie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cCreeazaParteneri.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cCreeazaParteneri.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cCreeazaParteneri._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cFactura.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cFactura.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cFactura._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cComanda.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cComanda.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cComanda._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cDataOra.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConturi.cDataOra.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cCodFiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cCodFiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cCont.Text1a" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cAcont.Text1a" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareConturi.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdImport" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdGenereazaNote" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdSterge" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cData.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cData.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cCodFiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cCodFiscal.Text1a" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cNr.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cNr.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cDenumire.Text1a" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cIBAN.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cIBAN.Text1a" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cDocumente.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cDocumente.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cSuma.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cSuma.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cTip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cTip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cTip2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cTip2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cComenzi.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdExtrase.cComenzi.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtData1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtData2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_help1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtIncasari" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtPlati" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblIncasari" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblPlati" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtExtras" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtOP" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cCodFiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cCodFiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cCont.Text1a" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cAcont.Text1a" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdConfigurareExplicatii.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtData" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label8" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: cauta_fdoc
		*m: completeazaclientiroa
		*m: connectroa
		*m: creeazanote
		*m: disconnectroa
		*m: exportdate
		*m: getidpart
		*m: loadsettings
		*m: modificanote
		*m: prelucreazafisierebreeze
		*m: refreshconfigurari
		*m: savesettings
		*m: scrienote
		*m: sql_temp_insert
		*m: sql_temp_insert_values
		*m: sterge_import
		*m: templatexlsx
		*m: trace
		*m: verificaimport
		*p: cfdocextras
		*p: cfdocop
		*p: lcontafin		&& Formularul se apeleaza din Contafin sau din ROA
		*p: nidfdocextras
		*p: nidfdocop
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		Caption = "Import extrase bancare, deconturi curieri, procesatori plati"
		cfdocextras = 
		cfdocop = 
		DoCreate = .T.
		Height = 457
		Icon = ..\comun\grafice\note.ico
		lcontafin = .F.
		Left = 0
		MaxButton = .T.
		MinButton = .F.
		Name = "Form1"
		nidfdocextras = 0
		nidfdocop = 0
		ShowWindow = 0
		Top = 0
		Width = 890
		WindowState = 2
		WindowType = 1
		_memberdata = <VFPData>
			<memberdata name="verificaimport" display="VerificaImport"/>
			<memberdata name="modificanote" display="ModificaNote"/>
			<memberdata name="getidpart" display="GetIdPart"/>
			<memberdata name="savesettings" display="SaveSettings"/>
			<memberdata name="loadsettings" display="LoadSettings"/>
			<memberdata name="lcontafin" display="lContafin"/>
			<memberdata name="refreshconfigurari" display="RefreshConfigurari"/>
			<memberdata name="nidfdocextras" display="nIdFdocExtras"/>
			<memberdata name="nidfdocop" display="nIdFdocOP"/>
			<memberdata name="cfdocextras" display="cFdocExtras"/>
			<memberdata name="cfdocop" display="cFdocOP"/>
		</VFPData>
	*</PropValue>

	ADD OBJECT 'But_help1' AS but_help WITH ;
		Anchor = 0, ;
		Left = 361, ;
		Name = "But_help1", ;
		TabIndex = 26, ;
		Top = 22
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 810, ;
		Name = "But_nou1", ;
		TabIndex = 18, ;
		ToolTipText = "Alegeti contul care se completeaza la import pe un partener/cod fiscal", ;
		Top = 66
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou2' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 809, ;
		Name = "But_nou2", ;
		TabIndex = 19, ;
		ToolTipText = "Alegeti partenerul si contul care se completeaza la import pe o explicatie", ;
		Top = 191
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 438, ;
		Name = "But_sterge1", ;
		TabIndex = 12, ;
		Top = 66, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge2' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 842, ;
		Name = "But_sterge2", ;
		TabIndex = 20, ;
		Top = 65, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge3' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 841, ;
		Name = "But_sterge3", ;
		TabIndex = 21, ;
		Top = 190, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdGenereazaNote' AS commandbutton WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		Caption = "\<Genereaza note", ;
		Enabled = .F., ;
		FontBold = .T., ;
		Height = 52, ;
		Left = 682, ;
		Name = "cmdGenereazaNote", ;
		Picture = ..\comun\grafice\note16.ico, ;
		PicturePosition = 7, ;
		TabIndex = 6, ;
		Top = 6, ;
		Width = 98
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'cmdImport' AS commandbutton WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		Caption = "\<Import", ;
		FontBold = .T., ;
		Height = 52, ;
		Left = 584, ;
		Name = "cmdImport", ;
		Picture = ..\comun\grafice\inbox.ico, ;
		PicturePosition = 7, ;
		TabIndex = 5, ;
		Top = 6, ;
		Width = 98
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'cmdSterge' AS commandbutton WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		Caption = "\<Sterge import", ;
		Enabled = .T., ;
		FontBold = .T., ;
		Height = 52, ;
		Left = 781, ;
		Name = "cmdSterge", ;
		Picture = ..\comun\grafice\erase01.ico, ;
		PicturePosition = 7, ;
		TabIndex = 7, ;
		Top = 6, ;
		Width = 98
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'grdConfigurareConturi' AS grid WITH ;
		Anchor = 8, ;
		ColumnCount = 4, ;
		DeleteMark = .F., ;
		Height = 92, ;
		HighlightStyle = 2, ;
		Left = 480, ;
		Name = "grdConfigurareConturi", ;
		Panel = 1, ;
		RecordSource = "cConfigConturi", ;
		TabIndex = 16, ;
		Top = 94, ;
		Width = 392, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "cod_fiscal", ;
		Column1.Name = "cCodFiscal", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 97, ;
		Column2.BackColor = 190,225,255, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "cont", ;
		Column2.Name = "cCont", ;
		Column2.ToolTipText = "DblClick pentru modificare", ;
		Column2.Width = 55, ;
		Column3.BackColor = 190,225,255, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "acont", ;
		Column3.Name = "cAcont", ;
		Column3.ToolTipText = "DblCLick pentru modificare", ;
		Column3.Width = 51, ;
		Column4.ColumnOrder = 1, ;
		Column4.ControlSource = "denumire", ;
		Column4.Name = "cDenumire", ;
		Column4.ReadOnly = .T., ;
		Column4.ToolTipText = "Dublu click pentru editare", ;
		Column4.Width = 152
		*< END OBJECT: BaseClass="grid" />

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

	ADD OBJECT 'grdConfigurareConturi.cAcont.Text1a' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1a"
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdConfigurareConturi.cCont.Text1a' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1a"
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grdConfigurareExplicatii' AS grid WITH ;
		Anchor = 8, ;
		ColumnCount = 5, ;
		DeleteMark = .F., ;
		Height = 92, ;
		HighlightStyle = 2, ;
		Left = 479, ;
		Name = "grdConfigurareExplicatii", ;
		Panel = 1, ;
		RecordSource = "cConfigExplicatii", ;
		TabIndex = 17, ;
		Top = 219, ;
		Width = 392, ;
		Column1.ColumnOrder = 3, ;
		Column1.ControlSource = "cod_fiscal", ;
		Column1.Name = "cCodFiscal", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 73, ;
		Column2.BackColor = 190,225,255, ;
		Column2.ColumnOrder = 4, ;
		Column2.ControlSource = "cont", ;
		Column2.Name = "cCont", ;
		Column2.ToolTipText = "DblClick pentru modificare", ;
		Column2.Width = 55, ;
		Column3.BackColor = 190,225,255, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "acont", ;
		Column3.Name = "cAcont", ;
		Column3.ToolTipText = "DblCLick pentru modificare", ;
		Column3.Width = 51, ;
		Column4.BackColor = 190,225,255, ;
		Column4.ColumnOrder = 2, ;
		Column4.ControlSource = "denumire", ;
		Column4.Name = "cDenumire", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 117, ;
		Column5.ColumnOrder = 1, ;
		Column5.ControlSource = "explicatie", ;
		Column5.Name = "cExplicatie", ;
		Column5.ReadOnly = .T., ;
		Column5.ToolTipText = "Dublu click pentru editare", ;
		Column5.Width = 121
		*< END OBJECT: BaseClass="grid" />

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

	ADD OBJECT 'grdConfigurareExplicatii.cAcont.Text1a' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1a"
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdConfigurareExplicatii.cCont.Text1a' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1a"
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

	ADD OBJECT 'grdConturi' AS grid WITH ;
		Anchor = 11, ;
		ColumnCount = 12, ;
		DeleteMark = .F., ;
		HeaderHeight = 30, ;
		Height = 226, ;
		HighlightStyle = 2, ;
		Left = 9, ;
		Name = "grdConturi", ;
		Panel = 1, ;
		RecordSource = "cConturi", ;
		TabIndex = 11, ;
		Top = 94, ;
		Width = 459, ;
		Column1.ColumnOrder = 3, ;
		Column1.ControlSource = "iban", ;
		Column1.Name = "cIBAN", ;
		Column1.Width = 164, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "banca", ;
		Column2.Name = "cCodFiscal", ;
		Column2.Width = 159, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "tip", ;
		Column3.Name = "cTip", ;
		Column3.Width = 59, ;
		Column4.BackColor = 190,225,255, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "cont", ;
		Column4.Name = "cCont", ;
		Column4.ToolTipText = "DblClick pentru modificare", ;
		Column4.Width = 66, ;
		Column5.BackColor = 190,225,255, ;
		Column5.ColumnOrder = 8, ;
		Column5.ControlSource = "acont", ;
		Column5.Name = "cAcont", ;
		Column5.ToolTipText = "DblClick pentru modificare", ;
		Column5.Width = 63, ;
		Column6.ColumnOrder = 6, ;
		Column6.ControlSource = "extensie", ;
		Column6.Name = "cExtensie", ;
		Column6.Width = 51, ;
		Column7.BackColor = 190,225,255, ;
		Column7.ColumnOrder = 9, ;
		Column7.ControlSource = "part_nou", ;
		Column7.CurrentControl = "_checkbox1", ;
		Column7.Name = "cCreeazaParteneri", ;
		Column7.ReadOnly = .F., ;
		Column7.Sparse = .F., ;
		Column7.Width = 56, ;
		Column8.BackColor = 190,225,255, ;
		Column8.ColumnOrder = 10, ;
		Column8.ControlSource = "factura", ;
		Column8.CurrentControl = "_checkbox1", ;
		Column8.Name = "cFactura", ;
		Column8.Sparse = .F., ;
		Column8.Width = 58, ;
		Column9.BackColor = 190,225,255, ;
		Column9.ColumnOrder = 11, ;
		Column9.ControlSource = "comanda", ;
		Column9.CurrentControl = "_checkbox1", ;
		Column9.Name = "cComanda", ;
		Column9.Sparse = .F., ;
		Column9.Width = 58, ;
		Column10.BackColor = 190,225,255, ;
		Column10.ColumnOrder = 1, ;
		Column10.ControlSource = "ales", ;
		Column10.CurrentControl = "_checkbox1", ;
		Column10.Name = "cAles", ;
		Column10.Sparse = .F., ;
		Column10.Width = 28, ;
		Column11.BackColor = 190,225,255, ;
		Column11.ColumnOrder = 4, ;
		Column11.ControlSource = "denumire", ;
		Column11.Name = "cDenumire", ;
		Column11.ReadOnly = .T., ;
		Column11.ToolTipText = "Dublu click pentru alegerea unui cont bancar", ;
		Column11.Width = 153, ;
		Column12.ControlSource = "dataora", ;
		Column12.Name = "cDataOra", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 108
		*< END OBJECT: BaseClass="grid" />

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

	ADD OBJECT 'grdConturi.cAcont.Text1' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdConturi.cAles._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "ales", ;
		Left = 16, ;
		Name = "_checkbox1", ;
		Top = 85
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdConturi.cAles.Text1' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdConturi.cCodFiscal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Banca / Curier / Procesator plati", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdConturi.cComanda._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Left = 53, ;
		Name = "_checkbox1", ;
		Top = 73
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdConturi.cComanda.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Asociaza comenzi", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdConturi.cComanda.Text1' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdConturi.cCont.Text1' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdConturi.cCreeazaParteneri._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		ControlSource = "part_nou", ;
		Left = 13, ;
		Name = "_checkbox1", ;
		Top = 61
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdConturi.cCreeazaParteneri.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Creeaza parteneri", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdConturi.cCreeazaParteneri.Text1' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdConturi.cDataOra.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data operare", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdConturi.cDenumire.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Partener ROA / Cont bancar", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdConturi.cExtensie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Extensie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdConturi.cFactura._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Height = 12, ;
		Left = 28, ;
		Name = "_checkbox1", ;
		Top = 49
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdConturi.cFactura.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Asociaza facturi", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdConturi.cFactura.Text1' AS textbox WITH ;
		BackColor = 190,225,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdConturi.cIBAN.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "IBAN", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdExtrase' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 11, ;
		DeleteMark = .F., ;
		Height = 68, ;
		HighlightStyle = 2, ;
		Left = 12, ;
		Name = "grdExtrase", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "cExtrase", ;
		TabIndex = 10, ;
		Top = 384, ;
		Width = 862, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "data", ;
		Column1.Name = "cData", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 73, ;
		Column2.ColumnOrder = 6, ;
		Column2.ControlSource = "cod_fiscal", ;
		Column2.CurrentControl = "Text1a", ;
		Column2.Format = "K", ;
		Column2.Name = "cCodFiscal", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 143, ;
		Column3.ColumnOrder = 1, ;
		Column3.ControlSource = "nr", ;
		Column3.Name = "cNr", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 98, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "denumire", ;
		Column4.Name = "cDenumire", ;
		Column4.ReadOnly = .T., ;
		Column4.ToolTipText = "DblClick pentru modificare", ;
		Column4.Width = 156, ;
		Column5.ColumnOrder = 7, ;
		Column5.ControlSource = "iban", ;
		Column5.Format = "K", ;
		Column5.Name = "cIBAN", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 196, ;
		Column6.ColumnOrder = 8, ;
		Column6.ControlSource = "documente", ;
		Column6.Name = "cDocumente", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 129, ;
		Column7.ColumnOrder = 10, ;
		Column7.ControlSource = "explicatie", ;
		Column7.Name = "cExplicatie", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 101, ;
		Column8.ColumnOrder = 3, ;
		Column8.ControlSource = "suma", ;
		Column8.Format = "RK", ;
		Column8.InputMask = "999 999 999.99", ;
		Column8.Name = "cSuma", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 106, ;
		Column9.ColumnOrder = 4, ;
		Column9.ControlSource = "iif(tip = 'C', 'Incasare', 'Plata')", ;
		Column9.Name = "cTip", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 79, ;
		Column10.ColumnOrder = 11, ;
		Column10.ControlSource = "tip_2", ;
		Column10.Name = "cTip2", ;
		Column10.ReadOnly = .T., ;
		Column11.ColumnOrder = 9, ;
		Column11.ControlSource = "comenzi", ;
		Column11.Name = "cComenzi", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 114
		*< END OBJECT: BaseClass="grid" />

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

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

	ADD OBJECT 'grdExtrase.cComenzi.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Comenzi", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdExtrase.cDenumire.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdExtrase.cDocumente.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Documente", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdExtrase.cIBAN.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "IBAN", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdExtrase.cNr.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdExtrase.cSuma.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdExtrase.cTip2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip trz.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.grdConturi, ;
		Left = 267, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 70
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

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

	ADD OBJECT 'Gridextra3' AS gridextra WITH ;
		gridexpression = Thisform.grdExtrase, ;
		Left = 870, ;
		Name = "Gridextra3", ;
		productname = ROA, ;
		Top = 361
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Label1' AS label WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Fdoc. Extras:", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 477, ;
		Name = "Label1", ;
		TabIndex = 15, ;
		ToolTipText = 'Fel document "Extras cont" (DblClick pentru a modifica)', ;
		Top = 323, ;
		Width = 75
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Configurare conturi import pe parteneri", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 480, ;
		Name = "Label2", ;
		TabIndex = 22, ;
		ToolTipText = "Alegeti contul care se completeaza la import pe un partener/cod fiscal", ;
		Top = 74, ;
		Width = 224
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Conturi bancare / deconturi", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 12, ;
		Name = "Label3", ;
		TabIndex = 24, ;
		Top = 76, ;
		Width = 156
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Detalii extrase / deconturi", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 24, ;
		Name = "Label4", ;
		TabIndex = 25, ;
		Top = 361, ;
		Width = 147
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label5' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Perioada import", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 11, ;
		Name = "Label5", ;
		TabIndex = 13, ;
		Top = 8, ;
		Width = 93
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label6' AS label WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Fdoc. OP:", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 694, ;
		Name = "Label6", ;
		TabIndex = 14, ;
		ToolTipText = 'Fel document "OP" (DblClick pentru a modifica)', ;
		Top = 323, ;
		Width = 55
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label7' AS label WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Configurare parteneri si conturi import pe explicatii", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 479, ;
		Name = "Label7", ;
		TabIndex = 23, ;
		ToolTipText = "Alegeti partenerul si contul care se completeaza la import pe o explicatie", ;
		Top = 199, ;
		Width = 291
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label8' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Data extras", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 228, ;
		Name = "Label8", ;
		TabIndex = 3, ;
		ToolTipText = "Se importa toate inregistrarile din fisier, indiferent de data lor. Se completeaza cu data extras. Se foloseste la importul deconturilor de la curieri.", ;
		Top = 8, ;
		Width = 68
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lblIncasari' AS _label WITH ;
		Anchor = 8, ;
		Caption = "Incasari", ;
		FontBold = .T., ;
		Height = 18, ;
		Left = 518, ;
		Name = "lblIncasari", ;
		TabIndex = 29, ;
		Top = 360
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblPlati' AS _label WITH ;
		Anchor = 8, ;
		Caption = "Plati", ;
		FontBold = .T., ;
		Left = 710, ;
		Name = "lblPlati", ;
		TabIndex = 30, ;
		Top = 360
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		Anchor = 8, ;
		BackStyle = 0, ;
		Height = 287, ;
		Left = 473, ;
		Name = "Shape1", ;
		SpecialEffect = 0, ;
		Style = 3, ;
		Top = 63, ;
		Width = 405
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		Anchor = 11, ;
		BackStyle = 0, ;
		Height = 287, ;
		Left = 5, ;
		Name = "Shape2", ;
		SpecialEffect = 0, ;
		Style = 3, ;
		Top = 63, ;
		Width = 469
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape3' AS shape WITH ;
		BackStyle = 0, ;
		BorderColor = 150,150,150, ;
		Height = 54, ;
		Left = 9, ;
		Name = "Shape3", ;
		Top = 6, ;
		Width = 213
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape4' AS shape WITH ;
		BackStyle = 0, ;
		BorderColor = 150,150,150, ;
		Height = 54, ;
		Left = 221, ;
		Name = "Shape4", ;
		Top = 6, ;
		Width = 110
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'txtData' AS textbox WITH ;
		Format = "!K", ;
		Height = 23, ;
		Left = 228, ;
		Name = "txtData", ;
		TabIndex = 4, ;
		ToolTipText = "Se importa toate inregistrarile din fisier, indiferent de data lor. Se completeaza cu data extras. Se foloseste la importul deconturilor de la curieri.", ;
		Top = 26, ;
		Width = 100
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtData1' AS textbox WITH ;
		Format = "!K", ;
		Height = 23, ;
		Left = 13, ;
		Name = "txtData1", ;
		TabIndex = 1, ;
		Top = 26, ;
		Width = 100
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtData2' AS textbox WITH ;
		Format = "!K", ;
		Height = 23, ;
		Left = 119, ;
		Name = "txtData2", ;
		TabIndex = 2, ;
		Top = 26, ;
		Width = 100
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtExtras' AS textbox WITH ;
		Anchor = 8, ;
		ControlSource = "Thisform.cFdocExtras", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 555, ;
		Name = "txtExtras", ;
		ReadOnly = .T., ;
		TabIndex = 8, ;
		ToolTipText = 'Fel document "Extras cont" (DblClick pentru a modifica)', ;
		Top = 320, ;
		Width = 120
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtIncasari' AS _textbox WITH ;
		Anchor = 8, ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "999 999 999.99", ;
		Left = 578, ;
		Name = "txtIncasari", ;
		ReadOnly = .T., ;
		TabIndex = 27, ;
		Top = 358, ;
		Width = 124
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtOP' AS textbox WITH ;
		Anchor = 8, ;
		ControlSource = "Thisform.cFdocOP", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 753, ;
		Name = "txtOP", ;
		ReadOnly = .T., ;
		TabIndex = 9, ;
		ToolTipText = 'Fel document "OP" (DblClick pentru a modifica)', ;
		Top = 320, ;
		Width = 120
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtPlati' AS _textbox WITH ;
		Anchor = 8, ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "999 999 999.99", ;
		Left = 749, ;
		Name = "txtPlati", ;
		ReadOnly = .T., ;
		TabIndex = 28, ;
		Top = 358, ;
		Width = 124
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE cauta_fdoc
		Lparameters tcTipDoc
		
		Local loCauta, lcTipDoc
		lcTipDoc =  Lower(m.tcTipDoc)
		loCauta = caut_fdoc()
		If !Isnull(loCauta)
			Do Case
				Case lcTipDoc = 'extras'
					lnSucces = scrie_optiune('ID_FDOC_EXTRASCONT', INT(NVL(loCauta.id_fdoc,0)))
					IF m.lnSucces > 0
						Thisform.nIdFdocExtras = loCauta.id_fdoc
						Thisform.cFdocExtras = loCauta.fel_document
						gnID_FDOC_EXTRASCONT = Thisform.nIdFdocExtras 			
					ENDIF 
					thisform.txtExtras.Refresh()							
				Case lcTipDoc = 'op'
					lnSucces = scrie_optiune('ID_FDOC_OP', INT(NVL(loCauta.id_fdoc,0)))			
					IF m.lnSucces > 0
						Thisform.nIdFdocOP = loCauta.id_fdoc
						Thisform.cFdocOP = loCauta.fel_document
						gnID_FDOC_OP = Thisform.nIdFdocOP							
						Thisform.txtOP.Refresh()				
					ENDIF 
			Endcase
		Endif
		
	ENDPROC

	PROCEDURE completeazaclientiroa
	ENDPROC

	PROCEDURE connectroa
	ENDPROC

	PROCEDURE creeazanote
		Local loImport As "ImportNote"
		Local lcAcontBanca, lcClass, lcClassType, lcContBanca, lcFile, lcFileExt, lcFileType, lcParam
		Local llCreeazaNote, llSucces, ldData1, ldData2, ldData
		Select cConturi
		lcClass = Alltrim(clasa)
		lcFileExt = Alltrim(extensie)
		lcClassType = Alltrim(tipclasa)
		lcFileType = Alltrim(tip)
		lcContBanca = Alltrim(Cont)
		lcAcontBanca = Alltrim(acont)
		lcFile = Alltrim(fisier)
		
		* Parcurg fisierul si determin IBAN-ul si inregistrarile din extras
		ldData1 = thisform.txtData1.Value
		ldData2 = thisform.txtData2.Value 
		ldData = thisform.txtData2.Value 
		
		lcParam = Iif(!Empty(m.lcContBanca), "cContBanca=>" + m.lcContBanca, "") + Iif(!Empty(m.lcAcontBanca), "??cAcontBanca=>" + m.lcAcontBanca, "")
		loImport = Createobject("ImportNote", m.lcFile, m.ldData1, m.ldData2, m.lcClass, m.lcClassType, m.lcFileType, m.lcFileExt, m.lcParam, m.ldData) && oproceduri_import.prg
		llCreeazaNote = .T.
		llSucces = loImport.Import(m.llCreeazaNote) && rezulta cursorul cActTemp
		
		Return m.llSucces
		
	ENDPROC

	PROCEDURE Destroy
		Thisform.SaveSettings()
		
		USE IN (SELECT('cConturi'))
		
	ENDPROC

	PROCEDURE disconnectroa
	ENDPROC

	PROCEDURE exportdate
	ENDPROC

	PROCEDURE getidpart
		LPARAMETERS tcDenumire
		LOCAL lcDenumire, lnId
		lnId = 0
		lcDenumire = ALLTRIM(m.tcDenumire)
		IF USED('cParteneri')
			IF SEEK(m.lcDenumire, 'cParteneri','denumire')
				lnId = cParteneri.id_part
			ENDIF 
		ENDIF 
		RETURN m.lnId
	ENDPROC

	PROCEDURE Init
		this.txtData1.Value = DATE(m.gnAn, m.gnLuna, 1)
		This.txtData2.Value = GOMONTH(DATE(m.gnAn, m.gnLuna, 1),1)-1
		this.txtData.Value = {}
		
		Thisform.nIdFdocOP = m.gnID_FDOC_OP
		Thisform.cFdocOP = GetFdocById(m.gnID_FDOC_OP)
		Thisform.nIdFdocExtras = m.gnID_FDOC_EXTRASCONT
		Thisform.cFdocExtras = GetFdocById(m.gnID_FDOC_EXTRASCONT)
			
		* Colorez cu albastru inregistrarile pentru import
		this.grdConturi.SetAll("DynamicForeColor", "IIF(cConturi.note = 1, RGB(0,128,0), IIF(cConturi.import = 1, RGB(0,0,128), RGB(0,0,0)))","Column")
		
		this.gridextra1.setup()
		this.gridextra2.setup()
		this.gridextra3.setup()
		DODEFAULT()
		
		
	ENDPROC

	PROCEDURE Load
		CREATE CURSOR cConturi (ales N(1), note N(1), import N(1), banca C(100), iban C(100), clasa C(100), fisier C(250), ;
			tip C(20), extensie C(4), tipclasa C(100), cont C(4), acont C(4), part_nou L, factura L, comanda L, denumire C(100), id_part N(10), dataora T)
		
		* Trebuie sa citesc configurarile pentru fiecare IBAN
		CREATE CURSOR cConfigConturi(iban C(100), id_part N(10), denumire C(200), cod_fiscal C(50), cont C(4), acont C(4))
		
		* Explicatii - cont, partener configurate de utilizator
		CREATE CURSOR cConfigExplicatii(iban C(100), id_part N(10), denumire C(200), cod_fiscal C(50), cont C(4), acont C(4), explicatie V(250))
		
		CREATE CURSOR cExtrase (eiban C(100), nr N(14), Data D, suma N(15, 2), suma_val N(15, 2), ;
			explicatie c (100), iban c (24), denumire c (60), cod_fiscal c (13), tip c (2), tip_2 c (3), documente c(250), comenzi C(250))
			
		This.LoadSettings()
		
		Select cConfigConturi
		Set Filter To iban = cConturi.iban
		
		Select cConfigExplicatii
		Set Filter To iban = cConturi.iban
		
		SELECT cExtrase
		SET FILTER TO eiban = cConturi.iban
		
		SELECT cConturi
	ENDPROC

	PROCEDURE loadsettings
		* Incarc setarile pe fiecare IBAN
		
		Local lcConfig, lcConturi, lcConfigExplicatii
		lcConturi = citeste_optiune('EXTRASEB_CONTURI', .T.)
		lcConfigConturi = citeste_optiune('EXTRASEB_CONFIG', .T.)
		lcConfigExplicatii = citeste_optiune('EXTRASEB_CONFIG_EXPL', .T.)
		
		
		If !Empty(m.lcConturi)
			Xmltocursor(m.lcConturi, 'cConturiTemp')
			Select cConturi
			Append From Dbf('cConturiTemp')
			Use In (Select('cConturiTemp'))
			UPDATE cConturi SET import = 0, ales = 0, note = 0
		
			* Completez numele partenerilor tip BANCA
			* Caut si pentru conturile care au denumirea partenerului completata, in cazul in care s-a modificat intre timp
			* Doar informativ. Se mai face o cautare si la generare note
			SELECT cConturi 
			SCAN FOR !EMPTY(NVL(iban, '')) AND (EMPTY(NVL(id_part,0)) OR EMPTY(NVL(denumire, '')))
				lcIBAN = ALLTRIM(iban)
				loPartener = GetPartenerByContBanca(m.lcIBAN)
				IF !ISNULL(loPartener)
					REPLACE id_part WITH NVL(loPartener.id_part, 0), denumire WITH NVL(loPartener.denumire,'') IN cConturi
				ENDIF 
			ENDSCAN 	
			
			Go Top In cConturi
		Endif
		
		If !Empty(m.lcConfigConturi)
			Xmltocursor(m.lcConfigConturi, 'cConfigConturiTemp')
			Select cConfigConturi
			Append From Dbf('cConfigConturiTemp')
			Use In (Select('cConfigConturiTemp'))
			Go Top In cConfigConturi
		ENDIF
		
		If !Empty(m.lcConfigExplicatii)
			Xmltocursor(m.lcConfigExplicatii, 'cConfigExplicatiiTemp')
			Select cConfigExplicatii
			Append From Dbf('cConfigExplicatiiTemp')
			Use In (Select('cConfigExplicatiiTemp'))
			Go Top In cConfigExplicatii
		Endif
	ENDPROC

	PROCEDURE modificanote
		LPARAMETERS tlIncarcaBackup
		
		* 10.02.2026
		* completez taxcode plati buget salarii, impozit venit/profit, tva de plata
		
		* tlIncarcaBackup (optional): daca se incarca notele din backup.xml
		
		Local loForm As [frm_modific2007]
		Local llMaximize, llNotaNoua, lnIdSet, llSucces, lcSelect
		Local lcSql, lnSucces, lnTaxCode
		Local ldDataAct, llFurnizorTVAI, lnIdJtva
		Local loBackupXML As "backupxml"
		Local lcXMLFileName, llRestoredBackupSet, llSuces, lnNract, lnNractNegativ, lnRec
		
		*: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)
		
		SELECT * FROM crsExplicatiiTVATemp INTO CURSOR crsJTVATemp READWRITE 
		*!* 15.07.2026 marius.mutu - index necesar pentru Seek-ul din frm_modific2024.grdRulaje.cExplicatieTVA
		SELECT crsJTVATemp
		INDEX ON id_jtva_coloana TAG id_jtva
		
		llSuces = .T.
		lcXMLFileName =  'nota_' + Alltrim(Str(m.lnIdSet)) && Iif(m.tnIdSet = 99998, 'notafarapredefinire2', Iif(m.tnIdSet = 99999, 'notafarapredefinire', 'nota'))
		loBackupXML = Createobject("backupxml", m.lcXMLFileName) && oproceduri_comune.prg
		IF m.tlIncarcaBackup
			llExistaBackupSet = loBackupXML.ExistsBackupSet()
			IF !m.llExistaBackupSet
				AMESSAGEBOX('Nu exista o nota salvata anterior!',0+48,_Screen.Caption)
				RETURN m.llSucces
			ENDIF 	
		ENDIF 	
		
		IF !m.tlIncarcaBackup
			lcSql = [SELECT * FROM vact WHERE 1=2]
			llSucces = goExecutor.oExecuta(m.lcSql, 'actactan_temp')
			
			
			* Creez cursoare trul, trul_obinv
			lcSql = [select * from vrul_tot where 1=2]
			lcCursor = [v_rul]
		
			llSucces = goExecutor.oExecuta(lcSql,lcCursor)
		
			If m.llSucces		
				Select *, ;
					valoare + valtva As valoarectva, ;
					valoarev + valtvav As valoarevctva ;
					From v_rul ;
					Into Cursor trul READWRITE 
					
				Use In (SELECT('v_rul'))
		
				lcSql = [select * from vrul_obinv_tot where 1=2]
				lcCursor = [v_rul_obinv]
		
				llSucces = goExecutor.oExecuta(lcSql,lcCursor)
			Endif
		
			If m.llSucces
				Select *, ;
					valoare + valtva As valoarectva, ;
					valoarev + valtvav As valoarevctva ;
					From v_rul_obinv ;
					Into Cursor trul_obinv READWRITE 			
		
				Use In (SELECT('v_rul_obinv'))
			Endif
			
		ELSE 
			llRestoredBackupSet = loBackupXML.RestoreBackupSet()
			IF USED('tAct')
				UPDATE tAct SET explicatia5 = 'IMPORT ' + STRTRAN(TTOC(DATETIME(),3), 'T', ' ')
			ENDIF 
		ENDIF 	
		
		If m.llSucces AND !m.tlIncarcaBackup
			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, explicatia5 = 'IMPORT ' + STRTRAN(TTOC(DATETIME(),3), 'T', ' ')
			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_modific2024], m.lnIdSet, m.llNotaNoua)
			loForm.lb_titlu_alb_b121.Caption = 'Import extrase bancare, deconturi curieri, procesatori plati'
			Select tact
			loForm.Show(1, m.llMaximize)
		
			*** SALVEZ NOTELE FARA PREDEFINIRE INAINTE DE SCRIEREA IN BAZA DE DATE
			If Type('loBackupXML') = 'O' And Used('tact')
				loBackupXML.SaveBackupSet("tact")
				loBackupXML.SaveBackupSet("trul")
				loBackupXML.SaveBackupSet("trul_obinv")
			ENDIF
			
			If buton = 1
				Use In (Select('actactan'))
		
				Update tact Set id_jtva_coloana = Null, PROC_TVA = 0 Where Cu_tva = 0
		
				* completez taxcode plati buget salarii, impozit venit/profit, tva de plata
				UPDATE tact SET taxcode = 412000 WHERE scd = '4315' or scc = '4315'
				UPDATE tact SET taxcode = 432000 WHERE scd = '4316' or scc = '4316'
				UPDATE tact SET taxcode = 480000 WHERE scd = '436' or scc = '436'						
				UPDATE tact SET taxcode = 602000 WHERE scd = '444' or scc = '444'
				UPDATE tact SET taxcode = 301000 WHERE scd = '4423' or scc = '4423'
				UPDATE tact SET taxcode = 100000 WHERE scd = '4411' or scc = '4411'
				UPDATE tact SET taxcode = 120000 WHERE scd = '4418' or scc = '4418'
		
				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'))
		Use In (Select('crsJTVATemp'))
		Use In (Select('tact'))
		Use In (Select('trul'))
		Use In (Select('trul_obinv'))
		Select (m.lcSelect)
		Return m.llSucces
		  
	ENDPROC

	PROCEDURE prelucreazafisierebreeze
	ENDPROC

	PROCEDURE refreshconfigurari
		LOCAL lcSelect
		lcSelect = SELECT()
		
		SELECT cExtrase
		CALCULATE SUM(suma) FOR tip = 'C' TO This.txtIncasari.Value
		CALCULATE SUM(suma) FOR tip = 'D' TO This.txtPlati.Value 
		GO TOP 
		Thisform.grdExtrase.Refresh()
		This.txtIncasari.Refresh()
		This.txtPlati.Refresh()
		
		SELECT cConfigConturi
		GO TOP 
		Thisform.grdConfigurareConturi.Refresh()
		
		SELECT cConfigExplicatii
		GO TOP 
		Thisform.grdConfigurareExplicatii.Refresh()
		
		
		SELECT (m.lcSelect)
	ENDPROC

	PROCEDURE savesettings
		* Salvez setarile pe fiecare AMEF
		Local lcFilter, lcConturi, lcConfigConturi, lcConfigExplicatii, lcSelect
		lcSelect = SELECT()
		lcConturi = ''
		lcConfigConturi = ''
		lcConfigExplicatii = ''
		lcFilter = ''
		
		Cursortoxml('cConturi', "lcConturi", 1, 1 + 2, 0, "1")
		
		Select cConfigConturi
		lcFilter = Filter()
		Set Filter To
		Cursortoxml('cConfigConturi', "lcConfigConturi", 1, 1 + 2, 0, "1")
		Set Filter To &lcFilter
		
		Select cConfigExplicatii
		lcFilter = Filter()
		Set Filter To
		Cursortoxml('cConfigExplicatii', "lcConfigExplicatii", 1, 1 + 2, 0, "1")
		Set Filter To &lcFilter
		
		= scrie_optiune('EXTRASEB_CONTURI', m.lcConturi, "EXTRASE BANCARE CONTURI", .T.)
		= scrie_optiune('EXTRASEB_CONFIG', m.lcConfigConturi, "EXTRASE BANCARE CONFIGURARE CONTURI", .T.)
		= scrie_optiune('EXTRASEB_CONFIG_EXPL', m.lcConfigExplicatii, "EXTRASE BANCARE CONFIGURARE EXPLICATII", .T.)
		
		SELECT (m.lcSelect)
	ENDPROC

	PROCEDURE scrienote
		Local lcMesaj, lcSql, lnHandle, lnSucces, lnSucces2
		Private gnAn, gnIdSucursala, gnIdUtil, gnLuna
		lnSucces = SQLSetprop(m.lnHandle, "Transactions", 2)
		
		if lnSucces > 0
			&& Creez note pentru fiecare luna/an
			Select Distinct an, luna From actactan Order By an, luna Into Cursor cAnLuna
			Select cAnLuna
			Scan
				*gnAn = an
				*gnLuna = luna
				*gnIdUtil = - 3
				*gnIdSucursala = Null
		
				if m.lnSucces > 0
					lcSql = [begin pack_contafin.init_scriere_act_rul_local(?gnIdUtil,?gnAn,?gnLuna, 1,0,?gnIdSucursala); end;]
					lnSucces = goExecutor.oExecute(m.lcSql)
				Endif
		
				if lnSucces > 0
					SELECT * FROM actactan WHERE an = m.gnAn AND luna = m.gnLuna INTO CURSOR cAct NOFILTER 
					lnSucces = This.sql_temp_insert('cAct', 'ACT_TEMP')
					USE IN (SELECT('cAct'))
				Endif
		
				if lnSucces > 0
					Private pcMesajRefacereNota
					pcMesajRefacereNota = ""
					lcSql = [begin pack_contafin.final_scriere_act_rul_local(?gnIdUtil, ?gnAn, ?gnLuna, NULL, 0, 1, ?@pcMesajRefacereNota); end;]
					lnSucces = goExecutor.oExecute(m.lcSql)
					If !Empty(Nvl(pcMesajRefacereNota, ''))
						This.trace(m.pcMesajRefacereNota)
						AMESSAGEBOX(m.pcMesajRefacereNota, 0 + 48, 'Atentie')
					Endif
					Release pcMesajRefacereNota
				ELSE
					lcMesaj = goExecutor.cEroare
					This.Trace(m.lcMesaj)
					AMESSAGEBOX(m.lcMesaj,0+48, _screen.Caption )
					EXIT 	
				ENDIF && lnSucces
			Endscan && cAnLuna
		
			Use In (Select('cAnLuna'))
		
			if lnSucces > 0
				lnSucces2 = goExecutor.oExecute('COMMIT')
				IF lnSucces2 <> 1
					lnSucces = 0
				ENDIF 
			Else
				lnSucces2 = goExecutor.oExecute('ROLLBACK')
			Endif
		
			If lnSucces2 <> 1
				This.trace(goExecutor.cEroare)
				AMESSAGEBOX(lcSql + Chr(13) + goExecutor.cEroare, 0 + 16, "Eroare")
			ELSE
				This.trace('Import realizat cu succes!')	
			Endif
		
			lnSucces3 = SQLSetprop(m.lnHandle, "Transactions", 1)
		
			If lnSucces3 <> 1
				lcMesaj = 'Programul nu a reusit sa treaca pe tranzactie automata. Iesiti din program si intrati din nou!'
				This.trace(m.lcMesaj)
				AMESSAGEBOX(m.lcMesaj, 0 + 48, 'Atentie!')
			Endif
		Endif && lnSucces
		
		Return m.lnSucces
		
	ENDPROC

	PROCEDURE sql_temp_insert
		Lparameters tcAlias, tcTableName
		
		Local lcAlias, lcCursor, lnSucces
		Local lcDate, lcFieldName, lcFieldType, lcFieldValue, lcFields, lcInsert, lcMesaj, lcNumber, lcSql
		Local lcString, lcTableName, lcValues, lnCount
		Local lnField
		
		Private poIreg, pcTableName
		Local lcVariable
		
		If Empty(tcAlias)
			lcAlias = 'ACTACTAN'
		Else
			lcAlias = Upper(Alltrim(tcAlias))
		Endif
		If Empty(tcTableName)
			pcTableName = 'ACT_TEMP'
		Else
			pcTableName = Upper(Alltrim(tcTableName))
		Endif
		
		lcCursor = 'crs_Coloane'
		lcSql = [SELECT COLUMN_NAME AS COLOANA from user_tab_columns WHERE table_name = ?pcTableName]
		lnSucces = goExecutor.oExecute(m.lcSql, m.lcCursor)
		If m.lnSucces <> 1
			lcMesaj = 'Eroare la selectare coloane din ' + m.lcTableName + Chr(13) + goExecutor.cEroare
			This.trace(m.lcMesaj)
			AMESSAGEBOX(m.lcMesaj, 0 + 16, 'Eroare')
		Endif
		
		If m.lnSucces = 1
			Select (lcAlias)
			lnCount = Fcount()
			lcFields = []
			lcValues = []
			lcInsert = []
			For lnField = 1 To lnCount
				Select (lcAlias)
				lcFieldName = Upper(Alltrim(Field(lnField)))
				lcFieldType = Type(lcFieldName)
				lcFieldValue = Evaluate(lcFieldName)
				If lcFieldType = 'C'
					lcVariable = '?ALLTRIM(poIreg.' + lcFieldName + ')'
				Else
					lcVariable = '?poIreg.' + lcFieldName
				Endif
		
				Select CRS_COLOANE
				Locate For Upper(Alltrim(COLOANA)) == lcFieldName
				If !Found()
					Loop
				Endif
				lcFields = lcFields + [,] + lcFieldName
				lcValues = lcValues + [,] + lcVariable
			Endfor
		
			lcFields = Substr(lcFields, 2)
			lcValues = Substr(lcValues, 2)
		
			&& INSERT INTO ACT_TEMP
			lcInsert = [INSERT INTO ] + m.pcTableName + [ (] + m.lcFields + [) VALUES (] + m.lcValues + [)]
		
			Select (lcAlias)
			Scan
				Scatter Name poIreg
				IF MOD(RECNO(), 100) = 0
					This.trace(' Inregistrare ' + TRANSFORM(RECNO()) + ' / ' + TRANSFORM(RECCOUNT()) + ' ...')
				ENDIF 
				&& FAC NULL ID-URILE CU VALOARE 0
				If TYPE('poReg.id_sucursala') = 'N' AND poIreg.id_sucursala = 0
					poIreg.id_sucursala = Null
				Endif
		
				lnSucces = goExecutor.oExecute(m.lcInsert)
				If lnSucces <> 1
					This.trace(goExecutor.cEroare)
					AMESSAGEBOX(goExecutor.cEroare, 0 + 16, 'Eroare')
					Exit
				Endif
		
			Endscan
		Endif
		
		Use In (Select('crs_coloane'))
		
		Return m.lnSucces
		
	ENDPROC

	PROCEDURE sql_temp_insert_values
		* daca se doreste insert into act_temp cu valori in loc de ?
		* trebuie decomentata sectiunea cu valori
		Lparameters tcAlias, tcTableName
		
		Local lcAlias, lcCursor, lnSucces
		Local lcDate, lcFieldName, lcFieldType, lcFieldValue, lcFields, lcInsert, lcMesaj, lcNumber, lcSql
		Local lcString, lcTableName, lcValues, lnCount
		Local lnField
		
		Private poIreg, pcTableName
		Local lcVariable
		
		If Empty(tcAlias)
			lcAlias = 'ACTACTAN'
		Else
			lcAlias = Upper(Alltrim(tcAlias))
		Endif
		If Empty(tcTableName)
			pcTableName = 'ACT_TEMP'
		Else
			pcTableName = Upper(Alltrim(tcTableName))
		Endif
		
		lcCursor = 'crs_Coloane'
		lcSql = [SELECT COLUMN_NAME AS COLOANA from user_tab_columns WHERE table_name = ?pcTableName]
		lnSucces = goExecutor.oExecute(m.lcSql, m.lcCursor)
		If m.lnSucces <> 1
			lcMesaj = 'Eroare la selectare coloane din ' + m.pcTableName + Chr(13) + goExecutor.cEroare
			This.trace(m.lcMesaj)
			AMESSAGEBOX(m.lcMesaj, 0 + 16, 'Eroare')
		Endif
		
		If m.lnSucces = 1
			Select (lcAlias)
			lnCount = Fcount()
			Scan
				lcFields = []
				lcValues = []
				lcInsert = []
				Scatter Name poIreg
		
				For lnField = 1 To lnCount
					Select (lcAlias)
					lcFieldName = Upper(Alltrim(Field(lnField)))
					lcFieldType = Type(lcFieldName)
					lcFieldValue = Evaluate(lcFieldName)
					If lcFieldType = 'C'
						lcVariable = '?ALLTRIM(poIreg.' + lcFieldName + ')'
					Else
						lcVariable = '?poIreg.' + lcFieldName
					Endif
		
					Select CRS_COLOANE
					Locate For Upper(Alltrim(COLOANA)) == lcFieldName
					If !Found()
						Loop
					Endif
					lcFields = lcFields + [,] + lcFieldName
					lcNumber = '0'
					lcDate = ''
					lcString = ''
		
					&& FAC NULL ID-URILE CU VALOARE 0
					If Inlist(lcFieldName, 'ID_SUCURSALA')
						If poIreg.id_sucursala = 0
							poIreg.id_sucursala = Null
						Endif
					Endif
					lcValues = lcValues + [,] + lcVariable
		
					*!*				DO CASE
					*!*					CASE lcFieldType = 'N'
					*!*						IF EMPTY(lcFieldValue) OR ISNULL(lcFieldValue)
					*!*							lcNumber = '0'
					*!*						ELSE
					*!*							lcNumber = ALLTRIM(STR(lcFieldValue,24,4))
					*!*						ENDIF
		
					*!*						lcValues = lcValues + [,] + lcNumber
					*!*					CASE lcFieldType = 'C'
					*!*						IF EMPTY(lcFieldValue) OR ISNULL(lcFieldValue)
					*!*							lcString = ''
					*!*						ELSE
					*!*							lcString = ALLTRIM(lcFieldValue)
					*!*						ENDIF
		
					*!*						lcValues = lcValues + [,] + ['] + lcString + [']
					*!*					CASE INLIST(lcFieldType,'D','T')
					*!*						IF EMPTY(lcFieldValue) OR ISNULL(lcFieldValue)
					*!*							lcDate = ''
					*!*						ELSE
					*!*							lcDate = DTOS(lcFieldValue)
					*!*						ENDIF
					*!*						lcValues = lcValues + [,] + [TO_DATE('] + lcDate + [','YYYY-MM-DD')]
					*!*				ENDCASE
		
				Endfor
		
				lcFields = Substr(lcFields, 2)
				lcValues = Substr(lcValues, 2)
		
				&& INSERT INTO ACT_TEMP
				lcInsert = [INSERT INTO ] + m.pcTableName + [ (] + lcFields + [) VALUES (] + lcValues + [)]
				lnSucces = goExecutor.oExecute(m.lcInsert)
				If lnSucces <> 1
					This.Trace(goExecutor.cEroare)
					AMESSAGEBOX(goExecutor.cEroare, 0 + 16, 'Eroare')
					Exit
				Endif
		
			Endscan
		Endif
		
		Use In (SELECT('crs_coloane'))
		
		Return m.lnSucces
		
		
		
	ENDPROC

	PROCEDURE sterge_import
		Local lcExplicatia5, lcMenu, lcSql, llContinuare, llSucces, lnInregistrari, lnOptiune, lcSeparator
		
		lcSql = [select explicatia5, util, COUNT(explicatia5) as nr from vact_tot where an=?gnAn and Luna=?gnLuna and id_set = 90023 and sters = 0 and explicatia5 is not null ] + m.gcCondSucursala + [ group by explicatia5, util order by explicatia5 DESC]
		llSucces = goExecutor.oExecuta(m.lcSql, 'crsStergeri')
		IF !m.llSucces
			RETURN
		ENDIF 
		
		If Reccount("crsstergeri") = 0
			amessagebox("Nu au fost gasite importuri in luna curenta")
			RETURN 
		Endif
		SET STEP ON 
		lcMenu = ''
		SELECT crsStergeri
		SCAN
			lcSeparator = IIF(RECNO() < RECCOUNT(), ';', '')
			lcMenu = m.lcMenu + ALLTRIM(explicatia5) +  ' ' + ALLTRIM(STR(nr)) + ' intregistrari, utilizator: ' + ALLTRIM(util) + m.lcSeparator
		ENDSCAN 
		lnOptiune = xmenu(m.lcMenu)
		IF EMPTY(m.lnOptiune)
			USE IN (SELECT('crsStergeri'))
			RETURN
		ENDIF 
		SELECT crsStergeri
		GOTO (m.lnOptiune) 
		lcExplicatia5 = ALLTRIM(explicatia5)
		lnInregistrari = nr
		USE IN (SELECT('crsStergeri'))
		llContinuare = (AMessagebox('Doriti sa stergeti ' + Alltrim(Str(m.lnInregistrari)) + ' inregistrari, tip operatie 90023, explicatia ' + m.lcExplicatia5 + ', din luna ' + Padl(m.gnLuna, 2, '0') + '/' + Alltrim(Str(m.gnAn)) + '?', 4 + 32, _Screen.Caption) = 6)
		
		IF !m.llContinuare
			RETURN
		ENDIF
		
		llSucces = stergere_import_note_contabile(m.lcExplicatia5, 0, "explicatia5") && oscrie_in_fisiere.prg
		AMESSAGEBOX('Stergerea s-a incheiat cu ' + IIF(m.llSucces, 'succes', 'eroare'),0+48, _screen.Caption)	
		Return m.llSucces
		  
	ENDPROC

	PROCEDURE templatexlsx
	ENDPROC

	PROCEDURE trace
		LPARAMETERS tcMessage
		AMESSAGEBOX(tcMessage)
		*!*	This.edtInfo.Value = This.edtInfo.Value + TRANSFORM(NVL(tcMessage,'')) + CHR(13) + CHR(10)
		*!*	this.edtInfo.SelStart = LEN(this.edtInfo.Value)
		*!*	This.edtInfo.Refresh()
	ENDPROC

	PROCEDURE verificaimport
		* Verifica daca mai exista inregistrari 90023 in luna curenta
		Local llExista, lcSelect, lcSql, llSucces
		Private pnReturnValue, pnSuma, pdDataAct, pcScd, pcScc
		pnReturnValue = 0
		lcSelect = SELECT()
		
		lcSql = [select COUNT(*) as nr from act where an=?gnAn and luna = ?gnLuna and id_set=90023 and sters=0 and suma = ?pnSuma and dataact = ?pdDataAct and scd = ?pcScd and scc = ?pcScc]
		SELECT actactan
		SCAN
			pnSuma = suma
			pdDataAct = dataact
			pcScd = ALLTRIM(scd)	
			pcScc = ALLTRIM(scc)
			llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @pnReturnValue)
			If !m.llSucces
				IF m.pnReturnValue > 0
					EXIT 
				ENDIF 
			ELSE 
				EXIT 
			Endif
		ENDSCAN && actactan
		
		llExista = (m.pnReturnValue > 0)
		
		Select (m.lcSelect)
		Return m.llExista
		
		
	ENDPROC

	PROCEDURE But_help1.Click
		LOCAL lcInfo
		TEXT TO lcInfo noshow
		[Optional]
		Inainte de import, completati codul "IBAN" in Entitati pe entitatea asociata contului bancar (Ex: "RAIFFEISEN CONT CURENT LEI") pentru ca Importul sa determine automat entitatea.
		Alternativ, partenerul "cont bancar" se poate alege la import.
		
		1. Modificati (daca este cazul) perioada de import sau Completati "Data extras" pentru deconturile de la curieri
		
		2. Apasati butonul [Import]
		
		3. Configurari
		3.1 Modificati (daca este cazul) contul sintetic si analitic aferent extrasului bancar / decontului importat
		
			Ex: pentru incasari din deconturi curieri sau procesatori plati se poate configura contul 5125. 
			Nota generata va fi 5125 = 4111
		
		3.2. Bifati optiunile:
			- "Creeaza parteneri": daca importul genereaza automat parteneri noi (daca nu exista in baza de date).
			- "Asociaza facturi": daca importul cauta numerele de facturi din detalii si incearca completarea documentului pereche.
		
		3.3 Configurati (daca este cazul) conturi pe anumiti parteneri
		
			Ex: Pentru un virament (incasare) de la FanCourier/Netopia/Emag se poate configura contul 5125. 
			Nota generata va fi 5121 = 5125 (FanCourier/Netopia/Emag), in loc de 5121 = 4111
		
		4. Apasati butonul [Genereaza note]
			Notele generate se verifica in fereastra urmatoare: "Note fara predefinire".
		ENDTEXT 
		
		AMESSAGEBOX(m.lcInfo)
	ENDPROC

	PROCEDURE But_nou1.Click
		Local locauta
		Local lcCont, lcTitlu, llNou, llToateIreg
		lcCont = ''
		lcTitlu = ''
		llToateIreg = .F.
		llNou = .T.
		locauta = caut_parteneri(lcCont, lcTitlu, llToateIreg, llNou)
		
		Select cConfigConturi
		Append Blank
		Replace iban With cConturi.iban, id_part With locauta.id_part, denumire With locauta.denumire, cod_fiscal WITH loCauta.cod_fiscal
		Thisform.grdConfigurareConturi.SetFocus()
		
	ENDPROC

	PROCEDURE But_nou2.Click
		LOCAL lcText, lcValue, lcCaption
		lcCaption = "Explicatie"
		lcValue = ""
		lnLeft = 10
		lnTop = 10
		lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcValue)
		IF EMPTY(m.lcText)
			RETURN
		ENDIF 
		
		SELECT cConfigExplicatii
		LOCATE FOR UPPER(ALLTRIM(NVL(explicatie,''))) == UPPER(ALLTRIM(NVL(m.lcText,'')))
		IF FOUND()
			AMESSAGEBOX('Exista deja o configurare pentru Explicatia: "' + m.lcText + '"!',0+48,_screen.Caption)
		ELSE 
			Select cConfigExplicatii
			Append Blank
			Replace iban With cConturi.iban, explicatie WITH m.lcText
		ENDIF 
		
		Thisform.grdConfigurareExplicatii.SetFocus()
		
	ENDPROC

	PROCEDURE But_sterge1.Click
		Local lcBanca, lcIBAN
		Select cConturi
		lcIBAN = Alltrim(Nvl(iban, ''))
		lcBanca = Alltrim(Nvl(banca, ''))
		If Empty(m.lcIBAN) And Empty(m.lcBanca)
			Return
		Endif
		If AMESSAGEBOX('Doriti sa stergeti configurarea pentru ' + m.lcBanca + ' / ' + m.lcIBAN + '?', 4 + 32, _Screen.Caption) = 6
			Delete From cConfigConturi Where iban = m.lcIBAN
			Delete From cConfigExplicatii Where iban = m.lcIBAN	
			Delete From cExtrase Where eiban = m.lcIBAN
			Delete From cConturi Where iban = m.lcIBAN
		Endif
		Thisform.grdConturi.SetFocus()
		Thisform.Refresh()
	ENDPROC

	PROCEDURE But_sterge2.Click
		SELECT cConfigConturi
		lnIdPart = NVL(id_part,0)
		lcPartener = NVL(denumire,'')
		IF EMPTY(m.lnIdPart)
			RETURN
		ENDIF 
		IF AMESSAGEBOX('Doriti sa stergeti configurarea pentru partenerul ' + m.lcPartener + '?', 4+32, _screen.caption) = 6
			DELETE FROM cConfigConturi WHERE id_part = m.lnIdPart
		ENDIF 
		Thisform.grdConfigurareConturi.SetFocus()
		thisform.Refresh()
	ENDPROC

	PROCEDURE But_sterge3.Click
		SELECT cConfigExplicatii
		lcExplicatie = ALLTRIM(NVL(explicatie, ''))
		IF EMPTY(m.lcExplicatie)
			RETURN
		ENDIF 
		IF AMESSAGEBOX('Doriti sa stergeti configurarea pentru explicatia: ' + m.lcExplicatie+ '?', 4+32, _screen.caption) = 6
			DELETE FROM cConfigExplicatii WHERE ALLTRIM(explicatie) = m.lcExplicatie
		ENDIF 
		Thisform.grdConfigurareExplicatii.SetFocus()
		thisform.Refresh()
	ENDPROC

	PROCEDURE cmdGenereazaNote.Click
		Local llSucces, lnSucces, lnButon, llContafin, lnIdSet
		Local lcCodAMEF, llExistaNote
		Local lcAcont, lcCont, lcIBAN, lnIdPart
		Local llPartNou
		Local lcExplicatie, lcPart, ldData, llComanda, llFactura
		
		
		Local loImport As "ImportNote"
		Local lcAcontBanca, lcClass, lcClassType, lcContBanca, lcFile, lcFileExt, lcFileType, lcParam
		Local llCreeazaNote, llSucces, ldData1, ldData2, lcSelect
		
		lcSelect = SELECT()
		llSucces = .T.
		lnIdSet = 90023
		ldData1 = Thisform.txtData1.Value
		ldData2 = Thisform.txtData2.Value
		ldData = thisform.txtData.Value
		
		USE IN (SELECT('actactan'))
		Thisform.SaveSettings()
		
		IF (m.glLunaInchisa)
			AMESSAGEBOX("Luna contabil este blocata!",0+48,_Screen.Caption)
		ENDIF 
		IF m.llSucces AND (m.glEMama)
			AMESSAGEBOX("Se pot face operatii doar pe sucursala!",0+48,_Screen.Caption)
			llSucces = .F.
		ENDIF 
		If m.llSucces
			Select cConturi
			LOCATE FOR ales = 1 AND Import = 1 AND note = 0
			llSucces = FOUND()
			IF !m.llSucces
				AMESSAGEBOX('Alegeti un cont/decont incarcat pentru care nu s-au generat note!',0+48,_scren.caption)
			ENDIF 
		ENDIF 
		
		IF m.llSucces	
			Select cConturi
			Scan For ales = 1 AND Import = 1 AND note = 0
				lcClass = Alltrim(clasa)
				lcFileExt = Alltrim(extensie)
				lcClassType = Alltrim(tipclasa)
				lcFileType = Alltrim(tip)
				lcContBanca = Alltrim(Cont)
				lcAcontBanca = Alltrim(acont)
				lcFile = Alltrim(fisier)
				lcIBAN = Alltrim(Nvl(iban, ''))
				lcBanca = ALLTRIM(NVL(denumire, ''))
				lnIdPartenerBanca = NVL(id_part, 0)
				llPartNou = part_nou && se creeaza parteneri noi daca nu exista codul fiscal in baza de date
				llFactura = factura
				llComanda = comanda
		
				* Parcurg fisierul si determin IBAN-ul si inregistrarile din extras
				lcParam = Iif(!Empty(m.lcContBanca), "cContBanca=>" + m.lcContBanca, "") + ;
					Iif(!Empty(m.lcAcontBanca), "??cAcontBanca=>" + m.lcAcontBanca, "") + ;
					"??lCreeazaParteneri=>" + TRANSFORM(m.llPartNou) + ;
					"??lFactura=>" + TRANSFORM(m.llFactura) + ;
					"??lComanda=>" + TRANSFORM(m.llComanda) + ;
					Iif(!Empty(m.lcBanca), "??cBanca=>" + m.lcBanca, "") + ;
					Iif(!Empty(m.lnIdPartenerBanca), "??nIdPartenerBanca=>" + ALLTRIM(STR(m.lnIdPartenerBanca)), "")
					
				loImport = Createobject("ImportNote", m.lcFile, m.ldData1, m.ldData2, m.lcClass, m.lcClassType, m.lcFileType, m.lcFileExt, m.lcParam, m.ldData) && oproceduri_import.prg
				llCreeazaNote = .T.
				Wait Window 'Generare note ' + Transform(Recno('cConturi')) + '/' + Transform(Reccount('cConturi')) Nowait
		
				llSucces = loImport.Import(m.llCreeazaNote) && rezulta cursorul cActTemp
				If !m.llSucces
					Exit
				Endif
		
				* Completez cont, acont, parteneri pe explicatiile din din cConfigExplicatii
				Select explicatie, id_part, denumire, Cont, acont From cConfigExplicatii Where iban = m.lcIBAN And !Empty(Nvl(explicatie, '')) Into Cursor cContTemp
				Select cContTemp
				Scan
					lcExplicatie = UPPER(ALLTRIM(explicatie))
					lcCont = ALLTRIM(NVL(Cont, ''))
					lcAcont = ALLTRIM(NVL(acont, ''))
					lnIdPart = id_part
					lcPart = ALLTRIM(NVL(denumire, ''))
					
					IF !EMPTY(NVL(m.lnIdPart, 0))
						Update cActTemp Set id_partd = m.lnIdPart, partd = m.lcPart Where m.lcExplicatie$UPPER(ALLTRIM(explicatia)) AND scc = m.lcContBanca AND EMPTY(NVL(id_partd, 0))
						Update cActTemp Set id_partc = m.lnIdPart, partc = m.lcPart Where m.lcExplicatie$UPPER(ALLTRIM(explicatia)) AND scd = m.lcContBanca AND EMPTY(NVL(id_partc, 0))		
					ENDIF 
					IF !EMPTY(m.lcCont)
						Update cActTemp Set scd = m.lcCont, ascd = m.lcAcont Where m.lcExplicatie$UPPER(ALLTRIM(explicatia)) AND scc = m.lcContBanca
						Update cActTemp Set scc = m.lcCont, ascc = m.lcAcont Where m.lcExplicatie$UPPER(ALLTRIM(explicatia)) AND scd = m.lcContBanca
					ENDIF 	
				Endscan
				Use In (Select('cContTemp'))
				
				* Completez cont, acont pe parteneri din cConfigConturi
				Select id_part, Cont, acont From cConfigConturi Where iban = m.lcIBAN And !Empty(Nvl(Cont, '')) Into Cursor cContTemp
				Select cContTemp
				Scan
					lcCont = Cont
					lcAcont = acont
					lnIdPart = id_part
					Update cActTemp Set scd = m.lcCont, ascd = m.lcAcont Where id_partd = m.lnIdPart
					Update cActTemp Set scc = m.lcCont, ascc = m.lcAcont Where id_partc = m.lnIdPart
				Endscan
				Use In (Select('cContTemp'))
		
				If !Used('actactan')
					Select * From cActTemp Into Cursor actactan Readwrite
				Else
					Select actactan
					Append From Dbf('cActTemp')
				Endif
				Use In (Select('cActTemp'))
				Release loImport
			Endscan
		Endif && llSucces
		
		llSucces = llSucces and USED('actactan')
		
		* verific daca mai exista import 90023
		IF m.llSucces
			llExistaNote = Thisform.VerificaImport()
			If m.llExistaNote
				If AMESSAGEBOX('Atentie! Exista deja note contabile generate dintr-un import anterior [tip operatie 90023]!' + Chr(13) + ;
						'Doriti sa continuati?', 4 + 32, _Screen.Caption) <> 6
					llSucces = .F.
				Endif
			ENDIF
		ENDIF 	
		
		If m.llSucces
			llSucces = Thisform.ModificaNote()
		Endif
		
		If m.llSucces
			UPDATE cConturi SET ales = 0, note = 1, dataora = DATETIME() WHERE ales = 1 AND import = 1 AND note = 0
			Thisform.cmdGenereazaNote.Enabled = .F.
			AMESSAGEBOX('S-au inregistrat notele!', 0 + 64, _Screen.Caption)
		Else
			AMESSAGEBOX('Nu s-au inregistrat notele!', 0 + 64, _Screen.Caption)
		Endif
		
		USE IN (SELECT('actactan'))
		
		Thisform.SaveSettings()
		SELECT (m.lcSelect)
		Return m.llSucces
		 
	ENDPROC

	PROCEDURE cmdImport.Click
		Local loImport As "ImportNote"
		Local lcClass, lcClassType, lcContBanca, lcFile, lcFileExt, lcFileType, lcParam, llCreeazaNote, llCreeazaParteneri
		Local llSucces, lnOptiune, ldData1, ldData2, ldData
		Local lcAcontBanca, lcIBAN, lcValuta
		lcIBAN = ''
		lnOptiune = xmenu('\<Import general (se determina automat tipul de fisier);\-;Extras bancar - MT940;Extras bancar CreditEurope - XML;Extras bancar Unicredit - CSV;\-;Note contabile salvate anterior')
		
		If Empty(m.lnOptiune)
			Return
		Endif
		ldData1 = Thisform.txtData1.Value
		ldData2 = Thisform.txtData2.Value
		ldData = Thisform.txtData.Value
		
		lcClass = "ExtrasBanca"
		lcFileType = ''
		lcContBanca = '5121'
		lcAcontBanca = ''
		Do Case
			Case m.lnOptiune = 1
				lcFileExt = ''
				lcClassType = ''
				lcFileType = ''
				
			Case m.lnOptiune = 3
				lcFileExt = 'TXT'
				lcClassType = 'RAIFFEISEN'
				lcFileType = 'MT940'
		
			Case m.lnOptiune = 4
				lcFileExt = 'XML'
				lcClassType = 'CREDITEUROPE'
			
			Case m.lnOptiune = 5
				lcFileExt = 'CSV'
				lcClassType = 'UNICREDIT'
		
			Case m.lnOptiune = 7		
			SET STEP ON 
				llSucces = Thisform.ModificaNote(.T.)
				RETURN 
		Endcase
		
		lcFile = Getfile(m.lcFileExt, "Fisier", "Selecteaza", 0, "Alege fisierul din care se realizeaza importul")
		If Empty(m.lcFile)
			Return
		Endif
		
		IF m.lnOptiune = 1
			lcFileExt = JUSTEXT(m.lcFile)
			lcClassType = 'GENERAL'
		ENDIF 
		
		* Parcurg fisierul si determin IBAN-ul si inregistrarile din extras
		lcParam = Iif(!Empty(m.lcContBanca), "cContBanca=>" + m.lcContBanca, "") + ;
			Iif(!Empty(m.lcAcontBanca), "??cAcontBanca=>" + m.lcAcontBanca, "")
			
		loImport = Createobject("ImportNote", m.lcFile, m.ldData1, m.ldData2, m.lcClass, m.lcClassType, m.lcFileType, m.lcFileExt, m.lcParam, m.ldData) && oproceduri_import.prg
		llCreeazaNote = .F.
		
		llSucces = loImport.Import(m.llCreeazaNote)
		If m.llSucces
			lcValuta = loImport.oImport.cValuta && RON/EUR/USD/GBP
			lcIBAN = Alltrim(Upper(loImport.oImport.cIBAN)) && contul bancar din extras
			IF EMPTY(m.lcClassType)
				lcClassType = m.lcIBAN
			ENDIF 	
			Select cConturi
			Locate For iban = m.lcIBAN
			If !Found()
				Append Blank
				Replace iban With m.lcIBAN, banca With m.lcClassType, clasa With 'ExtrasBanca', fisier With m.lcFile, extensie With m.lcFileExt, tip With m.lcFileType, tipclasa With m.lcClassType, ;
				Cont With m.lcContBanca, Import With 1, ales WITH 1, note WITH 0, factura WITH .T.
			Else
				Replace banca With m.lcClassType, clasa With 'ExtrasBanca', fisier With m.lcFile, extensie With m.lcFileExt, tipclasa With m.lcClassType, Import With 1, ales WITH 1, note WITH 0
				If Empty(Cont)
					Replace Cont With m.lcContBanca
				Endif
			Endif
		
			DELETE FROM cExtrase WHERE eiban = m.lcIBAN
			
			Select m.lcIBAN As eiban, i.* From c_import_temp i ORDER BY data Into Cursor cExtraseTemp
			Select cExtrase
			Append From Dbf('cExtraseTemp')
			Go Top
			Use In (Select('cExtraseTemp'))
		ELSE 
			IF !EMPTY(loImport.cErrorMessage)
				AMESSAGEBOX(loImport.cErrorMessage,0+48,_screen.Caption)
			ELSE
				AMESSAGEBOX('Eroare la import!',0+48,_screen.Caption)
			ENDIF 	
		ENDIF && llSucces
		
		Thisform.cmdGenereazaNote.Enabled = (Reccount('cExtrase') > 0)
		
		Select cConturi
		
		Thisform.RefreshConfigurari()
		
		Thisform.SaveSettings()
		Select cConturi
		Locate For iban = m.lcIBAN
		If !Found()
			Go Top
		Endif
		Thisform.grdConturi.Refresh()
		
		*Thisform.Refresh
	ENDPROC

	PROCEDURE cmdSterge.Click
		Thisform.Sterge_import()
	ENDPROC

	PROCEDURE grdConfigurareConturi.cAcont.Text1a.DblClick
		LOCAL lcText, lcCaption, lcAlias, lcControlSource
		lcAlias = this.Parent.Parent.RecordSource
		lcControlSource = This.ControlSource
		lcText = alltrim(EVALUATE(m.lcControlSource))
		lcCaption = this.Parent.Header1.Caption
		lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
		SELECT (lcAlias)
		REPLACE &lcControlSource WITH m.lcText
		
	ENDPROC

	PROCEDURE grdConfigurareConturi.cCont.Text1a.DblClick
		LOCAL lcText, lcCaption, lcAlias, lcControlSource
		lcAlias = this.Parent.Parent.RecordSource
		lcControlSource = This.ControlSource
		lcText = alltrim(EVALUATE(m.lcControlSource))
		lcCaption = this.Parent.Header1.Caption
		lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
		SELECT (lcAlias)
		REPLACE &lcControlSource WITH m.lcText
		
	ENDPROC

	PROCEDURE grdConfigurareConturi.Init
		*
	ENDPROC

	PROCEDURE grdConfigurareExplicatii.cAcont.Text1a.DblClick
		LOCAL lcText, lcCaption, lcAlias, lcControlSource
		lcAlias = this.Parent.Parent.RecordSource
		lcControlSource = This.ControlSource
		lcText = alltrim(EVALUATE(m.lcControlSource))
		lcCaption = this.Parent.Header1.Caption
		lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
		SELECT (lcAlias)
		REPLACE &lcControlSource WITH m.lcText
		
	ENDPROC

	PROCEDURE grdConfigurareExplicatii.cCont.Text1a.DblClick
		LOCAL lcText, lcCaption, lcAlias, lcControlSource
		lcAlias = this.Parent.Parent.RecordSource
		lcControlSource = This.ControlSource
		lcText = alltrim(EVALUATE(m.lcControlSource))
		lcCaption = this.Parent.Header1.Caption
		lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
		SELECT (lcAlias)
		REPLACE &lcControlSource WITH m.lcText
		
	ENDPROC

	PROCEDURE grdConfigurareExplicatii.cDenumire.Text1.DblClick
		Local locauta
		Local lcCont, lcTitlu, llNou, llToateIreg
		lcCont = ''
		lcTitlu = ''
		llToateIreg = .F.
		llNou = .T.
		locauta = caut_parteneri(lcCont, lcTitlu, llToateIreg, llNou)
		
		Select cConfigExplicatii
		Replace id_part With locauta.id_part, denumire With locauta.denumire, cod_fiscal WITH loCauta.cod_fiscal
		Thisform.grdConfigurareExplicatii.SetFocus()
		
	ENDPROC

	PROCEDURE grdConfigurareExplicatii.Init
		*
	ENDPROC

	PROCEDURE grdConturi.AfterRowColChange
		LPARAMETERS nColIndex
		
		
		IF INLIST(this.RowColChange, 1, 3)
			Thisform.RefreshConfigurari()
		ENDIF 	
		SELECT cConturi
		
		
	ENDPROC

	PROCEDURE grdConturi.cAcont.Text1.DblClick
		LOCAL lcText, lcCaption, lcAlias, lcControlSource
		lcAlias = this.Parent.Parent.RecordSource
		lcControlSource = This.ControlSource
		lcText = alltrim(EVALUATE(m.lcControlSource))
		lcCaption = this.Parent.Header1.Caption
		lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
		SELECT (lcAlias)
		REPLACE &lcControlSource WITH m.lcText
		
	ENDPROC

	PROCEDURE grdConturi.cCont.Text1.DblClick
		LOCAL lcText, lcCaption, lcAlias, lcControlSource
		lcAlias = this.Parent.Parent.RecordSource
		lcControlSource = This.ControlSource
		lcText = alltrim(EVALUATE(m.lcControlSource))
		lcCaption = this.Parent.Header1.Caption
		lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
		SELECT (lcAlias)
		REPLACE &lcControlSource WITH m.lcText
		
	ENDPROC

	PROCEDURE grdConturi.cDenumire.Text1.DblClick
		Local lcContBanca, lcPartenerBanca, lnIdPartenerBanca, loCauta
		
		lcContBanca = ALLTRIM(NVL(cConturi.cont,''))
		lcContBanca = IIF(!EMPTY(m.lcContBanca), m.lcContBanca, '5121')
		
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Banca??cCont=>] + m.lcContBanca))
		lnIdPartenerBanca = Nvl(loCauta.id_part, 0)
		lcPartenerBanca = Alltrim(m.loCauta.denumire)
		
		If !Empty(m.lnIdPartenerBanca) And AMESSAGEBOX('Doriti sa salvati banca pe acest fisier?',4+32,_Screen.Caption) = 6
			REPLACE denumire WITH m.lcPartenerBanca, id_part WITH m.lnIdPartenerBanca IN cConturi
		Endif
		  
	ENDPROC

	PROCEDURE grdConturi.Init
		*
	ENDPROC

	PROCEDURE grdExtrase.cDocumente.Text1.DblClick
		Local loCauta
		If Thisform.lContafin
			Local lcText, lcCaption, lcAlias, lcControlSource
			lcAlias = This.Parent.Parent.RecordSource
			lcControlSource = This.ControlSource
			lcText = Alltrim(Evaluate(m.lcControlSource))
			lcCaption = This.Parent.Header1.Caption
			lcText = Inputbox(m.lcCaption, m.lcCaption, m.lcText)
			Select (lcAlias)
			Replace &lcControlSource With m.lcText
		Else
			loCauta = caut_sectie()
			If !Empty(Nvl(loCauta.id_sectie, 0))
				Select cAMEF
				Replace id_sectie With loCauta.id_sectie, sectie With loCauta.sectie
			Endif
		Endif
	ENDPROC

	PROCEDURE grdExtrase.cExplicatie.Text1.DblClick
		Local loCauta
		If Thisform.lContafin
			Local lcText, lcCaption, lcAlias, lcControlSource
			lcAlias = This.Parent.Parent.RecordSource
			lcControlSource = This.ControlSource
			lcText = Alltrim(Evaluate(m.lcControlSource))
			lcCaption = This.Parent.Header1.Caption
			lcText = Inputbox(m.lcCaption, m.lcCaption, m.lcText)
			Select (lcAlias)
			Replace &lcControlSource With m.lcText
		Else
			loCauta = caut_venchelt()
			If !Empty(Nvl(loCauta.id_venchelt, 0))
				Select cAMEF
				Replace id_venchelt With loCauta.id_venchelt, dst_chlt With loCauta.explicatie
			Endif
		Endif
	ENDPROC

	PROCEDURE grdExtrase.cIBAN.Text1a.DblClick
		IF thisform.lContafin
			LOCAL lcText, lcCaption, lcAlias, lcControlSource
			lcAlias = this.Parent.Parent.RecordSource
			lcControlSource = This.ControlSource
			lcText = alltrim(EVALUATE(m.lcControlSource))
			lcCaption = this.Parent.Header1.Caption
			lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
			SELECT (lcAlias)
			REPLACE &lcControlSource WITH m.lcText
		ELSE
			LOCAL loCauta
		
			loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Client??lAdaugCorespondente=>1??cTipuriParteneri=>24]))
			SELECT cAMEF
			REPLACE id_banca WITH locauta.id_part, banca WITH locauta.nume
		ENDIF 	
	ENDPROC

	PROCEDURE grdExtrase.cIBAN.Text1a.When
		this.ReadOnly = .F.
	ENDPROC

	PROCEDURE grdExtrase.cSuma.Text1.DblClick
		IF thisform.lContafin
			LOCAL lcText, lcCaption, lcAlias, lcControlSource
			lcAlias = this.Parent.Parent.RecordSource
			lcControlSource = This.ControlSource
			lcText = alltrim(EVALUATE(m.lcControlSource))
			lcCaption = this.Parent.Header1.Caption
			lcText = INPUTBOX(m.lcCaption, m.lcCaption, m.lcText)
			SELECT (lcAlias)
			REPLACE &lcControlSource WITH m.lcText
		ELSE
			LOCAL loCauta
		
			loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Client??lAdaugCorespondente=>1??cTipuriParteneri=>22]))
			SELECT cAMEF
			REPLACE id_casac WITH locauta.id_part, casac WITH locauta.nume
		ENDIF 	
		
	ENDPROC

	PROCEDURE grdExtrase.Init
		*
	ENDPROC

	PROCEDURE txtData.Valid
		Local ldData, ldData1, ldData2
		
		ldData = Nvl(This.Value, {})
		ldData1 = Date(m.gnAn, m.gnLuna, 1)
		ldData2 = Gomonth(m.ldData1, 1) - 1
		
		If !Empty(m.ldData)
			If !Between(m.ldData, m.ldData1, m.ldData2)
				ldData = m.ldData1
				AMESSAGEBOX('Data trebuie sa fie din luna curenta!',0+48,_Screen.Caption)
				Return .F.
			Else
				AMESSAGEBOX('Atentie!' + Chr(13) + Chr(10) + ;
					'Se importa toate inregistrarile din fisier, cu ' + Dtoc(m.ldData) + ', indiferent de perioada de import si de data inregistrarilor din fisier.'+ Chr(13) + Chr(10) + ;
					'Se foloseste la importul deconturilor de la curieri, pentru o anumita data.',0+48,_Screen.Caption)
			Endif
		Endif
		
		
		
	ENDPROC

	PROCEDURE txtExtras.DblClick
		Thisform.cauta_fdoc('extras')
	ENDPROC

	PROCEDURE txtOP.DblClick
		Thisform.cauta_fdoc('op')
	ENDPROC

ENDDEFINE
