*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="serii_numere.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS clb_serie_act AS _container OF "_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Text_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_cbbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase1" UniqueID="" Timestamp="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<DefinedPropArrayMethod>
		*m: do_initializeaza
		*m: genereazanumar
		*p: cvariabila		&& Proprietatea din 'pcobj' corespunzatoare campului de serie.
		*p: cvariabiladoc		&& Proprietatea din 'pcobj' corespunzatoare campului de nr. doc.
		*p: nid_tipdoc
		*p: ntip		&& 0 - serie din baza de date;1 - serie manuala
		*p: pcobj
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		BackStyle = 0
		cvariabila = 
		cvariabiladoc = 
		Height = 29
		Name = "clb_serie_act"
		nid_tipdoc = 
		ntip = 0
		pcobj = 
		Width = 314
		_memberdata = <VFPData>
			<memberdata name="cvariabila" type="Property" favorites="True"/>
			<memberdata name="cvariabiladoc" type="Property" favorites="True"/>
			<memberdata name="nid_tipdoc" type="Property" favorites="True"/>
			<memberdata name="pcobj" type="Property" favorites="True"/>
			<memberdata name="genereazanumar" display="genereazaNumar"/>
			<memberdata name="ntip" display="nTip"/>
		</VFPData>
	*</PropValue>

	ADD OBJECT '_cbbase1' AS _cbbase WITH ;
		ColumnLines = .F., ;
		Height = 23, ;
		Left = 126, ;
		Name = "_cbbase1", ;
		RowSourceType = 6, ;
		SpecialEffect = 1, ;
		Top = 3, ;
		Width = 184, ;
		ZOrderSet = 1
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT '_lbbase1' AS _lbbase WITH ;
		Caption = "Seria documentului", ;
		Left = 8, ;
		Name = "_lbbase1", ;
		Top = 6, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'Text_simplu1' AS _txbase WITH ;
		Format = "K!", ;
		Left = 126, ;
		Name = "Text_simplu1", ;
		Top = 3, ;
		Width = 184, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_tx_base.vcx" BaseClass="textbox" />
	
	PROCEDURE do_initializeaza
		*!* 04.02.2014
		*!* marius.mutu
		*!* s-a tratat cazul tnRezultat = 2 (FARA SERIE, CU PLAJA)
		
		Lparameters tnRezultat
		Local lcCursor,lcSerie
		With This
			._cbbase1.Visible = .F.
			.text_simplu1.Visible = .F.
			.text_simplu1.ControlSource = ""
			._cbbase1.RowSource = ""
			._cbbase1.Value = ""
			
			Do Case
				Case m.tnRezultat = 1 && CU SERIE, FARA PLAJE
					.text_simplu1.ControlSource = Upper(.pcobj) + [.] + Alltrim(.cvariabila)
		*!*				.RemoveObject('_cbbase1')
					.text_simplu1.Visible = .T.
					.nTip = 1 && NU GENEREAZA NUMAR DIN PLAJA
				Case m.tnRezultat = 2 && FARA SERIE, CU PLAJE (BON FISCAL)
					.text_simplu1.ControlSource = Upper(.pcobj) + [.] + Alltrim(.cvariabila)
		*!*				.RemoveObject('_cbbase1')
					.text_simplu1.Visible = .T.
					.nTip = 0 && GENEREAZA NUMAR DIN PLAJA
				OTHERWISE && 3 CU SERIE SI PLAJE
					._cbbase1.RowSource = poGeneratorNumere.getNumeCursor(.nid_tipdoc)
					._cbbase1.Value = poGeneratorNumere.getSerieCursor(.nid_tipdoc)
					lcValoare = Upper(.pcobj)+[.]+Alltrim(.cvariabila)+[=']+Nvl(._cbbase1.Value,[])+[']
					&lcValoare
		*!*				.RemoveObject('text_simplu1')
					._cbbase1.Visible = .T. 
					.nTip = 0 && GENEREAZA NUMAR DIN PLAJA
			Endcase
		Endwith
		
	ENDPROC

	PROCEDURE genereazanumar
		Local lcValoare
		If This.nTip = 0
			lcValoare = Upper(This.pcobj)+[.]+Alltrim(This.cvariabila)+[=']+Nvl(This._cbbase1.Value,[])+[']
			&lcValoare
			*!*	modificare ROAFACTURARE v 2.0.80
			lcValoare = Upper(This.pcobj)+[.]+Alltrim(This.cvariabiladoc)
		
			If poGeneratorNumere.verifica_serie(This.nid_tipdoc) Or &lcValoare. = 0
				lcValoare = lcValoare+[=]+;
					ALLTRIM(Str(poGeneratorNumere.aloca_numar(This.nid_tipdoc,Null),20,0))
				&lcValoare
				This.Parent.Refresh()
			Endif
			*!*		If poGeneratorNumere.verifica_serie(This.nid_tipdoc)
			*!*			lcValoare = Upper(This.pcobj)+[.]+Alltrim(This.cvariabiladoc) + [=] + ;
			*!*				ALLTRIM(Str(poGeneratorNumere.aloca_numar(This.nid_tipdoc,Null),20,0))
			*!*			&lcValoare
			*!*			This.Parent.Refresh()
			*!*		Endif
			*!*	modificare ROAFACTURARE v 2.0.80	^
		Endif
	ENDPROC

	PROCEDURE _cbbase1.LostFocus
		This.Parent.genereazaNumar()
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_plaje AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_plaje"
	*</PropValue>
	
	PROCEDURE make_sql
		*!* 28.02.2017
		*!* Plaja inf, sup - daca erau prea mari se duceau cu E10
		
		Lparameters toRec,tnId
		
		lcActiune = Alltrim(This.cActiune)
		
		If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcId_tipdoc = ALLTRIM(STR(toRec.id_tipdoc))
			lcId_tipentitate = ALLTRIM(STR(toRec.id_tipentitate))
			lcId_serie = NVL(ALLTRIM(STR(toRec.id_serie)),[NULL])
			lcId_entitate = NVL(ALLTRIM(STR(toRec.id_entitate)),[NULL])
			lcPl_inf = ALLTRIM(STR(toRec.pl_inf,20,0))
			lcPl_sup = ALLTRIM(STR(toRec.pl_sup,20,0))
			lcDataI = [to_date('] + DTOC(toRec.datai,1) + [','YYYYMMDD')]
			lcDataS = [to_date('] + DTOC(toRec.datas,1) + [','YYYYMMDD')]
			lcInactiv = ALLTRIM(STR(toRec.inactiv))
		Endif
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin pack_serii_numere.adauga_plaja(] + lcId_tipdoc + [,] + ;
				lcId_tipentitate + [,] + lcId_serie + [,] + lcId_entitate + [,?gnIdSucursala,] + ;
				lcPl_inf + [,] + lcPl_sup + [,] + lcDataI + [,] + lcDataS + [,] + ;
				lcInactiv + [,?gnIdUtil); end;]
		Case lcActiune = "UPDATE"
			lcSql = [begin pack_serii_numere.modifica_plaja(] + lcId + [,] + lcId_tipdoc + [,] + ;
				lcId_tipentitate + [,] + lcId_serie + [,] + lcId_entitate + [,?gnIdSucursala,] + ;
				lcPl_inf + [,] + lcPl_sup + [,] + lcDataI + [,] + lcDataS + [,] + ;
				lcInactiv + [,?gnIdUtil); end;]
		Case lcActiune = "DELETE"
			lcSql = [begin pack_serii_numere.sterge_plaja(] + lcId + [,?gnIdUtil); end;]
		Endcase
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_serii AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_serii"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		
		lcActiune = Alltrim(This.cActiune)
		
		If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcSerie = Alltrim(toRec.serie)
			lcAn = Alltrim(Str(toRec.an))
			lcLuna = Alltrim(Str(toRec.luna))
			lcLungime = Alltrim(Str(toRec.lungime))
			lcInactiv = Alltrim(Str(toRec.inactiv))
			lcIsAutofactura = ALLTRIM(STR(NVL(poRec.isautofactura,0)))
			lcIsBeneficiari = ALLTRIM(STR(NVL(poRec.isbeneficiari,0)))
			lcIsTerti = ALLTRIM(STR(NVL(poRec.isterti,0)))
			lcIsFurnizori = ALLTRIM(STR(NVL(poRec.isfurnizori,0)))
			lcPrefix = IIF(ISNULL(poRec.prefix), 'NULL', ALLTRIM(STR(poRec.prefix,5,0)))
			lcAn2Caractere = ALLTRIM(STR(NVL(poRec.an2caractere,0)))
		Endif
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin pack_serii_numere.adauga_serie('] + lcSerie + [',] + ;
				lcAn + [,] + lcLuna + [,] + lcLungime + [,] + lcInactiv + ;
				[,?gnIdUtil,] + m.lcIsAutofactura + [,] + m.lcIsBeneficiari + [,] + m.lcIsTerti + [,] + m.lcIsFurnizori + [,] + m.lcPrefix + [,] + m.lcAn2Caractere + [); end;]
		Case lcActiune = "UPDATE"
			lcSql = [begin pack_serii_numere.modifica_serie(] + lcId + [,] + ;
				['] + lcSerie + [',] + lcAn + [,] + lcLuna + [,] + lcLungime + [,] + ;
				lcInactiv + [,?gnIdUtil,] + m.lcIsAutofactura + [,] + m.lcIsBeneficiari + [,] + m.lcIsTerti + [,] + m.lcIsFurnizori + [,] + m.lcPrefix + [,] + m.lcAn2Caractere + [); end;]
		Case lcActiune = "DELETE"
			lcSql = [begin pack_serii_numere.sterge_serie(] + lcId + [,?gnIdUtil); end;]
		Endcase
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_tipdoc AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_tipdoc"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		
		lcActiune = Alltrim(This.cActiune)
		
		If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcId_tipentitate = Alltrim(Str(toRec.id_tipentitate))
			lcCu_plaje = Alltrim(Str(toRec.cu_plaje))
			lcDezactiveazaTot = Iif(toRec.cu_plaje=0,Alltrim(Str(toRec.dezactiveaza_tot)),[0])
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql = []
			Case lcActiune = "UPDATE"
				*!*		lcSql = [begin pack_serii_numere.modifica_tipdoc(] + lcId + [,] + lcId_tipentitate + [,] + ;
				*!*			lcCu_plaje + [,] + lcDezactiveazaTot + [,?gnIdUtil); end;]
				lcSql = [begin pack_serii_numere.modifica_tipdoc(?pnIdAMS,?poRec.id_tipentitate, ?poRec.cu_serie, ?poRec.cu_plaje, ?poRec.an, ?poRec.luna, ?poRec.an2caractere, ?poRec.dezactiveaza_tot, ?gnIdUtil); end;]
			Case lcActiune = "DELETE"
				lcSql = []
		Endcase
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_plaje1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_entitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_valabilitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_plaja" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_inactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_serie" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_form
		*m: do_cauta_entitate
		*m: do_cauta_serie
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 200
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_plaje_nou"
		nid = 0
		orec = 
		Width = 371
		_memberdata = <VFPData>

		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 612
		_shape1.ZOrderSet = 3
		_shape2.Name = "_shape2"
		Lb_titlu_alb_b121.Caption = "PLAJE"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Left = 342
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 6
		BUT_TERMIN1.Top = 2
		BUT_TERMIN1.ZOrderSet = 6
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 7, ;
		Top = 2, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'ck_inactiv' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 4, ;
		Caption = "Inactiv", ;
		ControlSource = "poRec.inactiv", ;
		Left = 45, ;
		Name = "ck_inactiv", ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 172
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Clb_plaja' AS clb_nr_intre WITH ;
		Anchor = 4, ;
		Left = 26, ;
		Name = "Clb_plaja", ;
		TabIndex = 3, ;
		Top = 105, ;
		tx_n1.ControlSource = "poRec.pl_inf", ;
		tx_n1.FontName = "Arial Narrow", ;
		tx_n1.Height = 23, ;
		tx_n1.InputMask = "999 999 999 999", ;
		tx_n1.Left = 65, ;
		tx_n1.Name = "tx_n1", ;
		tx_n1.Top = 2, ;
		tx_n1.Width = 107, ;
		Lb_simplu1.Caption = "Plaja", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		tx_n2.ControlSource = "poRec.pl_sup", ;
		tx_n2.FontName = "Arial Narrow", ;
		tx_n2.InputMask = "999 999 999 999", ;
		tx_n2.Left = 176, ;
		tx_n2.Name = "tx_n2", ;
		tx_n2.Top = 2, ;
		tx_n2.Width = 107
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_valabilitate' AS clb_luna_intre WITH ;
		Anchor = 4, ;
		Left = 26, ;
		Name = "Clb_valabilitate", ;
		TabIndex = 4, ;
		Top = 133, ;
		tx_n1.Name = "tx_n1", ;
		Lb_simplu1.Caption = "Valabilitate", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		tx_n2.Name = "tx_n2"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_entitate' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(porec.id_entitate,0)), ;
		cprocedura = thisform.do_cauta_entitate, ;
		cvar_afisata = porec.entitate, ;
		Height = 31, ;
		Left = 25, ;
		Name = "Ct_clb_entitate", ;
		TabIndex = 1, ;
		Top = 48, ;
		Width = 323, ;
		img_cautare.Left = 300, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Height = 29, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Entitate", ;
		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 = 102, ;
		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="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_serie' AS ct_clb_cautare WITH ;
		Anchor = 4, ;
		cconditie = EMPTY(NVL(porec.id_serie,0)), ;
		cprocedura = thisform.do_cauta_serie, ;
		cvar_afisata = porec.serie, ;
		Height = 31, ;
		Left = 25, ;
		Name = "Ct_clb_serie", ;
		TabIndex = 2, ;
		Top = 76, ;
		Width = 323, ;
		img_cautare.Left = 300, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Height = 29, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Serie", ;
		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 = 102, ;
		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="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_plaje1' AS cus_odata_plaje WITH ;
		Left = 108, ;
		Name = "Cus_odata_plaje1", ;
		Top = 0
		*< END OBJECT: ClassLib="serii_numere.vcx" BaseClass="custom" />
	
	PROCEDURE actualizeaza_form
	ENDPROC

	PROCEDURE do_cauta_entitate
		*!* 11.11.2009
		*!* marius.mutu
		*!* id_tipentitate = 6 - tip imobilizari (corporale, necorporale, in curs)
		
		Do Case
			Case poRec.id_tipentitate = 1 && gestiune
				locauta = caut_gestiune()
				If !Isnull(locauta)
					poRec.id_entitate = locauta.id_gestiune
					poRec.entitate = locauta.nume_gestiune
					If poRec.cu_serie = 1
						Thisform.ct_clb_serie.SetFocus()
					Else
						Thisform.clb_plaja.SetFocus()
					Endif
				Endif
		
			Case poRec.id_tipentitate = 3 && utilizatori
				locauta = cauta_utilizator_firma()
				If !Isnull(locauta)
					poRec.id_entitate = locauta.id_util
					poRec.entitate = locauta.utilizator
					If poRec.cu_serie = 1
						Thisform.ct_clb_serie.SetFocus()
					Else
						Thisform.clb_plaja.SetFocus()
					Endif
				Endif
		
			Case poRec.id_tipentitate = 4 && grup utilizatori
				locauta = caut_gruputilizatori()
				If !Isnull(locauta)
					poRec.id_entitate = locauta.id_grup
					poRec.entitate = locauta.denumire_grup
					If poRec.cu_serie = 1
						Thisform.ct_clb_serie.SetFocus()
					Else
						Thisform.clb_plaja.SetFocus()
					Endif
				Endif
			Case poRec.id_tipentitate = 5 && subgrupe articole
				locauta = caut_subgrupa_articole()
				If !Isnull(locauta)
					poRec.id_entitate = locauta.id_subgrupa
					poRec.entitate = locauta.subgrupa
					If poRec.cu_serie = 1
						Thisform.ct_clb_serie.SetFocus()
					Else
						Thisform.clb_plaja.SetFocus()
					Endif
				Endif
				*!* 11.11.2009
			Case poRec.id_tipentitate = 6 && tip imobilizari
				locauta = caut_tipuri_imobilizare()
				If !Isnull(locauta)
					poRec.id_entitate = locauta.id_tip_imobilizare
					poRec.entitate = locauta.denumire
					If poRec.cu_serie = 1
						Thisform.ct_clb_serie.SetFocus()
					Else
						Thisform.clb_plaja.SetFocus()
					Endif
				Endif
				*!* 11.11.2009 ^
		Endcase
		
	ENDPROC

	PROCEDURE do_cauta_serie
		locauta=caut_serii_fact()
		If !Isnull(locauta)
			poRec.id_serie = locauta.id_serie
			poRec.serie = locauta.serie
			Thisform.clb_plaja.SetFocus()
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local plReturn
		Store .T. To plReturn
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		lcDataI = Alltrim(Thisform.clb_valabilitate.tx_n1.Value)
		lcDataS = Alltrim(Thisform.clb_valabilitate.tx_n2.Value)
		poRec.datai = Iif(!Empty(lcDataI),Date(Val(Substr(lcDataI,3)),Val(Substr(lcDataI,1,2)),1),{})
		poRec.DataS = Iif(!Empty(lcDataS),Gomonth(Date(Val(Substr(lcDataS,3)),Val(Substr(lcDataS,1,2)),1),1)-1,{})
		Do Case
		Case poRec.id_tipentitate <> 2 And Empty(Nvl(poRec.id_entitate,0))
			amessagebox('Nu ati completat campul pentru ' + Lower(Alltrim(poRec.tipentitate)) + ' !',0+48,"Atentie")
			Thisform.ct_clb_entitate.SetFocus()
			plReturn=.F.
		Case poRec.cu_serie = 1 And Empty(Nvl(poRec.id_serie,0))
			amessagebox('Nu ati completat seria!',0+48,"Atentie")
			Thisform.ct_clb_serie.SetFocus()
			PLRETURN=.F.
		Case poRec.pl_inf < 0
			amessagebox("Valoarea minima nu poate fi negativa!",48,"Atentie")
			Thisform.clB_PLAJA.tx_n1.SetFocus()
			plReturn = .F.
		Case poRec.pl_inf > poRec.pl_sup
			amessagebox("Valoarea maxima nu poate fi mai mica decat valoarea minima!",48,"Atentie")
			Thisform.clB_PLAJA.tx_n2.SetFocus()
			plReturn = .F.
		Case Empty(poRec.datai)
			amessagebox("Nu ati introdus luna de inceput!",48,"Atentie")
			Thisform.clb_valabilitate.tx_n1.SetFocus()
			plReturn = .F.
		Case Empty(poRec.DataS)
			amessagebox("Nu ati introdus luna de sfarsit!",48,"Atentie")
			Thisform.clb_valabilitate.tx_n2.SetFocus()
			plReturn = .F.
		Case poRec.DataS < poRec.datai
			amessagebox("Luna finala trebuie sa fie mai mare decat cea initiala!",48,"Atentie")
			Thisform.clb_valabilitate.tx_n2.SetFocus()
			plReturn = .F.
		Otherwise
		*!*		If poRec.cu_serie = 1 And Empty(Nvl(poRec.id_serie,0))
		*!*			If amessagebox('Nu ati completat seria!' + Chr(13) + Chr(10) + 'Doriti sa continuati?',4+32,"Confirmare")==7
		*!*				Thisform.ct_clb_serie.SetFocus()
		*!*				plReturn=.F.
		*!*			Endif
		*!*		Endif
		*!*		If plReturn
				plReturn=Thisform.cus_odata_plaje1.salvare(This.OREC,This.NID)
				If !plReturn
					Thisform.clB_PLAJA.SetFocus()
				Endif
		*!*		Endif
		Endcase
		Return plReturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DoDefault()
		
		Thisform.orec= toRec
		Thisform.nid = tnId
		Thisform.cus_odata_plaje1.cactiune = tcActiune
		If tcActiune = 'UPDATE'
			If toRec.id_tipentitate<> toRec.id_tipentitate2
		&&	daca documentul are alt tip de entitate si inactiv = 0
		&&	il las doar sa-l inactiveze
				Thisform.ct_clb_entitate.do_dezactiveaza()
				Thisform.ct_clb_serie.do_dezactiveaza()
				With Thisform.clb_plaja
					.tx_N1.ReadOnly=.T.
					.tx_N2.ReadOnly=.T.
				Endwith
				With Thisform.clb_valabilitate
					.tx_N1.ReadOnly=.T.
					.tx_N2.ReadOnly=.T.
				Endwith
			Endif
		Endif
		
		lnHeight = Thisform.Height
		lnOffset = 3
		If toRec.cu_serie = 0
			lnHeight = lnHeight - Thisform.ct_clb_serie.Height + lnOffset
			Thisform.RemoveObject([ct_clb_serie])
			toRec.id_serie = NULL
		Endif
		If toRec.id_tipentitate = 2
			lnHeight = lnHeight - Thisform.ct_clb_entitate.Height + lnOffset
			Thisform.RemoveObject([ct_clb_entitate])
		Else
			Thisform.ct_clb_entitate.clb_tx_cautare.lb_simplu1.Caption = Proper(Alltrim(toRec.tipentitate))
		Endif
		
		With Thisform.clb_valabilitate
			If !Empty(Nvl(poRec.datai,{}))
				.tx_N1.Value = Padl(Alltrim(Str(Month(poRec.datai))),2,[0])+Alltrim(Str(Year(poRec.datai)))
			Endif
			If !Empty(Nvl(poRec.DataS,{}))
				.tx_N2.Value = Padl(Alltrim(Str(Month(poRec.DataS))),2,[0])+Alltrim(Str(Year(poRec.DataS)))
			Endif
		Endwith
		
		Thisform.Height = lnHeight
		
		Thisform.Refresh()
	ENDPROC

	PROCEDURE Clb_plaja.tx_n1.Valid
		*!*
	ENDPROC

	PROCEDURE Clb_valabilitate.tx_n1.Valid
		If !Empty(This.Value)
			lcLuna=Substr(Alltrim(This.Value),1,2)
			lcAn=Substr(Alltrim(This.Value),3)
			If Type("DATE(VAL(lcAn),VAL(lcLuna),1)")!="D"
				aMESSAGEBOX("Data invalida!",0+16,"Eroare")
				Return 0
			Endif
		Endif
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="pgf_serii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cId_serie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cId_serie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cLungime.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cLungime.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cExemplu.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cExemplu.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cResetare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cResetare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cInactiv._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsAutofactura.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsAutofactura.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsAutofactura.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsbeneficiari.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsbeneficiari.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsbeneficiari.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsTerti.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsTerti.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsTerti.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsFurnizori.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsFurnizori.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cIsFurnizori.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cPrefix.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cPrefix.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cAn2caractere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cAn2caractere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE1.grdSerii.cAn2caractere._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cId_serie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cId_serie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cLungime.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cLungime.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cExemplu.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cExemplu.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cResetare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cResetare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pgf_serii.PAGE2.grdSerii.cInactiv._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cId_TipDoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cId_TipDoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cTipdoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cTipdoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cMaxLen.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cMaxLen.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cTipEntitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cTipEntitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cCu_serie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cCu_serie._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cCu_plaje.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cCu_plaje._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.Column7._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cPlInf.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cPlInf.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cEntitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cEntitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cPlSup.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cPlSup.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cId_plaja.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cId_plaja.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cUrmval.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cUrmval.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cTipEntitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cTipEntitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cDatai.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cDatai.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cDatas.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cDatas.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdPlaje.cInactiv._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_tipuri_documente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_plaje_numere" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_inactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modiparam1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_form
		*m: actualizeaza_grid3
		*m: actualizeaza_grid4
		*m: do_adauga_serie
		*m: do_modifica_serie
		*m: do_modifica_tipdoc
		*m: do_modiparam
		*m: do_sterge_serie
	*</DefinedPropArrayMethod>

	*<PropValue>
		cbuton1 = 
		cbuton2 = 
		cbuton3 = 
		cbuton4 = 
		DoCreate = .T.
		Height = 593
		Name = "frm_plaje_numere"
		Width = 793
		WindowState = 2
		_memberdata = <VFPData>

		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 792
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 761
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 41
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "CONFIGURARE SERII - PLAJE NUMERE"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 763
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 8, ;
		caction = do_modifica, ;
		Height = 27, ;
		Left = 698, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 53, ;
		Visible = .T., ;
		Width = 30, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica3' AS but_modifica WITH ;
		Anchor = 0, ;
		caction = do_modifica_tipdoc, ;
		Left = 328, ;
		Name = "But_modifica3", ;
		TabIndex = 2, ;
		Top = 31, ;
		Visible = .T., ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modiparam1' AS but_modiparam WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 725, ;
		Name = "But_modiparam1", ;
		ToolTipText = "Actualizeaza urmatorul numar din plaja", ;
		Top = 53, ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 669, ;
		Name = "But_nou1", ;
		TabIndex = 5, ;
		Top = 53, ;
		Width = 30, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		caction = do_sterge, ;
		Height = 27, ;
		Left = 754, ;
		Name = "But_sterge1", ;
		TabIndex = 7, ;
		Top = 53, ;
		Visible = .T., ;
		Width = 30, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdDocumente' AS _grdrow WITH ;
		Anchor = 5, ;
		ColumnCount = 7, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		HeaderHeight = 32, ;
		Height = 330, ;
		HighlightStyle = 2, ;
		lcamptextneeditabil = .F., ;
		Left = 12, ;
		Name = "grdDocumente", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsTipdoc", ;
		TabIndex = 1, ;
		Top = 60, ;
		Width = 348, ;
		ZOrderSet = 10, ;
		Column1.ColumnOrder = 7, ;
		Column1.ControlSource = "id_tipdoc", ;
		Column1.FontName = "Arial", ;
		Column1.Name = "cId_TipDoc", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 52, ;
		Column2.ColumnOrder = 1, ;
		Column2.ControlSource = "tipdoc", ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cTipdoc", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 96, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "maxlen", ;
		Column3.FontName = "Arial", ;
		Column3.Name = "cMaxLen", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 54, ;
		Column4.ColumnOrder = 2, ;
		Column4.ControlSource = "tipentitate", ;
		Column4.FontName = "Arial", ;
		Column4.Name = "cTipEntitate", ;
		Column4.ReadOnly = .T., ;
		Column5.ColumnOrder = 5, ;
		Column5.ControlSource = "cu_serie", ;
		Column5.FontName = "Arial", ;
		Column5.Name = "cCu_serie", ;
		Column5.ReadOnly = .T., ;
		Column5.Sparse = .F., ;
		Column5.Width = 51, ;
		Column6.ColumnOrder = 4, ;
		Column6.ControlSource = "cu_plaje", ;
		Column6.FontName = "Arial", ;
		Column6.Name = "cCu_plaje", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 47, ;
		Column7.ColumnOrder = 6, ;
		Column7.ControlSource = "plajepeentitate", ;
		Column7.CurrentControl = "_checkbox1", ;
		Column7.FontName = "Arial", ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column7.Sparse = .F., ;
		Column7.Width = 51
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'grdDocumente.cCu_plaje.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cu plaje", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDocumente.cCu_serie._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		Left = 25, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdDocumente.cCu_serie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cu serie", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDocumente.cId_TipDoc.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 'grdDocumente.cMaxLen.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lungime maxima", ;
		FontName = "Arial", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDocumente.cMaxLen.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 'grdDocumente.Column7._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		Left = 27, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdDocumente.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Plaje pe entitati", ;
		FontName = "Arial", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDocumente.cTipdoc.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 'grdDocumente.cTipEntitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip entitate", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDocumente.cTipEntitate.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 'grdPlaje' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 10, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		HeaderHeight = 19, ;
		Height = 306, ;
		lcamptextneeditabil = .F., ;
		Left = 372, ;
		Name = "grdPlaje", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsPlaje", ;
		TabIndex = 4, ;
		Top = 84, ;
		Width = 413, ;
		ZOrderSet = 11, ;
		Column1.ColumnOrder = 4, ;
		Column1.ControlSource = "pl_inf", ;
		Column1.FontName = "Arial", ;
		Column1.InputMask = (get_mask(18,0)), ;
		Column1.Name = "cPlInf", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 102, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "entitate", ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cEntitate", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 85, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "pl_sup", ;
		Column3.FontName = "Arial", ;
		Column3.InputMask = (get_mask(18,0)), ;
		Column3.Name = "cPlSup", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 101, ;
		Column4.ColumnOrder = 10, ;
		Column4.ControlSource = "id_plaja", ;
		Column4.FontName = "Arial", ;
		Column4.Name = "cId_plaja", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 64, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "urmval", ;
		Column5.FontName = "Arial", ;
		Column5.Name = "cUrmval", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 112, ;
		Column6.ColumnOrder = 3, ;
		Column6.ControlSource = "serie", ;
		Column6.FontName = "Arial", ;
		Column6.Name = "cSerie", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 60, ;
		Column7.ColumnOrder = 1, ;
		Column7.ControlSource = "tipentitate", ;
		Column7.FontName = "Arial", ;
		Column7.Name = "cTipEntitate", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 82, ;
		Column8.ColumnOrder = 7, ;
		Column8.ControlSource = "datai", ;
		Column8.FontName = "Arial", ;
		Column8.Name = "cDatai", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 87, ;
		Column9.ColumnOrder = 8, ;
		Column9.ControlSource = "datas", ;
		Column9.FontName = "Arial", ;
		Column9.Name = "cDatas", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 80, ;
		Column10.ColumnOrder = 9, ;
		Column10.ControlSource = "inactiv", ;
		Column10.FontName = "Arial", ;
		Column10.Name = "cInactiv", ;
		Column10.ReadOnly = .T., ;
		Column10.Sparse = .F., ;
		Column10.Width = 42
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'grdPlaje.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 'grdPlaje.cDatas.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data sfarsit", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cDatas.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 'grdPlaje.cEntitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Entitate", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cEntitate.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 'grdPlaje.cId_plaja.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cId_plaja.Text1' AS textbox WITH ;
		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 'grdPlaje.cInactiv._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		Left = 21, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 47
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'grdPlaje.cPlInf.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Limita inferioara", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cPlInf.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 'grdPlaje.cPlSup.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Limita superioara", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cPlSup.Text1' AS textbox WITH ;
		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 'grdPlaje.cSerie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cSerie.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 'grdPlaje.cTipEntitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip entitate", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cTipEntitate.Text1' AS textbox WITH ;
		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 'grdPlaje.cUrmval.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Urmatorul numar", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdPlaje.cUrmval.Text1' AS textbox WITH ;
		Alignment = 3, ;
		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_plaje_numere' AS lb_simplu WITH ;
		Caption = "Plaje de numere", ;
		Left = 371, ;
		Name = "lb_plaje_numere", ;
		TabIndex = 12, ;
		Top = 40, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'lb_tipuri_documente' AS lb_simplu WITH ;
		Caption = "Tipuri documente", ;
		Left = 14, ;
		Name = "lb_tipuri_documente", ;
		TabIndex = 11, ;
		Top = 40, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'opt_inactiv' AS _optiongrup WITH ;
		AutoSize = .F., ;
		ButtonCount = 3, ;
		Height = 28, ;
		Left = 372, ;
		Name = "opt_inactiv", ;
		ndefault = 2, ;
		TabIndex = 3, ;
		Top = 57, ;
		Value = 2, ;
		Width = 216, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Toate", ;
		Option1.FontName = "Arial", ;
		Option1.FontSize = 10, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 0, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Active", ;
		Option2.FontName = "Arial", ;
		Option2.FontSize = 10, ;
		Option2.Left = 57, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option2.Value = 1, ;
		Option3.AutoSize = .T., ;
		Option3.BackColor = 212,208,200, ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Inactive", ;
		Option3.FontName = "Arial", ;
		Option3.FontSize = 10, ;
		Option3.ForeColor = 128,128,128, ;
		Option3.Height = 18, ;
		Option3.Left = 117, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5, ;
		Option3.Width = 62
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'pgf_serii' AS _pageframe WITH ;
		Anchor = 14, ;
		ErasePage = .T., ;
		Height = 192, ;
		Left = 9, ;
		Name = "pgf_serii", ;
		TabIndex = 10, ;
		TabStyle = 1, ;
		Top = 396, ;
		Width = 771, ;
		ZOrderSet = 0, ;
		PAGE1.BackColor = 255,255,255, ;
		PAGE1.Caption = "Serii", ;
		PAGE1.Name = "PAGE1", ;
		PAGE2.BackColor = 255,255,255, ;
		PAGE2.Caption = "Serii folosite la plajele de numere", ;
		PAGE2.Name = "PAGE2"
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="pageframe" />

	ADD OBJECT 'pgf_serii.PAGE1.But_modifica2' AS but_modifica WITH ;
		Anchor = 8, ;
		caction = do_modifica_serie, ;
		Left = 727, ;
		Name = "But_modifica2", ;
		TabIndex = 8, ;
		Top = 38, ;
		Visible = .T., ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pgf_serii.PAGE1.But_nou2' AS but_nou WITH ;
		Anchor = 8, ;
		caction = do_adauga_serie, ;
		Left = 727, ;
		Name = "But_nou2", ;
		TabIndex = 7, ;
		Top = 9, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pgf_serii.PAGE1.But_sterge2' AS but_sterge WITH ;
		Anchor = 8, ;
		caction = do_sterge_serie, ;
		Left = 727, ;
		Name = "But_sterge2", ;
		TabIndex = 9, ;
		Top = 67, ;
		Visible = .T., ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 12, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		HeaderHeight = 36, ;
		Height = 155, ;
		lcamptextneeditabil = .F., ;
		Left = 7, ;
		Name = "grdSerii", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsSerii", ;
		TabIndex = 6, ;
		Top = 3, ;
		Width = 715, ;
		Column1.ColumnOrder = 12, ;
		Column1.ControlSource = "id_serie", ;
		Column1.FontName = "Arial", ;
		Column1.Name = "cId_serie", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 79, ;
		Column2.ColumnOrder = 1, ;
		Column2.ControlSource = "serie", ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cSerie", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 124, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "lungime", ;
		Column3.FontName = "Arial", ;
		Column3.Name = "cLungime", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 75, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "exemplu", ;
		Column4.FontName = "Arial", ;
		Column4.Name = "cExemplu", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 122, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "resetare", ;
		Column5.FontName = "Arial", ;
		Column5.Name = "cResetare", ;
		Column5.ReadOnly = .T., ;
		Column6.ColumnOrder = 2, ;
		Column6.ControlSource = "inactiv", ;
		Column6.FontName = "Arial", ;
		Column6.Name = "cInactiv", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 48, ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "isautofactura", ;
		Column7.CurrentControl = "Check1", ;
		Column7.FontName = "Arial", ;
		Column7.Name = "cIsAutofactura", ;
		Column7.ReadOnly = .T., ;
		Column7.Sparse = .F., ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "isbeneficiari", ;
		Column8.CurrentControl = "Check1", ;
		Column8.FontName = "Arial", ;
		Column8.Name = "cIsbeneficiari", ;
		Column8.ReadOnly = .T., ;
		Column8.Sparse = .F., ;
		Column9.ColumnOrder = 10, ;
		Column9.ControlSource = "isterti", ;
		Column9.CurrentControl = "Check1", ;
		Column9.FontName = "Arial", ;
		Column9.Name = "cIsTerti", ;
		Column9.ReadOnly = .T., ;
		Column9.Sparse = .F., ;
		Column10.ColumnOrder = 11, ;
		Column10.ControlSource = "isfurnizori", ;
		Column10.CurrentControl = "Check1", ;
		Column10.FontName = "Arial", ;
		Column10.Name = "cIsFurnizori", ;
		Column10.ReadOnly = .T., ;
		Column10.Sparse = .F., ;
		Column10.Width = 99, ;
		Column11.ColumnOrder = 3, ;
		Column11.ControlSource = "prefix", ;
		Column11.FontName = "Arial", ;
		Column11.Name = "cPrefix", ;
		Column11.ReadOnly = .T., ;
		Column12.ColumnOrder = 5, ;
		Column12.ControlSource = "an2caractere", ;
		Column12.CurrentControl = "_checkbox1", ;
		Column12.FontName = "Arial", ;
		Column12.Name = "cAn2caractere", ;
		Column12.ReadOnly = .T., ;
		Column12.Sparse = .F., ;
		Column12.Width = 78
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cAn2caractere._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Left = 54, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		Top = 62
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cAn2caractere.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lungime an pe 2 caractere", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cExemplu.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Exemplu", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cExemplu.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 'pgf_serii.PAGE1.grdSerii.cId_serie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cId_serie.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 'pgf_serii.PAGE1.grdSerii.cInactiv._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		Left = 20, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 35
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiva", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsAutofactura.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 34, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 52, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsAutofactura.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Autofactura", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsAutofactura.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsbeneficiari.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 42, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 52, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsbeneficiari.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Emisa de beneficiari", ;
		FontName = "Arial", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsbeneficiari.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsFurnizori.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 34, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 52, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsFurnizori.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Emisa in numele furnizorilor", ;
		FontName = "Arial", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsFurnizori.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsTerti.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 38, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 52, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsTerti.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Emisa de terti", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cIsTerti.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cLungime.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lungime numar", ;
		FontName = "Arial", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cLungime.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 'pgf_serii.PAGE1.grdSerii.cPrefix.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prefix", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cPrefix.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 'pgf_serii.PAGE1.grdSerii.cResetare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Resetare", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cResetare.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 'pgf_serii.PAGE1.grdSerii.cSerie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE1.grdSerii.cSerie.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 'pgf_serii.PAGE2.grdSerii' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		HeaderHeight = 19, ;
		Height = 147, ;
		lcamptextneeditabil = .F., ;
		Left = 7, ;
		Name = "grdSerii", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsSeriiPlaje", ;
		TabIndex = 6, ;
		Top = 3, ;
		Width = 715, ;
		Column1.ColumnOrder = 6, ;
		Column1.ControlSource = "id_serie", ;
		Column1.FontCharSet = 1, ;
		Column1.FontName = "Arial", ;
		Column1.Name = "cId_serie", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 114, ;
		Column2.ColumnOrder = 1, ;
		Column2.ControlSource = "serie", ;
		Column2.FontCharSet = 1, ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cSerie", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 124, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "lungime", ;
		Column3.FontCharSet = 1, ;
		Column3.FontName = "Arial", ;
		Column3.Name = "cLungime", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 75, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "exemplu", ;
		Column4.FontCharSet = 1, ;
		Column4.FontName = "Arial", ;
		Column4.Name = "cExemplu", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 122, ;
		Column5.ColumnOrder = 3, ;
		Column5.ControlSource = "resetare", ;
		Column5.FontCharSet = 1, ;
		Column5.FontName = "Arial", ;
		Column5.Name = "cResetare", ;
		Column5.ReadOnly = .T., ;
		Column6.ColumnOrder = 2, ;
		Column6.ControlSource = "inactiv", ;
		Column6.FontCharSet = 1, ;
		Column6.FontName = "Arial", ;
		Column6.Name = "cInactiv", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 50
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cExemplu.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Exemplu", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cExemplu.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cId_serie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cInactiv._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Left = 20, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 35
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiva", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cLungime.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lungime numar", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cResetare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Resetare", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cResetare.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cSerie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pgf_serii.PAGE2.grdSerii.cSerie.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_form
	ENDPROC

	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru = tcFiltru
		If Empty(lcFiltru)
			lcFiltru = poDocumente.ca_baza1.cfiltru
		Endif
		save_grid_comment(Thisform.grdDocumente)
		poDocumente.ca_baza1.cfiltru = lcFiltru
		poDocumente.ca_baza1.afisare()
		restore_grid_comment(Thisform.grdDocumente)
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru = tcFiltru
		If Empty(lcFiltru)
			lcFiltru = poPlaje.ca_baza1.cfiltru
		Endif
		save_grid_comment(Thisform.grdPlaje)
		poPlaje.ca_baza1.cfiltru = lcFiltru
		poPlaje.ca_baza1.afisare()
		restore_grid_comment(Thisform.grdPlaje)
	ENDPROC

	PROCEDURE actualizeaza_grid3
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru = tcFiltru
		If Empty(lcFiltru)
			lcFiltru = poSerii.ca_baza1.cfiltru
		Endif
		save_grid_comment(Thisform.pgf_serii.page1.grdSerii)
		poSerii.ca_baza1.cfiltru = lcFiltru
		poSerii.ca_baza1.afisare()
		restore_grid_comment(Thisform.pgf_serii.page1.grdSerii)
	ENDPROC

	PROCEDURE actualizeaza_grid4
		save_grid_comment(Thisform.pgf_serii.page2.grdSerii)
		Select id_serie, serie, an, luna, lungime, inactiv, resetare, exemplu, 0 As selectat From crsSerii ;
			WHERE id_serie In (Select Distinct id_serie From crsPlaje) Into Cursor crsSeriiPlaje Readwrite
		restore_grid_comment(Thisform.pgf_serii.page2.grdSerii)
	ENDPROC

	PROCEDURE do_adauga
		If Reccount('crsTipDoc') >0
			Select crsPlaje
			Scatter Name loRec Blank
			Select crsTipDoc
			loRec.id_tipentitate = id_tipentitate
			loRec.id_tipdoc = id_tipdoc
			loRec.tipentitate = tipentitate
			AddProperty(loRec,'cu_serie',cu_serie)
			pniesire = 0
			Do Adauga_Modifica_Inregistrare With "plaje",loRec,,"INSERT"
			If pniesire=1
				Thisform.actualizeaza_grid2()
				Thisform.actualizeaza_grid4()
			Endif
			Thisform.grdPlaje.SetFocus()
		Else
			amessagebox("Nu ati ales un document!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_adauga_serie
		Select crsSerii
		Scatter Name loRec Blank
		pniesire = 0
		Do Adauga_Modifica_Inregistrare With "serii",loRec,,"INSERT"
		If pniesire=1
			Thisform.actualizeaza_grid3()
		Endif
		Thisform.pgf_serii.page1.grdSerii.SetFocus()
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('crsPlaje')>0
			Select crsPlaje
			Scatter Name loRec
			Select crsTipDoc
			AddProperty(loRec,'cu_serie',cu_serie)
			AddProperty(loRec,'id_tipentitate2',id_tipentitate)
			lcExplicatie = Lower(Alltrim(descriere))
			If loRec.inactiv = 1 And loRec.id_tipentitate2 <> loRec.id_tipentitate
				amessagebox("Nu puteti modifica aceasta plaja, deoarece tipul de entitate nu corespunde cu cel setat pentru " + ;
					lcExplicatie + " !",48,"Atentie")
			Else
				pniesire = 0
				Do Adauga_Modifica_Inregistrare With "plaje",loRec,loRec.id_plaja,"UPDATE"
				If pniesire=1
					Thisform.actualizeaza_grid2()
					Thisform.actualizeaza_grid4()
				Endif
				Select crsPlaje
				Locate For id_plaja = loRec.id_plaja
				Thisform.grdPlaje.SetFocus()
			Endif
			Release loRec
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_modifica_serie
		If Reccount('crsSerii')>0
			Select crsSerii
			Scatter Name loRec
			pniesire = 0
			Do Adauga_Modifica_Inregistrare With "serii",loRec,loRec.id_serie,"UPDATE"
			If pniesire=1
				Thisform.actualizeaza_grid3()
			Endif
			Select crsSerii
			Locate For id_serie = loRec.id_serie
			Thisform.pgf_serii.page1.grdSerii.SetFocus()
		Else
			amessagebox("Nu puteti face modificari, deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_modifica_tipdoc
		If Reccount('crsTipDoc')>0
			Select crsTipDoc
			Scatter Name loRec
			AddProperty(loRec,'dezactiveaza_tot',0)
			pniesire = 0
			Do Adauga_Modifica_Inregistrare With "tipdoc",loRec,loRec.id_tipdoc,"UPDATE"
			If pniesire=1
				Thisform.actualizeaza_grid1()
			Endif
			Select crsTipDoc
			Locate For id_tipdoc = loRec.id_tipdoc
			Thisform.grdDocumente.SetFocus()
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_modiparam
		PRIVATE pnIdPlaja, pnNumarVechi, pnNumarNou
		SELECT crsPlaje
		pnIdPlaja = id_plaja
		pnNumarVechi = urmval
		pnNumarNou = m.pnNumarVechi
		loFrmSeteazaNumar = CREATEOBJECT("frm_seteaza_numar")
		loFrmSeteazaNumar.Show(1)
		IF m.gnButon = 2
			RETURN
		ENDIF 
		llSucces = goExecutor.oExecuta([BEGIN pack_serii_numere.seteaza_numar(?pnIdPlaja, ?pnNumarVechi, ?pnNumarNou); END;])
		IF m.llSucces
			Thisform.actualizeaza_grid2()
			Thisform.actualizeaza_grid4()
		
			Select crsPlaje
			Locate For id_plaja = m.pnIdPlaja
			Thisform.grdPlaje.SetFocus()
		ENDIF 
		
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('crsPlaje')>0
			Select crsPlaje
			Scatter Name loRec
			pniesire = 0
			Do STERGE_INREGISTRARE With "plaje",loRec.id_plaja
			If pniesire = 1
				Thisform.actualizeaza_grid2()
				Thisform.actualizeaza_grid4()
			Endif
			Thisform.grdPlaje.SetFocus()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge_serie
		If Reccount('crsSerii')>0
			Select crsSerii
			Scatter Name loRec
			pniesire = 0
			Do STERGE_INREGISTRARE With "serii",loRec.id_serie
			If pniesire = 1
				Thisform.actualizeaza_grid3()
			Endif
			Thisform.pgf_serii.page1.grdSerii.SetFocus()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Thisform.grdPlaje.SetAll([DynamicForeColor],[IIF(inactiv=1,RGB(128,128,128),RGB(0,0,0))],[Column])
		Thisform.grdPlaje.SetAll([DynamicFontItalic],[IIF(valabil=0,.T.,.F.)],[Column])
		Thisform.pgf_serii.page2.grdSerii.SetAll([DynamicBackColor],[IIF(selectat=1,RGB(173,178,206),RGB(255,255,255))],[Column])
		If !Isnull(gnIdSucursala)
			Thisform.RemoveObject([but_modifica3])
		Endif
		
	ENDPROC

	PROCEDURE grdDocumente.AfterRowColChange
		Lparameters nColIndex
		If Inlist(This.RowColChange,0,1,3)
			Select crsTipdoc
			lnIdTipDoc = id_tipdoc
			lcExplicatie = Lower(Alltrim(descriere))
			lnCuPlaje = cu_plaje
			lcFiltru = [id_tipdoc = ] + Alltrim(Str(lnIdTipDoc))
			Do Case
				Case Thisform.opt_inactiv.Value = 2
					lcFiltru = lcFiltru + [ and inactiv = 0]
				Case Thisform.opt_inactiv.Value = 3
					lcFiltru = lcFiltru + [ and inactiv = 1]
			Endcase
			If lnCuPlaje = 1
				Thisform.but_nou1.Visible = .T.
				Thisform.but_modifica1.Visible = .T.
				Thisform.but_sterge1.Visible = .T.
				Thisform.but_modiparam1.Visible = .T.
			Else
				Thisform.but_nou1.Visible = .F.
				Thisform.but_modifica1.Visible = .F.
				Thisform.but_sterge1.Visible = .F.
				Thisform.but_modiparam1.Visible = .F.	
			Endif
			Thisform.lb_plaje_numere.Caption = [Plaje de ] + lcExplicatie
			Thisform.pgf_serii.page2.Caption = [Serii folosite la plajele de ] + lcExplicatie
			Thisform.actualizeaza_grid2(lcFiltru)
			Thisform.actualizeaza_grid4()
		Endif
		
	ENDPROC

	PROCEDURE grdPlaje.AfterRowColChange
		Lparameters nColIndex
		If Inlist(This.RowColChange,1,3)
			Select crsPlaje
			lnIdSerie = id_serie
			Select crsSeriiPlaje
			Replace selectat With Iif(id_serie=lnIdSerie,1,0) All
			Locate For selectat = 1
			If !Found()
				Go Top
			ENDIF
			Thisform.pgf_serii.page2.Refresh()
		Endif
		
	ENDPROC

	PROCEDURE opt_inactiv.InteractiveChange
		If Reccount('crsTipDoc')>0
			Select crsTipdoc
			lnIdTipDoc = id_tipdoc
			lcFiltru = [id_tipdoc = ] + Alltrim(Str(lnIdTipDoc))
			Do Case
			Case Thisform.opt_inactiv.Value = 2
				lcFiltru = lcFiltru + [ and inactiv = 0]
			Case Thisform.opt_inactiv.Value = 3
				lcFiltru = lcFiltru + [ and inactiv = 1]
			Endcase
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtSerie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboResetare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtLungime" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkInactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblExemplu" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_serii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboTip" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtPrefix" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkAn2Caractere" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblAn2Caractere" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_form
		*m: refreshexemplu
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 252
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_serii_nou"
		nid = 0
		orec = .NULL.
		Width = 264
		_memberdata = <VFPData>
			<memberdata name="refreshexemplu" display="RefreshExemplu"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 612
		_shape1.ZOrderSet = 1
		_shape2.Name = "_shape2"
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "SERII"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 11
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Left = 234
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Left = 10
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 42
	*</PropValue>

	ADD OBJECT '_lbbase1' AS _lbbase WITH ;
		Caption = "Serie", ;
		Left = 10, ;
		Name = "_lbbase1", ;
		TabIndex = 12, ;
		Top = 45, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase2' AS _lbbase WITH ;
		Caption = "Resetare", ;
		Left = 10, ;
		Name = "_lbbase2", ;
		TabIndex = 14, ;
		Top = 129, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase3' AS _lbbase WITH ;
		Caption = "Lungime numar", ;
		Left = 10, ;
		Name = "_lbbase3", ;
		TabIndex = 15, ;
		Top = 103, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase4' AS _lbbase WITH ;
		Caption = "Inactiv", ;
		Left = 10, ;
		Name = "_lbbase4", ;
		TabIndex = 17, ;
		Top = 228, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase5' AS _lbbase WITH ;
		Caption = "Tip special D394", ;
		Left = 10, ;
		Name = "_lbbase5", ;
		TabIndex = 13, ;
		Top = 200, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase6' AS _lbbase WITH ;
		Caption = "Prefix (numeric)", ;
		Left = 10, ;
		Name = "_lbbase6", ;
		TabIndex = 16, ;
		Top = 77, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_shape3' AS _shape WITH ;
		BackStyle = 0, ;
		Height = 126, ;
		Left = 5, ;
		Name = "_shape3", ;
		Top = 69, ;
		Width = 253, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

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

	ADD OBJECT 'cboResetare' AS _combobox WITH ;
		Height = 24, ;
		Left = 122, ;
		Name = "cboResetare", ;
		RowSource = "Fara resetare,An,Luna", ;
		RowSourceType = 1, ;
		TabIndex = 3, ;
		ToolTipText = "Seria se reseteaza la inceputul fiecarui an/luna", ;
		Top = 126, ;
		Value = Fara resetare, ;
		Width = 130, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'cboTip' AS _combobox WITH ;
		Height = 24, ;
		Left = 122, ;
		Name = "cboTip", ;
		RowSource = "Normal,Autofactura,Emisa de beneficiari,Emisa de terti,Emisa in numele furnizorilor", ;
		RowSourceType = 1, ;
		TabIndex = 6, ;
		ToolTipText = "Autofactura,Emisa de beneficiari,Emisa de terti,Emisa in numele furnizorilor", ;
		Top = 197, ;
		Value = Normal, ;
		Width = 137, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'chkAn2Caractere' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		ControlSource = "poRec.an2caractere", ;
		Enabled = .F., ;
		Left = 122, ;
		Name = "chkAn2Caractere", ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 150, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'chkInactiv' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		ControlSource = "poRec.inactiv", ;
		Left = 122, ;
		Name = "chkInactiv", ;
		TabIndex = 9, ;
		TabStop = .F., ;
		Top = 228, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cus_odata_serii1' AS cus_odata_serii WITH ;
		Left = 96, ;
		Name = "Cus_odata_serii1", ;
		Top = 2
		*< END OBJECT: ClassLib="serii_numere.vcx" BaseClass="custom" />

	ADD OBJECT 'lblAn2Caractere' AS _lbbase WITH ;
		Caption = "An pe 2 caractere", ;
		Enabled = .F., ;
		Left = 10, ;
		Name = "lblAn2Caractere", ;
		TabIndex = 18, ;
		Top = 150, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'lblExemplu' AS _lbbase WITH ;
		AutoSize = .F., ;
		Caption = "Ex:", ;
		Height = 17, ;
		Left = 10, ;
		Name = "lblExemplu", ;
		TabIndex = 10, ;
		Top = 173, ;
		Width = 231, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'txtLungime' AS _textbox WITH ;
		ControlSource = "poRec.lungime", ;
		Format = "KR", ;
		Height = 23, ;
		InputMask = "99999999", ;
		Left = 122, ;
		Name = "txtLungime", ;
		TabIndex = 5, ;
		ToolTipText = "Pe cate caractere se genereaza numerele din serie", ;
		Top = 101, ;
		Width = 74, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtPrefix' AS _textbox WITH ;
		ControlSource = "poRec.prefix", ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "99999", ;
		Left = 122, ;
		MaxLength = 5, ;
		Name = "txtPrefix", ;
		TabIndex = 2, ;
		ToolTipText = "Pe cate caractere se genereaza numerele din serie", ;
		Top = 75, ;
		Width = 74, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtSerie' AS _textbox WITH ;
		ControlSource = "poRec.serie", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 122, ;
		MaxLength = 10, ;
		Name = "txtSerie", ;
		TabIndex = 1, ;
		Top = 42, ;
		Width = 137, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE actualizeaza_form
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local PLRETURN
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		lcValoare = This.CBOresetare.Value && Fara resetare/An/Luna
		
		Do Case
			Case lcValoare == 'Fara resetare'
				poRec.an = 0
				poRec.luna = 0
			Case lcValoare == 'An'
				poRec.an = 1
				poRec.luna = 0
			Otherwise
				poRec.an = 1
				poRec.luna = 1
		Endcase
		*!*	lnLungimeMinima = poRec.an * 4 + poRec.luna * 2
		
		lcValoare = this.cboTip.Value
		poRec.isautofactura = 0
		poRec.isbeneficiari = 0
		poRec.isterti = 0
		poRec.isfurnizori = 0
		Do Case
			Case lcValoare = 'Autofactura'
				poRec.isautofactura = 1
			Case lcValoare = 'Emisa de beneficiari'
				poRec.isbeneficiari = 1
			Case lcValoare = 'Emisa de terti'
				poRec.isterti = 1
			Case lcValoare = 'Emisa in numele furnizorilor'
				poRec.isfurnizori = 1
		ENDCASE
		
		Do Case
			Case Empty(poRec.serie)
				amessagebox('Nu ati introdus seria!',0+48,"Atentie")
				Thisform.txtSerie.SetFocus()
				PLRETURN=.F.
			Case Empty(poRec.lungime)
				amessagebox('Nu ati introdus lungimea seriei!',0+48,"Atentie")
				Thisform.txtLungime.SetFocus()
				PLRETURN=.F.
				*!*	Case poRec.lungime <= lnLungimeMinima
				*!*		amessagebox('Lungimea trebuie sa fie mai mare decat '+Alltrim(Str(lnLungimeMinima))+' !',48,"Atentie")
				*!*		Thisform.txtLungime.SetFocus()
				*!*		PLRETURN = .F.
				*!*	Case poRec.lungime > poRec.MaxLen
				*!*		amessagebox('Lungimea nu poate fi mai mare decat '+Alltrim(Str(poRec.MaxLen))+' !',48,"Atentie")
				*!*		Thisform.txtLungime.SetFocus()
				*!*		PLRETURN = .F.
		
			Otherwise
				PLRETURN=Thisform.cus_odata_serii1.salvare(This.OREC,This.NID)
				If !PLRETURN
					Thisform.txtSerie.SetFocus()
				Endif
		Endcase
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		Local lcValoare,lnValoare
		DoDefault()
		
		Thisform.orec= toRec
		Thisform.nid = tnId
		Thisform.cus_odata_serii1.cactiune = tcActiune
		
		lcValoare = "Fara resetare" && Fara resetare/An/Luna
		lnValoare = poRec.an + poRec.luna
		Do Case
			Case lnValoare = 0
				lcValoare = 'Fara resetare'
			Case lnValoare = 1
				lcValoare = 'An'
			Otherwise
				lcValoare = 'Luna'
		Endcase
		This.cboresetare.Value = m.lcValoare
		This.cboresetare.Valid()
		
		Do Case
			Case poRec.isautofactura = 1
				lcValoare = 'Autofactura'
			Case poRec.isbeneficiari = 1
				lcValoare = 'Emisa de beneficiari'
			Case poRec.isterti = 1
				lcValoare = 'Emisa de terti'
			Case poRec.isfurnizori = 1
				lcValoare = 'Emisa in numele furnizorilor'
			Otherwise
				lcValoare = 'Normal'
		Endcase
		
		This.cboTip.Value = m.lcValoare
		
		
	ENDPROC

	PROCEDURE refreshexemplu
		Local lcAn, lcLuna, lcLungime, lcPrefix, lcValueResetare, llAn2Caractere, llFaraResetare, lnLungime
		lcPrefix = IIF(ISNULL(poRec.prefix), '', Alltrim(Str(poRec.prefix, 5, 0)))
		lcValueResetare = This.cboResetare.Value
		llFaraResetare = (m.lcValueResetare = 'Fara resetare')
		lnLungime = Thisform.txtLungime.Value
		llAn2Caractere = (poRec.an2caractere = 1)
		lcAn = Alltrim(Str(m.gnAn))
		If m.llAn2Caractere
			lcAn = Substr(m.lcAn, 3)
		Endif
		lcLuna = Padl(Alltrim(Str(m.gnLuna)), 2, "0")
		lcLungime = Padl("1", m.lnLungime, "0")
		
		If m.llFaraResetare
			Thisform.lblExemplu.Caption = "Ex:"
		Else
			Thisform.lblExemplu.Caption = "Ex: " + m.lcPrefix + ;
				Iif(m.lcValueResetare = "An", m.lcAn + m.lcLungime, ;
				  Iif(m.lcValueResetare = "Luna", m.lcAn + m.lcLuna + m.lcLungime, ""))
		Endif
	ENDPROC

	PROCEDURE cboResetare.Valid
		Local llResetare
		llResetare = (This.Value <> 'Fara resetare')
		Thisform.lblAn2Caractere.Enabled = m.llResetare
		Thisform.chkAn2Caractere.Enabled = m.llResetare
		
		Thisform.RefreshExemplu()
	ENDPROC

	PROCEDURE chkAn2Caractere.Valid
		Thisform.RefreshExemplu()
	ENDPROC

	PROCEDURE txtLungime.Valid
		Thisform.RefreshExemplu()
	ENDPROC

	PROCEDURE txtPrefix.Valid
		Thisform.RefreshExemplu()
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtNumarNou" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtNumarVechi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase6" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_form
		*m: refreshexemplu
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 95
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_seteaza_numar"
		nid = 0
		orec = .NULL.
		Width = 243
		_memberdata = <VFPData>
			<memberdata name="refreshexemplu" display="RefreshExemplu"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 612
		_shape1.ZOrderSet = 1
		_shape2.Name = "_shape2"
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Actualizare numar"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Left = 213
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Left = 168
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 12
	*</PropValue>

	ADD OBJECT '_lbbase3' AS _lbbase WITH ;
		Caption = "Numar nou", ;
		Left = 10, ;
		Name = "_lbbase3", ;
		TabIndex = 6, ;
		Top = 67, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase6' AS _lbbase WITH ;
		Caption = "Numar vechi", ;
		Left = 10, ;
		Name = "_lbbase6", ;
		TabIndex = 7, ;
		Top = 41, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

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

	ADD OBJECT 'txtNumarNou' AS _textbox WITH ;
		ControlSource = "pnNumarNou", ;
		Format = "K", ;
		Height = 23, ;
		Left = 90, ;
		Name = "txtNumarNou", ;
		TabIndex = 1, ;
		ToolTipText = "Pe cate caractere se genereaza numerele din serie", ;
		Top = 65, ;
		Width = 147, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtNumarVechi' AS _textbox WITH ;
		ControlSource = "pnNumarVechi", ;
		Enabled = .T., ;
		Format = "K", ;
		Height = 23, ;
		Left = 90, ;
		Name = "txtNumarVechi", ;
		ReadOnly = .T., ;
		TabIndex = 3, ;
		ToolTipText = "Pe cate caractere se genereaza numerele din serie", ;
		Top = 39, ;
		Width = 147, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE txtNumarNou.Valid
		Thisform.RefreshExemplu()
	ENDPROC

	PROCEDURE txtNumarVechi.Valid
		Thisform.RefreshExemplu()
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="clb_document" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_maxlen" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_tip_entitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboResetare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_cu_serie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_tipdoc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_cu_plaje" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkAn2Caractere" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblExemplu" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_fereastra
		*m: do_cauta_tipentitate
		*m: refreshexemplu
		*p: cu_plaje_init
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cu_plaje_init = 0
		DoCreate = .T.
		Height = 242
		Name = "frm_tipdoc_nou"
		Width = 400
		_memberdata = <VFPData>
			<memberdata name="refreshexemplu" display="RefreshExemplu"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 444
		_shape2.Height = 29
		_shape2.Left = 347
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		Lb_titlu_alb_b121.Caption = "DOCUMENT"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 11
		BUT_TERMIN1.Left = 370
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 9
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Left = 311
		GRIDSORT1.Name = "GRIDSORT1"
		GRIDSORT1.Top = 100
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Se poate da aceeaºi plajã de numere pe mai multe entitãþi", ;
		ControlSource = "porec.plajepeentitate", ;
		FontItalic = .T., ;
		Left = 13, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		TabIndex = 6, ;
		TabStop = .F., ;
		Top = 156
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'cboResetare' AS _combobox WITH ;
		Enabled = .F., ;
		Height = 24, ;
		Left = 12, ;
		Name = "cboResetare", ;
		RowSource = "Fara resetare,An,Luna", ;
		RowSourceType = 1, ;
		TabIndex = 7, ;
		ToolTipText = "Seria se reseteaza la inceputul fiecarui an/luna", ;
		Top = 180, ;
		Value = Fara resetare, ;
		Width = 130, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'chkAn2Caractere' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "An pe 2 caractere", ;
		ControlSource = "poRec.an2caractere", ;
		Enabled = .F., ;
		Left = 179, ;
		Name = "chkAn2Caractere", ;
		TabIndex = 8, ;
		TabStop = .F., ;
		Top = 184, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_cu_plaje' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Cu plaje", ;
		ControlSource = "porec.cu_plaje", ;
		Left = 228, ;
		Name = "ck_cu_plaje", ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 134
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_cu_serie' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Cu serie", ;
		ControlSource = "porec.cu_serie", ;
		FontItalic = .T., ;
		Left = 12, ;
		Name = "ck_cu_serie", ;
		ReadOnly = .T., ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 135
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'clb_document' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "clb_document", ;
		TabIndex = 1, ;
		TabStop = .F., ;
		Top = 41, ;
		Text_simplu1.ControlSource = "porec.tipdoc", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Document", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_maxlen' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "clb_maxlen", ;
		TabIndex = 3, ;
		TabStop = .F., ;
		Top = 97, ;
		Text_simplu1.ControlSource = "porec.maxlen", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = "999", ;
		Text_simplu1.Left = 183, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 102, ;
		Lb_simplu1.Caption = "Lungime maximã", ;
		Lb_simplu1.Left = 3, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_tip_entitate' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(porec.id_tipentitate,0)), ;
		cprocedura = thisform.do_cauta_tipentitate, ;
		cvar_afisata = porec.tipentitate, ;
		Height = 31, ;
		Left = 8, ;
		Name = "Ct_clb_tip_entitate", ;
		TabIndex = 2, ;
		Top = 68, ;
		Width = 323, ;
		img_cautare.Left = 300, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Height = 29, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Tip entitate", ;
		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 = 102, ;
		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="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_tipdoc1' AS cus_odata_tipdoc WITH ;
		Left = 312, ;
		Name = "Cus_odata_tipdoc1", ;
		Top = 132
		*< END OBJECT: ClassLib="serii_numere.vcx" BaseClass="custom" />

	ADD OBJECT 'lblExemplu' AS _lbbase WITH ;
		AutoSize = .F., ;
		Caption = "Ex:", ;
		Height = 17, ;
		Left = 14, ;
		Name = "lblExemplu", ;
		TabIndex = 10, ;
		Top = 216, ;
		Width = 231, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_fereastra
		Local lcValoare
		If poRec.id_tipentitate = -1
			With Thisform.ck_cu_plaje
				.Visible = .F.
				.Value = 0
			Endwith
			With Thisform._checkbox1
				.Visible = .F.
			Endwith
		Else
			Thisform.ck_cu_plaje.Visible = .T.
			Thisform._checkbox1.Visible = .T.
		Endif
		
		If poRec.cu_serie = 0 And poRec.cu_plaje = 1
			This.cboResetare.Enabled = .T.
		Endif
		
		lcValoare = "Fara resetare" && Fara resetare/An/Luna
		Do Case
			Case poRec.an = 0 And poRec.luna = 0
				lcValoare = 'Fara resetare'
			Case poRec.an = 1 And poRec.luna = 0
				lcValoare = 'An'
			Otherwise
				lcValoare = 'Luna'
		Endcase
		This.cboResetare.Value = m.lcValoare
		This.cboResetare.Valid()
	ENDPROC

	PROCEDURE do_cauta_tipentitate
		locauta=caut_tipentitate_permis(poRec.id_tipdoc)
		If !Isnull(locauta)
			poRec.id_tipentitate = locauta.id_tipentitate
			poRec.tipentitate = locauta.descriere
			Thisform.actualizeaza_fereastra()		&&	modificare	04.09.2012
			Thisform.ck_cu_serie.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local llReturn, lcValoare, lccontrol, lcval
		llReturn = .T.
		
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If Inlist(lccontrol, "TEXTBOX", "EDITBOX", "COMBOBOX")
			lcval = This.ActiveControl.ControlSource
			&lcval = Thisform.ActiveControl.Value
		Endif
		Do Case
			Case Empty(Nvl(poRec.id_tipentitate, 0))
				amessagebox('Nu ati completat tipul entitatii!', 0 + 48, "Atentie")
				Thisform.ct_clb_tip_entitate.SetFocus()
				llReturn = .F.
			OTHERWISE
				poRec.dezactiveaza_tot = 0
				If This.cu_plaje_init = 1 And poRec.cu_plaje = 0
					If amessagebox("Vor fi dezactivate toate plajele active pentru acest tip de document!" + ;
							  CHR(13) + Chr(10) + "Doriti sa continuati?", 4 + 32, "Confirmare") == 6
						poRec.dezactiveaza_tot = 1
					Else
						llReturn = .F.
					Endif
				Endif
				If llReturn
					lcValoare = This.cboResetare.Value && Fara resetare/An/Luna
		
					Do Case
						Case lcValoare == 'Fara resetare'
							poRec.an = 0
							poRec.luna = 0
						Case lcValoare == 'An'
							poRec.an = 1
							poRec.luna = 0
						Otherwise
							poRec.an = 1
							poRec.luna = 1
					Endcase
		
					llReturn = Thisform.cus_odata_tipdoc1.salvare(This.OREC, This.NID)
					If !llReturn
						Thisform.ct_clb_tip_entitate.SetFocus()
					Endif
				Endif
		Endcase
		Return llReturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		
		DoDefault()
		
		Thisform.orec= toRec
		Thisform.nid = tnId
		Thisform.cus_odata_tipdoc1.cactiune = tcActiune
		Thisform.cu_plaje_init = toRec.cu_plaje
		Thisform.actualizeaza_fereastra()		&&	modificare	04.09.2012
	ENDPROC

	PROCEDURE refreshexemplu
		Local lcAn, lcLuna, lcLungime, lcValueResetare, llAn2Caractere, llFaraResetare, lnLungime, lcLungimeLuna, lcLungimeAn
		lcValueResetare = This.cboResetare.Value
		llFaraResetare = (m.lcValueResetare = 'Fara resetare')
		lnLungime = thisform.clb_maxlen.text_simplu1.Value
		llAn2Caractere = (poRec.an2caractere = 1)
		lcAn = Alltrim(Str(m.gnAn))
		If m.llAn2Caractere
			lcAn = Substr(m.lcAn, 3)
		Endif
		lcLuna = Padl(Alltrim(Str(m.gnLuna)), 2, "0")
		lcLungime = Padl("1", m.lnLungime, "0")
		lcLungimeAn = Padl("1", m.lnLungime - LEN(m.lcAn), "0")
		lcLungimeLuna = Padl("1", m.lnLungime - LEN(m.lcAn) - LEN(m.lcLuna), "0")
		
		If m.llFaraResetare
			Thisform.lblExemplu.Caption = "Ex:"
		Else
			Thisform.lblExemplu.Caption = "Ex: " + ;
				Iif(m.lcValueResetare = "An", m.lcAn + m.lcLungimeAn, ;
				  Iif(m.lcValueResetare = "Luna", m.lcAn + m.lcLuna + lcLungimeLuna, ""))
		Endif
	ENDPROC

	PROCEDURE cboResetare.Valid
		Local llResetare
		llResetare = (This.Value <> 'Fara resetare')
		Thisform.chkAn2Caractere.Enabled = m.llResetare
		
		Thisform.RefreshExemplu()
	ENDPROC

	PROCEDURE chkAn2Caractere.Valid
		Thisform.RefreshExemplu()
	ENDPROC

	PROCEDURE clb_maxlen.Text_simplu1.Valid
		Thisform.RefreshExemplu()
	ENDPROC

ENDDEFINE

DEFINE CLASS item_serii AS container 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Label_item1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lineo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lineo3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lineo4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lineo5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lineo2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_combobox1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: camp_lista
		*p: cvariabila		&& Proprietatea din 'pcobj' corespunzatoare campului de serie.
		*p: cvariabiladoc		&& Proprietatea din 'pcobj' corespunzatoare campului de nr. doc.
		*p: filtru
		*p: fis_lista
		*p: id_fisier
		*p: id_item
		*p: label_item
		*p: nid_tipdoc
		*p: nproc_tva
		*p: pcobj		&& Numele obiectului care contine campurile serie_act ( cvariabila ) si  numar act (cvariabiladoc ).
		*p: tip
	*</DefinedPropArrayMethod>

	*<PropValue>
		BackColor = 247,245,238
		BackStyle = 1
		BorderColor = 0,0,128
		BorderWidth = 0
		camp_lista =  
		cvariabila = 
		cvariabiladoc = 
		filtru = 
		fis_lista =  
		Height = 21
		id_fisier = ''
		id_item = 0
		label_item =  
		Name = "item_serii"
		nid_tipdoc = -99
		nproc_tva = 0
		pcobj = ''
		SpecialEffect = 1
		Width = 454
	*</PropValue>

	ADD OBJECT '_combobox1' AS _combobox WITH ;
		BorderColor = 128,128,128, ;
		ColumnLines = .F., ;
		FontName = "Comic Sans MS", ;
		FontSize = 8, ;
		Height = 20, ;
		Left = 241, ;
		Name = "_combobox1", ;
		RowSourceType = 6, ;
		SpecialEffect = 1, ;
		Top = 0, ;
		Width = 211
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'Label_item1' AS label_item WITH ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "SERIE DOCUMENT", ;
		Height = 18, ;
		Left = 3, ;
		Name = "Label_item1", ;
		TabIndex = 2, ;
		Top = 3, ;
		Width = 234
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="label" />

	ADD OBJECT 'Lineo1' AS lineo WITH ;
		Height = 0, ;
		Left = 0, ;
		Name = "Lineo1", ;
		Top = 0, ;
		Width = 452
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="line" />

	ADD OBJECT 'Lineo2' AS lineo WITH ;
		Height = 21, ;
		Left = 239, ;
		Name = "Lineo2", ;
		Top = 0, ;
		Width = 0
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="line" />

	ADD OBJECT 'Lineo3' AS lineo WITH ;
		Height = 0, ;
		Left = 0, ;
		Name = "Lineo3", ;
		Top = 19, ;
		Width = 452
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="line" />

	ADD OBJECT 'Lineo4' AS lineo WITH ;
		Height = 21, ;
		Left = 452, ;
		Name = "Lineo4", ;
		Top = 0, ;
		Width = 0
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="line" />

	ADD OBJECT 'Lineo5' AS lineo WITH ;
		Height = 21, ;
		Left = 0, ;
		Name = "Lineo5", ;
		Top = 0, ;
		Width = 0
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="line" />
	
	PROCEDURE Init
		Lparameters tcObj,tcIdTipDoc,tcVariabila,tcVariabilaDocument
		Local lcCursor,lcSerie
		With This
			.pcobj=tcObj
			.nid_tipdoc = Val(tcIdTipDoc)
			.cvariabila = tcVariabila
			.cvariabiladoc = tcVariabilaDocument
			._combobox1.RowSource = poGeneratorNumere.getNumeCursor(.nid_tipdoc)
			._combobox1.Value = poGeneratorNumere.getSerieCursor(.nid_tipdoc)
		
			lcCombo=._combobox1.Value
			IF NOT EMPTY(ALLTRIM(NVL(lcCombo,"")))
			lcValoare = Upper(tcObj)+[.]+Alltrim(tcVariabila)+[=']+lcCombo+[']
			&lcValoare
			ENDIF
			
		Endwith
		
	ENDPROC

	PROCEDURE Label_item1.Click
		This.Parent._combobox1.SetFocus()
		
	ENDPROC

	PROCEDURE _combobox1.InteractiveChange
		lcValoare = Upper(This.Parent.pcobj)+[.]+Alltrim(This.Parent.cvariabila)+[=']+This.Value+[']
		&lcValoare
		If poGeneratorNumere.verifica_serie(This.Parent.nid_tipdoc)
			lcValoare = Upper(This.Parent.pcobj)+[.]+Alltrim(This.Parent.cvariabiladoc)+[=]+;
				ALLTRIM(Str(poGeneratorNumere.aloca_numar(This.Parent.nid_tipdoc,Null),20,0))
			&lcValoare
			This.Parent.Parent.Refresh()
		Endif
		
	ENDPROC

ENDDEFINE
