diff --git a/lv/lv3100.cpp b/lv/lv3100.cpp index 8f74af96c..1faa7465f 100755 --- a/lv/lv3100.cpp +++ b/lv/lv3100.cpp @@ -1218,7 +1218,6 @@ void TGestione_bolle_app::salva_conguaglio( const TMask& m) const real conat = rdoc.get_real(RDOC_QTA); rdoc.put(RDOC_QTAGG4, ritat); rdoc.put(RDOC_QTAGG3, conat); - } rcondv.rewrite(); } diff --git a/lv/lv3300.cpp b/lv/lv3300.cpp index a8e446a17..5d2d82690 100755 --- a/lv/lv3300.cpp +++ b/lv/lv3300.cpp @@ -735,9 +735,8 @@ bool TGestione_buoni_msk::pre_codart_handler(TMask_field& f, KEY k) { const real congor = rcont.get_real(LVRCONDV_QTACONG); - const real congat = conat - ritat + congor; - - rdoc.put(RDOC_QTAGG5, congat); //conguaglio dopo modifica manuale + const real congat = conat - conor - ritat + ritor + congor; + msk.set(FR_QTAGG5, congat); TLocalisamfile rcondv(LF_LVRCONDV); rcondv.put(LVRCONDV_CODCF,codcf); @@ -1178,29 +1177,36 @@ void TGestione_buoni_app::elimina_vuote( const TMask& m) void TGestione_buoni_app::salva_conguaglio( const TMask& m) { - TDocumento_mask& mask = (TDocumento_mask&) m; - TDocumento& d = mask.doc(); + if (ini_get_bool(CONFIG_DITTA, "lv", "Aggcong")) + { + TDocumento_mask& mask = (TDocumento_mask&) m; + TDocumento& d = mask.doc(); - TSheet_field& sheet = mask.sfield(F_SHEET); - const long codcf = mask.get_long(F_CODCF); - const int indsped = mask.get_int(F_CODINDSP); - TDate datadoc = mask.get_date(F_DATADOC); + TSheet_field& sheet = mask.sfield(F_SHEET); + const long codcf = mask.get_long(F_CODCF); + const int indsped = mask.get_int(F_CODINDSP); + TDate datadoc = mask.get_date(F_DATADOC); - const TLaundry_contract cont(codcf, indsped, datadoc); - const int codcont = cont.get_int(LVCONDV_CODCONT); + const TLaundry_contract cont(codcf, indsped, datadoc); + const int codcont = cont.get_int(LVCONDV_CODCONT); - TLocalisamfile rcondv(LF_LVRCONDV); - - FOR_EACH_DOC_ROW_BACK(d, r, row) - { - TRiga_documento& rdoc = (TRiga_documento&)*row; - rcondv.put(LVRCONDV_CODCF,codcf); - rcondv.put(LVRCONDV_CODCONT, codcont); - rcondv.put(LVRCONDV_CODART, rdoc.get(RDOC_CODART)); - if (rcondv.read() == NOERR) - rcondv.put(LVRCONDV_QTACONG, rdoc.get_real(RDOC_QTAGG5)); - } - rcondv.rewrite(); + TLocalisamfile rcondv(LF_LVRCONDV); + + FOR_EACH_DOC_ROW_BACK(d, r, row) + { + TRiga_documento& rdoc = (TRiga_documento&)*row; + rcondv.put(LVRCONDV_CODCF,codcf); + rcondv.put(LVRCONDV_CODCONT, codcont); + rcondv.put(LVRCONDV_CODART, rdoc.get(RDOC_CODART)); + if (rcondv.read() == NOERR) + rcondv.put(LVRCONDV_QTACONG, rdoc.get_real(RDOC_QTAGG5)); + const real ritat = rdoc.get_real(RDOC_QTAGG1); + const real conat = rdoc.get_real(RDOC_QTA); + rdoc.put(RDOC_QTAGG4, ritat); + rdoc.put(RDOC_QTAGG3, conat); + } + rcondv.rewrite(); + } } //ridefinisco il metodo write delle TMotore_application diff --git a/lv/verig24.uml b/lv/verig24.uml index 2368f8a10..7a1b5cfa6 100755 --- a/lv/verig24.uml +++ b/lv/verig24.uml @@ -460,6 +460,13 @@ BEGIN FIELD RIFBCON FLAGS "D" END + +NUMBER FR_QTAGG5 6 0 +BEGIN + PROMPT 60 20 "Cong. " + FLAGS "H" + FIELD QTAGG5 +END ENDPAGE