sync SVN r17998: pret cu TVA pe linie si editarea liniei la introducerea facturii
ofacturare.vc2: - frm_articol_factura: bifa "Pret cu TVA inclus" (preturi_cu_tva) editabila in dialogul per-articol; activa doar pe tipurile unde pretul e editabil. - frm_facturare_articole: buton de modificare deasupra listei + dublu-clic pe linie, ambele redeschid dialogul pe linia curenta (do_modifica); Renunta lasa randul neschimbat. - Plafonul de cantitate la modificare se recalculeaza din stocul disponibil (reversul decrementarii din do_adauga_articol), nu ramane la cantitatea aflata deja pe linie. - Articolele gestionabile: modificarea redeschide tabelul cu gestiuni, pozitionat pe gestiunea liniei; do_alege_stoc primeste tnIdTempExclus, ca linia sa nu se scada pe ea insasi din stoc. Multi-selectia actualizeaza linia si adauga restul ca linii noi. - frm_articol_gest_factura: bifa era desenata sub grd_gestiuni; forma inaltata si bifa mutata sub grid. ofacturare_comun.vc2: scos un SET STEP ON ramas in cod. docs/testare-ui-vfp.md: sectiune noua despre conducerea dialogurilor modale Show(1) din teste (Timer pe _SCREEN, detectie prin _SCREEN.Forms, inchidere prin do_termin/do_renunt) si capcanele platite pe parcurs. Testat headless: Nivel 1 dialog 14 asertii, Nivel 2 factura in compunere 7, Nivel 2 retur 4, Nivel 3 ramura gestionabila 13 - toate PASS, zero FAIL. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN8snvkk94KuhWwoXUUey3
This commit is contained in:
@@ -1131,8 +1131,10 @@ DEFINE CLASS frm_articol_factura AS _frmbase OF "_frm_base.vcx"
|
||||
*< OBJECTDATA: ObjPath="Clb_serie" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="Ed_tx_explicatie" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="cb_explicatie_saft" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="ck_pret_cu_tva" UniqueID="" Timestamp="" />
|
||||
|
||||
*<DefinedPropArrayMethod>
|
||||
*m: do_aplica_mod_pret
|
||||
*m: do_calculeaza_adaos
|
||||
*m: do_calculeaza_discount
|
||||
*m: do_calculeaza_pretctva
|
||||
@@ -1155,7 +1157,7 @@ DEFINE CLASS frm_articol_factura AS _frmbase OF "_frm_base.vcx"
|
||||
BorderStyle = 1
|
||||
Caption = "Form"
|
||||
DoCreate = .T.
|
||||
Height = 450
|
||||
Height = 500
|
||||
larata = .T.
|
||||
lcuadaos = .T.
|
||||
lmodpretctva = .F.
|
||||
@@ -1284,6 +1286,16 @@ DEFINE CLASS frm_articol_factura AS _frmbase OF "_frm_base.vcx"
|
||||
_lbbase1.Top = 6
|
||||
*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
|
||||
|
||||
ADD OBJECT 'ck_pret_cu_tva' AS _checkbox WITH ;
|
||||
Alignment = 0, ;
|
||||
Caption = "Pret cu TVA inclus", ;
|
||||
ControlSource = "poArticol.preturi_cu_tva", ;
|
||||
Left = 6, ;
|
||||
Name = "ck_pret_cu_tva", ;
|
||||
TabIndex = 24, ;
|
||||
Top = 464
|
||||
*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />
|
||||
|
||||
ADD OBJECT 'clb_articol' AS clb_tx_simplu WITH ;
|
||||
Left = 6, ;
|
||||
Name = "clb_articol", ;
|
||||
@@ -1792,6 +1804,51 @@ DEFINE CLASS frm_articol_factura AS _frmbase OF "_frm_base.vcx"
|
||||
_lbbase1.Top = 6
|
||||
*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
|
||||
|
||||
PROCEDURE do_aplica_mod_pret
|
||||
Lparameters lnTip && 1 = sume in lei, 2 = sume in valuta
|
||||
If Inlist(poDate.tip,1,5,10,22,23,25,29,41) && documente pe baza de lista de preturi (1/5 factura lei si valuta, 10 factura fiscala in valuta, 22 aviz clienti, 23/25/41 transfer subunitati, 29 aviz clienti debitori): pretul e editabil oricum, pe restul doar daca e 0
|
||||
If poArticol.preturi_cu_tva = 0
|
||||
Thisform.lmodpretftva = .T.
|
||||
Thisform.clb_pretftva.do_activeaza(lnTip)
|
||||
Else
|
||||
Thisform.lmodpretctva = .T.
|
||||
Thisform.clb_pretctva.do_activeaza(lnTip)
|
||||
Endif
|
||||
Else
|
||||
If Type('Thisform.clb_procent_adaos') = 'O'
|
||||
Thisform.clb_procent_adaos.Visible = .F.
|
||||
Endif
|
||||
Thisform.lcuadaos = .F.
|
||||
If poArticol.preturi_cu_tva = 0 And ;
|
||||
((poArticol.pretftva = 0 And lnTip = 1) Or (poArticol.pretftva_val = 0 And lnTip = 2))
|
||||
Thisform.lmodpretftva = .T.
|
||||
Thisform.clb_pretftva.do_activeaza(lnTip)
|
||||
Else
|
||||
If poArticol.preturi_cu_tva = 1 And ;
|
||||
((poArticol.pretctva = 0 And lnTip = 1) Or (poArticol.pretctva_val = 0 And lnTip = 2))
|
||||
Thisform.lmodpretctva = .T.
|
||||
Thisform.clb_pretctva.do_activeaza(lnTip)
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
|
||||
If poArticol.preturi_cu_tva = 0
|
||||
Thisform.clb_discount_unitar.do_activeaza(lnTip)
|
||||
Thisform.clb_totalfdiscount.lb_explicatii.Caption = []
|
||||
Thisform.clb_totalcdiscount.lb_explicatii.Caption = []
|
||||
Thisform.clb_pret_diminuat.lb_explicatii.Caption = [(2) - (5)]
|
||||
Else
|
||||
Thisform.clb_discountctva.do_activeaza(lnTip)
|
||||
Thisform.clb_totalfdiscount.lb_explicatii.Caption = [(1) * (4)]
|
||||
Thisform.clb_totalcdiscount.lb_explicatii.Caption = [(1) * ( (4) - (7) )]
|
||||
With Thisform.clb_pret_diminuat
|
||||
.lb_explicatie.Caption = [Pret unitar diminuat cu TVA]
|
||||
.lb_explicatii.Caption = [(4) - (7)]
|
||||
Endwith
|
||||
Endif
|
||||
Thisform.ck_pret_cu_tva.Enabled = (Thisform.lmodpretftva Or Thisform.lmodpretctva)
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE do_calculeaza_adaos
|
||||
Lparameters tnValoare,tnTip
|
||||
If Thisform.lcuadaos
|
||||
@@ -2364,54 +2421,7 @@ DEFINE CLASS frm_articol_factura AS _frmbase OF "_frm_base.vcx"
|
||||
*!* *!* modificare v 2.0.46 ^
|
||||
*!* modificare v 2.0.74 ^
|
||||
|
||||
*!* modificare v 2.0.4
|
||||
*!* If Iif(Type('poArticol.modificabil')<>'U',poArticol.modificabil,0) = 1
|
||||
*!* modificare v 2.0.30 : am adaugat 41
|
||||
*!* modificare v 2.0.44 : am adaugat 42
|
||||
*!* If Inlist(poDate.tip,1,3,5,21,22,23,25,28,29,41,42)
|
||||
If Inlist(poDate.tip,1,5,10,22,23,25,29,41) && modificare v 2.0.56 : am adaugat 10
|
||||
*!* modificare v 2.0.4 ^
|
||||
If poArticol.preturi_cu_tva = 0
|
||||
Thisform.lmodpretftva = .T.
|
||||
Thisform.clb_pretftva.do_activeaza(lnTip)
|
||||
Else
|
||||
Thisform.lmodpretctva = .T.
|
||||
*!* modificare v 2.0.4
|
||||
*!* Thisform.RemoveObject('clb_procent_adaos')
|
||||
*!* thisform.lcuadaos = .F.
|
||||
*!* modificare v 2.0.4 ^
|
||||
Thisform.clb_pretctva.do_activeaza(lnTip)
|
||||
Endif
|
||||
Else
|
||||
Thisform.clb_procent_adaos.Visible = .F.
|
||||
Thisform.lcuadaos = .F.
|
||||
If poArticol.preturi_cu_tva = 0 And ;
|
||||
((poArticol.pretftva = 0 And lnTip = 1) Or (poArticol.pretftva_val = 0 And lnTip = 2))
|
||||
Thisform.lmodpretftva = .T.
|
||||
Thisform.clb_pretftva.do_activeaza(lnTip)
|
||||
Else
|
||||
If poArticol.preturi_cu_tva = 1 And ;
|
||||
((poArticol.pretctva = 0 And lnTip = 1) Or (poArticol.pretctva_val = 0 And lnTip = 2))
|
||||
Thisform.lmodpretctva = .T.
|
||||
Thisform.clb_pretctva.do_activeaza(lnTip)
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
|
||||
If poArticol.preturi_cu_tva = 0
|
||||
Thisform.clb_discount_unitar.do_activeaza(lnTip)
|
||||
Thisform.clb_totalfdiscount.lb_explicatii.Caption = []
|
||||
Thisform.clb_totalcdiscount.lb_explicatii.Caption = []
|
||||
Thisform.clb_pret_diminuat.lb_explicatii.Caption = [(2) - (5)]
|
||||
Else
|
||||
Thisform.clb_discountctva.do_activeaza(lnTip)
|
||||
Thisform.clb_totalfdiscount.lb_explicatii.Caption = [(1) * (4)]
|
||||
Thisform.clb_totalcdiscount.lb_explicatii.Caption = [(1) * ( (4) - (7) )]
|
||||
With Thisform.clb_pret_diminuat
|
||||
.lb_explicatie.Caption = [Pret unitar diminuat cu TVA]
|
||||
.lb_explicatii.Caption = [(4) - (7)]
|
||||
Endwith
|
||||
Endif
|
||||
Thisform.do_aplica_mod_pret(lnTip)
|
||||
|
||||
*!* modificare v 2.0.19
|
||||
*!* If (poDate.tip=2 And pnTipFacturare=3) Or INLIST(poDate.tip,4,23)
|
||||
@@ -2570,6 +2580,19 @@ DEFINE CLASS frm_articol_factura AS _frmbase OF "_frm_base.vcx"
|
||||
Thisform.UpdateExplicatieSaft()
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE ck_pret_cu_tva.InteractiveChange
|
||||
Local lnTip
|
||||
poArticol.preturi_cu_tva = This.Value
|
||||
lnTip = Iif(poArticol.tip_valuta = 0, 1, 2)
|
||||
If This.Value = 1
|
||||
Thisform.do_calculeaza_pretftva(Iif(lnTip = 1, poArticol.pretctva, poArticol.pretctva_val), lnTip)
|
||||
Else
|
||||
Thisform.do_calculeaza_pretctva(Iif(lnTip = 1, poArticol.pretftva, poArticol.pretftva_val), lnTip)
|
||||
Endif
|
||||
Thisform.do_aplica_mod_pret(lnTip)
|
||||
Thisform.do_calculeaza_totaluri()
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE clb_cantitate.Text_simplu1.InteractiveChange
|
||||
lcval=This.ControlSource
|
||||
&lcval=This.Value
|
||||
@@ -3146,7 +3169,7 @@ DEFINE CLASS frm_articol_gest_factura AS frm_articol_factura OF "ofacturare.vcx"
|
||||
*<PropValue>
|
||||
cgridsortlist = grd_gestiuni
|
||||
DoCreate = .T.
|
||||
Height = 510
|
||||
Height = 546
|
||||
lretur = .F.
|
||||
Name = "frm_articol_gest_factura"
|
||||
Width = 835
|
||||
@@ -3398,6 +3421,9 @@ DEFINE CLASS frm_articol_gest_factura AS frm_articol_factura OF "ofacturare.vcx"
|
||||
Cb_contract._cbbase1.Top = 3
|
||||
Cb_contract._cbbase1.Width = 274
|
||||
Cb_contract._lbbase1.Name = "_lbbase1"
|
||||
ck_pret_cu_tva.Left = 13
|
||||
ck_pret_cu_tva.Name = "ck_pret_cu_tva"
|
||||
ck_pret_cu_tva.Top = 510
|
||||
*</PropValue>
|
||||
|
||||
ADD OBJECT 'Cb_tx_articol' AS cb_tx_cautare WITH ;
|
||||
@@ -11048,6 +11074,7 @@ DEFINE CLASS frm_facturare_articole AS _frmbase OF "_frm_base.vcx"
|
||||
*< OBJECTDATA: ObjPath="grd_contracte.cNumar_contract.Text1" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="grd_contracte.cCodbare.Header1" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="grd_contracte.cCodbare.Text1" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="lb_total_mod" UniqueID="" Timestamp="" />
|
||||
*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
|
||||
@@ -11162,6 +11189,16 @@ DEFINE CLASS frm_facturare_articole AS _frmbase OF "_frm_base.vcx"
|
||||
Gridsort1.Top = 36
|
||||
*</PropValue>
|
||||
|
||||
ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
|
||||
Anchor = 9, ;
|
||||
caction = do_modifica, ;
|
||||
Left = 773, ;
|
||||
Name = "But_modifica1", ;
|
||||
TabIndex = 13, ;
|
||||
Top = 61, ;
|
||||
Visible = .T.
|
||||
*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />
|
||||
|
||||
ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
|
||||
Anchor = 8, ;
|
||||
Height = 27, ;
|
||||
@@ -13161,12 +13198,15 @@ DEFINE CLASS frm_facturare_articole AS _frmbase OF "_frm_base.vcx"
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE do_alege_stoc
|
||||
Lparameters tnIdArticol,tnCantitate,tcNumeArticol,tlImplicit,tnPret,tnDiscount,toGrid, tlRetur
|
||||
Lparameters tnIdArticol,tnCantitate,tcNumeArticol,tlImplicit,tnPret,tnDiscount,toGrid, tlRetur, tnIdTempExclus
|
||||
* llImplicit => vezi thisform.do_adauga
|
||||
* tnPret => doar pentru retururi : e pretul de vanzare fara TVA
|
||||
* toGrid => gridul din care vine articolul
|
||||
* tlRetur => factura normala cu articol retur (nu factura de retur tip 8,9). se comporta la fel ca factura de retur. se selecteaza din RUL, dar nu stiu factura din care fac retur
|
||||
|
||||
* tnIdTempExclus => id_temp-ul liniei modificate, exclus din cantitatea deja retinuta pe factura (0 la adaugare)
|
||||
If Type('tnIdTempExclus') <> 'N'
|
||||
tnIdTempExclus = 0
|
||||
Endif
|
||||
Private pnIdArticol
|
||||
Local llReturn,lofrmadarticol,lcSql, llFacturareFaraStoc
|
||||
llFactuareFaraStoc = .F.
|
||||
@@ -13232,7 +13272,7 @@ DEFINE CLASS frm_facturare_articole AS _frmbase OF "_frm_base.vcx"
|
||||
* Arat cantitatile din stoc - cantitatile deja pe factura curenta
|
||||
Select Iif(poDate.tip=41,-1,1)*Sum(cantitate) As cantitate,id_articol,id_gestiune,pret_achizitie,serie,lot,Cont, ;
|
||||
id_part_rez,id_lucrare_rez,pretv_orig,pretd,id_valuta_d ;
|
||||
FROM crsfactura Where id_articol = pnIdArticol ;
|
||||
FROM crsfactura Where id_articol = pnIdArticol And id_temp <> tnIdTempExclus ;
|
||||
GROUP By id_articol,id_gestiune,pret_achizitie,serie,lot,Cont,id_part_rez,id_lucrare_rez,pretv_orig,pretd,id_valuta_d ;
|
||||
INTO CURSOR crsFacturaArticoleTemp
|
||||
|
||||
@@ -13275,6 +13315,12 @@ DEFINE CLASS frm_facturare_articole AS _frmbase OF "_frm_base.vcx"
|
||||
|
||||
SELECT (m.lcCursor)
|
||||
Go Top
|
||||
If tnIdTempExclus > 0
|
||||
Locate For id_gestiune = poArticol.id_gestiune And Pret = poArticol.pret_achizitie And Cont = poArticol.Cont And Nvl(serie,'') = Nvl(poArticol.serie,'') And Nvl(lot,'') = Nvl(poArticol.lot,'') And Nvl(id_part_rez,0) = Nvl(poArticol.id_part_rez,0) And Nvl(id_lucrare_rez,0) = Nvl(poArticol.id_lucrare_rez,0) And pretv = poArticol.pretv_orig And pretd = poArticol.pretd And Nvl(id_valuta,0) = Nvl(poArticol.id_valuta_d,0)
|
||||
If !Found()
|
||||
Go Top
|
||||
Endif
|
||||
Endif
|
||||
Do Case
|
||||
Case Reccount(lcCursor) = 0
|
||||
amessagebox("Articolul "+Alltrim(tcNumeArticol)+" nu mai este pe stoc!",0+48,"Atentie")
|
||||
@@ -13697,6 +13743,176 @@ DEFINE CLASS frm_facturare_articole AS _frmbase OF "_frm_base.vcx"
|
||||
*!* modificare v 2.0.67 ^
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE do_modifica
|
||||
If Reccount('crsfactura')>0
|
||||
Private poArticol, pnProcentDiscountMem
|
||||
Local lnRecno, ofrmadarticol
|
||||
Select crsfactura
|
||||
lnRecno = Recno()
|
||||
Scatter Name poArticol MEMO
|
||||
|
||||
AddProperty(poArticol,'preturi_cu_tva',poArticol.cu_tva)
|
||||
AddProperty(poArticol,'discount_unitar',poArticol.discountftva)
|
||||
AddProperty(poArticol,'discount_unitar_ctva',poArticol.discountctva)
|
||||
AddProperty(poArticol,'pretftva_val',poArticol.vpretftva)
|
||||
AddProperty(poArticol,'pretctva_val',poArticol.vpretctva)
|
||||
AddProperty(poArticol,'discount_unitar_val',poArticol.vdiscountftva)
|
||||
AddProperty(poArticol,'discount_unitar_ctva_val',poArticol.vdiscountctva)
|
||||
Removeproperty(poArticol,'cu_tva')
|
||||
Removeproperty(poArticol,'discountftva')
|
||||
Removeproperty(poArticol,'discountctva')
|
||||
Removeproperty(poArticol,'vpretftva')
|
||||
Removeproperty(poArticol,'vpretctva')
|
||||
Removeproperty(poArticol,'vdiscountftva')
|
||||
Removeproperty(poArticol,'vdiscountctva')
|
||||
AddProperty(poArticol,'tva',poArticol.pretctva - poArticol.pretftva)
|
||||
AddProperty(poArticol,'tva_val',poArticol.pretctva_val - poArticol.pretftva_val)
|
||||
|
||||
pnProcentDiscountMem = 0
|
||||
If Nvl(gnMemProcDisc, 0) = 1
|
||||
pnProcentDiscountMem = Thisform.nproc_disc_mem
|
||||
Endif
|
||||
* plafonul de cantitate = stocul disponibil reconstituit din cursorul sursa; fara randul in cursor ramane cantitatea liniei
|
||||
Local lnCantitateMax, lcCursorStoc, lcAliasCrt, lnRecnoStoc, lnCantitateVeche, lnIdTempLinie, lnDeltaCantitate, lnTotalCantitate
|
||||
lnCantitateMax = poArticol.cantitate
|
||||
lcCursorStoc = Iif(poArticol.opt_facturare = 0, [crsarticole], [crsarticole1])
|
||||
If Used(lcCursorStoc)
|
||||
lcAliasCrt = Alias()
|
||||
Select (lcCursorStoc)
|
||||
lnRecnoStoc = Recno()
|
||||
Locate For id_c = poArticol.id_c
|
||||
If Found()
|
||||
Do Case
|
||||
Case (gnScadereStoc = 1 And poDate.tip = 23) Or Inlist(poDate.tip, 4, 21, 28, 42, 47) && adaugarea scade stocul; lista e cea validata la plafon (fara 3 si 25): 23 transfer subunitati, 4 din avize, 21/28/42/47 catre clienti
|
||||
lnCantitateMax = cantitate + poArticol.cantitate
|
||||
Case Inlist(poDate.tip, 8, 9, 24) && adaugarea creste stocul: 8/9 retur factura in lei si in valuta, 24 aviz de retur
|
||||
lnCantitateMax = cantitate - poArticol.cantitate
|
||||
Endcase
|
||||
Endif
|
||||
Try
|
||||
Go lnRecnoStoc
|
||||
Catch
|
||||
Go Top
|
||||
Endtry
|
||||
Select (lcAliasCrt)
|
||||
Endif
|
||||
|
||||
gnButon = 2
|
||||
lnCantitateVeche = poArticol.cantitate
|
||||
lnIdTempLinie = poArticol.id_temp
|
||||
Do Case
|
||||
Case (poArticol.gestionabil = 0 Or gnScadereStoc = 0 Or poDate.tip = 45) && 45 = ROARESTAURANT
|
||||
ofrmadarticol = Createobject("frm_articol_factura", lnCantitateMax, .F.)
|
||||
ofrmadarticol.Show(1)
|
||||
Release ofrmadarticol
|
||||
Otherwise
|
||||
Thisform.do_alege_stoc(poArticol.id_articol, lnCantitateMax, poArticol.denumire, .F., poArticol.pretftva, poArticol.discount_unitar, Thisform.grd_factura, .F., lnIdTempLinie)
|
||||
Endcase
|
||||
If gnButon = 1
|
||||
Select crsfactura
|
||||
Try
|
||||
Go lnRecno
|
||||
Catch
|
||||
Go Top
|
||||
Endtry
|
||||
If Used('crsartselectate')
|
||||
lnTotalCantitate = poArticol.cantitate
|
||||
Select crsartselectate
|
||||
Go Top
|
||||
poArticol.pret_achizitie = Pret
|
||||
poArticol.serie = Nvl(serie, [])
|
||||
poArticol.lot = Nvl(lot, [])
|
||||
poArticol.id_gestiune = id_gestiune
|
||||
poArticol.Cont = Alltrim(Cont)
|
||||
poArticol.cantitate = cantitate
|
||||
poArticol.pretv_orig = pretv
|
||||
poArticol.id_lucrare_rez = id_lucrare_rez
|
||||
poArticol.id_part_rez = id_part_rez
|
||||
poArticol.pretd = pretd
|
||||
poArticol.id_valuta_d = id_valuta
|
||||
Select crsfactura
|
||||
Endif
|
||||
Gather Name poArticol Fields Like pret_achizitie, denumire, cantitate, id_articol, Id_Pol, Cont, id_gestiune, Proc_Tvav, ;
|
||||
pretftva, valftva, valtva, valctva, valdiscountftva, valdiscounttva, valdiscountctva, Pretctva, ;
|
||||
valdiminuatftva, valdiminuattva, valdiminuatctva, ;
|
||||
vvalftva, vvaltva, vvalctva, vvaldiscountftva, vvaldiscounttva, vvaldiscountctva, ;
|
||||
vvaldiminuatftva, vvaldiminuattva, vvaldiminuatctva, id_c, lot, serie, explicatie, ;
|
||||
id_valuta, gestionabil, tip_valuta, id_jtva_coloana, taxcode, id_lucrare_rez, id_part_rez, pretv_orig, pretd, id_valuta_d, id_ctr, opt_facturare, nume_val MEMO
|
||||
Replace cu_tva With poArticol.preturi_cu_tva, ;
|
||||
discountftva With poArticol.discount_unitar, discountctva With poArticol.discount_unitar_ctva, ;
|
||||
vpretftva With Nvl(poArticol.pretftva_val,0), vpretctva With Nvl(poArticol.pretctva_val,0), ;
|
||||
vdiscountftva With Nvl(poArticol.discount_unitar_val,0), vdiscountctva With Nvl(poArticol.discount_unitar_ctva_val,0)
|
||||
If Used('crsartselectate')
|
||||
Select crsartselectate
|
||||
Skip
|
||||
Scan Rest
|
||||
poArticol.pret_achizitie = Pret
|
||||
poArticol.serie = Nvl(serie, [])
|
||||
poArticol.lot = Nvl(lot, [])
|
||||
poArticol.id_gestiune = id_gestiune
|
||||
poArticol.Cont = Alltrim(Cont)
|
||||
poArticol.cantitate = cantitate
|
||||
poArticol.pretv_orig = pretv
|
||||
poArticol.id_lucrare_rez = id_lucrare_rez
|
||||
poArticol.id_part_rez = id_part_rez
|
||||
poArticol.pretd = pretd
|
||||
poArticol.id_valuta_d = id_valuta
|
||||
Select crsfactura
|
||||
Append Blank
|
||||
Gather Name poArticol Fields Like pret_achizitie, denumire, cantitate, id_articol, Id_Pol, ;
|
||||
Cont, id_gestiune, Proc_Tvav, pretftva, Pretctva, ;
|
||||
id_c, lot, serie, explicatie, ;
|
||||
id_valuta, gestionabil, tip_valuta, id_jtva_coloana, taxcode, id_lucrare_rez, id_part_rez, pretv_orig, pretd, id_valuta_d, nume_val, id_ctr, opt_facturare MEMO
|
||||
Replace id_temp With Recno(), codmat With Nvl(poArticol.codmat, Space(50)), ;
|
||||
codbare With Nvl(poArticol.codbare, Space(50)), ;
|
||||
codmatf With Nvl(poArticol.codmatf, Space(50)), um With Nvl(poArticol.um, Space(50)), ;
|
||||
Curs With Nvl(poArticol.Curs, 0), multiplicator With Nvl(poArticol.multiplicator, 1), ;
|
||||
cu_tva With poArticol.preturi_cu_tva, ;
|
||||
vpretftva With Nvl(poArticol.pretftva_val, 0), vpretctva With Nvl(poArticol.pretctva_val, 0), ;
|
||||
discountftva With poArticol.discount_unitar, discountctva With poArticol.discount_unitar_ctva, ;
|
||||
vdiscountftva With Nvl(poArticol.discount_unitar_val, 0), ;
|
||||
vdiscountctva With Nvl(poArticol.discount_unitar_ctva_val, 0)
|
||||
poArticol = calculeaza_totaluri(poArticol)
|
||||
Gather Name poArticol Fields Like valftva, valtva, valctva, ;
|
||||
valdiscountftva, valdiscounttva, valdiscountctva, ;
|
||||
valdiminuatftva, valdiminuattva, valdiminuatctva, ;
|
||||
vvalftva, vvaltva, vvalctva, ;
|
||||
vvaldiscountftva, vvaldiscounttva, vvaldiscountctva, ;
|
||||
vvaldiminuatftva, vvaldiminuattva, vvaldiminuatctva MEMO
|
||||
Endscan
|
||||
Use In crsartselectate
|
||||
poArticol.cantitate = lnTotalCantitate
|
||||
Select crsfactura
|
||||
Endif
|
||||
lnDeltaCantitate = poArticol.cantitate - lnCantitateVeche
|
||||
If lnDeltaCantitate <> 0 And Used(lcCursorStoc)
|
||||
lcAliasCrt = Alias()
|
||||
Select (lcCursorStoc)
|
||||
lnRecnoStoc = Recno()
|
||||
Do Case
|
||||
Case (gnScadereStoc = 1 And poDate.tip = 23) Or Inlist(poDate.tip, 4, 21, 28, 42, 47)
|
||||
Replace cantitate With cantitate - lnDeltaCantitate For id_c = poArticol.id_c
|
||||
Case Inlist(poDate.tip, 8, 9, 24)
|
||||
Replace cantitate With cantitate + lnDeltaCantitate For id_c = poArticol.id_c
|
||||
Endcase
|
||||
Try
|
||||
Go lnRecnoStoc
|
||||
Catch
|
||||
Go Top
|
||||
Endtry
|
||||
Select (lcAliasCrt)
|
||||
Endif
|
||||
If Nvl(gnMemProcDisc, 0) = 1
|
||||
Thisform.nproc_disc_mem = pnProcentDiscountMem
|
||||
Endif
|
||||
Thisform.do_calculeaza_totaluri()
|
||||
Thisform.grd_factura.Refresh()
|
||||
Thisform.grd_factura.SetFocus()
|
||||
Endif
|
||||
Release poArticol, pnProcentDiscountMem
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE do_renunt
|
||||
*!* modificare 19.01.2007
|
||||
DODEFAULT()
|
||||
@@ -15512,6 +15728,10 @@ DEFINE CLASS frm_facturare_articole AS _frmbase OF "_frm_base.vcx"
|
||||
*Nu sterge
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE grd_factura.DblClick
|
||||
Thisform.do_modifica()
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE grd_factura.Init
|
||||
*Nu sterge
|
||||
ENDPROC
|
||||
|
||||
Reference in New Issue
Block a user