230 lines
8.4 KiB
Plaintext
230 lines
8.4 KiB
Plaintext
*!* 22.02.2010
|
|
*!* marius.mutu
|
|
*!* viz_config_grupe_gestiuni - arat doar gestiunile din sucursala curenta
|
|
|
|
*!* 22.03.2010
|
|
*!* marius.mutu
|
|
*!* viz_config_grupe_gestiuni - + ID_SECTIE, SECTIE
|
|
|
|
*!* 31.12.2019
|
|
*!* marius.mutu
|
|
*!* viz_config_grupe_gestiuni - GESTIUNI.GESTIONAR, COMISIE_RECEPTIE
|
|
|
|
PROCEDURE viz_config_grupe_gestiuni
|
|
PARAMETERS tntip
|
|
|
|
|
|
lntip = tntip
|
|
PRIVATE poGestiuni
|
|
Local lcSchema, lcSelect, lcOrder, lcFiltru, lcFiltruOriginal, llAfiseaza, lcgroup, lcFiltruOriginal
|
|
PRIVATE poGrupe,pcschema2,pcselect2,pcfiltru2,pcorder2
|
|
PRIVATE poUtilizatori
|
|
LOCAL lcschema3,lcselect3,lcfiltru3,lcorder3,lcgroup3, llModParam3, lcFiltruOriginal3
|
|
PRIVATE poGrupe_Gestiuni,pcschema4,pcselect4,pcfiltru4,pcorder4
|
|
PRIVATE poGrupe_Utilizatori,pcschema5,pcselect5,pcfiltru5,pcorder5
|
|
STORE '' TO poGestiuni,poGrupe,poUtilizatori,poGrupe_Gestiuni,poGrupe_Utilizatori
|
|
|
|
***********************
|
|
PRIVATE aTipuriGestiuni
|
|
DIMENSION aTipuriGestiuni(7)
|
|
*EXTERNAL ARRAY taTipuriGestiuni
|
|
aTipuriGestiuni(1)=[<Nedefinit>]
|
|
aTipuriGestiuni(2)=[Materii Prime si Materiale]
|
|
aTipuriGestiuni(3)=[Obiecte de Inventar]
|
|
aTipuriGestiuni(4)=[Produse]
|
|
aTipuriGestiuni(5)=[Marfuri la Pret de Achizitie]
|
|
aTipuriGestiuni(6)=[Marfuri la Pret de Vanzare]
|
|
aTipuriGestiuni(5)=[Marfuri la Pret de Achizitie*]
|
|
***********************
|
|
|
|
lcsql = [select nume_tip,id_tipgest from vtipuri_gestiuni ]
|
|
lnSucces = goExecutor.oexecute(lcSql,[crsTipuri_gest])
|
|
IF lnSucces < 0
|
|
lcMesaj = goExecutor.cEroare
|
|
ofrm_er =CREATEOBJECT([frm_mesaj],[Eroare],[exclam.ico],[Avertizare],lcmesaj)
|
|
ofrm_er.show()
|
|
RELEASE ofrm_er
|
|
return
|
|
ENDIF
|
|
|
|
lcSchema = [ID_GESTIUNE N(5), NUME_GESTIUNE V(50),INACTIV N(1),CONT V(4),ACONT V(4),] + ;
|
|
[NR_PAG N(2) ,CGEST V(20) ,ID_SUCURSALA N(10) ,DESCRIERE V(100) ,NUME_TIP V(30) ,SUCURSALA V(100) , ] + ;
|
|
[ID_RESPONSABIL N(10) ,DENUMIRE V(70), ID_SECTIE N(5), SECTIE V(50), ACONT_CHELTUIALA V(4), ACONT_ADAOS V(4),ID_LUCRARE N(10), NRORD V(100), ] + ;
|
|
[GESTIONAR V(50), COMISIE_RECEPTIE1 V(50), COMISIE_RECEPTIE2 V(50), COMISIE_RECEPTIE3 V(50)]
|
|
|
|
lcSelect = [select ID_GESTIUNE,NUME_GESTIUNE,INACTIV,CONT,ACONT,NR_PAG,CGEST,ID_SUCURSALA,DESCRIERE,NUME_TIP,SUCURSALA,ID_RESPONSABIL,DENUMIRE, ] + ;
|
|
[ID_SECTIE, SECTIE, ACONT_CHELTUIALA, ACONT_ADAOS,ID_LUCRARE, NRORD, ] +;
|
|
[GESTIONAR, COMISIE_RECEPTIE1, COMISIE_RECEPTIE2, COMISIE_RECEPTIE3] + ;
|
|
[ from vnom_gestiuni]
|
|
|
|
lcOrder = [nume_gestiune]
|
|
lcgroup = []
|
|
lcFiltru = []
|
|
*!* 22.02.2010
|
|
lcFiltruOriginal = SUBSTR(gcCondSucursala,6)
|
|
*!* 22.02.2010 ^
|
|
|
|
pcschema2=['id_grupe n(5),nume_grupa c(100), nume_parinte c(100), parent_id n(5), inactiv n(1)']
|
|
pcselect2=['select id_grupe,nume_grupa, nume_parinte, parent_id, inactiv'+]+;
|
|
[' from ]+gcS+[.vgest_nom_grupe where 1=2']
|
|
pcorder2=[nume_grupa]
|
|
pcfiltru2=[2=2]
|
|
|
|
lcschema3=[id_util n(5),utilizator c(30)]
|
|
lcselect3=[select distinct a.id_util,a.utilizator ]+;
|
|
[ from syn_vutilizatori a join syn_vdef_util_firme b on a.id_util = b.id_util ]
|
|
|
|
*!* pcselect3=['select id_util,utilizator'+]+;
|
|
*!* [' from contafin_oracle.vutilizatori where 1=2']
|
|
lcorder3=[utilizator]
|
|
lcfiltru3=[1=2]
|
|
lcgroup3 = []
|
|
llModParam3 = .T.
|
|
*!* modificare 19.03.2007
|
|
lcFiltruOriginal3 = [a.inactiv = 0 and b.id_firma = ?gnIdFirma]
|
|
*!* lcFiltruOriginal3 = [b.id_program = ]+ALLTRIM(STR(gnIdProgram))+[ and b.id_firma = ]+ALLTRIM(STR(gnIdFirma))
|
|
*!* modificare 19.03.2007 ^
|
|
|
|
pcschema4=['id_cgg n(5),id_gestiune n(5),nume_gestiune c(50),cgest c(20),nr_pag n(2),'+]+;
|
|
['cont c(4),acont c(4),inactiv_gest n(1),nume_tip_gest c(30),'+]+;
|
|
['id_grupe n(5),nume_grupa c(100),inactiv_grupa n(1)']
|
|
pcselect4=['select a.id_cgg,a.id_gestiune,b.nume_gestiune,b.cgest,b.nr_pag,'+]+;
|
|
['b.cont,b.acont,b.inactiv as inactiv_gest,b.nume_tip as nume_tip_gest,'+]+;
|
|
['a.id_grupe,c.nume_grupa,c.inactiv as inactiv_grupa'+]+;
|
|
[' from ]+ gcS+[.vgest_coresp_grupe_gestiuni a '+] + ;
|
|
[' join ]+ gcS + [.vnom_gestiuni b on a.id_gestiune=b.id_gestiune '+]+;
|
|
[' join ]+gcS+ [.vgest_nom_grupe c on a.id_grupe = c.id_grupe '+]+;
|
|
[' where 1=2']
|
|
pcorder4=[c.nume_grupa]
|
|
pcfiltru4=[1=2]
|
|
|
|
pcschema5=['id_cug n(5),id_util n(5),id_grupe n(5),nume_grupa c(100),inactiv n(1)']
|
|
pcselect5=['select a.id_cug,a.id_util,a.id_grupe,b.nume_grupa,b.inactiv'+]+;
|
|
[' from ]+gcS+[.vgest_coresp_util_grupe a '+]+;
|
|
[' join ]+gcS+[.vgest_nom_grupe b on a.id_grupe = b.id_grupe'+]+;
|
|
[' where 1=2']
|
|
pcorder5=[b.nume_grupa]
|
|
pcfiltru5=[1=2]
|
|
|
|
llModParam = .T.
|
|
llAfiseaza = .F.
|
|
_screen.MousePointer= 11
|
|
*gencursor('poGestiuni','crsGestiuni',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
gencursor('poGestiuni','crsGestiuni', lcSelect, lcFiltru, lcSchema, lcOrder, llAfiseaza, lcgroup, llModParam, lcFiltruOriginal)
|
|
gencursor('poGrupe','crsGrupe',pcselect2,pcfiltru2,pcschema2,pcorder2,llAfiseaza)
|
|
gencursor('poUtilizatori','crsUtilizatori',lcselect3,lcfiltru3,lcschema3,lcorder3,llAfiseaza,lcgroup3, llModParam3, lcFiltruOriginal3)
|
|
gencursor('poGrupe_Gestiuni','crsGrupe_Gestiuni',pcselect4,pcfiltru4,pcschema4,pcorder4,llAfiseaza)
|
|
gencursor('poGrupe_Utilizatori','crsGrupe_Utilizatori',pcselect5,pcfiltru5,pcschema5,pcorder5,llAfiseaza)
|
|
|
|
poGrupe.ca_baza1.afisare()
|
|
poGestiuni.ca_baza1.afisare()
|
|
poUtilizatori.ca_baza1.afisare()
|
|
SELECT crsUtilizatori
|
|
|
|
GO top
|
|
lcId_util = ALLTRIM(STR(crsUtilizatori.id_util))
|
|
poGrupe_Utilizatori.ca_baza1.cfiltru = [a.id_util=]+lcId_util
|
|
poGrupe_Utilizatori.ca_baza1.afisare()
|
|
|
|
|
|
DO case
|
|
CASE lntip = 1
|
|
SELECT crsGrupe
|
|
GO top
|
|
lcId_grupe = ALLTRIM(STR(crsGrupe.id_grupe))
|
|
poGrupe_Gestiuni.ca_baza1.cfiltru=[a.id_grupe=]+lcId_grupe
|
|
poGrupe_Gestiuni.ca_baza1.corder=[b.nume_gestiune]
|
|
poGrupe_Gestiuni.ca_baza1.afisare()
|
|
CASE lntip = 2
|
|
SELECT crsGestiuni
|
|
GO top
|
|
lcId_gestiune = ALLTRIM(STR(crsGestiuni.id_gestiune))
|
|
poGrupe_Gestiuni.ca_baza1.cfiltru=[a.id_gestiune=]+lcId_gestiune
|
|
poGrupe_Gestiuni.ca_baza1.corder=[c.nume_grupa]
|
|
poGrupe_Gestiuni.ca_baza1.afisare()
|
|
CASE lntip = 3
|
|
poGrupe_Gestiuni.ca_baza1.cfiltru = [1=2]
|
|
poGrupe_Gestiuni.ca_baza1.afisare()
|
|
ENDCASE
|
|
|
|
*!* DO FORM frm_grupe_gestiuni_utilizatori NOSHOW NAME ofrm_gest LINKED
|
|
ofrm_gest = CREATEOBJECT('frm_gestiuni_grupe_utilizatori')
|
|
_screen.MousePointer= 0
|
|
ofrm_gest.pagefr_config.activepage = lntip
|
|
ofrm_gest.show(1)
|
|
RELEASE ofrm_gest
|
|
|
|
RELEASE poGestiuni
|
|
RELEASE poGrupe
|
|
RELEASE poUtilizatori
|
|
RELEASE poGrupe_Gestiuni
|
|
RELEASE poGrupe_Utilizatori
|
|
|
|
ENDPROC
|
|
***********************
|
|
|
|
***********************
|
|
FUNCTION tip_gestiune
|
|
PARAMETERS tnpoz
|
|
|
|
IF tnpoz = 0
|
|
RETURN [<Nedefinit>]
|
|
ELSE
|
|
RETURN aTipuriGestiuni(tnpoz)
|
|
ENDIF
|
|
ENDFUNC
|
|
***********************
|
|
|
|
FUNCTION iif_inactiv
|
|
LOCAL lcrez
|
|
lcrez = IIF(inactiv=1,'DA','NU')
|
|
RETURN lcrez
|
|
ENDFUNC
|
|
|
|
|
|
********* INCEPUT: viz_config_tipuri_gestiuni ***********
|
|
PROCEDURE viz_config_tipuri_gestiuni
|
|
|
|
PRIVATE pnId_tipgest
|
|
STORE 0 TO pnId_tipgest
|
|
|
|
PRIVATE poCoresp,poPlcont
|
|
STORE '' TO poCoresp,poPlcont
|
|
|
|
lcSql1 = [select nume_tip,id_tipgest from tipuri_gestiuni]
|
|
lccursor1 = [crsTipuri_gest]
|
|
lnsucces1 = goExecutor.oExecute(lcSql1,lccursor1)
|
|
IF lnsucces1 < 0
|
|
lcmesaj = goExecutor.cEroare
|
|
ofrm_er = CREATEOBJECT('frm_mesaj','Eroare','exclam.ico','Avertizare',lcmesaj)
|
|
ofrm_er.show(1)
|
|
RELEASE ofrm_er
|
|
RETURN
|
|
ENDIF
|
|
|
|
lcSelect1 = ['select cont from ] + gcS + [.vplcont_sintetic where 1=2']
|
|
lcSchema1 = ['cont c(4)']
|
|
lcorder1 = [cont]
|
|
lcfiltru1 = [ an = ] + ALLTRIM(STR(gnAn)) + [ and SUBSTR(cont,1,1) = '3' ] + ;
|
|
[ and cont not in (select cont from ] + gcs +;
|
|
[.vcoresp_cont_tipgest where id_tipgest = ?pnId_tipgest)]
|
|
|
|
lcSelect2 = ['select cont,id_cct,id_tipgest from ] + gcS + [.vcoresp_cont_tipgest where 1=2']
|
|
lcSchema2 = ['cont c(4),id_cct n(5),id_tipgest n(5)']
|
|
lcorder2 = [cont]
|
|
lcfiltru2 = [id_tipgest = ?pnId_tipgest]
|
|
llAfiseaza = .t.
|
|
|
|
gencursor('poPlcont','crsPlcont',lcselect1,lcfiltru1,lcschema1,lcorder1,llAfiseaza)
|
|
gencursor('poCoresp','crsCoresp',lcselect2,lcfiltru2,lcschema2,lcorder2,llAfiseaza)
|
|
|
|
ofrm_tipgest = CREATEOBJECT('frm_config_tipuri_gestiuni')
|
|
ofrm_tipgest.show(1)
|
|
RELEASE ofrm_tipgest
|
|
|
|
RELEASE poCoresp
|
|
ENDPROC
|
|
********* SFARSIT: viz_config_tipuri_gestiuni ***********
|
|
|
|
|