From 572f380590c7d501cd64347fa711eea1b58ef062 Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Wed, 4 Mar 2026 23:17:37 +0100 Subject: [PATCH] Patch level : 12.00 1406 Files correlati : cg3.exe cg0500a.msk cg3100a.msk Commento : Segnalazione opzionale dei codici sospesi nella lista movimenti --- src/cg/cg0500.h | 1 + src/cg/cg0500a.uml | 11 +- src/cg/cg3100.cpp | 278 ++++++++++++++++++++++++--------------------- src/cg/cg3100.h | 2 + src/cg/cg3100a.uml | 45 ++++---- src/cg/cg3200.cpp | 166 +++++++++++++-------------- src/cg/cglib.h | 10 +- src/cg/cglib01.cpp | 13 +-- 8 files changed, 276 insertions(+), 250 deletions(-) diff --git a/src/cg/cg0500.h b/src/cg/cg0500.h index e856008c6..92978345b 100755 --- a/src/cg/cg0500.h +++ b/src/cg/cg0500.h @@ -40,6 +40,7 @@ #define F_DATAREG_PREC 237 #define F_TIPO_SDI 238 #define F_ESCULDIARC 239 +#define F_SOSPESO 240 #define SS_TIPO 101 #define SS_SEZIONE 102 diff --git a/src/cg/cg0500a.uml b/src/cg/cg0500a.uml index 0a82a090a..759d4d254 100755 --- a/src/cg/cg0500a.uml +++ b/src/cg/cg0500a.uml @@ -18,7 +18,7 @@ BEGIN PROMPT 2 1 "Codice " FIELD CODCAUS KEY 1 - FLAGS "UZ" + FLAGS "UZG" USE LF_CAUSALI INPUT CODCAUS F_COD_CAUS DISPLAY "Cod." CODCAUS @@ -54,6 +54,7 @@ BEGIN KEY 2 WARNING "Descrizione assente" MESSAGE COPY,F_DESCR2 + FLAGS "G" END STRING F_TIPO_DOC 2 @@ -197,9 +198,15 @@ BEGIN FILED ESCLUDIARC END +BOOLEAN F_SOSPESO +BEGIN + PROMPT 2 8 "Causale sospesa" + FILED SOSPESO +END + SPREADSHEET F_SHEET_GCS BEGIN - PROMPT 0 8 "Righe" + PROMPT 0 9 "Righe" ITEM "Tipo conto@21F" ITEM "D/A@3" ITEM "C/F@3" diff --git a/src/cg/cg3100.cpp b/src/cg/cg3100.cpp index 32d0aa530..7647ad6c8 100755 --- a/src/cg/cg3100.cpp +++ b/src/cg/cg3100.cpp @@ -64,7 +64,7 @@ class TListaMov_application : public TPrintapp real _tot_dare, _tot_avere, _tot_avere_giornaliero; real _tot_dare_giornaliero, _tot_dare_generale, _tot_avere_generale; bool _no_preprocess_page, _salto_pagina, _stampa_anno_comp,_esiste_riga_iva,_nonesiste_riga_iva; - bool _stampa_parte_iva,_alleg_causale,_stampa_mess_alleg_iva,_allegb; + bool _stampa_parte_iva,_alleg_causale,_stampa_mess_alleg_iva,_allegb, _stampa_sospesi; int _ricser; bool _settata_prima_riga, _causale_gia_stampata,_mov_di_sola_iva; int _cur1,_cur2,_cur2b,_cur3,_cur4,_decidi,/*_tipod,*/_controllo_mov_errati; @@ -134,13 +134,24 @@ bool TListaMov_application::annoes_handler(TMask_field& f, KEY k) const int anno = atoi(f.get()); TDate dataini, datafin; TEsercizi_contabili esc; - if (esc.code2range(anno, dataini, datafin)) + + if (esc.code2range(anno, dataini, datafin)) { - f.mask().set(F_DATAINI, dataini); - const int prossimo = esc.next(anno); - if (prossimo > 0) - datafin = esc[prossimo].fine(); - f.mask().set(F_DATAFIN, datafin); + TDate d = f.mask().get_date(F_DATAINI); + + if (!d.ok() || esc.date2esc(d) != anno) + f.mask().set(F_DATAINI, dataini); + + const int prossimo = esc.next(anno); + + d = f.mask().get_date(F_DATAFIN); + if (!d.ok() || esc.date2esc(d) != anno) + { + if (prossimo > 0) + datafin = esc[prossimo].fine(); + + f.mask().set(F_DATAFIN, datafin); + } } } return true; @@ -161,19 +172,17 @@ bool TListaMov_application::data_inizio(TMask_field& f, KEY k) ((app()._tipo_lista == movimenti ) && (decidi == 2)) ) ) { const TDate inizio = esc[anno].inizio(); - if (data.ok()) - { - if (data < inizio) - { - f.error_box(TR("La data indicata non deve essere inferiore alla data di inizio esercizio")); - return FALSE; - } - } - else //se la data e' vuota - f.mask().field(F_DATAINI).set(inizio); + + if (data.ok()) + { + if (data < inizio) + return f.error_box(TR("La data indicata non deve essere inferiore alla data di inizio esercizio")); + } + else //se la data e' vuota + f.mask().field(F_DATAINI).set(inizio); } } - return TRUE; + return true; } bool TListaMov_application::data_fine(TMask_field& f, KEY k) @@ -183,36 +192,31 @@ bool TListaMov_application::data_fine(TMask_field& f, KEY k) int decidi = 0; int anno = f.mask().get_int (F_ANNO); TDate dataini = f.mask().get_date(F_DATAINI); - TDate datafin = f.mask().get_date(F_DATAFIN); + TDate datafin = f.mask().get_date(F_DATAFIN); + if (app()._tipo_lista == movimenti) decidi = f.mask().get_int (F_DECIDI); if ( (app()._tipo_lista == fatture) || ((app()._tipo_lista == movimenti) && (decidi == 2)) ) - if ( dataini.ok() && datafin.ok() ) - if (dataini > datafin) - { - f.error_box(TR("La data iniziale non deve essere superiore alla data finale")); - return FALSE; - } - - TEsercizi_contabili esc; + if ( dataini.ok() && datafin.ok() && dataini > datafin) + return f.error_box(TR("La data iniziale non deve essere superiore alla data finale")); + + TEsercizi_contabili esc; + if (esc.exist(anno) && ( (app()._tipo_lista == fatture) || ((app()._tipo_lista == movimenti) && (decidi == 2)) ) ) { const int prossimo = esc.next(anno); const TDate fine = esc[prossimo > 0 ? prossimo : anno].fine(); - if (datafin.ok()) - { - if (datafin > fine) - { - f.error_box(TR("La data indicata non deve essere superiore alla data di fine esercizio successivo, oppure, in caso questo non esista, dell'esercizio indicato")); - return FALSE; - } - } - else //se la data e' vuota + if (datafin.ok()) + { + if (datafin > fine) + return f.error_box(TR("La data indicata non deve essere superiore alla data di fine esercizio successivo, oppure, in caso questo non esista, dell'esercizio indicato")); + } + else //se la data e' vuota f.mask().set(F_DATAFIN, fine); } } - return TRUE; + return true; } bool TListaMov_application::RicercaDoc(const char* tipo) const @@ -473,10 +477,12 @@ bool TListaMov_application::filter_func_fatture (const TRelation* rel) // Altrimenti stampa anche i corrispettivi! Pseudo errore MI2396 const long codcf = mov.get_long(MOV_CODCF); + if (codcf <= 0) - return FALSE; + return false; const TString& causale = mov.get(MOV_CODCAUS); + if (!between(causale, app()._causale_ini, app()._causale_fin)) return false; @@ -491,12 +497,13 @@ bool TListaMov_application::filter_func_fatture (const TRelation* rel) if (app()._annoes > 0) //anno esercizio specificato nella maschera { const int annoes = mov.get_int(MOV_ANNOES); + if (annoes != app()._annoes) return false; } - if (!between(mov.get_date(MOV_DATAREG), app()._data_ini, app()._data_fin)) - return false; + if (!between(mov.get_date(MOV_DATAREG), app()._data_ini, app()._data_fin)) + return false; if (!between(mov.get(MOV_TIPO), app()._tipo_ini, app()._tipo_fin)) return false; @@ -511,9 +518,10 @@ bool TListaMov_application::filter_func (const TRelation * rel) { const TRectype& mov = rel->curr(LF_MOV); - if ( (app()._decidi == 2) && (app()._annoes != 0) ) + if ((app()._decidi == 2) && (app()._annoes != 0)) { const int annoes = mov.get_int(MOV_ANNOES); + if (annoes != app()._annoes) return false; } @@ -524,12 +532,14 @@ bool TListaMov_application::filter_func (const TRelation * rel) #endif const TString& causale = mov.get(MOV_CODCAUS); + if (!between(causale, app()._causale_ini, app()._causale_fin)) return false; if (app()._scelta_stampa == 0) // Lista movimenti { const TString& codreg = mov.get(MOV_REG); + if (!between(codreg, app()._registro_ini, app()._registro_fin)) return false; } @@ -554,7 +564,6 @@ bool TListaMov_application::filter_func (const TRelation * rel) if (esc.date2esc(datareg) == annoes) return false; } - return true; } @@ -573,25 +582,21 @@ void TListaMov_application::stampa_errori_rmov() long sottocontoc = rec.get_long(RMV_SOTTOCONTOC); char tipoc = rec.get_char(RMV_TIPOCC); - bool g = FALSE; - + bool g = false; TBill tc (gruppo,conto,sottoconto); _nr++; - if (anno != _annoeser || datareg != _datareg) set_row(_nr++, FR("@11gUno o piu' campi non sono costanti nella riga dell' operazione")); if (sez != 'D' && sez != 'A') set_row(_nr++, FR("@11gIndicato tipo movimento Dare/Avere errato")); - if (tc.empty()) - set_row(_nr++, FR("@11gNon presente codice gruppo/conto/sottoconto")); - if (!tc.ok()) + if (tc.full() && !tc.ok()) set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto non corrisponde ad un sottoconto")); TRectype pc (LF_PCON); tc.set(gruppo,0,0l); if (!tc.read(pc)) - g = TRUE; + g = true; tc.set(gruppo,conto,0l); if (!tc.read(pc)) set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto non presente in Piano dei Conti")); @@ -610,7 +615,8 @@ void TListaMov_application::stampa_errori_rmov() else { bool sosp = tc.sospeso(); - if (sosp) + + if (_stampa_sospesi && sosp) set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto sospeso in Piano dei Conti")); } } @@ -624,7 +630,8 @@ void TListaMov_application::stampa_errori_rmov() if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); - if (sosp) + + if (_stampa_sospesi && sosp) set_row(_nr++, FR("@11gCodice C/F sospeso in Anagrafica")); } else set_row(_nr++, FR("@11gCodice C/F non presente in Anagrafica")); @@ -645,7 +652,7 @@ void TListaMov_application::stampa_errori_rmov() const TRectype & saldi = cache().get(LF_SALDI, key); - if (saldi.empty()) + if (gruppo != 0 && conto != 0 && sottoconto != 0L && saldi.empty()) set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto non presente in Saldi p.d.c.")); if (gruppoc != 0 || contoc != 0 || sottocontoc != 0l) @@ -654,13 +661,13 @@ void TListaMov_application::stampa_errori_rmov() void TListaMov_application::stampa_errori_contropartita(int gruppo, int conto, long sottoconto, char t) { - bool g = FALSE; + bool g = false; TBill tc; TRectype pc (LF_PCON); tc.set(gruppo,0,0l); if (!tc.read(pc)) - g = TRUE; + g = true; tc.set(gruppo,conto,0l); if (!tc.read(pc)) set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto di contropartita non presente in Piano dei Conti")); @@ -689,7 +696,8 @@ void TListaMov_application::stampa_errori_contropartita(int gruppo, int conto, l if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); - if (sosp) + + if (_stampa_sospesi && sosp) set_row(_nr++, FR("@11gCodice C/F di contropartita sospeso in Anagrafica")); } else set_row(_nr++, FR("@11gCodice C/F di contropartita non presente in Anagrafica")); @@ -835,7 +843,7 @@ void TListaMov_application::stampa_intestazione() bool TListaMov_application::preprocess_page(int file,int counter) { if (counter) - return TRUE; + return true; TCursor* cur = current_cursor(); @@ -851,9 +859,9 @@ bool TListaMov_application::preprocess_page(int file,int counter) _tot_avere = 0; _tot_dare = 0; _c.destroy(); - _no_preprocess_page = FALSE; - _esiste_riga_iva = FALSE; - _nonesiste_riga_iva = FALSE; + _no_preprocess_page = false; + _esiste_riga_iva = false; + _nonesiste_riga_iva = false; _annoeser = curmov.get_int(MOV_ANNOES); _datacomp = curmov.get_date(MOV_DATACOMP); _causale = curmov.get(MOV_CODCAUS); @@ -868,7 +876,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) _tiporegistro = cached_registro(_registro, _anno).tipo_registro(); - _causale_gia_stampata = FALSE; + _causale_gia_stampata = false; TEsercizi_contabili esc; _ae = esc.date2esc(_datareg); @@ -910,13 +918,16 @@ bool TListaMov_application::preprocess_page(int file,int counter) || _controllo_mov_errati == 2 ) { stampa_errori_mov(); - return TRUE; + return true; } - else if (_controllo_mov_errati == 1 && !verifica) - return FALSE; - else return TRUE; + else + if (_controllo_mov_errati == 1 && !verifica) + return false; + else + return true; } - else return TRUE; + else + return true; } } else if (file == LF_RMOV) @@ -951,13 +962,13 @@ bool TListaMov_application::preprocess_page(int file,int counter) if (_controllo_mov_errati != 3) stampa_errori_rmov(); } - return TRUE; + return true; } else if ( _stampa_parte_iva && file == LF_RMOVIVA) { const TRectype& iva = cur->curr(LF_RMOVIVA); _c.add_riga(iva); - return TRUE; + return true; } } else //_scelta_stampa == 1 @@ -966,7 +977,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) { _tot_avere = 0; _tot_dare = 0; - _no_preprocess_page = FALSE; + _no_preprocess_page = false; const TRectype& curmov = cur->curr(LF_MOV); _causale = curmov.get(MOV_CODCAUS); @@ -974,7 +985,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) _anno = curmov.get_int(MOV_ANNOES); _tipodoc = curmov.get(MOV_TIPODOC); - _causale_gia_stampata = FALSE; + _causale_gia_stampata = false; TRectype da (LF_MOV); TRectype a (LF_MOV); @@ -1004,7 +1015,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) { set_row(_nr,"@4g%3s", (const char*) _causale); set_row(_nr,"@8g%-.20s", (const char*) _descr_causale); - _causale_gia_stampata = TRUE; + _causale_gia_stampata = true; } const TRectype& rmov = current_cursor()->curr(LF_RMOV); const int gruppo = rmov.get_int(RMV_GRUPPO); @@ -1027,7 +1038,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) _tot_avere_generale += _importo; } } - return TRUE; + return true; } } break; @@ -1104,7 +1115,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) } else if (_tipo_clifo_prec == _tipo_elenco && _codcf_prec == _codcf) - _settata_prima_riga = FALSE; + _settata_prima_riga = false; else { if ( _salto_pagina && _tipo_clifo_prec == _tipo_elenco ) @@ -1112,9 +1123,9 @@ bool TListaMov_application::preprocess_page(int file,int counter) stampa_intestazione(); _tipo_clifo_prec = _tipo_elenco; _codcf_prec = _codcf; - _settata_prima_riga = FALSE; + _settata_prima_riga = false; } - return TRUE; + return true; } } } @@ -1179,7 +1190,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) set_row(2,"@131g*"); incrementa_totali(); - _settata_prima_riga = TRUE; + _settata_prima_riga = true; ++_documenti; } else if (_settata_prima_riga) @@ -1191,7 +1202,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) set_row(1,"@114g@n", FLD(LF_RMOVIVA,RMI_IMPOSTA)); incrementa_totali(); } - return TRUE; + return true; } } break; @@ -1199,7 +1210,7 @@ bool TListaMov_application::preprocess_page(int file,int counter) default: break; } - return FALSE; + return false; } void TListaMov_application::print_intra(int& rr) @@ -1214,11 +1225,11 @@ void TListaMov_application::print_intra(int& rr) rr++; const TCurrency cl(mov.get_real(MOV_CORRLIRE)); - str = cl.string(TRUE); str.right_just(19); + str = cl.string(true); str.right_just(19); set_row(rr,FR("Corrispettivo@14g%s"), (const char*)str); const TCurrency cv(corrval, codval); - str = cv.string(TRUE); str.right_just(19); + str = cv.string(true); str.right_just(19); set_row(rr,FR("@34gCorr.in valuta@49g%s"), (const char*)str); set_row(rr,"@70g%-3s", (const char*)codval); @@ -1290,7 +1301,8 @@ print_action TListaMov_application::postprocess_page(int file,int count) n = ++r; TRecnotype pos, items; - bool FINITO = FALSE; + bool FINITO = false; + if ((_scelta_stampa == 0)&&(_controllo_mov_errati != 3)&&(_tot_dare != _tot_avere)) set_row(n++, FR("@11gIl movimento risulta sbilanciato")); @@ -1344,8 +1356,8 @@ print_action TListaMov_application::postprocess_page(int file,int count) } else { - _no_preprocess_page = TRUE; - force_setpage(FALSE); + _no_preprocess_page = true; + force_setpage(false); return REPEAT_PAGE; } } @@ -1360,7 +1372,7 @@ print_action TListaMov_application::postprocess_page(int file,int count) _totdocumenti += _totdoc; _totritenute += _ritenute; TRecnotype pos, items; - bool FINITO = FALSE; + bool FINITO = false; pos = current_cursor()->pos(); items = current_cursor()->items(); @@ -1446,9 +1458,7 @@ print_action TListaMov_application::postprocess_page(int file,int count) default: break; } - - - return NEXT_PAGE; + return NEXT_PAGE; } print_action TListaMov_application::postprocess_print(int file,int count) @@ -1514,15 +1524,18 @@ bool TListaMov_application::segnala_errori_primariga() if (!RicercaDoc(_tipodoc)) _err.set(11); - if (_causale.not_empty()) //se indicata la causale + if (_causale.full()) //se indicata la causale { - const TRectype & caus = cache().get(LF_CAUSALI, _causale); - if (caus.empty()) + const TCausale & caus = cached_causale(_causale); + const TString codcaus = caus.codice(); + + if (codcaus.blank()) _err.set(7); else { - bool sos = caus.get_bool(CAU_SOSPESO); - if (sos) + const bool sos = caus.causale_sospesa(); + + if (_stampa_sospesi && sos) _err.set(8); if (_stampa_mess_alleg_iva && _alleg_causale) _err.set(9); @@ -1560,7 +1573,7 @@ bool TListaMov_application::segnala_errori_primariga() } if (_codcf != 0l) { - if ((tipo == 1 && _tipo_elenco != "C") || (tipo == 2 && _tipo_elenco != "F")) + if ((!caus.regolarizzazione() && tipo == 1 && _tipo_elenco != "C") || (tipo == 2 && _tipo_elenco != "F")) _err.set(17); TToken_string key; @@ -1571,7 +1584,8 @@ bool TListaMov_application::segnala_errori_primariga() if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); - if (sosp) + + if (_stampa_sospesi && sosp) _err.set(18); bool occ = clifo.get_bool(CLI_OCCAS); char alleg = clifo.get_char(CLI_ALLEG); @@ -1593,7 +1607,7 @@ bool TListaMov_application::segnala_errori_primariga() bool sospall = clifo.get_bool(CLI_SOSPESO); long codall = clifo.get_long(CLI_CODALLEG); char alleg = clifo.get_char(CLI_ALLEG); - if (sospall) + if (_stampa_sospesi && sospall) _err.set(21); if (codall != 0l) _err.set(22); @@ -1610,9 +1624,9 @@ bool TListaMov_application::segnala_errori_primariga() } } if (_err.ones()) - return TRUE; + return true; - return FALSE; + return false; } //controlli sulla contropartita @@ -1622,21 +1636,22 @@ bool TListaMov_application::contropartita(int gruppo, int conto, long sottoconto TRectype pc (LF_PCON); tc.set(gruppo,0,0l); if (!tc.read(pc)) - return TRUE; + return true; tc.set(gruppo,conto,0l); if (!tc.read(pc)) - return TRUE; + return true; //else t = pc.get_char(PCN_TMCF); tc.set(gruppo,conto,sottoconto); if (t != 'C' && t != 'F') { if (!tc.read(pc)) - return TRUE; + return true; else { bool sosp = tc.sospeso(); - if (sosp) - return TRUE; + + if (_stampa_sospesi && sosp) + return true; } } else if (sottoconto != 0l) @@ -1649,13 +1664,14 @@ bool TListaMov_application::contropartita(int gruppo, int conto, long sottoconto if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); - if (sosp) - return TRUE; + + if (_stampa_sospesi && sosp) + return true; } else - return TRUE; + return true; } - return FALSE; + return false; } //guarda se c'e' almeno un errore su almeno una riga (rmov) @@ -1718,12 +1734,7 @@ bool TListaMov_application::segnala_errori_ogniriga() rmov.readat(nrec); return true; } - if (tc.empty()) - { - rmov.readat(nrec); - return true; - } - if (!tc.ok()) + if (tc.full() && !tc.ok()) { rmov.readat(nrec); return true; @@ -1731,19 +1742,20 @@ bool TListaMov_application::segnala_errori_ogniriga() TRectype pc (LF_PCON); tc.set(gruppo,0,0l); - if (!tc.read(pc)) + if (tc.full() && !tc.read(pc)) { rmov.readat(nrec); return true; } tc.set(gruppo,conto,0l); - if (!tc.read(pc)) + if (tc.full() && !tc.read(pc)) { rmov.readat(nrec); return true; } - else t = pc.get_char(PCN_TMCF); - if (t != tipo) + else + t = pc.get_char(PCN_TMCF); + if (tc.full() && t != tipo) { rmov.readat(nrec); return true; @@ -1751,7 +1763,7 @@ bool TListaMov_application::segnala_errori_ogniriga() tc.set(gruppo,conto,sottoconto); if (t != 'C' && t != 'F') { - if (!tc.read(pc)) + if (tc.full() && !tc.read(pc)) { rmov.readat(nrec); return true; @@ -1759,7 +1771,8 @@ bool TListaMov_application::segnala_errori_ogniriga() else { bool sosp = tc.sospeso(); - if (sosp) + + if (_stampa_sospesi && sosp) { rmov.readat(nrec); return true; @@ -1776,7 +1789,8 @@ bool TListaMov_application::segnala_errori_ogniriga() if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); - if (sosp) + + if (_stampa_sospesi && sosp) { rmov.readat(nrec); return true; @@ -1805,9 +1819,7 @@ bool TListaMov_application::segnala_errori_ogniriga() saldi.put(SLD_GRUPPO,gruppo); saldi.put(SLD_CONTO, conto); saldi.put(SLD_SOTTOCONTO,sottoconto); - saldi.put(SLD_FLSCA, ""); - - if (saldi.read() != NOERR) + if ((gruppo != 0 || conto != 0 || sottoconto != 0L) && saldi.read() != NOERR) { rmov.readat(nrec); return true; @@ -1849,6 +1861,7 @@ bool TListaMov_application::segnala_errori_iva() _esiste_riga_iva = true; return true; } + const TString4 cod = rec.get(RMI_CODIVA); real percind; const int tipodet = get_tipodet_from_rmi(rec, mov, percind); @@ -1967,7 +1980,7 @@ void TListaMov_application::filtra_cursore_provvisori(TCursor* cur) const void TListaMov_application::imposta_parametri_stampa(const TMask& msk) { - set_magic_currency(TRUE); + set_magic_currency(true); reset_files(); _curr1->set_filterfunction (filter_func); @@ -2167,7 +2180,7 @@ void TListaMov_application::init_print(const TMask& msk) printer().setdate(data); printer().footerlen(5); - set_magic_currency(TRUE); + set_magic_currency(true); switch (_tipo_lista) { @@ -2190,9 +2203,12 @@ void TListaMov_application::init_print(const TMask& msk) _stampa_mess_alleg_iva = msk.get_bool(F_ALLEGATO); if (_stampa_mess_alleg_iva) _flags |= ST_MESS_ALLEG; - _stampa_anno_comp = msk.get_bool(F_ANNOC); - if (_stampa_anno_comp) - _flags |= ST_ANNO_COMP; + _stampa_anno_comp = msk.get_bool(F_ANNOC); + if (_stampa_anno_comp) + _flags |= ST_ANNO_COMP; + _stampa_sospesi = msk.get_bool(F_SEGNALA_SOSPESI); + if (_stampa_sospesi) + _flags |= ST_SOSPESI; _controllo_mov_errati = msk.get_int(F_CONTROLLO); if (_controllo_mov_errati == 1) _flags |= ST_SOLO_MOVERR; @@ -2251,7 +2267,7 @@ void TListaMov_application::init_print(const TMask& msk) //resettaggio di tutte le incasinatissime variabili membro...(membro stara' per cazzo?) _flags = 0; reset_print(); - _settata_prima_riga = FALSE; + _settata_prima_riga = false; _tipo_clifo_prec = ""; _codcf_prec = 0l; _numeroregp = 0; @@ -2322,8 +2338,8 @@ void TListaMov_application::preprocess_header() int soh = 1; // riga d'inizio dell'intestazione TString sep(132); - TString key; key.format("%d", get_firm()); - const TString & ragsoc = cache().get(LF_NDITTE, key, NDT_RAGSOC); + TAnagrafica ditta(LF_NDITTE, get_firm(), _data_fin); + const TString & ragsoc = ditta.ragione_sociale(); reset_header(); sep << TR("Ditta ") << get_firm(); @@ -2506,12 +2522,12 @@ int cg3100(int argc, char* argv[]) const char tipo = argc > 2 ? toupper(*argv[2]) : 'M'; TListaMov_application a(tipo); - const char* title = NULL; + const char* title = nullptr; switch (tipo) { case 'C': title = TR("Lista fatture clienti/fornitori"); break; default : title = TR("Lista movimenti"); break; } a.run(argc, argv, title); - return TRUE; + return true; } diff --git a/src/cg/cg3100.h b/src/cg/cg3100.h index 53ff2e5da..d0cff7b29 100755 --- a/src/cg/cg3100.h +++ b/src/cg/cg3100.h @@ -45,6 +45,7 @@ #ifdef CONT_SEP #define F_CONTSEP 148 #endif +#define F_SEGNALA_SOSPESI 149 #define ST_DATA 0x0001 #define ST_NUMERO 0x0002 @@ -62,6 +63,7 @@ #define ST_COMPLETA_CAUS 0x2000 #define ST_COMPLETA_REG 0x4000 #define ST_CODICE 0x8000 +#define ST_SOSPESI 0x10000 diff --git a/src/cg/cg3100a.uml b/src/cg/cg3100a.uml index 75cc36788..68808343b 100755 --- a/src/cg/cg3100a.uml +++ b/src/cg/cg3100a.uml @@ -52,9 +52,9 @@ BEGIN ADD RUN cg0 -5 esc END -RADIOBUTTON F_MOVIMENTI 41 +LIST F_MOVIMENTI 41 BEGIN - PROMPT 30 3 "Scelta stampa " + PROMPT 30 3 "Scelta stampa " HELP "Indicare il tipo di stampa" ITEM "0|Lista movimenti" MESSAGE SHOW,F_CONTROLLO|SHOW,F_REGISTROFIN|SHOW,F_REGISTROINI|SHOW,F_STAMPA|HIDE,1@|RESET,1@ @@ -65,7 +65,7 @@ END LIST F_CONTROLLO 23 BEGIN - PROMPT 2 7 "Controllo movimenti errati " + PROMPT 2 4 "Controllo movimenti errati " HELP "Indicare il tipo di controllo per movimenti errati" ITEM "3|No" MESSAGE HIDE,1@|RESET,1@|ENABLE,F_STAMPA ITEM "2|Si" MESSAGE SHOW,1@ @@ -75,21 +75,27 @@ END TEXT DLG_NULL BEGIN GROUP 1 - PROMPT 2 8 "Stampa messaggi : " + PROMPT 2 5 "Stampa messaggi : " END BOOLEAN F_ANNOC BEGIN GROUP 1 - PROMPT 20 8 "Anno di competenza " + PROMPT 20 5 "Anno di competenza " HELP "Indicare se stampa l'anno di competenza" GROUP 5 END +BOOLEAN F_SEGNALA_SOSPESI +BEGIN + PROMPT 60 5 "Elementi sospesi" + GROUP 1 +END + BOOLEAN F_ALLEGATO BEGIN GROUP 1 - PROMPT 44 8 "Allegato iva " + PROMPT 44 5 "Allegato iva " HELP "Indicare se stampare l'allegato IVA" MESSAGE TRUE DISABLE,F_STAMPA|COPY,F_STAMPA MESSAGE FALSE ENABLE,F_STAMPA @@ -98,12 +104,12 @@ END BOOLEAN F_COMPETENZA BEGIN - PROMPT 2 9 "Stampa i soli movimenti con competenza nell'esercizio precedente" + PROMPT 2 6 "Stampa i soli movimenti con competenza nell'esercizio precedente" END RADIOBUTTON F_DECIDI 12 BEGIN - PROMPT 2 10 "Stampa " + PROMPT 2 7 "Stampa " HELP "Indicare il criterio di scelta dei movimenti" ITEM "2|data" MESSAGE DISABLE,2@|RESET,2@|ENABLE,3@ ITEM "1|numero" MESSAGE DISABLE,3@|RESET,3@|ENABLE,2@ @@ -112,21 +118,21 @@ END DATE F_DATAINI BEGIN HELP "Data da cui iniziare la stampa" - PROMPT 16 11 "Stampa mov. dalla data " + PROMPT 16 8 "Stampa mov. dalla data " GROUP 3 END DATE F_DATAFIN BEGIN HELP "Data fino a cui stampare i movimenti" - PROMPT 52 11 "alla data " + PROMPT 52 8 "alla data " GROUP 3 END NUMBER F_NUMEROINI 7 BEGIN HELP "Numero del movimento da cui iniziare la stampa" - PROMPT 16 12 "Stampa mov. dal numero " + PROMPT 16 9 "Stampa mov. dal numero " USE LF_MOV KEY 1 INPUT NUMREG F_NUMEROINI DISPLAY "Numero@7" NUMREG @@ -141,7 +147,7 @@ END NUMBER F_NUMEROFIN 7 BEGIN HELP "Numero del movimenti fino cui fare la stampa" - PROMPT 52 12 "al numero " + PROMPT 52 9 "al numero " COPY USE F_NUMEROINI INPUT NUMREG F_NUMEROFIN COPY DISPLAY F_NUMEROINI @@ -155,7 +161,7 @@ END STRING F_CAUSALEINI 3 BEGIN - PROMPT 2 14 "Stampa dalla causale " + PROMPT 2 11 "Stampa dalla causale " USE LF_CAUSALI KEY 1 INPUT CODCAUS F_CAUSALEINI DISPLAY "Codice causale" CODCAUS @@ -168,7 +174,7 @@ END STRING F_CAUSALEFIN 3 BEGIN - PROMPT 40 14 "alla causale " + PROMPT 40 11 "alla causale " COPY USE F_CAUSALEINI INPUT CODCAUS F_CAUSALEFIN DISPLAY "Codice causale" CODCAUS @@ -181,7 +187,7 @@ END STRING F_REGISTROINI 3 BEGIN - PROMPT 2 15 "Stampa dal registro iva " + PROMPT 2 12 "Stampa dal registro iva " USE REG SELECT I0<"3" INPUT CODTAB[1,4] F_ANNO INPUT CODTAB[5,7] F_REGISTROINI @@ -197,7 +203,7 @@ END STRING F_REGISTROFIN 3 BEGIN - PROMPT 40 15 "al reg. iva " + PROMPT 40 12 "al reg. iva " COPY USE F_REGISTROINI INPUT CODTAB[1,4] F_ANNO INPUT CODTAB[5,7] F_REGISTROFIN @@ -213,14 +219,14 @@ END BOOLEAN F_STAMPA BEGIN - PROMPT 2 16 "Stampa imponibili, imposte e codici iva " + PROMPT 2 13 "Stampa imponibili, imposte e codici iva " HELP "Indicare se stampare i valori degli imponibili, delle imposte e i codici IVA" GROUP 5 END LIST F_STAMPAMOVP 16 BEGIN - PROMPT 2 17 "Tipo lista " + PROMPT 2 14 "Tipo lista " ITEM "1|Normale" ITEM "2|Globale" ITEM "3|Solo provvisori" @@ -229,7 +235,7 @@ END #ifdef CONT_SEP STRING F_CONTSEP 6 BEGIN - PROMPT 2 19 "Contabilità separata " + PROMPT 2 16 "Contabilità separata " USE &NPENT INPUT CODTAB F_CONTSEP DISPLAY "Codice@6" CODTAB @@ -239,5 +245,6 @@ BEGIN MODULE NP END #endif + ENDPAGE ENDMASK diff --git a/src/cg/cg3200.cpp b/src/cg/cg3200.cpp index 7ad518217..820390f37 100755 --- a/src/cg/cg3200.cpp +++ b/src/cg/cg3200.cpp @@ -297,7 +297,7 @@ bool TMastrini_application::sottoc_handler_ini(TMask_field& f, KEY key) } } - return TRUE; + return true; } bool TMastrini_application::sottoc_handler_fine(TMask_field& f, KEY key) @@ -321,7 +321,7 @@ bool TMastrini_application::sottoc_handler_fine(TMask_field& f, KEY key) return f.warning_box(TR("Manca il GRUPPO")); if (!app().check_ordine(f,key)) - return FALSE; + return false; } if ( key == K_TAB && m.is_running()) @@ -366,7 +366,7 @@ bool TMastrini_application::sottoc_handler_fine(TMask_field& f, KEY key) } } } - return TRUE; + return true; } bool TMastrini_application::gruppo_hnd (TMask_field& f, KEY k) @@ -377,7 +377,7 @@ bool TMastrini_application::gruppo_hnd (TMask_field& f, KEY k) int gruppof = m.get_int(F_GRUPPOFINE); if (gruppof == 0) - return TRUE; + return true; int gruppoi = m.get_int(F_GRUPPOINI); @@ -385,7 +385,7 @@ bool TMastrini_application::gruppo_hnd (TMask_field& f, KEY k) return f.error_box(TR("Il gruppo di partenza deve essere inferiore o uguale al gruppo di arrivo")); } - return TRUE; + return true; } bool TMastrini_application::contoi_hnd (TMask_field& f, KEY k) @@ -426,7 +426,7 @@ bool TMastrini_application::contoi_hnd (TMask_field& f, KEY k) } } - return TRUE; + return true; } bool TMastrini_application::contof_hnd (TMask_field& f, KEY k) @@ -439,14 +439,14 @@ bool TMastrini_application::contof_hnd (TMask_field& f, KEY k) int gruppof = m.get_int(F_GRUPPOFINE); if (gruppof == 0) - return TRUE; + return true; // char tipo = m.get(F_TIPOCF_INI)[0]; int gruppoi = m.get_int(F_GRUPPOINI); if (gruppoi < gruppof) - return TRUE; + return true; int contof = m.get_int(id); int contoi = m.get_int(F_CONTOINI_CONTO); @@ -492,7 +492,7 @@ bool TMastrini_application::contof_hnd (TMask_field& f, KEY k) } } - return TRUE; + return true; } bool TMastrini_application::check_ordine(TMask_field& f, KEY k) @@ -501,18 +501,18 @@ bool TMastrini_application::check_ordine(TMask_field& f, KEY k) const int gruppof = m.get_int(F_GRUPPOFINE); if (gruppof == 0) - return TRUE; + return true; const int gruppoi = m.get_int(F_GRUPPOINI); if (gruppoi < gruppof) - return TRUE; + return true; int contof = m.get_int(F_CONTOFINE_CONTO); int contoi = m.get_int(F_CONTOINI_CONTO); if (contoi < contof) - return TRUE; + return true; long sottocf = m.get_long(F_SOTTOCFINE_CONTO); long sottoci = m.get_long(F_SOTTOCINI_CONTO); @@ -520,7 +520,7 @@ bool TMastrini_application::check_ordine(TMask_field& f, KEY k) if (sottoci > sottocf) return f.error_box(TR("Il sottoconto di partenza deve essere inferiore o uguale al sottoconto di arrivo")); - return TRUE; + return true; } bool TMastrini_application::memorizza_handler(TMask_field& f, KEY k) @@ -534,7 +534,7 @@ bool TMastrini_application::memorizza_handler(TMask_field& f, KEY k) m.set_focus_field(F_TIPOCF_INI); } } - return TRUE; + return true; } bool TMastrini_application::scelte_notify(TSheet_field& s, int r, KEY k) @@ -582,6 +582,7 @@ bool TMastrini_application::almeno_un_record() const int annoes = rmov.get_int (RMV_ANNOES); const TString4 provvis (mov.get(MOV_PROVVIS)); const TDate datareg = get_filter_date(mov, rmov); + if ( ((annoes==_annomsk) || (_annomsk==0)) && ((datareg>=_data_ini) && (datareg<=fine)) && (_stampa_mov_prov || provvis.blank())) { trovato = true; @@ -609,10 +610,7 @@ bool TMastrini_application::data_inizio(TMask_field& f, KEY k) if (data.ok()) { if (data < app()._data_inizioese || data > app()._data_finese) - { - f.error_box(TR("La data non appartiene all'esercizio indicato")); - return FALSE; - } + return f.error_box(TR("La data non appartiene all'esercizio indicato")); else app()._data_ini = data; } @@ -628,7 +626,7 @@ bool TMastrini_application::data_inizio(TMask_field& f, KEY k) app()._data_ini = data; } } - return TRUE; + return true; } bool TMastrini_application::data_fine(TMask_field& f, KEY k) @@ -649,10 +647,7 @@ bool TMastrini_application::data_fine(TMask_field& f, KEY k) if (data.ok()) { if (data < app()._data_inizioese || data > app()._data_finese) - { - f.error_box(TR("La data non appartiene all'esercizio indicato")); - return FALSE; - } + return f.error_box(TR("La data non appartiene all'esercizio indicato")); else app()._data_fine = data; } @@ -670,12 +665,9 @@ bool TMastrini_application::data_fine(TMask_field& f, KEY k) } if (data < data_ini) - { - f.error_box(TR("La data finale non puo' essere inferiore alla data di partenza")); - return FALSE; - } + return f.error_box(TR("La data finale non puo' essere inferiore alla data di partenza")); } - return TRUE; + return true; } void TMastrini_application::fai_stampa132() @@ -853,7 +845,7 @@ void TMastrini_application::fai_stampa198() { if (_sottocontocontr > 0) { - conto(_gruppocontr,_contocontr,FALSE); + conto(_gruppocontr,_contocontr,false); TBill tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr); _descrcontr.cut(0); _descrcontr << _g_contr << ' ' << _c_contr << ' ' << _s_contr << ' ' << tc.descrizione(); @@ -903,7 +895,7 @@ void TMastrini_application::stampa_totali132() set_row (_rw,"@100g%r", &_totprogre_avere_al); } - _devi_stampare_footer = FALSE; + _devi_stampare_footer = false; } const char* TMastrini_application::real2str(const real& r) const @@ -1063,7 +1055,7 @@ void TMastrini_application::stampa_totali132_II() if (_item_lista <= diff) _lista.destroy(); - _devi_stampare_footer = FALSE; + _devi_stampare_footer = false; } void TMastrini_application::stampa_totali198() @@ -1101,7 +1093,7 @@ void TMastrini_application::stampa_totali198() set_row (_rw,"@135g%r", &_saldo_progre_al); } - _devi_stampare_footer = FALSE; + _devi_stampare_footer = false; } void TMastrini_application::carica_array_totali198() @@ -1259,7 +1251,7 @@ void TMastrini_application::stampa_totali198_II() if (_item_lista <= diff) _lista.destroy(); - _devi_stampare_footer = FALSE; + _devi_stampare_footer = false; } void TMastrini_application::setta_riga (int r, const TString& riga) @@ -1274,7 +1266,7 @@ void TMastrini_application::setta_riga (int r, const TString& riga) bool TMastrini_application::preprocess_page(int file, int counter) { if (counter) - return TRUE; + return true; switch (file) { @@ -1282,7 +1274,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) { // Usati in crea_intestazione() - _devi_stampare_footer = TRUE; + _devi_stampare_footer = true; if (_nummast == 3 || _nummast == 2) { @@ -1295,16 +1287,16 @@ bool TMastrini_application::preprocess_page(int file, int counter) _conto = saldi.get_int(SLD_CONTO); _sottoc = saldi.get_long(SLD_SOTTOCONTO); - _cambia_mastrino = TRUE; + _cambia_mastrino = true; const int annoes = saldi.get_int(SLD_ANNOES); - conto(_gruppo,_conto,TRUE); + conto(_gruppo,_conto,true); if (annoes != _anno_corrente && annoes != _anno_precedente) - return FALSE; + return false; if (_g_prec == _gruppo && _c_prec == _conto && _s_prec == _sottoc) - return FALSE; + return false; _g_prec = _gruppo; _c_prec = _conto; @@ -1328,7 +1320,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) _saldo_progre_prec = ZERO; if (_selez_mastrini == 2) { - calcola_progressivi(TRUE); + calcola_progressivi(true); _totale_saldo = _saldo_progre_prec; } @@ -1337,7 +1329,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) if ((_selez_mastrini == 1 && almeno_un_record()) || (_selez_mastrini == 2 && _totale_saldo != ZERO)) { - _puoi_stampare = TRUE; + _puoi_stampare = true; if (_nummast == 3 || _nummast == 2) { @@ -1359,8 +1351,8 @@ bool TMastrini_application::preprocess_page(int file, int counter) } else { - _puoi_stampare = FALSE; - return FALSE; + _puoi_stampare = false; + return false; } } else @@ -1369,12 +1361,12 @@ bool TMastrini_application::preprocess_page(int file, int counter) calcola_progressivi(); if (_progredare == ZERO && _progreavere == ZERO && !almeno_un_record()) { - _puoi_stampare = FALSE; - return FALSE; + _puoi_stampare = false; + return false; } else { - _puoi_stampare = TRUE; + _puoi_stampare = true; if (_nummast == 3 || _nummast == 2) { @@ -1403,7 +1395,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) //In quest'ultimo caso infatti quando vado a pagina nuova devo stampare l'intestazione //ma senza il flag rischio di stamparla due volte. if (_nummast == 3) - _gia_stampata_intestazione = FALSE; + _gia_stampata_intestazione = false; if (_nummast == 1 || _nummast == 3) _rw = 1; @@ -1529,7 +1521,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) else if (_descrizionemov == "") { - conto(_gruppocontr,_contocontr,FALSE); + conto(_gruppocontr,_contocontr,false); TBill tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr); _descrcontr = tc.descrizione(); *_d18 = (const char*) _descrcaus; @@ -1570,7 +1562,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) } else { - conto(_gruppocontr,_contocontr,FALSE); + conto(_gruppocontr,_contocontr,false); TBill tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr); _descrcontr = tc.descrizione(); *_d22 = (const char*) _descrcaus; @@ -1607,7 +1599,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) } else { - conto(_gruppocontr,_contocontr,FALSE); + conto(_gruppocontr,_contocontr,false); TBill tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr); _descrcontr = tc.descrizione(); d18 = _descrcaus; @@ -1656,7 +1648,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) } else { - conto(_gruppocontr,_contocontr,FALSE); + conto(_gruppocontr,_contocontr,false); TBill tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr); _descrcontr = tc.descrizione(); d23 = _descrcaus; @@ -1713,12 +1705,12 @@ bool TMastrini_application::preprocess_page(int file, int counter) if (_item >= diff) { lim = diff - 1; - stampa_riporti = TRUE; + stampa_riporti = true; } else { lim = _item; - stampa_riporti = FALSE; + stampa_riporti = false; } _indice_array = 0; @@ -1793,7 +1785,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) dep_dare = _riporto_footer_dare; dep_avere = _riporto_footer_avere; - _stampa_footer_si = FALSE; + _stampa_footer_si = false; } else { @@ -1833,7 +1825,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) rmov.prev(); _riga.destroy(); _item = 0; - return TRUE; + return true; } _rw--; } @@ -1923,22 +1915,22 @@ bool TMastrini_application::preprocess_page(int file, int counter) } _rw = 1; - return TRUE; + return true; } else - return FALSE; + return false; } else - return FALSE; + return false; } else - return FALSE; + return false; break; } default: break; } - return TRUE; + return true; } void TMastrini_application::set_page(int file, int counter) @@ -1971,8 +1963,8 @@ print_action TMastrini_application::postprocess_page(int file, int counter) printer().formfeed(); //fatto solo quando seleziono un mastrino per pagina reset_print(); // per evitare che stampi di nuovo il totale prec. - _stampa_progressivi_si = TRUE; - _stampa_footer_si = TRUE; + _stampa_progressivi_si = true; + _stampa_footer_si = true; _riporto_dare = ZERO; _riporto_avere = ZERO; _riporto_footer_dare = ZERO; @@ -1992,8 +1984,8 @@ print_action TMastrini_application::postprocess_page(int file, int counter) if (counter && item_lista == 0) { reset_print(); // per evitare che stampi di nuovo il totale prec. - _stampa_progressivi_si = TRUE; - _stampa_footer_si = TRUE; + _stampa_progressivi_si = true; + _stampa_footer_si = true; _riporto_dare = ZERO; _riporto_avere = ZERO; _riporto_footer_dare = ZERO; @@ -2106,7 +2098,7 @@ print_action TMastrini_application::postprocess_page(int file, int counter) } } -// _stampa_progressivi_si = TRUE; +// _stampa_progressivi_si = true; return REPEAT_PAGE; } case LF_RMOV: @@ -2225,11 +2217,11 @@ bool TMastrini_application::preprocess_print(int file, int counter) _flag_del_cazzo = _nummast == 1; - _stampa_progressivi_si = TRUE; - _stampa_footer_si = TRUE; + _stampa_progressivi_si = true; + _stampa_footer_si = true; } - return TRUE; + return true; } bool TMastrini_application::set_print(int m) @@ -2349,13 +2341,13 @@ bool TMastrini_application::set_print(int m) if (_stampatotiva) _b.destroy(); - //_inizio_stampa = TRUE; + //_inizio_stampa = true; _numero_pag = 1; if (_nummast == 3) _pagina = 0; else _pagina = 1; - _cambia_mastrino = FALSE; + _cambia_mastrino = false; _rw = 0; _conta_mastrini = 0; _indice_lista = 0; @@ -2381,7 +2373,7 @@ bool TMastrini_application::set_print(int m) _msk->reset(-8); } - return FALSE; + return false; } void TMastrini_application::data_fine_esercizio(int anno) @@ -2446,7 +2438,7 @@ void TMastrini_application::preprocess_footer() dep_dare = _stampato ? _riporto_footer_dare : _riporto_footer_dare - imp_d; dep_avere = _stampato ? _riporto_footer_avere : _riporto_footer_avere - imp_a; - _stampa_footer_si = FALSE; + _stampa_footer_si = false; } else { @@ -2546,7 +2538,7 @@ void TMastrini_application::crea_intestazione() { if (_nummast != 3) _pagina = 1; - _cambia_mastrino = FALSE; + _cambia_mastrino = false; } if (_numcarat == 1) { @@ -2698,7 +2690,7 @@ void TMastrini_application::crea_intestazione() } _riporto_dare = _progredare; _riporto_avere = _progreavere; - _stampa_progressivi_si = FALSE; + _stampa_progressivi_si = false; } else { @@ -2756,13 +2748,13 @@ int TMastrini_application::crea_intestazione(int start_riga) _conta_mastrini++; if (_nummast == 3) - _gia_stampata_intestazione = TRUE; + _gia_stampata_intestazione = true; if (_nummast == 2) if (_cambia_mastrino) { _numero_pag = 1; - _cambia_mastrino = FALSE; + _cambia_mastrino = false; } if (_nummast == 3) { @@ -2876,7 +2868,7 @@ int TMastrini_application::stampa_progre_riporto(int start_riga) r = stampa_progressivi(r); _riporto_dare = _progredare; _riporto_avere = _progreavere; - _stampa_progressivi_si = FALSE; + _stampa_progressivi_si = false; } else { @@ -3073,9 +3065,9 @@ void TMastrini_application::calcola_progressivi(bool finali) saldo = _sld->saldo(); #else - // W96SALDI del 18-07-96 saldofin_esprec usa il flag TRUE xche' deve + // W96SALDI del 18-07-96 saldofin_esprec usa il flag true xche' deve // considerare anche il saldo finale - saldo = _sld->saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc,TRUE, _stampa_mov_prov); + saldo = _sld->saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc,true, _stampa_mov_prov); #endif saldi.readat(pos); @@ -3461,10 +3453,10 @@ void TMastrini_application::ricerca_gruppo() TString80 descr,descriz,descriz2,dep; TString dataini,datafine; - ricerca_classe_IV (TRUE); //Esiste a livello di sottoconto + ricerca_classe_IV (true); //Esiste a livello di sottoconto if (_sezivd == '0') //Non esiste a livello di sottoconto - ricerca_classe_IV (FALSE); //Allora la cerco a livello di conto + ricerca_classe_IV (false); //Allora la cerco a livello di conto descriz = descrizione_classe(_sezivd,_lettivd,_numrivd_int,_numivd); if (_numivd.not_empty()) //Ora devo stampare la descrizione del livello della @@ -3536,10 +3528,10 @@ int TMastrini_application::ricerca_gruppo(int start) TString dataini,datafine; int r = start; - ricerca_classe_IV (TRUE); //Esiste a livello di sottoconto + ricerca_classe_IV (true); //Esiste a livello di sottoconto if (_sezivd == '0') //Non esiste a livello di sottoconto - ricerca_classe_IV (FALSE); //Allora la cerco a livello di conto + ricerca_classe_IV (false); //Allora la cerco a livello di conto descriz = descrizione_classe(_sezivd,_lettivd,_numrivd_int,_numivd); if (_numivd.not_empty()) //Ora devo stampare la descrizione del livello della @@ -3713,7 +3705,7 @@ bool TMastrini_application::sheet2mask() id++; } - rows.destroy(0, TRUE); + rows.destroy(0, true); } return ok; } @@ -3782,9 +3774,9 @@ bool TMastrini_application::user_create() TMask& sm = sht.sheet_mask(); set_handlers(&sm); - _gia_stampata_intestazione = FALSE; + _gia_stampata_intestazione = false; - return TRUE; + return true; } bool TMastrini_application::user_destroy() @@ -3799,7 +3791,7 @@ bool TMastrini_application::user_destroy() delete _d22; delete _d30; - return TRUE; + return true; } #ifdef CONT_SEP diff --git a/src/cg/cglib.h b/src/cg/cglib.h index 8e57f8d9c..73b3ad4b1 100644 --- a/src/cg/cglib.h +++ b/src/cg/cglib.h @@ -200,7 +200,7 @@ public: const TEsercizio& operator [](int codice) const { return esercizio(codice); } const TEsercizio& esercizio(const TDate& date) const { return esercizio(date2esc(date)); } - int date2esc(const TDate& date) const; + int date2esc(const TDate& date) const; int date2prevesc(const TDate& date) const; int date2nextesc(const TDate& date) const; int pred(int codice) const; @@ -337,6 +337,7 @@ public: const TString & tipo_doc() const; const TString & codice_registro() const { return _rec.get(CAU_REG); } const TString & causale_770() const { return _rec.get(CAU_M770); } + bool causale_sospesa() const { return _rec.get_bool(CAU_SOSPESO); } const TRegistro& reg() const; TipoIVA iva() const { return _iva; } int regime_speciale() const; @@ -491,7 +492,8 @@ public: const TBill& add_to(TToken_string& ts, int from, int mode = 0); const TBill& operator=(const TBill& b) { return copy(b); } - bool empty() const { return _gruppo==0 && _conto==0 && _sottoconto == 0; } + bool empty() const { return _gruppo == 0 && _conto == 0 && _sottoconto == 0; } + bool full() const { return !empty(); } char tipo() const; int gruppo() const { return _gruppo; } @@ -658,7 +660,7 @@ public: { return prg_saldo(i, c, p1, p2, TRUE); } - + const real& saldo() const { return _saldo; } const real& saldoini() const { return _saldo_iniziale; } const real& saldoinisusaldi() const { return _saldoiniziale; } @@ -1412,7 +1414,7 @@ class TAnagrafica : public TObject TDate _data_nasc; int _allegato, _stato_estero, _stato_nasc; - + protected: void build_ind_res(const TRectype& rec, const char* ind, const char* civ); void split_ragsoc(); diff --git a/src/cg/cglib01.cpp b/src/cg/cglib01.cpp index 91ecdc2a7..db696fc7b 100755 --- a/src/cg/cglib01.cpp +++ b/src/cg/cglib01.cpp @@ -72,7 +72,10 @@ bool TCausale::read(const char* cod, int year) { _rec = cache().get(LF_CAUSALI, cod); if (_rec.empty()) + { + _rec.zero(); return false; + } _provvisorio = _rec.get_char(CAU_PROVV); TLocalisamfile rcaus(LF_RCAUSALI); @@ -88,11 +91,6 @@ bool TCausale::read(const char* cod, int year) add(rcaus.curr(), riga); } - /* const TString4 codreg(_rec.get(CAU_REG)); - const bool ok = _reg.read(codreg, year); // Read register - if (!ok && codreg.not_empty()) - return error_box(FR("Non esiste il registro '%s' del %d"), - (const char*)codreg, year); */ calcIVA(); } else @@ -634,8 +632,9 @@ int TEsercizi_contabili::esc2index(int codice) const int TEsercizi_contabili::date2esc(const TDate& d) const { - const int i = date2index(d); - return i >= 0 ? esc(i).codice() : 0; + const int i = date2index(d); + + return i >= 0 ? esc(i).codice() : 0; } int TEsercizi_contabili::date2prevesc(const TDate& d) const