From ef4f09a9cd5e9f7c39fa78360f5919f855fad04e Mon Sep 17 00:00:00 2001 From: villa Date: Mon, 11 Mar 1996 08:06:41 +0000 Subject: [PATCH] Aggiornamenti nuova gestione esercizi contabili git-svn-id: svn://10.65.10.50/trunk@2677 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg0600.cpp | 3 +-- cg/cg1500.cpp | 45 +++++++++++++++++---------------------------- cg/cg1500a.uml | 6 +++--- cg/cg1600.cpp | 34 ++++++++++------------------------ cg/cg1600a.uml | 10 +++++----- cg/cg2100c.uml | 2 +- cg/cg3100.cpp | 19 +------------------ cg/cg3200.cpp | 20 +------------------- cg/cg3400.cpp | 23 +---------------------- cg/cg4600a.uml | 4 ++-- cg/cglib04.cpp | 16 +++++----------- 11 files changed, 47 insertions(+), 135 deletions(-) diff --git a/cg/cg0600.cpp b/cg/cg0600.cpp index 45b7b9724..7cb605516 100755 --- a/cg/cg0600.cpp +++ b/cg/cg0600.cpp @@ -66,7 +66,6 @@ bool CGTab_application::user_destroy() { if (get_tabname() == "ESC") delete _saldi; - return Tab_application::user_destroy(); } @@ -189,7 +188,7 @@ void CGTab_application::check_sheet() if (i > 0 && e.inizio() != ++s1) tt->add("*** non contiguo ***"); - else tt->add("ok"); + else tt->add(""); s1 = e.fine(); diff --git a/cg/cg1500.cpp b/cg/cg1500.cpp index dd9e57234..ac7bdb342 100755 --- a/cg/cg1500.cpp +++ b/cg/cg1500.cpp @@ -21,6 +21,7 @@ #include #include "cglib.h" +#include "cglib04.h" #include "cg1.h" #include "cg1500.h" @@ -31,8 +32,6 @@ bool mask_date (TMask_field& f, KEY k); bool mask_bilancio(TMask_field& f, KEY k); bool mask_tipost (TMask_field& f, KEY k); -HIDDEN int date2esc(const TDate& d, int* prevesc = NULL); - class CG1500_application : public TPrintapp { friend bool mask_anno (TMask_field& f, KEY k); @@ -219,24 +218,6 @@ bool IsEsercizio (const TDate& datalim, int anno_eser) return FALSE; } -HIDDEN int date2esc(const TDate& d, int* prevesc) -{ - if (prevesc) *prevesc = 0; - TTable esc("ESC"); - for (int err = esc.first(); err == NOERR; err = esc.next()) - { - const TDate ia(esc.get("D0")); // Data inizio esercizio - const TDate fa(esc.get("D1")); // Data fine esercizio - const anno = esc.get_int("CODTAB"); - app()._inizioEs = ia; - app()._fineEs = fa; - if (d >= ia && d <= fa) - return anno; - if (prevesc) *prevesc = anno; - } - return 0; -} - bool mask_anno(TMask_field& f, KEY k) { if (k == K_ENTER) @@ -3738,9 +3719,8 @@ bool CG1500_application::set_print(int) else _dataini = _inizioEs; _datada = m.get(F_DATADA); _dataa = m.get(F_DATAA); - //_stampa_mov_prov = (bool)(m.get(F_STAMPAMPROV) == "X"); } - if ( (_verifica == 1)||(_verifica == 2) ) + if ((_verifica == 1)||(_verifica == 2)) { _stampav = atoi(m.get(F_STAMPAV)); bil_verifica(); @@ -3887,9 +3867,12 @@ void CG1500_application::preprocess_header() set_header(r,"@41gall'ultima immissione Es. %d", _annoes); //else set_header(r, "@41gall'ultima immissione Es. Precedente"); - //modifica del 20/04/1995 - set_header(r,"@85gAnno comp. %d", _annoes); - + //modifica del 20/04/1995 + { + TString d1(InizioEsercizio(_annoes).string()); + TString d2(FineEsercizio(_annoes).string()); + set_header(r,"@86gEsercizio %s %s", (const char*)d1, (const char*)d2); /**/ + } r++; riga.fill('-'); set_header(r, (const char*)riga); @@ -3920,14 +3903,20 @@ void CG1500_application::preprocess_header() set_header(r,"@42gdalla data %s alla data %s", (const char*)datada, (const char*) dataa); //modifica del 20/04/1995 - if (_annoes != 0) //se l'anno e' 0 non si considera la competenza - set_header(r,"@86gAnno comp. %d", _annoes); + if (_annoes != 0) //se l'anno e' 0 non si considera la competenza + { + TString d1(InizioEsercizio(_annoes).string()); + TString d2(FineEsercizio(_annoes).string()); + set_header(r,"@86gEsercizio %s %s", (const char*)d1, (const char*)d2); /**/ + } } else if (_tipo_stampa1 == 2) { set_header(r,"@42gall'ultima immissione Es. %d", _annoes); //modifica del 20/04/1995 - set_header(r,"@86gAnno comp. %d", _annoes); + TString d1(InizioEsercizio(_annoes).string()); + TString d2(FineEsercizio(_annoes).string()); + set_header(r,"@86gEsercizio %s %s", (const char*)d1, (const char*)d2); /**/ } if ( (_verifica == 1)||(_verifica == 2) ) diff --git a/cg/cg1500a.uml b/cg/cg1500a.uml index 6348f83eb..25f5e4a17 100755 --- a/cg/cg1500a.uml +++ b/cg/cg1500a.uml @@ -30,11 +30,11 @@ END NUMBER F_ANNO 4 BEGIN - PROMPT 2 3 "Anno esercizio " - HELP "Anno di cui si vuole ottenere il bilancio" + PROMPT 2 3 "Codice esercizio " + HELP "Esercizio di cui si vuole ottenere il bilancio" USE ESC INPUT CODTAB F_ANNO - DISPLAY "Anno" CODTAB + DISPLAY "Codice" CODTAB DISPLAY "Data inizio esercizio" D0 DISPLAY "Data fine esercizio" D1 OUTPUT F_ANNO CODTAB diff --git a/cg/cg1600.cpp b/cg/cg1600.cpp index 473cd5098..63d1ee29c 100755 --- a/cg/cg1600.cpp +++ b/cg/cg1600.cpp @@ -18,6 +18,7 @@ #include #include "cglib.h" +#include "cglib04.h" #include "cg1.h" #include "cg1600.h" @@ -222,8 +223,6 @@ void Righe_sez_opp::add(int g, int c, long s, } } -int date2esc(const TDate& d, int* prevesc = NULL); - class CG1600_application : public TPrintapp { friend bool data_limite (TMask_field & f,KEY k); @@ -437,24 +436,6 @@ void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo, b->conto_dettagliato = conto_dettagliato; } -HIDDEN int date2esc(const TDate& d, int* prevesc) -{ - if (prevesc) *prevesc = 0; - TTable esc("ESC"); - for (int err = esc.first(); err == NOERR; err = esc.next()) - { - const TDate ia(esc.get("D0")); // Data inizio esercizio - const TDate fa(esc.get("D1")); // Data fine esercizio - a()._inizioEs = ia; - a()._fineEs = fa; - const anno = esc.get_int("CODTAB"); - if (d >= ia && d <= fa) - return anno; - if (prevesc) *prevesc = anno; - } - return 0; -} - bool data_limite (TMask_field& f, KEY key) { if (key == K_ENTER) @@ -5124,13 +5105,18 @@ void CG1600_application::intesta_verifica_fissa() void CG1600_application::intesta_scalare() { TString datalimitestr,databilrafrstr; - TString sep(132); - + TString sep(132); + + TString16 d1e(_data_ini_ese.string()); + TString16 d2e(_data_fine_ese.string()); + TString16 d1r(_data_ini_raf.string()); + TString16 d2r(_data_fine_raf.string()); + set_header (3,"@0gSTAMPA BILANCIO CONFORME ALLA IV DIRETTIVA"); - set_header (3,"@89gEsercizio@99g%d", _anno_esercizio); + set_header (3,"@80gEs. %s/%s", (const char*)d1e, (const char*)d2e); /**/ if (_annoeserafr != 0 || _databilrafr != botime) { - set_header (3,"@115gEsercizio@125g%d", _anno_esercizio_raf); + set_header (3,"@106gEs. %s/%s", (const char*)d1r, (const char*)d2r); /**/ databilrafrstr = _databilrafr.string(); set_header (4,"@112galla data@122g%s", (const char*) databilrafrstr); } diff --git a/cg/cg1600a.uml b/cg/cg1600a.uml index 151bbf54e..f0e9c22cf 100755 --- a/cg/cg1600a.uml +++ b/cg/cg1600a.uml @@ -30,11 +30,11 @@ END NUMBER F_ANNOESE 4 BEGIN - PROMPT 4 5 "Anno esercizio " - HELP "Anno d'esercizio di cui si vuole la stampa" + PROMPT 4 5 "Codice esercizio " + HELP "Esercizio di cui si vuole la stampa" USE ESC INPUT CODTAB F_ANNOESE - DISPLAY "Anno" CODTAB + DISPLAY "Codice" CODTAB DISPLAY "Data inizio esercizio" D0 DISPLAY "Data fine esercizio" D1 OUTPUT F_ANNOESE CODTAB @@ -44,8 +44,8 @@ END NUMBER F_ANNORAFFR 4 BEGIN - PROMPT 36 5 "Anno esercizio da raffrontare " - HELP "Anno d'esercizio da raffrontare (in caso di confronto)" + PROMPT 36 5 "Cod. esercizio da raffrontare " + HELP "Codice esercizio da raffrontare (in caso di confronto)" COPY USE F_ANNOESE INPUT CODTAB F_ANNORAFFR COPY DISPLAY F_ANNOESE diff --git a/cg/cg2100c.uml b/cg/cg2100c.uml index 27ddd9e4d..b7096a0ac 100755 --- a/cg/cg2100c.uml +++ b/cg/cg2100c.uml @@ -73,7 +73,7 @@ END NUMBER F_ANNOES 4 BEGIN - PROMPT 32 4 "Anno esercizio " + PROMPT 32 4 "Cod. esercizio " FIELD ANNOES FLAGS "DGZ" MESSAGE COPY,H_ANNOES diff --git a/cg/cg3100.cpp b/cg/cg3100.cpp index 7237c5ee1..551b1b869 100755 --- a/cg/cg3100.cpp +++ b/cg/cg3100.cpp @@ -21,6 +21,7 @@ #include #include #include "cglib.h" +#include "cglib04.h" #include "cglib03.h" #include "cg2103.h" @@ -36,8 +37,6 @@ bool annoes (TMask_field&, KEY); bool data_inizio (TMask_field&, KEY); bool data_fine (TMask_field&, KEY); -HIDDEN int date2esc(const TDate& d, int* prevesc = NULL); - HIDDEN const char* err_msg[] = {"La data operazione non appartiene a nessun esercizio", "Anno IVA non compatibile con data operazione", "Data operazione successiva all'esercizio di competenza", @@ -139,22 +138,6 @@ public: HIDDEN inline TListaMov_application & app() { return (TListaMov_application&)main_app();} -HIDDEN int date2esc(const TDate& d, int* prevesc) -{ - if (prevesc) *prevesc = 0; - TTable esc("ESC"); - for (int err = esc.first(); err == NOERR; err = esc.next()) - { - const TDate ia(esc.get("D0")); // Data inizio esercizio - const TDate fa(esc.get("D1")); // Data fine esercizio - const anno = esc.get_int("CODTAB"); - if (d >= ia && d <= fa) - return anno; - if (prevesc) *prevesc = anno; - } - return 0; -} - TDate InizioEsercizio(int anno) { TTable TabEs ("ESC"); diff --git a/cg/cg3200.cpp b/cg/cg3200.cpp index 30f0a35e6..83a315328 100755 --- a/cg/cg3200.cpp +++ b/cg/cg3200.cpp @@ -24,9 +24,9 @@ #include "cg3.h" #include "cg3200.h" #include "cglib.h" +#include "cglib04.h" #include "cglib03.h" -int date2esc(const TDate& d, int* prevesc = NULL); bool sottoc_handler_ini (TMask_field& f, KEY k); bool sottoc_handler_fine (TMask_field& f, KEY k); @@ -585,24 +585,6 @@ bool TMastrini_application::check_ordine(TMask_field& f, KEY k) return TRUE; } -int date2esc(const TDate& d, int* prevesc) -{ - if (prevesc) *prevesc = 0; - TTable esc("ESC"); - for (int err = esc.first(); err == NOERR; err = esc.next()) - { - const TDate ia(esc.get("D0")); // Data inizio esercizio - const TDate fa(esc.get("D1")); // Data fine esercizio - app()._inizioEs = ia; - app()._fineEs = fa; - const anno = esc.get_int("CODTAB"); - if (d >= ia && d <= fa) - return anno; - if (prevesc) *prevesc = anno; - } - return 0; -} - //Questa funzione restituisce vero se il record su piano dei conti ha almeno un //record figlio (e che soddisfa la condizione riguardante la data di registr.). //Viene successivamente utilizzata per stampare l'intestazione (e i totali) diff --git a/cg/cg3400.cpp b/cg/cg3400.cpp index 59c17d795..2431db98e 100755 --- a/cg/cg3400.cpp +++ b/cg/cg3400.cpp @@ -23,6 +23,7 @@ #include "conto.h" #include "cglib.h" +#include "cglib04.h" #include "cglib03.h" #include "cg2103.h" #include "cg3400a.h" @@ -50,8 +51,6 @@ HIDDEN const int AVERE198 = 174; HIDDEN TString256 tmp; -HIDDEN int date2esc(const TDate& d, int* prevesc = NULL); - HIDDEN enum descr { causale, conto, operazione }; class TContoOccas : public TBill @@ -1590,26 +1589,6 @@ bool CG3400_application::leggi_tabreg(const char * reg_cod, int reg_anno) return ok; } -// Calcola l'anno di esercizio di una data -// Certified 99% -HIDDEN int date2esc(const TDate& d, int* prevesc) -{ - if (prevesc) *prevesc = 0; - TTable esc("ESC"); - for (int err = esc.first(); err == NOERR; err = esc.next()) - { - const TDate ia(esc.get("D0")); // Data inizio esercizio - const TDate fa(esc.get("D1")); // Data fine esercizio - app()._inizioEs = ia; - app()._fineEs = fa; - const anno = esc.get_int("CODTAB"); - if (d >= ia && d <= fa) - return anno; - if (prevesc) *prevesc = anno; - } - return 0; -} - void CG3400_application::set_reg_filter(TMask& m) { TEdit_field& reg = m.efield(CODREG); diff --git a/cg/cg4600a.uml b/cg/cg4600a.uml index 946e0c4f9..2ff6808e9 100755 --- a/cg/cg4600a.uml +++ b/cg/cg4600a.uml @@ -65,14 +65,14 @@ BEGIN PROMPT 69 4 "" USE ESC INPUT CODTAB F_ANNOCH - DISPLAY "Anno" CODTAB + DISPLAY "Codice" CODTAB DISPLAY "Inizio Es.@12" D0 DISPLAY "Fine Es.@12" D1 DISPLAY "Scarico@12" D2 OUTPUT F_ANNOCH CODTAB OUTPUT F_DATAC D1 CHECKTYPE REQUIRED - WARNING "Anno non presente in tabella esercizi" + WARNING "Codice non presente in tabella esercizi" FLAGS "GRZD" END diff --git a/cg/cglib04.cpp b/cg/cglib04.cpp index 5fb22ccd0..51292cd3a 100755 --- a/cg/cglib04.cpp +++ b/cg/cglib04.cpp @@ -4,6 +4,7 @@ #include #include #include +#include "cglib.h" #include "cglib04.h" const int size = 256; //Lunghezza del record del TRASFER @@ -3409,16 +3410,9 @@ const char* riconverti (TString& data_PC,bool anno_di_quattro) int date2esc(const TDate& d, int* prevesc) { if (prevesc) *prevesc = 0; - TTable esc("ESC"); - for (int err = esc.first(); err == NOERR; err = esc.next()) - { - const TDate ia(esc.get("D0")); // Data inizio esercizio - const TDate fa(esc.get("D1")); // Data fine esercizio - const anno = esc.get_int("CODTAB"); - if (d >= ia && d <= fa) - return anno; - if (prevesc) *prevesc = anno; - } - return 0; + TEsercizi_contabili esc; + int e = esc.date2esc(d); + if (prevesc) *prevesc = esc.pred(e); + return e; }