Patch level : 10.0 258
Files correlati : 770.exe Ricompilazione Demo : [ ] Commento : Modificato l'aggiornamento pagamenti per non aggiornare i pagamenti già aggiornati git-svn-id: svn://10.65.10.50/trunk@18512 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b2bba76c57
commit
4ea5af1eeb
@ -404,19 +404,60 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (int i = 0; !found &&i < rows; i++)
|
|
||||||
{
|
|
||||||
const TRectype & pagrec = sc.pag(i);
|
|
||||||
found = num == pagrec.get_long(PAG_NUMREG);
|
|
||||||
}
|
|
||||||
if (!found)
|
|
||||||
{
|
|
||||||
imppag += TImporto(sez, pag.get_real(PAGSCA_RITENUTE));
|
imppag += TImporto(sez, pag.get_real(PAGSCA_RITENUTE));
|
||||||
imppag += TImporto(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC));
|
imppag += TImporto(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC));
|
||||||
real abbuoni = pag.get_real(PAGSCA_ABBUONI);
|
real abbuoni = pag.get_real(PAGSCA_ABBUONI);
|
||||||
real abb = pag.get_real(PAGSCA_ABBUONI);
|
real abb = pag.get_real(PAGSCA_ABBUONI);
|
||||||
if (!abb.is_zero())
|
if (!abb.is_zero())
|
||||||
imppag += TImporto(sez, abb);
|
imppag += TImporto(sez, abb);
|
||||||
|
for (int i = 0; !found &&i < rows; i++)
|
||||||
|
{
|
||||||
|
TRectype & pagrec = sc.pag(i);
|
||||||
|
const long numsch = pagrec.get_long(PAG_NUMREG);
|
||||||
|
found = num == numsch;
|
||||||
|
if (numsch == 0L && !found)
|
||||||
|
{
|
||||||
|
TDate data(sum.get_date(PART_DATADOC));
|
||||||
|
if (!data.ok())
|
||||||
|
data = sum.get_date(PART_DATAREG);
|
||||||
|
if (!data.ok())
|
||||||
|
data = sum.get_date(PART_DATAPAG);
|
||||||
|
const TDate datasch(pagrec.get(PAG_DATAPAG));
|
||||||
|
if (data == datasch)
|
||||||
|
{
|
||||||
|
pagrec.put(PAG_NUMREG, num);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
imppag.normalize('D');
|
||||||
|
|
||||||
|
real spesep = imppag.valore() * spperc;
|
||||||
|
real ivap = imppag.valore() * ivaperc;
|
||||||
|
|
||||||
|
spesep.round(TCurrency::get_firm_dec());
|
||||||
|
if (abs(spesep) > abs(spese))
|
||||||
|
spesep = spese;
|
||||||
|
ivap.round(TCurrency::get_firm_dec());
|
||||||
|
if (abs(ivap) > abs(iva))
|
||||||
|
ivap = iva;
|
||||||
|
|
||||||
|
real compensop = imppag.valore() - spesep - ivap;
|
||||||
|
|
||||||
|
compensop += compensop * h_PercRitenuta;
|
||||||
|
compensop.round(TCurrency::get_firm_dec());
|
||||||
|
if (abs(compensop) > abs(compenso))
|
||||||
|
compensop = compenso;
|
||||||
|
if (compensop == pagrec.get_real(PAG_COMPENSO))
|
||||||
|
{
|
||||||
|
pagrec.put(PAG_NUMREG, num);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
tot[lastsch] += imppag;
|
tot[lastsch] += imppag;
|
||||||
if (!datapag.ok())
|
if (!datapag.ok())
|
||||||
datapag = sum.get_date(PART_DATADOC);
|
datapag = sum.get_date(PART_DATADOC);
|
||||||
@ -456,8 +497,6 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
|
|||||||
compensopag.round(TCurrency::get_firm_dec());
|
compensopag.round(TCurrency::get_firm_dec());
|
||||||
if (abs(compensopag) > abs(compenso))
|
if (abs(compensopag) > abs(compenso))
|
||||||
compensopag = compenso;
|
compensopag = compenso;
|
||||||
compensopag += pagrec.get_real(PAG_COMPENSO);
|
|
||||||
spesepag += pagrec.get_real(PAG_SPESA);
|
|
||||||
pagrec.put(PAG_COMPENSO, compensopag);
|
pagrec.put(PAG_COMPENSO, compensopag);
|
||||||
pagrec.put(PAG_SPESA, spesepag);
|
pagrec.put(PAG_SPESA, spesepag);
|
||||||
pagrec.put(PAG_DATAPAG, datapag);
|
pagrec.put(PAG_DATAPAG, datapag);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user