1283 lines
38 KiB
Plaintext
1283 lines
38 KiB
Plaintext
*--------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
|
|
*--------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
*< FOXBIN2PRG: Version="1.21" SourceFile="orapoarte.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
|
|
*
|
|
*
|
|
DEFINE CLASS ct_grup_camp AS _container OF "..\comun\clase\_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="ck_ordine" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="lb_nume_camp" UniqueID="" Timestamp="" />
|
|
|
|
*<DefinedPropArrayMethod>
|
|
*m: do_actualizeaza_ordine
|
|
*p: ccamp
|
|
*p: cnumecamp
|
|
*p: ngrupat
|
|
*p: nordine
|
|
*p: _memberdata && XML Metadata for customizable properties
|
|
*</DefinedPropArrayMethod>
|
|
|
|
*<PropValue>
|
|
BorderWidth = 0
|
|
ccamp =
|
|
cnumecamp =
|
|
Height = 17
|
|
Name = "ct_grup_camp"
|
|
ngrupat = 0
|
|
nordine = 0
|
|
Width = 183
|
|
_memberdata = <VFPData>
|
|
<memberdata name="ccamp" type="Property" favorites="True"/>
|
|
<memberdata name="cnumecamp" type="Property" favorites="True"/>
|
|
<memberdata name="do_actualizeaza_ordine" type="Method" favorites="True"/>
|
|
<memberdata name="ngrupat" type="Property" favorites="True"/>
|
|
<memberdata name="nid_container" type="Property" favorites="True"/>
|
|
</VFPData>
|
|
*</PropValue>
|
|
|
|
ADD OBJECT 'ck_ordine' AS _checkbox WITH ;
|
|
Alignment = 0, ;
|
|
AutoSize = .F., ;
|
|
Caption = "[Ordine camp]", ;
|
|
Height = 17, ;
|
|
Left = 122, ;
|
|
Name = "ck_ordine", ;
|
|
Top = 1, ;
|
|
Width = 43
|
|
*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />
|
|
|
|
ADD OBJECT 'lb_nume_camp' AS lb_simplu WITH ;
|
|
AutoSize = .F., ;
|
|
Caption = "[Explicatie camp]", ;
|
|
Height = 17, ;
|
|
Left = 2, ;
|
|
Name = "lb_nume_camp", ;
|
|
Top = 1, ;
|
|
Width = 118
|
|
*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
|
|
|
|
PROCEDURE do_actualizeaza_ordine
|
|
Lparameters tnOrdine
|
|
If !Empty(tnOrdine)
|
|
This.lb_nume_camp.FontBold = .T.
|
|
This.ck_ordine.Caption = Alltrim(Str(tnOrdine))
|
|
This.ngrupat = 1
|
|
Else
|
|
This.lb_nume_camp.FontBold = .F.
|
|
This.ck_ordine.Caption = []
|
|
This.ngrupat = 0
|
|
Endif
|
|
This.nordine = tnOrdine
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE Init
|
|
Lparameters tcCamp,tcNumeCamp
|
|
This.ccamp = tcCamp
|
|
This.cnumeCamp = tcNumeCamp
|
|
This.lb_nume_camp.Caption = This.cnumeCamp
|
|
This.do_actualizeaza_ordine(0)
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE ck_ordine.Click
|
|
This.Parent.Parent.do_modifica_ordine(This.Parent.Name,This.Parent.nordine,This.Value)
|
|
ENDPROC
|
|
|
|
ENDDEFINE
|
|
|
|
DEFINE CLASS ct_grupare AS _container OF "..\comun\clase\_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="lb_grupare" UniqueID="" Timestamp="" />
|
|
|
|
*<DefinedPropArrayMethod>
|
|
*m: do_adauga_ct
|
|
*m: do_modifica_ordine
|
|
*m: do_sterge_ct
|
|
*p: cclasa && Numele clasei ce va fi instantiata la adaugare.
|
|
*p: nleft
|
|
*p: nleft2 && 90
|
|
*p: nmaxtop
|
|
*p: nmaxtop2
|
|
*p: nmax_ordine
|
|
*p: _memberdata && XML Metadata for customizable properties
|
|
*</DefinedPropArrayMethod>
|
|
|
|
*<PropValue>
|
|
cclasa = ct_grup_camp
|
|
Height = 200
|
|
Name = "ct_grupare"
|
|
nleft = 15
|
|
nleft2 = 90
|
|
nmaxtop = 0
|
|
nmaxtop2 = 0
|
|
nmax_ordine = 0
|
|
Width = 353
|
|
_memberdata = <VFPData>
|
|
<memberdata name="cclasa" type="Property" favorites="True"/>
|
|
<memberdata name="do_adauga_ct" type="Method" favorites="True"/>
|
|
<memberdata name="do_modifica_ordine" type="Method" favorites="True"/>
|
|
<memberdata name="do_sterge_ct" type="Method" favorites="True"/>
|
|
<memberdata name="nmax_id_container" type="Property" favorites="True"/>
|
|
<memberdata name="nmax_ordine" type="Property" favorites="True"/>
|
|
</VFPData>
|
|
*</PropValue>
|
|
|
|
ADD OBJECT 'lb_grupare' AS lb_simplu WITH ;
|
|
Caption = "Grupat dupa :", ;
|
|
Height = 17, ;
|
|
Left = 12, ;
|
|
Name = "lb_grupare", ;
|
|
TabIndex = 8, ;
|
|
Top = 6, ;
|
|
Visible = .T., ;
|
|
Width = 76
|
|
*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
|
|
|
|
PROCEDURE do_adauga_ct
|
|
Lparameters tcCamp,tcNumeCamp
|
|
Local lcClasa,lcNumeObiect
|
|
If Empty(This.cclasa)
|
|
lcClasa = [CT_GRUP_CAMP]
|
|
Else
|
|
lcClasa = Upper(Alltrim(This.cclasa))
|
|
Endif
|
|
lcNumeObiect = Upper(Alltrim([ct_grup_] + Strtran(tcCamp,[.],[_])))
|
|
This.AddObject(lcNumeObiect,lcClasa,tcCamp,tcNumeCamp)
|
|
With This.&lcNumeObiect.
|
|
.Left = This.nLeft
|
|
.Top = This.nMaxTop
|
|
This.nMaxTop = .Top + .Height - 2
|
|
.Visible = .T.
|
|
Endwith
|
|
ENDPROC
|
|
|
|
PROCEDURE do_modifica_ordine
|
|
Lparameters tcNumeObiect,tnOrdine,tnValoare
|
|
If Empty(This.cclasa)
|
|
lcClasa = [CT_GRUP_CAMP]
|
|
Else
|
|
lcClasa = Upper(Alltrim(This.cclasa))
|
|
Endif
|
|
If tnValoare = 0
|
|
For i = 1 To This.Objects.Count
|
|
With This.Objects(i)
|
|
If Upper(Alltrim(.Class))=lcClasa
|
|
Do Case
|
|
Case .nordine = tnOrdine
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(2,.ccamp,.nordine - 1)
|
|
Endif
|
|
.do_actualizeaza_ordine(0)
|
|
Case .nordine > tnOrdine
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(2,.ccamp,.nordine - 1)
|
|
Endif
|
|
.do_actualizeaza_ordine(.nordine - 1)
|
|
Endcase
|
|
Endif
|
|
Endwith
|
|
Endfor
|
|
This.nmax_ordine = This.nmax_ordine - 1
|
|
Else
|
|
This.nmax_ordine = This.nmax_ordine + 1
|
|
With This.&tcNumeObiect.
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(2,.ccamp,This.nmax_ordine)
|
|
Endif
|
|
.do_actualizeaza_ordine(This.nmax_ordine)
|
|
Endwith
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_sterge_ct
|
|
Lparameters tcCamp
|
|
Local lcClasa,lcNumeObiect
|
|
If Empty(This.cclasa)
|
|
lcClasa = [CT_GRUP_CAMP]
|
|
Else
|
|
lcClasa = Upper(Alltrim(This.cclasa))
|
|
Endif
|
|
lcNumeObiect = Upper(Alltrim([ct_grup_] + Strtran(tcCamp,[.],[_])))
|
|
If Type('this.'+lcNumeObiect)<>'U'
|
|
With This.&lcNumeObiect.
|
|
lnHeight = .Height
|
|
lnTop = .Top
|
|
lnOrdine = .nordine
|
|
Endwith
|
|
This.RemoveObject(lcNumeObiect,lcClasa)
|
|
For i = 1 To This.Objects.Count
|
|
With This.Objects(i)
|
|
If Upper(Alltrim(.Class))=lcClasa
|
|
If lnOrdine > 0 And .nordine > lnOrdine
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(2,.ccamp,.nordine - 1)
|
|
Endif
|
|
.do_actualizeaza_ordine(.nordine - 1)
|
|
Endif
|
|
If .Top > lnTop
|
|
.Top = .Top - lnHeight + 2
|
|
Endif
|
|
Endif
|
|
Endwith
|
|
Endfor
|
|
This.nMaxTop = This.nMaxTop - lnHeight + 2
|
|
This.nmax_ordine = This.nmax_ordine - Iif(lnOrdine = 0,0,1)
|
|
Endif
|
|
ENDPROC
|
|
|
|
PROCEDURE Init
|
|
DoDefault()
|
|
This.nmaxtop = This.lb_grupare.Top + This.lb_grupare.Height
|
|
ENDPROC
|
|
|
|
ENDDEFINE
|
|
|
|
DEFINE CLASS ct_ordine_camp AS _container OF "..\comun\clase\_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="ck_ordine" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="lb_nume_camp" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="opt_ordine" UniqueID="" Timestamp="" />
|
|
|
|
*<DefinedPropArrayMethod>
|
|
*m: do_actualizeaza_ordine
|
|
*p: ccamp
|
|
*p: cnumecamp
|
|
*p: csens
|
|
*p: nordine
|
|
*</DefinedPropArrayMethod>
|
|
|
|
*<PropValue>
|
|
BorderWidth = 0
|
|
ccamp =
|
|
cnumecamp =
|
|
csens =
|
|
Height = 17
|
|
Name = "ct_ordine_camp"
|
|
nordine = 0
|
|
Width = 302
|
|
*</PropValue>
|
|
|
|
ADD OBJECT 'ck_ordine' AS _checkbox WITH ;
|
|
Alignment = 0, ;
|
|
AutoSize = .F., ;
|
|
Caption = "[Ordine camp]", ;
|
|
Height = 17, ;
|
|
Left = 122, ;
|
|
Name = "ck_ordine", ;
|
|
Top = 0, ;
|
|
Width = 43
|
|
*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />
|
|
|
|
ADD OBJECT 'lb_nume_camp' AS lb_simplu WITH ;
|
|
AutoSize = .F., ;
|
|
Caption = "[Explicatie camp]", ;
|
|
Height = 17, ;
|
|
Left = 2, ;
|
|
Name = "lb_nume_camp", ;
|
|
Top = 0, ;
|
|
Width = 118
|
|
*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
|
|
|
|
ADD OBJECT 'opt_ordine' AS _optiongrup WITH ;
|
|
BorderStyle = 0, ;
|
|
Height = 28, ;
|
|
Left = 160, ;
|
|
Name = "opt_ordine", ;
|
|
Top = -6, ;
|
|
Width = 146, ;
|
|
Option1.AutoSize = .T., ;
|
|
Option1.Caption = "Crescator", ;
|
|
Option1.FontName = "Arial Narrow", ;
|
|
Option1.Left = 5, ;
|
|
Option1.Name = "Option1", ;
|
|
Option1.Top = 5, ;
|
|
Option2.AutoSize = .T., ;
|
|
Option2.Caption = "Descrescator", ;
|
|
Option2.FontName = "Arial Narrow", ;
|
|
Option2.Left = 68, ;
|
|
Option2.Name = "Option2", ;
|
|
Option2.Top = 5
|
|
*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="optiongroup" />
|
|
|
|
PROCEDURE do_actualizeaza_ordine
|
|
Lparameters tnOrdine
|
|
If !Empty(tnOrdine)
|
|
This.lb_nume_camp.FontBold = .T.
|
|
This.ck_ordine.Caption = Alltrim(Str(tnOrdine))
|
|
This.opt_ordine.Visible = .T.
|
|
Else
|
|
This.lb_nume_camp.FontBold = .F.
|
|
This.ck_ordine.Caption = []
|
|
With This.opt_ordine
|
|
.Visible = .F.
|
|
.Value = 1
|
|
Endwith
|
|
Endif
|
|
This.nordine = tnOrdine
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE Init
|
|
Lparameters tcCamp,tcNumeCamp
|
|
This.ccamp = tcCamp
|
|
This.cnumecamp = tcNumeCamp
|
|
This.lb_nume_camp.Caption = tcNumeCamp
|
|
This.do_actualizeaza_ordine(0)
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE ck_ordine.Click
|
|
This.Parent.Parent.do_modifica_ordine(This.Parent.Name,This.Parent.nordine,This.Value)
|
|
ENDPROC
|
|
|
|
PROCEDURE opt_ordine.InteractiveChange
|
|
If This.Value = 1
|
|
This.Parent.csens = []
|
|
Else
|
|
This.Parent.csens = [DESC]
|
|
Endif
|
|
This.Parent.Parent.do_modifica_sens(This.Parent.ccamp,This.Value)
|
|
ENDPROC
|
|
|
|
ENDDEFINE
|
|
|
|
DEFINE CLASS ct_ordonare AS _container OF "..\comun\clase\_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="lb_ordonare" UniqueID="" Timestamp="" />
|
|
|
|
*<DefinedPropArrayMethod>
|
|
*m: do_adauga_ct
|
|
*m: do_modifica_ordine
|
|
*m: do_modifica_sens
|
|
*m: do_sterge_ct
|
|
*p: cclasa && Numele clasei ce va fi instantiata la adaugare.
|
|
*p: nleft
|
|
*p: nleft2 && 90
|
|
*p: nmaxtop
|
|
*p: nmaxtop2
|
|
*p: nmax_ordine
|
|
*p: _memberdata && XML Metadata for customizable properties
|
|
*</DefinedPropArrayMethod>
|
|
|
|
*<PropValue>
|
|
cclasa = ct_ordine_camp
|
|
Height = 200
|
|
Name = "ct_ordonare"
|
|
nleft = 9
|
|
nleft2 = 90
|
|
nmaxtop = 0
|
|
nmaxtop2 = 0
|
|
nmax_ordine = 0
|
|
Width = 353
|
|
_memberdata = <VFPData>
|
|
<memberdata name="cclasa" type="Property" favorites="True"/>
|
|
<memberdata name="do_adauga_ct" type="Method" favorites="True"/>
|
|
<memberdata name="do_modifica_ordine" type="Method" favorites="True"/>
|
|
<memberdata name="do_sterge_ct" type="Method" favorites="True"/>
|
|
<memberdata name="nmax_id_container" type="Property" favorites="True"/>
|
|
<memberdata name="nmax_ordine" type="Property" favorites="True"/>
|
|
</VFPData>
|
|
*</PropValue>
|
|
|
|
ADD OBJECT 'lb_ordonare' AS lb_simplu WITH ;
|
|
Caption = "Ordonate dupa:", ;
|
|
Height = 17, ;
|
|
Left = 8, ;
|
|
Name = "lb_ordonare", ;
|
|
TabIndex = 8, ;
|
|
Top = 6, ;
|
|
Visible = .T., ;
|
|
Width = 87
|
|
*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
|
|
|
|
PROCEDURE do_adauga_ct
|
|
Lparameters tcCamp,tcNumeCamp
|
|
Local lcClasa,lcNumeObiect
|
|
If Empty(This.cclasa)
|
|
lcClasa = [CT_ORDINE_CAMP]
|
|
Else
|
|
lcClasa = Upper(Alltrim(This.cclasa))
|
|
Endif
|
|
lcNumeObiect = Upper(Alltrim([ct_ordine_] + Strtran(tcCamp,[.],[_])))
|
|
This.AddObject(lcNumeObiect,lcClasa,tcCamp,tcNumeCamp)
|
|
With This.&lcNumeObiect.
|
|
.Left = This.nLeft
|
|
.Top = This.nMaxTop
|
|
This.nMaxTop = .Top + .Height - 2
|
|
.Visible = .T.
|
|
Endwith
|
|
ENDPROC
|
|
|
|
PROCEDURE do_modifica_ordine
|
|
Lparameters tcNumeObiect,tnOrdine,tnValoare
|
|
If Empty(This.cclasa)
|
|
lcClasa = [CT_ORDINE_CAMP]
|
|
Else
|
|
lcClasa = Upper(Alltrim(This.cclasa))
|
|
Endif
|
|
If tnValoare = 0
|
|
For i = 1 To This.Objects.Count
|
|
With This.Objects(i)
|
|
If Upper(Alltrim(.Class))=lcClasa
|
|
Do Case
|
|
Case .nordine = tnOrdine
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(3,.ccamp,0)
|
|
Endif
|
|
.do_actualizeaza_ordine(0)
|
|
Case .nordine > tnOrdine
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(3,.ccamp,.nordine - 1)
|
|
Endif
|
|
.do_actualizeaza_ordine(.nordine - 1)
|
|
Endcase
|
|
Endif
|
|
Endwith
|
|
Endfor
|
|
This.nmax_ordine = This.nmax_ordine - 1
|
|
Else
|
|
This.nmax_ordine = This.nmax_ordine + 1
|
|
With This.&tcNumeObiect.
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(3,.ccamp,This.nmax_ordine)
|
|
Endif
|
|
.do_actualizeaza_ordine(This.nmax_ordine)
|
|
Endwith
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_modifica_sens
|
|
Lparameters tcCamp,tnSens
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(4,tcCamp,tnSens)
|
|
Endif
|
|
ENDPROC
|
|
|
|
PROCEDURE do_sterge_ct
|
|
Lparameters tcCamp
|
|
Local lcClasa,lcNumeObiect
|
|
If Empty(This.cclasa)
|
|
lcClasa = [CT_ORDINE_CAMP]
|
|
Else
|
|
lcClasa = Upper(Alltrim(This.cclasa))
|
|
Endif
|
|
lcNumeObiect = Upper(Alltrim([ct_ordine_] + Strtran(tcCamp,[.],[_])))
|
|
If Type('this.'+lcNumeObiect)<>'U'
|
|
With This.&lcNumeObiect.
|
|
lnHeight = .Height
|
|
lnTop = .Top
|
|
lnOrdine = .nordine
|
|
Endwith
|
|
This.RemoveObject(lcNumeObiect,lcClasa)
|
|
For i = 1 To This.Objects.Count
|
|
With This.Objects(i)
|
|
If Upper(Alltrim(.Class))=lcClasa
|
|
If lnOrdine > 0 And .nordine > lnOrdine
|
|
If Pemstatus(This.Parent,"do_modifica",5)
|
|
This.Parent.do_modifica(3,.ccamp,.nordine - 1)
|
|
Endif
|
|
.do_actualizeaza_ordine(.nordine - 1)
|
|
Endif
|
|
If .Top > lnTop
|
|
.Top = .Top - lnHeight + 2
|
|
Endif
|
|
Endif
|
|
Endwith
|
|
Endfor
|
|
This.nMaxTop = This.nMaxTop - lnHeight + 2
|
|
This.nmax_ordine = This.nmax_ordine - Iif(lnOrdine = 0,0,1)
|
|
Endif
|
|
ENDPROC
|
|
|
|
PROCEDURE Init
|
|
DoDefault()
|
|
This.nmaxtop = This.lb_ordonare.Top + This.lb_ordonare.Height
|
|
ENDPROC
|
|
|
|
ENDDEFINE
|
|
|
|
DEFINE CLASS ct_selectie AS _container OF "..\comun\clase\_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="Ct_grupare1" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_ordonare1" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="lb_coloane" UniqueID="" Timestamp="" />
|
|
|
|
*<DefinedPropArrayMethod>
|
|
*m: do_adauga
|
|
*m: do_compune_ordine_selectie
|
|
*m: do_instructiune_sql
|
|
*m: do_modifica
|
|
*m: do_sterge
|
|
*p: cclasa && Clasa folosita pentru checkbox-urile din selectii.
|
|
*p: ccoloanesuma && Numele coloanelor care sunt agregate.
|
|
*p: clistacoloaneordine && Lista delimitata prin virgula ce contine pozitiile din ccoloanesuma pentru care se vor adauga containere la ordonare.
|
|
*p: cnumecoloanesuma
|
|
*p: cnumetabela && Numele tabelei/view-ului din care se face selectia.
|
|
*p: cordine
|
|
*p: csql
|
|
*p: nelemente && Numarul de elemente din this.aselectie
|
|
*a: aselectie[30,4]
|
|
*</DefinedPropArrayMethod>
|
|
|
|
*<PropValue>
|
|
cclasa = ct_selectie_camp
|
|
ccoloanesuma =
|
|
clistacoloaneordine =
|
|
cnumecoloanesuma =
|
|
cnumetabela =
|
|
cordine =
|
|
csql =
|
|
Height = 364
|
|
Name = "ct_selectie"
|
|
nelemente = 0
|
|
Width = 332
|
|
*</PropValue>
|
|
|
|
ADD OBJECT 'Ct_grupare1' AS ct_grupare WITH ;
|
|
Height = 133, ;
|
|
Left = 5, ;
|
|
Name = "Ct_grupare1", ;
|
|
Top = 227, ;
|
|
Width = 320, ;
|
|
lb_grupare.Name = "lb_grupare"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_ordonare1' AS ct_ordonare WITH ;
|
|
Height = 133, ;
|
|
Left = 5, ;
|
|
Name = "Ct_ordonare1", ;
|
|
Top = 95, ;
|
|
Width = 320, ;
|
|
lb_ordonare.Name = "lb_ordonare"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'lb_coloane' AS lb_simplu WITH ;
|
|
Caption = "Coloane in selectie:", ;
|
|
Height = 17, ;
|
|
Left = 10, ;
|
|
Name = "lb_coloane", ;
|
|
TabIndex = 9, ;
|
|
Top = 6, ;
|
|
Width = 111
|
|
*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
|
|
|
|
PROCEDURE do_adauga
|
|
Lparameters tcCamp,tcNumeCamp,tlGrupare,tlOrdine
|
|
This.nelemente = This.nelemente + 1
|
|
Ains(This.aselectie,This.nelemente)
|
|
This.aselectie[This.nelemente,1]=Upper(Alltrim(tcCamp))
|
|
This.aselectie[this.nelemente,2]=0
|
|
This.aselectie[this.nelemente,3]=0
|
|
This.aselectie[this.nelemente,4]=0
|
|
If tlGrupare
|
|
This.ct_grupare1.do_adauga_ct(Upper(Alltrim(tcCamp)),tcNumeCamp)
|
|
Endif
|
|
If tlOrdine
|
|
This.ct_ordonare1.do_adauga_ct(Upper(Alltrim(tcCamp)),tcNumeCamp)
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROTECTED PROCEDURE do_compune_ordine_selectie
|
|
Lparameters taArraySelectie
|
|
Local lcOrdine, lcSens
|
|
lcOrdine = []
|
|
ASORT(taArraySelectie,3)
|
|
For i = 1 To Alen(taArraySelectie,1)
|
|
If !Empty(taArraySelectie[i,1]) And !Empty(Nvl(taArraySelectie[i,3],0))
|
|
If Empty(taArraySelectie[i,4]) Or (taArraySelectie[i,4] = 1)
|
|
lcSens = []
|
|
Else
|
|
lcSens = [ DESC]
|
|
Endif
|
|
lcOrdine = lcOrdine + [,] + taArraySelectie[i,1] + lcSens
|
|
Endif
|
|
Endfor
|
|
This.cOrdine = lcOrdine
|
|
ENDPROC
|
|
|
|
PROCEDURE do_instructiune_sql
|
|
Local llSelectieVida,lcSql,lcColoaneGrupate,lcAlteColoane,lcColoaneSuma,lcSelect,lcFiltru,lcGroupBy,lcOrderBy,lcOrdine,lcOrdineGrup
|
|
Local lnPozitii
|
|
Store .T. To llSelectieVida
|
|
If !Empty(This.clistacoloaneordine)
|
|
lnPozitii = Getwordcount(This.clistacoloaneordine,[,]) + 1
|
|
Else
|
|
lnPozitii = 1
|
|
Endif
|
|
For i = lnPozitii To Alen(Thisform.ct_selectie1.aselectie,1)
|
|
If !Empty(Thisform.ct_selectie1.aselectie[i,1])
|
|
llSelectieVida = .F.
|
|
Exit
|
|
Endif
|
|
Endfor
|
|
If llSelectieVida
|
|
lcSql = []
|
|
Else
|
|
Dimension laArraySelectie(This.nelemente,4)
|
|
Acopy(This.aselectie,laArraySelectie,1,This.nelemente*4)
|
|
This.do_compune_ordine_selectie(@laArraySelectie)
|
|
lcColoaneAgregare = This.ccoloanesuma
|
|
lcView = gcS + [.] + This.cnumetabela
|
|
lcColoaneGrupate = []
|
|
lcAlteColoane = []
|
|
lcColoaneSuma = []
|
|
lcSelect = []
|
|
lcFiltru = [1=2]
|
|
lcGroupBy = []
|
|
lcOrderBy = []
|
|
lcOrdine = This.cordine
|
|
lcOrdineGrup = []
|
|
If !Empty(This.clistacoloaneordine)
|
|
*!* sterg coloana pentru care se va face suma
|
|
For i = 1 To lnPozitii - 1
|
|
lnPozColoana = VAL(GETWORDNUM(this.clistacoloaneordine,i,[,]))
|
|
lcColoana = GETWORDNUM(this.ccoloanesuma,lnPozColoana,[,])
|
|
lnRand = ASCAN(laArraySelectie,lcColoana,1,ALEN(laArraySelectie,1),1,15)
|
|
Adel(laArraySelectie,lnRand)
|
|
*!* Adel(laArraySelectie,1)
|
|
Endfor
|
|
Dimension laArraySelectie(This.nelemente-lnPozitii+1,4)
|
|
Endif
|
|
Asort(laArraySelectie,2)
|
|
For i = 1 To Getwordcount(lcColoaneAgregare,[,])
|
|
lcNumeColoana = Getwordnum(lcColoaneAgregare,i,[,])
|
|
lcColoaneSuma = lcColoaneSuma + [,SUM(] + lcNumeColoana + [) as ] + lcNumeColoana
|
|
Endfor
|
|
For i = 1 To Alen(laArraySelectie,1)
|
|
If !Empty(laArraySelectie[i,1])
|
|
If !Empty(laArraySelectie[i,2])
|
|
lcColoaneGrupate = lcColoaneGrupate + [,] + Alltrim(laArraySelectie[i,1])
|
|
Else
|
|
lcAlteColoane = lcAlteColoane + [,] + Alltrim(laArraySelectie[i,1])
|
|
Endif
|
|
Endif
|
|
Endfor
|
|
If !Empty(lcColoaneGrupate)
|
|
lcSelect = [GROUPING_ID(]+Substr(lcColoaneGrupate,2)+lcAlteColoane+[) AS GID] + lcColoaneGrupate
|
|
lcOrdineGrup = Substr(lcColoaneGrupate,2) + [,GID]
|
|
If Empty(lcAlteColoane)
|
|
lcSelect = lcSelect + lcColoaneSuma
|
|
lcGroupBy = [ GROUP BY ROLLUP(]+Substr(lcColoaneGrupate,2)+[) ]
|
|
Else
|
|
lcSelect = lcSelect + lcAlteColoane + lcColoaneSuma
|
|
lcGroupBy = [ GROUP BY ROLLUP(]+Substr(lcColoaneGrupate,2)+[,(]+Substr(lcAlteColoane,2)+[)) ]
|
|
Endif
|
|
Else
|
|
lcSelect = lcSelect + [GROUPING_ID(] + SUBSTR(lcAlteColoane,2) +[) AS GID] + ;
|
|
lcAlteColoane + lcColoaneSuma
|
|
lcGroupBy = [ GROUP BY ROLLUP((] + SUBSTR(lcAlteColoane,2) + [))]
|
|
lcOrdineGrup = [GID]
|
|
Endif
|
|
Do Case
|
|
Case !Empty(lcOrdine) And !Empty(lcOrdineGrup)
|
|
lcOrderBy = [ ORDER BY ] + lcOrdineGrup + lcOrdine
|
|
Case !Empty(lcOrdine) And Empty(lcOrdineGrup)
|
|
lcOrderBy = [ ORDER BY ] + Substr(lcOrdine,2)
|
|
Case !Empty(lcOrdineGrup)
|
|
lcOrderBy = [ ORDER BY ] + lcOrdineGrup
|
|
Otherwise
|
|
lcOrderBy = []
|
|
Endcase
|
|
|
|
lcSql = [SELECT ] + lcSelect + [ FROM ] + lcView + ;
|
|
[ WHERE ] + lcFiltru + lcGroupBy + lcOrderBy
|
|
Release laArraySelectie
|
|
Endif
|
|
This.cSql = lcSql
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_modifica
|
|
Lparameters tnColoana,tcCamp,tnValoare
|
|
&& tnColoana : 2 - ordine grupare
|
|
&& 3 - ordine la ordonare
|
|
&& 4 - sens la ordonare = 1 - ASC
|
|
&& 2 - DESC
|
|
lnPozitie=Ascan(This.aselectie,Upper(Alltrim(tcCamp)),1,30,1,9)
|
|
If lnPozitie > 0
|
|
This.aselectie[lnPozitie,tnColoana]=tnValoare
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_sterge
|
|
Lparameters tcCamp,tcNumeCamp
|
|
lnPozitie=Ascan(This.aselectie,Upper(Alltrim(tcCamp)),1,30,1,9)
|
|
If lnPozitie > 0
|
|
Adel(This.aselectie,lnPozitie)
|
|
This.nelemente = This.nelemente - 1
|
|
Endif
|
|
This.ct_grupare1.do_sterge_ct(tcCamp)
|
|
This.ct_ordonare1.do_sterge_ct(tcCamp)
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE Init
|
|
If !Empty(This.clistacoloaneordine)
|
|
*!* se adauga la ordine si prima coloana din coloanele de sume
|
|
lcLista = Alltrim(Iif(Type('This.clistacoloaneordine')='C',This.clistacoloaneordine,Str(This.clistacoloaneordine)))
|
|
This.clistacoloaneordine=lcLista
|
|
For i = 1 To Getwordcount(lcLista,[,])
|
|
lnPozitie=Val(Getwordnum(lcLista,i,[,]))
|
|
lcNume=Proper(Getwordnum(This.ccoloanesuma,lnPozitie,[,]))
|
|
If !Empty(This.cnumecoloanesuma)
|
|
lcNumeCamp=Proper(Getwordnum(This.cnumecoloanesuma,lnPozitie,[,]))
|
|
Else
|
|
lcNumeCamp = lcNume
|
|
Endif
|
|
This.do_adauga(lcNume,lcNumeCamp,.F.,.T.)
|
|
Endfor
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
ENDDEFINE
|
|
|
|
DEFINE CLASS ct_selectie_camp AS _container OF "..\comun\clase\_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="ck_camp" UniqueID="" Timestamp="" />
|
|
|
|
*<DefinedPropArrayMethod>
|
|
*m: actualizeaza_container
|
|
*p: ccamp
|
|
*p: cnumecamp
|
|
*p: csens
|
|
*p: lgrupare && .T. daca se pot face grupari dupa acest camp.
|
|
*p: lordine && .T. daca se poate ordona dupa acest camp.
|
|
*p: nid_container
|
|
*p: nordine_grup
|
|
*p: nordine_ordine
|
|
*p: nselectat
|
|
*</DefinedPropArrayMethod>
|
|
|
|
*<PropValue>
|
|
BorderWidth = 0
|
|
ccamp =
|
|
cnumecamp =
|
|
csens =
|
|
Height = 19
|
|
lgrupare = .T.
|
|
lordine = .T.
|
|
Name = "ct_selectie_camp"
|
|
nid_container = 0
|
|
nordine_grup = 0
|
|
nordine_ordine = 0
|
|
nselectat = 0
|
|
Width = 108
|
|
*</PropValue>
|
|
|
|
ADD OBJECT 'ck_camp' AS _checkbox WITH ;
|
|
Alignment = 0, ;
|
|
Caption = "Camp", ;
|
|
Left = 9, ;
|
|
Name = "ck_camp", ;
|
|
Top = 1
|
|
*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />
|
|
|
|
PROCEDURE actualizeaza_container
|
|
Lparameters llVizibil
|
|
This.Visible=llVizibil
|
|
This.ck_camp.FontBold = .F.
|
|
This.ck_camp.Value = 0
|
|
This.ngrupat = 0
|
|
ENDPROC
|
|
|
|
PROCEDURE Init
|
|
This.ck_camp.Caption = This.cnumecamp
|
|
ENDPROC
|
|
|
|
PROCEDURE ck_camp.Click
|
|
This.Parent.nselectat = This.Value
|
|
If This.Value = 1
|
|
This.FontBold=.T.
|
|
This.Parent.Parent.do_adauga(This.Parent.ccamp,This.Parent.cnumecamp,This.Parent.lgrupare,This.Parent.lordine)
|
|
Else
|
|
This.FontBold = .F.
|
|
This.Parent.Parent.do_sterge(This.Parent.ccamp)
|
|
Endif
|
|
ENDPROC
|
|
|
|
ENDDEFINE
|
|
|
|
DEFINE CLASS frm_date_rapoarte AS _frmbase OF "..\comun\clase\_frm_base.vcx"
|
|
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />
|
|
|
|
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
|
|
*< OBJECTDATA: ObjPath="But_salveaza1" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_clb_raport" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_clb_raport.But_sterge1" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Clb_data_referinta" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Clb_perioada" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_opt_agent" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_opt_masina" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_opt_delegat" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_opt_client" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1.Ct_selectie_nract" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1.Ct_selectie_datascad" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1.Ct_selectie_nume_agent" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1.Ct_selectie_nume_delegat" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1.Ct_selectie_nrinmat" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1.Ct_selectie_nume_client" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="Ct_selectie1.Ct_selectie_dataact" UniqueID="" Timestamp="" />
|
|
*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
|
|
|
|
*<DefinedPropArrayMethod>
|
|
*m: do_adauga_filtru
|
|
*m: do_cauta_agent
|
|
*m: do_cauta_client
|
|
*m: do_cauta_delegat
|
|
*m: do_cauta_masina
|
|
*</DefinedPropArrayMethod>
|
|
|
|
*<PropValue>
|
|
DoCreate = .T.
|
|
Height = 470
|
|
Name = "frm_date_rapoarte"
|
|
Width = 696
|
|
_shape1.Height = 29
|
|
_shape1.Left = 0
|
|
_shape1.Name = "_shape1"
|
|
_shape1.Top = 0
|
|
_shape1.Width = 696
|
|
_shape2.Height = 29
|
|
_shape2.Left = 600
|
|
_shape2.Name = "_shape2"
|
|
_shape2.Top = 0
|
|
_shape2.Width = 96
|
|
Lb_titlu_alb_b121.Caption = "CRITERII DE SELECTIE"
|
|
Lb_titlu_alb_b121.FontBold = .T.
|
|
Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
|
|
Lb_titlu_alb_b121.TabIndex = 22
|
|
BUT_TERMIN1.Left = 664
|
|
BUT_TERMIN1.Name = "BUT_TERMIN1"
|
|
BUT_TERMIN1.TabIndex = 18
|
|
BUT_TERMIN1.Top = 1
|
|
GRIDSORT1.Left = 480
|
|
GRIDSORT1.Name = "GRIDSORT1"
|
|
GRIDSORT1.Top = 36
|
|
*</PropValue>
|
|
|
|
ADD OBJECT 'But_listare1' AS but_listare WITH ;
|
|
Left = 634, ;
|
|
Name = "But_listare1", ;
|
|
Top = 1
|
|
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
|
|
|
|
ADD OBJECT 'But_salveaza1' AS but_salveaza WITH ;
|
|
Left = 603, ;
|
|
Name = "But_salveaza1", ;
|
|
TabIndex = 20, ;
|
|
Top = 1, ;
|
|
Visible = .F.
|
|
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
|
|
|
|
ADD OBJECT 'Clb_data_referinta' AS clb_tx_simplu WITH ;
|
|
Left = 383, ;
|
|
Name = "Clb_data_referinta", ;
|
|
TabIndex = 3, ;
|
|
Top = 100, ;
|
|
Text_simplu1.ControlSource = "poListare.data_referinta", ;
|
|
Text_simplu1.Height = 23, ;
|
|
Text_simplu1.Left = 126, ;
|
|
Text_simplu1.Name = "Text_simplu1", ;
|
|
Text_simplu1.Top = 3, ;
|
|
Text_simplu1.Width = 159, ;
|
|
Lb_simplu1.Caption = "Data de referinta", ;
|
|
Lb_simplu1.Name = "Lb_simplu1"
|
|
*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Clb_perioada' AS clb_n1n2_simplu WITH ;
|
|
Left = 383, ;
|
|
Name = "Clb_perioada", ;
|
|
TabIndex = 2, ;
|
|
Top = 72, ;
|
|
tx_n1.ControlSource = "poListare.datai", ;
|
|
tx_n1.Left = 127, ;
|
|
tx_n1.Name = "tx_n1", ;
|
|
tx_n1.Top = 2, ;
|
|
Lb_simplu1.Caption = "Perioada", ;
|
|
Lb_simplu1.Name = "Lb_simplu1", ;
|
|
tx_n2.ControlSource = "poListare.dataf", ;
|
|
tx_n2.Name = "tx_n2"
|
|
*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_clb_raport' AS ct_clb_cautare WITH ;
|
|
Height = 31, ;
|
|
Left = 23, ;
|
|
Name = "Ct_clb_raport", ;
|
|
TabIndex = 21, ;
|
|
Top = 36, ;
|
|
Visible = .F., ;
|
|
Width = 396, ;
|
|
img_cautare.Height = 25, ;
|
|
img_cautare.Left = 321, ;
|
|
img_cautare.Name = "img_cautare", ;
|
|
img_cautare.Top = 3, ;
|
|
img_cautare.Width = 30, ;
|
|
clb_tx_cautare.Lb_simplu1.Caption = "Raport", ;
|
|
clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
|
|
clb_tx_cautare.Name = "clb_tx_cautare", ;
|
|
clb_tx_cautare.TabIndex = 1, ;
|
|
clb_tx_cautare.Text_simplu1.Height = 23, ;
|
|
clb_tx_cautare.Text_simplu1.Left = 71, ;
|
|
clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
|
|
clb_tx_cautare.Text_simplu1.Top = 3, ;
|
|
clb_tx_cautare.Text_simplu1.Width = 239
|
|
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_clb_raport.But_sterge1' AS but_sterge WITH ;
|
|
Height = 27, ;
|
|
Left = 361, ;
|
|
Name = "But_sterge1", ;
|
|
TabIndex = 2, ;
|
|
Top = 1, ;
|
|
Width = 30
|
|
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
|
|
|
|
ADD OBJECT 'Ct_opt_agent' AS ct_opt_cautare WITH ;
|
|
cprocedura = thisform.do_cauta_agent, ;
|
|
cvar_afisata = poListare.nume_agent, ;
|
|
Left = 383, ;
|
|
Name = "Ct_opt_agent", ;
|
|
TabIndex = 5, ;
|
|
Top = 198, ;
|
|
tx_cautare.Name = "tx_cautare", ;
|
|
opt_cautare.Name = "opt_cautare", ;
|
|
opt_cautare.OPTION1.Left = 5, ;
|
|
opt_cautare.OPTION1.Name = "OPTION1", ;
|
|
opt_cautare.OPTION1.Top = 5, ;
|
|
opt_cautare.OPTION2.Left = 5, ;
|
|
opt_cautare.OPTION2.Name = "OPTION2", ;
|
|
opt_cautare.OPTION2.Top = 24, ;
|
|
lb_explicatie.Caption = "Agent", ;
|
|
lb_explicatie.Name = "lb_explicatie"
|
|
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_opt_client' AS ct_opt_cautare WITH ;
|
|
cprocedura = thisform.do_cauta_client, ;
|
|
cvar_afisata = poListare.nume_client, ;
|
|
Left = 383, ;
|
|
Name = "Ct_opt_client", ;
|
|
TabIndex = 4, ;
|
|
Top = 128, ;
|
|
tx_cautare.Name = "tx_cautare", ;
|
|
opt_cautare.Name = "opt_cautare", ;
|
|
opt_cautare.OPTION1.Left = 5, ;
|
|
opt_cautare.OPTION1.Name = "OPTION1", ;
|
|
opt_cautare.OPTION1.Top = 5, ;
|
|
opt_cautare.OPTION2.Left = 5, ;
|
|
opt_cautare.OPTION2.Name = "OPTION2", ;
|
|
opt_cautare.OPTION2.Top = 24, ;
|
|
lb_explicatie.Caption = "Client", ;
|
|
lb_explicatie.Name = "lb_explicatie"
|
|
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_opt_delegat' AS ct_opt_cautare WITH ;
|
|
cprocedura = thisform.do_cauta_delegat, ;
|
|
cvar_afisata = poListare.nume_delegat, ;
|
|
Left = 383, ;
|
|
Name = "Ct_opt_delegat", ;
|
|
TabIndex = 6, ;
|
|
Top = 268, ;
|
|
tx_cautare.Name = "tx_cautare", ;
|
|
opt_cautare.Name = "opt_cautare", ;
|
|
opt_cautare.OPTION1.Left = 5, ;
|
|
opt_cautare.OPTION1.Name = "OPTION1", ;
|
|
opt_cautare.OPTION1.Top = 5, ;
|
|
opt_cautare.OPTION2.Left = 5, ;
|
|
opt_cautare.OPTION2.Name = "OPTION2", ;
|
|
opt_cautare.OPTION2.Top = 24, ;
|
|
lb_explicatie.Caption = "Delegat", ;
|
|
lb_explicatie.Name = "lb_explicatie"
|
|
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_opt_masina' AS ct_opt_cautare WITH ;
|
|
cprocedura = thisform.do_cauta_masina, ;
|
|
cvar_afisata = poListare.nrinmat, ;
|
|
Left = 383, ;
|
|
Name = "Ct_opt_masina", ;
|
|
TabIndex = 7, ;
|
|
Top = 338, ;
|
|
tx_cautare.Name = "tx_cautare", ;
|
|
opt_cautare.Name = "opt_cautare", ;
|
|
opt_cautare.OPTION1.Left = 5, ;
|
|
opt_cautare.OPTION1.Name = "OPTION1", ;
|
|
opt_cautare.OPTION1.Top = 5, ;
|
|
opt_cautare.OPTION2.Left = 5, ;
|
|
opt_cautare.OPTION2.Name = "OPTION2", ;
|
|
opt_cautare.OPTION2.Top = 24, ;
|
|
lb_explicatie.Caption = "Masina", ;
|
|
lb_explicatie.Name = "lb_explicatie"
|
|
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1' AS ct_selectie WITH ;
|
|
ccoloanesuma = facturat,incasat, ;
|
|
cnumetabela = fact_vrap_fact_incasari, ;
|
|
Left = 24, ;
|
|
Name = "Ct_selectie1", ;
|
|
Top = 72, ;
|
|
Ct_grupare1.lb_grupare.Name = "lb_grupare", ;
|
|
Ct_grupare1.Name = "Ct_grupare1", ;
|
|
Ct_ordonare1.lb_ordonare.Name = "lb_ordonare", ;
|
|
Ct_ordonare1.Name = "Ct_ordonare1", ;
|
|
lb_coloane.Name = "lb_coloane"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1.Ct_selectie_dataact' AS ct_selectie_camp WITH ;
|
|
ccamp = dataact, ;
|
|
cnumecamp = Data factura, ;
|
|
Left = 17, ;
|
|
Name = "Ct_selectie_dataact", ;
|
|
nid_container = 2, ;
|
|
TabIndex = 37, ;
|
|
Top = 36, ;
|
|
ck_camp.Alignment = 0, ;
|
|
ck_camp.Name = "ck_camp"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1.Ct_selectie_datascad' AS ct_selectie_camp WITH ;
|
|
ccamp = datascad, ;
|
|
cnumecamp = Data scadenta, ;
|
|
Left = 17, ;
|
|
Name = "Ct_selectie_datascad", ;
|
|
nid_container = 3, ;
|
|
TabIndex = 31, ;
|
|
Top = 51, ;
|
|
ck_camp.Alignment = 0, ;
|
|
ck_camp.Name = "ck_camp"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1.Ct_selectie_nract' AS ct_selectie_camp WITH ;
|
|
ccamp = nract, ;
|
|
cnumecamp = Nr. factura, ;
|
|
Left = 17, ;
|
|
Name = "Ct_selectie_nract", ;
|
|
nid_container = 1, ;
|
|
TabIndex = 30, ;
|
|
Top = 22, ;
|
|
ck_camp.Alignment = 0, ;
|
|
ck_camp.Name = "ck_camp"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1.Ct_selectie_nrinmat' AS ct_selectie_camp WITH ;
|
|
ccamp = nrinmat, ;
|
|
cnumecamp = Masina, ;
|
|
Left = 180, ;
|
|
Name = "Ct_selectie_nrinmat", ;
|
|
TabIndex = 35, ;
|
|
Top = 51, ;
|
|
ck_camp.Alignment = 0, ;
|
|
ck_camp.Name = "ck_camp"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1.Ct_selectie_nume_agent' AS ct_selectie_camp WITH ;
|
|
ccamp = nume_agent, ;
|
|
cnumecamp = Agent, ;
|
|
Left = 180, ;
|
|
Name = "Ct_selectie_nume_agent", ;
|
|
nid_container = 5, ;
|
|
TabIndex = 33, ;
|
|
Top = 22, ;
|
|
ck_camp.Alignment = 0, ;
|
|
ck_camp.Name = "ck_camp"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1.Ct_selectie_nume_client' AS ct_selectie_camp WITH ;
|
|
ccamp = nume_client, ;
|
|
cnumecamp = Client, ;
|
|
Left = 17, ;
|
|
Name = "Ct_selectie_nume_client", ;
|
|
nid_container = 4, ;
|
|
TabIndex = 36, ;
|
|
Top = 67, ;
|
|
ck_camp.Alignment = 0, ;
|
|
ck_camp.Name = "ck_camp"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
ADD OBJECT 'Ct_selectie1.Ct_selectie_nume_delegat' AS ct_selectie_camp WITH ;
|
|
ccamp = nume_delegat, ;
|
|
cnumecamp = Delegat, ;
|
|
Left = 180, ;
|
|
Name = "Ct_selectie_nume_delegat", ;
|
|
TabIndex = 34, ;
|
|
Top = 36, ;
|
|
ck_camp.Alignment = 0, ;
|
|
ck_camp.Name = "ck_camp"
|
|
*< END OBJECT: ClassLib="orapoarte.vcx" BaseClass="container" />
|
|
|
|
PROCEDURE do_adauga_filtru
|
|
Lparameters lcSql
|
|
lcFiltru = [WHERE DATAACT BETWEEN ?poListare.datai AND ?poListare.dataf]
|
|
If !Empty(Nvl(poListare.nume_client,[]))
|
|
lcFiltru = lcFiltru + [ AND nume_client = ?poListare.nume_client]
|
|
Endif
|
|
|
|
If !Empty(Nvl(poListare.nume_agent,[]))
|
|
lcFiltru = lcFiltru + [ AND nume_agent = ?poListare.nume_agent]
|
|
Endif
|
|
|
|
If !Empty(Nvl(poListare.nume_delegat,[]))
|
|
lcFiltru = lcFiltru + [ AND nume_delegat = ?poListare.nume_delegat]
|
|
Endif
|
|
|
|
If !Empty(Nvl(poListare.nrinmat,[]))
|
|
lcFiltru = lcFiltru + [ AND nrinmat = ?poListare.nrinmat]
|
|
Endif
|
|
poListare.csql = Strtran(lcSql,[WHERE 1=2],lcFiltru)
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_cauta_agent
|
|
Private pnIdPart,pcNumePart
|
|
lcTitlu=[ALEGETI AGENTUL]
|
|
pnIdPart=0
|
|
pcNumePart=[]
|
|
|
|
If caut_partener_dupa_tip(gnIdTipAgenti,lcTitlu,@pnIdPart,@pcNumePart)
|
|
poListare.id_agent = pnIdPart
|
|
poListare.nume_agent = Alltrim(pcNumePart)
|
|
Thisform.ct_opt_agent.Refresh()
|
|
Thisform.ct_opt_delegat.SetFocus()
|
|
Else
|
|
If Empty(Nvl(poListare.nume_agent,[]))
|
|
Thisform.ct_opt_agent.opt_cautare.Value=1
|
|
Endif
|
|
Thisform.ct_opt_agent.SetFocus()
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_cauta_client
|
|
Private pnIdPart,pcNumePart
|
|
Store 0 To pnIdPart
|
|
Store "" To pcNumePart
|
|
If cauta_client(@pnIdPart,@pcNumePart)
|
|
poListare.id_client = pnIdPart
|
|
poListare.nume_client = pcNumePart
|
|
|
|
Thisform.ct_opt_client.Refresh()
|
|
Thisform.ct_opt_agent.SetFocus()
|
|
Else
|
|
If Empty(Nvl(poListare.nume_client,[]))
|
|
Thisform.ct_opt_client.opt_cautare.Value=1
|
|
Endif
|
|
Thisform.ct_opt_client.SetFocus()
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_cauta_delegat
|
|
Local loCauta
|
|
loCauta=caut_delegati()
|
|
If !Empty(loCauta.id_responsabil)
|
|
poListare.id_delegat = loCauta.id_responsabil
|
|
poListare.nume_delegat = Alltrim(loCauta.nume)
|
|
Thisform.ct_opt_delegat.Refresh()
|
|
Thisform.ct_opt_masina.SetFocus()
|
|
Else
|
|
If Empty(Nvl(poListare.nume_delegat,[]))
|
|
Thisform.ct_opt_delegat.opt_cautare.Value = 1
|
|
Endif
|
|
Thisform.ct_opt_delegat.SetFocus()
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_cauta_masina
|
|
locauta=caut_masina_gs()
|
|
If !Empty(locauta.id_masina)
|
|
poListare.nrinmat = Alltrim(locauta.nrinmat)
|
|
poListare.id_masina = locauta.id_masina
|
|
|
|
Thisform.ct_opt_masina.Refresh()
|
|
Else
|
|
If Empty(Nvl(poListare.nrinmat,[]))
|
|
Thisform.ct_opt_masina.opt_cautare.Value = 1
|
|
Endif
|
|
Thisform.ct_opt_masina.SetFocus()
|
|
Endif
|
|
|
|
ENDPROC
|
|
|
|
PROCEDURE do_listare
|
|
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(poListare.datai,{}))
|
|
amessagebox("Nu ati completat data initiala!",0+48,"Atentie")
|
|
Thisform.clb_perioada.tx_n1.SetFocus()
|
|
Return
|
|
Case Empty(Nvl(poListare.dataf,{}))
|
|
amessagebox("Nu ati completat data finala!",0+48,"Atentie")
|
|
Thisform.clb_perioada.tx_n2.SetFocus()
|
|
Return
|
|
Case Empty(Nvl(poListare.data_referinta,{}))
|
|
amessagebox("Nu ati completat data de referinta!",0+48,"Atentie")
|
|
Thisform.clb_data_referinta.SetFocus()
|
|
Return
|
|
Otherwise
|
|
With This.ct_selectie1
|
|
.do_instructiune_sql()
|
|
lcSql = .csql
|
|
Endwith
|
|
If Empty(lcSql)
|
|
amessagebox("Nu ati ales coloane pentru selectie!",0+48,"Atentie")
|
|
Thisform.ct_selectie1.SetFocus()
|
|
Return
|
|
Else
|
|
This.do_adauga_filtru(lcSql)
|
|
Endif
|
|
Endcase
|
|
|
|
If Used('crsraport')
|
|
Use In crsraport
|
|
Endif
|
|
*!* STRTOFILE(poListare.cSql,[c:\sql.txt])
|
|
lnSucces = goExecutor.oExecute(poListare.csql,'crsraport')
|
|
If lnSucces < 0
|
|
amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
|
|
Endif
|
|
|
|
pcDataora = get_ora(2)
|
|
If Reccount('crsraport')<>0
|
|
Thisform.AlwaysOnTop = .F.
|
|
Select crsraport
|
|
Report Form raport_facturat To Printer Prompt Preview
|
|
Thisform.AlwaysOnTop = .T.
|
|
Else
|
|
amessagebox("Nu exista rezultate pentru listare!",0+48,"Atentie")
|
|
Endif
|
|
|
|
If Used('crsraport')
|
|
Use In crsraport
|
|
Endif
|
|
ENDPROC
|
|
|
|
PROCEDURE Clb_perioada.tx_n1.Valid
|
|
*!*
|
|
ENDPROC
|
|
|
|
ENDDEFINE
|