*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="penalitati.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS frm_penalitati AS _frmbase OF "..\comun\clase\_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="grdPenalitati" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cDataFact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cDataFact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNrFact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNrFact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cTotctva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cTotctva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cDataScad.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cDataScad.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cDataDoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cDataDoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNrDoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNrDoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cSuma.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cSuma.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNrZile.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNrZile.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cPenalitati.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cPenalitati.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cPpenzi.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cPpenzi.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cContract.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cContract.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cExplicatia.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.cExplicatia.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.Column16.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPenalitati.Column16.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboContracte" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboClienti" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ckNrFact" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ckDataFact" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtTotalPen" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblTotal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ckExplicatia" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblClienti" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: afisactual
		*m: calculeaza_totaluri
		*p: ccontractfiltru
		*p: cexplicatiafiltru
		*p: cnumefiltru
		*p: ddatareferinta		&& Data de referinta pentru calculul zilelor de penalitati pentru evaluare,
		*p: levaluare		&& Daca se evalueaza penalitatile fata de o data de referinta.
		*p: nnrzile		&& numarul de zile penalitati din linia curenta
		*p: npenalitati
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		ccontractfiltru = 
		cexplicatiafiltru = 
		cnumefiltru = 
		ddatareferinta = {}
		DoCreate = .T.
		Height = 483
		levaluare = .F.
		Name = "frm_penalitati"
		nnrzile = 0
		npenalitati = 0
		Width = 787
		WindowState = 2
		_memberdata = <VFPData>
			<memberdata name="levaluare" type="property" display="lEvaluare"/>
			<memberdata name="ddatareferinta" type="property" display="dDataReferinta"/>
		</VFPData>
		_SHAPE1.Anchor = 10
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 816
		_shape2.Anchor = 8
		_shape2.Left = 744
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		LB_TITLU_ALB_B121.Caption = "Penalitati"
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 12
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 756
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 11
		BUT_TERMIN1.Top = 0
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_label1' AS _label WITH ;
		BackStyle = 0, ;
		Caption = "Contracte", ;
		Left = 312, ;
		Name = "_label1", ;
		Top = 32
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 9, ;
		Left = 696, ;
		Name = "But_excel1", ;
		Picture = ..\comun\grafice\excel_sus.bmp, ;
		TabIndex = 9, ;
		Top = 0, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Left = 726, ;
		Name = "But_listare1", ;
		TabIndex = 10, ;
		Top = 0, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'cboClienti' AS combobox WITH ;
		FontName = "Arial", ;
		Format = "", ;
		Height = 24, ;
		Left = 12, ;
		Name = "cboClienti", ;
		RowSource = "cClientiTemp", ;
		RowSourceType = 2, ;
		Style = 2, ;
		TabIndex = 1, ;
		Top = 48, ;
		Width = 289, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'cboContracte' AS combobox WITH ;
		FontName = "Arial", ;
		Format = "", ;
		Height = 24, ;
		Left = 312, ;
		Name = "cboContracte", ;
		RowSource = "", ;
		RowSourceType = 2, ;
		Style = 2, ;
		TabIndex = 2, ;
		Top = 48, ;
		Width = 205, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'ckDataFact' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Data factura", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 96, ;
		Name = "ckDataFact", ;
		TabIndex = 4, ;
		Top = 74, ;
		Width = 88
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'ckExplicatia' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Explicatia", ;
		Comment = "*:OnResize=RT", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 195, ;
		Name = "ckExplicatia", ;
		TabIndex = 5, ;
		Top = 75, ;
		Visible = .T., ;
		Width = 73
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'ckNrFact' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Nr. factura", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 12, ;
		Name = "ckNrFact", ;
		TabIndex = 3, ;
		Top = 74, ;
		Width = 78
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Anchor = 9, ;
		Caption = "\<Factureaza", ;
		Left = 693, ;
		Name = "Cmd_executa1", ;
		TabIndex = 6, ;
		Top = 39
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdPenalitati' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 16, ;
		Comment = "*:OnResize=ss", ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		HeaderHeight = 38, ;
		Height = 348, ;
		HighlightBackColor = 92,107,150, ;
		HighlightForeColor = 255,255,255, ;
		HighlightStyle = 2, ;
		Left = 12, ;
		Name = "grdPenalitati", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .F., ;
		RecordSource = "CFIord", ;
		TabIndex = 7, ;
		Top = 96, ;
		Width = 766, ;
		Column1.ColumnOrder = 5, ;
		Column1.ControlSource = "dataFact", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cDataFact", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 54, ;
		Column2.ColumnOrder = 4, ;
		Column2.ControlSource = "nrFact", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "cNrFact", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 51, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "VALCTVA", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.InputMask = (get_mask(12,gnZ)), ;
		Column3.Name = "cTotctva", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 69, ;
		Column4.ColumnOrder = 9, ;
		Column4.ControlSource = "dataScad", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "cDataScad", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 50, ;
		Column5.ColumnOrder = 10, ;
		Column5.ControlSource = "dataact", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "cDataDoc", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 53, ;
		Column6.ColumnOrder = 11, ;
		Column6.ControlSource = "nract", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "cNrDoc", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 57, ;
		Column7.ColumnOrder = 12, ;
		Column7.ControlSource = "suma", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Format = "", ;
		Column7.InputMask = (get_mask(12,gnZ)), ;
		Column7.Name = "cSuma", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 67, ;
		Column8.ColumnOrder = 14, ;
		Column8.ControlSource = "nr_zile", ;
		Column8.DynamicBackColor = "RGB(200,250,220)", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Name = "cNrZile", ;
		Column8.ReadOnly = .F., ;
		Column8.Sparse = .F., ;
		Column8.Width = 49, ;
		Column9.ColumnOrder = 16, ;
		Column9.ControlSource = "penalitati", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.InputMask = (get_mask(12,gnZ)), ;
		Column9.Name = "cPenalitati", ;
		Column9.ReadOnly = .T., ;
		Column10.ColumnOrder = 1, ;
		Column10.ControlSource = "nume", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.Name = "cNume", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 135, ;
		Column11.ColumnOrder = 15, ;
		Column11.ControlSource = "ppenzi", ;
		Column11.FontName = "Arial Narrow", ;
		Column11.InputMask = "99.99", ;
		Column11.Name = "cPpenzi", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 58, ;
		Column12.ColumnOrder = 2, ;
		Column12.ControlSource = "contract", ;
		Column12.FontName = "Arial Narrow", ;
		Column12.Name = "cContract", ;
		Column12.ReadOnly = .T., ;
		Column13.ColumnOrder = 3, ;
		Column13.ControlSource = "explicatia", ;
		Column13.FontName = "Arial Narrow", ;
		Column13.Name = "cExplicatia", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 105, ;
		Column14.ColumnOrder = 7, ;
		Column14.ControlSource = "totval", ;
		Column14.FontName = "Arial Narrow", ;
		Column14.Format = "R", ;
		Column14.InputMask = (get_mask(12,gnZ)), ;
		Column14.Name = "Column14", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 67, ;
		Column15.ColumnOrder = 8, ;
		Column15.ControlSource = "valuta", ;
		Column15.FontName = "Arial Narrow", ;
		Column15.Name = "Column15", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 35, ;
		Column16.ColumnOrder = 13, ;
		Column16.ControlSource = "sumaval", ;
		Column16.FontName = "Arial Narrow", ;
		Column16.Format = "R", ;
		Column16.InputMask = (get_mask(12,gnZ)), ;
		Column16.Name = "Column16", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 69
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdPenalitati.cContract.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Contract", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cDataDoc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data incasare", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cDataFact.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data factura", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cDataScad.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data scadenta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cExplicatia.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatia", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cNrDoc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. doc. incasare", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cNrFact.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. factura", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cNrZile.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. zile penalitati", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cNume.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Client", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare factura in valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.Column15.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.Column16.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare incasare in valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPenalitati.Column16.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 'grdPenalitati.cPenalitati.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare penalitati", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cPpenzi.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent penalitati / zi", ;
		FontBold = .F., ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cSuma.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare incasare", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdPenalitati.cTotctva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare factura", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'lblClienti' AS _label WITH ;
		BackStyle = 0, ;
		Caption = "Clienti", ;
		Left = 12, ;
		Name = "lblClienti", ;
		Top = 32
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblTotal' AS _lbbase WITH ;
		Anchor = 12, ;
		Caption = "TOTAL", ;
		FontBold = .T., ;
		Left = 604, ;
		Name = "lblTotal", ;
		TabIndex = 14, ;
		Top = 456
		*< END OBJECT: ClassLib="..\comun\clase\_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'txtTotalPen' AS _txbase WITH ;
		Anchor = 12, ;
		ControlSource = "thisform.nPenalitati", ;
		Height = 23, ;
		Left = 648, ;
		Name = "txtTotalPen", ;
		TabIndex = 13, ;
		Top = 453, ;
		Width = 132
		*< END OBJECT: ClassLib="..\comun\clase\_tx_base.vcx" BaseClass="textbox" />
	
	PROCEDURE afisactual
		Local lcCond, lcContract, lcNume, lcTabel
		lcCond=""
		
		
		If This.ckdataFact.Value=1
			lcCond=lcCond+[ and data1<=dataFact]
			lcCond=lcCond+[ and data2>=dataFact]
		Endif
		
		If This.cknrFact.Value=1
			lcCond=lcCond+[ and nr1<=nrFact]
			lcCond=lcCond+[ and nr2>=nrFact]
		Endif
		
		lcNume = Alltrim(This.cboClienti.Value)
		If m.lcNume <> '<TOTI>' and !Empty(m.lcNume)
			pcNumefiltru = m.lcNume
		*!*		lcCond = lcCond + [ AND Alltrim(nume) = "] + m.lcNume + ["]
			lcCond = lcCond + [ AND Alltrim(nume) = m.pcNumefiltru]
		Endif
		
		lcContract = Alltrim(This.cboContracte.Value)
		If m.lcContract <> '<TOATE>' and !Empty(m.lcContract)
			pcContractfiltru = m.lcContract
		*!*		lcCond = lcCond + [ AND Alltrim(contract) = "] + m.lcContract + ["]
			lcCond = lcCond + [ AND Alltrim(contract) = m.pcContractfiltru]
		Endif
		
		if thisform.ckExplicatia.value=1
			lcCond = lcCond + [ and "]+UPPE(ALLT(M.EXPLICATIA))+["]+[$UPPE(ALLT(EXPLICATIA))]
		EndIf
		
		If !Empty(lcCond)
			lcCond=Substr(lcCond,6)
		Else
			lcCond=".t."
		Endif
		
		lcTabel=Thisform.GRDPenalitati.RecordSource
		Select (lcTabel)
		Set Filter To &lcCond
		this.calculeaza_totaluri()
		*!* ACTUALIZARE CBOCONTRACTE
		Thisform.LockScreen = .T.
		
		
		Thisform.cboContracte.RowSource = ""
		Create Cursor cContracteTemp (contract c(100))
		Insert Into cContracteTemp (contract) Values ('<TOATE>')
		Select Distinct contract From cFiord WHERE &lcCond Into Cursor cContracteTemp1
		If _Tally <> 0
			Select cContracteTemp
			Append From Dbf('cContracteTemp1')
		Endif
		Thisform.cboContracte.RowSource = "cContracteTemp"
		SELECT cContracteTemp
		If !Empty(m.lcContract)
			Locate for Alltrim(contract) = Alltrim(m.lcContract)
		Else 
			GO TOP 
		EndIf 
		
		Thisform.cboContracte.Value = cContracteTemp.contract
		
		
		Use In (Select('cContracteTemp1'))
		Thisform.LockScreen = .F.
		
		*!* ACTUALIZARE CBOCONTRACTE ^
		
		Thisform.GRDPenalitati.SetFocus
		
	ENDPROC

	PROCEDURE calculeaza_totaluri
		Local lnRecno, lcSelect
		lcSelect = Select()
		Select cFiord
		lnRecno = Recno()
		Calculate Sum(penalitati) To Thisform.nPenalitati
		Thisform.txtTotalPen.Refresh
		
		If m.lnRecno > 0 AND RECCOUNT('cFiord') >= m.lnRecno
			Goto m.lnRecno
		Else
			Go Top
		Endif
		
		Select (lcSelect)
		
	ENDPROC

	PROCEDURE do_excel
		Do export_excel_grid with this.grdPenalitati
	ENDPROC

	PROCEDURE do_executa
		*!* 14.03.2011
		*!* marius.mutu
		*!* loDateAditionale.contracte - c/val penalitati conform contractelor 1,2..
		
		Local lcContracte, lcFiltru
		
		Select cFiord
		Locate for !Empty(nume)
		If !Found()
			Return
		EndIf 
		
		If Alltrim(this.cboClienti.Value) = '<TOTI>'
			aMessageBox('Alegeti un client pentru facturare!',0+48,'Penalitati')
			Return
		EndIf 
			
		Local loDateAditionale
		loDateAditionale = CreateObject("session")
		loDateAditionale.addproperty("valftva", thisform.npenalitati)
		loDateAditionale.addproperty("valtva", 0)
		loDateAditionale.addproperty("valctva", thisform.npenalitati)
		
		*!* 14.03.2011
		lcContracte = ""
		lcFiltru = FILTER('cFiord')
		IF EMPTY(lcFiltru)
			lcFiltru = '.T.'
		ENDIF 
		SELECT distinct contract FROM cFiord WHERE &lcFiltru INTO CURSOR cContracteTempx ORDER BY contract
		SELECT cContracteTempx
		SCAN 
			lcContracte = m.lcContracte + ',' + ALLTRIM(contract)
		ENDSCAN 
		IF !EMPTY(m.lcContracte)
			lcContracte = SUBSTR(m.lcContracte,2)
		ENDIF 
		loDateAditionale.addproperty("contracte", m.lcContracte)
		USE IN (SELECT('cContracteTempx'))
		*!* 14.03.2011 ^
		
		THIS.AlwaysOnBottom = .T.
		THIS.AlwaysOnTop = .F.
		Do modi_factura with cFiord.ctr_id, 6, loDateAditionale in proceduri_acnpro.prg
		THIS.AlwaysOnTop = .T.
		THIS.AlwaysOnBottom = .F. 
	ENDPROC

	PROCEDURE do_listare
		THIS.AlwaysOnBottom = .T.
		THIS.AlwaysOnTop = .F.
		Private pcTitlu, FSERVICIU
		pcTitlu = 'Situatia calculului penalitatilor de intarziere'
		FSERVICIU = FSERVICIU6
		IF !this.lEvaluare 
			Do LISTAREUSERREPORT with "cfiord", "FRX", "PENALITATI"
		ELSE 
			Do LISTAREUSERREPORT with "cfiord", "FRX", "PENALITATI_EVALUARE"
		ENDIF 	
		THIS.AlwaysOnBottom = .F.
		THIS.AlwaysOnTop = .T.
	ENDPROC

	PROCEDURE do_sterge
		If !Empty(cFiord.nume)
			If aMessageBox('Doriti sa stergeti inregistrarea?',4+32,'Penalitati') = 6
				If aMessageBox('Stergeti definitiv?' + Chr(13) + Chr(10) + 'Atentie nu se poate reveni asupra inregistrarilor sterse definitiv!',4+32,'Penalitati') = 6
					Insert Into penalitati_sters (nume, fact_id, clie_id, ctr_id, nrfact, datafact, valctva, nract, dataact, suma, dataora, utilizator) ;
						values (cFiord.nume, cFiord.fact_id, cFiord.clie_id, cFiord.ctr_id, cFiord.nrfact, cFiord.datafact, cFiord.valctva, cFiord.nract, cFiord.dataact, cFiord.suma, Datetime(), utilizator)
				Endif
				Select cFiord
				Delete
				this.calculeaza_totaluri()
				This.grdPenalitati.Refresh()
				This.grdPenalitati.SetFocus()
			Endif
		Endif
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		THIS.WindowState = 2
		this.afisactual()
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		THIS.WindowState = 2
	ENDPROC

	PROCEDURE cboClienti.Init
		LOCAL lcTabel, lcNume 
		lcTabel = this.RowSource 
		SELECT (lcTabel)
		GO TOP 
		lcNume = nume
		this.Value = lcNume
		
		
	ENDPROC

	PROCEDURE cboClienti.Valid
		thisform.afisactual()
	ENDPROC

	PROCEDURE cboContracte.Valid
		thisform.afisactual()
	ENDPROC

	PROCEDURE ckDataFact.Click
		data1=date()
		data2=date()
		IF this.value=1
			Ointre=CREATEOBJECT("CAUTintre")
			WITH Ointre
				.CAPTION="Data factura"
				.label1.caption="Data initiala:"
				.label2.caption="Data finala:"
				.text1.controlsource="data1"
				.text2.controlsource="data2"
			endwith
			ointre.show(1)
		endif
	ENDPROC

	PROCEDURE ckDataFact.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE ckExplicatia.Click
		m.explicatia=''
		If This.Value = 1
			OLIT=Createobject("CAUTLITERE")
			With OLIT
				.Caption="Explicatia"
				.text1.ControlSource="m.explicatia"
			Endwith
			OLIT.Show(1)
		Endif
		
	ENDPROC

	PROCEDURE ckExplicatia.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE ckNrFact.Click
		nr1=0
		nr2=0
		IF this.value=1
			Ointre=CREATEOBJECT("CAUTintre")
			WITH Ointre
				.CAPTION="Numar factura"
				.label1.caption="Nr initial:"
				.label2.caption="Nr final:"
				.text1.controlsource="nr1"
				.text2.controlsource="nr2"
			endwith
			ointre.show(1)
		endif
		
	ENDPROC

	PROCEDURE ckNrFact.Valid
		thisform.afisactual
	ENDPROC

	PROCEDURE grdPenalitati.AfterRowColChange
		LPARAMETERS nColIndex
		* NU STERGE
	ENDPROC

	PROCEDURE grdPenalitati.cNrZile.Text1.Valid
		Local lnNrZile
		lnNrZile = cFiord.nr_zile
		If Thisform.nNrZile <> lnNrZile
			Replace penalitati With Round(Round(ppenzi/100*SUMA, gnZ) * lnNrZile, gnZ)
			thisform.calculeaza_totaluri()
		Endif
		
	ENDPROC

	PROCEDURE grdPenalitati.cNrZile.Text1.When
		Thisform.nNrZile = cFiord.nr_zile
	ENDPROC

	PROCEDURE grdPenalitati.Init
		* NU STERGE
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtData" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: ddatareferinta
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		ddatareferinta = {}
		DoCreate = .T.
		Height = 83
		Name = "frm_penalitati_info"
		Width = 225
		_memberdata = <VFPData>
			<memberdata name="ddatareferinta" type="property" display="dDataReferinta"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 395
		Lb_titlu_alb_b121.Caption = "PENALITATI"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 14
		BUT_TERMIN1.Left = 196
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 12
		BUT_TERMIN1.Top = 1
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 166, ;
		Name = "But_renunt1", ;
		TabIndex = 13, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Data de referinta", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 9, ;
		Name = "Label3", ;
		TabIndex = 17, ;
		Top = 49, ;
		Width = 97
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'txtData' AS textbox WITH ;
		ControlSource = "pdDataReferinta", ;
		Format = "k!", ;
		Height = 23, ;
		Left = 112, ;
		Name = "txtData", ;
		TabIndex = 2, ;
		Top = 44, ;
		Width = 100
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE Init
		LPARAMETERS tdDataReferinta
		DODEFAULT()
		
		this.dDataReferinta = IIF(!EMPTY(tdDataReferinta), tdDataReferinta, DATE())
	ENDPROC

ENDDEFINE
