sync SVN r18195
This commit is contained in:
@@ -12170,16 +12170,31 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
|
||||
PROCEDURE actualizeazalipsurirandcurent
|
||||
*!* ponytail: reevaluarea se face la parasirea randului si la import, nu la fiecare tasta - se muta pe fiecare handler de editare de linie daca deranjeaza
|
||||
Local loCoada, lcLipsuri, llEraLipsuri
|
||||
LPARAMETERS tnIdRand
|
||||
Local loCoada, lcLipsuri, lcGest, llEraLipsuri, lnRecnoIntoarcere
|
||||
If !Used('crsFacturi') Or Eof('crsFacturi')
|
||||
Return
|
||||
Endif
|
||||
loCoada = Createobject('CoadaContabilizareEF')
|
||||
*!* calculul poate ceda controlul (interogare), deci se face inainte de mutarea pointerului, ca grila sa nu se redeseneze pe alt rand
|
||||
lcLipsuri = loCoada.LipsuriDetalii('crsDetaliiFacturi', gnEFACTURA_ID_GESTIUNE_P)
|
||||
lcGest = Iif(loCoada.Ruta('crsDetaliiFacturi') = 2, 'G', '')
|
||||
Select crsFacturi
|
||||
lnRecnoIntoarcere = 0
|
||||
If !Empty(Nvl(m.tnIdRand,0)) And Nvl(id,0) <> m.tnIdRand
|
||||
lnRecnoIntoarcere = Recno('crsFacturi')
|
||||
Locate For Nvl(id,0) = m.tnIdRand
|
||||
If !Found()
|
||||
Try
|
||||
Go m.lnRecnoIntoarcere In crsFacturi
|
||||
Catch
|
||||
Endtry
|
||||
Return
|
||||
Endif
|
||||
Endif
|
||||
llEraLipsuri = (Left(Alltrim(Nvl(motiv_lot,'')), 13) == 'de completat:')
|
||||
Replace de_completat With m.lcLipsuri In crsFacturi
|
||||
Replace gest With Iif(loCoada.Ruta('crsDetaliiFacturi') = 2, 'G', '') In crsFacturi
|
||||
Replace gest With m.lcGest In crsFacturi
|
||||
If !Empty(m.lcLipsuri)
|
||||
If Nvl(eligibil_lot,1) = 1
|
||||
Replace eligibil_lot With 0, ales With 0, motiv_lot With 'de completat: ' + m.lcLipsuri In crsFacturi
|
||||
@@ -12189,6 +12204,12 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
Replace eligibil_lot With 1, motiv_lot With '' In crsFacturi
|
||||
Endif
|
||||
Endif
|
||||
If !Empty(m.lnRecnoIntoarcere)
|
||||
Try
|
||||
Go m.lnRecnoIntoarcere In crsFacturi
|
||||
Catch
|
||||
Endtry
|
||||
Endif
|
||||
ENDPROC
|
||||
|
||||
PROCEDURE actualizeazarandimportat
|
||||
@@ -12611,7 +12632,7 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
*!* daca firma nu are TVA la Incasare si este o factura de achizitie, verific daca furnizorul are TVA la incasare
|
||||
|
||||
Local lcCodFiscal, lcCont, lcNumarAct, lcPartenerROA, lcSerieAct, llPrimite, llRTVAI, llSucces, llNecompletat
|
||||
Local lnIdPartROA, lnInValuta, lnNrAct, lnTvaIncasare, loFactura, loRezolvare, loRezPartener, lcDetalii
|
||||
Local lnIdPartROA, lnInValuta, lnNrAct, lnTvaIncasare, loFactura, loRezolvare, loRezPartener
|
||||
Local lcCodFiscalROA, lcNrAct, lcSql, lnIdSectie, lnIdVenChelt, loSectie, loVenchelt, lnCand
|
||||
|
||||
Private pcCodValuta, pnCurs, pnIdEFactura, pnIdValuta, pdDataAct
|
||||
@@ -12634,7 +12655,6 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
Select crsFacturi
|
||||
Scatter Name loFactura MEMO
|
||||
llNecompletat = (crsFacturi.completat = 0)
|
||||
lcDetalii = NVL(loFactura.detalii, '')
|
||||
|
||||
* Fac vizibila bifa de distribuie discount daca efactura are discount global
|
||||
This.chkDistribuieDiscount.Value = (Nvl(loFactura.discount_fara_tva, 0) <> 0 or Nvl(loFactura.taxe_fara_tva, 0) <> 0)
|
||||
@@ -12680,7 +12700,7 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
Select crsFacturi
|
||||
Replace IdValutaROA With m.pnIdValuta, NumeValutaROA With m.pcCodValuta
|
||||
|
||||
llSucces = goExecutor.oSelecteaza2Value("SELECT last_value(curs) over (partition by id_valuta order by data DESC) FROM CURS WHERE ?pdDataAct BETWEEN DATA AND DATA2", @pnCurs)
|
||||
llSucces = goExecutor.oSelecteaza2Value("SELECT last_value(curs) over (partition by id_valuta order by data DESC) FROM CURS WHERE ?pdDataAct BETWEEN DATA AND DATA2 AND ID_VALUTA = ?pnIdValuta AND NVL(STERS, 0) = 0", @pnCurs)
|
||||
If !m.llSucces
|
||||
Return
|
||||
Endif
|
||||
@@ -12746,20 +12766,6 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
Replace completat With 1
|
||||
|
||||
|
||||
***************
|
||||
****************************************************************************
|
||||
* Actualizez si anaf_efactura.detalii
|
||||
* Aduc si xml efactura din anaf_efactura.detalii doar pentru factura curenta, pentru ca dureaza prea mult sa aduc pentru toate facturile
|
||||
***************
|
||||
IF EMPTY(m.lcDetalii)
|
||||
lcSql = [select detalii from anaf_efactura where id = ] + ALLTRIM(STR(m.pnIdEFactura))
|
||||
llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @lcDetalii)
|
||||
IF m.llSucces
|
||||
SELECT crsFacturi
|
||||
REPLACE detalii WITH m.lcDetalii
|
||||
ENDIF
|
||||
ENDIF
|
||||
***************
|
||||
|
||||
With This
|
||||
.txtSerieAct.Refresh
|
||||
@@ -13569,7 +13575,10 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
|
||||
Create Cursor cDetaliiDiscTaxeTemp (valoare N(20,6), procentTVA N(5,2), discount N(1), motivdiscount V(200), motivdiscountcod V(50)) && discount : discount = 1 / taxe : discount = 0
|
||||
If m.lnDiscountFaraTVA <> 0 OR m.lnTaxeFaraTVA <> 0
|
||||
lcDetalii = loFactura.detalii
|
||||
lcDetalii = Nvl(loFactura.detalii, '')
|
||||
If Empty(m.lcDetalii)
|
||||
goExecutor.oSelecteaza2Value([select detalii from anaf_efactura where id = ] + Alltrim(Str(Nvl(loFactura.Id, 0))), @lcDetalii)
|
||||
Endif
|
||||
loFactParse = ParseEfactura(m.lcDetalii, .T.)
|
||||
|
||||
lcXmlDisc = loFactParse.FacturaDetaliiDisc
|
||||
@@ -13920,7 +13929,10 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
|
||||
Create Cursor cDetaliiDiscTaxeTemp (valoare N(20,6), procentTVA N(5,2), discount N(1), motivdiscount V(200), motivdiscountcod V(50)) && discount : discount = 1 / taxe : discount = 0
|
||||
If m.lnDiscountFaraTVA <> 0 OR m.lnTaxeFaraTVA <> 0
|
||||
lcDetalii = loFactura.detalii
|
||||
lcDetalii = Nvl(loFactura.detalii, '')
|
||||
If Empty(m.lcDetalii)
|
||||
goExecutor.oSelecteaza2Value([select detalii from anaf_efactura where id = ] + Alltrim(Str(Nvl(loFactura.Id, 0))), @lcDetalii)
|
||||
Endif
|
||||
loFactParse = ParseEfactura(m.lcDetalii, .T.)
|
||||
|
||||
lcXmlDisc = loFactParse.FacturaDetaliiDisc
|
||||
@@ -15314,7 +15326,7 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
|
||||
If Inlist(This.RowColChange, 1, 3)
|
||||
Thisform.LockScreen = .T.
|
||||
Local lnIdVechi, lnRecnoNou
|
||||
Local lnIdVechi
|
||||
lnIdVechi = 0
|
||||
If Used('crsDetaliiFacturi')
|
||||
Select crsDetaliiFacturi
|
||||
@@ -15324,16 +15336,7 @@ DEFINE CLASS frm_import_efactura AS _frmbase OF "_frm_base.vcx"
|
||||
Endif
|
||||
Endif
|
||||
If !Empty(m.lnIdVechi)
|
||||
lnRecnoNou = Recno('crsFacturi')
|
||||
Select crsFacturi
|
||||
Locate For id = m.lnIdVechi
|
||||
If Found()
|
||||
Thisform.actualizeazalipsurirandcurent()
|
||||
Endif
|
||||
Try
|
||||
Go m.lnRecnoNou In crsFacturi
|
||||
Catch
|
||||
Endtry
|
||||
Thisform.actualizeazalipsurirandcurent(m.lnIdVechi)
|
||||
Endif
|
||||
Thisform.CompleteazaFactura() && cap factura
|
||||
Thisform.actualizeaza_grid2()
|
||||
|
||||
Reference in New Issue
Block a user