From b52347cc144f7e14a79c50d1ca2db8aa99a6d646 Mon Sep 17 00:00:00 2001 From: angelo Date: Thu, 21 Nov 1996 08:55:34 +0000 Subject: [PATCH] Corretti i seguenti errori: MI2249 (vedi modifica di guy sui TConfig), MI2250, MI2248 (sempre modifica di guy), MI2251, MI2252. git-svn-id: svn://10.65.10.50/trunk@3918 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg6600.cpp | 8 ++++---- cg/cg6700.cpp | 18 ++++++++++++------ cg/cg6800.cpp | 6 ++++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/cg/cg6600.cpp b/cg/cg6600.cpp index aa62db3e5..e4e597e73 100755 --- a/cg/cg6600.cpp +++ b/cg/cg6600.cpp @@ -1242,10 +1242,10 @@ void TRic_tab::ricevi_movIVA(TString& key, char uselab) if (ocfpi.not_empty()) occasionali(ocfpi); - TRecnotype rec = _tmov->recno(); // Salvo il nuovo numero di - _tmov->put("TOCFP", ocfpi); // registrazione sul file di lavoro - _tmov->rewrite(); - _tmov->readat(rec); +// TRecnotype rec = _tmov->recno(); // Salvo il nuovo numero di +// _tmov->put("TOCFP", ocfpi); // registrazione sul file di lavoro +// _tmov->rewrite(); +// _tmov->readat(rec); TDate data74ter ( _tmov->get_date(MOV_DATA74TER) ); TString codval ( _tmov->get (MOV_CODVALI) ); diff --git a/cg/cg6700.cpp b/cg/cg6700.cpp index 272707f3d..fb00c0142 100755 --- a/cg/cg6700.cpp +++ b/cg/cg6700.cpp @@ -2278,9 +2278,9 @@ bool TRic_ListaMov::preprocess_page(int file,int counter) } } - int r = 1; - // Visualizza in positivo le note di credito e gli storni - if ((_tipodoc == "NC" || _tipodoc == "ST") && _impo < 0.0) + int r = 1; + // Cambia segno se si tratta di note di credito o storni + if (_tipodoc == "NC" || _tipodoc == "ST") { _impo_print = _impo * (-1); _impos_print = _impos * (-1); @@ -2706,8 +2706,12 @@ void TRic_ListaMov::aggiorna_mov() if (mov.get(MOV_TIPOMOV).empty()) mov.put(MOV_TIPOMOV, _tipom_cau); mov.put(MOV_CODPAG, _codpag_scad); - if ((_tipodoc == "NC" || _tipodoc == "ST") && _tot_doc > 0.0) // swap sign only if positive + const bool first_time = mov.get("TOCFP")!="X"; + if ((_tipodoc == "NC" || _tipodoc == "ST") && first_time) // swap sign only if it's first time + { _tot_doc = _tot_doc * -1; + mov.put("TOCFP","X"); + } mov.put(MOV_TOTDOC, _tot_doc); if (_is_salda) { @@ -2739,11 +2743,13 @@ void TRic_ListaMov::aggiorna_rmov(char tipoc, char tipocc) void TRic_ListaMov::aggiorna_iva(char tipo) { TLocalisamfile& riva = current_cursor()->file(LF_RMOVIVA); + TLocalisamfile& mov = current_cursor()->file(LF_MOV); if (_anno == 0) riva.put(RMI_ANNOES, _annoese); - - if ((_tipodoc == "NC" || _tipodoc == "ST") && _impo > 0.0) // swap sign only if positive + + const bool first_time = mov.get("TOCFP") != "X"; + if ((_tipodoc == "NC" || _tipodoc == "ST") && first_time) // swap sign only if it is the first time { _impo = _impo * -1; _impos = _impos * -1; diff --git a/cg/cg6800.cpp b/cg/cg6800.cpp index d84bd4f68..db441d623 100755 --- a/cg/cg6800.cpp +++ b/cg/cg6800.cpp @@ -745,8 +745,9 @@ bool TVar_mov::setta_campi_maschera_iva(TMask& m) int gruppo = _tiva->get_int (RMI_GRUPPO); int conto = _tiva->get_int (RMI_CONTO); long sottoc = _tiva->get_long(RMI_SOTTOCONTO); + const bool first_time = _rec_mov->get("TOCFP") != "X"; - if ((tipodoc == "NC" || tipodoc == "ST") && imponibile < 0.0) + if ((tipodoc == "NC" || tipodoc == "ST") && !first_time) { imponibile *= -1; imposta *= -1; @@ -1521,8 +1522,9 @@ void TVar_mov::registra_IVA(TMask& m) int gruppo = m.get_int (F_GRUPPO); int conto = m.get_int (F_CONTO); long sottoc = m.get_long(F_SOTTOCONTO); + const bool first_time = _rec_mov->get("TOCFP") != "X"; - if ((tipodoc=="NC" || tipodoc =="ST") && imponibile > 0.0) + if ((tipodoc=="NC" || tipodoc =="ST") && !first_time) { imponibile *= -1; imposta *= -1;