*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="odevize.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS frm_adaug_man 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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_shape4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="LB_SIMPLU1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdmecanici" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdmecanici.cMecanic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdmecanici.cMecanic._cbbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cMarca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cMarca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cAnsamblu.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cAnsamblu.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cDenop.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cDenop.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cTimpn.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cTimpn.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cSelectat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cSelectat.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cCodop.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cCodop.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_marca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_ansamblu" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_denop" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_selectat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_adauga1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Autoresize1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_modifica1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_adaugarep
		*m: do_adauga_norme
		*p: nid_sectie
		*p: nordine
		*p: npret
		*p: n_idpret
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = grdnorme
		DoCreate = .T.
		Height = 444
		lactiv4 = .T.
		Name = "frm_adaug_man"
		nid_sectie = 0
		nordine = 0
		npret = 0
		n_idpret = 0
		Width = 695
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = -1
		_shape1.Name = "_shape1"
		_shape1.Tag = "W"
		_shape1.Top = 0
		_shape1.Width = 696
		_shape1.ZOrderSet = 0
		_shape2.Height = 29
		_shape2.Left = 631
		_shape2.Name = "_shape2"
		_shape2.Tag = "L"
		_shape2.Top = 0
		_shape2.Width = 64
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Caption = "MODIFICARE COMANDĂ NR:"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 14
		Lb_titlu_alb_b121.ZOrderSet = 2
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.AutoSize = .F.
		BUT_TERMIN1.Left = 664
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 12
		BUT_TERMIN1.Tag = "L"
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.ZOrderSet = 3
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_shape3' AS _shape WITH ;
		BackStyle = 0, ;
		Height = 214, ;
		Left = 317, ;
		Name = "_shape3", ;
		SpecialEffect = 0, ;
		Top = 36, ;
		Width = 306, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT '_shape4' AS _shape WITH ;
		BackStyle = 0, ;
		Height = 214, ;
		Left = 13, ;
		Name = "_shape4", ;
		SpecialEffect = 0, ;
		Top = 36, ;
		Width = 306, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Autoresize1' AS autoresize WITH ;
		Left = 633, ;
		Name = "Autoresize1", ;
		TabIndex = 26, ;
		Top = 208
		*< END OBJECT: ClassLib="..\comun\clase\autoresize.vcx" BaseClass="container" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		BackColor = 212,208,200, ;
		Left = 589, ;
		Name = "But_nou1", ;
		TabIndex = 15, ;
		Top = 125, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		Left = 634, ;
		Name = "But_renunt1", ;
		TabIndex = 13, ;
		Tag = "L", ;
		Top = 0, ;
		ZOrderSet = 4
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		BackColor = 212,208,200, ;
		Left = 589, ;
		Name = "But_sterge1", ;
		TabIndex = 16, ;
		Top = 154, ;
		Visible = .T., ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Left = 324, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 61, ;
		ZOrderSet = 16, ;
		_CBBASE1.ControlSource = "ooper.sectie", ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "v_sectie.sectie", ;
		_CBBASE1.RowSourceType = 2, ;
		_LBBASE1.Caption = "Atelier:", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu2' AS cb_tx_simplu WITH ;
		Left = 324, ;
		Name = "Cb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 89, ;
		ZOrderSet = 17, ;
		_CBBASE1.ColumnCount = 2, ;
		_CBBASE1.ControlSource = "ooper.pret", ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "v_preturi.pret,asigurator", ;
		_CBBASE1.RowSourceType = 2, ;
		_LBBASE1.Caption = "Preț / Oră", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ck_ansamblu' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = ansamblu, ;
		Caption = "Ansamblu", ;
		Left = 17, ;
		Name = "Ck_ansamblu", ;
		TabIndex = 5, ;
		Top = 290, ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_denop' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = denop, ;
		Caption = "Denumire", ;
		Left = 376, ;
		Name = "Ck_denop", ;
		TabIndex = 19, ;
		TabStop = .F., ;
		Top = 290, ;
		Visible = .F., ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_marca' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = marca, ;
		Caption = "Marca mașinii", ;
		Left = 107, ;
		Name = "Ck_marca", ;
		TabIndex = 6, ;
		Top = 290, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_selectat' AS ck_simplu WITH ;
		Alignment = 0, ;
		Caption = "Înregistrările selectate", ;
		Left = 218, ;
		Name = "Ck_selectat", ;
		TabIndex = 7, ;
		Top = 290, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 17, ;
		TabStop = .F., ;
		Top = 61, ;
		ZOrderSet = 8, ;
		TEXT_SIMPLU1.ControlSource = "ocomanda.nume", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		LB_SIMPLU1.Caption = "Client:", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 18, ;
		TabStop = .F., ;
		Top = 89, ;
		ZOrderSet = 9, ;
		TEXT_SIMPLU1.ControlSource = "ocomanda.asigurator", ;
		TEXT_SIMPLU1.Left = 101, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		TEXT_SIMPLU1.Top = 2, ;
		LB_SIMPLU1.Caption = "Asigurator:", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 20, ;
		TabStop = .F., ;
		Top = 117, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.ControlSource = "ocomanda.NRORD", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		LB_SIMPLU1.Caption = "Nr. comandă", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu4' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_simplu4", ;
		TabIndex = 21, ;
		TabStop = .F., ;
		Top = 145, ;
		ZOrderSet = 11, ;
		TEXT_SIMPLU1.ControlSource = "ocomanda.Nrinmat", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		LB_SIMPLU1.Caption = "Nr. înmatriculare", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_simplu5", ;
		TabIndex = 22, ;
		TabStop = .F., ;
		Top = 173, ;
		ZOrderSet = 12, ;
		TEXT_SIMPLU1.ControlSource = "ocomanda.marca", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		LB_SIMPLU1.Caption = "Marcă mașină", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu6' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_simplu6", ;
		TabIndex = 23, ;
		TabStop = .F., ;
		Top = 201, ;
		ZOrderSet = 13, ;
		TEXT_SIMPLU1.ControlSource = "ocomanda.masina", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		LB_SIMPLU1.Caption = "Model", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu7' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Clb_tx_simplu7", ;
		TabIndex = 4, ;
		Top = 259, ;
		Width = 314, ;
		TEXT_SIMPLU1.Left = 123, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 3, ;
		LB_SIMPLU1.Caption = "Adăugare/ Căutare", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cmd_adauga1' AS cmd_adauga WITH ;
		Anchor = 0, ;
		caction = do_adauga_norme, ;
		Left = 515, ;
		Name = "Cmd_adauga1", ;
		TabIndex = 10, ;
		Top = 259, ;
		ZOrderSet = 28
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 0, ;
		Left = 343, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 8, ;
		Top = 259, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_modifica1' AS cmd_modifica WITH ;
		Anchor = 0, ;
		Caption = "\<Modifică", ;
		Left = 600, ;
		Name = "Cmd_modifica1", ;
		TabIndex = 27, ;
		Top = 259
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 0, ;
		Left = 429, ;
		Name = "Cmd_reset1", ;
		TabIndex = 9, ;
		Top = 259, ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdmecanici' AS _grdrow WITH ;
		ColumnCount = 1, ;
		DeleteMark = .F., ;
		Height = 118, ;
		Left = 323, ;
		Name = "grdmecanici", ;
		Panel = 1, ;
		RecordSource = "crsmecanici", ;
		RowHeight = 27, ;
		TabIndex = 3, ;
		Top = 126, ;
		Width = 264, ;
		ZOrderSet = 18, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cMecanic", ;
		Column1.Sparse = .F., ;
		Column1.Width = 231
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdmecanici.cMecanic._cbbase1' AS _cbbase WITH ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 35, ;
		Name = "_cbbase1", ;
		RowSource = "v_mecanici.nume,id_mecanic", ;
		RowSourceType = 6, ;
		Top = 27
		*< END OBJECT: ClassLib="..\comun\clase\_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'grdmecanici.cMecanic.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Mecanic", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdnorme' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 127, ;
		Left = 12, ;
		Name = "grdnorme", ;
		Panel = 1, ;
		RecordSource = "v_norme", ;
		RowHeight = 19, ;
		TabIndex = 11, ;
		Tag = "WH", ;
		Top = 312, ;
		Width = 672, ;
		ZOrderSet = 21, ;
		Column1.ControlSource = "marca", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cMarca", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 85, ;
		Column2.ControlSource = "ansamblu", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cAnsamblu", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 112, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "denop", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDenop", ;
		Column3.ReadOnly = .T., ;
		Column3.Tag = "W", ;
		Column3.Width = 320, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "timpn", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.InputMask = "999.999", ;
		Column4.Name = "cTimpn", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 76, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "ales", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cSelectat", ;
		Column5.ReadOnly = .F., ;
		Column5.Sparse = .F., ;
		Column5.Width = 54, ;
		Column6.ColumnOrder = 3, ;
		Column6.ControlSource = "codop", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cCodop", ;
		Column6.ReadOnly = .T.
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'grdnorme.cDenop.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire operatie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdnorme.cMarca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Marca masinii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdnorme.cTimpn.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Timp normat", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'LB_SIMPLU1' AS lb_simplu WITH ;
		Caption = "Date client:", ;
		Left = 18, ;
		Name = "LB_SIMPLU1", ;
		TabIndex = 24, ;
		Top = 41, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'Lb_simplu2' AS lb_simplu WITH ;
		Caption = "Date Service:", ;
		Left = 324, ;
		Name = "Lb_simplu2", ;
		TabIndex = 25, ;
		Top = 41, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid2
		Lparameters tcFiltru,tcFiltru2
		Local lcFiltru,lcFiltru2
		
		lcFiltru=tcFiltru
		If Empty(lcFiltru)
			lcFiltru=''
		Endif
		lcFiltru2=tcFiltru2
		If Empty(lcFiltru2)
			lcFiltru2=''
		Endif
		
		With Thisform
			Select v_norme
			Go Top
			Select * From v_norme Where ales!=0 Into Cursor crsalese
			save_grid_tag(.grdnorme)
			If !Empty(lcFiltru2)
				Select * From crsalese Into Cursor crstoate
			Else
				=update_norme(lcFiltru)
				Select * From crsalese ;
					Union ;
					Select * From v_norme Where id_norme Not In (Select id_norme From crsalese) Into Cursor crstoate
			Endif
			If Used('v_norme')
				Use In v_norme
			Endif
			Select * From crstoate Order By ales Desc,ordine,denop Asc,masina Asc Into Cursor v_norme Readwrite
			Use In crstoate
			Go Top
			restore_grid_tag(.grdnorme)
			.grdnorme.ctimpn.SetFocus()
		Endwith
		
		
		*!*	LPARAMETERS pcFiltru
		*!*	LOCAL lcFiltru
		*!*	lcFiltru=pcFiltru
		*!*	IF EMPTY(lcFiltru)
		*!*		lcFiltru=ponorme.ca_baza1.cfiltru
		*!*	ENDIF
		*!*	save_grid_tag(thisform.gnorme)
		*!*	ponorme.ca_baza1.cfiltru=lcFiltru
		*!*	ponorme.ca_baza1.afisare()
		*!*	restore_grid_tag(thisform.gnorme)
		*!*	*!*	IF RECCOUNT('v_delegati')>0
		*!*		thisform.gnorme.SetFocus()
		*!*	*!*	ELSE
		*!*	*!*		thisform.lb_delegati.SetFocus()
		*!*	*!*	ENDIF
	ENDPROC

	PROCEDURE do_adauga
		*!*	If Thisform._pageframe1.ActivePage=1
		*!*		WAIT WINDOW 'aaaa'
			Private pnIesire,pcselect,pcfiltru,pcorder,pnid_mecanic,pcnume
			Store "" To oCautare
			pnIesire=0
			pnid_mecanic=0
		
			pcselect=['select id_mecanic,nume||CHR(32)||prenume as nume,sectie from ] + gcS + [.auto_vmecanici where inactiv=0']
			pcfiltru = [inactiv=0]
			pcordine = [nume]
			oCautare=cauta_alfa(pcselect,pcfiltru,[''],pcordine,'nume,sectie','Alegeti mecanicul','Mecanic,Sectie')
			pnid_mecanic=oCautare.id_mecanic
			pcnume=oCautare.nume
			If pnIesire != 1 Or Empty(pnid_mecanic)
				Return
			Endif
		
			save_grid_tag(Thisform.grdmecanici)
			Insert Into crsmecanici(id_crs,id_mecanic,nume) Values(Reccount('crsmecanici')+1,pnid_mecanic,pcnume)
			restore_grid_tag(Thisform.grdmecanici)
			Select crsmecanici
			Go Top
			Thisform.grdmecanici.Refresh
			Release oCautare
		*!*	Endif
		
	ENDPROC

	PROCEDURE do_adaugarep
		Local lcFiltru, lcExecuteString, lcDenop, lcAlias, lnNealese, lnNrIreg
		Store '' To lcFiltru,lcExecuteString,lcDenop
		lcFiltru=[2=2]
		lcExecuteString =  "thisform.clb_tx_simplu7.tEXT_SIMPLU1"
		With &lcExecuteString
			lcDenop=Strtran(Alltrim(Upper(.Value)),['],[''])
			If !Empty(lcDenop)
				lcFiltru = lcFiltru + [ and denop like '%] + lcDenop + [%']
			Else
				Return
			Endif
		Endwith
		Thisform.actualizeaza_grid2(lcFiltru)
		
		Store 0 To lnNrIreg
		Select v_norme
		Count For Like('*'+lcDenop+'*',denop) To lnNrIreg
		If lnNrIreg = 0
			If AMessagebox('Valoarea introdusa nu exista! O adaugam?',4+32,"Adaugare norma") # 6
				Return
			Endif
		*!*	modificare	v 2.0.9
		*!*		lcSql = [INSERT INTO ] + gcS + [.dev_nom_norme (id_masina,id_ansamblu,denop,codop,timpn,inactiv) VALUES (]+;
		*!*		[0,0,'] + Alltrim(Thisform.clb_tx_simplu7.tEXT_SIMPLU1.Value) + [',0,0,0)]
			lcSql = [begin pack_auto.adauga_norma(null,null,'] + lcDenop + [',null,0,0,?gnIdUtil); end;]
		*!*	modificare	v 2.0.9	^
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
		*!*			Sqlrollback(gnHandle)
		*!*			SQLSETPROP(gnHandle,"Transactions",1)
				AMessagebox(goExecutor.cEroare,0+16,'Eroare')
				Return
			Endif
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
		
		lcAlias = Thisform.grdnorme.RecordSource
		Select (lcAlias)
		Calculate Cnt() For ales=0 To lnNealese
		Go Top
		If lnNealese=1
			*!*	modificare	v 2.0.13
			*!*	Replace All ales With 1
			Thisform.nordine = Thisform.nordine+1
			Replace ales With 1,ordine With Thisform.nordine FOR ales = 0
			*!*	modificare	v 2.0.13	^
		Endif
		Thisform.grdnorme.ctimpn.SetFocus()
		
	ENDPROC

	PROCEDURE do_adauga_norme
		Private pniesire
		pniesire=0
		Do update_ansamble In update_devize.prg
		Do update_masini In update_devize.prg
		
		Select v_norme
		Scatter Name loRec Blank
		Do Adauga_Modifica_Inregistrare With "norme",loRec,,"INSERT",,"addnorm"
		If pniesire=1
		*!*		This.actualizeaza_grid2()
		*!*		thisform.actualizeaza_grid2()
			thisform.do_cauta() 
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcVal1
		Store '' To lcVal1
		*!*	*!*	If Thisform._pageframe1.ActivePage=2
		Local lcFiltru,lcFiltru2
		lcFiltru = [2=2]
		lcFiltru2 = []
		*!*	*!*		With Thisform._pageframe1.page2
		With Thisform
			If .ck_ansamblu.Value=1
				lcFiltru = lcFiltru + .ck_ansamblu.filtru
			Endif
		
		*!*		If .ck_denop.Value=1
		*!*			lcFiltru = lcFiltru + .ck_denop.filtru
		*!*		Endif
		
			lcVal1=Strtran(Alltrim(Upper(Thisform.clb_tx_simplu7.text_simplu1.Value)),['],[''])
			If !Empty(lcVal1)
				lcFiltru = lcFiltru + [ and denop like '%] + lcVal1 + [%']
			Endif
		
			If .ck_marca.Value=1
				lcFiltru = lcFiltru + .ck_marca.filtru
			Endif
		
			If .ck_selectat.Value=1
				lcFiltru2 = lcFiltru2 + [ and ales=1 ]
			Endif
		Endwith
		
		*!*		lcExecuteString = " thisform._pageframe1.page2.cb_tx_cautare1"
		*!*		With &lcExecuteString
		*!*			lcval1=Strtran(Alltrim(Upper(.Text.Value)),['],[''])
		*!*			If !Empty(.Text.Value) Or (Empty(.Text.Value) And .criteriu.Value = "6")
		*!*				Do Case
		*!*				Case .criteriu.Value = "1"
		*!*					lcfiltru = lcfiltru + [ and LIKE('] + lcval1 + [*',denop)]
		*!*				Case .criteriu.Value = "2"
		*!*					lcfiltru = lcfiltru + [ and denop ='] + lcval1 + [']
		*!*				Case .criteriu.Value = "3"
		*!*					lcfiltru = lcfiltru + [ and denop !='] + lcval1 + [']
		*!*				Case .criteriu.Value = "4"
		*!*					lcfiltru = lcfiltru + [ and LIKE('*] + lcval1 + [*',denop)]
		*!*				Case .criteriu.Value = "5"
		*!*					lcfiltru = lcfiltru + [ and !LIKE('*] + lcval1 + [*',denop)]
		*!*				Case .criteriu.Value = "6"
		*!*					lcFiltru = lcFiltru + [ and 2=2 ]
		*!*				Endcase
		*!*			Endif
		
		Thisform.actualizeaza_grid2(lcFiltru,lcFiltru2)
		If Reccount('v_norme')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.clb_tx_simplu7.SetFocus()
		Else
			Thisform.grdnorme.SetFocus()
		Endif
		*!*		Endwith
		*!*	Endif
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_norme')>0
			Private pniesire
			pniesire=0
			Do update_ansamble In update_devize.prg
			Do update_masini In update_devize.prg
			Select v_norme
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "norme",loRec,loRec.id_norme,"UPDATE"
			If pniesire=1
				Gather Name loRec
		*!*		thisform.do_cauta()
			Endif
		Endif
	ENDPROC

	PROCEDURE do_reset
		*!*	If Thisform._pageframe1.ActivePage=2
			With Thisform
				For i=1 To .Objects.Count
					If Upper(.Objects(i).BaseClass)='CHECKBOX'
						.Objects(i).Value=0
						.Objects(i).enabled=.T.
					Endif
				Endfor
				.ck_ansamblu.SetFocus()
			Endwith
		*!*	Endif
	ENDPROC

	PROCEDURE do_sterge
		*!*	If Thisform._pageframe1.ActivePage=1
			If Used('crsmecanici') And Reccount('crsmecanici')>0
				Private pnid_opermecanic,pcnume
				Select crsmecanici
				pnid_crs=id_crs
				pcnume=nume
				If !Deleted() And !Empty(pcnume)
					If amessagebox('Doriti sa stergeti mecanicul '+Alltrim(pcnume)+' ?',4+32+256,'Stergere')==6
						save_grid_tag(Thisform.grdmecanici)
						Delete From crsmecanici Where id_crs=pnid_crs
						restore_grid_tag(Thisform.grdmecanici)
						Thisform.grdmecanici.Refresh
					Endif
				Endif
			Endif
		*!*	Endif
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		Use In crsmecanici
		Return .T.
	ENDPROC

	PROCEDURE inainte_de_do_termin
		*!* 21.09.2016
		*!* marius.mutu
		*!* dev_adauga_operatie + parametri gnAn, gnLuna
		*!* pentru adaugarea operatiilor intr-o luna anterioara
		
		Local lcSirIdMecanic,lnNrAlese,lnNrMecanici
		Store 0 To lnNrAlese,lnNrMecanici
		
		Select v_norme
		Go Top
		Calculate Cnt() For ales=1 To lnNrAlese
		Go Top
		
		If lnNrAlese=0
			Use In crsmecanici
			Return .T.
		Endif
		
		If Empty(Thisform.nid_sectie)
			AMessagebox("Nu ati ales sectia!",0+48,"Atentie")
			With Thisform
		*!*			.ActivePage=1
		*!*			.page1.SetFocus()
				.cb_tx_simplu1.SetFocus()
			Endwith
			Return .F.
		Endif
		
		If Thisform.cb_tx_simplu2._CBBASE1.Value=0
			amessagebox("Nu ati ales pretul!",0+48,"Atentie")
			With Thisform
		*!*			.page1.SetFocus()
				.cb_tx_simplu2.SetFocus()
			Endwith
			Return .F.
		Endif
		
		lcSirIdMecanic=[]
		Select crsmecanici
		Go Top
		Calculate Cnt() For !Deleted() To lnNrMecanici
		Go Top
		
		If lnNrMecanici>0
			Scan For !Deleted()
				lcSirIdMecanic=lcSirIdMecanic+Alltrim(Str(id_mecanic))+[;]
			Endscan
		Else
			amessagebox("Nu ati adaugat mecanicii!",0+48,"Atentie")
			With Thisform
		*!*			.page1.SetFocus()
				.grdmecanici.SetFocus()
			Endwith
			Return .F.
		Endif
		Use In crsmecanici
		
		If Used('crsnorme_ord')
			Use In crsnorme_ord
		Endif
		Select * From v_norme Where ales=1 Order By ordine Into Cursor crsnorme_ord
		Select crsnorme_ord
		Scan
		*!*	Select v_norme
		*!*	Scan For ales=1
			Scatter Name onorme
			lcSql = [begin pack_auto.dev_adauga_operatie('] + gcS + [',] + Alltrim(Str(Thisform.nid_sectie)) + [,] + ;
				Alltrim(Str(ocomanda.id_ordl)) + [,] + Alltrim(Str(Thisform.npret,17,4)) + [,] + ;
				Alltrim(Str(gnidutil)) + [,] + Alltrim(Str(onorme.timpn,5,3)) + [,]+ Alltrim(Str(onorme.id_norme)) + [,'] + ;
				lcSirIdMecanic + [',] + ALLTRIM(STR(m.gnAn)) + [,] + ALLTRIM(STR(m.gnLuna)) +  [); end;]
		*!*		lcSql = [select PACK_INAINTE_DE.] + lcProc + [('] + gcS +[',] + ALLTRIM(STR(gnAn)) + [,] + ALLTRIM(STR(gnLuna)) + lcCont + [) AS VALOARE FROM DUAL]&&[select * from ] + gcS + [.calendar]
		
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
		*!*		Return .F.
			Endif
		Endscan
		If Used('crsnorme_ord')
			Use In crsnorme_ord
		Endif
		
		pnid_sectie=Thisform.nid_sectie
		Select v_preturi
		pnid_pret=v_preturi.id_pret
		Return .T.
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		If Used('crsmecanici')
			Use In crsmecanici
		Endif
		
		If pnid_sectie!=0
			Select v_sectie
			Locate For id_sectie=pnid_sectie
			If Found()
				Thisform.cb_tx_simplu1._cbbase1.Value=Alltrim(sectie)
				Thisform.nid_sectie=pnid_sectie
				ooper.sectie=Alltrim(sectie)
			Endif
		Endif
		If pnid_pret!=0
			Select v_preturi
			Locate For id_pret=pnid_pret
			If Found()
				ooper.Pret=Pret
				Thisform.cb_tx_simplu2._cbbase1.Value = RECNO()
				Thisform.npret=Pret
				Thisform.cb_tx_simplu2._cbbase1.refresh
			Endif
		ELSE
			Select v_preturi
			Locate For id_asigurator=pnid_asigurator_com AND id_marca=pnid_marca
			If Found()
				ooper.Pret=Pret
				Thisform.cb_tx_simplu2._cbbase1.Value = RECNO()
				Thisform.npret=Pret
				Thisform.cb_tx_simplu2._cbbase1.refresh
			Endif
		ENDIF
		SELECT 0
		Create Cursor crsmecanici(id_crs N(2),id_mecanic N(5),nume c(100))
		This.WindowState = 2
		Thisform.Resize
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcControl = Upper(Alltrim(This.ActiveControl.Name))
		
		DO Case
		Case nKeyCode = 13 And lcControl = 'TEXT_SIMPLU1'
			Nodefault
			Thisform.do_adaugarep()
		Case (nKeyCode=32 And lcControl = 'GRDNORME' And Thisform.grdnorme.ActiveColumn!=6) Or ;
			((nKeyCode >=33 And nKeyCode <=122) And (lcControl = 'GRDNORME'))
			Nodefault
			Thisform.clb_tx_simplu7.text_simplu1.SetFocus
			Thisform.clb_tx_simplu7.text_simplu1.Value = Alltrim(Thisform.clb_tx_simplu7.text_simplu1.Value) + Chr(nKeyCode)
			Keyboard '{END}'
		Case (nKeyCode = 127) And (lcControl = 'GRDNORME')					&& backspace
			Nodefault
			Thisform.clb_tx_simplu7.text_simplu1.Value = Left(Alltrim(Thisform.clb_tx_simplu7.text_simplu1.Value),Len(Alltrim(Thisform.clb_tx_simplu7.text_simplu1.Value))-1)
			Thisform.clb_tx_simplu7.text_simplu1.SetFocus
			Keyboard '{END}'
		Case nKeyCode=27 And nShiftAltCtrl=0
			Nodefault
			If amessagebox("Sunteti sigur ca doriti sa inchideti fereastra?",4+32+256,"Confirmare")==6
				This.do_renunt()
			Endif
		Case nKeyCode=14 And nShiftAltCtrl=2 
			Nodefault
			If PEMSTATUS(This,"do_adauga",5)
				This.do_adauga()
			Endif
		Case nKeyCode=13 And nShiftAltCtrl=2
			Nodefault
			If PEMSTATUS(This,"do_modifica",5)
				This.do_modifica()
			Endif
		Case nKeyCode=4 And nShiftAltCtrl=2
			Nodefault
			If PEMSTATUS(This,"do_sterge",5)
				This.do_sterge()
			Endif
		Case nKeyCode=6 And nShiftAltCtrl=2
			Nodefault
			This.do_termin()
		Case nKeyCode=16 And nShiftAltCtrl=2
			Nodefault
			If PEMSTATUS(This,"do_listare",5)
				This.do_listare()
			Endif
		Endcase
		
	ENDPROC

	PROCEDURE Resize
		thisform.Refresh 
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		* Centrez fereastra si o fac 70% din ecran
		lnHeight = _screen.Height
		lnWidth = _screen.Width
		This.Height = INT(0.7 * m.lnHeight)
		this.Width = INT(0.7 * m.lnWidth)
		this.AutoCenter = .T. 
		
	ENDPROC

	PROCEDURE Cb_tx_simplu1._CBBASE1.InteractiveChange
		thisform.nid_sectie = v_sectie.id_sectie
	ENDPROC

	PROCEDURE Cb_tx_simplu2._CBBASE1.InteractiveChange
		thisform.npret = v_preturi.pret
	ENDPROC

	PROCEDURE Ck_selectat.Click
		If This.Value=1
			Thisform.ck_ansamblu.Enabled=.F.
			Thisform.ck_denop.Enabled=.F.
			Thisform.ck_marca.Enabled=.F.
			Thisform.ck_ansamblu.Value=0
			Thisform.ck_denop.Value=0
			Thisform.ck_marca.Value=0
		Else
			Thisform.ck_ansamblu.Enabled=.T.
			Thisform.ck_denop.Enabled=.T.
			Thisform.ck_marca.Enabled=.T.
		Endif
	ENDPROC

	PROCEDURE grdmecanici.cMecanic._cbbase1.GotFocus
		This.Tag=Alltrim(Str(v_mecanici.id_mecanic))
		
	ENDPROC

	PROCEDURE grdmecanici.cMecanic._cbbase1.Valid
		pnid_crs=crsmecanici.id_crs
		pnid_mecanic=v_mecanici.id_mecanic
		pcnume=v_mecanici.nume
		If Int(Val(This.Tag))!=pnid_mecanic
			Update crsmecanici Set id_mecanic=pnid_mecanic,nume=pcnume Where id_crs=pnid_crs
		Endif
		
	ENDPROC

	PROCEDURE grdnorme.cSelectat.Check1.Click
		Select v_norme
		Thisform.nordine=Thisform.nordine+This.Value
		Replace ales With This.Value,ordine With Thisform.nordine
		This.Parent.Parent.Refresh
	ENDPROC

	PROCEDURE Lb_titlu_alb_b121.Init
		This.Caption=This.Caption+Alltrim(ocomanda.nrord)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_alegtipcom 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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Labelmic2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ogTipcom" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 3
		DoCreate = .T.
		Height = 192
		Name = "frm_alegtipcom"
		Width = 266
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 205
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 65
		Lb_titlu_alb_b121.Caption = "Generare comandă nouă"
		Lb_titlu_alb_b121.Left = 24
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = 36
		BUT_TERMIN1.Left = 237
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 208, ;
		Name = "But_renunt1", ;
		Top = 1
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Labelmic2' AS lb_simplu WITH ;
		Caption = "Tip comandă:", ;
		Left = 12, ;
		Name = "Labelmic2", ;
		TabIndex = 33, ;
		Top = 41, ;
		ZOrderSet = 37
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'ogTipcom' AS _optiongrup WITH ;
		AutoSize = .T., ;
		ButtonCount = 6, ;
		Height = 122, ;
		Left = 29, ;
		Name = "ogTipcom", ;
		Top = 59, ;
		Width = 200, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "comandă post-garanție", ;
		Option1.FontCharSet = 238, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Tag = "1", ;
		Option1.Top = 5, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "comandă în termen de \<garanție", ;
		Option2.FontCharSet = 238, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Tag = "2", ;
		Option2.Top = 24, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "comandă \<regie", ;
		Option3.FontCharSet = 238, ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Tag = "3", ;
		Option3.Top = 43, ;
		Option3.Width = 101, ;
		Option4.AutoSize = .T., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "comandă de \<pregătire", ;
		Option4.FontCharSet = 238, ;
		Option4.Height = 17, ;
		Option4.Left = 5, ;
		Option4.Name = "Option4", ;
		Option4.Tag = "4", ;
		Option4.Top = 62, ;
		Option4.Width = 139, ;
		Option5.AutoSize = .T., ;
		Option5.BackStyle = 0, ;
		Option5.Caption = "comandă de pro\<ducție", ;
		Option5.FontCharSet = 238, ;
		Option5.Height = 17, ;
		Option5.Left = 5, ;
		Option5.Name = "Option5", ;
		Option5.Tag = "6", ;
		Option5.Top = 81, ;
		Option5.Width = 141, ;
		Option6.AutoSize = .T., ;
		Option6.BackStyle = 0, ;
		Option6.Caption = "comanda de \<constatare", ;
		Option6.Height = 17, ;
		Option6.Left = 5, ;
		Option6.Name = "Option6", ;
		Option6.Tag = "7", ;
		Option6.Top = 100, ;
		Option6.Width = 148
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="optiongroup" />
	
	PROCEDURE Destroy
		pnTipCom = Val(Thisform.ogtipcom.Buttons(Thisform.ogtipcom.Value).Tag)
	ENDPROC

	PROCEDURE Init
		Parameters pnTipcom
		DoDefault()
		If Empty(pnTipcom)
			Store 1 To pnTipcom
			Thisform.ogTipcom.Value = 1
		Else
			For i = 1 To Thisform.ogTipcom.ButtonCount
				If Val(Thisform.ogTipcom.Buttons(i).Tag) = pnTipcom
					Thisform.ogTipcom.Value = i
					Exit
				Endif
			Endfor
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_com_list 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="grdcomenzi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cNrord.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cNrord.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cDatai.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cDatai.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cTip_comanda.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cTip_comanda.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdcomenzi.cValidat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_datai" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nrinmat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nrord" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cbtip_deviz" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_export
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = grdcomenzi
		DoCreate = .T.
		Height = 520
		lactiv1 = .T.
		Name = "frm_com_list"
		Width = 644
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = -3
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 646
		_shape1.ZOrderSet = 0
		_shape2.Height = 29
		_shape2.Left = 577
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 72
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Caption = "Selectați comanda pe care doriți să o listați"
		Lb_titlu_alb_b121.Left = 7
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 12
		Lb_titlu_alb_b121.Top = 7
		Lb_titlu_alb_b121.ZOrderSet = 8
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 612
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 11
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 9
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		Left = 582, ;
		Name = "But_excel1", ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cbtip_deviz' AS ctip_deviz WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 527, ;
		Name = "cbtip_deviz", ;
		TabIndex = 6, ;
		Top = 137, ;
		Width = 110, ;
		_combobox1.FontCharSet = 1, ;
		_combobox1.FontName = "Arial", ;
		_combobox1.Height = 24, ;
		_combobox1.Left = 1, ;
		_combobox1.Name = "_combobox1", ;
		_combobox1.Top = 2, ;
		_combobox1.Width = 107
		*< END OBJECT: ClassLib="oviz_devize.vcx" BaseClass="container" />

	ADD OBJECT 'Ck_datai' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		Anchor = 8, ;
		camp_nume = a.datai, ;
		Caption = "Data comenzii", ;
		Left = 530, ;
		Name = "Ck_datai", ;
		TabIndex = 3, ;
		tip = D, ;
		Top = 75, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nrinmat' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 8, ;
		camp_nume = a.nrinmat, ;
		Caption = "Nr. înmatriculare", ;
		Left = 530, ;
		Name = "Ck_nrinmat", ;
		TabIndex = 4, ;
		Top = 94, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nrord' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 8, ;
		camp_nume = a.nrord, ;
		Caption = "Nr. comandă", ;
		Left = 530, ;
		Name = "Ck_nrord", ;
		TabIndex = 1, ;
		Top = 38, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nume' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 8, ;
		camp_nume = a.nume, ;
		Caption = "Nume client", ;
		Left = 530, ;
		Name = "Ck_nume", ;
		TabIndex = 2, ;
		Top = 56, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 8, ;
		Height = 29, ;
		Left = 523, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 7, ;
		Top = 176, ;
		Width = 116, ;
		ZOrderSet = 3
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "\<Raport generare", ;
		Height = 29, ;
		Left = 523, ;
		Name = "Cmd_executa1", ;
		TabIndex = 9, ;
		Top = 447, ;
		Width = 116, ;
		WordWrap = .T., ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa2' AS cmd_executa WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		caction = do_listare, ;
		Caption = "\<Listare comandă", ;
		Height = 29, ;
		Left = 523, ;
		Name = "Cmd_executa2", ;
		TabIndex = 10, ;
		Top = 481, ;
		Width = 116, ;
		WordWrap = .T., ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 8, ;
		Height = 29, ;
		Left = 523, ;
		Name = "Cmd_reset1", ;
		TabIndex = 13, ;
		Top = 212, ;
		Width = 116, ;
		ZOrderSet = 4
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdcomenzi' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 5, ;
		DeleteMark = .F., ;
		Height = 472, ;
		Left = 11, ;
		Name = "grdcomenzi", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crscomenzi", ;
		TabIndex = 8, ;
		Top = 38, ;
		Width = 505, ;
		ZOrderSet = 2, ;
		Column1.ControlSource = "nrord", ;
		Column1.FontName = "Arial", ;
		Column1.Name = "cNrord", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 90, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "datai", ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cDatai", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 85, ;
		Column3.ColumnOrder = 2, ;
		Column3.ControlSource = "nume", ;
		Column3.FontName = "Arial", ;
		Column3.Name = "cNume", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 179, ;
		Column4.ControlSource = "tip_comanda", ;
		Column4.FontName = "Arial", ;
		Column4.Name = "cTip_comanda", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 76, ;
		Column5.Alignment = 2, ;
		Column5.ControlSource = "IIF(validat=0,'NU','DA')", ;
		Column5.FontName = "Arial", ;
		Column5.Name = "cValidat", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 39
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdcomenzi.cDatai.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data comanda", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdcomenzi.cNrord.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.comanda", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdcomenzi.cNume.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume client", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdcomenzi.cTip_comanda.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip comanda", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdcomenzi.cValidat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Validat", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdcomenzi.cValidat.Text1' AS textbox WITH ;
		Alignment = 2, ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Lb_simplu1' AS lb_simplu WITH ;
		Anchor = 8, ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Tip comandă", ;
		Left = 523, ;
		Name = "Lb_simplu1", ;
		TabIndex = 5, ;
		Top = 119, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		Parameters tcFiltru
		Local lcFiltru
		If Empty(tcFiltru)
			lcFiltru = pocomenzi.ca_baza1.cfiltru
		Else
			lcFiltru = tcFiltru
		Endif
		
		
		Thisform.LockScreen = .T.
		Thisform.MousePointer = 11
		save_grid_tag(Thisform.grdcomenzi)
		pocomenzi.ca_baza1.cfiltru = lcFiltru
		pocomenzi.ca_baza1.afisare()
		restore_grid_tag(Thisform.grdcomenzi)
		Thisform.MousePointer = 0
		Thisform.LockScreen = .F.
		
		If Reccount('crscomenzi')>0
			Select crscomenzi
			Go Top
			Thisform.grdcomenzi.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		*!*	lcFiltru=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))
		lcFiltru = gcCondLuna
		
		If Thisform.ck_datai.Value=1
			lcFiltru = lcFiltru + Thisform.ck_datai.filtru
		Endif
		
		If Thisform.ck_nrinmat.Value=1
			lcFiltru = lcFiltru + Thisform.ck_nrinmat.filtru
		Endif
		
		If Thisform.ck_nrord.Value=1
			lcFiltru = lcFiltru + Thisform.ck_nrord.filtru
		Endif
		
		If Thisform.ck_nume.Value=1
			lcFiltru = lcFiltru + Thisform.ck_nume.filtru
		Endif
		
		If Thisform.cbtip_deviz._combobox1.Value # '<Toate tipurile>'
			lcFiltru = lcFiltru + [ and a.id_tip = ] + Alltrim(Str(lista_tipuri.id_tip))
		Endif
		 
		Thisform.actualizeaza_grid1(lcFiltru)
		
		If Reccount('crscomenzi')=0
			AMessagebox('Cautarea nu a intors rezultate!',0+48,'Info cautare')
			Thisform.ck_nrord.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_excel
		If Reccount('crscomenzi')>0
			Private porul,pooper,pcschema1,pcselect1
			Store '' To porul,pooper
		
			Select crscomenzi
			Scatter Name ocomanda
			If ocomanda.Validat = 1
				*!*	modificare	v 2.0.35 : am pus ocomanda.proc_tvav in loc de pack_contafin.getCotaTVAStandard
				*!*	modificare	v 2.0.41	:	am inlocuit pack_sesiune.calculeaza_pret_tva cu pack_sesiune.calculeaza_pret_cu_tva		
				lcSql = [select 'A' as semn,codmat,denumire,cante,pretv as pret,dataact as data,id_rul as id,] + ;
					[pack_sesiune.calculeaza_pret_cu_tva(pretv,1,pack_def.GetIdMonedaNationala(),] + ;
					ALLTRIM(STR(ocomanda.proc_tvav,10,4)) + [,0,2) as pretctva ] + ;
					[ from ] + gcS + [.vrul ] + ;
					[where id_lucrare = ] + Alltrim(Str(ocomanda.id_lucrare)) + [ ] + ;
					[union all ] + ;
					[select 'B' as semn,codop as codmat,denop as denumire,timpn as cante,pret,datai as data,id_oper as id,] + ;
					[0 as pretctva from ] + gcS + [.auto_voper ] + ;
					[where id_ordl = ] + Alltrim(Str(ocomanda.id_ordl)) + [ and ] + ;
					[extract(month from datai)+extract(year from datai)*12 <= ?gnLuna + ?gnAn*12 ] + ;
					[order by semn,data,id]
				lnSucces = goExecutor.oExecute(lcSql,[crslistare])
				If lnSucces < 0
					amessagebox(goExecutor.cEroare,0+16,"Eroare")
					Return
				Endif
		
				If Reccount('crslistare') > 0
					Private pdDataora,pcdataora,pntotaltn,pntotalval
					If Used('crsdate')
						Use In crsdate
					Endif
					*!*	modificare	v 2.0.37 : am pus a.kmint in loc de b.kmint
					lcSql=[select a.nrord,a.nume,a.cod_fiscal,a.datai,a.asigurator,a.inspector,] + ;
						[a.banca,a.cont_banca,a.adresa,a.nr_dosar,] + ;
						[b.nrinmat,b.series,b.seriem,b.culoare,a.kmint,b.marca,b.masina ] + ;
						[from ] + gcS + [.auto_vordl a ] + ;
						[left join ] + gcS + [.auto_vmasiniclienti b on a.id_masiniclient=b.id_masiniclient ] + ;
						[where a.id_ordl=] + Alltrim(Str(ocomanda.id_ordl))
					lnSucces=goExecutor.oExecute(lcSql,[crsdate])
					If lnSucces<0
						amessagebox(goExecutor.cEroare,0+16,'Eroare')
						Return
					Endif
					Select crsdate
					Scatter Name olistare Memo
					Use In crsdate
		
					pcdataora=get_ora(2)
					pdDataora=Ttod(Ctot(pcdataora))
		
					Select crslistare
					*!*	modificare	v 2.0.22 : am adaugat tva
					*!*	modificare	v 2.0.41 : am inlocuit tva cu pretctva
					Calculate Sum(Round(cante*Pret,gnPc)),SUM(ROUND(cante*pretctva,gnPc)) To pnTotalMatDeviz,pnTotalCTVAMatDeviz For semn = 'A'
					Calculate Sum(Round(cante*Pret,gnPc)) To pnTotalManDeviz For semn = 'B'
					*!*	modificare	v 2.0.35 : am inlocuit m.ctvam cu ocomanda.proc_tvav
					*!*	modificare	v 2.0.41 : am inlocuit pnTotalTvaMatDeviz cu pnTotalCTVAMatDeviz-pnTotalMatDeviz
					pnTotalTvaDeviz=IIF(glAutoBonDet,pnTotalCTVAMatDeviz-pnTotalMatDeviz,Round(pnTotalMatDeviz*(ocomanda.proc_tvav-1),gnPc))+Round(pnTotalManDeviz*(ocomanda.proc_tvav-1),gnPc)
		
					If Used('crsFirma')
						Use In crsfirma
					Endif
					lcSql = [select localitate,strada,numar,cod_fiscal,reg_comert from syn_nom_firme where id_firma = ]+Alltrim(Str(gnIdFirma))	&&	modificare	v 2.0.29 : am inlocuit gnId_Firma
					lnSucces=goExecutor.oExecute(lcSql,[crsfirma])
					If lnSucces<0
						amessagebox(goExecutor.cEroare,0+16,'Eroare')
						Return
					Endif
					Select crsfirma
					Scatter Name firma
					Use In crsfirma
		
		*!*	modificare MIX 07.09.2007
		*!*				Select crslistare
		*!*				Locate For Like('MIX*',denumire) And semn=='A'
		*!*				If Found()
		*!*					Calculate Sum(Round(cante*Pret,gnPc)),Max(Recno()) To lnSumaMix,lnNrCrt For Like('MIX*',denumire) And semn='A'
		*!*					If Used('crslistare2')
		*!*						Use In crslistare2
		*!*					Endif
		*!*					Select Recno() As nrcrtord,* From crslistare Where !(Like('MIX*',denumire) And semn='A') Into Cursor crslistare2 Readwrite
		*!*					Select crslistare2
		*!*					Append Blank
		*!*					Replace codmat With '',denumire With 'MIX',semn With 'A',Pret With lnSumaMix,cante With 1,nrcrtord With lnNrCrt,nrord With olistare.nrord
		*!*					Use In crslistare
		*!*					Select * From crslistare2 Into Cursor crslistare Order By nrcrtord
		*!*					Use In crslistare2
		*!*				Endif
		*!*	modificare MIX 07.09.2007	^
		*!*	export in EXCEL
					Try
						poExcel = Createobject("Excel.Application")
					Catch
						export_xls('crslistare')
						Return
					Endtry
		
					Thisform.MousePointer = 11
					Thisform.LockScreen = .T.
		
					Local llIntrerupt
					llIntrerupt = .F.
					loTherm = Newobject("_thermometer","_therm","","Export date in Excel...")
					loTherm.AlwaysOnTop=.T.
					loTherm.Show()
		
					lnPercent = 0
					lcTask = [DEVIZ COMANDA ] + Alltrim(olistare.nrord)
					loTherm.Update(lnPercent, lcTask)
		
					poExcel.WorkBooks.Add
					poExcel.Sheets(1).Select
					poExcel.Sheets(1).Name = [DEVIZ]
					poExcel.Cells(2,1) = [Firma]
					poExcel.Cells(2,2) = ALLTrim(gcFirma)
					poExcel.Cells(3,1) = [C.I.F./C.N.P.]
					poExcel.Cells(3,2) = ALLTRIM(firma.cod_fiscal)
					poExcel.Cells(4,1) = [Adresa]		
					poExcel.Cells(4,2) = [Strada ]+Alltrim(firma.strada) + Iif(!Empty(Nvl(firma.numar,[])),[, nr.]+Alltrim(firma.numar),[]) + ;
						Iif(!Empty(Nvl(firma.localitate,[])),[,] + Alltrim(firma.localitate),[])
		
					poExcel.Cells(2,7) = [Client]
					poExcel.Cells(2,8) = ALLTrim(olistare.nume)
					poExcel.Cells(3,7) = [C.I.F./C.N.P.]
					poExcel.Cells(3,8) = ALLTRIM(olistare.cod_fiscal)
					poExcel.Cells(4,7) = [Adresa]				
					poExcel.Cells(4,8) = ALLTRIM(olistare.adresa)
		
					poExcel.Cells(5,4).Font.Bold=.T.
					poExcel.Cells(5,4).Font.Size = 16
					poExcel.Cells(5,4) = [DEVIZ COMANDA ] + Alltrim(olistare.nrord)
					poExcel.Cells(6,4).Font.Bold=.T.
					poExcel.Cells(6,4).Font.Size = 16
					poExcel.Cells(6,4) = [ASIGURATOR ] + Alltrim(olistare.asigurator) + ;
						IIF(!EMPTY(NVL(olistare.inspector,[])),[ * INSPECTOR ] + ALLTRIM(olistare.inspector),[])
					poExcel.Cells(7,4).Font.Bold=.T.
					poExcel.Cells(7,4).Font.Size = 16
					poExcel.Cells(7,4) = [NR. DOSAR ] + Alltrim(olistare.nr_dosar)
		
					poExcel.Cells(9,3) = [Marca masinii]
					poExcel.Cells(9,4) = ALLTrim(olistare.marca) + [ ] + ALLTrim(olistare.masina)
					poExcel.Cells(10,3) = [Nr. inmatriculare]
					poExcel.Cells(10,4) = ALLTRIM(olistare.nrinmat)
					poExcel.Cells(11,3) = [Culoare]				
					poExcel.Cells(11,4) = ALLTRIM(olistare.culoare)
					poExcel.Cells(12,3) = [Km. la bord]
					poExcel.Cells(12,4) = olistare.kmint
					poExcel.Cells(9,6) = [Serie sasiu]
					poExcel.Cells(9,7) = ALLTRIM(olistare.series)
					poExcel.Cells(10,6) = [Serie motor]				
					poExcel.Cells(10,7) = ALLTRIM(olistare.seriem)
					poExcel.Cells(11,6) = [Data intrarii]
					poExcel.Cells(11,7).NumberFormat = [dd/mm/yyyy;@] 
					poExcel.Cells(11,7) = olistare.datai
		
					lnRandStart=14
					lnColoanaI=2
		
					lnRow=lnRandStart
					Set Cursor Off
					lcCursor=[crslistare]
					lnNrRanduri = Reccount(lcCursor)
					lnPercent = (lnRow - lnRandStart + 1) * 100 / (lnNrRanduri + 1)
					lcTask = [Completare cap de tabel...]
					loTherm.Update(lnPercent, lcTask)
		
					poExcel.Cells(lnRow,lnColoanaI+1) = [TIP]
					poExcel.Columns(lnColoanaI+1).NumberFormat=[@]
					poExcel.Cells(lnRow,lnColoanaI+2) = [COD]
					poExcel.Columns(lnColoanaI+2).NumberFormat=[@]
					poExcel.Cells(lnRow,lnColoanaI+3) = [DENUMIRE]
					poExcel.Columns(lnColoanaI+3).NumberFormat=[@]
					poExcel.Cells(lnRow,lnColoanaI+4) = [CANTITATE/ORE]
					poExcel.Cells(lnRow,lnColoanaI+5) = [PRET]
					poExcel.Cells(lnRow,lnColoanaI+6) = [VALOARE]
		
					For i = 1 To 6
						poExcel.Cells(lnRow,lnColoanaI+i).Font.Bold = .T.
						poExcel.Cells(lnRow,lnColoanaI+i).Interior.ColorIndex = 16
					Endfor
		
					lcTask = [Completare randuri...]
					Select (lcCursor)
					Scan
						lnRow = lnRow + 1
						lnPercent = (lnRow - lnRandStart + 1) * 100 / (lnNrRanduri + 1)
						loTherm.Update(lnPercent, lcTask)
						If Inkey()=27
							amessagebox("Exportul a fost intrerupt!",0+48,"Atentie")
							llIntrerupt = .T.
							Exit
						Endif
						poExcel.Cells(lnRow,lnColoanaI+1) = Iif(semn='A',[MATERIALE],[MANOPERA])
						poExcel.Cells(lnRow,lnColoanaI+2) = codmat
						poExcel.Cells(lnRow,lnColoanaI+3) = denumire
						poExcel.Cells(lnRow,lnColoanaI+4) = cante
						poExcel.Cells(lnRow,lnColoanaI+5) = Pret
						poExcel.Cells(lnRow,lnColoanaI+6) = Round(cante*Pret,gnPc)
					Endscan
		
					poExcel.Cells(lnRow + 3, lnColoanaI + 3) = [TOTAL FARA TVA]
					poExcel.Cells(lnRow + 3, lnColoanaI + 6) = pnTotalMatDeviz+pnTotalManDeviz
					poExcel.Cells(lnRow + 4, lnColoanaI + 3) = [TOTAL TVA]
					poExcel.Cells(lnRow + 4, lnColoanaI + 6) = pnTotalTvaDeviz
					poExcel.Cells(lnRow + 5, lnColoanaI + 3) = [TOTAL GENERAL]
					poExcel.Cells(lnRow + 5, lnColoanaI + 6) = pnTotalMatDeviz+pnTotalManDeviz+pnTotalTvaDeviz
		
					loTherm.Complete()
					loTherm.AlwaysOnTop=.F.
					Release loTherm
					Set Cursor On
					If llIntrerupt
						poExcel.DisplayAlerts = .F.
						poExcel.Quit
					Else
						poExcel.Visible=.T.
					Endif
					Release poExcel
					Thisform.LockScreen=.F.
					Thisform.MousePointer=0
		*!* export in EXCEL ^
					Use In crslistare
				Else
					amessagebox("Nu exista manopera si materiale pe aceasta comanda!",0+48,"Atentie")
					Thisform.ck_nrord.SetFocus()
				Endif
			Else
				amessagebox("Aceasta comanda nu a fost validata!",0+48,"Atentie")
				Thisform.ck_nrord.SetFocus()
			Endif
		Else
			amessagebox("Nu inregistrari pentru export in Excel!",0+48,"Atentie")
			Thisform.ck_nrord.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_export
	ENDPROC

	PROCEDURE do_listare
		If Reccount('crscomenzi')>0
		*!*	modificare	v 2.0.35
			Select crscomenzi
			Scatter Name ocomanda
			listare_comanda_deviz(Thisform,ocomanda,IIF(INLIST(ocomanda.id_tip,3,6),2,1))
		*!*		Private porul,pooper,pcschema1,pcselect1
		*!*		Store '' To porul,pooper
		*!*		Select crscomenzi
		*!*		Scatter Name ocomanda
		*!*		lcSql = [select row_number() over (order by datai,id_oper) as nrcrt,id_ordl,codop,timpn,pret,denop,] + ;
		*!*			[datai from ] + gcS + [.dev_voper where id_ordl = ?ocomanda.id_ordl and ] + ;
		*!*			[extract(month from datai)+extract(year from datai)*12<=?gnLuna+?gnAn*12 ] + ;
		*!*			[order by 1]
		*!*		lnSucces = goExecutor.oExecute(lcSql,'oper')
		*!*		If lnSucces < 0
		*!*			amessagebox(goExecutor.cEroare,16,'Eroare')
		*!*			Return
		*!*		Endif
		*!*	*!*	modificare	v 2.0.22 : am adaugat tva
		*!*		lcSql = [select row_number() over (order by a.dataact,a.id_rul) as nrcrt,a.*,b.denumire,b.codmat from (] + ;
		*!*			[select id_articol,pretv,SUM(cante) as cante,MIN(dataact) as dataact,MIN(id_rul) as id_rul, ] + ;
		*!*			[pack_sesiune.calculeaza_pret_tva(pretv,1,pack_def.GetIdMonedaNationala(),pack_contafin.getCotaTVAStandard(?gnLuna,?gnAn),0) as tva ] + ;
		*!*			[from ] + gcS + [.rul where sters = 0 and id_lucrare = ?ocomanda.id_lucrare ] + ;
		*!*			[group by id_articol,pretv) a ] + ;
		*!*			[left join nom_articole b on a.id_articol = b.id_articol where a.cante <> 0]
		*!*		lnSucces = goExecutor.oExecute(lcSql,'rul')
		*!*		If lnSucces < 0
		*!*			amessagebox(goExecutor.cEroare,16,'Eroare')
		*!*			Return
		*!*		Endif
		*!*		If Reccount('oper')>0 Or Reccount('rul')>0
		*!*			Private pdDataora,pcdataora,pntotaltn,pntotalval
		*!*			If Used('crslistare')
		*!*				Use In crslistare
		*!*			Endif
		*!*			lcSql=[select a.nrord,a.nume,a.cod_fiscal,a.datai,a.asigurator,a.inspector,] + ;
		*!*				[a.banca,a.cont_banca,a.adresa,a.nr_dosar,a.reg_comert,a.tip_persoana,] + ;
		*!*				[b.nrinmat,b.series,b.seriem,b.culoare,b.kmint,b.marca,b.masina ] + ;
		*!*				[from ] + gcS + [.dev_vordl a ] + ;
		*!*				[left join ] + gcS + [.dev_vmasiniclienti b on a.id_masiniclient=b.id_masiniclient ] + ;
		*!*				[where a.id_ordl = ?ocomanda.id_ordl]
		*!*			lnSucces=goExecutor.oExecute(lcSql,[crslistare])
		*!*			If lnSucces<0
		*!*				amessagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*				Return
		*!*			Endif
		*!*			Select crslistare
		*!*			Scatter Name olistare Memo
		*!*			Use In crslistare
		*!*			pcdataora=get_ora(2)
		*!*			pdDataora=Ttod(Ctot(pcdataora))
		*!*			Select rul
		*!*	*!*	modificare	v 2.0.22 : am adaugat tva
		*!*			Calculate Sum(Round(cante*pretv,gnPc)),SUM(ROUND(cante*tva,gnPc)) To pnTotalMatDeviz,pnTotalTVAMatDeviz
		*!*			Select oper
		*!*			Calculate Sum(Round(timpn*Pret,gnPc)) To pnTotalManDeviz
		*!*			pnTotalTvaDeviz=IIF(glAutoBonDet,pnTotalTVAMatDeviz,Round(pnTotalMatDeviz*(m.ctvam-1),gnPa))+Round(pnTotalManDeviz*(m.ctvam-1),gnPa)
		*!*			Select nrcrt,olistare.nrord As nrord,'A' As semn,codmat,denumire,cante,pretv As Pret From rul ;
		*!*				UNION All ;
		*!*				SELECT nrcrt,olistare.nrord As nrord,'B' As semn,codop As codmat,denop As denumire,timpn As cante,Pret From oper ;
		*!*				ORDER By 3,1 Into Cursor crslistare
		*!*			Thisform.AlwaysOnTop=.F.
		*!*			If ocomanda.Validat=0
		*!*				Select crslistare
		*!*				*!*			modificare v 2.0.5
		*!*				*!*				Do LISTAREUSERREPORT With "crsListare", [FRX], "RAP_COMANDA" In PROCEDURI_RAPOARTE.PRG
		*!*				goExport.export2frx([crslistare],[rap_comanda])
		*!*				*!*			modificare v 2.0.5	^
		*!*			Else
		*!*				Private pofirma
		*!*				Store '' To pofirma
		*!*				If Used('crsFirma')
		*!*					Use In crsfirma
		*!*				Endif
		*!*				lcSql = [select localitate,strada,numar,cod_fiscal,reg_comert from syn_nom_firme where ] + ;
		*!*					[id_firma = ?gnIdFirma]		&&	modificare	v 2.0.29 : am inlocuit gnId_Firma
		*!*				lnSucces=goExecutor.oExecute(lcSql,[crsfirma])
		*!*				If lnSucces<0
		*!*					amessagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*					Return
		*!*				Endif
		*!*				Sele crsfirma
		*!*				Scatter Name firma
		*!*				Use In crsfirma
		*!*				*!*	modificare MIX 07.09.2007
		*!*				*!*				Select crslistare
		*!*				*!*				Locate For Like('MIX*',denumire) And semn=='A'
		*!*				*!*				If Found()
		*!*				*!*					Calculate Sum(Round(cante*Pret,gnPc)),Max(Recno()) To lnSumaMix,lnNrCrt For Like('MIX*',denumire) And semn='A'
		*!*				*!*					If Used('crslistare2')
		*!*				*!*						Use In crslistare2
		*!*				*!*					Endif
		*!*				*!*					Select Recno() As nrcrtord,* From crslistare Where !(Like('MIX*',denumire) And semn='A') Into Cursor crslistare2 Readwrite
		*!*				*!*					Select crslistare2
		*!*				*!*					Append Blank
		*!*				*!*					Replace codmat With '',denumire With 'MIX',semn With 'A',Pret With lnSumaMix,cante With 1,nrcrtord With lnNrCrt,nrord With olistare.nrord
		*!*				*!*					Use In crslistare
		*!*				*!*					Select * From crslistare2 Into Cursor crslistare Order By nrcrtord
		*!*				*!*					Use In crslistare2
		*!*				*!*				Endif
		*!*				*!*	modificare MIX 07.09.2007	^
		*!*				Select crslistare
		*!*				Go Top
		*!*				*!*	modificare	v 2.0.5
		*!*				*!*				Do LISTAREUSERREPORT With "crsListare", [FRX], "RAP_DEVIZ" In PROCEDURI_RAPOARTE.PRG
		*!*				goExport.export2frx([crslistare],[rap_deviz])
		*!*				*!*	modificare	v 2.0.5	^
		*!*			Endif
		*!*			Thisform.AlwaysOnTop=.T.
		*!*			Use In crslistare
		*!*		Else
		*!*			amessagebox("Nu exista manopera si materiale pe aceasta comanda!",0+48,"Atentie")
		*!*			Thisform.ck_nrord.SetFocus()
		*!*		Endif
		*!*		*!*	modificare	v 2.0.5
		*!*		If Used('oper')
		*!*			Use In oper
		*!*		Endif
		*!*		If Used('rul')
		*!*			Use In rul
		*!*		Endif
		*!*		*!*	modificare	v 2.0.5	^
		*!*	modificare	v 2.0.35	^
		Else
			amessagebox("Nu inregistrari pentru listare!",0+48,"Atentie")
			Thisform.ck_nrord.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_reset
		With Thisform
			For i=1 To .Objects.Count
				If Upper(.Objects(i).BaseClass)='CHECKBOX'
					.Objects(i).Value=0
				Endif
			Endfor
		Endwith
		Thisform.cbtip_deviz.do_reset()
		Thisform.ck_nrord.SetFocus()
		
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		* Centrez fereastra si o fac 70% din ecran
		lnHeight = _screen.Height
		lnWidth = _screen.Width
		This.Height = INT(0.7 * m.lnHeight)
		this.Width = INT(0.7 * m.lnWidth)
		this.AutoCenter = .T. 
		
	ENDPROC

	PROCEDURE Cmd_executa1.Click
		If Reccount('crscomenzi')>0
			Thisform.AlwaysOnTop = .F.
			lnIdOrdl = crsComenzi.id_ordl
			DO listare_precomanda WITH m.lnIdOrdl
			Thisform.AlwaysOnTop = .T.	
		ENDIF 
		
		RETURN 
		******************************************************************
		If Reccount('crscomenzi')>0	
			Private pofirma,pooper,pcschema,pcselect,pcorder,pddataora
			Local lnRecno
			Store '' To pofirma,pooper
		
			If Used('crsfirma')
				Use In crsfirma
			Endif
			pcschema=['']
			pcselect=['select adresa,localitate,strada,numar,cod_fiscal from syn_nom_firme where 1=2']
			pcorder=[]
			pcfiltru=[id_firma = ]+Alltrim(Str(gnIdFirma))		&&	modificare	v 2.0.29 : am inlocuit gnId_Firma
			llAfiseaza=.F.
			gencursor('pofirma','crsFirma',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza)
			pofirma.ca_baza1.afisare()
			Select crsfirma
		
			Scatter Name firma
			Use In crsfirma
		
			Select crsComenzi
		
			Scatter Name ocom
			lnRecno=Recno()
		
			pddataora = get_ora()
		
			If Used('crsmasina')
				Use In crsmasina
			Endif
			lcSql=[select * from ] + gcS + [.auto_date_suplimentare_rap where id_ordl=]+;
				Alltrim(Str(ocom.id_ordl))
			lnSucces=goExecutor.oExecute(lcSql,'crsmasina')
			If lnSucces<0
				AMessagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*			Thisform.AlwaysOnTop=.T.
				Return
			Endif
		
			Select crsmasina
		
			ADDPROPERTY(ocom,'solicitari_client','')
			ocom.solicitari_client = ALLTRIM(NVL(solicitari_client, ''))
			ADDPROPERTY(ocom,'observatii','')
			ocom.observatii = ALLTRIM(NVL(observatii,''))
			ADDPROPERTY(ocom,'defectiuni','')	
			ocom.defectiuni = ALLTRIM(NVL(defectiuni,''))
		
			AddProperty(ocom,'adresa','')
			ocom.adresa = adresa
			AddProperty(ocom,'seriem',seriem)
			AddProperty(ocom,'nrinmat',nrinmat)
			AddProperty(ocom,'marca',marca)
			AddProperty(ocom,'masina',masina)
			AddProperty(ocom,'series',series)
			AddProperty(ocom,'kmint',kmint)
			AddProperty(ocom,'ore_functionare',ore_functionare)	
			AddProperty(ocom,'furnizor',furnizor)
			AddProperty(ocom,'nrachi',nrachi)
		*!*	AddProperty(ocom,'dataachi',Ttod(dataachi))
			AddProperty(ocom,'anfabricatie',anfabricatie)
			AddProperty(ocom,'telefon',telefon)
			AddProperty(ocom,'cod_fiscal',cod_fiscal)
			AddProperty(ocom,'asigurator',asigurator)
			AddProperty(ocom,'inspector',inspector)
			AddProperty(ocom,'termen',termen)
			Use In crsmasina
		
			Thisform.AlwaysOnTop=.F.
			Select crsComenzi
			listare_raport_comanda([CRSCOMENZI],ocom.id_tip)
		
			Thisform.AlwaysOnTop=.T.
			Select crsComenzi
			Go lnRecno
		Else
			AMessagebox("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_devizestimativ 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="gnorme" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cMasina.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cMasina.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cAnsamblu.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cAnsamblu.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cDenop.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cDenop.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cTimpn.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cTimpn.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cCodop.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cCodop.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cMarca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.cMarca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_manop" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.cCodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.cCodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.Um.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.Um.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="garticole.cCont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_articol" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_devest" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmd_addm" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmd_addart" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cCod.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cCod.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cUm.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cUm.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cCantitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cCantitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cPretctva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cPretctva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cPretftva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cPretftva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cCotatva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cCotatva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cCotatva.cbtva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cValoare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cValoare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cPretcutva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cPretcutva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdevest.cPretcutva.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Autoresize1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_but
		*m: actualizeaza_gdevest
		*m: adauga_articole
		*m: adauga_manopera
		*m: do_calcul
		*m: do_cautaart
		*m: do_cautadevest
		*m: do_cautam
		*p: lsalvat
		*p: lvalidat
		*p: ncanti
		*p: ncantm
		*p: npret
		*p: npretctvai
		*p: npretctvam
		*p: npretftvai
		*p: npretftvam
		*p: nproctvai
		*p: nproctvam
		*p: ntvai
		*p: ntvam
		*p: totctva
		*p: totftva
		*p: tottva
		*p: tva
		*p: valoare
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = gnorme
		DoCreate = .T.
		FontSize = 9
		Height = 600
		lactiv2 = .T.
		lactiv4 = .T.
		lsalvat = .T.
		lvalidat = .T.
		Name = "frm_devizestimativ"
		ncanti = 0.000
		ncantm = 0.000
		npret = 
		npretctvai = 0.00
		npretctvam = 0.00
		npretftvai = 0.00
		npretftvam = 0.00
		nproctvai = 0
		nproctvam = 0
		ntvai = 0
		ntvam = 0
		totctva = 0
		totftva = 0
		tottva = 0
		tva = 0
		valoare = 0
		Width = 800
		_memberdata = <VFPData>
			<memberdata name="nproctvam" display="nProcTVAm"/>
			<memberdata name="nproctvai" display="nProcTVAi"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "W"
		_shape1.Top = 0
		_shape1.Width = 801
		_shape2.Height = 29
		_shape2.Left = 715
		_shape2.Name = "_shape2"
		_shape2.Tag = "L"
		_shape2.Top = 0
		_shape2.Width = 84
		Lb_titlu_alb_b121.Caption = "Deviz estimativ"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 19
		BUT_TERMIN1.Left = 767
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 14
		BUT_TERMIN1.Tag = "L"
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = -12
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 120
	*</PropValue>

	ADD OBJECT 'Autoresize1' AS autoresize WITH ;
		Left = 402, ;
		Name = "Autoresize1", ;
		TabIndex = 26, ;
		Top = 36
		*< END OBJECT: ClassLib="..\comun\clase\autoresize.vcx" BaseClass="container" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Left = 737, ;
		Name = "But_listare1", ;
		TabIndex = 15, ;
		Tag = "L", ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'Cb_articol' AS cb_tx_cautare WITH ;
		Anchor = 0, ;
		Left = 8, ;
		Name = "Cb_articol", ;
		TabIndex = 4, ;
		Tag = "", ;
		Top = 359, ;
		Text.Name = "Text", ;
		criteriu.Name = "criteriu", ;
		criteriu.Value =
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_devest' AS cb_tx_cautare WITH ;
		Anchor = 0, ;
		Height = 27, ;
		Left = 431, ;
		Name = "Cb_devest", ;
		TabIndex = 6, ;
		Tag = "", ;
		Top = 60, ;
		Width = 270, ;
		Text.Name = "Text", ;
		Text.Width = 160, ;
		criteriu.Name = "criteriu", ;
		criteriu.Value =
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_manop' AS cb_tx_cautare WITH ;
		Left = 6, ;
		Name = "Cb_manop", ;
		TabIndex = 2, ;
		Top = 94, ;
		Text.Name = "Text", ;
		criteriu.Name = "criteriu", ;
		criteriu.Value =
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu2' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Cb_tx_simplu2", ;
		TabIndex = 1, ;
		Top = 60, ;
		Width = 286, ;
		ZOrderSet = 17, ;
		_CBBASE1.ColumnCount = 2, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "v_preturi.pret,asigurator", ;
		_CBBASE1.RowSourceType = 2, ;
		_lbbase1.Caption = "Preț / Oră", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'cmd_addart' AS commandbutton WITH ;
		Anchor = 4, ;
		Caption = ">", ;
		Enabled = .T., ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 392, ;
		Name = "cmd_addart", ;
		TabIndex = 18, ;
		Tag = "", ;
		Top = 447, ;
		Width = 28
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'cmd_addm' AS commandbutton WITH ;
		Anchor = 0, ;
		Caption = ">", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 393, ;
		Name = "cmd_addm", ;
		TabIndex = 17, ;
		Tag = "", ;
		Top = 186, ;
		Width = 28
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		caction = do_cautam, ;
		Height = 27, ;
		Left = 324, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 11, ;
		Tag = "", ;
		Top = 93, ;
		Width = 61
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta2' AS cmd_cauta WITH ;
		Anchor = 0, ;
		caction = do_cautaart, ;
		Left = 323, ;
		Name = "Cmd_cauta2", ;
		TabIndex = 12, ;
		Tag = "", ;
		Top = 359, ;
		Width = 61
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta3' AS cmd_cauta WITH ;
		Anchor = 0, ;
		caction = do_cautadevest, ;
		Height = 27, ;
		Left = 699, ;
		Name = "Cmd_cauta3", ;
		TabIndex = 13, ;
		Tag = "", ;
		Top = 60, ;
		Width = 61
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'garticole' AS _grdrow WITH ;
		Anchor = 5, ;
		ColumnCount = 4, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 206, ;
		Left = 8, ;
		Name = "garticole", ;
		Panel = 1, ;
		RecordSource = "v_articole", ;
		RowHeight = 19, ;
		TabIndex = 5, ;
		Tag = "", ;
		Top = 389, ;
		Width = 376, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cDenumire", ;
		Column1.Width = 239, ;
		Column2.ControlSource = "codmat", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cCodmat", ;
		Column2.Width = 75, ;
		Column3.ControlSource = "um", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Um", ;
		Column3.Width = 44, ;
		Column4.ControlSource = "cont", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cCont", ;
		Column4.Width = 53
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

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

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

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

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

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

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

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

	ADD OBJECT 'gdevest' AS grid WITH ;
		ColumnCount = 9, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 423, ;
		HighlightBackColor = 0,64,128, ;
		HighlightStyle = 2, ;
		Left = 432, ;
		Name = "gdevest", ;
		Panel = 1, ;
		RecordSource = "v_devest", ;
		RowHeight = 19, ;
		TabIndex = 7, ;
		Tag = "WH", ;
		Top = 93, ;
		Width = 360, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cDenumire", ;
		Column1.ReadOnly = .T., ;
		Column1.Visible = .T., ;
		Column1.Width = 197, ;
		Column2.ControlSource = "cod", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cCod", ;
		Column2.ReadOnly = .T., ;
		Column2.Visible = .T., ;
		Column2.Width = 73, ;
		Column3.ControlSource = "um", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cUm", ;
		Column3.ReadOnly = .T., ;
		Column3.Visible = .T., ;
		Column3.Width = 41, ;
		Column4.BackColor = 253,252,223, ;
		Column4.ControlSource = "cantitate", ;
		Column4.DynamicBackColor = "rgb(253,252,223)", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "R", ;
		Column4.InputMask = (get_mask(12,gnPCANT)), ;
		Column4.Name = "cCantitate", ;
		Column4.Visible = .T., ;
		Column4.Width = 55, ;
		Column5.BackColor = 253,252,223, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "pretctva", ;
		Column5.DynamicBackColor = "rgb(253,252,223)", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "R", ;
		Column5.InputMask = (get_mask(12,gnPPretV)), ;
		Column5.Name = "cPretctva", ;
		Column5.ReadOnly = .F., ;
		Column5.Visible = .T., ;
		Column5.Width = 66, ;
		Column6.BackColor = 253,252,223, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "pretftva", ;
		Column6.DynamicBackColor = "rgb(253,252,223)", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "R", ;
		Column6.InputMask = (get_mask(12,gnPPretV)), ;
		Column6.Name = "cPretftva", ;
		Column6.Visible = .T., ;
		Column6.Width = 73, ;
		Column7.BackColor = 253,252,223, ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "cota_tva", ;
		Column7.CurrentControl = "cbtva", ;
		Column7.DynamicBackColor = "rgb(253,252,223)", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cCotatva", ;
		Column7.ReadOnly = .T., ;
		Column7.Sparse = .F., ;
		Column7.Visible = .T., ;
		Column7.Width = 63, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "valoare", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "R", ;
		Column8.InputMask = (get_mask(12,gnPc)), ;
		Column8.Name = "cValoare", ;
		Column8.ReadOnly = .T., ;
		Column8.Visible = .T., ;
		Column8.Width = 75, ;
		Column9.Alignment = 2, ;
		Column9.ColumnOrder = 7, ;
		Column9.ControlSource = "pret_cu_tva", ;
		Column9.CurrentControl = "Check1", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cPretcutva", ;
		Column9.ReadOnly = .T., ;
		Column9.Sparse = .F., ;
		Column9.Visible = .T., ;
		Column9.Width = 47
		*< END OBJECT: BaseClass="grid" />

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

	ADD OBJECT 'gdevest.cCantitate.Text1' AS textbox WITH ;
		BackColor = 253,252,223, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'gdevest.cCotatva.cbtva' AS combobox WITH ;
		BackColor = 253,252,223, ;
		BorderStyle = 0, ;
		BoundTo = .T., ;
		ColumnCount = 1, ;
		ControlSource = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 25, ;
		Margin = 0, ;
		Name = "cbtva", ;
		ReadOnly = .F., ;
		RowSourceType = 2, ;
		Style = 2, ;
		Top = 23, ;
		Width = 100
		*< END OBJECT: BaseClass="combobox" />

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

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

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

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

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

	ADD OBJECT 'gdevest.cPretctva.Text1' AS textbox WITH ;
		BackColor = 253,252,223, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'gdevest.cPretcutva.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 26, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

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

	ADD OBJECT 'gdevest.cPretftva.Text1' AS textbox WITH ;
		BackColor = 253,252,223, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

	ADD OBJECT 'gnorme' AS _grdrow WITH ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 208, ;
		Left = 7, ;
		Name = "gnorme", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_norme", ;
		RowHeight = 19, ;
		TabIndex = 3, ;
		Tag = "", ;
		Top = 124, ;
		Width = 377, ;
		Column1.ColumnOrder = 6, ;
		Column1.ControlSource = "masina", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cMasina", ;
		Column1.ReadOnly = .T., ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "ansamblu", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cAnsamblu", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 75, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "denop", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDenop", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 158, ;
		Column4.ColumnOrder = 4, ;
		Column4.ControlSource = "timpn", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cTimpn", ;
		Column4.ReadOnly = .T., ;
		Column4.Sparse = .F., ;
		Column4.Width = 56, ;
		Column5.ColumnOrder = 5, ;
		Column5.ControlSource = "codop", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cCodop", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 54, ;
		Column6.ColumnOrder = 1, ;
		Column6.ControlSource = "marca", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cMarca", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 53
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'gnorme.cDenop.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire operatie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'gnorme.cMasina.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Model masina", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'gnorme.cTimpn.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Timp normat", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Label1' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "TVA", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 555, ;
		Name = "Label1", ;
		TabIndex = 9, ;
		Tag = "", ;
		Top = 553, ;
		Width = 27, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label11' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total cu TVA", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 555, ;
		Name = "Label11", ;
		TabIndex = 10, ;
		Tag = "", ;
		Top = 576, ;
		Width = 77, ;
		ZOrderSet = 14
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		Anchor = 0, ;
		BackStyle = 0, ;
		Caption = "Materiale", ;
		FontBold = .T., ;
		FontSize = 11, ;
		Height = 17, ;
		Left = 10, ;
		Name = "Label2", ;
		TabIndex = 23, ;
		Tag = "", ;
		Top = 340, ;
		Width = 96
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		BackStyle = 0, ;
		Caption = "Manoperă", ;
		FontBold = .T., ;
		FontSize = 11, ;
		Height = 17, ;
		Left = 10, ;
		Name = "Label3", ;
		TabIndex = 24, ;
		Top = 33, ;
		Width = 96
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		BackStyle = 0, ;
		Caption = "Deviz estimativ", ;
		FontBold = .T., ;
		FontSize = 11, ;
		Height = 17, ;
		Left = 432, ;
		Name = "Label4", ;
		TabIndex = 25, ;
		Top = 33, ;
		Width = 120
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label9' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total fără TVA", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 555, ;
		Name = "Label9", ;
		TabIndex = 8, ;
		Tag = "", ;
		Top = 531, ;
		Width = 84, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Text1' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTTVA", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 658, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		TabIndex = 20, ;
		TabStop = .F., ;
		Tag = "", ;
		Top = 550, ;
		Width = 132, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text7' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTFTVA", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 658, ;
		Name = "Text7", ;
		ReadOnly = .T., ;
		TabIndex = 21, ;
		TabStop = .F., ;
		Tag = "", ;
		Top = 528, ;
		Width = 132, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text9' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTCTVA", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 658, ;
		Name = "Text9", ;
		ReadOnly = .T., ;
		TabIndex = 22, ;
		TabStop = .F., ;
		Tag = "", ;
		Top = 572, ;
		Width = 132, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_but
		With This
			Select v_norme
			If Reccount('v_norme')=0
				.cmd_addm.Enabled = .F.
			Else
				.cmd_addm.Enabled = .T.
			Endif
			Select v_articole
			If Reccount('v_articole')=0
				.cmd_addart.Enabled = .F.
			Else
				.cmd_addart.Enabled = .T.
			Endif
		Endwith
		
	ENDPROC

	PROCEDURE actualizeaza_gdevest
		Thisform.LockScreen=.T.
		save_grid_tag(This.gdevest)
		*!*	podest.ca_baza1.cFiltru = 'id_lucrare='+Alltrim(Str(ocomanda.id_lucrare))
		podest.ca_baza1.afisare()
		restore_grid_tag(This.gdevest)
		Thisform.LockScreen=.F.
	ENDPROC

	PROCEDURE adauga_articole
		Local lcIdArticol,lcSql,lnSucces,lcFiltru,lcSelect
		
		Select v_articole
		lcIdArticol = Alltrim(Str(v_articole.id_articol))
		
		lcSelect = [select COUNT(*) as nr from ] + gcS + [.auto_vestimari_rep where id_lucrare = ] + Alltrim(Str(ocomanda.id_lucrare))+;
			[ and id_articol = ] + lcIdArticol
		lnSucces = goExecutor.oExecute(lcSelect,[cExistaart])
		If lnSucces < 0
			aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
			Return
		Else
			If cExistaart.nr >= 1
				aMESSAGEBOX("Material deja existent!",0+48,"Atentie")
				*!*			Select v_devest
				*!*			Locate For id_articol = v_articole.id_articol
				*!*			This.gdevest.cCantitate.SetFocus()
			Else
				lcSql = [begin pack_auto.adauga_material_de(]+Alltrim(Str(ocomanda.id_lucrare))+[,]+lcIdArticol+[,1,]+;
					[0,0,pack_contafin.getCotaTVAStandard(?gnLuna,?gnAn)*100-100,]+ Alltrim(Str(gnIdUtil))+[); end;]
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
					Return
				Endif
			Endif
			This.actualizeaza_gdevest()
			This.do_calcul
		Endif
		This.actualizeaza_but
		Select v_devest
		Locate For id_articol = v_articole.id_articol
		Thisform.gdevest.cCantitate.SetFocus()
		
		
	ENDPROC

	PROCEDURE adauga_manopera
		Local lcSelect,lcSql,lnSucces,lcId_norme
		Select v_norme
		lcId_norme = Alltrim(Str(v_norme.id_norme))
		lcTimpn = Alltrim(Str(v_norme.timpn,7,3))
		lcSelect = [select COUNT(*) as nr from ] + gcS + [.auto_vestimari_rep where id_lucrare = ] + Alltrim(Str(ocomanda.id_lucrare))+;
			[ and id_norme = ] + lcId_norme
		lnSucces = goExecutor.oExecute(lcSelect,[cExistam])
		If lnSucces < 0
			aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
			Return
		Else
			If cExistam.nr >= 1
				aMESSAGEBOX("Manopera deja existenta!",0+48,"Atentie")
			Else
				lcSql = [begin pack_auto.adauga_manopera_de(] + Alltrim(Str(ocomanda.id_lucrare))+[,]+lcId_norme+[,]+lcTimpn+[,]+;
					ALLTRIM(Str(Thisform.npret,14,gnPPretV))+[,0,pack_contafin.getCotaTVAStandard(?gnLuna,?gnAn)*100-100,]+ Alltrim(Str(gnIdUtil))+[); end;]
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
					Return
				Endif
			Endif
			This.actualizeaza_gdevest
			This.do_calcul
		Endif
		
		This.actualizeaza_but
		Select v_devest
		Locate For id_norme = v_norme.id_norme
		Thisform.gdevest.cCantitate.SetFocus()
		
	ENDPROC

	PROCEDURE do_calcul
		STORE 0 TO thisform.totctva,thisform.totftva,thisform.tottva
		
		If Reccount('v_devest')>0
			SELECT v_devest
				SUM(valftva) to thisform.totftva
				SUM(valtva) to thisform.tottva
				SUM(valoare) to thisform.totctva
		Endif
		
		Thisform.text7.Refresh
		THISFORM.text1.Refresh
		Thisform.text9.Refresh
	ENDPROC

	PROCEDURE do_cautaart
		Local lcFiltru
		Local lcArticol, lnCriteriu
		
		lcFiltru=[2=2]
		lcArticol = UPPER(ALLTRIM(Strtran(Thisform.cb_articol.Text.Value,['],[''])))
		lnCriteriu = Val(Alltrim(Thisform.cb_articol.criteriu.Value))
		*lnCriteriu = Thisform.cb_articol.criteriu.Value
		Do Case
			Case lnCriteriu=1
				lcFiltru = [(denumire LIKE '] + lcArticol + [%'] + [ or codmat LIKE '] + m.lcArticol + [%')]
			Case lnCriteriu=2
				lcFiltru = [(denumire ='] + lcArticol + ['] + [ or codmat ='] + m.lcArticol + [')]
			Case lnCriteriu=3
				lcFiltru = [(denumire !='] + lcArticol + ['] + [or codmat !='] + m.lcArticol + [')]
			Case lnCriteriu=4
				lcFiltru = [(denumire LIKE '%] + lcArticol + [%'] + [or codmat LIKE '%] + m.lcArticol + [%')]
			Case lnCriteriu=5
				lcFiltru = [(denumire NOT LIKE '%] + lcArticol + [%'] + [or codmat NOT LIKE '%] + m.lcArticol + [%')]
			Case lnCriteriu=6
				lcFiltru = [2=2]
		Endcase
		This.MousePointer= 11
		This.LockScreen=.T.
		save_grid_tag(This.garticole)
		Do ccarticole In update_devize.prg With lcFiltru
		restore_grid_tag(This.garticole)
		If Reccount('v_articole')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.cb_articol.SetFocus()
		Endif
		This.actualizeaza_but
		This.LockScreen=.F.
		This.MousePointer= 0
		 
	ENDPROC

	PROCEDURE do_cautadevest
		Local lcFiltru
		Local lcDevEst, lnCriteriu
		
		lcFiltru=[2=2]
		lcDevEst = UPPER(ALLTRIM(Strtran(Thisform.cb_devest.Text.Value,['],[''])))
		lnCriteriu = Val(Alltrim(Thisform.cb_devest.criteriu.Value))
		*lnCriteriu = Thisform.cb_devest.criteriu.Value
		Do Case
			Case lnCriteriu=1
				lcFiltru = [(denumire LIKE '] + m.lcDevEst + [%'] + [ or cod LIKE '] + m.lcDevEst + [%')]
			Case lnCriteriu=2
				lcFiltru = [(denumire ='] + m.lcDevEst + ['] + [ or cod ='] + m.lcDevEst + [')]
			Case lnCriteriu=3
				lcFiltru = [(denumire !='] + m.lcDevEst + ['] + [or cod !='] + m.lcDevEst + [')]
			Case lnCriteriu=4
				lcFiltru = [(denumire LIKE '%] + m.lcDevEst + [%'] + [or cod LIKE '%] + m.lcDevEst + [%')]
			Case lnCriteriu=5
				lcFiltru = [(denumire NOT LIKE '%] + m.lcDevEst + [%'] + [or cod NOT LIKE '%] + m.lcDevEst + [%')]
			Case lnCriteriu=6
				lcFiltru = [2=2]
		Endcase
		
		This.MousePointer= 11
		This.LockScreen=.T.
		*this.actualizeaza_gdevest()
		save_grid_tag(This.gdevest)
		podest.ca_baza1.cFiltru = lcFiltru + ' and id_lucrare = ' + Alltrim(Str(ocomanda.id_lucrare))
		podest.ca_baza1.afisare()
		restore_grid_tag(This.gdevest)
		If Reccount('v_devest')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.cb_devest.SetFocus()
		Endif
		This.do_calcul
		This.actualizeaza_but
		
		This.LockScreen=.F.
		This.MousePointer= 0
		 
	ENDPROC

	PROCEDURE do_cautam
		Local lcFiltru
		lcFiltru=[2=2]
		lcDenop = Strtran(Upper(Alltrim(Thisform.cb_manop.Text.Value)),['],[''])
		lnCriteriu = VAL(ALLTRIM(Thisform.cb_manop.criteriu.Value))
		*lnCriteriu = Thisform.cb_manop.criteriu.Value
		Do Case
		Case lnCriteriu=1
			lcFiltru = [denop LIKE '] + Upper(Alltrim(lcDenop)) + [%']
		Case lnCriteriu=2
			lcFiltru = [denop ='] + Upper(Alltrim(lcDenop)) + [']
		Case lnCriteriu=3
			lcFiltru = [denop !='] + Upper(Alltrim(lcDenop)) + [']
		Case lnCriteriu=4
			lcFiltru = [denop LIKE '%] + Upper(Alltrim(lcDenop)) + [%']
		Case lnCriteriu=5
			lcFiltru = [denop NOT LIKE '%] + Upper(Alltrim(lcDenop)) + [%']
		Case lnCriteriu=6
			lcFiltru = [2=2]
		*!*	Case lnCriteriu=7
		*!*		lcFiltru = [denop is not null]
		Endcase
		This.MousePointer= 11
		This.LockScreen=.T.
		save_grid_tag(this.gnorme)
		Do ccnorme_devest In update_devize.prg WITH lcFiltru
		restore_grid_tag(this.gnorme)
		*Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('v_norme')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.cb_manop.SetFocus()
		ENDIF
		this.actualizeaza_but
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_listare
		If Reccount('v_devest')>0
			
		
				Private pdDataora,pcdataora,pntotaltn,pntotalval,pofirma,pcschema,pcselect,pcorder,pcfiltru,pnTotalTva,pnTotalGen  
				Store '' To pofirma,pcschema,pcselect,pcorder,pcfiltru
		
				If Used('crsFirma')
					Use In crsfirma
				Endif
				lcSql = [select localitate,strada,numar,cod_fiscal,reg_comert from syn_nom_firme ] + ;
					[where id_firma = ?gnIdFirma]		&&	modificare	v 2.0.29 : am inlocuit gnId_Firma
				lnSucces=goExecutor.oExecute(lcSql,[crsfirma])
				If lnSucces<0
					AMessagebox(goExecutor.cEroare,0+16,'Eroare')
					Return
				Endif
		
				Sele crsfirma
				Scatter Name firma
				Use In crsfirma
		
				If Used('crslistare')
					Use In crslistare
				Endif
				*!*	modificare	v 2.0.37 : am pus a.kmint in loc de b.kmint
				lcSql=[select a.nrord,a.nume,a.cod_fiscal,a.datai,a.asigurator,a.inspector,] + ;
					[a.banca,a.cont_banca,a.adresa,a.nr_dosar,a.reg_comert,a.tip_persoana,] + ;
					[b.nrinmat,b.series,b.seriem,b.culoare,a.kmint,b.marca,b.masina ] + ;
					[from ] + gcS + [.auto_vordl a ] + ;
					[left join ] + gcS + [.auto_vmasiniclienti b on a.id_masiniclient=b.id_masiniclient ] + ;
					[where a.id_ordl = ?ocomanda.id_ordl]
				lnSucces=goExecutor.oExecute(lcSql,'crslistare')
				If lnSucces<0
					amessagebox(goExecutor.cEroare,0+16,'Eroare')
					Return
				Endif
				Select crslistare
				Scatter Name olistare Memo
				Use In crslistare
		
				pcdataora=get_ora(2)
				pdDataora=Ttod(Ctot(pcdataora))
		
		
				SELECT olistare.nrord As nrord,IIF(!ISNULL(id_norme),'B','A') as semn,cod,um,denumire,cantitate,pretftva,valftva,id_dev_estimare_rep From v_devest;
					Order By 2,8 Into Cursor crslistare
				
				pnTotalTva = this.tottva
				pnTotalGen = this.totctva
				
				If Used('crslistare')
					Thisform.AlwaysOnTop=.F.
					Select crslistare
		
					goExport.export2frx([crslistare],[rap_devizest],.F., , , , , .T.)	&&	modificare v 2.1.9
					Thisform.AlwaysOnTop=.T.
					Use In crslistare
				Endif
			
		Else
			amessagebox("Nu exista manopera si materiale pe aceasta comanda!",0+48,"Atentie")
		Endif
		
		
	ENDPROC

	PROCEDURE do_modifica
		Lparameters tnColoana
		Local lcValoareNoua,lnRecNo
		If Empty(tnColoana)
			Return
		Endif
		Thisform.lsalvat=.T.
		Select v_devest
		pnid_dev_estimare_rep=id_dev_estimare_rep
		Do Case
		Case tnColoana=1 && pret cu TVA
			lcValoareNoua=Alltrim(Str(Thisform.npretctvam,20,gnPPretV))
			If Thisform.npretctvam<0
				amessagebox("Pretul nu poate fi negativ!",0+48,"Atentie")
				thisform.lvalidat=.f.
				return
			ELSE && pret fara TVA
				lcSql=[begin pack_auto.modifica_pret_de(]+ALLTRIM(STR(pnid_dev_estimare_rep))+[,]+lcValoareNoua+;
						[,1,]+ALLTRIM(STR(gnIdUtil))+[); end;]
				loColoana=thisform.gdevest.cPretctva
				Thisform.lvalidat=.t.
			ENDIF 	
				
		Case tnColoana=2
			lcValoareNoua=Alltrim(Str(Thisform.npretftvam,20,gnPPretV))
			If Thisform.npretftvam<0
				amessagebox("Pretul nu poate fi negativ!",0+48,"Atentie")
				thisform.lvalidat=.f.
				return
			else
				lcSql=[begin pack_auto.modifica_pret_de(]+ALLTRIM(STR(pnid_dev_estimare_rep))+[,]+lcValoareNoua+;
						[,0,]+ALLTRIM(STR(gnIdUtil))+[); end;]
				loColoana=thisform.gdevest.cPretftva
				Thisform.lvalidat=.t.
			ENDIF 
				
		Case tnColoana=3
			lcValoareNoua=Alltrim(Str(Thisform.ntvam))
			lcSql=[begin pack_auto.modifica_cota_tva_de(]+ALLTRIM(STR(pnid_dev_estimare_rep))+[,]+lcValoareNoua+[,]+ALLTRIM(STR(gnIdUtil))+[); end;]
			loColoana=thisform.gdevest.cCotatva
			Thisform.lvalidat=.t.
						
		Case tnColoana=4
			lcValoareNoua=Alltrim(Str(Thisform.ncantm,20,gnPCANT))
			If Thisform.ncantm<0
				amessagebox("Cantitatea nu poate fi negativa!",0+48,"Atentie")
				thisform.lvalidat = .f.
				return
			else
				lcSql=[begin pack_auto.modifica_cantitate_de(]+ALLTRIM(STR(pnid_dev_estimare_rep))+[,]+lcValoareNoua+[,]+ALLTRIM(STR(gnIdUtil))+[); end;]
				loColoana=thisform.gdevest.cCantitate
				Thisform.lvalidat=.t.		
			ENDIF 	
		Endcase
		
		lnSucces=goExecutor.oExecute(lcSql)
		If lnSucces < 0
			Thisform.lvalidat=.F.
			amessagebox(goExecutor.cEroare,0+16,'Eroare')
		ELSE
			Thisform.lvalidat=.T.
			
		Endif
		loColoana.text1.Refresh()
		
		SELECT v_devest
		lnRecNo=Recno()
		*SET STEP ON
		this.cmd_cauta3.SetFocus 
		this.actualizeaza_gdevest()
		thisform.do_calcul()
		If Reccount('v_devest')<lnRecNo
			lnRecNo=Reccount('v_devest')
		Endif
		If lnRecNo>0
			Select v_devest
			Go lnRecNo
		
		Endif
		this.gdevest.SetFocus 
	ENDPROC

	PROCEDURE do_sterge
		LOCAL lcSql,lnSucces
		PRIVATE pnIdDevEstRep 
		Select v_devest
		pnIdDevEstRep = id_dev_estimare_rep
		If !Empty(Nvl(pnIdDevEstRep,0))
			lcSql = [begin pack_auto.sterge_articol_de(]+Alltrim(Str(pnIdDevEstRep ))+[,]+Alltrim(Str(gnIdUtil))+[); end;]
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
				Return
			Endif
		ENDIF
		this.actualizeaza_gdevest
		this.do_calcul
		thisform.gdevest.SetFocus
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Local lcSql,lcCursor,lnSucces
		lcSql = [select distinct cota_tva from ] + gcS + [.jtva_coloane where sters = 0 and afisat = 1 ]+;
			[and jv = 1 order by cota_tva desc]
		lcCursor = [cCotatva]
		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		If lnSucces < 0
			aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
			Return
		Else
			SELECT cCotatva
			GO top
			This.gdevest.cCotatva.cbtva.RowSource = [cCotatva.cota_tva]
		Endif
		If Reccount('v_devest')>0
			This.do_calcul()
		Endif
		This.cmd_addm.Enabled= .F.
		This.cmd_addart.Enabled= .F.
		
		This.WindowState = 2
		Thisform.Resize
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcControlp = Upper(Alltrim(This.ActiveControl.Parent.Name))
		lcControl = Upper(Alltrim(This.ActiveControl.Name))
		
		Do Case
			Case nKeyCode = 13 And lcControlp = 'CB_MANOP'
				Nodefault
				This.do_cautam()
			Case nKeyCode = 13 And lcControlp = 'CB_ARTICOL'
				Nodefault
				This.do_cautaart()
			Case nKeyCode = 13 And lcControlp = 'CB_DEVEST'
				Nodefault
				This.do_cautadevest()
			Case nKeyCode = 13 And lcControl = 'GNORME' And This.cmd_addm.Enabled = .T.  && enter
				Nodefault
				This.adauga_manopera()
			Case nKeyCode = 13 And lcControl = 'GARTICOLE' And This.cmd_addart.Enabled = .T.
				Nodefault
				This.adauga_articole()
			CASE nKeyCode = 9 AND lcControl = 'GNORME' && tab
				Nodefault
				thisform.cb_articol.text.SetFocus
				
			CASE nKeyCode = 9 AND lcControl = 'GARTICOLE'
				Nodefault
				thisform.cb_devest.text.SetFocus
			CASE nKeyCode = 9 AND lcControl = 'GDEVEST' AND thisform.lsalvat = .t.
				Nodefault
				THISFORM.Cb_tx_simplu2.SetFocus
			Case (nKeyCode=32 And lcControl = 'GNORME') Or ;
					((nKeyCode >=33 And nKeyCode <=122) And (lcControl = 'GNORME'))
				Nodefault
				Thisform.cb_manop.Text.SetFocus
				Thisform.cb_manop.Text.Value = Alltrim(Thisform.cb_manop.Text.Value) + Chr(nKeyCode)
				Keyboard '{END}'
			Case (nKeyCode=32 And lcControl = 'GARTICOLE') Or ;
					((nKeyCode >=33 And nKeyCode <=122) And (lcControl = 'GARTICOLE'))
				Nodefault
				Thisform.cb_articol.Text.SetFocus
				Thisform.cb_articol.Text.Value = Alltrim(Thisform.cb_articol.Text.Value) + Chr(nKeyCode)
				Keyboard '{END}'
			Case (nKeyCode = 127) And (lcControl = 'GNORME')					&& backspace
				Nodefault
				Thisform.cb_manop.Text.Value = Left(Alltrim(Thisform.cb_manop.Text.Value),Len(Alltrim(Thisform.cb_manop.Text.Value))-1)
				Thisform.cb_manop.Text.SetFocus
				Keyboard '{END}'
			Case (nKeyCode = 127) And (lcControl = 'GARTICOLE')					&& backspace
				Nodefault
				Thisform.cb_articol.Text.Value = Left(Alltrim(Thisform.cb_articol.Text.Value),Len(Alltrim(Thisform.cb_articol.Text.Value))-1)
				Thisform.cb_articol.Text.SetFocus
				Keyboard '{END}'
			Case (nKeyCode = 127) And (lcControl = 'GDEVEST')					&& backspace
				Nodefault
				Thisform.CB_devest.Text.Value = Left(Alltrim(Thisform.CB_devest.Text.Value),Len(Alltrim(Thisform.CB_devest.Text.Value))-1)
				Thisform.CB_devest.Text.SetFocus
				Keyboard '{END}'
			Case nKeyCode = 7 And lcControl = 'GDEVEST' && DEL
				Nodefault
				If Pemstatus(This,"do_sterge",5)
					This.do_sterge()
				Endif
			Case nKeyCode=6 And nShiftAltCtrl=2 && CTRL + F
				Nodefault
				This.do_termin()
			Case nKeyCode=16 And nShiftAltCtrl=2  && CTRL + P
				Nodefault
				If Pemstatus(This,"do_listare",5)
					This.do_listare()
				Endif
			
		Endcase
		
		
	ENDPROC

	PROCEDURE Resize
		thisform.Refresh
	ENDPROC

	PROCEDURE Cb_articol.Init
		this.criteriu.Value = [1]
	ENDPROC

	PROCEDURE Cb_devest.Init
		this.criteriu.Value = [1]
	ENDPROC

	PROCEDURE Cb_manop.Init
		this.criteriu.Value = [1]
	ENDPROC

	PROCEDURE Cb_tx_simplu2._CBBASE1.Init
		thisform.npret = v_preturi.pret
	ENDPROC

	PROCEDURE Cb_tx_simplu2._CBBASE1.InteractiveChange
		thisform.npret = v_preturi.pret
	ENDPROC

	PROCEDURE cmd_addart.Click
		thisform.adauga_articole
	ENDPROC

	PROCEDURE cmd_addm.Click
		thisform.adauga_manopera
	ENDPROC

	PROCEDURE garticole.AfterRowColChange
		LPARAMETERS nColIndex
		thisform.actualizeaza_but
	ENDPROC

	PROCEDURE gdevest.cCantitate.Text1.GotFocus
		Thisform.ncanti=This.Value
		Thisform.ncantm=This.Value
		Thisform.lvalidat=.T.
	ENDPROC

	PROCEDURE gdevest.cCantitate.Text1.InteractiveChange
		Thisform.ncantm=This.Value
		Thisform.lsalvat=.F.
	ENDPROC

	PROCEDURE gdevest.cCantitate.Text1.LostFocus
		If Thisform.ncanti!=Thisform.ncantm And Thisform.lsalvat=.F.
			Thisform.do_modifica(4)
		ENDIF
		
	ENDPROC

	PROCEDURE gdevest.cCantitate.Text1.Valid
		
		
	ENDPROC

	PROCEDURE gdevest.cCotatva.cbtva.GotFocus
		Thisform.ntvai=This.Value
		Thisform.ntvam=This.Value
		Thisform.lvalidat=.T.
	ENDPROC

	PROCEDURE gdevest.cCotatva.cbtva.InteractiveChange
		thisform.ntvam = this.Value
		thisform.lsalvat=.f.
		
	ENDPROC

	PROCEDURE gdevest.cCotatva.cbtva.LostFocus
		If Thisform.ntvai!=Thisform.ntvam And Thisform.lsalvat=.F.
			Thisform.do_modifica(3)
		Endif
	ENDPROC

	PROCEDURE gdevest.cCotatva.Text1.GotFocus
		Thisform.nProcTVAi=This.Value
		Thisform.nProcTVAm=This.Value
		Thisform.lvalidat=.T.
	ENDPROC

	PROCEDURE gdevest.cCotatva.Text1.InteractiveChange
		Thisform.nProcTVAm=This.Value
		Thisform.lsalvat=.F.
	ENDPROC

	PROCEDURE gdevest.cCotatva.Text1.LostFocus
		If Thisform.npretctvai!=Thisform.npretctvam And Thisform.lsalvat=.F.
			Thisform.do_modifica(1)
		Endif
	ENDPROC

	PROCEDURE gdevest.cPretctva.Text1.GotFocus
		Thisform.npretctvai=This.Value
		Thisform.npretctvam=This.Value
		Thisform.lvalidat=.T.
	ENDPROC

	PROCEDURE gdevest.cPretctva.Text1.InteractiveChange
		Thisform.npretctvam=This.Value
		Thisform.lsalvat=.F.
	ENDPROC

	PROCEDURE gdevest.cPretctva.Text1.LostFocus
		If Thisform.npretctvai!=Thisform.npretctvam And Thisform.lsalvat=.F.
			Thisform.do_modifica(1)
		Endif
	ENDPROC

	PROCEDURE gdevest.cPretftva.Text1.GotFocus
		Thisform.npretftvai=This.Value
		Thisform.npretftvam=This.Value
		Thisform.lvalidat=.T.
	ENDPROC

	PROCEDURE gdevest.cPretftva.Text1.InteractiveChange
		Thisform.npretftvam=This.Value
		Thisform.lsalvat=.F.
	ENDPROC

	PROCEDURE gdevest.cPretftva.Text1.LostFocus
		If Thisform.npretftvai!=Thisform.npretftvam And Thisform.lsalvat=.F.
			Thisform.do_modifica(2)
		Endif
	ENDPROC

	PROCEDURE gnorme.AfterRowColChange
		LPARAMETERS nColIndex
		
		DODEFAULT()
		
		thisform.actualizeaza_but
	ENDPROC

	PROCEDURE Lb_titlu_alb_b121.Init
		This.Caption=This.Caption+Space(2)+Alltrim(Nvl(ocomanda.nrord,''))
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_gencom 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="Ed_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_operatii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_nrord" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_asigurator" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_inspector" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_nrinmat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_marca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_model" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_series" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_kmint" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_termen" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_nrdosar" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_referinta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_client" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cDenop.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cDenop.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cSelectat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnorme.cSelectat.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_titlu_operatii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_manopera" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_manopera" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_cilindree" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_putere" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_putere.Text_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_putere._lbbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: aleg_client
		*m: aleg_referinta
		*m: do_modifica_operatii
		*p: casig
		*p: cclient
		*p: cdefectiuni
		*p: cfurnizor
		*p: cinspector
		*p: cmarca
		*p: cnrcom
		*p: cnrcomanda
		*p: cnrdosar
		*p: cnrinmat
		*p: cobservatii
		*p: coperatii
		*p: cpartref		&& Nume partener care a referit comanda
		*p: cseriem
		*p: cseries
		*p: csiridoperatii
		*p: ctipm
		*p: ddataachi
		*p: dtermen
		*p: llistare
		*p: lmodificare
		*p: lverificari		&& .T. Daca se fac verificari pentru km la bord si termen.
		*p: nanfabricatie
		*p: ncilindree
		*p: nidasig
		*p: nidclie
		*p: nidinsp
		*p: nidmc
		*p: nidpartref		&& Id partener care a referit comanda
		*p: nid_masina
		*p: nkmint
		*p: nnrachi
		*p: nordine
		*p: norefct
		*p: nputerecp
		*p: nputerekw
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		Caption = "Form"
		casig = 
		cclient = 
		cdefectiuni = 
		cfurnizor = 
		cinspector = 
		cmarca = 
		cnrcom = 
		cnrcomanda = 
		cnrdosar = 
		cnrinmat = 
		cobservatii = 
		coperatii = 
		cpartref = 
		cseriem = 
		cseries = 
		csiridoperatii = 
		ctipm = 
		ddataachi = {}
		DoCreate = .T.
		dtermen = {}
		Height = 482
		lverificari = .T.
		Name = "frm_gencom"
		nanfabricatie = 
		ncilindree = 0
		nidasig = 0
		nidclie = 0
		nidinsp = 0
		nidmc = 0
		nidpartref = 0
		nid_masina = 0
		nkmint = 0
		nnrachi = 0
		nordine = 0
		norefct = 0
		nputerecp = 0
		nputerekw = 0
		Width = 755
		_memberdata = <VFPData>
			<memberdata name="nidpartref" display="nIdPartRef"/>
			<memberdata name="cpartref" display="cPartRef"/>
			<memberdata name="ncilindree" display="nCilindree"/>
			<memberdata name="nputerecp" display="nPutereCP"/>
			<memberdata name="nputerekw" display="nPutereKW"/>
			<memberdata name="cobservatii" display="cObservatii"/>
			<memberdata name="norefct" display="nOreFct"/>
			<memberdata name="cdefectiuni" display="cDefectiuni"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 756
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 693
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 63
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Generare comanda noua"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 23
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 725
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 20
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 696, ;
		Name = "But_renunt1", ;
		TabIndex = 21, ;
		Top = 1, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_asigurator' AS cb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Cb_asigurator", ;
		TabIndex = 2, ;
		Top = 88, ;
		ZOrderSet = 7, ;
		_cbbase1.ControlSource = "thisform.casig", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_asiguratori.asigurator", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Caption = "Asigurator:", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_inspector' AS cb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Cb_inspector", ;
		TabIndex = 3, ;
		Top = 116, ;
		ZOrderSet = 8, ;
		_cbbase1.ControlSource = "thisform.cinspector", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_inspectori.inspector", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Caption = "Inspector:", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_manopera' AS cb_tx_cautare WITH ;
		cpornire = 1, ;
		Left = 420, ;
		Name = "Cb_manopera", ;
		TabIndex = 16, ;
		Top = 56, ;
		ZOrderSet = 21, ;
		Text.Name = "Text", ;
		criteriu.Name = "criteriu"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_cilindree' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "clb_cilindree", ;
		TabIndex = 11, ;
		TabStop = .T., ;
		Top = 352, ;
		Width = 105, ;
		ZOrderSet = 13, ;
		Text_simplu1.ControlSource = "thisform.nCilindree", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 56, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 45, ;
		Lb_simplu1.Caption = "Cilindree", ;
		Lb_simplu1.Left = 3, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_kmint' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_kmint", ;
		TabIndex = 13, ;
		TabStop = .T., ;
		Top = 380, ;
		ZOrderSet = 14, ;
		Text_simplu1.ControlSource = "thisform.nkmint", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Km. la bord", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_marca' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_marca", ;
		TabIndex = 8, ;
		TabStop = .T., ;
		Top = 268, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "thisform.cmarca", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Marca mașinii", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_model' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_model", ;
		TabIndex = 9, ;
		TabStop = .T., ;
		Top = 296, ;
		ZOrderSet = 11, ;
		Text_simplu1.ControlSource = "thisform.ctipm", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Modelul mașinii", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_nrdosar' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_nrdosar", ;
		TabIndex = 4, ;
		TabStop = .T., ;
		Top = 144, ;
		ZOrderSet = 16, ;
		Text_simplu1.ControlSource = "thisform.cnrdosar", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Numar dosar", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_nrinmat' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_nrinmat", ;
		TabIndex = 7, ;
		TabStop = .T., ;
		Top = 240, ;
		ZOrderSet = 9, ;
		Text_simplu1.ControlSource = "thisform.cnrinmat", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Nr. înmatriculare", ;
		Lb_simplu1.Left = 7, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_nrord' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_nrord", ;
		TabIndex = 1, ;
		Top = 44, ;
		ZOrderSet = 6, ;
		Text_simplu1.ControlSource = "thisform.cnrcom", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Numar comanda", ;
		Lb_simplu1.Left = 5, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_putere' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 116, ;
		Name = "clb_putere", ;
		TabIndex = 12, ;
		TabStop = .T., ;
		Top = 352, ;
		Width = 186, ;
		ZOrderSet = 13, ;
		Text_simplu1.ControlSource = "thisform.nPutereCP", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 89, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 42, ;
		Lb_simplu1.Caption = "Putere CP/KW", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_putere._lbbase1' AS _lbbase WITH ;
		Caption = "/", ;
		Left = 133, ;
		Name = "_lbbase1", ;
		Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'clb_putere.Text_simplu2' AS _txbase WITH ;
		ControlSource = "thisform.nPutereKW", ;
		Height = 23, ;
		Left = 140, ;
		Name = "Text_simplu2", ;
		ReadOnly = .T., ;
		Top = 3, ;
		Width = 42
		*< END OBJECT: ClassLib="..\comun\clase\_tx_base.vcx" BaseClass="textbox" />

	ADD OBJECT 'Clb_series' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_series", ;
		TabIndex = 10, ;
		TabStop = .T., ;
		Top = 324, ;
		ZOrderSet = 13, ;
		Text_simplu1.ControlSource = "thisform.cseries", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Serie șasiu", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_termen' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_termen", ;
		TabIndex = 15, ;
		TabStop = .T., ;
		Top = 436, ;
		ZOrderSet = 15, ;
		Text_simplu1.ControlSource = "thisform.dtermen", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Termen", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 14, ;
		TabStop = .T., ;
		Top = 408, ;
		ZOrderSet = 14, ;
		Text_simplu1.ControlSource = "thisform.nOreFct", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Ore functionare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_client' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(thisform.nidclie), ;
		cprocedura = thisform.aleg_client, ;
		cvar_afisata = thisform.cclient, ;
		Height = 31, ;
		Left = 11, ;
		Name = "Ct_clb_client", ;
		TabIndex = 5, ;
		Top = 171, ;
		Width = 325, ;
		ZOrderSet = 17, ;
		img_cautare.Left = 300, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Height = 29, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Client", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Left = 1, ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 99, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Top = 3, ;
		clb_tx_cautare.Top = 1, ;
		clb_tx_cautare.Width = 290
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_referinta' AS ct_clb_cautare WITH ;
		cconditie = 1=2, ;
		cprocedura = thisform.aleg_referinta, ;
		cvar_afisata = thisform.cPartRef, ;
		Height = 31, ;
		Left = 11, ;
		Name = "Ct_clb_referinta", ;
		TabIndex = 6, ;
		Top = 199, ;
		Width = 325, ;
		ZOrderSet = 17, ;
		img_cautare.Left = 300, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Height = 29, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Referinta", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Left = 1, ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 99, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.ToolTipText = "Partenerul care a referit comanda (ex: brocker). Pentru modificare apasati DEL sau butonul din dreapta ", ;
		clb_tx_cautare.Text_simplu1.Top = 3, ;
		clb_tx_cautare.Top = 1, ;
		clb_tx_cautare.Width = 290
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ed_operatii' AS ed_tx_simplu WITH ;
		Height = 220, ;
		Left = 340, ;
		Name = "Ed_operatii", ;
		TabIndex = 22, ;
		Top = 44, ;
		Width = 396, ;
		ZOrderSet = 0, ;
		_edbase1.ControlSource = "Thisform.coperatii", ;
		_edbase1.Height = 301, ;
		_edbase1.Left = 13, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.ReadOnly = .T., ;
		_edbase1.Top = 27, ;
		_edbase1.Width = 374, ;
		_lbbase1.Caption = "Operatii cerute de client", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Height = 106, ;
		Left = 340, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 18, ;
		Top = 264, ;
		Width = 396, ;
		ZOrderSet = 0, ;
		_edbase1.ControlSource = "Thisform.cObservatii", ;
		_edbase1.Height = 70, ;
		_edbase1.Left = 13, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.ReadOnly = .F., ;
		_edbase1.Top = 27, ;
		_edbase1.Width = 374, ;
		_lbbase1.Caption = "Observatii", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ed_tx_simplu2' AS ed_tx_simplu WITH ;
		Height = 106, ;
		Left = 340, ;
		Name = "Ed_tx_simplu2", ;
		TabIndex = 19, ;
		Top = 369, ;
		Width = 396, ;
		ZOrderSet = 0, ;
		_edbase1.ControlSource = "Thisform.cDefectiuni", ;
		_edbase1.Height = 70, ;
		_edbase1.Left = 13, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.ReadOnly = .F., ;
		_edbase1.Top = 27, ;
		_edbase1.Width = 374, ;
		_lbbase1.Caption = "Defectiuni constatate", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'grdnorme' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 176, ;
		Left = 340, ;
		Name = "grdnorme", ;
		Panel = 1, ;
		RecordSource = "v_norme", ;
		TabIndex = 17, ;
		Top = 88, ;
		Width = 396, ;
		ZOrderSet = 18, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "denop", ;
		Column1.FontName = "Arial", ;
		Column1.Name = "cDenop", ;
		Column1.ReadOnly = .T., ;
		Column1.Tag = "W", ;
		Column1.Width = 304, ;
		Column2.ColumnOrder = 1, ;
		Column2.ControlSource = "ales", ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cSelectat", ;
		Column2.ReadOnly = .F., ;
		Column2.Sparse = .F., ;
		Column2.Width = 51
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdnorme.cDenop.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire operatie", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdnorme.cSelectat.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 21, ;
		Name = "Check1", ;
		ReadOnly = .F., ;
		Top = 43, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grdnorme.cSelectat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Selectat", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Lb_manopera' AS lb_simplu WITH ;
		Caption = "Manopera", ;
		Left = 350, ;
		Name = "Lb_manopera", ;
		TabIndex = 25, ;
		Top = 61, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'lb_titlu_operatii' AS lb_titlu_negru_b12 WITH ;
		Caption = "Operatii cerute de client", ;
		Left = 343, ;
		Name = "lb_titlu_operatii", ;
		TabIndex = 24, ;
		Top = 33, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru,tcFiltru2
		Local lcFiltru,lcFiltru2
		
		lcFiltru=tcFiltru
		If Empty(lcFiltru)
			lcFiltru=''
		Endif
		lcFiltru2=tcFiltru2
		If Empty(lcFiltru2)
			lcFiltru2=''
		Endif
		
		With Thisform
			Select v_norme
			Go Top
			Select * From v_norme Where ales!=0 Into Cursor crsalese
			save_grid_tag(.grdnorme)
			If !Empty(lcFiltru2)
				Select * From crsalese Into Cursor crstoate
			Else
				=update_norme(lcFiltru)
				Select * From crsalese ;
					Union ;
					Select * From v_norme Where id_norme Not In (Select id_norme From crsalese) Into Cursor crstoate
			Endif
			If Used('v_norme')
				Use In v_norme
			Endif
			Select * From crstoate Order By ales Desc,ordine,denop Asc,masina Asc Into Cursor v_norme Readwrite
			Use In crstoate
			Go Top
			restore_grid_tag(.grdnorme)
			.grdnorme.cdenop.SetFocus()
		Endwith
	ENDPROC

	PROCEDURE aleg_client
		Local omasclie
		If Thisform.lmodificare=.F. And !Thisform.llistare
		*!*	DO viz_clienti IN onom_devize.prg
			omasclie = viz_clienti(.T.)	&&	modificare v 2.1.1	:	.T. > doar masinile active
			If !Empty(omasclie.id_partener)
				lcComanda=Iif(Empty(Thisform.cnrcom),Alltrim(pcNr),Alltrim(Thisform.cnrcom))
				lcNrComanda=IIF(AT([/],lcComanda)>0,SUBSTR(lcComanda,1,AT([/],lcComanda)-1),lcComanda)
				Thisform.cmarca = omasclie.marca
				Thisform.ctipm = omasclie.masina
				Thisform.cnrinmat = omasclie.nrinmat
				Thisform.cclient = omasclie.partener
				Thisform.cnrcom = lcNrComanda + "/" + Alltrim(omasclie.nrinmat)
				Thisform.nidclie = omasclie.id_partener
				Thisform.nidmc = omasclie.id_masiniclient
				Thisform.nid_masina = omasclie.id_masina
				Thisform.cseries = omasclie.series
				Thisform.cseriem = omasclie.seriem
				Thisform.cfurnizor = omasclie.furnizor
				Thisform.nnrachi = omasclie.nrachi
		*!*			Thisform.ddataachi = Iif(Type("omasclie.dataachi")='D',omasclie.dataachi,Ttod(omasclie.dataachi))
				thisform.nanfabricatie = omasclie.anfabricatie
				Thisform.nkmint = omasclie.kmint
				Thisform.nCilindree = omasclie.cilindree
				Thisform.nPutereCP = omasclie.puterecp
				Thisform.nPutereKW = omasclie.puterekw	
				thisform.nOreFct = omasclie.ore_functionare
						
				Thisform.Refresh
				Thisform.ct_clb_referinta.clb_tx_cautare.text_simplu1.SetFocus()
			Endif
		Endif
		
	ENDPROC

	PROCEDURE aleg_referinta
		Local loCauta
		If Thisform.lmodificare=.F. And !Thisform.llistare
		
			loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Cauta referinta in clienti]))
			If m.gnButon = 1
				Thisform.nIdPartRef = loCauta.id_part
				Thisform.cPartRef = loCauta.denumire
				thisform.ct_clb_referinta.Refresh()
				Thisform.clb_kmint.SetFocus()
			ENDIF
		Endif
		
	ENDPROC

	PROCEDURE Destroy
		*!* 31.08.2015
		*!* marius.mutu
		*!*	salvare id partener care a referit comanda
		
		pcNr = Thisform.cnrcom
		*!*	WAIT WINDOW this.cinspector
		*!*	RETURN thisform.cnrcom
		pnIdInsp = Thisform.nidinsp
		pnIdAsig = Thisform.nidasig
		pnIdMC = Thisform.nidmc
		pnIdClie = Thisform.nidclie
		pnId_masina = Thisform.nid_masina
		pnKmInt = Thisform.nkmint
		pdTermen = Thisform.dtermen
		pcNrDosar = Alltrim(Thisform.cnrdosar)
		pcSirIDOperatiiClient = ALLTRIM(SUBSTR(STRTRAN(Thisform.csiridoperatii,[><],[,]),2,LEN(STRTRAN(Thisform.csiridoperatii,[><],[,]))-2))
		pnIdPartRef = thisform.nIdPartRef
		
		pcObservatii = ALLTRIM(thisform.cObservatii)
		pcDefectiuni = ALLTRIM(thisform.cDefectiuni)
		pnOreFct = thisform.nOreFct
		
		If Type('ocomlistare')<>'U'
			AddProperty(ocomlistare,'marca',Alltrim(Thisform.cmarca))
			AddProperty(ocomlistare,'nrinmat',Alltrim(Thisform.cnrinmat))
			AddProperty(ocomlistare,'masina',Alltrim(Thisform.ctipm))
			AddProperty(ocomlistare,'nrord',Alltrim(Thisform.cnrcom))
			AddProperty(ocomlistare,'nume',Alltrim(Thisform.cclient))
			AddProperty(ocomlistare,'series',Alltrim(Thisform.cseries))
			AddProperty(ocomlistare,'seriem',Alltrim(Thisform.cseriem))
			AddProperty(ocomlistare,'asigurator',Alltrim(Thisform.casig))
			AddProperty(ocomlistare,'inspector',Alltrim(Thisform.cinspector))
			AddProperty(ocomlistare,'kmint',Thisform.nkmint)
			AddProperty(ocomlistare,'OreFct',Thisform.nOreFct)	
			AddProperty(ocomlistare,'furnizor',Alltrim(Thisform.cfurnizor))
			AddProperty(ocomlistare,'nrachi',Thisform.nnrachi)
			AddProperty(ocomlistare,'cilindree',Alltrim(TRANSFORM(Thisform.nCilindree)))
			AddProperty(ocomlistare,'puterecp',Alltrim(TRANSFORM(Thisform.nPutereCP)))
			AddProperty(ocomlistare,'puterekw',Alltrim(TRANSFORM(Thisform.nPutereKW)))
			AddProperty(ocomlistare,'anfabricatie',Thisform.nanfabricatie)
			AddProperty(ocomlistare,'nr_dosar',Alltrim(Thisform.cnrdosar))
		*!*		AddProperty(ocomlistare,'dataachi',Thisform.ddataachi)
			AddProperty(ocomlistare,'termen',Thisform.dtermen)
			AddProperty(ocomlistare,'nidclie',Thisform.nidclie)
			ADDPROPERTY(ocomlistare,'solicitari_client',SUBSTR(STRTRAN(Thisform.coperatii,[><],[,]),2,LEN(STRTRAN(Thisform.coperatii,[><],[,]))-2))
			ADDPROPERTY(ocomlistare,'observatii',Thisform.cObservatii)
			ADDPROPERTY(ocomlistare,'defectiuni',Thisform.cDefectiuni)
				
			AddProperty(ocomlistare,'nIdPartRef',Thisform.nIdPartRef)	
			AddProperty(ocomlistare,'PartRef',Alltrim(Thisform.cPartRef))	
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru, lcAlias, lnNealese, lnNrIreg, lnCriteriu, lcDenop, lcFiltruVFP 	&&	lcExecuteString
		Store '' To lcFiltru, lcDenop, lcFiltruVFP										&&	lcExecuteString
		lcFiltru=[2=2]
		*!*	modificare	v 2.0.18
		*!*	lcExecuteString =  "thisform.Clb_operatii.tEXT_SIMPLU1"
		*!*	With &lcExecuteString
		*!*		lcDenop=Alltrim(Strtran(Alltrim(Upper(.Value)),['],['']))
		*!*		If !Empty(lcDenop)
		*!*			lcFiltru = lcFiltru + [ and denop like '%] + lcDenop + [%']
		*!*		Else
		*!*			Return
		*!*		Endif
		*!*	Endwith
		lcDenop = Strtran(Upper(Alltrim(Thisform.cb_manopera.Text.Value)),['],[''])
		lnCriteriu = Val(Alltrim(Thisform.cb_manopera.criteriu.Value))
		Do Case
		Case lnCriteriu=1
			lcFiltru = [denop LIKE '] + Upper(Alltrim(lcDenop)) + [%']
			lcFiltruVFP = [LIKE('] + Upper(Alltrim(lcDenop)) + [*',denop)]
		Case lnCriteriu=2
			lcFiltru = [denop ='] + Upper(Alltrim(lcDenop)) + [']
			lcFiltruVFP = [denop = '] + Upper(Alltrim(lcDenop)) + [']
		Case lnCriteriu=3
			lcFiltru = [denop !='] + Upper(Alltrim(lcDenop)) + [']
			lcFiltruVFP = [denop <> '] + Upper(Alltrim(lcDenop)) + [']
		Case lnCriteriu=4
			lcFiltru = [denop LIKE '%] + Upper(Alltrim(lcDenop)) + [%']
			lcFiltruVFP = [LIKE('*] + Upper(Alltrim(lcDenop)) + [*',denop)]
		Case lnCriteriu=5
			lcFiltru = [denop NOT LIKE '%] + Upper(Alltrim(lcDenop)) + [%']
			lcFiltruVFP = [!LIKE('*] + Upper(Alltrim(lcDenop)) + [*',denop)]
		Case lnCriteriu=6
			lcFiltru = [2=2]
			lcFiltruVFP = []
		Endcase
		*!*	modificare	v 2.0.18	^
		Thisform.actualizeaza_grid1(lcFiltru)
		
		*!*	modificare	v 2.0.18
		IF !EMPTY(lcFiltruVFP)
		*!*	modificare	v 2.0.18	^
			Store 0 To lnNrIreg
			Select v_norme
			Count For Like('*'+lcDenop+'*',denop) To lnNrIreg
			If lnNrIreg = 0
				If AMessagebox('Operatia introdusa nu exista! Doriti sa o adaugati?',4+32,"Adaugare norma") # 6
					Return
				Endif
				lcSql = [begin pack_auto.adauga_norma(null,null,'] + lcDenop + [',null,0,0,?gnIdUtil); end;]
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					AMessagebox(goExecutor.cEroare,0+16,'Eroare')
					Return
				Endif
				Thisform.actualizeaza_grid1(lcFiltru)
			Endif
		*!*	modificare	v 2.0.18
		ENDIF
		*!*	modificare	v 2.0.18	^
		
		lcAlias = Thisform.grdnorme.RecordSource
		Select (lcAlias)
		Calculate Cnt() For ales=0 To lnNealese
		Go Top
		Do Case
		Case lnNealese=1
		*!*	daca am cautat ceva si imi apare un singur rezultat, atunci il bifez automat
			Locate For ales = 0
			*!*	modificare v 2.0.11
			*!*	replace all ales with 1
			If Found()
				Replace ales With 1
				Thisform.do_modifica_operatii(denop,id_norme,ales)
			Endif
			*!*	modificare v 2.0.11	^
		Case lnNealese > 1
		*!*	ma pozitioneaza pe primul neales
			Select (lcAlias)
			Locate For ales = 0
		Otherwise
		*!*	nimic
		Endcase
		Thisform.grdnorme.cselectat.SetFocus()
		
	ENDPROC

	PROCEDURE do_executa
		*!*	*!*	 codul trebuie apelat doar prin click pe butonul de listare
		*!*	*!*	 procedura do_listare se poate apela si prin combinatie de taste
		*!*	If Empty(Thisform.nkmint) AND thisform.lverificari
		*!*		AMessagebox("Nu ati completat km!",0+48,"Atentie")
		*!*		Thisform.clb_kmint.SetFocus()
		*!*		Return .F.
		*!*	Endif
		
		*!*	Private pofirma,pocomanda,pcschema1,pcselect1,pddataora
		*!*	Store '' To pofirma,pocomanda
		
		*!*	pcschema=['']
		*!*	pcselect=['select localitate,strada,numar,cod_fiscal from nom_firme where 1=2']
		*!*	pcorder=[]
		*!*	pcfiltru=[id_firma = ]+Alltrim(Str(gnId_Firma))
		*!*	llAfiseaza=.F.
		*!*	gencursor('pofirma','crsFirma',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza)
		*!*	pofirma.ca_baza1.afisare()
		*!*	Sele crsfirma
		*!*	Scatter Name firma
		
		*!*	pddataora = get_Ora()
		
		*!*	pcschema=['']
		*!*	pcselect=['select cod_fiscal,adresa,telefon from ] + gcS + [.nom_parteneri where ']
		*!*	pcorder=[]
		*!*	pcfiltru=[id_part=]+Alltrim(Str(Thisform.nidclie))
		*!*	llAfiseaza=.F.
		*!*	gencursor('pocomanda','crsComanda',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza)
		*!*	pocomanda.ca_baza1.afisare()
		*!*	Select crsComanda
		*!*	Scatter Name ocom
		*!*	AddProperty(ocom,'marca',Thisform.cmarca)
		*!*	AddProperty(ocom,'nrinmat',Thisform.cnrinmat)
		*!*	AddProperty(ocom,'masina',Thisform.ctipm)
		*!*	AddProperty(ocom,'nrord',Thisform.cnrcom)
		*!*	AddProperty(ocom,'nume',Thisform.cclient)
		*!*	AddProperty(ocom,'series',Thisform.cseries)
		*!*	AddProperty(ocom,'seriem',Thisform.cseriem)
		*!*	AddProperty(ocom,'asigurator',Thisform.casig)
		*!*	AddProperty(ocom,'kmint',Thisform.nkmint)
		*!*	AddProperty(ocom,'furnizor',Thisform.cfurnizor)
		*!*	AddProperty(ocom,'nrachi',Thisform.nnrachi)
		*!*	AddProperty(ocom,'dataachi',Thisform.ddataachi)
		*!*	AddProperty(ocom,'termen',Thisform.dtermen)
		*!*	AddProperty(ocom,'datai',pddataora)
		*!*	nrord=ocom.nrord
		*!*	Thisform.AlwaysOnTop=.F.
		*!*	*!*	modificare
		*!*	Report Form PRECO To Printer Prompt Preview
		*!*	*!*	If gnTip_LPrecomanda = 1			&& cu tipizate
		*!*	*!*		Report Form _PRECO To Printer Prompt Preview
		*!*	*!*	Else
		*!*	*!*		If pntipcom=2
		*!*	*!*			Report Form PRECOG To Printer Prompt Preview
		*!*	*!*		Else
		*!*	*!*			Report Form PRECO To Printer Prompt Preview
		*!*	*!*		Endif
		*!*	*!*	Endif
		*!*	Thisform.AlwaysOnTop=.T.
		*!*	If !Thisform.llistare
		*!*		Thisform._shape2.Width=Thisform._shape2.Width-Thisform.but_renunt1.Width
		*!*		Thisform._shape2.Left=Thisform._shape2.Left+Thisform.but_renunt1.Width
		*!*		Thisform.RemoveObject("but_renunt1")
		*!*		Thisform.llistare=.T.
		*!*	Endif
		*!*	Use In crsComanda
		*!*	Use In crsfirma
		
	ENDPROC

	PROCEDURE do_modifica_operatii
		Lparameters tcDenop,tnIdNorme,tnAles
		Local lcOperatie,lcIdNorme
		lcOperatie = [<] + Alltrim(tcDenop) + [>]
		lcIdNorme = [<] + Alltrim(Str(tnIdNorme)) + [>]
		If tnAles = 0
			Thisform.coperatii = Strtran(Thisform.coperatii,lcOperatie,[])
			Thisform.csiridoperatii = Strtran(Thisform.csiridoperatii,lcIdNorme,[])
		Else
			Thisform.coperatii = Thisform.coperatii + lcOperatie
			Thisform.csiridoperatii = Thisform.csiridoperatii + lcIdNorme
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		If Thisform.llistare
			AMessagebox("Apasati terminat pentru inregistrarea comenzii!",0+48,"Atentie")
			Return .F.
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local llReturn
		Store .F. To llReturn
		If Type('thisform.activecontrol.baseclass')<>'U'
			lccontrol = Upper(Thisform.ActiveControl.BaseClass )
			If   Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
				lcval=Thisform.ActiveControl.ControlSource
				&lcval=Thisform.ActiveControl.Value
			Endif
		Endif
		
		Do Case
		Case Empty(Thisform.cclient)
			AMessagebox("Alegeti clientul!",0+48,'Atentie')
			Thisform.ct_clb_client.SetFocus()
		Case Empty(Thisform.cnrinmat)
			AMessagebox("Completati numarul de inmatriculare al masinii!",0+16,'Atentie')
			Thisform.ct_clb_client.SetFocus()
		Case Empty(Thisform.cseries)
			AMessagebox("Completati seria sasiului masinii!",0+16,'Atentie')
			Thisform.ct_clb_client.SetFocus()
		Case Empty(Thisform.nkmint) And Thisform.lverificari
			AMessagebox("Nu ati completat km!",0+48,"Atentie")
			Thisform.clb_kmint.SetFocus()
		Case !Thisform.lModificare AND !Empty(Thisform.dtermen) And Thisform.dtermen<Ttod(get_ora())
			&& la modificare nu mai verific termenul
			AMessagebox("Termenul nu poate fi mai mic decat data de azi!",0+48,"Atentie")
			Thisform.clb_termen.SetFocus()
		Otherwise
			If Thisform.lmodificare
				pcAsigurator=Alltrim(Thisform.casig)
				pcInspector=Alltrim(Thisform.cinspector)
			Endif
			llReturn = .T.
		Endcase
		Return llReturn
	ENDPROC

	PROCEDURE Init
		Parameters tnTip,pcNR,pnIdInsp,pnIdAsig,pnIdMC,pnIdClie,pnId_Masina,pnKmInt,pnOreFct,pdTermen,pcNrDosar,tlmodificare,pcInspector,pcAsigurator, pcObservatii, pcDefectiuni
		*!*	modificare	v 2.0.9
		Do Case
			Case tnTip = 1	&&	adaugare comanda
				*!*	modificare	v 2.0.18
				This.cb_manopera.criteriu.Value = [1]
				This.cb_manopera.criteriu.Requery()
				*!*	modificare	v 2.0.18	^
				This.ed_operatii.Visible = .F.
				This.grdnorme.SetAll("DynamicBackColor","IIF(ales=1,RGB(248,186,124),RGB(255,255,255))","Column")
			Case tnTip = 2	&&	adaugare comanda de spalare / itp / alte operatii
				*!*	modificare	v 2.0.18
				*!*		This.clb_operatii.Visible = .F.
				This.lb_titlu_operatii.Visible = .F.
				This.lb_manopera.Visible = .F.
				This.cb_manopera.Visible = .F.
				*!*	modificare	v 2.0.18	^
				This.grdnorme.Visible = .F.
				This.ed_operatii.Visible = .F.
				This.Width = This.grdnorme.Left
				This.AutoCenter = .T.
			Case tnTip = 3	&&	modificare comanda
				*!*	modificare	v 2.0.18
				*!*		This.clb_operatii.Visible = .F.
				This.lb_titlu_operatii.Visible = .F.
				This.lb_manopera.Visible = .F.
				This.cb_manopera.Visible = .F.
				*!*	modificare	v 2.0.18	^
				This.grdnorme.Visible = .F.
				lcCursor = [crstempordl]
				lcSql = [select solicitari_client from ] + gcS + [.dev_ordl where id_ordl = ] + Alltrim(Str(ocomanda.id_ordl))
				lnSucces = goExecutor.oExecute(lcSql,lcCursor)
				If lnSucces < 0
					amessagebox(goExecutor.cEroare,16,"Eroare")
				Else
					Select (lcCursor)
					This.coperatii = Alltrim(Nvl(solicitari_client,[]))
					Use In (lcCursor)
				Endif
		Endcase
		*!*	modificare	v 2.0.9	^
		
		If !Empty(tlmodificare)
			Thisform.lmodificare=tlmodificare
			Thisform.lb_TITLU_ALB_B121.Caption="Modificare comanda "+Alltrim(pcNR)
			*!*		Thisform.cmdlist1.Visible=.F.
			Thisform.clb_nrord.teXT_SIMPLU1.ReadOnly=.T.
			*!*		Thisform.clb_kmint.teXT_SIMPLU1.ReadOnly=.T.	&&	modificare	v 2.0.43
			* Thisform.clb_termen.teXT_SIMPLU1.ReadOnly=.T. && pot sa modific termenul la o comanda
			*!*	Else
			*!*		If pntipfactura>0
			*!*			Thisform.cmdlist1.Visible=.F.
			*!*		Endif
		Endif
		If Empty(pcNR)
			Store "" To pcNR
		Endif
		Thisform.cnrcom = pcNR
		Store 0 To pnIdInsp,pnIdAsig,pnIdMC,pnIdClie,pnId_Masina,pnKmInt, pnOreFct, pcObservatii
		this.dtermen = m.pdTermen
		DoDefault()
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcControl = Upper(Alltrim(This.ActiveControl.Name))
		
		Do Case
		*!*	modificare	v 2.0.18
		*!*	Case nKeyCode = 13 And lcControl = 'TEXT_SIMPLU1'
		*!*		If Upper(Alltrim(This.ActiveControl.Parent.Name)) = 'CLB_OPERATII'
		Case nKeyCode = 13 And lcControl = 'TEXT'
			If Upper(Alltrim(This.ActiveControl.Parent.Name)) = 'CB_MANOPERA'
		*!*	modificare	v 2.0.18	^	
				Nodefault
				Thisform.do_cauta()
			Else
				DoDefault(nKeyCode, nShiftAltCtrl)
			Endif
		Case (nKeyCode=32 And lcControl = 'GRDNORME' And Thisform.grdnorme.ActiveColumn!=1) Or ;
				((nKeyCode >=33 And nKeyCode <=122) And (lcControl = 'GRDNORME'))
			Nodefault
		*!*	modificare	v 2.0.18
		*!*		Thisform.Clb_operatii.text_simplu1.SetFocus()
		*!*		Thisform.Clb_operatii.text_simplu1.Value = Alltrim(Thisform.Clb_operatii.text_simplu1.Value) + Chr(nKeyCode)
			Thisform.cb_manopera.text.Value = ALLTRIM(thisform.cb_manopera.text.Value) + CHR(nKeyCode)
			Thisform.cb_manopera.text.SetFocus()
		*!*	modificare	v 2.0.18	^
			Keyboard '{END}'
		Case (nKeyCode = 127) And (lcControl = 'GRDNORME')					&& backspace
			Nodefault
		*!*	modificare	v 2.0.18
		*!*		Thisform.Clb_operatii.text_simplu1.Value = Left(Alltrim(Thisform.Clb_operatii.text_simplu1.Value),Len(Alltrim(Thisform.Clb_operatii.text_simplu1.Value))-1)
		*!*		Thisform.Clb_operatii.text_simplu1.SetFocus
			Thisform.cb_manopera.text.Value = LEFT(ALLTRIM(Thisform.cb_manopera.text.Value),LEN(ALLTRIM(Thisform.cb_manopera.text.Value))-1)
			Thisform.cb_manopera.text.SetFocus()	
		*!*	modificare	v 2.0.18	^
			Keyboard '{END}'
		Otherwise
			DoDefault(nKeyCode, nShiftAltCtrl)
		Endcase
		
	ENDPROC

	PROCEDURE Cb_asigurator._cbbase1.InteractiveChange
		*!*	porec.id_marca = v_marci.id_marca
		*!*	DO update_masini IN update_devize.prg
		Thisform.casig=This.Value
		*!*	If !Empty(Thisform.casig)
		Thisform.nidasig = v_asiguratori.id_asigurator
		*!*	Endif
		
		Select v_inspectori
		Set Filter To id_asigurator = v_asiguratori.id_asigurator
		Go Top
		Thisform.cinspector=inspector
		Thisform.nidinsp=id_inspector
		Thisform.cb_inspector._cbbase1.Requery
		Thisform.cb_inspector._cbbase1.Refresh
	ENDPROC

	PROCEDURE Cb_inspector._cbbase1.InteractiveChange
		Lparameters cItem
		*!*	thisform.nidasig = v_asiguratori.id_asigurator
		Thisform.cinspector=This.Value
		Thisform.nidinsp = v_inspectori.id_inspector
	ENDPROC

	PROCEDURE Cb_inspector._cbbase1.ProgrammaticChange
		Thisform.cinspector=This.Value
		Thisform.nidinsp = v_inspectori.id_inspector
	ENDPROC

	PROCEDURE grdnorme.cSelectat.Check1.Click
		Select v_norme
		Thisform.nordine=Thisform.nordine+This.Value
		Replace ales With This.Value,ordine With Thisform.nordine
		Thisform.do_modifica_operatii(denop,id_norme,ales)
		This.Parent.Parent.Refresh
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_interval_luni 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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_luna_intre1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: ctip
	*</DefinedPropArrayMethod>

	*<PropValue>
		BindControls = .T.
		ctip = 
		DoCreate = .T.
		Height = 100
		Name = "frm_interval_luni"
		Width = 338
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 338
		_SHAPE2.Height = 29
		_SHAPE2.Left = 274
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Width = 71
		LB_TITLU_ALB_B121.Caption = "ALEGEȚI PERIOADA"
		LB_TITLU_ALB_B121.FontBold = .T.
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 4
		BUT_TERMIN1.Left = 306
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'Clb_luna_intre1' AS clb_luna_intre WITH ;
		Left = 25, ;
		Name = "Clb_luna_intre1", ;
		TabIndex = 1, ;
		Top = 49, ;
		tx_n1.ControlSource = "pcAnLuna1", ;
		tx_n1.Name = "tx_n1", ;
		Lb_simplu1.Caption = "Perioada", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		tx_n2.ControlSource = "pcAnLuna2", ;
		tx_n2.Name = "tx_n2"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE inainte_de_do_termin
		Local llReturn
		pcAnLuna1=Padl(Alltrim(pcAnLuna1),6,'0')
		pcAnLuna2=Padl(Alltrim(pcAnLuna2),6,'0')
		Do Case
		Case Empty(pcAnLuna1) Or Empty(Substr(pcAnLuna1,1,2))
			AMessagebox("Nu ati completat luna de inceput!",0+48,"Atentie")
			Thisform.clb_data.tx_n1.SetFocus()
			llReturn=.F.
		Case Empty(pcAnLuna2) Or Empty(Substr(pcAnLuna2,1,2))
			AMessagebox("Nu ati completat luna de sfarsit!",0+48,"Atentie")
			Thisform.clb_data.tx_n2.SetFocus()
			llReturn=.F.
		Otherwise
			llReturn=.T.
		Endcase
		Return llReturn
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_interval_zile 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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_perioada" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: ctip
	*</DefinedPropArrayMethod>

	*<PropValue>
		BindControls = .T.
		ctip = 
		DoCreate = .T.
		Height = 100
		Name = "frm_interval_zile"
		Width = 338
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = -1
		_SHAPE1.Width = 338
		_SHAPE2.Height = 29
		_SHAPE2.Left = 278
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = -1
		_SHAPE2.Width = 71
		LB_TITLU_ALB_B121.Caption = "ALEGEȚI PERIOADA"
		LB_TITLU_ALB_B121.FontBold = .T.
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 4
		BUT_TERMIN1.Left = 309
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'Clb_perioada' AS clb_n1n2_simplu WITH ;
		Left = 24, ;
		Name = "Clb_perioada", ;
		TabIndex = 1, ;
		Top = 48, ;
		tx_n1.Alignment = 3, ;
		tx_n1.ControlSource = "pdData1", ;
		tx_n1.Name = "tx_n1", ;
		tx_n1.Value = {}, ;
		Lb_simplu1.Caption = "Perioada", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		tx_n2.Alignment = 3, ;
		tx_n2.ControlSource = "pdData2", ;
		tx_n2.Name = "tx_n2", ;
		tx_n2.Value = {}
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE inainte_de_do_termin
		Local llReturn
		Do Case
		Case Empty(pdData1)
			AMessagebox("Nu ati completat data de inceput!",0+48,"Atentie")
			Thisform.clb_perioada.tx_n1.SetFocus()
			llReturn=.F.
		Case Empty(pdData2)
			AMessagebox("Nu ati completat data de sfarsit!",0+48,"Atentie")
			Thisform.clb_perioada.tx_n2.SetFocus()
			llReturn=.F.
		Otherwise
			llReturn=.T.
		Endcase
		Return llReturn
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_nom_com 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="ck_nrord" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_client" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_datai" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_nrinmat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_validat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cNrord.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cNrord.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cDatai.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cDatai.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cTip_comanda.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cTip_comanda.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cSeries.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cSeries.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cOreFunctionare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gcliord.cOreFunctionare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cbtip_deviz" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_series" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		cbuton3 = cmd_modifica1
		cbuton4 = cmd_sterge1
		cbuton7 = cmd_executa1
		cgridsortlist = gcliord
		DoCreate = .T.
		Height = 469
		Name = "frm_nom_com"
		Width = 775
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 780
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 741
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 34
		Lb_titlu_alb_b121.Caption = "SELECTATI COMANDA"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 13
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 743
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 12
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'cbtip_deviz' AS ctip_deviz WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 616, ;
		Name = "cbtip_deviz", ;
		TabIndex = 8, ;
		Top = 164, ;
		Width = 147, ;
		_combobox1.FontCharSet = 1, ;
		_combobox1.FontName = "Arial", ;
		_combobox1.Height = 24, ;
		_combobox1.Left = 1, ;
		_combobox1.Name = "_combobox1", ;
		_combobox1.Top = 2, ;
		_combobox1.Width = 141
		*< END OBJECT: ClassLib="oviz_devize.vcx" BaseClass="container" />

	ADD OBJECT 'ck_client' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		camp_nume = a.nume, ;
		Caption = "Nume client", ;
		Left = 616, ;
		Name = "ck_client", ;
		TabIndex = 3, ;
		Top = 60
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_datai' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		camp_nume = a.datai, ;
		Caption = "Data comanda", ;
		Left = 616, ;
		Name = "ck_datai", ;
		TabIndex = 4, ;
		tip = D, ;
		Top = 78
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_nrinmat' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		camp_nume = a.nrinmat, ;
		Caption = "Nr. inmatriculare", ;
		Left = 616, ;
		Name = "ck_nrinmat", ;
		TabIndex = 5, ;
		Top = 95
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_nrord' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		camp_nume = a.nrord, ;
		Caption = "Nr. comanda", ;
		Left = 616, ;
		Name = "ck_nrord", ;
		TabIndex = 2, ;
		Top = 43
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_series' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		camp_nume = a.series, ;
		Caption = "Serie sasiu", ;
		Left = 616, ;
		Name = "ck_series", ;
		TabIndex = 6, ;
		Top = 112
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		Height = 27, ;
		Left = 617, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 10, ;
		Top = 269, ;
		Width = 145
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Caption = "\<Normare", ;
		Enabled = .F., ;
		Height = 27, ;
		Left = 617, ;
		Name = "Cmd_executa1", ;
		TabIndex = 11, ;
		Top = 428, ;
		Width = 145
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_modifica1' AS cmd_modifica WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		Caption = "\<Modifica tip comanda", ;
		cpicturedown = d:\roa\roaauto\comun\grafice\edit1.bmp, ;
		cpictureup = d:\roa\roaauto\comun\grafice\edit1.bmp, ;
		Height = 47, ;
		Left = 617, ;
		Name = "Cmd_modifica1", ;
		Picture = ..\comun\grafice\edit1.bmp, ;
		PictureMargin = 5, ;
		PicturePosition = 1, ;
		SpecialEffect = 0, ;
		TabIndex = 16, ;
		ToolTipText = "Modifica tip comanda, km. la bord", ;
		Top = 333, ;
		Visible = .F., ;
		Width = 145, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		Height = 27, ;
		Left = 617, ;
		Name = "Cmd_reset1", ;
		TabIndex = 14, ;
		Top = 298, ;
		Width = 145
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_sterge1' AS cmd_sterge WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		Height = 27, ;
		Left = 617, ;
		Name = "Cmd_sterge1", ;
		TabIndex = 15, ;
		Top = 393, ;
		Visible = .F., ;
		Width = 145
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'gcliord' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 7, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 420, ;
		Left = 14, ;
		Name = "gcliord", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "cliord", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 36, ;
		Width = 586, ;
		Column1.ControlSource = "nrord", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNrord", ;
		Column1.ReadOnly = .T., ;
		Column1.Visible = .T., ;
		Column1.Width = 80, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "nume", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cNume", ;
		Column2.ReadOnly = .T., ;
		Column2.Visible = .T., ;
		Column2.Width = 169, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "IIF(TYPE('datai')=='D',datai,TTOD(datai))", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDatai", ;
		Column3.ReadOnly = .T., ;
		Column3.Visible = .T., ;
		Column3.Width = 87, ;
		Column4.ColumnOrder = 4, ;
		Column4.ControlSource = "tip_comanda", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cTip_comanda", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 78, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "kmint", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "RK", ;
		Column5.InputMask = "999 999 999", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 71, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "series", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cSeries", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 171, ;
		Column7.ControlSource = "ore_functionare", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cOreFunctionare", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 70
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'gcliord.cNume.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume client", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'gcliord.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Km. la bord", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'gcliord.cOreFunctionare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Ore motor", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'gcliord.cSeries.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie sasiu", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

	ADD OBJECT 'Lb_simplu1' AS lb_simplu WITH ;
		Anchor = 9, ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Tip comanda", ;
		Left = 614, ;
		Name = "Lb_simplu1", ;
		TabIndex = 7, ;
		Top = 146, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'opt_validat' AS _optiongrup WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		ButtonCount = 3, ;
		Height = 65, ;
		Left = 621, ;
		Name = "opt_validat", ;
		TabIndex = 9, ;
		Top = 199, ;
		Value = 3, ;
		Width = 99, ;
		OPTION1.AutoSize = .F., ;
		OPTION1.Caption = "Toate", ;
		OPTION1.FontSize = 10, ;
		OPTION1.Left = 7, ;
		OPTION1.Name = "OPTION1", ;
		OPTION1.Top = 5, ;
		OPTION1.Value = 0, ;
		OPTION2.AutoSize = .F., ;
		OPTION2.Caption = "Validate", ;
		OPTION2.FontSize = 10, ;
		OPTION2.Left = 5, ;
		OPTION2.Name = "OPTION2", ;
		OPTION2.Top = 24, ;
		Option3.AutoSize = .F., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Nevalidate", ;
		Option3.FontSize = 10, ;
		Option3.Height = 18, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 43, ;
		Option3.Value = 1, ;
		Option3.Width = 78
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="optiongroup" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru
		Local lcFiltru,lnRecNo
		If Empty(tcFiltru)
			lcFiltru = poordl.ca_baza1.cfiltru
		Else
			lcFiltru = tcFiltru
		Endif
		
		Select cliord
		lnRecNo=Recno()
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		save_grid_tag(Thisform.gcliord)
		poordl.ca_baza1.cfiltru=lcFiltru
		poordl.ca_baza1.afisare()
		restore_grid_tag(Thisform.gcliord)
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
		
		Thisform.gcliord.SetAll('DynamicFontItalic','IIF(validat=1,.T.,.F.)','Column')
		Thisform.gcliord.SetAll('DynamicForeColor','IIF(validat=1,RGB(128,128,128),RGB(0,0,0))','Column')
		Select cliord
		*!*	CALCULATE sum(totctva),sum(neimpozab),sum(totftvam),sum(tvam),sum(totftvai),sum(tvai) TO ;
		*!*		pntotctva,pnneimpozab,pntotftvam,pntvam,pntotftvai,pntvai
		If Reccount('cliord')<lnRecNo
			lnRecNo=Reccount('cliord')
		Endif
		If lnRecNo>0
			Select cliord
			Go lnRecNo
		Endif
		Thisform.Refresh
	ENDPROC

	PROCEDURE do_cauta
		*!* 24.08.2015
		*!* marius.mutu
		*!* se afiseaza doar comenzile active (nearhivate)
		
		Local lcFiltru
		Store .F. To llFMasini
		Store '' To lcFiltru
		*!*	lcFiltru = [luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnAn))
		*!*	lcFiltru = [extract(month from a.datafact) = ] + Alltrim(Str(gnLuna)) + [ and extract(year from a.datafact) = ]+Alltrim(Str(gnAn))
		lcFiltru = gcCondLuna
		lcFiltru = lcFiltru + [ and a.inchis_fortat = 0 ]
		If Thisform.ck_nrord.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_nrord.filtru
		Endif
		
		If Thisform.ck_client.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_client.filtru
		Endif
		
		If Thisform.ck_datai.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_datai.filtru
		Endif
		
		If Thisform.ck_nrinmat.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_nrinmat.filtru
		Endif
		
		If Thisform.ck_series.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_series.filtru
		Endif
		
		If Thisform.cbtip_deviz._combobox1.Value!='<Toate tipurile>'
			lcFiltru = lcFiltru + [ and a.id_tip = ] + Alltrim(Str(lista_tipuri.id_tip))
		Endif
		
		Do Case
			Case Thisform.opt_validat.Value=2
				lcFiltru = lcFiltru + [ and a.validat=1 ]
			Case Thisform.opt_validat.Value=3
				lcFiltru = lcFiltru + [ and a.validat=0 ]
		Endcase
		
		Thisform.actualizeaza_grid1(lcFiltru)
		
		Select cliord
		Go Top
		If Reccount('cliord')=0
			AMessagebox("Cautarea nu a intors rezultate!",64,"Info cautare")
			Thisform.ck_nrord.SetFocus()
		Else
			Thisform.gcliord.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_executa
		Select cliord
		Scatter Name ocomanda
		
		If ocomanda.Validat=0
			If Used('crs_comanda')
				Use In crs_comanda
			Endif
			lcSel = [select * from ] + gcS + [.auto_date_suplimentare WHERE id_ordl=?ocomanda.id_ordl]
			lcCursor = 'crs_comanda'
			lnSucces = goExecutor.oExecute(lcSel,lcCursor)
			If lnSucces < 0
				AMessagebox(goExecutor.cEroare,0+16,"Eroare")
				Return
			Endif
			Select crs_comanda
			AddProperty(ocomanda,'id_partener',id_partener)
			AddProperty(ocomanda,'marca',marca)
			AddProperty(ocomanda,'id_marca',id_marca)	
			AddProperty(ocomanda,'masina',masina)
			AddProperty(ocomanda,'inspector',inspector)
			AddProperty(ocomanda,'asigurator',asigurator)
			AddProperty(ocomanda,'kmint',kmint)
			AddProperty(ocomanda,'ore_functionare',ore_functionare)	
			AddProperty(ocomanda,'observatii', '')	
			ocomanda.observatii = ALLTRIM(NVL(observatii,''))
			AddProperty(ocomanda,'defectiuni', '')
			ocomanda.defectiuni = ALLTRIM(NVL(defectiuni,''))
			AddProperty(ocomanda,'solicitari_client', '')
			ocomanda.solicitari_client = ALLTRIM(NVL(solicitari_client,''))
			
			AddProperty(ocomanda,'termen',termen)
			AddProperty(ocomanda,'series',series)
			Use In crs_comanda
		*!*	modificare	v 2.0.35
			If vizualizeaza_detalii_comanda(Thisform,ocomanda)
				Select cliord
				lnInreg = Recno()
				Thisform.actualizeaza_grid1()
				Go MAX(lnInreg,MIN(lnInreg,RECCOUNT('cliord')))
			Endif	
		*!*		Do ccsectii in update_devize.prg
		*!*		Private pooper,pcschema1,pcselect1,plcomandam && .T. daca au fost facute modificari asupra comenzii
		*!*		Store '' To pooper
		*!*		plcomandam=.F.
		*!*		llAfiseaza=.F.
		*!*		pcschema1=['']
		*!*	*!*	modificare 27.01
		*!*		pcselect1=['select * from ] + gcS + [.dev_voper where 1=2']
		*!*	*!*	modificare 09.06
		*!*	*!*		pcorder1=[validat desc,dataora,datai,denop,sectie]
		*!*		pcorder1=[datai,id_oper]
		*!*	*!*	^
		*!*		pcfiltru1 = [id_ordl = ]+Alltrim(Str(ocomanda.id_ordl))+[ and ]+;
		*!*			[extract(month from datai)+extract(year from datai)*12<=?gnLuna+?gnAn*12]
		*!*	*!*		pcselect1=['select * from ] + gcS + [.dev_voper where 1=2']
		*!*	*!*		pcorder1=[dataora,denop,sectie]
		*!*	*!*		pcfiltru1 = [id_ordl = ]+Alltrim(Str(ocomanda.id_ordl))+[ and ]+;
		*!*	*!*			[extract(month from dataora)+extract(year from dataora)*12<=?gnLuna+?gnAn*12]
		*!*		gencursor('pooper','oper',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
		*!*		pooper.ca_baza1.afisare()
		*!*	&&,.f.,'','id_oper','demo.dev_oper','pret,timpn','id_oper dev_oper.id_oper,pret dev_oper.pret,timpn dev_oper.timpn','')
		*!*	*!*					.UPDATENAMELIST = [KEYID Presidents.KeyID, LoginID Presidents.LoginID, ] ;
		*!*	*!*						+ [FIRSTNAME Presidents.FirstName, LASTNAME Presidents.LastName]
		*!*	*!*					.CONVERSIONFUNC = [LoginID RTRIM, FirstName RTRIM, Lastname RTRIM]
		*!*	*!*		pooper.ca_baza1.afisare()
		*!*		PRIVATE podevest,pcschema3,pcselect3
		*!*		STORE '' TO podevest
		*!*		pcschema3=['']
		*!*		pcselect3=['select * from ] + gcS + [.dev_vestimari_rep where 1=2']
		*!*		pcorder3=[id_dev_estimare_rep]
		*!*		pcfiltru3 = [id_lucrare = ]+Alltrim(Str(ocomanda.id_lucrare))
		*!*		gencursor('podevest','v_devizest',pcselect3,pcfiltru3,pcschema3,pcorder3,llAfiseaza)
		*!*		podevest.ca_baza1.afisare()
		*!*		
		*!*		Private porul,pcschema2,pcselect2
		*!*		Store '' To porul
		*!*	*!*	modificare	v 2.0.22
		*!*	*!*		pcschema2=['']
		*!*	*!*		pcselect2=['select * from ] + gcS + [.vrul where 1=2']
		*!*		pcschema2=['CODMAT c(50),DENUMIRE c(100),PRETV n(20,4),CANTE n(18,3),DATAACT D,ID_RUL n(20),COTA_DIFERITA n(1),TVA n(20,4)']
		*!*		pcselect2=[select codmat,denumire,pretv,cante,dataact,id_rul,decode(proc_tvav,pack_contafin.getCotaTVAStandard(?gnLuna,?gnAn),0,1) as cota_diferita,] + ;
		*!*				[pack_sesiune.calculeaza_pret_tva(pretv,1,pack_def.GetIdMonedaNationala(),pack_contafin.getCotaTVAStandard(?gnLuna,?gnAn),0) as tva ] + ;
		*!*				[from ] + gcS + [.vrul where 1=2']
		*!*	*!*	modificare	v 2.0.22	^
		*!*		pcorder2=[dataact,id_rul]
		*!*		pcfiltru2 = [id_lucrare = ]+Alltrim(Str(ocomanda.id_lucrare))+[ and ]+;
		*!*			[luna+an*12<=?gnLuna+?gnAn*12]
		*!*		gencursor('porul','rul',pcselect2,pcfiltru2,pcschema2,pcorder2,llAfiseaza)
		*!*		porul.ca_baza1.afisare()
		*!*	*!*	Select rul
		*!*	*!*	amessagebox("cante = " + Alltrim(Str(cante))+" pretv = "+ Alltrim(Str(pretv)))
		*!*	*!*	amessagebox(Alltrim(Str(cante*pretv)))
		*!*		Thisform.AlwaysOnTop=.F.
		*!*		ooo = Createobject('frm_vizcomanda')
		*!*		ooo.Show(1)
		*!*		Thisform.AlwaysOnTop=.T.
		*!*					*!*	modificare	v 2.0.5
		*!*					If Used('oper')
		*!*						Use In oper
		*!*					Endif
		*!*					If Used('rul')
		*!*						Use In rul
		*!*					Endif
		*!*					*!*	modificare	v 2.0.5	^
		*!*		If plcomandam
		*!*			Select cliord
		*!*			pnrec=Recno()
		*!*			Thisform.actualizeaza_grid1()
		*!*			Go pnrec
		*!*		Endif
		*!*	*!*	Else
		*!*	*!*		amessagebox("Comanda "+Alltrim(ocomanda.nrord)+" este validata.Nu este permisa modificarea ei!",0+16,"Operatiune nepermisa")
		*!*		Release ooo
		*!*	modificare	v 2.0.35	^
		Endif
		Release ocomanda
	ENDPROC

	PROCEDURE do_modifica
		*!*	If gnNivelUtilizator>1
		*!*		Return
		*!*	Endif
		Local ofrmtipcomanda As 'frm_tip_comanda'
		Local lcSql, lcTextEroare, lnRecNo, lnSucces
		PRIVATE ocomanda_mod, pnIdOrdl, pnIdTip, pnKmInt
		
		If Reccount('cliord') > 0
			Private pnbuton
			pnbuton = 2
			Select cliord
			lnRecNo = Recno()
			Scatter Name ocomanda_mod
			= cctipuri_deviz()
			ofrmtipcomanda = Createobject('frm_tip_comanda')
			ofrmtipcomanda.Show(1)
			Use In (SELECT('crstipuri_deviz'))
		
			If pnbuton = 1
				*!*			lcSql=[begin pack_auto.modifica_tip_comanda(']+ALLTRIM(gcS)+[',]+ALLTRIM(STR(ocomanda_mod.id_tip))+[,]+;
				*!*				ALLTRIM(STR(ocomanda_mod.id_ordl))+[,]+ALLTRIM(STR(gnIdUtil))+[); end;]
				pnIdOrdl = ocomanda_mod.id_ordl
				pnIdTip = ocomanda_mod.id_tip
				pnKmInt = ocomanda_mod.kmint
				pnOreFct = ocomanda_mod.ore_functionare
				lcSql = [begin pack_auto.modifica_date_comanda(?pnIdOrdl, ?pnIdTip, ?pnKmInt, ?pnOreFct, ?gnIdUtil); end;]
		
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					lcTextEroare = goExecutor.cEroare
					AMessagebox(lcTextEroare, 0 + 16, "Modificare date comanda")
				Else
					Thisform.actualizeaza_grid1()
					Select cliord
					lnRecNo = Max(lnRecNo - 1, 1)
					Go lnRecNo
					Thisform.gcliord.SetFocus()
				Endif
			Endif
			Release ofrmtipcomanda, ocomanda_mod
		Endif
	ENDPROC

	PROCEDURE do_reset
		With Thisform
			For i=1 To .Objects.Count
				If Upper(.Objects(i).BaseClass)='CHECKBOX'
					.Objects(i).Value=0
				Endif
			Endfor
		Endwith
		Thisform.opt_validat.Value=3
		thisform.cbtip_deviz.do_reset()
		
		Thisform.ck_nrord.SetFocus()
	ENDPROC

	PROCEDURE do_sterge
		*!*	If gnNivelUtilizator>1
		*!*		Return
		*!*	Endif
		If Reccount('cliord')>0
			If AMessagebox('Doriti sa stergeti comanda selectata?',4+32,"Stergere") # 6
				Return
			Endif
			Select cliord
			lnRecNo=Recno()
			Scatter Name ogcliord
			lcSql = [begin pack_auto.dev_sterge_comanda('] + gcS + [',] + Alltrim(Str(gnIdUtil))+[,]+;
				ALLTRIM(Str(ogcliord.id_ordl))+[,]+Alltrim(Str(ogcliord.id_lucrare))+[); end;]
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
				AMessagebox(goExecutor.oPrelucrareEroare(),0+16,"Stergere")
			Else
				AMessagebox("Comanda a fost stearsa!",0+64,"Info stergere")
				Thisform.actualizeaza_grid1()
				Select cliord
				If Reccount('cliord')>0
					lnRecNo=Min(Reccount('cliord'),Max(lnRecNo-1,1))	&&	modificare v 2.0.15
					Go lnRecNo
					Thisform.gcliord.SetFocus()
				Else
					Thisform.ck_nrord.SetFocus()
				Endif
			Endif
			Release ogcliord
		Else
			AMessagebox("Nu sunt comenzi de sters in selectie!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		* Centrez fereastra si o fac 70% din ecran
		lnHeight = _screen.Height
		lnWidth = _screen.Width
		This.Height = INT(0.7 * m.lnHeight)
		this.Width = INT(0.7 * m.lnWidth)
		this.AutoCenter = .T. 
		
		this.gridextra1.setup()
		
	ENDPROC

	PROCEDURE gcliord.AfterRowColChange
		Lparameters nColIndex
		If This.RowColChange!=2
			DoDefault()
			Do Case
			Case Validat=0
				Thisform.cmd_executa1.Enabled=.T.
			Case Validat=1
				Thisform.cmd_executa1.Enabled=.F.
			Endcase
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_tip_comanda 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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tip_comanda" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_nume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_nrord" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_datai" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cb_kmint" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cb_orefct" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid_tip
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 221
		Name = "frm_tip_comanda"
		nid_tip = 0
		Width = 375
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape2.Height = 29
		_shape2.Left = 313
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 69
		Lb_titlu_alb_b121.Caption = "MODIFICARE DATE COMANDĂ"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 6
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'cb_kmint' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "cb_kmint", ;
		TabIndex = 2, ;
		Top = 160, ;
		Text_simplu1.ControlSource = "", ;
		Text_simplu1.Format = "!RK", ;
		Text_simplu1.InputMask = "999 999 999", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .F., ;
		Lb_simplu1.Caption = "Km. la bord", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'cb_orefct' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "cb_orefct", ;
		TabIndex = 3, ;
		Top = 188, ;
		Text_simplu1.ControlSource = "", ;
		Text_simplu1.Format = "!RK", ;
		Text_simplu1.InputMask = "999 999 999", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .F., ;
		Lb_simplu1.Caption = "Ore functionare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tip_comanda' AS cb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Cb_tip_comanda", ;
		TabIndex = 1, ;
		Top = 132, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "crstipuri_deviz.denumire,id_tip", ;
		_cbbase1.RowSourceType = 6, ;
		_lbbase1.Caption = "Tip comandă", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_datai' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_datai", ;
		TabIndex = 9, ;
		Top = 104, ;
		Text_simplu1.ControlSource = "ocomanda_mod.datai", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Dată comandă", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_nrord' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_nrord", ;
		TabIndex = 8, ;
		Top = 48, ;
		Text_simplu1.ControlSource = "ocomanda_mod.nrord", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Comandă", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_nume' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_nume", ;
		TabIndex = 7, ;
		Top = 76, ;
		Text_simplu1.ControlSource = "ocomanda_mod.nume", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Client", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE inainte_de_do_termin
		Private plReturn
		Store .F. To plReturn
		
		SET STEP ON 
		If (ocomanda_mod.tip_comanda <> Thisform.cB_TIP_COMANDA._cbbase1.Value OR ocomanda_mod.kmint <> thisform.cb_kmint.text_simplu1.Value OR ocomanda_mod.ore_functionare <> thisform.cb_orefct.text_simplu1.Value)
			If AMessagebox("Doriti sa salvati modificarea?",4+32,"Confirmare modificare date") = 6
				ocomanda_mod.id_tip = crstipuri_deviz.id_tip
				ocomanda_mod.kmint = thisform.cb_kmint.text_simplu1.Value
				ocomanda_mod.ore_functionare = thisform.cb_orefct.text_simplu1.Value		
				plReturn=.T.
			Endif
		Else
			AMessagebox("Nu ati facut nici o modificare!",0+64,"Info modificare")
		Endif
		Return plReturn
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Thisform.nid_tip=ocomanda_mod.id_tip
		Select crstipuri_deviz
		Locate For id_tip=ocomanda_mod.id_tip
		Thisform.cb_TIP_COMANDA._cbbase1.Value=Alltrim(denumire)
		thisform.cb_kmint.text_simplu1.Value = ocomanda_mod.kmint
		thisform.cb_orefct.text_simplu1.Value = ocomanda_mod.ore_functionare
		
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_vizcomanda 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="Seip4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cDenop.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cDenop.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cTimpn.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cTimpn.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cPret.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cPret.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cValoare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cValoare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cSectie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cSectie._CBBASE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Grid1.cValidat.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Cmd_adauga1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Cmd_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page1.Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cCant.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cCant.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cPret.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cPret.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cValoare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.cValoare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page2.Grid2.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Cmd_adauga1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cCodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cCodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cUm.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cUm.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cCantitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cCantitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cPretctva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cPretctva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cPretftva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cPretftva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cCotatva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cCotatva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cValoare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Grid3.cValoare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Label10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Text10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Label11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Text11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Label9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Text12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="p.Page3.Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_modifica" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_client" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_data" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra3" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: activeaza_validare
		*m: actualizeaza_grid3
		*m: do_adauga_devizest
		*m: do_calcul
		*m: do_calculdevizest
		*m: do_modificacom
		*m: do_validare
		*p: lcomandavalidata
		*p: lsalvat
		*p: lvalidat
		*p: nid_pret
		*p: nid_sectie
		*p: npretinitial
		*p: npretmodificat
		*p: ntimpninitial
		*p: ntimpnmodificat
		*p: tart
		*p: tman
		*p: totalman
		*p: totalmat
		*p: totalore
		*p: totctva
		*p: totftva
		*p: tva
		*p: tvalftva
		*p: tvaloare
		*p: tvaltva
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 474
		lactiv2 = .T.
		lactiv4 = .T.
		lsalvat = .T.
		lvalidat = .T.
		Name = "frm_vizcomanda"
		nid_pret = 0
		nid_sectie = 0
		npretinitial = 0.00
		npretmodificat = 0.00
		ntimpninitial = 0.000
		ntimpnmodificat = 0.000
		tart = 0.00
		tman = 0.00
		totalman = 0
		totalmat = 0
		totalore = 0
		totctva = 0
		totftva = 0
		tva = 0
		tvalftva = 0.00
		tvaloare = 0.00
		tvaltva = 0.00
		Width = 788
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 792
		_shape1.ZOrderSet = 1
		_shape2.Height = 29
		_shape2.Left = 725
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 70
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "COMANDA NR."
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.FontName = "Arial"
		Lb_titlu_alb_b121.Height = 22
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = 5
		Lb_titlu_alb_b121.Width = 117
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 758
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 8, ;
		Left = 728, ;
		Name = "But_listare1", ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_modifica' AS cmd_modifica WITH ;
		Anchor = 12, ;
		caction = do_modificacom, ;
		Caption = "\<Modificare date comandă", ;
		Height = 49, ;
		Left = 660, ;
		Name = "Cmd_modifica", ;
		Top = 406, ;
		Width = 108, ;
		WordWrap = .T., ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		gridexpression = thisform.p.page1.grid1, ;
		Left = 336, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 36
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Gridextra2' AS gridextra WITH ;
		allowgridfilter = .T., ;
		gridexpression = thisform.p.page2.grid2, ;
		Left = 372, ;
		Name = "Gridextra2", ;
		productname = ROA, ;
		Top = 36
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Gridextra3' AS gridextra WITH ;
		allowgridfilter = .T., ;
		gridexpression = thisform.p.page3.grid3, ;
		Left = 408, ;
		Name = "Gridextra3", ;
		productname = ROA, ;
		Top = 36
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Label10' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 424, ;
		Name = "Label10", ;
		Top = 422, ;
		Width = 27, ;
		ZOrderSet = 12
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label11' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 424, ;
		Name = "Label11", ;
		Top = 445, ;
		Width = 77, ;
		ZOrderSet = 14
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total materiale", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 149, ;
		Name = "Label3", ;
		Top = 445, ;
		Width = 87, ;
		ZOrderSet = 20
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label5' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total manoperă", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 149, ;
		Name = "Label5", ;
		Top = 400, ;
		Width = 91, ;
		ZOrderSet = 15
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label6' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total ore", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 149, ;
		Name = "Label6", ;
		Top = 422, ;
		Width = 52, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label8' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		Caption = "TOTAL COMANDĂ:", ;
		FontBold = .T., ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 24, ;
		Name = "Label8", ;
		Top = 385, ;
		Width = 119, ;
		ZOrderSet = 8
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label9' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total fără TVA", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 424, ;
		Name = "Label9", ;
		Top = 400, ;
		Width = 84, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lb_client' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "CLIENT:", ;
		FontBold = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Height = 18, ;
		Left = 12, ;
		Name = "lb_client", ;
		Top = 36, ;
		Width = 52, ;
		ZOrderSet = 22
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lb_data' AS label WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "DATA :", ;
		FontBold = .T., ;
		FontName = "Arial", ;
		ForeColor = 255,255,255, ;
		Height = 17, ;
		Left = 605, ;
		Name = "lb_data", ;
		Top = 7, ;
		Width = 39, ;
		ZOrderSet = 23
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'p' AS pageframe WITH ;
		Anchor = 15, ;
		ErasePage = .T., ;
		Height = 326, ;
		Left = 10, ;
		Name = "p", ;
		PageCount = 3, ;
		TabStyle = 0, ;
		Top = 60, ;
		Width = 768, ;
		ZOrderSet = 6, ;
		Page1.BackColor = 255,255,255, ;
		Page1.Caption = "Manoperă", ;
		Page1.FontBold = .T., ;
		Page1.FontCharSet = 238, ;
		Page1.FontSize = 10, ;
		Page1.Name = "Page1", ;
		Page2.BackColor = 255,255,255, ;
		Page2.Caption = "Materiale", ;
		Page2.FontCharSet = 238, ;
		Page2.FontItalic = .T., ;
		Page2.FontSize = 10, ;
		Page2.Name = "Page2", ;
		Page3.BackColor = 255,255,255, ;
		Page3.Caption = "Deviz estimativ", ;
		Page3.FontCharSet = 238, ;
		Page3.FontItalic = .T., ;
		Page3.FontSize = 10, ;
		Page3.Name = "Page3"
		*< END OBJECT: BaseClass="pageframe" />

	ADD OBJECT 'p.Page1.Cmd_adauga1' AS cmd_adauga WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 668, ;
		Name = "Cmd_adauga1", ;
		Top = 41, ;
		Width = 84
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'p.Page1.Cmd_executa1' AS cmd_executa WITH ;
		Anchor = 8, ;
		caction = do_validare, ;
		Caption = "\<Validare", ;
		Height = 27, ;
		Left = 668, ;
		Name = "Cmd_executa1", ;
		Top = 151, ;
		Width = 84
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'p.Page1.Cmd_sterge1' AS cmd_sterge WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 668, ;
		Name = "Cmd_sterge1", ;
		Top = 79, ;
		Width = 84
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'p.Page1.Grid1' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		HeaderHeight = 19, ;
		Height = 264, ;
		Left = 10, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RecordSource = "oper", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 20, ;
		Width = 649, ;
		ZOrderSet = 12, ;
		Column1.ControlSource = "denop", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cDenop", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 188, ;
		Column2.ControlSource = "timpn", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.InputMask = "999.99", ;
		Column2.Name = "cTimpn", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 76, ;
		Column3.ControlSource = "oper.pret", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Format = "R", ;
		Column3.InputMask = (get_mask(12,gnPPretV)), ;
		Column3.Name = "cPret", ;
		Column3.ReadOnly = .F., ;
		Column4.ControlSource = "oper.timpn*oper.pret", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "R", ;
		Column4.InputMask = (get_mask(12,gnPc)), ;
		Column4.Name = "cValoare", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 87, ;
		Column5.ControlSource = "sectie", ;
		Column5.CurrentControl = "_CBBASE1", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cSectie", ;
		Column5.Sparse = .F., ;
		Column5.Width = 141, ;
		Column6.BackColor = 253,252,223, ;
		Column6.ColumnOrder = 6, ;
		Column6.ControlSource = "oper.validat", ;
		Column6.CurrentControl = "Check1", ;
		Column6.DynamicBackColor = "rgb(253,252,223)", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cValidat", ;
		Column6.Sparse = .F., ;
		Column6.Width = 45
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'p.Page1.Grid1.cSectie._CBBASE1' AS _cbbase WITH ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 60, ;
		Name = "_CBBASE1", ;
		ReadOnly = .F., ;
		RowSource = "v_nom_sectii.sectie,id_sectie", ;
		RowSourceType = 6, ;
		Top = 32
		*< END OBJECT: ClassLib="..\comun\clase\_cb_base.vcx" BaseClass="combobox" />

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

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

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

	ADD OBJECT 'p.Page1.Grid1.cValidat.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Enabled = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 10, ;
		Name = "Check1", ;
		ReadOnly = .F., ;
		SpecialEffect = 1, ;
		Top = 35, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

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

	ADD OBJECT 'p.Page2.Grid2' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 5, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 264, ;
		Left = 10, ;
		Name = "Grid2", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "rul", ;
		RowHeight = 19, ;
		Top = 20, ;
		Width = 725, ;
		ZOrderSet = 15, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cDenumire", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 416, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "cante", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.InputMask = (get_mask(12,gnPCant)), ;
		Column2.Name = "cCant", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 79, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "pretv", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Format = "R", ;
		Column3.InputMask = (get_mask(12,gnPPretV)), ;
		Column3.Name = "cPret", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 99, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "ROUND(rul.pretv*rul.cante,gnPc)", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Format = "R", ;
		Column4.InputMask = (get_mask(12,gnPc)), ;
		Column4.Name = "cValoare", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 93, ;
		Column5.ColumnOrder = 2, ;
		Column5.ControlSource = "codmat", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column1", ;
		Column5.ReadOnly = .T.
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'p.Page2.Grid2.cCant.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cant.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'p.Page2.Grid2.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod mat.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'p.Page2.Grid2.Column1.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 'p.Page2.Grid2.cPret.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'p.Page2.Grid2.cValoare.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'p.Page3.Cmd_adauga1' AS cmd_adauga WITH ;
		Anchor = 8, ;
		caction = do_adauga_devizest, ;
		Height = 27, ;
		Left = 670, ;
		Name = "Cmd_adauga1", ;
		Top = 41, ;
		Width = 84
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'p.Page3.Grid3' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 8, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 192, ;
		Left = 10, ;
		Name = "Grid3", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_devizest", ;
		RowHeight = 19, ;
		Top = 20, ;
		Width = 651, ;
		ZOrderSet = 15, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cDenumire", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 216, ;
		Column2.ControlSource = "cod", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cCodmat", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 53, ;
		Column3.ControlSource = "um", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cUm", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 40, ;
		Column4.ControlSource = "cantitate", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.InputMask = (get_mask(12,gnPCant)), ;
		Column4.Name = "cCantitate", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 52, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "pretctva", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "R", ;
		Column5.InputMask = (get_mask(12,gnPPretV)), ;
		Column5.Name = "cPretctva", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 56, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "pretftva", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "R", ;
		Column6.InputMask = (get_mask(12,gnPPretV)), ;
		Column6.Name = "cPretftva", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 71, ;
		Column7.ControlSource = "cota_tva", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cCotatva", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 58, ;
		Column8.ControlSource = "valoare", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "R", ;
		Column8.InputMask = (get_mask(12,gnPc)), ;
		Column8.Name = "cValoare", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 55
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'p.Page3.Grid3.cCotatva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Proc TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'p.Page3.Grid3.cCotatva.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'p.Page3.Grid3.cPretctva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret cu tva", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'p.Page3.Grid3.cPretctva.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'p.Page3.Grid3.cPretftva.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret fara tva", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'p.Page3.Grid3.cUm.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Um", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'p.Page3.Grid3.cUm.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'p.Page3.Grid3.cValoare.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'p.Page3.Label10' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "TVA", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 442, ;
		Name = "Label10", ;
		Top = 241, ;
		Width = 27, ;
		ZOrderSet = 12
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'p.Page3.Label11' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total cu TVA", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 442, ;
		Name = "Label11", ;
		Top = 266, ;
		Width = 77, ;
		ZOrderSet = 14
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'p.Page3.Label3' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total materiale", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 185, ;
		Name = "Label3", ;
		Top = 266, ;
		Width = 87, ;
		ZOrderSet = 20
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'p.Page3.Label5' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total manoperă", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 185, ;
		Name = "Label5", ;
		Top = 241, ;
		Width = 91, ;
		ZOrderSet = 15
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'p.Page3.Label9' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total fără TVA", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 442, ;
		Name = "Label9", ;
		Top = 216, ;
		Width = 84, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'p.Page3.Text10' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "thisform.tvaloare", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 529, ;
		Name = "Text10", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 264, ;
		Width = 132, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'p.Page3.Text11' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "thisform.tman", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 285, ;
		Name = "Text11", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 239, ;
		Width = 132, ;
		ZOrderSet = 16
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'p.Page3.Text12' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "thisform.tart", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 285, ;
		Name = "Text12", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 264, ;
		Width = 132, ;
		ZOrderSet = 21
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'p.Page3.Text3' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "thisform.tvalftva", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 529, ;
		Name = "Text3", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 214, ;
		Width = 132, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'p.Page3.Text5' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "thisform.tvaltva", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 529, ;
		Name = "Text5", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 239, ;
		Width = 132, ;
		ZOrderSet = 11
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Seip4' AS _shape WITH ;
		Anchor = 14, ;
		BackStyle = 0, ;
		Height = 74, ;
		Left = 15, ;
		Name = "Seip4", ;
		Top = 393, ;
		Width = 765, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Text4' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTALMAN", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 246, ;
		Name = "Text4", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 396, ;
		Width = 132, ;
		ZOrderSet = 16
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text5' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTALORE", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,2)), ;
		Left = 246, ;
		Name = "Text5", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 418, ;
		Width = 132, ;
		ZOrderSet = 18
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text6' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTALMAt", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 246, ;
		Name = "Text6", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 441, ;
		Width = 132, ;
		ZOrderSet = 21
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text7' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTFTVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 508, ;
		Name = "Text7", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 396, ;
		Width = 132, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text8' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 508, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 418, ;
		Width = 132, ;
		ZOrderSet = 11
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text9' AS textbox WITH ;
		Anchor = 12, ;
		BackStyle = 1, ;
		ControlSource = "THISFORM.TOTCTVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Format = "R", ;
		Height = 22, ;
		InputMask = (get_mask(12,gnPc)), ;
		Left = 508, ;
		Name = "Text9", ;
		ReadOnly = .T., ;
		TabStop = .F., ;
		Top = 441, ;
		Width = 132, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE activeaza_validare
		If Thisform.nselectate!=Reccount('oper')
			Thisform.p.page1.cmd_executa1.Enabled=.T.
		Else
			Thisform.p.page1.cmd_executa1.Enabled=.F.
		Endif
	ENDPROC

	PROCEDURE actualizeaza_grid1
		With Thisform.p.page1
			Thisform.LockScreen=.T.
			Thisform.MousePointer=11
			save_grid_tag(.grid1)
			pooper.ca_baza1.afisare()
			restore_grid_tag(.grid1)
			Thisform.MousePointer= 0
			Thisform.LockScreen=.F.
		
			Thisform.do_calcul
		
			If Reccount('oper')>0 AND thisform.p.page1.cmd_adauga1.visible
				If Used('crsvalidate')
					Use In crsvalidate
				Endif
				Select Sum(Validat) As nrvalidate From oper Into Cursor crsvalidate
				Select crsvalidate
				lnValidate=nrvalidate
				Use In crsvalidate
		
				Thisform.nselectate=lnValidate
				.cmd_sterge1.Enabled=.T.
				If lnValidate<Reccount('oper')
					.cmd_executa1.Enabled=.T.
				Else
					.cmd_executa1.Enabled=.F.
				Endif
			Else
				.cmd_sterge1.Enabled=.F.
				.cmd_executa1.Enabled=.F.
			Endif
		Endwith
	ENDPROC

	PROCEDURE actualizeaza_grid2
		With Thisform.p.page2
			Thisform.LockScreen=.T.
			Thisform.MousePointer=11
			save_grid_tag(.grid2)
			porul.ca_baza1.afisare()
			restore_grid_tag(.grid2)
			Thisform.MousePointer= 0
			Thisform.LockScreen=.F.
		Endwith
	ENDPROC

	PROCEDURE actualizeaza_grid3
		With Thisform.p.page3
			Thisform.LockScreen=.T.
			Thisform.MousePointer=11
			save_grid_tag(.grid3)
			podevest.ca_baza1.afisare()
			restore_grid_tag(.grid3)
			Thisform.MousePointer= 0
			Thisform.LockScreen=.F.
			thisform.do_calculdevizest
		ENDWITH
		
	ENDPROC

	PROCEDURE do_adauga
		If Thisform.p.pAGE1.cmd_adauga1.Visible And Thisform.p.ActivePage=1
		
			Private pniesire,pnid_sectie,pnid_pret,pnid_asigurator_com,pnid_marca
			pnid_sectie=Thisform.nid_sectie
			pnid_pret=Thisform.nid_pret
			pnid_asigurator_com=ocomanda.id_asigurator
			pnid_marca=ocomanda.id_marca
			pniesire=0
			Do update_sectie In update_devize.prg
			Do update_preturi In update_devize.prg
			Do update_norme In update_devize.prg With [1=2]
			SELECT 0
			=ccmecanici()
			Select oper
			Scatter Name ooper Blank
			ofrm_addman = Createobject('frm_adaug_man')
			ofrm_addman.Show(1)
			If pniesire = 1
				Thisform.actualizeaza_grid1()
				Thisform.nid_sectie=pnid_sectie
				Thisform.nid_pret=pnid_pret
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_adauga_devizest
		PRIVATE podest,pcschema,pcselect
		STORE '' TO podest
		
		If Thisform.p.pAGE3.cmd_adauga1.Visible And Thisform.p.ActivePage=3
			pniesire=0
			Do update_preturi In update_devize.prg
			Do ccnorme_devest In update_devize.prg WITH '1=2'
			Do ccarticole In update_devize.prg WITH '1=2'
		
			pcschema=['']
			pcselect=['select * from ] + gcS + [.auto_vestimari_rep where 1=2']
			pcorder=[id_dev_estimare_rep]
			pcfiltru = [id_lucrare = ] + ALLTRIM(STR(ocomanda.id_lucrare))
			gencursor('podest','v_devest',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza)
			podest.ca_baza1.afisare()
			THISFORM.AlwaysOnTop= .F.
			ofrm_devest = Createobject('frm_devizestimativ')
			ofrm_devest.Show(1)
			
			THISFORM.AlwaysOnTop= .t.
			If pniesire = 1
				Thisform.actualizeaza_grid3()	
			Endif
		Endif
	ENDPROC

	PROCEDURE do_calcul
		Local lnRecNo,lnTVAMateriale
		Store 0 To Thisform.totalman,Thisform.totalore,Thisform.totalmat,lnTVAMateriale
		*!*	modificare	v 2.0.35 : lnCtvaM=m.ctvam
		
		If Reccount('rul')>0
			Select rul
			Scan
				Thisform.totalmat=Thisform.totalmat+Round(Pretv*cante,gnPc)
				lnTVAMateriale = lnTVAMateriale + ROUND(tva*cante,gnPc)		&&	modificare v 2.0.22
			Endscan
			Go Top
		Endif
		*!*	SET STEP ON
		If Reccount('oper')>0
			Select oper
			lnRecNo=Recno()
			Scan
				Thisform.totalman=Thisform.totalman+Round(timpn*Pret,gnPc)
				Thisform.totalore=Thisform.totalore+timpn
			Endscan
			Go lnRecNo
		Endif
		
		Thisform.totftva=Thisform.totalman+Thisform.totalmat
		*!*	modificare v 2.0.22
		*!*	Thisform.tva=Round(Thisform.totalmat*(lnCtvaM-1),gnPc)+Round(Thisform.totalman*(lnCtvaM-1),gnPc)
		*!*	modificare	v 2.0.35 	am inlocuit lnCtvaM cu ocomanda.proc_tvav
		Thisform.tva=IIF(glAutoBonDet,lnTVAMateriale,Round(Thisform.totalmat*(ocomanda.proc_tvav-1),gnPc))+Round(Thisform.totalman*(ocomanda.proc_tvav-1),gnPc)
		*!*	modificare v 2.0.22	^
		Thisform.totctva=Thisform.totftva+Thisform.tva
		
		
		*!*	*!*	LOCAL SECT
		*!*	*!*	SECT='.T.'
		*!*	*!*	IF !(THISFORM.P.PAGE1.CMDLIST1.CAPTION='MODIFICARE' OR M.SECTIE='SUPERVIZOR')
		*!*	*!*		SECT='ALLT(M.SECTIE)=ALLT(SECTIE)'
		*!*	*!*	ENDIF
		*!*	*!*	SELE oper
		*!*	*!*	M=RECCOUNT()+2
		*!*	OP=Crea('PROGRESBAR')
		*!*	OP.titlu.Caption='Se calculeaza datele...'
		*!*	OP.Show()
		
		*!*	*!*	j=0
		*!*	*!*	DO PR WITH j
		
		*!*	*!*	SELE oper
		*!*	*!*	SET FILTER TO nrord=m.nrord AND &SECT
		*!*	*!*	DO PR WITH j
		
		*!*	*!*	SELE oper
		*!*	*!*	SCAN FOR nrord=m.nrord AND &SECT
		*!*	*!*		THISFORM.totalman=THISFORM.totalman+timpn*pret
		*!*	*!*		THISFORM.totalore=THISFORM.totalore+timpn
		*!*	*!*		DO PR WITH j
		
		*!*	*!*	ENDSCAN
		*!*	*!*	*sum timpn*pret,timpn to thisform.totalman,thisform.totalore  for nrord=m.nrord AND &SECT
		*!*	*!*	SELE oper
		*!*	*!*	GO TOP
		*!*	*!*	OP.RELEASE
		
		Thisform.text4.Refresh
		Thisform.text5.Refresh
		Thisform.text6.Refresh
		Thisform.text7.Refresh
		Thisform.text8.Refresh
		Thisform.text9.Refresh
	ENDPROC

	PROCEDURE do_calculdevizest
		Local lnRecNo
		Store 0 To Thisform.tvalftva ,Thisform.tvaltva,Thisform.tvaloare,thisform.tman,thisform.tart
		
		
		If Reccount('v_devizest')>0
			Select v_devizest
			lnRecNo=Recno()
			SUM(valftva) to thisform.tvalftva 
			SUM(valtva) to thisform.tvaltva
			SUM(valoare) to thisform.tvaloare
			SUM(valftva) to thisform.tman for !ISNULL(id_norme)
			thisform.tart = thisform.tvalftva - thisform.tman
			Go lnRecNo
		ENDIF
		
		thisform.p.pAGE3.text3.Refresh
		thisform.p.paGE3.text5.Refresh
		thisform.p.paGE3.text10.Refresh
		thisform.p.paGE3.text11.Refresh
		thisform.p.paGE3.text12.Refresh
		
		
		
		
		
	ENDPROC

	PROCEDURE do_listare
		*!* 19.08.2014
		*!* marius.mutu
		*!* adaugat campul UM pe listare deviz estimativ
		
		If Thisform.p.ActivePage<>3
		*!*	modificare	v 2.0.35
			listare_comanda_deviz(Thisform,ocomanda,IIF(INLIST(ocomanda.id_tip,3,6),2,1))
		*!*		If Reccount('oper')>0 Or Reccount('rul')>0
		*!*			If Thisform.lcomandavalidata
		*!*				*!*			pcschema=['ID_ORDL n(10),CODOP c(10),TIMPN n(9,3),PRET n(20,4),VALIDAT n(1),DENOP c(100),SECTIE c(30)']
		*!*				*!*			pcselect=['select id_ordl,codop,timpn,pret,validat,denop,sectie from ] + gcS + [.dev_voper where 1=2']
		*!*				*!*			pcorder=[sectie,denop]
		*!*				*!*			pcfiltru=[id_ordl = ]+Alltrim(Str(ocomanda.id_ordl))
		*!*				*!*			llAfiseaza=.F.
		*!*				*!*			gencursor('pooper','oper',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza)
		*!*				*!*			pooper.ca_baza1.afisare()
		*!*				*!*			pcschema=['CODMAT c(50),DENUMIRE c(100),PRETV n(20,4),CANTE n(18,3)']
		*!*				*!*			pcselect=['select codmat,denumire,pretv,cante from ] + gcS + [.vrul where 1=2']
		*!*				*!*			pcorder=[denumire]
		*!*				*!*			pcfiltru=[id_lucrare = ]+Alltrim(Str(ocomanda.id_lucrare))
		*!*				*!*			llAfiseaza=.F.
		*!*				*!*			gencursor('porul','rul',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza)
		*!*				*!*			porul.ca_baza1.afisare()
		*!*				*!*			If Reccount('oper')>0 Or Reccount('rul')>0
		*!*				Private pdDataora,pcdataora,pntotaltn,pntotalval,pofirma,pcschema,pcselect,pcorder,pcfiltru
		*!*				Store '' To pofirma,pcschema,pcselect,pcorder,pcfiltru
		*!*				If Used('crsFirma')
		*!*					Use In crsfirma
		*!*				Endif
		*!*				lcSql = [select localitate,strada,numar,cod_fiscal,reg_comert from syn_nom_firme ] + ;
		*!*					[where id_firma = ?gnIdFirma]		&&	modificare	v 2.0.29 : am inlocuit gnId_Firma
		*!*				lnSucces=goExecutor.oExecute(lcSql,[crsfirma])
		*!*				If lnSucces<0
		*!*					AMessagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*					Return
		*!*				Endif
		*!*				Sele crsfirma
		*!*				Scatter Name firma
		*!*				Use In crsfirma
		*!*				If Used('crslistare')
		*!*					Use In crslistare
		*!*				Endif
		*!*				lcSql=[select a.nrord,a.nume,a.cod_fiscal,a.datai,a.asigurator,a.inspector,] + ;
		*!*					[a.banca,a.cont_banca,a.adresa,a.nr_dosar,a.reg_comert,a.tip_persoana,] + ;
		*!*					[b.nrinmat,b.series,b.seriem,b.culoare,b.kmint,b.marca,b.masina ] + ;
		*!*					[from ] + gcS + [.dev_vordl a ] + ;
		*!*					[left join ] + gcS + [.dev_vmasiniclienti b on a.id_masiniclient=b.id_masiniclient ] + ;
		*!*					[where a.id_ordl = ?ocomanda.id_ordl]
		*!*				lnSucces=goExecutor.oExecute(lcSql,'crslistare')
		*!*				If lnSucces<0
		*!*					AMessagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*					Return
		*!*				Endif
		*!*				Select crslistare
		*!*				Scatter Name olistare Memo
		*!*				Use In crslistare
		*!*				pcdataora=get_ora(2)
		*!*				pdDataora=Ttod(Ctot(pcdataora))
		*!*				*!* modificare 27.07
		*!*				Select rul
		*!*				*!*	modificare	v 2.0.22 : am adaugat tva
		*!*				Calculate Sum(Round(cante*pretv,gnPc)),Sum(Round(cante*tva,gnPc)) To pnTotalMatDeviz,pnTotalTVAMatDeviz
		*!*				Select oper
		*!*				Calculate Sum(Round(timpn*Pret,gnPc)) To pnTotalManDeviz
		*!*				pnTotalTvaDeviz=Iif(glAutoBonDet,pnTotalTVAMatDeviz,Round(pnTotalMatDeviz*(m.ctvam-1),gnPa))+Round(pnTotalManDeviz*(m.ctvam-1),gnPa)
		*!*				*!*
		*!*				Use In (Select('crsRulCumulat'))
		*!*				Select codmat,denumire,Sum(cante) As cante,pretv As Pret,Min(dataact) As dataact,Min(id_rul) As id_rul ;
		*!*					From rul Group By codmat,denumire,pretv ;
		*!*					INTO Cursor crsRulCumulat
		*!*				Select olistare.nrord As nrord,'A' As semn,codmat,denumire,cante,Pret,dataact As Data,id_rul As Id From crsRulCumulat ;
		*!*					WHERE cante <> 0 ;
		*!*					UNION All;
		*!*					SELECT olistare.nrord As nrord,'B' As semn,codop As codmat,denop As denumire,timpn As cante,Pret,datai As Data,id_oper As Id ;
		*!*					From oper Order By 2,7,8 Into Cursor crslistare
		*!*				Use In (Select('crsRulCumulat'))
		*!*				If Used('crslistare')
		*!*					Thisform.AlwaysOnTop=.F.
		*!*					Select crslistare
		*!*					*!*	modificare MIX 07.09.2007
		*!*					*!*	*!*	modificare 09.08.2006
		*!*					*!*				Locate For Like('MIX*',denumire) And semn=='A'
		*!*					*!*				If Found()
		*!*					*!*					Calculate Sum(Round(cante*Pret,gnPc)),Max(Recno()) To lnSumaMix,lnNrCrt For Like('MIX*',denumire) And semn='A'
		*!*					*!*					If Used('crslistare2')
		*!*					*!*						Use In crslistare2
		*!*					*!*					Endif
		*!*					*!*					Select Recno() As nrcrtord,* From crslistare Where !(Like('MIX*',denumire) And semn='A') Into Cursor crslistare2 Readwrite
		*!*					*!*					Select crslistare2
		*!*					*!*					Append Blank
		*!*					*!*					Replace codmat With '',denumire With 'MIX',semn With 'A',Pret With lnSumaMix,cante With 1,nrcrtord With lnNrCrt,nrord With olistare.nrord
		*!*					*!*					Use In crslistare
		*!*					*!*					Select * From crslistare2 Into Cursor crslistare Order By nrcrtord
		*!*					*!*					Use In crslistare2
		*!*					*!*				Endif
		*!*					*!*				Select crslistare
		*!*					*!*				Go Top
		*!*					*!*	*!*	modificare 09.08.2006
		*!*					*!*	modificare MIX 07.09.2007	^
		*!*					*!*				If gnTip_LPrecomanda = 1			&& cu tipizate
		*!*					*!*					Report Form _deviz To Printer Prompt Preview
		*!*					*!*				Else
		*!*					*!* 26.07.2006
		*!*					*!* MARIUS MUTU
		*!*					*!*				Report Form rap_deviz To Printer Prompt Preview
		*!*					*!*			modificare v 2.0.5
		*!*					*!*				Do LISTAREUSERREPORT With "crsListare", "FRX", "RAP_DEVIZ" In PROCEDURI_RAPOARTE.PRG
		*!*					goExport.export2frx([crslistare],[rap_deviz])
		*!*					*!*			modificare v 2.0.5	^
		*!*					*!* 26.06.2006
		*!*					*!*				Endif
		*!*					Thisform.AlwaysOnTop=.T.
		*!*					Use In crslistare
		*!*					*!*			Endif
		*!*				Endif
		*!*			Else
		*!*				Private pcdataora,pdDataora,pntotaltn,pntotalval
		*!*				If Used('crslistare')
		*!*					Use In crslistare
		*!*				Endif
		
		*!*				lcSql=[select a.nrord,a.nume,a.cod_fiscal,a.datai,a.asigurator,a.inspector,a.nr_dosar,] + ;
		*!*					[b.nrinmat,b.series,b.seriem,b.culoare,b.kmint,b.marca,b.masina ] + ;
		*!*					[from ] + gcS + [.dev_vordl a ] + ;
		*!*					[left join ] + gcS + [.dev_vmasiniclienti b on a.id_masiniclient=b.id_masiniclient ] + ;
		*!*					[where a.id_ordl=] + Alltrim(Str(ocomanda.id_ordl))
		*!*				lnSucces=goExecutor.oExecute(lcSql,'crslistare')
		*!*				If lnSucces<0
		*!*					AMessagebox(goExecutor.cEroare,0+16,'Eroare')
		*!*					Return
		*!*				Endif
		*!*				Select crslistare
		*!*				Scatter Name olistare
		*!*				Use In crslistare
		
		
		*!*				*!* modificare 27.07
		*!*				Select rul
		*!*				*!*	modificare	v 2.0.22 : am adaugat tva
		*!*				Calculate Sum(Round(cante*pretv,gnPc)),Sum(Round(cante*tva,gnPc)) To pnTotalMatDeviz,pnTotalTVAMatDeviz
		
		*!*				Select oper
		*!*				Calculate Sum(Round(timpn*Pret,gnPc)) To pnTotalManDeviz
		*!*				pnTotalTvaDeviz=Iif(glAutoBonDet,pnTotalTVAMatDeviz,Round(pnTotalMatDeviz*(m.ctvam-1),gnPa))+Round(pnTotalManDeviz*(m.ctvam-1),gnPa)
		*!*				*!*
		
		*!*				pcdataora=get_ora(2)
		*!*				pdDataora=Ttod(Ctot(pcdataora))
		*!*				Select olistare.nrord As nrord,'A' As semn,codmat,denumire,cante,pretv As Pret,dataact As Data,id_rul As Id From rul ;
		*!*					UNION All;
		*!*					SELECT olistare.nrord As nrord,'B' As semn,codop As codmat,denop As denumire,timpn As cante,Pret,datai As Data,id_oper As Id ;
		*!*					From oper Order By 2,7,8 Into Cursor crslistare
		
		*!*				If Used('crslistare')
		*!*					Thisform.AlwaysOnTop=.F.
		*!*					Select crslistare
		*!*					*!*			modificare v 2.0.5
		*!*					*!*				Do LISTAREUSERREPORT With "crsListare", [FRX], "RAP_COMANDA" In PROCEDURI_RAPOARTE.PRG
		*!*					goExport.export2frx([crslistare],[rap_comanda])
		*!*					*!*			modificare v 2.0.5	^
		*!*					*!*			REPORT FORM rap_comanda TO PRINTER PROMPT PREVIEW
		*!*					Thisform.AlwaysOnTop=.T.
		*!*					Use In crslistare
		*!*				Endif
		*!*			Endif
		*!*		Else
		*!*			AMessagebox("Nu exista manopera si materiale pe aceasta comanda!",0+48,"Atentie")
		*!*		Endif
		*!*	modificare	v 2.0.35	^
			*!*	sec n(1)
			*!*	semn=a >> din rul;b >> din oper
			*!*	codmat,denumire,cante,pretv,semn,sectie din rul
			*!*	codop,denop,timpn,pret,semn,sectie din oper
		
		
		Else
			If Reccount('v_devizest')>0
		
				Private pdDataora,pcdataora,pntotaltn,pntotalval,pofirma,pcschema,pcselect,pcorder,pcfiltru,pnTotalTva,pnTotalGen
				Store '' To pofirma,pcschema,pcselect,pcorder,pcfiltru
		
				If Used('crsFirma')
					Use In crsfirma
				Endif
				lcSql = [select localitate,strada,numar,cod_fiscal,reg_comert from syn_nom_firme ] + ;
					[where id_firma = ?gnIdFirma]		&&	modificare	v 2.0.29 : am inlocuit gnId_Firma
				if !goExecutor.oExecuta(lcSql,[crsfirma])
					Return
				Endif
		
				Sele crsfirma
				Scatter Name firma
				Use In crsfirma
		
				If Used('crslistare')
					Use In crslistare
				Endif
				*!*	modificare	v 2.0.37 : am pus a.kmint in loc de b.kmint
				lcSql=[select a.nrord,a.nume,a.cod_fiscal,a.datai,a.asigurator,a.inspector,] + ;
					[a.banca,a.cont_banca,a.adresa,a.nr_dosar,a.reg_comert,a.tip_persoana,] + ;
					[b.nrinmat,b.series,b.seriem,b.culoare,a.kmint,b.marca,b.masina ] + ;
					[from ] + gcS + [.auto_vordl a ] + ;
					[left join ] + gcS + [.auto_vmasiniclienti b on a.id_masiniclient=b.id_masiniclient ] + ;
					[where a.id_ordl = ?ocomanda.id_ordl]
				if !goExecutor.oExecuta(lcSql,'crslistare')
					Return
				Endif
				Select crslistare
				Scatter Name olistare Memo
				Use In crslistare
		
				pcdataora=get_ora(2)
				pdDataora=Ttod(Ctot(pcdataora))
		
		
				Select olistare.nrord As nrord,Iif(!Isnull(id_norme),'B','A') As semn,cod,denumire,um,cantitate,pretftva,valftva,id_dev_estimare_rep From v_devizest;
					Order By 2,8 Into Cursor crslistare
		
				pnTotalTva = This.tvaltva
				pnTotalGen = This.tvaloare
		
				If Used('crslistare')
					Thisform.AlwaysOnTop=.F.
					Select crslistare
		
					goExport.export2frx([crslistare],[rap_devizest],.F., , , , , .T.)	&&	modificare v 2.1.9
					Thisform.AlwaysOnTop=.T.
					Use In crslistare
				Endif
		
			Else
				AMessagebox("Nu exista manopera si materiale pe aceasta comanda!",0+48,"Atentie")
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_modifica
		Lparameters tnColoana
		Local lcNumeCamp,lcValoareNoua
		If Empty(tnColoana)
			Return
		Endif
		Thisform.lsalvat=.T.
		Select oper
		pnid_oper=id_oper
		Do Case
		Case tnColoana=1
			lcNumeCamp=[TIMPN]
			lcValoareInitiala=Alltrim(Str(Thisform.ntimpninitial,9,3))
			lcValoareNoua=Alltrim(Str(Thisform.ntimpnmodificat,9,3))
		*!*		If Thisform.ntimpnmodificat<0
		*!*			amessagebox("Timpul normat nu poate fi negativ!",0+48,"Atentie")
		*!*			lcSql2=[UPDATE OPER SET ]+lcNumeCamp+[=]+lcValoareInitiala+[ WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
		*!*			&lcSql2
		*!*			lcColoana=[thisform.p.page1.grid1.c]+lcNumeCamp
		*!*			loColoana=&lcColoana
		*!*			loColoana.text1.Refresh()
		*!*			Thisform.lvalidat=.F.
		*!*			Return
		*!*		Endif
		Case tnColoana=2
			lcNumeCamp=[PRET]
			lcValoareInitiala=Alltrim(Str(Thisform.npretinitial,20,4))
			lcValoareNoua=Alltrim(Str(Thisform.npretmodificat,20,4))
			If Thisform.npretmodificat<0
				amessagebox("Pretul nu poate fi negativ!",0+48,"Atentie")
				IF gnLunaRon+GnAnROn*12<= gnLuna+gnAn*12
					lcSql2=[UPDATE OPER SET ]+lcNumeCamp+[=]+lcValoareInitiala+[,NOU = 1 WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
				ELSE 
					lcSql2=[UPDATE OPER SET ]+lcNumeCamp+[=]+lcValoareInitiala+[ WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
				ENDIF 
		
				&lcSql2
				lcColoana=[thisform.p.page1.grid1.c]+lcNumeCamp
				loColoana=&lcColoana
				loColoana.text1.Refresh()
				Thisform.lvalidat=.F.
				Return
			Endif
		Endcase
		*!*	modificare 27.01
				lcSql=[begin pack_auto.dev_actualizeaza_operatie(']+gcS+[',']+lcNumeCamp+[',]+lcValoareNoua+;
					[,]+Alltrim(Str(pnid_oper))+[,]+Alltrim(Str(gnLuna))+[,]+Alltrim(Str(gnAn))+[); end;]
		*!*	IF (lcNumeCamp =[PRET]) AND (gnLunaRon+GnAnROn*12<= gnLuna+gnAn*12)
		*!*		lcSql=[UPDATE ] + gcS + [.DEV_OPER SET ]+lcNumeCamp+[=]+lcValoareNoua+[, nou = 1 WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
		*!*	ELSE 
		*!*		lcSql=[UPDATE ] + gcS + [.DEV_OPER SET ]+lcNumeCamp+[=]+lcValoareNoua+[ WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
		*!*	ENDIF 
		*!*	se comenteaza ^
		If !goExecutor.oExecuta(lcSql)
			IF (lcNumeCamp =[PRET]) AND (gnLunaRon+GnAnROn*12<= gnLuna+gnAn*12)
				lcSql2=[UPDATE OPER SET ]+lcNumeCamp+[=]+lcValoareInitiala+[ WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
			ELSE 
				lcSql2=[UPDATE OPER SET ]+lcNumeCamp+[=]+lcValoareInitiala+[,nou = 1 WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
			ENDIF 
			Thisform.lvalidat=.F.
		ELSE
			IF (lcNumeCamp =[PRET]) AND (gnLunaRon+GnAnROn*12<= gnLuna+gnAn*12)
				lcSql2=[UPDATE OPER SET ]+lcNumeCamp+[=]+lcValoareNoua+[,nou=1 WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
			ELSE 
				lcSql2=[UPDATE OPER SET ]+lcNumeCamp+[=]+lcValoareNoua+[ WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
			ENDIF 
			Thisform.lvalidat=.T.
		Endif
		&lcSql2
		lcColoana=[thisform.p.page1.grid1.c]+lcNumeCamp
		loColoana=&lcColoana
		loColoana.text1.Refresh()
		thisform.do_calcul()
	ENDPROC

	PROCEDURE do_modificacom
		Private pcnrord,pnidInsp,pnidAsig,pcInspector,pcAsigurator,pnIdMc,pnIdCl,pniesire,pnid_masina,pnKmInt,pdTermen,pcNrDosar, pnOreFct, pcObservatii, pcDefectiuni
		Local lcListaValori
		pniesire=0
		pcnrord=ocomanda.nrord
		pnidInsp=ocomanda.id_inspector
		pnidAsig=ocomanda.id_asigurator
		pnid_masina=0
		pnIdMc=0
		pnIdCl=0
		pcInspector=""
		pcAsigurator=""
		pcNrDosar=ocomanda.nr_dosar
		pnKmInt=ocomanda.kmint
		pnOreFct = ocomanda.ore_functionare
		pcObservatii = NVL(ocomanda.observatii, '')
		pcDefectiuni = NVL(ocomanda.defectiuni, '')
		pdTermen=Iif(Type('ocomanda.termen')='T',Ttod(ocomanda.termen),ocomanda.termen)
		
		Do update_asigurator In update_devize.prg
		Do update_inspector In update_devize.prg
		Select v_inspectori
		Set Filter To id_asigurator = ocomanda.id_asigurator
		
		ofrmmodifica=Createobject("frm_gencom",3,@pcnrord,@pnidInsp,@pnidAsig,@pnIdMc,@pnIdCl,@pnid_masina,@pnKmInt,@pdTermen,@pcNrDosar,.T.,@pcInspector,@pcAsigurator)
		With ofrmmodifica
			.ct_clb_client.do_dezactiveaza()
			.cnrdosar = ocomanda.nr_dosar
			.cnrcom=ocomanda.nrord
			.casig=ocomanda.asigurator
			.cinspector=ocomanda.inspector
			.cclient=ocomanda.nume
			.cnrinmat=ocomanda.nrinmat
			.cmarca=ocomanda.marca
			.ctipm=ocomanda.masina
			.cseries=ocomanda.series
			.nCilindree=ocomanda.cilindree
			.nPutereCP=ocomanda.puterecp
			.nPutereKW=ocomanda.puterekw		
			.nkmint=ocomanda.kmint
			.nOreFct = ocomanda.ore_functionare
			.cObservatii = NVL(ocomanda.observatii, '')
			.cDefectiuni = NVL(ocomanda.defectiuni, '')
			
			.dtermen=Iif(Type('ocomanda.termen')='T',Ttod(ocomanda.termen),ocomanda.termen)
			*!*	modificare	v 2.0.39
			.nidinsp = ocomanda.id_inspector
			.nidasig = ocomanda.id_asigurator
			*!*	modificare	v 2.0.39	^
		Endwith
		ofrmmodifica.Show(1)
		If pniesire=1
			lcListaValori=[]
			If pnidInsp!=ocomanda.id_inspector &&	And pnidInsp>0	:	modificare 2.0.37 - se poate si 0, ca sa pot sterge inspectorul in
																	&&	caz ca nu mai este folosit
				ocomanda.id_inspector=pnidInsp
				ocomanda.inspector=pcInspector
				lcListaValori=[ID_INSPECTOR=?pnidInsp]
			Endif
			If pnidAsig!=ocomanda.id_asigurator &&	And pnidAsig>0	:	modificare 2.0.37 - idem inspector
				ocomanda.id_asigurator=pnidAsig
				ocomanda.asigurator=pcAsigurator
				lcListaValori=Iif(!Empty(lcListaValori),lcListaValori+[,],lcListaValori)+[ID_ASIGURATOR=?pnidAsig]
			Endif
			IF pcNrDosar!=NVL(ocomanda.nr_dosar,[]) &&	AND !EMPTY(pcNrDosar)	:	modificare 2.0.37 - idem inspector
				ocomanda.nr_dosar = pcNrDosar
				lcListaValori=IIF(!EMPTY(lcListaValori),lcListaValori+[,],lcListaValori)+[NR_DOSAR=?pcNrDosar]
			ENDIF
			*!*	modificare	v 2.0.43
			IF pnKmInt!=NVL(ocomanda.kmint,[])
				ocomanda.kmint = pnKmInt
				lcListaValori=IIF(!EMPTY(lcListaValori),lcListaValori+[,],lcListaValori)+[KMINT=?pnKmInt]
			ENDIF
			*!*	modificare	v 2.0.43	^	
			IF pnOreFct!=NVL(ocomanda.ore_functionare,[])
				ocomanda.ore_functionare = pnOreFct
				lcListaValori=IIF(!EMPTY(lcListaValori),lcListaValori+[,],lcListaValori)+[ORE_FUNCTIONARE=?pnOreFct]
			ENDIF
			IF m.pdTermen!=NVL(ocomanda.termen,{})
				ocomanda.termen = m.pdTermen
				lcListaValori=IIF(!EMPTY(lcListaValori),lcListaValori+[,],lcListaValori)+[termen=?pdTermen]
			ENDIF
			IF m.pcObservatii!=NVL(ocomanda.observatii,{})
				ocomanda.observatii = m.pcObservatii
				lcListaValori=IIF(!EMPTY(lcListaValori),lcListaValori+[,],lcListaValori)+[observatii=?pcObservatii]
			ENDIF
			IF m.pcDefectiuni!=NVL(ocomanda.defectiuni,{})
				ocomanda.defectiuni = m.pcDefectiuni
				lcListaValori=IIF(!EMPTY(lcListaValori),lcListaValori+[,],lcListaValori)+[defectiuni=?pcDefectiuni]
			ENDIF	
			If !Empty(lcListaValori)
				plcomandam=.T.
				lcSql=[UPDATE ] + gcS + [.DEV_ORDL SET ] + lcListaValori + [ WHERE ID_ORDL=] + Alltrim(Str(ocomanda.id_ordl))
				if !goExecutor.oExecuta(lcSql)
					plcomandam=.F.
				Endif
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('oper')>0 And Thisform.p.pAGE1.cmd_sterge1.Visible AND thisform.p.ActivePage=1
			Select oper
			Scatter Name opdel
			If amessagebox("Sunteti sigur ca doriti sa stergeti "+NVL(Alltrim(opdel.denop),[operatia])+" din lista?",4+32+256,"Confirmare") = 6
		*!*			lcSql = [UPDATE ] + gcs + [.dev_oper SET sters = 1,dataoras = sysdate,id_utils = ]+ Alltrim(Str(gnIdutil)) + [ where id_oper = ] + Alltrim(Str(opdel.id_oper))
				lcSql=[begin pack_auto.sterge_operatie(']+ALLTRIM(gcS)+[',]+ALLTRIM(STR(opdel.id_oper))+[,]+;
					ALLTRIM(STR(gnIdUtil))+[); end;]
				If goExecutor.oExecuta(lcSql)
					Thisform.actualizeaza_grid1()
				Endif
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_validare
		If Reccount('oper')>0 And Thisform.p.page1.cmd_executa1.Visible And Thisform.p.page1.cmd_executa1.Enabled
			If AMessagebox("Sunteti sigur ca doriti validarea tuturor operatiilor nevalidate?",4+32+256,"Confirmare")==6
		*!*			Select oper
		*!*			Scan For Validat=0
		*!*				Scatter Name opdel
		*!*				lcSql = [UPDATE ] + gcs + [.dev_oper SET validat = 1 where id_oper = ] + Alltrim(Str(opdel.id_oper))
		*!*				lnSucces = goExecutor.oExecute(lcSql)
		*!*				If lnSucces <0
		*!*					AMessagebox(goExecutor.cEroare)
		*!*				Endif
		*!*				Select oper
		*!*			Endscan
		*!*	modificare 27.01
				lcSql = [begin pack_auto.dev_valideaza_operatii(']+gcS+[',]+Alltrim(Str(ocomanda.id_ordl))+;
					[,]+Alltrim(Str(gnIdUtil))+[); end;]
				if goExecutor.oExecuta(lcSql)
					Select oper
					Thisform.actualizeaza_grid1()
				Endif
			Endif
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		Local llReturn,lnColoana
		Thisform.lvalidat=.T.
		If Thisform.lsalvat=.F.
			lcColoana = []
			Do Case
			Case Thisform.ntimpninitial!=Thisform.ntimpnmodificat
				lnColoana=1
				lcColoana=[timp normat]
			Case Thisform.npretinitial!=Thisform.npretmodificat
				lnColoana=2
				lcColoana=[pret]
			Otherwise
				lcColoana = []
				Return .T.
			Endcase
			If amessagebox("Doriti sa salvati ultima modificare facuta?",4+32+256,"Modificare "+lcColoana)==6
				Thisform.do_modifica(lnColoana)
			Endif
		Endif
		Return Thisform.lvalidat
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local llReturn,lnColoana
		If Thisform.lsalvat=.F.
			lcColoana = []
			Do Case
			Case Thisform.ntimpninitial!=Thisform.ntimpnmodificat
				lnColoana=1
				lcColoana=[timp normat]
			Case Thisform.npretinitial!=Thisform.npretmodificat
				lnColoana=2
				lcColoana=[pret]
			Otherwise
				amessagebox("Modificarea nu a fost salvata!",0+48,"Atentie")
				Return .F.
			Endcase
			If amessagebox("Doriti sa salvati ultima modificare facuta?",4+32+256,"Modificare "+lcColoana)==6
				Thisform.do_modifica(lnColoana)
			Endif
		Endif
		Return Thisform.lvalidat
		
	ENDPROC

	PROCEDURE Init
		*!* 05.10.2015
		*!* marius.mutu
		*!* #4220 adaguare gridextras pentru cele 3 grid-uri (sa se retina dimensiunea coloanelor)
		
		Lparameters tnMod,tnComValidata
		Local lnMod,lnComValidata
		Thisform.p.page2.grid2.SetAll("DynamicForeColor","IIF(cota_diferita=1,RGB(255,66,66),RGB(0,0,0))","Column")	&&	modificare v 2.0.22
		DoDefault()
		lnMod=Iif(Empty(tnMod),1,tnMod)
		llComValidata=Iif(Empty(tnComValidata),.F.,Iif(tnComValidata=0,.F.,.T.))
		Thisform.lcomandavalidata=llComValidata
		If lnMod=2 Or glLunaInchisa
			Thisform.cmd_modifica.Visible=.F.
			With Thisform.p.page1
				.cmd_adauga1.Visible=.F.
				.cmd_executa1.Visible=.F.
				.cmd_sterge1.Visible=.F.
				With .grid1
					.cpret.ReadOnly=.T.
					.cpret.text1.ReadOnly=.T.
					.ctimpn.ReadOnly=.T.
					.ctimpn.text1.ReadOnly=.T.
					.csectie.ReadOnly=.T.
					.csectie._cbbase1.Enabled=.F.
					.cvalidat.ReadOnly=.T.
					.cvalidat.check1.ReadOnly=.T.
					.Height=Thisform.p.page2.grid2.Height
					.Left=Thisform.p.page2.grid2.Left
					.Top=Thisform.p.page2.grid2.Top
					.Width=Thisform.p.page2.grid2.Width
				Endwith
			ENDWITH
			WITH thisform.p.pAGE3
				.cmd_adauga1.Visible= .F.
				WITH .grid3
					.Left=Thisform.p.page2.grid2.Left
					.Top=Thisform.p.page2.grid2.Top
					.Width=Thisform.p.page2.grid2.Width
				ENDWITH
			ENDWITH 		
		Endif
		thisform.nid_pret=0
		thisform.nid_sectie=0
		Thisform.actualizeaza_grid1()
		Thisform.actualizeaza_grid2()
		thisform.actualizeaza_grid3()
		
		this.gridextra1.setup()
		this.gridextra2.setup()
		this.gridextra3.setup()
		
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		* Centrez fereastra si o fac 70% din ecran
		lnHeight = _screen.Height
		lnWidth = _screen.Width
		This.Height = INT(0.7 * m.lnHeight)
		this.Width = INT(0.7 * m.lnWidth)
		this.AutoCenter = .T. 
		
	ENDPROC

	PROCEDURE lb_client.Init
		This.Caption=This.Caption+Space(2)+Alltrim(Nvl(ocomanda.nume,''))
		
	ENDPROC

	PROCEDURE lb_client.MouseDown
		Lparameters nButton, nShift, nXCoord, nYCoord
		If nButton = 1
			thisform.MouseIcon='HMOVE.CUR'
			thisform.MousePointer= 99
			ReleaseCapture()
			SendMessage(Thisform.nHWND, 0x112, 0xF012, 0x0)
			thisform.MousePointer= 0
			SendMessage(Thisform.nHWND, 0x202, 0x0, 0x0)	
		Endif
		
	ENDPROC

	PROCEDURE lb_data.Init
		lcData = Iif(Isnull(ocomanda.datai),[],Iif(Type("ocomanda.datai")#'D',Dtoc(Ttod(ocomanda.datai)),Dtoc(ocomanda.datai)))
		This.Caption=This.Caption+Space(2)+lcData
		
	ENDPROC

	PROCEDURE lb_data.MouseDown
		Lparameters nButton, nShift, nXCoord, nYCoord
		If nButton = 1
			thisform.MouseIcon='HMOVE.CUR'
			thisform.MousePointer= 99
			ReleaseCapture()
			SendMessage(Thisform.nHWND, 0x112, 0xF012, 0x0)
			thisform.MousePointer= 0
			SendMessage(Thisform.nHWND, 0x202, 0x0, 0x0)	
		Endif
	ENDPROC

	PROCEDURE Lb_titlu_alb_b121.Init
		This.Caption=This.Caption+Space(2)+Alltrim(Nvl(ocomanda.nrord,''))
		
	ENDPROC

	PROCEDURE p.Page1.Activate
		This.FontBold=.T.
		This.FontItalic=.F.
		This.Parent.page2.FontBold=.F.
		This.Parent.page2.FontItalic=.T.
		This.Parent.page3.FontBold=.F.
		This.Parent.page3.FontItalic=.T.
		Select oper
	ENDPROC

	PROCEDURE p.Page1.Grid1.cPret.Text1.GotFocus
		Thisform.npretinitial=This.Value
		Thisform.npretmodificat=This.Value
		Thisform.lvalidat=.T.
	ENDPROC

	PROCEDURE p.Page1.Grid1.cPret.Text1.InteractiveChange
		Thisform.npretmodificat=This.Value
		Thisform.lsalvat=.F.
	ENDPROC

	PROCEDURE p.Page1.Grid1.cPret.Text1.Valid
		If Thisform.npretinitial!=Thisform.npretmodificat And Thisform.lsalvat=.F.
			Thisform.do_modifica(2)
		Endif
		
	ENDPROC

	PROCEDURE p.Page1.Grid1.cSectie._CBBASE1.GotFocus
		This.Tag=Alltrim(Str(v_nom_sectii.id_sectie))
	ENDPROC

	PROCEDURE p.Page1.Grid1.cSectie._CBBASE1.Valid
		pnid_sectie=v_nom_sectii.id_sectie
		If Int(Val(This.Tag))!=pnid_sectie
			pnid_oper=oper.id_oper
		*!*		lcSql=[UPDATE ] + gcS + [.DEV_OPER SET ID_SECTIE=]+Alltrim(Str(pnid_sectie))+[ WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
			lcSql=[begin pack_auto.modifica_sectie(']+ALLTRIM(gcS)+[',]+;
				ALLTRIM(STR(pnId_sectie))+[,]+ALLTRIM(STR(pnid_oper))+[,]+ALLTRIM(STR(gnIdUtil))+[); end;]
			if !goExecutor.oExecuta(lcSql)
				Return
			Endif
		Endif
	ENDPROC

	PROCEDURE p.Page1.Grid1.cTimpn.Text1.GotFocus
		Thisform.ntimpninitial=This.Value
		Thisform.ntimpnmodificat=This.Value
		Thisform.lvalidat=.T.
	ENDPROC

	PROCEDURE p.Page1.Grid1.cTimpn.Text1.InteractiveChange
		Thisform.ntimpnmodificat=This.Value
		Thisform.lsalvat=.F.
	ENDPROC

	PROCEDURE p.Page1.Grid1.cTimpn.Text1.Valid
		If Thisform.ntimpninitial!=Thisform.ntimpnmodificat And Thisform.lsalvat=.F.
			Thisform.do_modifica(1)
		Endif
		
	ENDPROC

	PROCEDURE p.Page1.Grid1.cValidat.Check1.Click
		If !This.ReadOnly
			Local pnid_oper
			Select oper
			pnid_oper=id_oper
		*!*		lcSql=[UPDATE ] + gcS + [.DEV_OPER SET VALIDAT=]+Alltrim(Str(This.Value))+[ WHERE ID_OPER=]+Alltrim(Str(pnid_oper))
			lcSql=[begin pack_auto.valideaza_operatie(']+gcS+[',]+Alltrim(Str(This.Value))+[,]+Alltrim(Str(pnid_oper))+[,]+;
				ALLTRIM(Str(gnIdUtil))+[); end;]
			if !goExecutor.oExecuta(lcSql)
				This.Value=Abs(This.Value-1)
			Endif
		*!*	modificare 09.06
			Thisform.nselectate=Thisform.nselectate+This.Value*2-1
			Thisform.activeaza_validare()
		*!*		Thisform.actualizeaza_grid1()
		*!*	^
		Endif
	ENDPROC

	PROCEDURE p.Page2.Activate
		This.FontBold=.T.
		This.FontItalic=.F.
		This.Parent.page1.FontBold=.F.
		This.Parent.page1.FontItalic=.T.
		This.Parent.page3.FontBold=.F.
		This.Parent.page3.FontItalic=.T.
		This.grid2.cvaloare.ControlSource = 'ROUND(rul.cante*rul.pretv,gnPc)'
		This.grid2.ActivateCell(1,1)
		
	ENDPROC

	PROCEDURE p.Page3.Activate
		This.FontBold=.T.
		This.FontItalic=.F.
		This.Parent.page1.FontBold=.F.
		This.Parent.page1.FontItalic=.T.
		This.Parent.page2.FontBold=.F.
		This.Parent.page2.FontItalic=.T.
		
		
		
	ENDPROC

ENDDEFINE
