sync SVN r18152
This commit is contained in:
@@ -74,6 +74,10 @@
|
||||
*!* marius.mutu
|
||||
*!* + verifica_cont_venit_linie - verificare prietenoasa a contului de venit rezolvat pentru o linie
|
||||
*!* de factura, la adaugarea articolului
|
||||
*!* 17.09.2026
|
||||
*!* agent
|
||||
*!* cus_pret_nomenclator: conturi analitice (cAscd/cAscc) in nota de vanzare a articolului;
|
||||
*!* apelul RPC devine pack_preturi.gaseste_creeaza_nota_vanzare (overload 6 arg cu analitice)
|
||||
|
||||
***************************************************************************************************************
|
||||
**** Clase:
|
||||
@@ -2375,6 +2379,8 @@ Define Class cus_pret_nomenclator As Custom
|
||||
nIdNota = .NULL.
|
||||
cScd = []
|
||||
cScc = []
|
||||
cAscd = []
|
||||
cAscc = []
|
||||
cContDedus = []
|
||||
cEroare = []
|
||||
|
||||
@@ -2410,6 +2416,8 @@ Define Class cus_pret_nomenclator As Custom
|
||||
This.nIdNota = .NULL.
|
||||
This.cScd = []
|
||||
This.cScc = []
|
||||
This.cAscd = []
|
||||
This.cAscc = []
|
||||
This.cContDedus = []
|
||||
If This.asigura_politica() <= 0
|
||||
Return .F.
|
||||
@@ -2450,7 +2458,7 @@ Define Class cus_pret_nomenclator As Custom
|
||||
Use In crspolart
|
||||
Endif
|
||||
If !Isnull(This.nIdNota)
|
||||
lcSql = [select n.scd, n.scc from crm_note_vanzari v, note_contabile n ] + ;
|
||||
lcSql = [select n.scd, n.ascd, n.scc, n.ascc from crm_note_vanzari v, note_contabile n ] + ;
|
||||
[where v.id_nota = ] + Alltrim(Str(This.nIdNota)) + [ and n.id_set = v.id_set]
|
||||
If Used('crsnotapol')
|
||||
Use In crsnotapol
|
||||
@@ -2459,6 +2467,8 @@ Define Class cus_pret_nomenclator As Custom
|
||||
If lnSucces >= 0 And Reccount('crsnotapol') > 0
|
||||
This.cScd = Alltrim(Nvl(crsnotapol.scd,[]))
|
||||
This.cScc = Alltrim(Nvl(crsnotapol.scc,[]))
|
||||
This.cAscd = Alltrim(Nvl(crsnotapol.ascd,[]))
|
||||
This.cAscc = Alltrim(Nvl(crsnotapol.ascc,[]))
|
||||
Endif
|
||||
If Used('crsnotapol')
|
||||
Use In crsnotapol
|
||||
@@ -2482,11 +2492,20 @@ Define Class cus_pret_nomenclator As Custom
|
||||
* valideaza conturile si pretul curente; mesaj + .F. la refuz
|
||||
Procedure valideaza
|
||||
This.cEroare = []
|
||||
If (!Empty(This.cScd) And Empty(This.cScc)) Or (Empty(This.cScd) And !Empty(This.cScc))
|
||||
This.cEroare = [Trebuie completate ambele conturi (debit si credit) sau niciunul.]
|
||||
If !Empty(This.cAscd) And Empty(This.cScd)
|
||||
This.cEroare = [Contul analitic debitor nu poate fi completat fara contul sintetic debitor.]
|
||||
Else
|
||||
If This.nPretFtva < 0 Or This.nPretCtva < 0
|
||||
This.cEroare = [Pretul nu poate fi negativ.]
|
||||
If !Empty(This.cAscc) And Empty(This.cScc)
|
||||
This.cEroare = [Contul analitic creditor nu poate fi completat fara contul sintetic creditor.]
|
||||
Endif
|
||||
Endif
|
||||
If Empty(This.cEroare)
|
||||
If (!Empty(This.cScd) And Empty(This.cScc)) Or (Empty(This.cScd) And !Empty(This.cScc))
|
||||
This.cEroare = [Trebuie completate ambele conturi (debit si credit) sau niciunul.]
|
||||
Else
|
||||
If This.nPretFtva < 0 Or This.nPretCtva < 0
|
||||
This.cEroare = [Pretul nu poate fi negativ.]
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
If !Empty(This.cEroare)
|
||||
@@ -2505,14 +2524,16 @@ Define Class cus_pret_nomenclator As Custom
|
||||
Return .F.
|
||||
Endif
|
||||
If !Empty(This.cScd) And !Empty(This.cScc)
|
||||
Private pcScd, pcScc, pnIdUtil
|
||||
Private pcScd, pcScc, pcAscd, pcAscc, pnIdUtil
|
||||
pcScd = This.cScd
|
||||
pcScc = This.cScc
|
||||
pcAscd = This.cAscd
|
||||
pcAscc = This.cAscc
|
||||
pnIdUtil = gnIdUtil
|
||||
pnIdNota = 0
|
||||
lcSql = [begin pack_preturi.gaseste_sau_creeaza_nota_vanzare(?pcScd,?pcScc,?pnIdUtil,?@pnIdNota); end;]
|
||||
lcSql = [begin pack_preturi.gaseste_creeaza_nota_vanzare(?pcScd,?pcAscd,?pcScc,?pcAscc,?pnIdUtil,?@pnIdNota); end;]
|
||||
lnSucces = goExecutor.oExecute(lcSql)
|
||||
Release pcScd, pcScc, pnIdUtil
|
||||
Release pcScd, pcScc, pcAscd, pcAscc, pnIdUtil
|
||||
If lnSucces < 0
|
||||
AMESSAGEBOX(goExecutor.oPrelucrareEroare(),16,"Eroare")
|
||||
Release pnIdArticol, pnPretFtva, pnPretCtva, pnProcTvav, pnIdVenchelt, pnIdNota, pnScrieNota
|
||||
@@ -2555,7 +2576,9 @@ Define Class cus_pret_nomenclator As Custom
|
||||
Local lcSql, lnSucces
|
||||
This.cScd = []
|
||||
This.cScc = []
|
||||
lcSql = [select n.scd, n.scc from crm_politici_preturi p, crm_note_vanzari v, note_contabile n ] + ;
|
||||
This.cAscd = []
|
||||
This.cAscc = []
|
||||
lcSql = [select n.scd, n.ascd, n.scc, n.ascc from crm_politici_preturi p, crm_note_vanzari v, note_contabile n ] + ;
|
||||
[where p.id_pol = ] + Alltrim(Str(tnIdPol)) + [ and v.id_nota = p.id_nota and n.id_set = v.id_set]
|
||||
If Used('crsnotapolstoc')
|
||||
Use In crsnotapolstoc
|
||||
@@ -2564,6 +2587,8 @@ Define Class cus_pret_nomenclator As Custom
|
||||
If lnSucces >= 0 And Reccount('crsnotapolstoc') > 0
|
||||
This.cScd = Alltrim(Nvl(crsnotapolstoc.scd,[]))
|
||||
This.cScc = Alltrim(Nvl(crsnotapolstoc.scc,[]))
|
||||
This.cAscd = Alltrim(Nvl(crsnotapolstoc.ascd,[]))
|
||||
This.cAscc = Alltrim(Nvl(crsnotapolstoc.ascc,[]))
|
||||
Endif
|
||||
If Used('crsnotapolstoc')
|
||||
Use In crsnotapolstoc
|
||||
@@ -2573,8 +2598,10 @@ Define Class cus_pret_nomenclator As Custom
|
||||
|
||||
* valideaza (ambele conturi sau niciunul) si scrie nota implicita a politicii date
|
||||
Procedure salveaza_nota_politica
|
||||
Lparameters tnIdPol, tcScd, tcScc
|
||||
Lparameters tnIdPol, tcScd, tcScc, tcAscd, tcAscc
|
||||
Local lcSql, lnSucces
|
||||
tcAscd = Iif(Type('tcAscd')='C', tcAscd, [])
|
||||
tcAscc = Iif(Type('tcAscc')='C', tcAscc, [])
|
||||
If (!Empty(tcScd) And Empty(tcScc)) Or (Empty(tcScd) And !Empty(tcScc))
|
||||
This.cEroare = [Trebuie completate ambele conturi (debit si credit) sau niciunul.]
|
||||
AMESSAGEBOX(This.cEroare,0+48,"Atentie")
|
||||
@@ -2583,16 +2610,18 @@ Define Class cus_pret_nomenclator As Custom
|
||||
If Empty(tcScd) And Empty(tcScc)
|
||||
Return .T.
|
||||
Endif
|
||||
Private pcScd, pcScc, pnIdUtil, pnIdNota, pnIdPol
|
||||
Private pcScd, pcScc, pcAscd, pcAscc, pnIdUtil, pnIdNota, pnIdPol
|
||||
pcScd = tcScd
|
||||
pcScc = tcScc
|
||||
pcAscd = tcAscd
|
||||
pcAscc = tcAscc
|
||||
pnIdUtil = gnIdUtil
|
||||
pnIdNota = 0
|
||||
lcSql = [begin pack_preturi.gaseste_sau_creeaza_nota_vanzare(?pcScd,?pcScc,?pnIdUtil,?@pnIdNota); end;]
|
||||
lcSql = [begin pack_preturi.gaseste_creeaza_nota_vanzare(?pcScd,?pcAscd,?pcScc,?pcAscc,?pnIdUtil,?@pnIdNota); end;]
|
||||
lnSucces = goExecutor.oExecute(lcSql)
|
||||
If lnSucces < 0
|
||||
AMESSAGEBOX(goExecutor.oPrelucrareEroare(),16,"Eroare")
|
||||
Release pcScd, pcScc, pnIdUtil, pnIdNota, pnIdPol
|
||||
Release pcScd, pcScc, pcAscd, pcAscc, pnIdUtil, pnIdNota, pnIdPol
|
||||
Return .F.
|
||||
Endif
|
||||
pnIdPol = tnIdPol
|
||||
@@ -2601,7 +2630,7 @@ Define Class cus_pret_nomenclator As Custom
|
||||
If lnSucces < 0
|
||||
AMESSAGEBOX(goExecutor.oPrelucrareEroare(),16,"Eroare")
|
||||
Endif
|
||||
Release pcScd, pcScc, pnIdUtil, pnIdNota, pnIdPol
|
||||
Release pcScd, pcScc, pcAscd, pcAscc, pnIdUtil, pnIdNota, pnIdPol
|
||||
Return (lnSucces >= 0)
|
||||
Endproc && salveaza_nota_politica
|
||||
Enddefine
|
||||
|
||||
Reference in New Issue
Block a user