diff --git a/cg/cg1303.cpp b/cg/cg1303.cpp index dc0b5c56d..4199c8073 100755 --- a/cg/cg1303.cpp +++ b/cg/cg1303.cpp @@ -2,6 +2,7 @@ //* Rinumerazione numero protocollo * //*********************************** #include +#include #include "cg1300.h" #include "cg1303.h" @@ -64,8 +65,14 @@ bool TAgg_nprot::menu(MENU_TAG m) int TAgg_nprot::rinumera_prot() { + TConfig cnf(CONFIG_DITTA,"cg"); + const bool sc_enabled = cnf.get_bool("GesSal"); + TRelation rel (LF_MOV); + rel.add(LF_PARTITE,"NREG=NUMREG",2); + TLocalisamfile& mov = rel.lfile(); + TLocalisamfile& part= rel.lfile(LF_PARTITE); //TString80 filter; //filter.format("ANNOIVA=%04d && REG=\"%s\"", _anno, (const char*)_reg); @@ -126,6 +133,13 @@ int TAgg_nprot::rinumera_prot() mov.put(MOV_PROTIVA, nprot); mov.put(MOV_UPROTIVA, uprot); mov.rewrite(); + // Aggiorna il nr di prot. iva sul file partite + if (sc_enabled && rel.is_first_match(LF_PARTITE)) + do + { + part.put(PART_PROTIVA,nprot); + part.rewrite(); + } while (rel.next_match(LF_PARTITE)); } TTable reg("REG");