From 12e041c8b32b210de50cf56bf035da1a0aa0c438 Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 3 Jan 1996 15:06:24 +0000 Subject: [PATCH] Corretti errori segnalati in data 05/12/95 git-svn-id: svn://10.65.10.50/trunk@2381 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg3100.cpp | 12 ++++++----- cg/cg4300.cpp | 20 ++++++++++++----- cg/cg4300.h | 1 + cg/cg4301.cpp | 59 +++++++++++++++++++++++++++++++++++++-------------- cg/cg4303.cpp | 5 ++++- cg/cg4304.cpp | 20 ++++++++++++++--- cg/cg4400.cpp | 46 +++++++++++++++++++++++++++++---------- cg/cg4400.h | 18 ++++++++++------ 8 files changed, 133 insertions(+), 48 deletions(-) diff --git a/cg/cg3100.cpp b/cg/cg3100.cpp index fa17662f1..e13b0b64d 100755 --- a/cg/cg3100.cpp +++ b/cg/cg3100.cpp @@ -818,6 +818,7 @@ void TListaMov_application::set_page(int file, int count) set_row (_n, "@88gdel@92g@d", FLD(LF_MOV,MOV_DATADOC)); int annoese = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOES); TDate data = current_cursor()->curr(LF_MOV).get_date(MOV_DATAREG); + TDate dcomp = current_cursor()->curr(LF_MOV).get_date(MOV_DATACOMP); TString16 reg = current_cursor()->curr(LF_MOV).get(MOV_REG); int anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA); char prov = current_cursor()->curr(LF_MOV).get_char(MOV_PROVVIS); @@ -830,14 +831,15 @@ void TListaMov_application::set_page(int file, int count) } else if (_provvis == 2 && (prov == 'P' || prov == 'N')) set_row (_n, "@103gMov.Provvisorio"); + //15/12/1995 + /* if (ae != annoese) if (_annoes == 0) //se non indicato l'anno nella maschera set_row (_n, "@120gcomp @4n", FLD(LF_MOV,MOV_ANNOES)); - /* - if (_scelta_stampa == 0) - if (_stampa_anno_comp) - set_row (_n, "@127g@4n", FLD(LF_MOV,MOV_ANNOES)); - */ + */ + if (data != dcomp) + set_row (_n, "@119gc.%s", (const char*)dcomp.string(brief, '-')); + //fine set_row (_n, "@130g@f", FLD(LF_MOV,MOV_STAMPATO)); } break; diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index bbc02b1d0..9ce4b51d9 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -91,12 +91,14 @@ bool TLiquidazione_app::user_create() // s o l minuscoli = registro bollato (setta B1) _isregis = (rcl == 'l' || rcl == 'L' || rcl == 'S' || rcl == 's'); // stampa per registri - _isfinal = rcl == 'l' || rcl == 's'; // se l minuscolo, definitivo + _isfinal = rcl == 'l' || rcl == 's'; // se l minuscolo, definitivo nocalc = rcl == 'S' || rcl == 's'; printdate = subj.get(4); filename = subj.get(5); headerlen = subj.get_int(6); - is_header = subj.items() == 7; + char rliq = *(subj.get(7)); + _riepilogo = rliq == 'X'; + is_header = subj.items() == 8; //modifica del 5/07/1995 int f = printer().formlen(); printer().formlen(f - headerlen); @@ -375,8 +377,12 @@ bool TLiquidazione_app::set_print(int) } break; case 2: // estrazione deleghe - _isprint = FALSE; - //build_ditte_sheet(all); + _isprint = FALSE; + //12/12/1995 + _selected.reset(); + _ditte->check(-1, FALSE); + //fine + build_ditte_sheet(all); while (set_deleghe()) { if (_calcall || _selected.ones() > 0l) @@ -399,7 +405,11 @@ bool TLiquidazione_app::set_print(int) case 3: // calcolo acconto _isprint = TRUE; _month = 12; - //build_ditte_sheet(all); + //12/12/1995 + _selected.reset(); + _ditte->check(-1, FALSE); + //fine + build_ditte_sheet(all); real inf; real ina; // cotale obbrobrio non fu da me cercato, ne' mai condiviso while (set_acconto(inf, ina)) { diff --git a/cg/cg4300.h b/cg/cg4300.h index 3806c5f6f..b51ef322a 100755 --- a/cg/cg4300.h +++ b/cg/cg4300.h @@ -215,6 +215,7 @@ class TLiquidazione_app : public TPrint_application bool _isfinal; // stampa definitiva (su registro bollato) bool _isregis; // stampa per registro bool _isintr; // calcola interessi per trimestrali + bool _riepilogo; // stampa riepilogo sul 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 77fc6420e..39fec4e05 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -148,7 +148,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) look_lim(liq_month(month), TRUE); - if (_isfinal && _lim->get_bool("B1") && _month != 13) + if (_isfinal && _lim->get_bool("B1")) // && _month != 13) return TRUE; TConfig cnf(CONFIG_DITTA, "cg"); @@ -169,7 +169,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) // ricalcolo normale // lim c'e' solo per i trimestri - bool ok = _lim->get_bool("B0"); + bool ok = _lim->get_bool("B0"); if (ok && !recalc) return TRUE; bool calc = (_recalc == ever || (_recalc == one && is_month_ok(month,_month))); if (!calc && _recalc != never) calc = !ok; @@ -183,8 +183,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) zero_firm(month); // casini per stampa minchie in coda ai registri - bool riepliq = FALSE; - bool stliq = FALSE; + //22/12/1995 + bool riepliq = _isregis ? _riepilogo : FALSE; + bool stliq = TRUE; + //fine _nditte->save_status(); if (_nditte->is_first_match(LF_ATTIV)) @@ -262,16 +264,18 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) _pla->rewrite(); } - for (_reg->first(); _reg->good(); _reg->next()) { - if (codatt == _reg->get("S8") || quater) + //22/12/1995 + //if (codatt == _reg->get("S8") || quater) + if (codatt == _reg->get("S8")) { - if (!riepliq) riepliq = _reg->get_bool("B6"); - if (!stliq) stliq = _reg->get_bool("B7"); + //if (!riepliq) riepliq = _reg->get_bool("B6"); + //if (!stliq) stliq = _reg->get_bool("B7"); if (_reg->get_int("I0") == 2) if (!_isvent) _isvent = _reg->get_bool("B3"); - } + //fine + } } if (!_isregis) @@ -284,6 +288,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) if (!update_att(month, cattiv) && stliq) describe_error("Attivita' non ricalcolate: possibili errori", codatt); + //13/12/1995 + if (month == 13) + recalc_annual(cattiv); + //fine // vediamo se c'e' qualcosa da raccontare gheravergot = _isannual || _isriepilogo; @@ -316,9 +324,23 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) _nditte->restore_status(); // aggiorna le liquidazioni - if (calc || !recalc) + //13/12/1995. + //Concordato con Ferdinando che, visto che qualche + //calcoluccio viene fatto anche in write_liq, essa + //verra' sempre richiamata. + //if (calc || !recalc) + //fine if (is_month_ok_strict(month) || month == 13) write_liq(month, atts); + + //5/12/1995 + //in ogni caso... + if (_isfinal) + { + _lim->put("B1", "X"); + _lim->rewrite(); + } + //fine // rimborso infraannuale _DescrItem* rimb_d = NULL; @@ -360,7 +382,7 @@ bool TLiquidazione_app::update_att(int month, const char* codatt, // il ricalcolo e' FORZATO da _recalc messo a one { look_plm(month, codatt, TRUE); - bool ok = _plm->get_bool("B0"); + bool ok = _plm->get_bool("B0"); if (ok && !recalc) return TRUE; bool calc = _recalc == ever || (_recalc == one && is_month_ok(month,_month)); if (!calc && _recalc != never) calc = !ok; @@ -373,10 +395,13 @@ bool TLiquidazione_app::update_att(int month, const char* codatt, { recalc_ventilation(month, codatt); recalc_corrispettivi(month, codatt); - } - if (month == 13) - recalc_annual(codatt); + } + //13/12/1995 + // if (month == 13) + // recalc_annual(codatt); + //fine } + return ok || calc; } @@ -1156,7 +1181,9 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) if (!_prorata.is_zero() && month != 13) { prorata = acquisti_iva * (_prorata / CENTO); - prorata.round(ROUND_MILLELIRE); + //13/12/1995 + //prorata.round(ROUND_MILLELIRE); + //fine acquisti_iva -= prorata; } look_plm(month, codatt, TRUE); @@ -1284,7 +1311,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 liq. annuali + // Calcolo liq. mensili e liq. annuali. Scrive le lim { TToken_string atts(codatts); const char* tmpatt; diff --git a/cg/cg4303.cpp b/cg/cg4303.cpp index 19e6863b0..5a887b203 100755 --- a/cg/cg4303.cpp +++ b/cg/cg4303.cpp @@ -19,10 +19,13 @@ void TLiquidazione_app::add_plafond(int month, const char* codatt, int type, if (intra) r1 += howmuch; else r0 += howmuch; - + //06/12/1995 + /* if (r2 < (r0+r1)) describe_error("Acquisti in eccesso rispetto al plafond disponibile", att.cut(5)); + */ + //fine _ppa_r->put("R0",r0); _ppa_r->put("R1",r1); _ppa->rewrite(); diff --git a/cg/cg4304.cpp b/cg/cg4304.cpp index 9af6ed1b1..f6ae1094c 100755 --- a/cg/cg4304.cpp +++ b/cg/cg4304.cpp @@ -189,6 +189,7 @@ void TLiquidazione_app::describe_liqacc() void TLiquidazione_app::describe_plafond(int month, const char* codatt) { + TString att(codatt); // prepara la descrizione del riepilogo da stampare e lo accoda real t1, t2, t3; _DescrItem* d = new _DescrItem(PLAFOND); @@ -216,7 +217,13 @@ void TLiquidazione_app::describe_plafond(int month, const char* codatt) case 3: d->_r6 = t1; d->_r7 = t2; d->_r8 = t3; break; - } + } + //06/12/1995 + if (t3.sign() < 0) t3 = ZERO; + if (t3 < (t1+t2)) + describe_error("Acquisti in eccesso rispetto al plafond disponibile", + att.cut(5)); + //fine } // for tipo esenzione plafond _descr_arr.add(d); @@ -937,7 +944,10 @@ void TLiquidazione_app::describe_consistence(const char* codatt) void TLiquidazione_app::describe_error(const char* err, const char* codatt) { - if (!_isprint || !_canprint) return; + //if (!_isprint || !_canprint) return; + //06/12/1995 + if (!_isprint || !_canprint || (_isregis && _isfinal)) return; + //fine _errors.add(new _ErrItem(err,codatt,_nditte->curr().get("CODDITTA"))); } @@ -1711,7 +1721,11 @@ bool TLiquidazione_app::set_annual(_DescrItem& d) // chiamata internamente a set_pims bool ret = FALSE; - int row = get_maxrow()+1; + int row = get_maxrow()+1; + //14/12/1995. Correzione errore MI0952 + if (row == 1) row = 4; + //fine + if (d._f0 & IS_PRORATA) { // non lo ha stampato prima se annuale, perche' vladimiro il nefido diff --git a/cg/cg4400.cpp b/cg/cg4400.cpp index 5f9a4b971..42273be4e 100755 --- a/cg/cg4400.cpp +++ b/cg/cg4400.cpp @@ -1127,18 +1127,18 @@ bool CG4400_application::cerca_libro_gio(TString& datas, bool* good) if (tiporeg == 5) //libro giornale { const TDate& data = _tabreg->get_date("D3"); - if (data > _data_a) + if (data <= _data_a) { // datas = format("%02/%02d/%4d", data.day(), data.month(), data.year()); datas = data; // Meglio cosi' - *good = FALSE; + *good = FALSE; return FALSE; - } + } + _tabreg->readat(rec); return TRUE; } } _tabreg->readat(rec); - //return TRUE; return FALSE; } @@ -1689,6 +1689,7 @@ bool CG4400_application::compila_reg(const TMask& m) { _tipo_reg = _tabreg->get_int("I0"); if (_tipo_reg == 1 || _tipo_reg == 2) //registro iva + //if (_tipo_reg == 1 || _tipo_reg == 2 || _tipo_reg == 3) { cod_lib_un = _tabreg->get("S6"); sca_vid = _tabreg->get_date("D1"); @@ -2419,7 +2420,8 @@ print_action CG4400_application::postprocess_page (int file, int counter) { if (file == LF_MOV) { - if (counter) //dopo aver fatto un REPEAT_PAGE (cioe' dopo aver stampato le righe settate in set_page_tot_reg()), in pratica a rottura di mese o alla fine + if (counter) //dopo aver fatto un REPEAT_PAGE (cioe' dopo aver stampato + //le righe settate in set_page_tot_reg()), in pratica a rottura di mese o alla fine { reset_print(); if (_liquidazione) @@ -2683,6 +2685,10 @@ bool CG4400_application::setta_mask(long i) void CG4400_application::no_movimenti() { _mov_empty = TRUE; + /* + if (_tipo_reg == 3) //registro riepilogativo + stampa_riepilogativo(); //che lecca morale!!! + */ if (_liquidazione) { int da, a; @@ -2813,7 +2819,7 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m) } //non ci sono movimenti da stampare nel periodo richiesto! else no_movimenti(); - + if (_tipo_stampa == 3 && _rif_vid) { _intesta_vidi = TRUE; @@ -2980,11 +2986,27 @@ void CG4400_application::stampa_liq_mesi_succ() _datareg = TDate(1, m, _annoes); // Meglio cosi' TFilename t; t.temp("iva"); + + //06/12/1995 + /* if (_tipo_stampa == 1) send_message('L',t, m); //prima era S ma non andava bene! else send_message('l',t,m); //prima era s - //TString80 nomef; nomef = t.path(); nomef << "\\" << t.name(); - //if (fexist(nomef)) + */ + if (_scelta == B0_settato || _scelta == prosegui_stampa) + { + if (_tipo_stampa == 1) + send_message('S',t, m); + else send_message('s',t, m); + } + else //_scelta == prosegui_cal_stampa + { + if (_tipo_stampa == 1) + send_message('L', t, m); + else send_message('l', t, m); + } + //fine + if (fexist(t)) { _intesta_liq = TRUE; @@ -3009,7 +3031,7 @@ void CG4400_application::send_message(char tipo, const TFilename& nome, int mese app = "cg4 -2 -C"; else app = "cg4 -2"; - TToken_string ss(10); + TToken_string ss(36); ss.add(_annoes); if (_tipo_riepilogativo == 'A' && mese == 12) @@ -3019,8 +3041,10 @@ void CG4400_application::send_message(char tipo, const TFilename& nome, int mese ss.add(tipo); ss.add(_data_stampa.string()); ss.add(nome); - ss.add(_size_header); - //ss.add("x"); + ss.add(_size_header); + if (_riep_liq) + ss.add('X'); + else ss.add(' '); TMessage liq (app, "RCL", ss); liq.send(); diff --git a/cg/cg4400.h b/cg/cg4400.h index 402dcf0e5..bbaf84a4c 100755 --- a/cg/cg4400.h +++ b/cg/cg4400.h @@ -52,10 +52,10 @@ class CG4400_application : public TPrintapp bool _test; TRecnotype _nrec; bool _mov_empty, _stampa_ind_ditta, _stampa_tutti_i_registri, _auto_intraf, _stampa; - bool _corrispettivi, _liquidazione, _riep_liq, _stampa_ind_comp, _esiste_riga_iva, _stampa_cred_pre; + bool _corrispettivi, _liquidazione, _stampa_ind_comp, _esiste_riga_iva, _stampa_cred_pre; bool _rif_vid, _intesta_vidi, _intesta_liq, _stampa_data_reg, _ok_vidi; - bool _sosp_imposta; - char _frequiva, _tipo_riepilogativo; + bool _sosp_imposta, _riep_liq; + char _frequiva, _tipo_riepilogativo, _freq_riepilogo; TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg; TDate _u_data; long _n_ditte, _u_stampata, _primast, __firm, _uprotivap, _ditta; @@ -91,10 +91,11 @@ protected: public: + //const char* desc_attivita (const TString&); const char* desc_attivita (); const char* tipo_attivita (); const char* descr_doc (); - const char* descr_iva (const char *); + const char* descr_iva (const char*); TRectype& ricerca_occ(const char*); TRectype& ricerca_cf (char, long); TRectype& look_comuni(const char*); @@ -106,7 +107,9 @@ public: bool compila_reg(const TMask&); bool compila_lib(); messaggio controlla_liquidazione(); - messaggio controlla_b0(); + messaggio controlla_b0(); + bool is_mese_ok(int,int); + bool is_trim(int); bool controlla_mov(); bool stampo_liquidazione(int); bool ventilazione(const char*); @@ -117,12 +120,13 @@ public: bool stampa_datareg(); bool stampa_registri_IVA(const TMask&); bool look_lia(long ditta = 0l); - bool ricerca_mese(TString&,TString&,int,int,TMask_field&); + bool stampa_riepilogo(int); + void stampa_pims(TPrintrow&, const TString&, int, int); void set_choice_limits(TMask&); void build_ditte_sheet(); void cerca_reg(const TString&, byte*); void set_page_tot_reg(); - void send_message(char, const TFilename&,int); + void send_message(char,const TFilename&,int); void aggiorna_reg(const bool aggiorna_vidi); void aggiorna_lib(); void calcola_progressivi();