Patch level : 12.00 1278

Files correlati     : cg2.exe
Commento            :

Correzione saldaconto per AGS
This commit is contained in:
Alessandro Bonazzi 2023-08-10 21:11:14 +02:00
parent 997b67cb45
commit 8fcf3df4b9

View File

@ -1440,14 +1440,34 @@ bool TPartita::read(const TBill& clifo, int year, const char* num)
TRiga_partite & row = riga(r);
long nreg = row.get_long(PART_NREG);
int rate = row.rate();
tipo_movimento t = row.tipo();
if (regs[nreg])
if (t == tm_pagamento)
{
_part.destroy_row(r);
changed = true;
if (regs[nreg])
{
_part.destroy_row(r);
changed = true;
}
else
{
regs.set(nreg);
const long nriga = row.get_long(PART_NRIGA);
TToken_string key;
key.add(nreg);
key.add(nriga);
const TRectype & cg = cache().get(LF_RMOV, key);
if (cg.empty())
{
_part.destroy_row(r);
changed = true;
}
}
}
else
regs.set(nreg);
}
if (_part.exist(UNASSIGNED))
@ -1461,7 +1481,7 @@ bool TPartita::read(const TBill& clifo, int year, const char* num)
if (_unassigned.rows() > 0 &&_part.rows() <= 0) // non assegnati orfani!
_unassigned.destroy_rows();
/*
TImporto saldo;
TImporto doc;
TImporto pag;
@ -1479,7 +1499,7 @@ TImporto saldo;
if (saldo != oldsaldo || doc != olddoc || pag != oldpag || imp != oldimp)
write_saldo(true);
*/
if (changed)
rewrite();