From 5f590762879a32897b674b5935f4aebfc50eb2ec Mon Sep 17 00:00:00 2001 From: nik Date: Fri, 17 Mar 1995 14:31:33 +0000 Subject: [PATCH] Correzioni alla lista movimenti git-svn-id: svn://10.65.10.50/trunk@1144 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg3100.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/cg/cg3100.cpp b/cg/cg3100.cpp index 26bc94304..2558fdd8d 100755 --- a/cg/cg3100.cpp +++ b/cg/cg3100.cpp @@ -680,19 +680,12 @@ void TListaMov_application::stampa_errori_rmov() if (saldi.read() != NOERR) set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non presente in Saldi p.d.c."); - //TRecnotype numrec = current_cursor()->file(LF_RMOV).recno(); if (gruppoc != 0 || contoc != 0 || sottocontoc != 0l) stampa_errori_contropartita(gruppoc, contoc, sottocontoc, tipoc); - //current_cursor()->file(LF_RMOV).readat(numrec); } void TListaMov_application::stampa_errori_contropartita(int gruppo, int conto, long sottoconto, char t) { - //TLocalisamfile& rmov = current_cursor()->file(LF_RMOV); - //int gruppo = rmov.get_int (RMV_GRUPPOC); - //int conto = rmov.get_int (RMV_CONTOC); - //long sottoconto = rmov.get_long(RMV_SOTTOCONTOC); - //char t; bool g = FALSE; TConto tc; @@ -1693,12 +1686,6 @@ else _err.set(3); //controlli sulla contropartita bool TListaMov_application::contropartita(int gruppo, int conto, long sottoconto, char t) { - //char t; - //TLocalisamfile rmov(LF_RMOV,FALSE); - //int gruppo = rmov.get_int (RMV_GRUPPOC); - //int conto = rmov.get_int (RMV_CONTOC); - //long sottoconto = rmov.get_long(RMV_SOTTOCONTOC); - TConto tc; TRectype pc (_pcon->curr()); tc.set(gruppo,0,0l); @@ -1746,10 +1733,13 @@ bool TListaMov_application::segnala_errori_ogniriga() int gruppo, conto, anno, gruppoc, contoc; long sottoconto, sottocontoc; TDate datareg; - char sez, tipo, t, tipoc; + char sez, tipo, t, tipoc; + real importo; + real dare, avere; if (current_cursor()->is_first_match(LF_RMOV)) { + dare = avere = ZERO; TRecnotype nrec = rmov.recno(); rmov.zero(); rmov.setkey(1); @@ -1770,16 +1760,21 @@ bool TListaMov_application::segnala_errori_ogniriga() datareg = rec.get_date(RMV_DATAREG); sez = rec.get_char(RMV_SEZIONE); tipo = rec.get_char(RMV_TIPOC); + importo = rec.get_real(RMV_IMPORTO); + + if (sez == 'D') + dare += importo; + if (sez == 'A') + avere += importo; TConto tc (gruppo,conto,sottoconto); - // TRecnotype numerorec = rmov.recno(); - if (contropartita(gruppoc, contoc, sottocontoc, tipoc)) - // { - // rmov.readat(nrec); - return TRUE; - // } - // rmov.readat(numerorec); + if (gruppoc != 0 || contoc != 0 || sottocontoc != 0l) + if (contropartita(gruppoc, contoc, sottocontoc, tipoc)) + { + rmov.readat(nrec); + return TRUE; + } if (anno != _annoeser || datareg != _datareg) { @@ -1884,7 +1879,12 @@ bool TListaMov_application::segnala_errori_ogniriga() rmov.readat(nrec); return TRUE; } - } + } //for + if (dare != avere) + { + rmov.readat(nrec); + return TRUE; + } rmov.readat(nrec); } return FALSE;