From b3211f009b3243c274db4a976a104a3045847e9b Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Fri, 11 Aug 2023 17:00:49 +0200 Subject: [PATCH] Patch level : 12.00 1278 Files correlati : cg2.exe Commento : Correzione saldacontot per AGS --- src/cg/cgsaldac.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/cg/cgsaldac.cpp b/src/cg/cgsaldac.cpp index 22eef3b42..6a5674990 100755 --- a/src/cg/cgsaldac.cpp +++ b/src/cg/cgsaldac.cpp @@ -1450,9 +1450,19 @@ bool TPartita::read(const TBill& clifo, int year, const char* num) changed = true; } else - { regs.set(nreg); + } + } + if (!changed) + 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(); + tipo_movimento t = row.tipo(); + if (t == tm_pagamento) + { const long nriga = row.get_long(PART_NRIGA); TToken_string key; @@ -1463,13 +1473,16 @@ bool TPartita::read(const TBill& clifo, int year, const char* num) if (cg.empty()) { - _part.destroy_row(r); - changed = true; + TMovimento_contabile m(nreg); + + if (m.cg_rows() == 0) + { + _part.destroy_row(r); + changed = true; + } } } } - } - if (_part.exist(UNASSIGNED)) _part.destroy_row(UNASSIGNED); // Elimina riga saldo;