From 1de31e18c39d0a5e8f2a53a0f59ea9e19271113b Mon Sep 17 00:00:00 2001 From: villa Date: Fri, 20 Jan 1995 10:41:57 +0000 Subject: [PATCH] Introdotta inibizione per calcolo gia' stampato su bollato solo se da stampa registri git-svn-id: svn://10.65.10.50/trunk@894 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4300.cpp | 13 +++++++++---- cg/cg4300.h | 2 ++ cg/cg4301.cpp | 33 +++++++++++++++++++++++++-------- cg/cg4302.cpp | 2 +- cg/cg4303.cpp | 12 +++++++----- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index dc1b1246e..125978209 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -26,11 +26,13 @@ TLiquidazione_app::TLiquidazione_app() : _ditte(NULL), _selected(10000), _year(4), _nomiditte(100) { - _isprint = _is_interactive = TRUE; _recalc = needed; + _isprint = _is_interactive = _canprint = TRUE; _isplafond = _printonly = _is_visliq = FALSE; _isvent = _isagricolo = _isbenzinaro = _isviaggio = FALSE; _row = 1; _what = all; _comp_acconto = FALSE; _isriepilogo = FALSE; _calcall = FALSE; + _isfinal = _isregis = FALSE; + _recalc = needed; } bool TLiquidazione_app::user_create() @@ -77,9 +79,12 @@ bool TLiquidazione_app::user_create() { _year = subj.get(0); _month = subj.get_int(1); - ditta = subj.get_long(2); - recalc_only = *(subj.get(3)) == 'C'; - _is_visliq = *(subj.get(3)) == 'V'; + ditta = subj.get_long(2); + char rcl = *(subj.get(3)); + recalc_only = rcl == 'C'; + _is_visliq = rcl == 'V'; + _isregis = (rcl == 'l' || rcl == 'L'); // stampa per registri + _isfinal = rcl == 'l'; // se l minuscolo, definitivo printdate = subj.get(4); filename = subj.get(5); is_header = subj.items() == 6; diff --git a/cg/cg4300.h b/cg/cg4300.h index 42e0787cf..78d4bf049 100755 --- a/cg/cg4300.h +++ b/cg/cg4300.h @@ -179,6 +179,8 @@ class TLiquidazione_app : public TPrint_application bool _isdifferita; // liquidazione differita bool _calcall; // tutte le ditte nessuna esclusa bool _isbase; // stampa base di calcolo acconto + bool _isfinal; // stampa definitiva (su registro bollato) + bool _isregis; // stampa per registro tbc _basecalc; // tipo base di calcolo acconto TString _freqviva; // frequenza versamenti (M|T} long _n_ditte; // numero ditte diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index ab2c6ec0f..fad23120c 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -106,7 +106,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) // stato effettuato per scelta dello stronzo commercialista. look_lim(month, TRUE); - + + if (_isregis && _lim->get_bool("B1")) + return TRUE; + TConfig cnf(CONFIG_DITTA, "cg"); _isdifferita = cnf.get_bool("GeLiDi"); TConfig cnf1(CONFIG_STUDIO, "cg"); @@ -362,7 +365,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) continue; /* - * Tipo documento da eliminare (Scudler 1994) + * Tipo documento da eliminare (Scudler 1994) + * Trattasi per lo piu' di non incassati */ if (tipodoc == "SN" || tipodoc == "CN" || tipodoc == "RN" || tipodoc == "IN" || tipodoc == "PG") @@ -873,7 +877,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) } void TLiquidazione_app::write_liq(int month, const char* codatts) - // Calcolo liq. mensili e progr. liq. annuali + // Calcolo liq. mensili e liq. annuali { TToken_string atts(codatts); const char* tmpatt; @@ -925,9 +929,10 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) } else { - for (int m = 1; m <= 12; m++) + for (int m = 1; m <= month; m++) { - // ciclo su tutti i mesi del caso (1 o 3, o tutti se annuale) + // ciclo su tutti i mesi del caso (1 o 3; + // tutti se annuale, compreso 13 if (!is_month_ok(m, month)) continue; @@ -989,14 +994,24 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) } look_lim(month,TRUE); - + + /* + * versamenti effettuati: si conteggiano in R0 + * - annuali se annuale + */ + _lim->put("R0",risultato); _lim->put("R2",cred_cost); _lim->put("R3",deb_mens); _lim->put("R4",perc_r); _lim->put("R6",detrazioni); - - if (_freqviva == "T" && risultato.sign() > 0) + + /* + * Interessi dovuti solo da trimestrali in periodica, + * non benzinari + */ + if (_freqviva == "T" && risultato.sign() > 0 && + month < 12 && !_isbenzinaro) { real interesse = interesse_trimestrale(_month); real ivi = risultato * interesse / CENTO; ivi.ceil(ROUND_LIRA); @@ -1004,6 +1019,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) } _lim->put("B0","X"); + if (_isfinal) + _lim->put("B1", "X"); _lim->rewrite(); } diff --git a/cg/cg4302.cpp b/cg/cg4302.cpp index 079189668..9c2eb6704 100755 --- a/cg/cg4302.cpp +++ b/cg/cg4302.cpp @@ -28,7 +28,7 @@ bool TLiquidazione_app::is_month_ok(int x, int mtocalc) // rispetto al regime di liquidazione scelto { bool ret = x == mtocalc; - if (!ret && _freqviva == "T") + if (!ret && _freqviva == "T" && mtocalc != 13) { // aggiusta al trimestre il mese da calcolare mtocalc += 2 - ((mtocalc-1) % 3); diff --git a/cg/cg4303.cpp b/cg/cg4303.cpp index 28229325b..cdd9073f0 100755 --- a/cg/cg4303.cpp +++ b/cg/cg4303.cpp @@ -160,12 +160,14 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt) { look_iva(*_pim_codiva); - // soltanto normali ed esenti IVA sono base di riparto - if (_iva->get("S1").empty() || _iva->get("S1") == "ES") + // base di riparto solo se non esente, non soggetto, non imponibile + TString tipoiva(_iva->get("S1")); + + if (tipoiva != "NS" && tipoiva != "NI" && tipoiva != "ES") { - real lurd = _pim->get_real("R0"); - lurd += _pim->get_real("R1"); - real perc = _iva->get_real("R0"); + real lurd = _pim->get_real("R0"); + lurd += _pim->get_real("R1"); + real perc = _iva->get_real("R0"); TString other = _iva->get("S6"); if (!other.empty()) {