Patch level : 12.00 1278
Files correlati : cg2.exe Commento : Correzione saldacontot per AGS
This commit is contained in:
parent
08be98bc92
commit
a70e0bcdea
@ -1409,6 +1409,9 @@ bool TPartita::read(const TBill& clifo, int year, const char* num)
|
|||||||
else
|
else
|
||||||
_num.trim();
|
_num.trim();
|
||||||
_align = allineamento_corrente();
|
_align = allineamento_corrente();
|
||||||
|
|
||||||
|
real dare;
|
||||||
|
real avere;
|
||||||
|
|
||||||
TRiga_partite* partita = new TRiga_partite(this); // Record campione della partita
|
TRiga_partite* partita = new TRiga_partite(this); // Record campione della partita
|
||||||
TString16 str;
|
TString16 str;
|
||||||
@ -1427,17 +1430,59 @@ bool TPartita::read(const TBill& clifo, int year, const char* num)
|
|||||||
partita->renum_key(PART_ANNO, str); // Anno partita
|
partita->renum_key(PART_ANNO, str); // Anno partita
|
||||||
partita->renum_key(PART_NUMPART, _num); // Numero partita
|
partita->renum_key(PART_NUMPART, _num); // Numero partita
|
||||||
_part.read(partita);
|
_part.read(partita);
|
||||||
|
|
||||||
|
TBit_array regs;
|
||||||
|
int firstrow =first();
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
for (int r = last(); r >= firstrow; r = pred(r))
|
||||||
|
{
|
||||||
|
TRiga_partite & row = riga(r);
|
||||||
|
long nreg = row.get_long(PART_NREG);
|
||||||
|
int rate = row.rate();
|
||||||
|
|
||||||
|
if (regs[nreg])
|
||||||
|
{
|
||||||
|
_part.destroy_row(r);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
regs.set(nreg);
|
||||||
|
}
|
||||||
|
|
||||||
if (_part.exist(UNASSIGNED))
|
if (_part.exist(UNASSIGNED))
|
||||||
_part.destroy_row(UNASSIGNED); // Elimina riga saldo;
|
_part.destroy_row(UNASSIGNED); // Elimina riga saldo;
|
||||||
|
|
||||||
TRectype* unas = new TRectype(LF_PAGSCA); // Record pagamenti non assegnati
|
TRectype* unas = new TRectype(LF_PAGSCA); // Record pagamenti non assegnati
|
||||||
partita->copy_key_to_row(*unas);
|
partita->copy_key_to_row(*unas);
|
||||||
unas->put(PART_NRIGA, (int)UNASSIGNED);
|
unas->put(PART_NRIGA, (int)UNASSIGNED);
|
||||||
unas->put(SCAD_NRATA, (int)UNASSIGNED);
|
unas->put(SCAD_NRATA, (int)UNASSIGNED);
|
||||||
_unassigned.read(unas);
|
_unassigned.read(unas);
|
||||||
if (_unassigned.rows() > 0 &&_part.rows() <= 0) // non assegnati orfani!
|
if (_unassigned.rows() > 0 &&_part.rows() <= 0) // non assegnati orfani!
|
||||||
_unassigned.destroy_rows();
|
_unassigned.destroy_rows();
|
||||||
|
|
||||||
|
/*
|
||||||
|
TImporto saldo;
|
||||||
|
TImporto doc;
|
||||||
|
TImporto pag;
|
||||||
|
TImporto imp;
|
||||||
|
|
||||||
|
calcola_saldo(saldo, doc, pag, imp);
|
||||||
|
|
||||||
|
TImporto oldsaldo;
|
||||||
|
TImporto olddoc;
|
||||||
|
TImporto oldpag;
|
||||||
|
TImporto oldimp;
|
||||||
|
TRectype riga_saldo(LF_PARTITE);
|
||||||
|
|
||||||
|
read_saldo(riga_saldo,oldsaldo, olddoc, oldpag, oldimp, true);
|
||||||
|
|
||||||
|
if (saldo != oldsaldo || doc != olddoc || pag != oldpag || imp != oldimp)
|
||||||
|
write_saldo(true);
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
rewrite();
|
||||||
|
|
||||||
return ok();
|
return ok();
|
||||||
}
|
}
|
||||||
@ -1492,7 +1537,7 @@ int TPartita::write_saldo(bool re, TRectype* rec) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TPartita::read_saldo(TRectype& riga,
|
int TPartita::read_saldo(TRectype& riga,
|
||||||
TImporto& saldo, TImporto& doc, TImporto& pag, TImporto& imp)
|
TImporto& saldo, TImporto& doc, TImporto& pag, TImporto& imp, bool low_level)
|
||||||
{
|
{
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
|
|
||||||
@ -1504,7 +1549,7 @@ int TPartita::read_saldo(TRectype& riga,
|
|||||||
sld.put(PART_NRIGA, (int)UNASSIGNED);
|
sld.put(PART_NRIGA, (int)UNASSIGNED);
|
||||||
|
|
||||||
err = part.read();
|
err = part.read();
|
||||||
if (err != NOERR)
|
if (err != NOERR && !low_level)
|
||||||
{
|
{
|
||||||
const TPartita p(riga);
|
const TPartita p(riga);
|
||||||
err = p.write_saldo(false, &sld);
|
err = p.write_saldo(false, &sld);
|
||||||
|
@ -322,7 +322,7 @@ public:
|
|||||||
|
|
||||||
static void carica_allineamento();
|
static void carica_allineamento();
|
||||||
static char allineamento_richiesto(char tipocf);
|
static char allineamento_richiesto(char tipocf);
|
||||||
static int read_saldo(TRectype& riga, TImporto& saldo, TImporto& doc, TImporto& pag, TImporto& imp);
|
static int read_saldo(TRectype& riga, TImporto& saldo, TImporto& doc, TImporto& pag, TImporto& imp, bool low_level = false);
|
||||||
static bool rileva_sempre_differenze_cambi();
|
static bool rileva_sempre_differenze_cambi();
|
||||||
|
|
||||||
int tipopag2causale(int tipo) const;
|
int tipopag2causale(int tipo) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user