131 lines
5.0 KiB
Plaintext
131 lines
5.0 KiB
Plaintext
Procedure viz_politici
|
|
Private popolitici,popoliticiart,pcschema1,pcselect1
|
|
Local llAfiseaza
|
|
Store .F. To llAfiseaza
|
|
Store '' To popolitici,popoliticiart
|
|
If Used('crspoliticipret')
|
|
Use In crspoliticipret
|
|
Endif
|
|
If Used('crspoliticiart')
|
|
Use In crspoliticiart
|
|
Endif
|
|
|
|
|
|
pcschema1=['id_pol n(10), nume_lista_preturi c(100), datai d, datas d, id_valuta n(10), nume_val c(10), id_nota N(10), notaContab C(30), preturi_cu_tva N(1), utilizator c(100),dataora t, id_sucursala n(5), sucursala c(50), moneda_nationala n(1)']
|
|
pcselect1=['select id_pol, nume_lista_preturi ,datai, datas, id_valuta, nume_val, id_nota, notaContab, preturi_cu_tva, utilizator, dataora,id_sucursala,sucursala,moneda_nationala from vcrm_politici_preturi where 1=2']
|
|
pcorder1=[nume_lista_preturi ]
|
|
pcfiltru1 = [2 = 2] + gcCondSucursala
|
|
llAfiseaza = .F.
|
|
gencursor('popolitici','crspoliticipret',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
popolitici.ca_baza1.afisare()
|
|
|
|
pcschema1=['id_articol n(10), id_pol_art n(10), nume_articol c(100), um c(16), pret n(20,4), pretftva n(20,4), pretctva n(20,4),proc_tvav n(6,2), nume_val c(16),utilizator c(50),'+]+;
|
|
['dataora t,codmat c(30),art_compus N(1),procent n(1),explicatie c(50),id_venchelt n(10),explicatie_venchelt c(50),um2 c(16),cant_bax n(20,4),reteta_principala n(10)']
|
|
pcselect1=['select id_articol, id_pol_art, nume_articol,um,pret,pretftva, pretctva, proc_tvav,nume_val,utilizator,dataora,codmat,art_compus,procent,'+]+;
|
|
["(case procent when 1 then '%' else nume_val end) as explicatie,id_venchelt,explicatie_venchelt,um2,cant_bax,reteta_principala "+]+;
|
|
['from vcrm_politici_pret_art where 2=2']
|
|
pcorder1=[nume_articol]
|
|
pcfiltru1 = [1 = 2]
|
|
llAfiseaza = .F.
|
|
gencursor('popoliticiart','crspoliticiart',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
popoliticiart.ca_baza1.afisare()
|
|
|
|
ofrmpolitici=Createobject('frm_politici_pret')
|
|
ofrmpolitici.Show(1)
|
|
Release ofrmpolitici,popolitici,popoliticiart
|
|
Endproc && viz_politici
|
|
|
|
******************************************************************************************************************
|
|
Procedure viz_note_vanzari
|
|
Private poNote, poNoteIreg, pcschema1, pcselect1, pcschema2, pcselect2
|
|
Local llAfiseaza
|
|
Store .F. To llAfiseaza
|
|
Store '' To poNote, poNoteIreg
|
|
If Used('crsNote')
|
|
Use In crsNote
|
|
Endif
|
|
If Used('crsNoteIreg')
|
|
Use In crsNoteIreg
|
|
Endif
|
|
|
|
pcschema1=['']
|
|
pcselect1=['select * from vcrm_note_vanzari where 2=2']
|
|
pcorder1=[denumire]
|
|
pcfiltru1 = [1 = 2]
|
|
llAfiseaza = .F.
|
|
gencursor('poNote','crsNote',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
poNote.ca_baza1.afisare()
|
|
|
|
pcselect2 = ['select * from note_contabile where 2=2']
|
|
pcorder2 = [ordine]
|
|
pcfiltru2 = [1 = 2]
|
|
llAfiseaza = .F.
|
|
gencursor('poNoteIreg','crsNoteIreg',pcselect2,pcfiltru2,pcschema1,pcorder2,llAfiseaza)
|
|
poNoteIreg.ca_baza1.afisare()
|
|
|
|
Select crsNote
|
|
ofrmNote = Createobject('frm_note_vanzari')
|
|
ofrmNote.Show(1)
|
|
Release poNote
|
|
Release poNoteIreg
|
|
Endproc && viz_note_vanzari
|
|
***------------------------------------------------------------------------------------------------------------------------------
|
|
Procedure viz_categ_articole
|
|
|
|
Private poCateg, pcschema1, pcselect1
|
|
Local llAfiseaza
|
|
Store .F. To llAfiseaza
|
|
Store '' To poCateg
|
|
If Used('crsCateg')
|
|
Use In crsCateg
|
|
Endif
|
|
|
|
pcschema1=['id_categ N(5), denumire C(30), grup_sup C(100), id_tata N(5), tata C(100), id_nota N(10), den_nota C(30), scd C(4), ascd C(4), scc C(4), ascc C(4)']
|
|
pcselect1=['select id_categ, denumire, TRIM(SUBSTR(tata,1,INSTR(tata,CHR(92),1,nivel)-1)) as grup_sup, id_tata, tata, id_nota, den_nota, scd, ascd, scc, ascc from ]+gcS+[.vcrm_categ_note where 2=2']
|
|
pcorder1=[denumire]
|
|
pcfiltru1 = [1 = 2]
|
|
llAfiseaza = .F.
|
|
gencursor('poCateg','crsCateg',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
|
|
poCateg.ca_baza1.afisare()
|
|
|
|
Select crsCateg
|
|
ofrmCatArt = Createobject('frm_categ_articole')
|
|
ofrmCatArt.Show(1)
|
|
Release poCateg
|
|
|
|
Endproc && viz_categ_articole
|
|
***------------------------------------------------------------------------------------------------------------------------------
|
|
Function verifica_politica
|
|
Lparameters tnIdPol,tnTipOperatie
|
|
** tnTipOperatie = 1 - modificare
|
|
** = 2 - stergere
|
|
Local llReturn
|
|
Store .T. To llReturn
|
|
lcCursor = [crstestpol]
|
|
lcSql = [select to_number(varvalue) as id_pol from optiuni where varname = 'ID_POL_PRET_STOC']
|
|
lnSucces = goExecutor.oExecute(lcSql,lcCursor)
|
|
If lnSucces < 0
|
|
amessagebox(goExecutor.cEroare,16,"Eroare")
|
|
Else
|
|
If Reccount(lcCursor)>0
|
|
Select (lcCursor)
|
|
lnIdPol = id_pol
|
|
If lnIdPol = tnIdPol
|
|
llReturn = .F.
|
|
If tnTipOperatie = 1
|
|
lcMesaj = Chr(9) + Chr(9) + Chr(9) + Chr(9) + [Nu puteti modifica articolele de pe aceasta politica,] + Chr(13) + Chr(10) + ;
|
|
[deoarece este setata ca fiind politica de preturi pentru facturarea din stoc ( in ROAFACTURARE ) !]
|
|
Else
|
|
lcMesaj = Chr(9) + Chr(9) + Chr(9) + Chr(9) + [Nu puteti sterge aceasta politica,] + Chr(13) + Chr(10) + ;
|
|
[deoarece este setata ca fiind politica de preturi pentru facturarea din stoc ( in ROAFACTURARE ) !]
|
|
Endif
|
|
amessagebox(lcMesaj,48,"Atentie")
|
|
Endif
|
|
Endif
|
|
Endif
|
|
If Used(lcCursor)
|
|
Use In (lcCursor)
|
|
Endif
|
|
Return llReturn
|
|
Endfunc && verifica_politica
|