From 538add6ec94a9065fdb2df0d720541b8de05073f Mon Sep 17 00:00:00 2001 From: nik Date: Tue, 3 Oct 1995 09:45:08 +0000 Subject: [PATCH] Aggiunta stampa acconti in coda a stampa registri e correzioni varie git-svn-id: svn://10.65.10.50/trunk@1919 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4300.cpp | 3 +- cg/cg4300.h | 8 +++-- cg/cg4301.cpp | 22 ++++++++++-- cg/cg4304.cpp | 93 ++++++++++++++++++++++++++++++++++++++++++++++++-- cg/cg4305.cpp | 5 +-- cg/cg4400.cpp | 6 ++-- cg/cg4900.cpp | 20 ++++++++--- cg/cg4900b.uml | 4 +-- cg/cg4900c.uml | 4 +-- 9 files changed, 142 insertions(+), 23 deletions(-) diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index a31ff0833..60173224d 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -234,7 +234,8 @@ bool TLiquidazione_app::user_create() to.put(MOV_DATAREG, t); _cur->setregion(from, to); _canprint = is_month_ok_strict(_month) || _month == 13; - + _isannual = _isriepilogo = _month == 13; + //modifica del 03/05/1995 int need_refresh = FALSE; for (int m = 1; m < _month; m++) diff --git a/cg/cg4300.h b/cg/cg4300.h index 021933d5b..747a37dc8 100755 --- a/cg/cg4300.h +++ b/cg/cg4300.h @@ -99,6 +99,7 @@ enum tbc { precedente = 1, incorso = 2}; #define DELCRED 16 // header tabulato deleghe ditte a credito #define DELEGA 17 // descrizione versamenti #define PIM_HEAD 18 // bytes sprecati per far vedere l'intestazione pim +#define LIQACC 19 // prospetto liquidazione acconto // ............................................................... // support structs @@ -203,7 +204,8 @@ class TLiquidazione_app : public TPrint_application bool _isservizio; // servizi, professionisti, artisti bool _isrimborso; // vuole il rimborso infraannuale bool _isricacq; // ricalcolo imposte acq. riv (par. ditta) - bool _isdifferita; // liquidazione differita + bool _isdifferita; // liquidazione differita e mese != 13 + bool _isdiffacc; // liq. differita (usato per stampa registri) bool _recalc_only; // solo ricalcolo progressivi bool _calcall; // tutte le ditte nessuna esclusa bool _isbase; // stampa base di calcolo acconto @@ -388,7 +390,8 @@ public: void describe_error(const char* errstr, const char* codatt); void describe_annual(const char* codatt); void describe_consistence(const char* codatt); - + void describe_liqacc(); + _DescrItem* describe_deleghe(int month); // corrispettivi @@ -433,6 +436,7 @@ public: bool set_annual(_DescrItem& d); void set_grand(_DescrItem& d); void set_pim_head(); + void set_liqacc(_DescrItem& d); // cercapalle in tabelle con opzione di creazione se serve bool look_pim(int m, const char* a, const char* r, const char* cr, diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index a2bbf6ea4..1fb91bbc2 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -150,8 +150,12 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) return TRUE; TConfig cnf(CONFIG_DITTA, "cg"); - _isdifferita = cnf.get_bool("GeLiDi") && _month != 13; + _isdiffacc = cnf.get_bool("GeLiDi"); //usato per stampa acconto in coda ai registri + _isdifferita = _isdiffacc && _month != 13; _isintr = !cnf.get_bool("InTrTr") && _freqviva != "M"; + bool gest4 = FALSE; //usato alla riga 342 per stampa acconto + if (_isbenzinaro) + gest4 = cnf.get_bool("GesT74"); // controlla che il periodo corrente non sia l'inizio dell'attivita' // nel caso, differita va a FALSE TDate inatt(_nditte->lfile().get("DINIZIOATT")); @@ -326,8 +330,20 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) if (month == _month && stliq) { describe_firm(month); - describe_liq(_month, atts, _isregis ? NULL : rimb_d); - } + //describe_liq(_month, atts, _isregis ? NULL : rimb_d); + describe_liq(_month, atts, rimb_d); + } + + //in caso di stampa registri e in caso sia + //stato calcolato l'acconto (metodo analitico) + //deve essere stampato il prospetto di liquidazione + //dell'acconto in coda al resto + if (_isregis && stliq) + if ((_month == 12 && _freqviva == "M") || + (_month == 12 && _isbenzinaro && gest4) || + (_isannual && _freqviva == "T" && !_isbenzinaro) || + (_isannual && _isbenzinaro && !gest4)) + describe_liqacc(); } return ok || calc; } diff --git a/cg/cg4304.cpp b/cg/cg4304.cpp index b05080911..8a69ad526 100755 --- a/cg/cg4304.cpp +++ b/cg/cg4304.cpp @@ -5,7 +5,6 @@ // ------------------------------------------------------------ #include - #include "cg4300.h" // flags per annuale @@ -69,6 +68,9 @@ void TLiquidazione_app::set_page(int file, int cnt) break; case THE_END: set_grand(d); + break; + case LIQACC: + set_liqacc(d); break; case ACCONTO: set_acconto_p(d); @@ -82,7 +84,7 @@ void TLiquidazione_app::set_page(int file, int cnt) case DELCRED: set_deltab(d, TRUE); break; - } + } } print_action TLiquidazione_app::postprocess_page(int file, int cnt) @@ -94,7 +96,7 @@ print_action TLiquidazione_app::postprocess_page(int file, int cnt) bool TLiquidazione_app::preprocess_page(int file, int cnt) { - return _descr_arr.items() != 0; + return _descr_arr.items() != 0; } // ---------------------------------------------------------------- @@ -157,6 +159,33 @@ void TLiquidazione_app::describe_firm(int month) _descr_arr.add(d); } +void TLiquidazione_app::describe_liqacc() +{ + if (!_isprint || !_canprint) return; + + if (!look_lia()) return; + + if (_lia->get("S8") != "A") return; + + _DescrItem* d = new _DescrItem(LIQACC); + + d->_r0 = _lia->get_real("R7"); + d->_r1 = _lia->get_real("R13"); + d->_r2 = _lia->get_real("R14"); + d->_r3 = _lia->get_real("R9"); + d->_r4 = _lia->get_real("R10"); + d->_r5 = _lia->get_real("R8"); + d->_r6 = _lia->get_real("R12"); + d->_r7 = _lia->get_real("R11"); + d->_r8 = _lia->get_real("R4"); + TToken_string ff(_lia->get("S1")); + real cre_pre (ff.get(0)); + real acq_intr (ff.get(1)); + d->_r9 = cre_pre; + d->_r10 = acq_intr; + + _descr_arr.add(d); +} void TLiquidazione_app::describe_plafond(int month, const char* codatt) { @@ -1012,6 +1041,64 @@ void TLiquidazione_app::set_plafond(_DescrItem& d) set_auto_ff(); } +void TLiquidazione_app::set_liqacc(_DescrItem& d) +{ + real r1 = d._r0 + d._r1 + d._r2 + d._r3 + d._r4; + real r2 = d._r5 + d._r10; + real r3 = r2 + d._r9 + d._r7 + abs(d._r3); + + set_row(1,""); set_row(2,""); set_row(3,""); set_row(4,""); + set_row(5,"@11gCALCOLO ACCONTO SU OPERAZIONI EFFETTUATE"); + set_row(6,""); + set_row(7,"@72gCredito@90gDebito"); set_row(8,""); + if (!_isdiffacc) + set_row(9,"@11gIva sulle operazioni annotate fino al 20 Dicembre@81g%r", + &(d._r0)); + else set_row(9,"@11gIva sulle operazioni di vendita@81g%r", + &(d._r0)); + int i = 10; + if (!_isdiffacc) + { + set_row(i++,"@11gIva su operazioni fino al 20 Dic., ma non fatturate@81g%r", + &(d._r1)); + set_row(i++,"@11gIva su operazioni fino al 20 Dic., ma non annotate@81g%r", + &(d._r2)); + } + set_row(i,"@11gRettifiche iva a debito"); + if (d._r3.sign() > 0) + set_row(i,"@81g%r", &(d._r3)); + i++; + set_row(i++,"@11gIva chiesta a rimborso@81g%r", &(d._r4)); + set_row(i++,"@11gRISULTATO@81g%r", &r1); + + if (!_isdiffacc) + set_row(i++,"@11gIva sugli acquisti annotati fino al 20 Dicembre@64g%r", + &r2); + else set_row(i++,"@11gIva sulle operazioni di acquisto@64g%r", &r2); + if (d._r6 != ZERO) + set_row(i++,"@11gmeno perc. di prorata pari a lire %r", &(d._r6)); + set_row(i++, "@11gCredito precedente@64g%r", &(d._r9)); + set_row(i, "@11gRettifiche iva a credito"); + if ((d._r3).sign() <= 0) + { + real ab = abs(d._r3); + set_row(i,"@64g%r", &ab); + } + i++; + set_row(i++,"@11gRISULTATO@64g%r", &r3); + if ((d._r8).sign() < 0) + { + real ab = abs(d._r8); + set_row(i++,"@23gCREDITO DA EVIDENZIARE@64g%r", &ab); + } + else if ((d._r8).sign() > 0 && d._r8 > ACCONTO_MINIMO_DA_VERSARE) + set_row(i++,"@23gACCONTO DA VERSARE@81g%r", &(d._r8)); + else if ((d._r8).sign() > 0 && d._r8 <= ACCONTO_MINIMO_DA_VERSARE) + set_row(i++,"@23gACCONTO DA NON VERSARE@64g%r", &(d._r8)); + + set_auto_ff(); +} + void TLiquidazione_app::set_pim_head() { set_bookmark("Riepilogo progressivi", _att_bookmark); diff --git a/cg/cg4305.cpp b/cg/cg4305.cpp index e57f48eeb..7cef14ef5 100755 --- a/cg/cg4305.cpp +++ b/cg/cg4305.cpp @@ -493,7 +493,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina) _year = thyear; } else if (_basecalc == incorso) -{ +{ // that's pazzesc but as it turns out there's no better way _comp_acconto = TRUE; // force recalc of current month @@ -556,7 +556,8 @@ else error = 1; // sbatti l'acconto (e non solo!) in LIA if (look_lia()) { - isdifferita = _lia->get_bool("B1"); + TConfig cnf(CONFIG_DITTA, "cg"); + isdifferita = cnf.get_bool("GeLiDi"); if (isdifferita && _basecalc == incorso) acc *= real(double(2/3)); _lia->put("R4",acc); _lia->put("R7",iva_ven); diff --git a/cg/cg4400.cpp b/cg/cg4400.cpp index 6afe65ceb..773746cbc 100755 --- a/cg/cg4400.cpp +++ b/cg/cg4400.cpp @@ -2338,13 +2338,13 @@ void CG4400_application::stampa_vidi() TabVid.put("CODTAB", vid); if (TabVid.read() == NOERR) { - row.put(format("%s", (const char*)TabVid.get("S0")), 39); + row.put(format("%-.32s", (const char*)TabVid.get("S0")), 39); row.put(format("%7d",TabVid.get_long("I0")), 71); row.put(format("%7d",TabVid.get_long("I1")), 79); row.put(format("%7d",TabVid.get_long("I2")), 87); TDate d(TabVid.get_long("D0")); row.put(format("%s", (const char*)d.string()), 95); - row.put(format("%s", (const char*)TabVid.get("S1")), 106); + row.put(format("%-.26s", (const char*)TabVid.get("S1")), 106); } printer().print(row); } @@ -3101,7 +3101,7 @@ int CG4400_application::stampa_intestazione() get_dati_ditta(); codice_ditta << get_firm(); - + set_header (r, "Ditta %s %s %s %s %s %s", (const char*)codice_ditta, (const char*)_ragsoc, (const char*)_viafis, (const char*)_cap, (const char*)_comunefis, diff --git a/cg/cg4900.cpp b/cg/cg4900.cpp index e99d4e0ff..3d8be0621 100755 --- a/cg/cg4900.cpp +++ b/cg/cg4900.cpp @@ -371,10 +371,11 @@ bool LiqAcc_app::video_vis() lia.put("CODTAB", y); if (lia.read() != NOERR) //da verificare se e' giusto return FALSE; - + + TConfig cnf(CONFIG_DITTA, "cg"); + bool liqdiff = cnf.get_bool("GeLiDi"); _tipo_acc = lia.get("S8"); TString16 freqviva = lia.get("S7"); - bool liqdiff = lia.get_bool("B1"); real acconto = ZERO; real iva_ven = ZERO; real iva_acq = ZERO; @@ -460,7 +461,7 @@ bool LiqAcc_app::video_vis() if (acconto.sign() < 0) { m.show(F_CREEVI); - m.field(F_CREEVI).set(acconto.string()); + m.field(F_CREEVI).set(abs(acconto).string()); m.hide(F_ACCVER); m.hide(F_ACCNVER); } @@ -478,9 +479,18 @@ bool LiqAcc_app::video_vis() m.hide(F_ACCVER); m.field(F_ACCNVER).set(acconto.string()); } + else //==0 + { + m.hide(F_CREEVI); + m.hide(F_ACCNVER); + m.hide(F_ACCVER); + } - m.set_handler(F_NONFAT, msk_risul); - m.set_handler(F_NONANN, msk_risul); + if (!liqdiff) + { + m.set_handler(F_NONFAT, msk_risul); + m.set_handler(F_NONANN, msk_risul); + } m.set_handler(msk_hide); for (bool stop = FALSE; !stop;) diff --git a/cg/cg4900b.uml b/cg/cg4900b.uml index da47290a8..b0ccfe4d2 100755 --- a/cg/cg4900b.uml +++ b/cg/cg4900b.uml @@ -159,7 +159,7 @@ END NUMBER F_IVADEB 15 BEGIN - PROMPT 16 16 "IVA A DEBITO " + PROMPT 16 16 "IVA A DEBITO " FLAGS "RD" PICTURE "." NUM_CALC {#F_RISVEN - #F_RISACQ} @@ -167,7 +167,7 @@ END NUMBER F_ACCVER 15 BEGIN - PROMPT 10 17 "ACCONTO DA VERSARE " + PROMPT 10 17 "ACCONTO DA VERSARE " FLAGS "RD" PICTURE "." END diff --git a/cg/cg4900c.uml b/cg/cg4900c.uml index 5c283fef8..da06f59d0 100755 --- a/cg/cg4900c.uml +++ b/cg/cg4900c.uml @@ -143,14 +143,14 @@ END NUMBER F_IVADEB 15 BEGIN - PROMPT 16 15 "IVA A DEBITO " + PROMPT 16 15 "IVA A DEBITO " FLAGS "RD" PICTURE "." END NUMBER F_ACCVER 15 BEGIN - PROMPT 10 17 "ACCONTO DA VERSARE " + PROMPT 10 17 "ACCONTO DA VERSARE " FLAGS "RD" PICTURE "." END