From 90058a54bc5c29fd1dff3e64b78efe5eafe4b1b6 Mon Sep 17 00:00:00 2001 From: villa Date: Thu, 5 Jan 1995 12:01:12 +0000 Subject: [PATCH] Aggiunto di nuovo parametro ditta "ricalcolo acquisti per rivendita" e sua gestione in liquidazione git-svn-id: svn://10.65.10.50/trunk@827 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4300.cpp | 1 + cg/cg4300.h | 1 + cg/cg4301.cpp | 16 ++++++++++++++-- cg/cg4303.cpp | 12 ++++++++++-- cg/cg5100a.h | 1 + cg/cg5100a.uml | 11 +++++++++-- cg/prassid.doc | 2 ++ 7 files changed, 38 insertions(+), 6 deletions(-) diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index 63ae55ea9..7e6cc9cbe 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -88,6 +88,7 @@ bool TLiquidazione_app::user_create() _rel = new TRelation(LF_MOV); _rel->add(LF_RMOVIVA,"NUMREG=NUMREG"); + _rel->add(LF_CAUSALI,"CODCAUS=CODCAUS"); _cur = new TCursor(_rel, "", 2); diff --git a/cg/cg4300.h b/cg/cg4300.h index 38befd8d2..ccf656a9b 100755 --- a/cg/cg4300.h +++ b/cg/cg4300.h @@ -174,6 +174,7 @@ class TLiquidazione_app : public TPrint_application bool _isriepilogo; // 13a liq bool _isservizio; // servizi, professionisti, artisti bool _isrimborso; // vuole il rimborso infraannuale + bool _isricacq; // ricalcolo imposte acq. riv (par. ditta) bool _calcall; // tutte le ditte nessuna esclusa bool _isbase; // stampa base di calcolo acconto tbc _basecalc; // tipo base di calcolo acconto diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index 9bb3db579..e01bb80df 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -6,6 +6,7 @@ #include #include +#include #include "cg4300.h" // -------------------- QUI comincia l'avventura -------------------------- @@ -102,6 +103,9 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) _lim->put("R6",""); _lim->rewrite(); + TConfig cnf(CONFIG_DITTA, "cg"); + _isricacq = cnf.get_bool("RicAcq"); + // ricalcolo normale ok = _lim->get_bool("B0"); if (ok && !recalc) return TRUE; @@ -348,6 +352,13 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) */ if (_reg->get_bool("B1")) continue; + + /* + * Fatture in ritardo vengono considerate solo in dichiarazione + * annuale + */ + if (!_isannual && _cur->curr(LF_CAUSALI).get_bool("RITFATT")) + continue; /* * check date se si calcola l'acconto @@ -392,8 +403,9 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) totintra += imposta; // Altre cose di cui tener conto - if (tipomov == acquisto && (tipocr == 1 || tipocr == 5)) - // Acquisto beni per rivendita + if (tipomov == acquisto && (tipocr == 1 || tipocr == 5) && _isricacq) + // Acquisto beni per rivendita (solo se l'apposito parametro ditta + // e' settato) { acq_riv += imponibile; acq_riv_iva += imposta; diff --git a/cg/cg4303.cpp b/cg/cg4303.cpp index 12534a3d4..a9aa7a359 100755 --- a/cg/cg4303.cpp +++ b/cg/cg4303.cpp @@ -132,8 +132,16 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt) for (_pim->first(); !_pim->eof(); _pim->next()) { // se e' acquisto beni per rivendita - int tipocr = atoi(*_pim_tipocr); - int mese = atoi(*_pim_mese); + int tipocr = atoi(*_pim_tipocr); + int mese = atoi(*_pim_mese); + int tipodet = atoi(*_pim_tipodet); + + // se non si e' settato il ricalcolo nei parametri ditta + // considera soltanto quelli con detraibilita' == 3 + // (passaggi interni) + if (!_isricacq && tipodet != 3) + continue; + TString att(codatt); if (tipocr == 1 && mese == m && att == (const char*)(*_pim_codatt)) diff --git a/cg/cg5100a.h b/cg/cg5100a.h index 46c6d48e5..08e1fcbc3 100755 --- a/cg/cg5100a.h +++ b/cg/cg5100a.h @@ -53,3 +53,4 @@ #define FLD_DCSUECE 152 #define FLD_DCSPECE 153 #define FLD_DESLIN 154 +#define CHK_RICACQ 155 \ No newline at end of file diff --git a/cg/cg5100a.uml b/cg/cg5100a.uml index 6b26f9935..bf927c85f 100755 --- a/cg/cg5100a.uml +++ b/cg/cg5100a.uml @@ -59,9 +59,16 @@ BEGIN FIELD RifPar END -GROUPBOX DLG_NULL 76 11 +GROUPBOX DLG_NULL 76 12 BEGIN - PROMPT 2 7 "" + PROMPT 2 6 "" +END + +BOOLEAN CHK_RICACQ +BEGIN + PROMPT 4 7 "Ricalcolo imposte acquisti per rivendita " + HELP "Indicare se attivare il calcolo IVA acquisti per rivendita nel calcolo ventilazione" + FIELD RicAcq END BOOLEAN CHK_GSLBCN diff --git a/cg/prassid.doc b/cg/prassid.doc index 4c2508c51..bd8ff0c20 100755 --- a/cg/prassid.doc +++ b/cg/prassid.doc @@ -20,6 +20,8 @@ StTfFr = StLgiU = # Gestione saldaconto GesSal = +# Ricalcolo imposte degli acquisti destinati a rivendita +RicAcq = # N. rif. allineato a destra per clienti e fornitori NrCliDx = NrForDx =