diff --git a/cg/cg2102.cpp b/cg/cg2102.cpp index 940e78f88..ebfbfcc60 100755 --- a/cg/cg2102.cpp +++ b/cg/cg2102.cpp @@ -369,8 +369,11 @@ int TPrimanota_application::set_cgs_row(int n, const TImporto& imp, if (tipo == 'T') // Calcolo contropartita { TToken_string& irow = ivas().row(0); - for (int i = 5; i < 10; i++) - row.add(irow.get(i == 5 ? 5 : -1)); + TBill contro(irow, 5, 0x3); + if (contro.ok()) // Errore MI3599 + row.add(contro.string(0x3)); + else + row.add(" | | | | "); } else { @@ -378,9 +381,11 @@ int TPrimanota_application::set_cgs_row(int n, const TImporto& imp, if (pos >= 0) { TBill contro(cg.row(pos), 2, 0x3); - row.add(contro.string(0x3)); + if (contro.ok()) + row.add(contro.string(0x3)); } - else row.add(" | | | | "); + else + row.add(" | | | | "); } row << "| |" << tipo; @@ -956,8 +961,12 @@ bool TPrimanota_application::descr_handler(TMask_field& f, KEY k) if (first >= 0) { TSheet_field& cg = app().cgs(); - cg.row(first).add(f.get(), 8); - cg.force_update(first); + const TString80 old = cg.row(first).get(8); + if (old.blank) + { + cg.row(first).add(f.get(), 8); + cg.force_update(first); + } } } }