Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012P75yL9Fc9EcT33tMbuxcF
215 lines
6.4 KiB
Plaintext
215 lines
6.4 KiB
Plaintext
*******************************************
|
|
Procedure viz_delegati
|
|
Lparameters tnidpartener
|
|
Private podelegati,pcschema1,pcselect1,odetalii
|
|
LOCAL llAfiseaza
|
|
Store '' To podelegati
|
|
If Used('v_delegati')
|
|
Use In v_delegati
|
|
Endif
|
|
pcschema1=['']
|
|
pcselect1=['select * from ] + gcS + [.vnom_delegati where 1=2']
|
|
pcorder1 = [nume]
|
|
*!* pcfiltru1=[sters=0]
|
|
pcfiltru1=[1=2]
|
|
llAfiseaza=.F.
|
|
gencursor('podelegati','v_delegati',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
podelegati.ca_baza1.afisare()
|
|
ofrmdelegati=Createobject('frm_delegati',tnidpartener)
|
|
ofrmdelegati.Show(1)
|
|
|
|
Select v_delegati
|
|
Scatter Name odetalii
|
|
Use In v_delegati
|
|
Release podelegati
|
|
Return odetalii
|
|
ENDPROC && viz_delegati
|
|
**********************sfarsit procedura viz_delegati*******************
|
|
******************************************* INCEPUT:viz_responsabili *******************************************
|
|
PROCEDURE viz_responsabili( )
|
|
|
|
PRIVATE poresponsabili, pcschema1, pcselect1
|
|
STORE '' TO poresponsabili
|
|
pcschema1 = ['']
|
|
pcselect1=['select * from ] + gcS + [.vnom_responsabili where 1=2']
|
|
pcorder1=[nume]
|
|
pcfiltru1 = [2=2]
|
|
llAfiseaza = .F.
|
|
gencursor('poresponsabili','v_responsabili',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
poresponsabili.ca_baza1.afisare()
|
|
ofrmres=CREATEOBJECT('frm_responsabili')
|
|
ofrmres.SHOW(1)
|
|
RELEASE poresponsabili
|
|
|
|
|
|
ENDPROC && viz_responsabili
|
|
******************************************* SFARSIT: viz_responsabili *******************************************
|
|
Procedure viz_curs
|
|
|
|
Private poCurs
|
|
Store '' To poCurs
|
|
|
|
Local lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
|
|
lcSchema1 = ['id_curs N(10), nume_val C(10), curs N(10,4), data D(8), data2 D(8), id_valuta N(5)']
|
|
lcSelect1 = [select id_curs, nume_val, curs, data, data2, id_valuta from ] + gcS + [.vcrm_curs]
|
|
lcOrder1 = [data desc]
|
|
lcFiltru1 = [1=2]
|
|
lcFiltruOriginal = []
|
|
llModParam = .T.
|
|
llAfiseaza = .F.
|
|
lcgroup = []
|
|
*gencursor('poCurs','cIntermediar', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza, lcgroup, llModParam, lcFiltruOriginal)
|
|
gencursor('poCurs','tCurs', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza, lcgroup, llModParam, lcFiltruOriginal)
|
|
poCurs.ca_baza1.afisare()
|
|
|
|
Select tCurs
|
|
lovc = Createobject("frm_curs")
|
|
lovc.Show(1)
|
|
|
|
Release poCurs
|
|
|
|
Endproc && viz_curs
|
|
***-----------------------------------------------------------------------------------------------------------------------------
|
|
Procedure viz_tipc
|
|
|
|
Private poTipc
|
|
Store '' To poTipc
|
|
|
|
Local lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
|
|
lcSchema1 = ['']
|
|
lcSelect1 = [select * from ] + gcS + [.crm_tipc]
|
|
lcOrder1 = [id_tipc]
|
|
lcFiltru1 = [2=2]
|
|
lcFiltruOriginal = []
|
|
llModParam = .T.
|
|
llAfiseaza = .F.
|
|
lcgroup = []
|
|
gencursor('poTipc','tTipc', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza, lcgroup, llModParam, lcFiltruOriginal)
|
|
poTipc.ca_baza1.afisare()
|
|
|
|
Select tTipc
|
|
lotc = Createobject("frm_tipc")
|
|
lotc.Show(1)
|
|
|
|
Release poTipc
|
|
|
|
Endproc && viz_tipc
|
|
***-----------------------------------------------------------------------------------------------------------------------------
|
|
********* Inceput: viz_articole
|
|
Procedure viz_articole
|
|
|
|
Private poArticole
|
|
Store '' To poArticole
|
|
|
|
Local lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
|
|
lcSchema1 = ['']
|
|
lcSelect1 = [select * from ] + gcS + [.nom_articole]
|
|
lcOrder1 = [denumire]
|
|
lcFiltru1 = [1=2]
|
|
lcFiltruOriginal = []
|
|
llModParam = .T.
|
|
llAfiseaza = .F.
|
|
lcgroup = []
|
|
gencursor('poArticole','tArticole', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza, lcgroup, llModParam, lcFiltruOriginal)
|
|
poArticole.ca_baza1.afisare()
|
|
|
|
of_art = Createobject('frm_articole')
|
|
of_art.Show(1)
|
|
|
|
Endproc
|
|
********* Sfarsit: viz_articole
|
|
******************************************************************************************************************
|
|
Procedure viz_clienti()
|
|
Private poClie,pcschema1,pcselect1
|
|
Local llAfiseaza
|
|
Store .F. To llAfiseaza
|
|
Store '' To poClie
|
|
If Used('v_clie')
|
|
Use In v_clie
|
|
Endif
|
|
|
|
pcschema1=['']
|
|
pcselect1=['select b.* from vcoresp_tip_part a left join vnom_parteneri b '+]+;
|
|
['on a.id_part=b.id_part where a.id_tip_part=16 and b.inactiv=0']
|
|
pcorder1=[b.nume]
|
|
pcfiltru1 = [1 = 2]
|
|
llAfiseaza = .F.
|
|
gencursor('poclie','v_clie',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
poClie.ca_baza1.afisare()
|
|
|
|
ofrmclienti=Createobject('frm_clienti')
|
|
ofrmclienti.Show(1)
|
|
Release ofrmclienti,poClie
|
|
Endproc && viz_clienti
|
|
******************************************************************************************************************
|
|
******************************************************************************************************************
|
|
Procedure viz_agenti
|
|
Private poagenti,pcschema1,pcselect1
|
|
Local llAfiseaza
|
|
Store .F. To llAfiseaza
|
|
Store '' To poagenti
|
|
If Used('crsagenti')
|
|
Use In crstagenti
|
|
Endif
|
|
|
|
pcschema1=['']
|
|
pcselect1=['select * from ]+gcS+[.vnom_agenti where 2=2']
|
|
pcorder1=[nume_agent]
|
|
pcfiltru1 = [1 = 2]
|
|
llAfiseaza = .F.
|
|
gencursor('poagenti','crsagenti',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
poagenti.ca_baza1.afisare()
|
|
|
|
ofrmagenti=Createobject('frm_agenti')
|
|
ofrmagenti.Show(1)
|
|
Release ofrmtipuri,potipurieven
|
|
Endproc && viz_agenti
|
|
******************************************************************************************************************
|
|
*****************************************************************************
|
|
function cauta_zona
|
|
Lparameters tnIdZona,tcNumeZona
|
|
Local locauta,llReturn
|
|
Store "" To locauta
|
|
Store .F. To llReturn
|
|
pcselect = ["select id_zona,zona from ] + gcS + [.crm_vzone where inactiv=0"]
|
|
pcfiltru = [1=2]
|
|
pcschema = ['']
|
|
pcorder = [2]
|
|
pccoloane = [Zona]
|
|
pcTitlu = [Zona]
|
|
pcTitluColoane = [Zona]
|
|
locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
|
|
If !Empty(locauta.id_zona)
|
|
tnIdZona=locauta.id_zona
|
|
tcNumeZona=Alltrim(locauta.zona)
|
|
llReturn=.T.
|
|
Endif
|
|
Return llReturn
|
|
Endfunc && cauta_zona
|
|
*****************************************************************************
|
|
Procedure update_clienti( )
|
|
LPARAMETERS tnid_partener
|
|
|
|
LOCAL lcFiltru
|
|
IF !EMPTY(tnid_partener)
|
|
lcFiltru = [ and p.id_part=]+ALLTRIM(STR(tnid_partener))
|
|
ELSE
|
|
lcFiltru = []
|
|
ENDIF
|
|
If Used('v_clienti')
|
|
Use In v_clienti
|
|
Endif
|
|
|
|
lcSql = [select distinct p.nume, p.cod_fiscal, p.id_part FROM ] + gcS + [.vcoresp_tip_part p ] + ;
|
|
[join ] + gcS + [.vcoresp_tip_cont c on p.id_tip_part=c.id_tip_part where c.cont ='4111' ] + ;
|
|
[and p.inactiv=0 ]+lcFiltru+[ order by p.nume ]
|
|
lcCursor = 'v_clienti'
|
|
lnSucces = goExecutor.oExecute(lcSql,lcCursor)
|
|
goExecutor.oReset()
|
|
Return lnSucces
|
|
|
|
Endproc
|
|
**********************sfarsit procedura update_clienti*******************
|
|
|
|
|