From 5c5b5bacf5f9fafe744df847039dc086714cdeea Mon Sep 17 00:00:00 2001 From: nik Date: Mon, 17 Jun 1996 09:47:09 +0000 Subject: [PATCH] Commit globale git-svn-id: svn://10.65.10.50/trunk@3003 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- m770/771232.cpp | 6 - m770/771232.h | 6 +- m770/771310.cpp | 16 +- m770/771310a.uml | 683 +++++++++++++++--------------- m770/772100.cpp | 64 +-- m770/772200.cpp | 6 +- m770/772300.cpp | 68 +-- m770/772400.cpp | 8 +- m770/774100.cpp | 1033 +++++++++++++++++++++++----------------------- m770/776100.cpp | 2 +- m770/776500.cpp | 65 +-- m770/776500.h | 2 + m770/776500a.uml | 27 +- m770/77g1.cpp | 30 +- m770/77lib.h | 118 +++--- m770/77stq.cpp | 395 +++++++++--------- m770/pe1.h | 36 +- m770/rpag.h | 46 +-- 18 files changed, 1308 insertions(+), 1303 deletions(-) diff --git a/m770/771232.cpp b/m770/771232.cpp index 71b3a730b..92301beec 100755 --- a/m770/771232.cpp +++ b/m770/771232.cpp @@ -122,7 +122,6 @@ int TQuadroG::read(TMask& m) void TQuadroG::init_modify_mode (TMask& m) { - init_mask(m); m.disable(DLG_DELREC); } @@ -135,13 +134,8 @@ void TQuadroG::init_query_mode (TMask& m) m.field(F_CODDITTA).check(); } m.send_key(K_AUTO_ENTER,0); - - init_mask(m); } -void TQuadroG::init_mask (TMask& m) -{} - void TQuadroG::update_totals(TSheet_field& f, int ss) { int i = 0; diff --git a/m770/771232.h b/m770/771232.h index 1a6c46ee0..8ea822072 100755 --- a/m770/771232.h +++ b/m770/771232.h @@ -44,7 +44,6 @@ class TQuadroG : public TRelation_application virtual bool changing_mask(int mode) { return FALSE; } virtual void init_query_mode (TMask&); virtual void init_modify_mode (TMask&); - void init_mask (TMask&); void fill_ss(TMask& m); void fill_arr(TMask& m); void ss2rel(const TMask& m); @@ -119,6 +118,7 @@ class TQuadroG1 : public TRelation_application virtual bool user_create(); virtual bool user_destroy(); virtual int rewrite(const TMask& m); + virtual int read(TMask& m); virtual int write (const TMask& m); virtual bool remove(); virtual TRelation* get_relation() const { return _rel; } @@ -126,10 +126,8 @@ class TQuadroG1 : public TRelation_application virtual bool changing_mask(int mode) { return FALSE; } virtual void init_query_mode (TMask&); virtual void init_modify_mode (TMask&); - void init_mask (TMask&); -// void fill_ss(TMask& m); +// void init_mask (TMask&); void fill_arr(TMask& m); -// void ss2rel(const TMask& m); void arr2rel(const TMask& m); public: const char* taitol() { return (const char*)_title; } diff --git a/m770/771310.cpp b/m770/771310.cpp index 870bd13cd..ed11747b1 100755 --- a/m770/771310.cpp +++ b/m770/771310.cpp @@ -161,9 +161,11 @@ bool M71310_application::auto_premi(TMask_field& f, KEY k) { if (k == K_TAB && f.mask().is_running()) { - TLocalisamfile qual (LF_QUAL,FALSE); +// TLocalisamfile qual (LF_QUAL,FALSE); + TRelation* rel = app()._rel; TMask& m = f.mask(); - long codditta = m.get_long(F_CODDITTA); + m.autosave(rel); +/* long codditta = m.get_long(F_CODDITTA); TDate datavers (m.get(F_QLDATAVERS)); TString data = datavers.string(); int mesepag = m.get_int(F_QLMESEPAG); @@ -172,9 +174,8 @@ bool M71310_application::auto_premi(TMask_field& f, KEY k) char tipovers = m.get (F_QLTIPOVERS)[0]; long codtrib = m.get_long(F_QLCODTRIB); int artbil = m.get_int(F_ARTBIL); - TString serie(m.get(FH_ABISERIE)); - TString numero(m.get(FH_NUMERO)); + TString numero(m.get(FH_NUMERO)); */ // TString cab(m.get(FH_CAB)); // TString nprog(m.get(FH_NPROG)); @@ -182,6 +183,7 @@ bool M71310_application::auto_premi(TMask_field& f, KEY k) // if (tipovers == DELEGA_BANCARIA) // numero << nprog; +/* qual.setkey(1); qual.zero(); qual.put(QUL_CODDITTA, codditta); @@ -193,9 +195,11 @@ bool M71310_application::auto_premi(TMask_field& f, KEY k) qual.put(QUL_QLCT, (long)codtrib); qual.put(QUL_QLAB, (long)artbil); qual.put(QUL_QLSERIE, serie); - qual.put(QUL_QLNUMERO, numero); + qual.put(QUL_QLNUMERO, numero); */ - if (qual.read() == NOERR) +// if (qual.read() == NOERR) + + if (rel->read() == NOERR) f.mask().stop_run(K_AUTO_ENTER); else f.mask().stop_run(K_INS); diff --git a/m770/771310a.uml b/m770/771310a.uml index ae41ebbd4..2f496834a 100755 --- a/m770/771310a.uml +++ b/m770/771310a.uml @@ -1,354 +1,329 @@ -// 771310a.uml - Quadro L -#include "771310.h" -TOOLBAR "" 0 18 0 4 -BUTTON F_GENERA 21 2 -BEGIN - PROMPT -13 -3 "~Generazione" -END - -BUTTON F_PARAMETRI 21 2 -BEGIN - PROMPT -23 -3 "~Parametri Generazione" -END - -#include -ENDPAGE - -PAGE "QUADRO L" -1 -1 78 18 - -#define ABI_CAB 7 -#define NUM_SERIE 8 -#define TEXT_NUM_SERIE 9 -#define TEXT_ABI_CAB 6 -#define GH 10 - -GROUPBOX DLG_NULL 78 4 -BEGIN - PROMPT 0 0 "" - FLAGS "R" -END - -NUMBER F_CODDITTA 5 -BEGIN - PROMPT 2 1 "Ditta " - FLAGS "RDG" - USE LF_NDITTE KEY 1 - FIELD LF_QUAL->CODDITTA - CHECKTYPE REQUIRED - INPUT CODDITTA F_CODDITTA - DISPLAY "Codice" CODDITTA - DISPLAY "Ragione sociale @50" RAGSOC - OUTPUT F_RAGSOC RAGSOC - KEY 1 -END - -STRING F_RAGSOC 50 -BEGIN - PROMPT 2 2 "Ragione sociale " - FLAGS "D" -END - -TEXT 96 -BEGIN - PROMPT 2 10 "Numero serie " - GROUP TEXT_NUM_SERIE -END - -TEXT 97 -BEGIN - PROMPT 2 10 "Codice ABI " - GROUP ABI_CAB -END - -TEXT 98 -BEGIN - PROMPT 46 10 "Numero quietanza " - GROUP TEXT_NUM_SERIE -END - -TEXT 99 -BEGIN - PROMPT 46 10 "Codice CAB " - GROUP ABI_CAB -END - -GROUPBOX DLG_NULL 78 7 -BEGIN - PROMPT 0 5 "" -END - -NUMBER F_ANNODIC 4 -BEGIN - PROMPT 2 4 "Anno dichiarazione " -END - -NUMBER F_QLANNOPAG 4 -BEGIN - PROMPT 2 6 "Anno pagamento " - USE LF_QUAL KEY 1 SELECT ((CODDITTA=#F_CODDITTA) && (QLAP=#F_ANNODIC)) - INPUT CODDITTA F_CODDITTA - INPUT QLAP F_QLANNOPAG - DISPLAY "A.P." QLAP - DISPLAY "M.P." QLMP - DISPLAY "Ritenute@15" QLRITEFF - DISPLAY "Importo versato" QLRITVER - DISPLAY "L.V." QLLV - DISPLAY "T.V." QLTV - DISPLAY "C.T." QLCT - DISPLAY "Art.Bil." QLAB - DISPLAY "Data Vers." QLDV - DISPLAY "Serie/ABI" QLSERIE - DISPLAY "Numero/CAB@11" QLNUMERO - DISPLAY "Rss" QLRSS - DISPLAY "Note@7" QLNOTE - OUTPUT F_QLDATAVERS QLDV - OUTPUT F_QLMESEPAG QLMP - OUTPUT F_QLANNOPAG QLAP - OUTPUT F_QLLUOVERS QLLV - OUTPUT F_QLTIPOVERS QLTV - OUTPUT F_QLCODTRIB QLCT - OUTPUT F_ARTBIL QLAB - OUTPUT F_QLSERIE QLSERIE - OUTPUT F_ABI QLSERIE - OUTPUT FH_NUMERO QLNUMERO - OUTPUT FH_ABISERIE QLSERIE - OUTPUT F_CAB1 QLNUMERO[1,5] - OUTPUT F_CAB QLNUMERO[6,11] - FIELD LF_QUAL->QLAP - FLAGS "R" - VALIDATE FIXLEN_FUNC 4 - WARNING "L' anno deve essere indicato per esteso" - KEY 1 -END - -LIST F_QLMESEPAG 2 13 -BEGIN - PROMPT 46 6 "Mese pagamento " - FIELD LF_QUAL->QLMP - ITEM " |Indefinito" - FLAGS "M" - KEY 1 -END - -DATE F_QLDATAVERS -BEGIN - PROMPT 2 7 "Data versamento " - FIELD LF_QUAL->QLDV - KEY 1 -END - -LIST F_QLLUOVERS 11 -BEGIN - PROMPT 46 7 "Luogo versamento " - ITEM " |Nessuno" - ITEM "C|Concessione" - ITEM "T|Tesoreria" - FIELD LF_QUAL->QLLV - KEY 1 -END - -LIST F_QLTIPOVERS 15 -BEGIN - PROMPT 2 8 "Tipo versamento " - ITEM " |Nessuno" - MESSAGE SHOW,97|SHOW,99|HIDE,96|HIDE,98|RESET,GH@ - MESSAGE ENABLE,F_QLSERIE - ITEM "B|Delega bancaria" - MESSAGE RESET,GH@|HIDE,TEXT_NUM_SERIE@|SHOW,ABI_CAB@ - MESSAGE ENABLE,ABI_CAB@|DISABLE,NUM_SERIE@ - ITEM "D|Distinta" - MESSAGE RESET,GH@|SHOW,TEXT_NUM_SERIE@|HIDE,ABI_CAB@ - MESSAGE ENABLE,NUM_SERIE@|DISABLE,ABI_CAB@ - ITEM "C|C/C Postale" - MESSAGE RESET,GH@|SHOW,TEXT_NUM_SERIE@|CLEAR,F_ABI|CLEAR,F_QLSERIE|HIDE,ABI_CAB@ - MESSAGE DISABLE,F_QLSERIE|DISABLE,ABI_CAB@ - FIELD LF_QUAL->QLTV - KEY 1 -END - -NUMBER F_QLCODTRIB 4 -BEGIN - PROMPT 46 8 "Codice tributo " - FIELD LF_QUAL->QLCT - KEY 1 -END - -NUMBER F_ARTBIL 2 -BEGIN - PROMPT 2 9 "Articolo di bilancio " - FIELD LF_QUAL->QLAB - KEY 1 -END - -STRING FH_ABISERIE 5 -BEGIN - PROMPT 0 1 "HABISERIE" - FIELD LF_QUAL->QLSERIE - FLAGS "D" - KEY 1 - GROUP GH -END - -STRING FH_NUMERO 11 -BEGIN - PROMPT 0 2 "HNUMERO" - FIELD LF_QUAL->QLNUMERO - KEY 1 - FLAGS "D" - GROUP GH -END - -STRING F_QLSERIE 5 -BEGIN - PROMPT 23 10 "" - FIELD LF_QUAL->QLSERIE - MESSAGE COPY,FH_ABISERIE - GROUP NUM_SERIE -// KEY 1 -END - -STRING F_QLNUMERO 11 -BEGIN - PROMPT 63 10 "" - FIELD LF_QUAL->QLNUMERO -// MESSAGE COPY,FH_NUMERO - GROUP NUM_SERIE -// KEY 1 -END - -NUMBER F_ABI 5 -BEGIN - PROMPT 23 10 "" - FIELD LF_QUAL->QLSERIE - MESSAGE COPY,FH_ABISERIE - GROUP ABI_CAB -// KEY 1 -END - -NUMBER F_CAB1 5 -BEGIN - PROMPT 63 10 "" - FIELD LF_QUAL->QLNUMERO[1,5] -// MESSAGE COPY,FH_NUMERO - GROUP ABI_CAB -// KEY 1 -END - -NUMBER F_CAB 6 -BEGIN - PROMPT 69 10 "" - FIELD LF_QUAL->QLNUMERO[6,11] - FLAGS "Z" -// MESSAGE ADD,FH_NUMERO - GROUP ABI_CAB -// KEY 1 -END - -LIST F_QUADRO 2 -BEGIN - PROMPT 0 12 "Codice quadro " - HELP "Inserire il codice quadro" - ITEM "| " - ITEM "A|A" - ITEM "B|B" - ITEM "B1|B1" - ITEM "C|C" - ITEM "D|D" - ITEM "D1|D1" - ITEM "E|E" - ITEM "E1|E1" - ITEM "G|G" - ITEM "G1|G1" - FIELD LF_QUAL->QLCODQUA -END - -TEXT DLG_NULL -BEGIN - PROMPT 0 13 "Somme assoggettate a ritenuta:" -END - -TEXT DLG_NULL -BEGIN - PROMPT 0 14 "Rit. Effettuate" -END - -NUMBER F_QLRITEFF 15 -BEGIN - PROMPT 0 15 "" - FIELD LF_QUAL->QLRITEFF - PICTURE "." - FLAGS "R" -END - -TEXT DLG_NULL -BEGIN - PROMPT 17 14 "Importo versato" -END - -NUMBER F_QLRITVER 15 -BEGIN - PROMPT 17 15 "" - FIELD LF_QUAL->QLRITVER - PICTURE "." - FLAGS "R" -END - -TEXT DLG_NULL -BEGIN - PROMPT 37 14 "RSS" -END - -LIST F_QLRSS 7 -BEGIN - PROMPT 34 15 "" - ITEM " |Nessuna" - ITEM "1|VA" - ITEM "2|SA" - ITEM "3|SI" - FIELD LF_QUAL->QLRSS -END - -TEXT DLG_NULL -BEGIN - PROMPT 58 14 "Note" -END - -BOOLEAN F_NOTEA -BEGIN - PROMPT 45 15 "A" -END - -BOOLEAN F_NOTEB -BEGIN - PROMPT 50 15 "B" -END - -BOOLEAN F_NOTEC -BEGIN - PROMPT 55 15 "C" -END - -BOOLEAN F_NOTED -BEGIN - PROMPT 60 15 "D" -END - -BOOLEAN F_NOTEE -BEGIN - PROMPT 65 15 "E" -END - -BOOLEAN F_NOTEF -BEGIN - PROMPT 70 15 "F" -END - -BOOLEAN F_NOTEG -BEGIN - PROMPT 75 15 "G" -END - -ENDPAGE - -ENDMASK - +// 771310a.uml - Quadro L +#include "771310.h" +TOOLBAR "" 0 18 0 4 +BUTTON F_GENERA 21 2 +BEGIN + PROMPT -13 -3 "~Generazione" +END + +BUTTON F_PARAMETRI 21 2 +BEGIN + PROMPT -23 -3 "~Parametri Generazione" +END + +#include +ENDPAGE + +PAGE "QUADRO L" -1 -1 78 18 + +#define ABI_CAB 7 +#define NUM_SERIE 8 +#define TEXT_NUM_SERIE 9 +#define TEXT_ABI_CAB 6 +#define GH 10 + +GROUPBOX DLG_NULL 78 4 +BEGIN + PROMPT 0 0 "" + FLAGS "R" +END + +NUMBER F_CODDITTA 5 +BEGIN + PROMPT 2 1 "Ditta " + FLAGS "RDG" + USE LF_NDITTE KEY 1 + FIELD LF_QUAL->CODDITTA + CHECKTYPE REQUIRED + INPUT CODDITTA F_CODDITTA + DISPLAY "Codice" CODDITTA + DISPLAY "Ragione sociale @50" RAGSOC + OUTPUT F_RAGSOC RAGSOC + KEY 1 +END + +STRING F_RAGSOC 50 +BEGIN + PROMPT 2 2 "Ragione sociale " + FLAGS "D" +END + +TEXT 96 +BEGIN + PROMPT 2 10 "Numero serie " + GROUP TEXT_NUM_SERIE +END + +TEXT 97 +BEGIN + PROMPT 2 10 "Codice ABI " + GROUP ABI_CAB +END + +TEXT 98 +BEGIN + PROMPT 46 10 "Numero quietanza " + GROUP TEXT_NUM_SERIE +END + +TEXT 99 +BEGIN + PROMPT 46 10 "Codice CAB " + GROUP ABI_CAB +END + +GROUPBOX DLG_NULL 78 7 +BEGIN + PROMPT 0 5 "" +END + +NUMBER F_ANNODIC 4 +BEGIN + PROMPT 2 4 "Anno dichiarazione " +END + +NUMBER F_QLANNOPAG 4 +BEGIN + PROMPT 2 6 "Anno pagamento " + USE LF_QUAL KEY 1 SELECT ((CODDITTA=#F_CODDITTA) && (QLAP=#F_ANNODIC)) + INPUT CODDITTA F_CODDITTA + INPUT QLAP F_QLANNOPAG + DISPLAY "A.P." QLAP + DISPLAY "M.P." QLMP + DISPLAY "Ritenute@15" QLRITEFF + DISPLAY "Importo versato" QLRITVER + DISPLAY "L.V." QLLV + DISPLAY "T.V." QLTV + DISPLAY "C.T." QLCT + DISPLAY "Art.Bil." QLAB + DISPLAY "Data Vers." QLDV + DISPLAY "Serie/ABI" QLSERIE + DISPLAY "Numero/CAB@11" QLNUMERO + DISPLAY "Rss" QLRSS + DISPLAY "Note@7" QLNOTE + OUTPUT F_QLDATAVERS QLDV + OUTPUT F_QLMESEPAG QLMP + OUTPUT F_QLANNOPAG QLAP + OUTPUT F_QLLUOVERS QLLV + OUTPUT F_QLTIPOVERS QLTV + OUTPUT F_QLCODTRIB QLCT + OUTPUT F_ARTBIL QLAB + OUTPUT F_QLSERIE QLSERIE + OUTPUT F_ABI QLSERIE + OUTPUT F_CAB1 QLNUMERO[1,5] + OUTPUT F_CAB QLNUMERO[6,11] + FIELD LF_QUAL->QLAP + FLAGS "R" + VALIDATE FIXLEN_FUNC 4 + WARNING "L' anno deve essere indicato per esteso" + KEY 1 +END + +LIST F_QLMESEPAG 2 13 +BEGIN + PROMPT 46 6 "Mese pagamento " + FIELD LF_QUAL->QLMP + ITEM " |Indefinito" + FLAGS "M" + KEY 1 +END + +DATE F_QLDATAVERS +BEGIN + PROMPT 2 7 "Data versamento " + FIELD LF_QUAL->QLDV + KEY 1 +END + +LIST F_QLLUOVERS 11 +BEGIN + PROMPT 46 7 "Luogo versamento " + ITEM " |Nessuno" + ITEM "C|Concessione" + ITEM "T|Tesoreria" + FIELD LF_QUAL->QLLV + KEY 1 +END + +LIST F_QLTIPOVERS 15 +BEGIN + PROMPT 2 8 "Tipo versamento " + ITEM " |Nessuno" + MESSAGE SHOW,97|SHOW,99|HIDE,96|HIDE,98|RESET,GH@ + MESSAGE ENABLE,F_QLSERIE + ITEM "B|Delega bancaria" + MESSAGE RESET,GH@|HIDE,TEXT_NUM_SERIE@|SHOW,ABI_CAB@ + MESSAGE ENABLE,ABI_CAB@|DISABLE,NUM_SERIE@ + ITEM "D|Distinta" + MESSAGE RESET,GH@|SHOW,TEXT_NUM_SERIE@|HIDE,ABI_CAB@ + MESSAGE ENABLE,NUM_SERIE@|DISABLE,ABI_CAB@ + ITEM "C|C/C Postale" + MESSAGE RESET,GH@|SHOW,TEXT_NUM_SERIE@|CLEAR,F_ABI|CLEAR,F_QLSERIE|HIDE,ABI_CAB@ + MESSAGE DISABLE,F_QLSERIE|DISABLE,ABI_CAB@ + FIELD LF_QUAL->QLTV + KEY 1 +END + +NUMBER F_QLCODTRIB 4 +BEGIN + PROMPT 46 8 "Codice tributo " + FIELD LF_QUAL->QLCT + KEY 1 +END + +NUMBER F_ARTBIL 2 +BEGIN + PROMPT 2 9 "Articolo di bilancio " + FIELD LF_QUAL->QLAB + KEY 1 +END + +STRING F_QLSERIE 5 +BEGIN + PROMPT 23 10 "" + FIELD LF_QUAL->QLSERIE + GROUP NUM_SERIE + KEY 1 +END + +STRING F_QLNUMERO 11 +BEGIN + PROMPT 63 10 "" + FIELD LF_QUAL->QLNUMERO + GROUP NUM_SERIE + KEY 1 +END + +NUMBER F_ABI 5 +BEGIN + PROMPT 23 10 "" + FIELD LF_QUAL->QLSERIE + GROUP ABI_CAB + KEY 1 +END + +NUMBER F_CAB1 5 +BEGIN + PROMPT 63 10 "" + FIELD LF_QUAL->QLNUMERO[1,5] + GROUP ABI_CAB + KEY 1 +END + +NUMBER F_CAB 6 +BEGIN + PROMPT 69 10 "" + FIELD LF_QUAL->QLNUMERO[6,11] + FLAGS "Z" + GROUP ABI_CAB + KEY 1 +END + +LIST F_QUADRO 2 +BEGIN + PROMPT 0 12 "Codice quadro " + HELP "Inserire il codice quadro" + ITEM "| " + ITEM "A|A" + ITEM "B|B" + ITEM "B1|B1" + ITEM "C|C" + ITEM "D|D" + ITEM "D1|D1" + ITEM "E|E" + ITEM "E1|E1" + ITEM "G|G" + ITEM "G1|G1" + FIELD LF_QUAL->QLCODQUA +END + +TEXT DLG_NULL +BEGIN + PROMPT 0 13 "Somme assoggettate a ritenuta:" +END + +TEXT DLG_NULL +BEGIN + PROMPT 0 14 "Rit. Effettuate" +END + +NUMBER F_QLRITEFF 15 +BEGIN + PROMPT 0 15 "" + FIELD LF_QUAL->QLRITEFF + PICTURE "." + FLAGS "R" +END + +TEXT DLG_NULL +BEGIN + PROMPT 17 14 "Importo versato" +END + +NUMBER F_QLRITVER 15 +BEGIN + PROMPT 17 15 "" + FIELD LF_QUAL->QLRITVER + PICTURE "." + FLAGS "R" +END + +TEXT DLG_NULL +BEGIN + PROMPT 37 14 "RSS" +END + +LIST F_QLRSS 7 +BEGIN + PROMPT 34 15 "" + ITEM " |Nessuna" + ITEM "1|VA" + ITEM "2|SA" + ITEM "3|SI" + FIELD LF_QUAL->QLRSS +END + +TEXT DLG_NULL +BEGIN + PROMPT 58 14 "Note" +END + +BOOLEAN F_NOTEA +BEGIN + PROMPT 45 15 "A" +END + +BOOLEAN F_NOTEB +BEGIN + PROMPT 50 15 "B" +END + +BOOLEAN F_NOTEC +BEGIN + PROMPT 55 15 "C" +END + +BOOLEAN F_NOTED +BEGIN + PROMPT 60 15 "D" +END + +BOOLEAN F_NOTEE +BEGIN + PROMPT 65 15 "E" +END + +BOOLEAN F_NOTEF +BEGIN + PROMPT 70 15 "F" +END + +BOOLEAN F_NOTEG +BEGIN + PROMPT 75 15 "G" +END + +ENDPAGE + +ENDMASK + diff --git a/m770/772100.cpp b/m770/772100.cpp index fdae8314f..550695e44 100755 --- a/m770/772100.cpp +++ b/m770/772100.cpp @@ -7,14 +7,14 @@ #include #include #include -#include "scperc.h" -#include "rpag.h" -#include "rver.h" +#include +#include +#include #include #include #include #include -#include "perc.h" +#include #include #include @@ -58,7 +58,7 @@ class TStampa_perc : public TPrintapp { char _liv; // Se stampa a livello di studio int _anno_dic; // Anno dichiarazione nei paramentri utente o studio - bool _changed_perc; // flag che segnala il passaggio a nuovo perc. + bool _changed_perc; // flag che segnala il passaggio a nuovo perc. struct righe_pag { char codq[3]; @@ -76,31 +76,31 @@ class TStampa_perc : public TPrintapp TCursor* _cur; righe_pag* _bil; TSort* _sort; - TVersamento_stampa _stvers; + TVersamento_stampa _stvers; const char* _buf; TLocalisamfile* _nditte, *_anag, *_rpag, *_rver, *_comuni; TString16 _section; TConfig* _cnf; - TString _ragsocER,_indER,_civER,_capER,_dencomER,_provER,_cofiER; - TString _ragsocPE,_indPE,_civPE,_capPE,_dencomPE,_provPE,_cofiPE; - TString _dencomnscER,_provnscER,_dencomnscPE,_provnscPE; - TString _datanascER,_datanascPE,_desc_cau,_numdoc; - TDate _datadoc; + TString _ragsocER,_indER,_civER,_capER,_dencomER,_provER,_cofiER; + TString _ragsocPE,_indPE,_civPE,_capPE,_dencomPE,_provPE,_cofiPE; + TString _dencomnscER,_provnscER,_dencomnscPE,_provnscPE; + TString _datanascER,_datanascPE,_desc_cau,_numdoc; + TDate _datadoc; int _nprog; - int _anno,_numcarat,_codcaus,_codtrib; - long _codditta,_codanagER,_codanagPE; + int _anno,_numcarat,_codcaus,_codtrib; + long _codditta,_codanagER,_codanagPE; char _tipoa, _tipoaER; - real _impondoc,_spesedoc,_imposdoc,_totaledoc; - real _tot_comp,_tot_fatt; - real _tot_somme_non_soggette, _tot_comp_non_pagati; // tot.delle rimanenze di un percipiente - real _compenso_dovuto, _spese_dovute; // usati per calcolare rimanenza di una scheda + real _impondoc,_spesedoc,_imposdoc,_totaledoc; + real _tot_comp,_tot_fatt; + real _tot_somme_non_soggette, _tot_comp_non_pagati; // tot.delle rimanenze di un percipiente + real _compenso_dovuto, _spese_dovute; // usati per calcolare rimanenza di una scheda bool _rifai_sort,_stampa_modulo; - int _ind,_mesecomp,_annocomp; - bool _stampa_scheda; // stampo o no la scheda corrente - bool _almeno_una_scheda; // c'e' almeno una scheda stampabile - bool init_print(); - void add(TVersamento& vers); - bool find(TVersamento& vers); + int _ind,_mesecomp,_annocomp; + bool _stampa_scheda; // stampo o no la scheda corrente + bool _almeno_una_scheda; // c'e' almeno una scheda stampabile + bool init_print(); + void add(TVersamento& vers); + bool find(TVersamento& vers); protected: virtual void on_config_change(); @@ -441,7 +441,7 @@ int TStampa_perc::stampa_vers(TVersamento_stampa& ve, int nriga, const int numve { TString16 serie, numero; int j = nriga; - real vers_stampa = ZERO; + real vers_stampa = ZERO; _rver->setkey(1); _rver->zero(); @@ -492,10 +492,10 @@ int TStampa_perc::stampa_vers(TVersamento_stampa& ve, int nriga, const int numve void calcola_non_pagate(TSchedaP& sch, real& compensi_non_pagati, real& spese_non_pagate, const int anno_in_corso) { - real comp, spese; - real comp_doc, spese_doc, comp_pagato, spese_pagate; - TDate data_pag; - int anno_pag; + real comp, spese; + real comp_doc, spese_doc, comp_pagato, spese_pagate; + TDate data_pag; + int anno_pag; comp = spese = ZERO; TLocalisamfile* rpag = new TLocalisamfile(LF_RPAG); @@ -515,8 +515,8 @@ void calcola_non_pagate(TSchedaP& sch, real& compensi_non_pagati, if (rpag->curr() > mst) break; comp_pagato = rpag->get_real(PAG_COMPENSO); spese_pagate = rpag->get_real(PAG_SPESA); - data_pag = rpag->get_date(PAG_DATAPAG); - anno_pag = data_pag.year(); + data_pag = rpag->get_date(PAG_DATAPAG); + anno_pag = data_pag.year(); if (anno_pag <= anno_in_corso) { comp_doc -= comp_pagato; @@ -751,8 +751,8 @@ print_action TStampa_perc::postprocess_page(int file, int counter) int codcau,codcau_t; real totale,somme,quote,imp,rit,netto; real totale_t,somme_t,quote_t,imp_t,rit_t,netto_t; - TString key(20),keyp(20); - real perc,perc_t; + TString key(20),keyp(20); + real perc,perc_t; _almeno_una_scheda = FALSE; reset_print(); diff --git a/m770/772200.cpp b/m770/772200.cpp index a89f153ae..acc83f21f 100755 --- a/m770/772200.cpp +++ b/m770/772200.cpp @@ -7,13 +7,13 @@ #include #include #include -#include "scperc.h" -#include "rpag.h" +#include +#include #include #include #include #include -#include "perc.h" +#include #include #include "772.h" #include "772200.h" diff --git a/m770/772300.cpp b/m770/772300.cpp index 797e646fd..d58a91212 100755 --- a/m770/772300.cpp +++ b/m770/772300.cpp @@ -12,14 +12,14 @@ #include #include #include -#include "scperc.h" -#include "rpag.h" -#include "rver.h" +#include +#include +#include #include #include #include #include -#include "perc.h" +#include #include #include @@ -27,17 +27,17 @@ #include "772300.h" #include "77lib.h" -HIDDEN TString256 __tmp; +HIDDEN TString256 __tmp; HIDDEN bool filter_func (const TRelation *); class TStampa_mov : public TPrintapp { - char _liv; // Se stampa a livello di studio - int _anno_dic; // Anno dichiarazione nei paramentri utente o studio - int _row; // Riga corrente di stampa - TString16 _section; - TConfig* _cnf; - TVersamento_stampa _stvers; + char _liv; // Se stampa a livello di studio + int _anno_dic; // Anno dichiarazione nei paramentri utente o studio + int _row; // Riga corrente di stampa + TString16 _section; + TConfig* _cnf; + TVersamento_stampa _stvers; TRelation* _rel; TCursor* _cur; TLocalisamfile* _nditte; @@ -45,28 +45,28 @@ class TStampa_mov : public TPrintapp TLocalisamfile* _rpag; TLocalisamfile* _rver; TArray _pagver; - TPercipiente _curr_perc, _prec_perc; - TString _ragsocER,_ragsocPE,_datadoc,_numdoc,_datastampa; - int _anno, _codcaus, _codtrib, _ind, _nprog; - long _codditta,_codanagER,_codanagPE,_cod_da,_cod_a; - char _tipoa,_tipoa_da,_tipoa_a; - real _tot_imponpag,_tot_ritenpag,_tot_impvers; - real _g_tot_imp, _g_tot_ver, _g_tot_rit; - TDate _datada,_dataa; + TPercipiente _curr_perc, _prec_perc; + TString _ragsocER,_ragsocPE,_datadoc,_numdoc,_datastampa; + int _anno, _codcaus, _codtrib, _ind, _nprog; + long _codditta,_codanagER,_codanagPE,_cod_da,_cod_a; + char _tipoa,_tipoa_da,_tipoa_a; + real _tot_imponpag,_tot_ritenpag,_tot_impvers; + real _g_tot_imp, _g_tot_ver, _g_tot_rit; + TDate _datada,_dataa; protected: - friend bool filter_func (const TRelation *); - virtual void on_config_change(); - virtual bool user_create() ; - virtual bool user_destroy(); - virtual bool set_print(int m); - virtual bool preprocess_page (int,int); - virtual bool preprocess_print(int,int); - virtual print_action postprocess_page (int,int); - bool init_print(); - void set_total_perc(); - void set_global_total(); - void add(TVersamento& vers); - bool find(TVersamento& vers); + friend bool filter_func (const TRelation *); + virtual void on_config_change(); + virtual bool user_create() ; + virtual bool user_destroy(); + virtual bool set_print(int m); + virtual bool preprocess_page (int,int); + virtual bool preprocess_print(int,int); + virtual print_action postprocess_page (int,int); + bool init_print(); + void set_total_perc(); + void set_global_total(); + void add(TVersamento& vers); + bool find(TVersamento& vers); public: void dati_erogante(); // void intesta_fissa(); @@ -87,7 +87,7 @@ HIDDEN TStampa_mov& app() { return (TStampa_mov&) main_app(); } bool filter_func (const TRelation * rel) { const int anno_corr = app()._anno; - TRectype sch_curr(rel->lfile().curr()); + TRectype sch_curr(rel->lfile().curr()); TSchedaP scheda(sch_curr); return esiste_pag_in_anno(scheda, anno_corr); } @@ -494,7 +494,7 @@ bool TStampa_mov::init_print() void TStampa_mov::dati_erogante() { char tipoa; - bool ditta_ok = FALSE; + bool ditta_ok = FALSE; _ragsocER = ""; _codanagER = 0L; diff --git a/m770/772400.cpp b/m770/772400.cpp index cbbdc97d8..882e4575a 100755 --- a/m770/772400.cpp +++ b/m770/772400.cpp @@ -7,12 +7,12 @@ #include #include #include -#include "scperc.h" -#include "rpag.h" -#include "rver.h" +#include +#include +#include #include #include -#include "perc.h" +#include #include #include "772.h" #include "772400.h" diff --git a/m770/774100.cpp b/m770/774100.cpp index 398d5d922..255331a9d 100755 --- a/m770/774100.cpp +++ b/m770/774100.cpp @@ -1,515 +1,518 @@ -// 774100.cpp - Generazione quadro L -// -// 774 -0 S (livello di studio) oppure -// 774 -0 D (livello di ditta) -// -// Lista modifiche -// -// 21.12.95 Azzera solo i record con AP=anno dichiarazione (nf) -// 8.01.96 Scambiate nel quadrol la chiave 2 con la 1 (nf) -// -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "rpag.h" -#include "rver.h" -#include "scperc.h" -#include "quadrol.h" -#include "774100.h" -#include "77lib.h" - -// inizializzato in TGenera::set() - usato in filter_func() -HIDDEN TGenera* this_genera = NULL; -// Possibili esiti della dialog-box di configurazione parametri di gen. -HIDDEN const int UNCHANGED = 0; -HIDDEN const int CHANGED = 1; -HIDDEN const int ESCI = 2; - -void TVersamenti::set (TSchedaP& sc, const long numvers) -{ - _key.format("%4ld%c%4ld%4d%4ld", sc.codditta(),sc.tipoa(),sc.codanagr(),sc.nprog(),numvers); - add(_key); -} - -bool TVersamenti::find (TSchedaP& sc, const long numvers) -{ - _key.format("%4ld%c%4ld%4d%4ld", sc.codditta(),sc.tipoa(),sc.codanagr(),sc.nprog(),numvers); - return is_key(_key); -} - -// Accetta un record solo se: -// l'anno della data-pagamento == annodic E -// il pagamento e' collegato ad un versamento (non importa quale) -bool filter_func (const TRelation * rel) -{ - TDate datapag; - int anno,annod; - long nvers; - - annod = this_genera->_annodic; - datapag = rel->lfile().get(PAG_DATAPAG); - nvers = rel->lfile().get_long(PAG_NUMVERS); - anno = datapag.year(); - - return anno == annod && nvers > 0L; -} - -bool TGenera::causale1015(int causale) -{ - TTable ca7("%CA7"); - TString dep; - int artbil = 0; - - ca7.zero(); - dep = format("%02d", causale); - ca7.put("CODTAB", dep); - const bool ok = ca7.read() == NOERR; - - if (!ok) ca7.zero(); - - _ab1015 = ca7.get_int("I3"); - _ct1015 = ca7.get_int("I0"); - _cq1015 = ca7.get ("S1"); - - return ok; -} - -void TGenera::causale(int causale) -{ - TTable ca7("%CA7"); - TString dep; - - _codqua = ""; - - ca7.zero(); - dep = format("%02d", causale); - ca7.put("CODTAB", dep); - if (ca7.read() == NOERR) - { - _codqua = ca7.get ("S1"); - _artbil = ca7.get_int("I3"); - _codtrib = ca7.get_int("I0"); - } -} - -bool TGenera::set(const long codditta, TConfig* cnf, const char* section) -{ - TString16 filt; - int causale; - TRelation* rel; - TCursor* cur; - - if (!yesno_box("Conferma la generazione dei versamenti?")) - return FALSE; - - _codditta = codditta; - _annodic = (int)cnf->get_long(ANNO_SEL, section); - - this_genera = this; - - rel = new TRelation (LF_RPAG); - filt.format("CODDITTA=%ld", codditta); - - cur = new TCursor(rel,filt,1); - cur->set_filterfunction (filter_func); - - causale = atoi(cnf->get("CoCa1015", section)); - - if (causale) - { - if (!causale1015(causale)) - return warning_box("Manca la causale 1015 nella tabella causali"); - } - else - return warning_box("Manca la causale 1015 nei parametri di studio"); - - azzera_quadroL(); - genera_riga(cur); - arrotonda(); - - delete cur; - delete rel; - - return FALSE; -} - -int TGenera::controllo_parametri() -{ - TLocalisamfile base (LF_BASE); - - base.setkey(1); - base.zero(); - base.put("CODDITTA", _codditta); - const int rc = base.read(); - if (rc == NOERR) - { - TDate dv (base.get_date("DATAVERS")); - char lv = base.get_char("LUOVERS"); - char tv = base.get_char("TIPOVERS"); - TString s(base.get("SERIE")); - TString n(base.get("NUMERO")); - - if (!dv.ok() || lv == '\0' || tv == '\0' || n == "" || (s == "" && tv != 'C') ) - { - TString appname("776mod -4 d"); - TExternal_app a (appname); - a.run(); - - TMailbox m; - TMessage* msg = m.next_s(""); - int subj; -// 1 => uscito con Registra -// 0 => uscito con Quit - if (msg != NULL) - { - subj = atoi(msg->body()); - if (subj) - return CHANGED; - else - return ESCI; - } - } - } -#ifdef DBG - if (rc != NOERR) - return warning_box("Errore di lettura su base cod. %d", rc); -#endif - return UNCHANGED; -} - -bool TGenera::azzera_quadroL() -{ - TString quadro(3); - const long dittafirm = get_firm_770(); - TLocalisamfile ql(LF_QUAL); - TProgind progn(ql.items(), "Azzeramento quadro L", FALSE, TRUE); - - for (ql.first(); !ql.eof(); ql.next(), progn.addstatus(1)) - { - const long codditta = ql.get_long(QUL_CODDITTA); - if (codditta != dittafirm) continue; - -// 21.12.95 Azzera solo quelli dell'anno dichiarazione - const int ap = ql.get_int(QUL_QLAP); - if (ap != _annodic) continue; - - quadro = ql.get(QUL_QLCODQUA); - if (quadro == "C" || quadro == "D" || quadro == "D1" - || quadro == "E" || quadro == "E1") - ql.remove(); - } - progn.addstatus(1); - return TRUE; -} - -void TGenera::dati_rver(TLocalisamfile& rver,TSchedaP& sch, long numvers) -{ - rver.zero(); - rver.put(VER_CODDITTA, sch.codditta()); - rver.put(VER_TIPOA, sch.tipoa()); - rver.put(VER_CODANAGR, sch.codanagr()); - rver.put(VER_NPROG, sch.nprog()); - rver.put(VER_NRIGA, (long)numvers); - rver.read(); - if (rver.bad()) - rver.zero(); - - _ver1015 = rver.get_bool(VER_VERS1015); - _ritver = rver.get_real(VER_IMPVERS); - - if (_ver1015) - { - //Prendo i dati su flags LF_BASE - TLocalisamfile base(LF_BASE); - - base.setkey(1); - base.zero(); - base.put("CODDITTA", _codditta); - if (base.read(_isequal) == NOERR) - { - _datavers = base.get_date("DATAVERS"); - _mesepag = 12; - _luovers = base.get_char("LUOVERS"); - _tipover = base.get_char("TIPOVERS"); - _serie = base.get ("SERIE"); - _numero = base.get ("NUMERO"); - if (_tipover == DELEGA_BANCARIA) - _sNprog = _numero.mid(6); - - rver.reread(_testandlock); - rver.put("DATAVERS", _datavers); - rver.put("TIPOVERS", _tipover); - rver.put("SERIE", _serie); - rver.put("NUMERO", _numero); - rver.put("LUOVERS", _luovers); - rver.rewrite(); - rver.reread(_unlock); - } - } - else - { - _datavers = rver.get_date(VER_DATAVERS); - _luovers = rver.get_char(VER_LUOVERS); - _tipover = rver.get_char(VER_TIPOVERS); - _serie = rver.get (VER_SERIE); - _numero = rver.get (VER_NUMERO); - _sNrog = rver.get (VER_PROGBANC); - _sNprog.trim(); - if (_sNprog.not_empty()) - _numero << _sNprog; - } -} - -void TGenera::dati_scperc(TSchedaP& sch) -{ - TLocalisamfile scperc(LF_SCPERC); - int codtrib = 0; - - scperc.setkey(1); - scperc.zero(); - scperc.put(SPR_CODDITTA, sch.codditta()); - scperc.put(SPR_TIPOA, sch.tipoa()); - scperc.put(SPR_CODANAGR, sch.codanagr()); - scperc.put(SPR_NPROG, sch.nprog()); - if (scperc.read(_isequal) == NOERR) - _causale = scperc.get_int(SPR_CODCAUS); -} - -void TGenera::arrotonda() -{ - TLocalisamfile qual (LF_QUAL); - TRecnotype items_qual = qual.items(); - real importo; importo = ZERO; - TProgind progn(items_qual, "Arrotondamento ritenute versate in corso... Prego attendere", FALSE, TRUE); - - qual.setkey(1); - qual.zero(); - for (qual.first(); !qual.eof(); qual.next()) - { - progn.addstatus(1); - const long codditta = qual.get_long(QUL_CODDITTA); - if (codditta != _codditta) - continue; - importo = qual.get_real(QUL_QLRITVER); - importo = round_770(importo); - qual.reread(_testandlock); - qual.put(QUL_QLRITVER, importo); - qual.rewrite(); - qual.reread(_unlock); - } - progn.addstatus(1); -} - -void TGenera::genera_riga(TCursor* cur) -{ - TLocalisamfile ql (LF_QUAL); - TLocalisamfile rver(LF_RVER); - real riteff,ritver; - long numvers,codanagr,codp; - char tipoa,tipop; - int nprog,nprogp; - bool prima_volta = TRUE; - bool gia_fatto = FALSE; - TString perc,percp; - - (*cur) = 0L; - TRecnotype items_rpag = cur->items(); - TString scritta(60); - scritta.format("Generazione versamenti per la ditta %ld", _codditta); - TProgind progn(items_rpag, scritta, FALSE, TRUE); - - riteff = ZERO; - ritver = ZERO; - - _righe_gia_presenti = new TVersamenti; - _righe_gia_presenti->destroy(); - - tipop = 'Z'; - codp = 99999; - nprogp = 9999; - - TSchedaP scheda_prec; - for (int i = 0; i < items_rpag; i++, ++(*cur), progn.addstatus(1)) - { -// Leggo i dati su RPAG - TDate datapag(cur->curr().get(PAG_DATAPAG)); - _mesepag = datapag.month();; - _annopag = datapag.year(); - riteff = cur->curr().get_real(PAG_RITENUTA); - numvers = cur->curr().get_long(PAG_NUMVERS); - tipoa = cur->curr().get_char(PAG_TIPOA); - codanagr = cur->curr().get_long(PAG_CODANAGR); - nprog = cur->curr().get_int (PAG_NPROG); - - TSchedaP scheda_corr(_codditta, tipoa, codanagr, nprog); - dati_rver(rver,scheda_corr,numvers); - - if (scheda_corr != scheda_prec) - { - dati_scperc(scheda_corr); - causale(_causale); - } - scheda_prec.set(_codditta,tipoa,codanagr,nprog); - -// Se e' tributo1015 posso evitare di controllare il codice quadro - if (!_ver1015) - { - if (_codqua != "C" && _codqua != "D" && _codqua != "D1" && - _codqua != "E" && _codqua != "E1") - continue; - } - else - if (!gia_fatto) - { - gia_fatto = TRUE; - const int cp = controllo_parametri(); - if (cp == CHANGED) - dati_rver(rver,scheda_corr,numvers); - else - if (cp == ESCI) - break; // ho premuto il bottone FINE - } - - ql.setkey(1); - ql.zero(); - ql.put(QUL_CODDITTA, _codditta); - ql.put(QUL_QLMP, _mesepag); - ql.put(QUL_QLAP, _annopag); - ql.put(QUL_QLDV, _datavers); - ql.put(QUL_QLLV, _luovers); - ql.put(QUL_QLTV, _tipover); - - if (_ver1015) - { - ql.put(QUL_QLCT, _ct1015); - ql.put(QUL_QLAB, _ab1015); - ql.put(QUL_QLCODQUA, _cq1015); - } - else - { - ql.put(QUL_QLCT, _codtrib); - ql.put(QUL_QLAB, _artbil); - ql.put(QUL_QLCODQUA, _codqua); - } - ql.put(QUL_QLSERIE, _serie); - ql.put(QUL_QLNUMERO, _numero); - - TRectype dep(ql.curr()); - - if (ql.read(_isequal, _lock) == NOERR) - { - _riteff = ql.get_real(QUL_QLRITEFF); - _riteff += riteff; - ql.put(QUL_QLRITEFF, _riteff); - - if (!_righe_gia_presenti->find(scheda_corr,numvers)) - { - ritver = ql.get_real(QUL_QLRITVER); - ritver += _ritver; - ql.put(QUL_QLRITVER, ritver); - } - ql.rewrite(); - } - else - { - ql.zero(); - ql.curr() = dep; - ql.put(QUL_QLRITEFF, riteff); - ql.put(QUL_QLRITVER, _ritver); - ql.write(); - } - _righe_gia_presenti->set(scheda_corr,numvers); - } -} - - -class TGenera_versamenti : public TApplication -{ - char _liv; - TString16 _section; - TConfig* _cnf; - public: - TGenera* _genera; - TLocalisamfile *_rver, *_rpag, *_base, *_scperc, *_ql; - public: - virtual bool create(); - virtual bool menu(MENU_TAG m); - virtual bool destroy(); - - TGenera& genera() { return *_genera; } - - public: - TGenera_versamenti(char livello) : _liv(toupper(livello)) {} - ~TGenera_versamenti() {} -}; - -TGenera_versamenti& app() { return (TGenera_versamenti&)main_app(); } - -bool TGenera_versamenti::menu(MENU_TAG m) -{ - long codditta, codditta_prec; - int i = 0; - - if (m == BAR_ITEM(1)) - if (_liv == 'S') - { - codditta_prec = get_firm_770(); - while ((codditta = _cnf->get_long(DITTE_SEL, _section, i++)) != 0L) - { - set_firm_770(codditta); - _genera->set(codditta, _cnf, _section); - } - set_firm_770(codditta_prec); - - return FALSE; - } - else - return _genera->set(get_firm_770(), _cnf, _section); - - return FALSE; -} - -bool TGenera_versamenti::create() -{ - TApplication::create(); - _rver = new TLocalisamfile(LF_RVER); - _rpag = new TLocalisamfile(LF_RPAG); - _scperc = new TLocalisamfile(LF_SCPERC); - _base = new TLocalisamfile(LF_BASE); - _ql = new TLocalisamfile(LF_QUAL); - _genera = new TGenera; - _cnf = new TConfig(_liv == 'S' ? CONFIG_USER : CONFIG_STUDIO); - - _section = name(); - _section.cut(2); - - dispatch_e_menu (BAR_ITEM(1)); - return TRUE; -} - -bool TGenera_versamenti::destroy() -{ - delete _rver; - delete _rpag; - delete _scperc; - delete _base; - delete _ql; - delete _genera; - delete _cnf; - return TApplication::destroy(); -} - -int m74100 (int argc, char* argv[]) -{ - TGenera_versamenti a(*argv[2]); - a.run(argc, argv, "Generazione versamenti"); - return 0; -} - +// 774100.cpp - Generazione quadro L +// +// 774 -0 S (livello di studio) oppure +// 774 -0 D (livello di ditta) +// +// Lista modifiche +// +// 21.12.95 Azzera solo i record con AP=anno dichiarazione (nf) +// 8.01.96 Scambiate nel quadrol la chiave 2 con la 1 (nf) +// +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "rpag.h" +#include "rver.h" +#include "scperc.h" +#include "quadrol.h" +#include "774100.h" +#include "77lib.h" + +// inizializzato in TGenera::set() - usato in filter_func() +HIDDEN TGenera* this_genera = NULL; +// Possibili esiti della dialog-box di configurazione parametri di gen. +HIDDEN const int UNCHANGED = 0; +HIDDEN const int CHANGED = 1; +HIDDEN const int ESCI = 2; + +void TVersamenti::set (TSchedaP& sc, const long numvers) +{ + _key.format("%4ld%c%4ld%4d%4ld", sc.codditta(),sc.tipoa(),sc.codanagr(),sc.nprog(),numvers); + add(_key); +} + +bool TVersamenti::find (TSchedaP& sc, const long numvers) +{ + _key.format("%4ld%c%4ld%4d%4ld", sc.codditta(),sc.tipoa(),sc.codanagr(),sc.nprog(),numvers); + return is_key(_key); +} + +// Accetta un record solo se: +// l'anno della data-pagamento == annodic E +// il pagamento e' collegato ad un versamento (non importa quale) +bool filter_func (const TRelation * rel) +{ + TDate datapag; + int anno,annod; + long nvers; + + annod = this_genera->_annodic; + datapag = rel->lfile().get(PAG_DATAPAG); + nvers = rel->lfile().get_long(PAG_NUMVERS); + anno = datapag.year(); + + return anno == annod && nvers > 0L; +} + +bool TGenera::causale1015(int causale) +{ + TTable ca7("%CA7"); + TString dep; + int artbil = 0; + + ca7.zero(); + dep = format("%02d", causale); + ca7.put("CODTAB", dep); + const bool ok = ca7.read() == NOERR; + + if (!ok) ca7.zero(); + + _ab1015 = ca7.get_int("I3"); + _ct1015 = ca7.get_int("I0"); + _cq1015 = ca7.get ("S1"); + + return ok; +} + +void TGenera::causale(int causale) +{ + TTable ca7("%CA7"); + TString dep; + + _codqua = ""; + + ca7.zero(); + dep = format("%02d", causale); + ca7.put("CODTAB", dep); + if (ca7.read() == NOERR) + { + _codqua = ca7.get ("S1"); + _artbil = ca7.get_int("I3"); + _codtrib = ca7.get_int("I0"); + } +} + +bool TGenera::set(const long codditta, TConfig* cnf, const char* section) +{ + TString16 filt; + int causale; + TRelation* rel; + TCursor* cur; + + if (!yesno_box("Conferma la generazione dei versamenti?")) + return FALSE; + + _codditta = codditta; + _annodic = (int)cnf->get_long(ANNO_SEL, section); + + this_genera = this; + + rel = new TRelation (LF_RPAG); + filt.format("CODDITTA=%ld", codditta); + + cur = new TCursor(rel,filt,1); + cur->set_filterfunction (filter_func); + + causale = atoi(cnf->get("CoCa1015", section)); + + if (causale) + { + if (!causale1015(causale)) + return warning_box("Manca la causale 1015 nella tabella causali"); + } + else + return warning_box("Manca la causale 1015 nei parametri di studio"); + + azzera_quadroL(); + genera_riga(cur); + arrotonda(); + + delete cur; + delete rel; + + return FALSE; +} + +int TGenera::controllo_parametri() +{ + TLocalisamfile base (LF_BASE); + + base.setkey(1); + base.zero(); + base.put("CODDITTA", _codditta); + const int rc = base.read(); + if (rc == NOERR) + { + TDate dv (base.get_date("DATAVERS")); + char lv = base.get_char("LUOVERS"); + char tv = base.get_char("TIPOVERS"); + TString s(base.get("SERIE")); + TString n(base.get("NUMERO")); + + if (!dv.ok() || lv == '\0' || tv == '\0' || n == "" || (s == "" && tv != 'C') ) + { + TString appname("776mod -4 d"); + TExternal_app a (appname); + a.run(); + + TMailbox m; + TMessage* msg = m.next_s(""); + int subj; +// 1 => uscito con Registra +// 0 => uscito con Quit + if (msg != NULL) + { + subj = atoi(msg->body()); + if (subj) + return CHANGED; + else + return ESCI; + } + } + } +#ifdef DBG + if (rc != NOERR) + return warning_box("Errore di lettura su base cod. %d", rc); +#endif + return UNCHANGED; +} + +bool TGenera::azzera_quadroL() +{ + TString quadro(3); + const long dittafirm = get_firm_770(); + TLocalisamfile ql(LF_QUAL); + TProgind progn(ql.items(), "Azzeramento quadro L", FALSE, TRUE); + + for (ql.first(); !ql.eof(); ql.next(), progn.addstatus(1)) + { + const long codditta = ql.get_long(QUL_CODDITTA); + if (codditta != dittafirm) continue; + +// 21.12.95 Azzera solo quelli dell'anno dichiarazione + const int ap = ql.get_int(QUL_QLAP); + if (ap != _annodic) continue; + + quadro = ql.get(QUL_QLCODQUA); + if (quadro == "C" || quadro == "D" || quadro == "D1" + || quadro == "E" || quadro == "E1") + ql.remove(); + } + progn.addstatus(1); + return TRUE; +} + +void TGenera::dati_rver(TLocalisamfile& rver,TSchedaP& sch, long numvers) +{ + rver.zero(); + rver.put(VER_CODDITTA, sch.codditta()); + rver.put(VER_TIPOA, sch.tipoa()); + rver.put(VER_CODANAGR, sch.codanagr()); + rver.put(VER_NPROG, sch.nprog()); + rver.put(VER_NRIGA, (long)numvers); + rver.read(); + if (rver.bad()) + rver.zero(); + + _ver1015 = rver.get_bool(VER_VERS1015); + _ritver = rver.get_real(VER_IMPVERS); + + if (_ver1015) + { + //Prendo i dati su flags LF_BASE + TLocalisamfile base(LF_BASE); + + base.setkey(1); + base.zero(); + base.put("CODDITTA", _codditta); + if (base.read(_isequal) == NOERR) + { + _datavers = base.get_date("DATAVERS"); + _mesepag = 12; + _luovers = base.get_char("LUOVERS"); + _tipover = base.get_char("TIPOVERS"); + _serie = base.get ("SERIE"); + _numero = base.get ("NUMERO"); + if (_tipover == DELEGA_BANCARIA) + _sNprog = _numero.mid(6); + + rver.reread(_testandlock); + rver.put("DATAVERS", _datavers); + rver.put("TIPOVERS", _tipover); + rver.put("SERIE", _serie); + rver.put("NUMERO", _numero); + rver.put("LUOVERS", _luovers); + rver.rewrite(); + rver.reread(_unlock); + } + } + else + { + _datavers = rver.get_date(VER_DATAVERS); + _luovers = rver.get_char(VER_LUOVERS); + _tipover = rver.get_char(VER_TIPOVERS); + _serie = rver.get (VER_SERIE); + _numero = rver.get (VER_NUMERO); + _sNprog = rver.get (VER_PROGBANC); + _sNprog.trim(); + if (_sNprog.not_empty()) + _numero << _sNprog; + } +} + +void TGenera::dati_scperc(TSchedaP& sch) +{ + TLocalisamfile scperc(LF_SCPERC); + int codtrib = 0; + + scperc.setkey(1); + scperc.zero(); + scperc.put(SPR_CODDITTA, sch.codditta()); + scperc.put(SPR_TIPOA, sch.tipoa()); + scperc.put(SPR_CODANAGR, sch.codanagr()); + scperc.put(SPR_NPROG, sch.nprog()); + if (scperc.read(_isequal) == NOERR) + _causale = scperc.get_int(SPR_CODCAUS); +} + +void TGenera::arrotonda() +{ + TLocalisamfile qual (LF_QUAL); + TRecnotype items_qual = qual.items(); + real importo; importo = ZERO; + TProgind progn(items_qual, "Arrotondamento ritenute versate in corso... Prego attendere", FALSE, TRUE); + + qual.setkey(1); + qual.zero(); + for (qual.first(); !qual.eof(); qual.next()) + { + progn.addstatus(1); + const long codditta = qual.get_long(QUL_CODDITTA); + if (codditta != _codditta) + { + progn.addstatus(1); // per far andare fino alla fine il "termometro" (sic) + continue; + } + importo = qual.get_real(QUL_QLRITVER); + importo = round_770(importo); + qual.reread(_testandlock); + qual.put(QUL_QLRITVER, importo); + qual.rewrite(); + qual.reread(_unlock); + } + progn.addstatus(1); +} + +void TGenera::genera_riga(TCursor* cur) +{ + TLocalisamfile ql (LF_QUAL); + TLocalisamfile rver(LF_RVER); + real riteff,ritver; + long numvers,codanagr,codp; + char tipoa,tipop; + int nprog,nprogp; + bool prima_volta = TRUE; + bool gia_fatto = FALSE; + TString perc,percp; + + (*cur) = 0L; + TRecnotype items_rpag = cur->items(); + TString scritta(60); + scritta.format("Generazione versamenti per la ditta %ld", _codditta); + TProgind progn(items_rpag, scritta, FALSE, TRUE); + + riteff = ZERO; + ritver = ZERO; + + _righe_gia_presenti = new TVersamenti; + _righe_gia_presenti->destroy(); + + tipop = 'Z'; + codp = 99999; + nprogp = 9999; + + TSchedaP scheda_prec; + for (int i = 0; i < items_rpag; i++, ++(*cur), progn.addstatus(1)) + { +// Leggo i dati su RPAG + TDate datapag(cur->curr().get(PAG_DATAPAG)); + _mesepag = datapag.month();; + _annopag = datapag.year(); + riteff = cur->curr().get_real(PAG_RITENUTA); + numvers = cur->curr().get_long(PAG_NUMVERS); + tipoa = cur->curr().get_char(PAG_TIPOA); + codanagr = cur->curr().get_long(PAG_CODANAGR); + nprog = cur->curr().get_int (PAG_NPROG); + + TSchedaP scheda_corr(_codditta, tipoa, codanagr, nprog); + dati_rver(rver,scheda_corr,numvers); + + if (scheda_corr != scheda_prec) + { + dati_scperc(scheda_corr); + causale(_causale); + } + scheda_prec.set(_codditta,tipoa,codanagr,nprog); + +// Se e' tributo1015 posso evitare di controllare il codice quadro + if (!_ver1015) + { + if (_codqua != "C" && _codqua != "D" && _codqua != "D1" && + _codqua != "E" && _codqua != "E1") + continue; + } + else + if (!gia_fatto) + { + gia_fatto = TRUE; + const int cp = controllo_parametri(); + if (cp == CHANGED) + dati_rver(rver,scheda_corr,numvers); + else + if (cp == ESCI) + break; // ho premuto il bottone FINE + } + + ql.setkey(1); + ql.zero(); + ql.put(QUL_CODDITTA, _codditta); + ql.put(QUL_QLMP, _mesepag); + ql.put(QUL_QLAP, _annopag); + ql.put(QUL_QLDV, _datavers); + ql.put(QUL_QLLV, _luovers); + ql.put(QUL_QLTV, _tipover); + + if (_ver1015) + { + ql.put(QUL_QLCT, _ct1015); + ql.put(QUL_QLAB, _ab1015); + ql.put(QUL_QLCODQUA, _cq1015); + } + else + { + ql.put(QUL_QLCT, _codtrib); + ql.put(QUL_QLAB, _artbil); + ql.put(QUL_QLCODQUA, _codqua); + } + ql.put(QUL_QLSERIE, _serie); + ql.put(QUL_QLNUMERO, _numero); + + TRectype dep(ql.curr()); + + if (ql.read(_isequal, _lock) == NOERR) + { + _riteff = ql.get_real(QUL_QLRITEFF); + _riteff += riteff; + ql.put(QUL_QLRITEFF, _riteff); + + if (!_righe_gia_presenti->find(scheda_corr,numvers)) + { + ritver = ql.get_real(QUL_QLRITVER); + ritver += _ritver; + ql.put(QUL_QLRITVER, ritver); + } + ql.rewrite(); + } + else + { + ql.zero(); + ql.curr() = dep; + ql.put(QUL_QLRITEFF, riteff); + ql.put(QUL_QLRITVER, _ritver); + ql.write(); + } + _righe_gia_presenti->set(scheda_corr,numvers); + } +} + + +class TGenera_versamenti : public TApplication +{ + char _liv; + TString16 _section; + TConfig* _cnf; + public: + TGenera* _genera; + TLocalisamfile *_rver, *_rpag, *_base, *_scperc, *_ql; + public: + virtual bool create(); + virtual bool menu(MENU_TAG m); + virtual bool destroy(); + + TGenera& genera() { return *_genera; } + + public: + TGenera_versamenti(char livello) : _liv(toupper(livello)) {} + ~TGenera_versamenti() {} +}; + +TGenera_versamenti& app() { return (TGenera_versamenti&)main_app(); } + +bool TGenera_versamenti::menu(MENU_TAG m) +{ + long codditta, codditta_prec; + int i = 0; + + if (m == BAR_ITEM(1)) + if (_liv == 'S') + { + codditta_prec = get_firm_770(); + while ((codditta = _cnf->get_long(DITTE_SEL, _section, i++)) != 0L) + { + set_firm_770(codditta); + _genera->set(codditta, _cnf, _section); + } + set_firm_770(codditta_prec); + + return FALSE; + } + else + return _genera->set(get_firm_770(), _cnf, _section); + + return FALSE; +} + +bool TGenera_versamenti::create() +{ + TApplication::create(); + _rver = new TLocalisamfile(LF_RVER); + _rpag = new TLocalisamfile(LF_RPAG); + _scperc = new TLocalisamfile(LF_SCPERC); + _base = new TLocalisamfile(LF_BASE); + _ql = new TLocalisamfile(LF_QUAL); + _genera = new TGenera; + _cnf = new TConfig(_liv == 'S' ? CONFIG_USER : CONFIG_STUDIO); + + _section = name(); + _section.cut(2); + + dispatch_e_menu (BAR_ITEM(1)); + return TRUE; +} + +bool TGenera_versamenti::destroy() +{ + delete _rver; + delete _rpag; + delete _scperc; + delete _base; + delete _ql; + delete _genera; + delete _cnf; + return TApplication::destroy(); +} + +int m74100 (int argc, char* argv[]) +{ + TGenera_versamenti a(*argv[2]); + a.run(argc, argv, "Generazione versamenti"); + return 0; +} + diff --git a/m770/776100.cpp b/m770/776100.cpp index feca08b2f..ff292571f 100755 --- a/m770/776100.cpp +++ b/m770/776100.cpp @@ -122,7 +122,7 @@ bool TManutenzione_quadri::exec_soci(TMask_field& f, KEY k) TExternal_app a(appname); a.run(); - } + } return TRUE; } diff --git a/m770/776500.cpp b/m770/776500.cpp index 82a1d460e..49ec75a16 100755 --- a/m770/776500.cpp +++ b/m770/776500.cpp @@ -9,36 +9,29 @@ #include #include #include - #include "776.h" #include "776500.h" #include "77lib.h" class TParametri_genera : public TApplication { - char _liv; // Se stampa a livello di studio - int _anno_dic; // Anno dichiarazione nei paramentri utente o studio - - TRelation* _rel; - -// Configurazione - TString16 _section; - TConfig* _cnf; - int _risposta; - - bool init_print(); - -protected: - virtual void on_config_change(); - - virtual bool create() ; - virtual bool destroy(); - virtual bool menu(MENU_TAG m); - -public: - bool main_loop(); + char _liv; // Se stampa a livello di studio + int _anno_dic; // Anno dichiarazione nei paramentri utente o studio + TRelation* _rel; + TString16 _section; + TConfig* _cnf; + int _risposta; + bool init_print(); + protected: + static bool ProgBancaHnd(TMask_field& f, KEY k); + virtual void on_config_change(); + virtual bool create() ; + virtual bool destroy(); + virtual bool menu(MENU_TAG m); + public: + bool main_loop(); // D = stampa ditta, S = stampa a livello di studio - TParametri_genera(char livello='D') : _liv(toupper(livello)) {} + TParametri_genera(char livello='D') : _liv(toupper(livello)) {} }; HIDDEN TParametri_genera& app() { return (TParametri_genera&) main_app(); } @@ -49,10 +42,32 @@ void TParametri_genera::on_config_change() _anno_dic = (int)conf.get_long(ANNO_SEL, _section); } +// Copia su NUMERO CAB+PROGBANCA +bool TParametri_genera::ProgBancaHnd(TMask_field& f, KEY k) +{ + TMask& m = f.mask(); + if (k == K_TAB && m.is_running()) + { + char tipov = m.get(F_TIPOVERS)[0]; + TString cab(m.get(F_CAB)); + TString prg(m.get(F_PROGBANCA)); + TString numero; + if (tipov == DELEGA_BANCARIA) + { + numero = cab; + numero << prg; + m.set(FH_NUMERO, numero); + } + } + return TRUE; +} + bool TParametri_genera::main_loop() { KEY tasto; TMask msk ("776500a"); + msk.set_handler(F_CAB, ProgBancaHnd); + msk.set_handler(F_PROGBANCA, ProgBancaHnd); long codditta, codditta_prec; int i = 0; @@ -134,15 +149,11 @@ bool TParametri_genera::destroy() { TString appname = "771mod -3"; TString body = ""; - body << _risposta; - TMessage msg (appname,"",(const char*) body); - TMailbox mb; mb.send(msg); } - return TApplication::destroy(); } diff --git a/m770/776500.h b/m770/776500.h index 157f65cf0..d02795987 100755 --- a/m770/776500.h +++ b/m770/776500.h @@ -8,3 +8,5 @@ #define F_NUMERO 107 #define F_ABI 108 #define F_CAB 109 +#define F_PROGBANCA 110 +#define FH_NUMERO 111 diff --git a/m770/776500a.uml b/m770/776500a.uml index 8f9647504..becccb697 100755 --- a/m770/776500a.uml +++ b/m770/776500a.uml @@ -97,15 +97,11 @@ BEGIN PROMPT 46 7 "Tipo versamento " ITEM "B|Delega bancaria" MESSAGE SHOW,97|SHOW,99|SHOW,F_ABI|SHOW,F_CAB|HIDE,96|HIDE,98|HIDE,F_SERIE|HIDE,F_NUMERO -// MESSAGE HIDE,GSERIE@|SHOW,ABI_CAB@ -// MESSAGE ENABLE,F_ABI ITEM "D|Distinta" MESSAGE SHOW,96|SHOW,98|SHOW,F_SERIE|SHOW,F_NUMERO|HIDE,97|HIDE,99|HIDE,F_ABI|HIDE,F_CAB -// MESSAGE HIDE,ABI_CAB@|SHOW,GSERIE@ MESSAGE ENABLE,F_SERIE ITEM "C|C/C Postale" MESSAGE SHOW,96|SHOW,98|SHOW,F_SERIE|SHOW,F_NUMERO|HIDE,97|HIDE,99|HIDE,F_ABI|HIDE,F_CAB -// MESSAGE HIDE,ABI_CAB@|SHOW,GSERIE@ MESSAGE CLEAR,F_SERIE|DISABLE,F_SERIE FIELD LF_BASE->TIPOVERS END @@ -114,13 +110,32 @@ NUMBER F_ABI 5 BEGIN PROMPT 18 13 "" FIELD LF_BASE->SERIE + FLAGS "RZ" GROUP ABI_CAB END -NUMBER F_CAB 11 +STRING FH_NUMERO 11 +BEGIN + PROMPT 0 1 "" + FLAGS "D" + KEY 1 + FIELD LF_BASE->NUMERO +END + +NUMBER F_CAB 5 BEGIN PROMPT 63 13 "" - FIELD LF_BASE->NUMERO +// FIELD LF_BASE->NUMERO +// MESSAGE COPY,FH_NUMERO + FLAGS "RZ" + GROUP ABI_CAB +END + +NUMBER F_PROGBANCA 6 +BEGIN + PROMPT 69 13 "" + FLAGS "RZ" +// MESSAGE ADD,FH_NUMERO GROUP ABI_CAB END diff --git a/m770/77g1.cpp b/m770/77g1.cpp index 4916a2d92..b09fc2801 100755 --- a/m770/77g1.cpp +++ b/m770/77g1.cpp @@ -27,10 +27,18 @@ inline TQuadroG1& app() { return (TQuadroG1&) main_app(); } void TQuadroG1::init_modify_mode (TMask& m) { - init_mask(m); +// init_mask(m); m.disable(DLG_DELREC); } +int TQuadroG1::read(TMask& m) +{ + int err = TRelation_application::read(m); + if (err == NOERR) + fill_arr(m); + return err; +} + void TQuadroG1::init_query_mode (TMask& m) { TString16 codditta; codditta << _codditta; @@ -40,14 +48,10 @@ void TQuadroG1::init_query_mode (TMask& m) m.field(F_CODDITTA).check(); } m.send_key(K_AUTO_ENTER,0); - - init_mask(m); +// init_mask(m); } -void TQuadroG1::init_mask (TMask& m) -{ - fill_arr(m); -} +//void TQuadroG1::init_mask (TMask& m){} void TQuadroG1::update_totals(TSheet_field& f) { @@ -100,12 +104,12 @@ bool TQuadroG1::user_destroy() void TQuadroG1::arr2rel(const TMask& m) { - TToken_string p3a(200); - TToken_string p3b(200); - TToken_string p3c(200); - TToken_string p3d(200); - TToken_string p3e(200); - TToken_string p3f(200); + TToken_string p3a; + TToken_string p3b; + TToken_string p3c; + TToken_string p3d; + TToken_string p3e; + TToken_string p3f; TRectype& r = _rel->curr(); int dlg; dlg = 0; diff --git a/m770/77lib.h b/m770/77lib.h index 5cefa778d..526318aa1 100755 --- a/m770/77lib.h +++ b/m770/77lib.h @@ -75,7 +75,7 @@ typedef enum { estinto=0, normale, dichiarante } TipoDitta; // Controlla se esiste la dic bool exist_dichiar_770 (long codditta, bool sogg_dich= FALSE); // Immette una dichiarazione -bool enter_dichiar_770 (long codditta, int annodic=0, bool sogg_dich= FALSE); +bool enter_dichiar_770 (long codditta, int annodic=0, bool sogg_dich= FALSE); // Ritorna l'anno sui parametri di studio int anno_770(); @@ -124,7 +124,7 @@ class TNikArray_sheet : public TArray_sheet TNikArray_sheet(short x, short y, short dx, short dy, const char* caption, const char* head, byte buttons = 0, WINDOW parent = NULL_WIN, int visible=0) - : TArray_sheet(x, y, dx, dy, caption,head, buttons), + : TArray_sheet(x, y, dx, dy, caption,head, buttons, parent), _visible_items(visible) {} bool destroy(int i = -1); @@ -145,23 +145,23 @@ const int SCHEDA_NON_ESISTENTE = -2; class TSchedaP { private: - long _codditta; - char _tipoa; - long _codanagr; - int _nprog; - real _spese_doc, _compenso_doc; - TDate _data_doc; + long _codditta; + char _tipoa; + long _codanagr; + int _nprog; + real _spese_doc, _compenso_doc; + TDate _data_doc; public: - bool read(); - long codditta() const { return _codditta; } - char tipoa() const { return _tipoa; } - long codanagr() const { return _codanagr; } - int nprog() const { return _nprog; } + bool read(); + long codditta() const { return _codditta; } + char tipoa() const { return _tipoa; } + long codanagr() const { return _codanagr; } + int nprog() const { return _nprog; } - real compenso_doc() const; - real spese_doc() const; - int anno_doc() const; + real compenso_doc() const; + real spese_doc() const; + int anno_doc() const; bool operator == (const TSchedaP& sch) const { @@ -194,9 +194,9 @@ class TSchedaP class TPercipiente { private: - long _codditta; - char _tipoa; - long _codanagr; + long _codditta; + char _tipoa; + long _codanagr; public: long codditta() const { return _codditta; } @@ -235,22 +235,22 @@ class TPercipiente class TVersamento { protected: - long _codditta; - char _tipoa; - long _codanagr; - int _nprog; - int _nriga; - real _importo_versato; + long _codditta; + char _tipoa; + long _codanagr; + int _nprog; + int _nriga; + real _importo_versato; public: - long codditta() const { return _codditta; } - char tipoa() const { return _tipoa; } - long codanagr() const { return _codanagr; } - int nprog() const { return _nprog; } - int nriga() const { return _nriga; } + long codditta() const { return _codditta; } + char tipoa() const { return _tipoa; } + long codanagr() const { return _codanagr; } + int nprog() const { return _nprog; } + int nriga() const { return _nriga; } real importo_versato() const { return _importo_versato; } - void set_importo_versato(real& imp) { _importo_versato = imp; } + void set_importo_versato(real& imp) { _importo_versato = imp; } virtual TVersamento& operator = (const TVersamento& sch) { @@ -296,13 +296,13 @@ class TVersamento class TVersamento_stampa : public TVersamento { private: - TAssoc_array _vers; - real _importo_versato_residuo; - real _importo_versato; - int _status; // esito read_pags - int _num_pags; // numero di pagamenti collegati - bool _gia_letti_pag; - int _num_last_pag; // numero dell'ultimo pagamento + TAssoc_array _vers; + real _importo_versato_residuo; + real _importo_versato; + int _status; // esito read_pags + int _num_pags; // numero di pagamenti collegati + bool _gia_letti_pag; + int _num_last_pag; // numero dell'ultimo pagamento public: virtual void set(const long codditta=0L, const char tipoa=0, const long codanagr=0L, const int nprog=0, const int nriga=0, const real& impvers=ZERO); @@ -317,17 +317,17 @@ class TVersamento_stampa : public TVersamento return *this; } - int read_pags(TLocalisamfile* pagf=NULL); // legge i pagamenti collegati - int num_pags(TLocalisamfile* pag=NULL); - bool last_pag(const int npag) const { return npag == _num_last_pag; } - real importo_versato() const { return _importo_versato; } - void set_importo_versato(const real& imp) { _importo_versato = imp; } + int read_pags(TLocalisamfile* pagf=NULL); // legge i pagamenti collegati + int num_pags(TLocalisamfile* pag=NULL); + bool last_pag(const int npag) const { return npag == _num_last_pag; } + real importo_versato() const { return _importo_versato; } + void set_importo_versato(const real& imp) { _importo_versato = imp; } - void add(TVersamento& vers); - bool find(TVersamento& vers); + void add(TVersamento& vers); + bool find(TVersamento& vers); - real vers_stampa(TLocalisamfile* rpag, const int nriga_pag, const real& vers, const real& rit); - real importo_versato_residuo() const { return _importo_versato_residuo; } + real vers_stampa(TLocalisamfile* rpag, const int nriga_pag, const real& vers, const real& rit); + real importo_versato_residuo() const { return _importo_versato_residuo; } TVersamento_stampa(const long codditta=0L, const char tipoa=0, const long codanagr=0L, const int nprog=0, const int nriga=0, const real& impvers=ZERO); }; @@ -342,18 +342,18 @@ typedef enum { nessuno=0, fattura=1, pagamento=3, versamento=4, struct TLink770 { - TTipo_coll _tipo_coll; - char _immissione; - char _tipo; - long _codanagr; - long _numreg; - TString16 _numdoc; - TString16 _datadoc; - real _spese; - real _compenso; - real _imposte; - real _ritenute; - real _totdoc; + TTipo_coll _tipo_coll; + char _immissione; + char _tipo; + long _codanagr; + long _numreg; + TString16 _numdoc; + TString16 _datadoc; + real _spese; + real _compenso; + real _imposte; + real _ritenute; + real _totdoc; bool read(const char* msg); diff --git a/m770/77stq.cpp b/m770/77stq.cpp index 9db734994..dd7921855 100755 --- a/m770/77stq.cpp +++ b/m770/77stq.cpp @@ -7,13 +7,13 @@ #include #include #include -#include "base.h" +#include #include #include #include #include "quadrod.h" -#include "quadrod1.h" +#include #include "quadrogd.h" #include "quadrif.h" #include "77stqd.h" @@ -22,8 +22,8 @@ // // Lista modifiche // -// 3.4.96 Nella stampa per Modulaser, aggiunto all'inizio un comando per settare -// il font della stampante a 17cpi (v.riga 176) +// 3.4.96 Nella stampa per Modulaser, aggiunto all'inizio un comando per settare +// il font della stampante a 17cpi (v.riga 176) // @@ -41,24 +41,24 @@ HIDDEN TString80 __dep80; HIDDEN const char* form(TString& quadro); // Vega-Key di Modulaser -HIDDEN const char* VK_STARTDOC = "&MA795&0&1"; -HIDDEN const char* VK_ENDDOC = "!0"; +HIDDEN const char* VK_STARTDOC = "&MA795&0&1"; +HIDDEN const char* VK_ENDDOC = "!0"; HIDDEN const char* VK_STARTPAGE[] = { "*9*1", "*9*2", "*9*3", "*9*4" }; typedef enum { STARTDOC, STARTDITTA, STARTPAGE, ENDDOC } ModulaserKey; // Campi form -#define TOT_TOTALE 1 -#define TOT_SNSRIT 2 -#define TOT_IMPON 3 -#define TOT_IMPOR 4 -#define TOT_NETTO 5 -#define H_COFI_DIC 13 -#define H_NUM_FOGLIO 14 +#define TOT_TOTALE 1 +#define TOT_SNSRIT 2 +#define TOT_IMPON 3 +#define TOT_IMPOR 4 +#define TOT_NETTO 5 +#define H_COFI_DIC 13 +#define H_NUM_FOGLIO 14 // Quadro D HIDDEN const int QD_FORMLEN_PRIMA = 70; // 72 - 3 (3 e' la posizione della X di posiz.) HIDDEN const int QD_FORMLEN = 72; -HIDDEN const int POS_DITTA = 91; // Colonna del codice ditta a pie' di modulo +HIDDEN const int POS_DITTA = 91; // Colonna del codice ditta a pie' di modulo HIDDEN const int QD_PAGINE = 4; HIDDEN const int QD_RIGHE_PRIMA = 5; HIDDEN const int QD_RIGHE_SECONDA = 7; @@ -80,86 +80,86 @@ typedef enum { fisiche, nofisiche } TipoPagina; class TDicForm : public TForm { private: - real _f_tot_totale, _f_tot_snsrit, _f_tot_impon, _f_tot_impor, _f_tot_netto; - real _nf_tot_totale, _nf_tot_snsrit, _nf_tot_impon, _nf_tot_impor, _nf_tot_netto; - void aggiorna_totali_C(const char tipo); - void aggiorna_totali_D(const char tipo); - void aggiorna_totali_D1(const char tipo); - void aggiorna_totali_E(const char tipo); - void aggiorna_totali_E1(const char tipo); + real _f_tot_totale, _f_tot_snsrit, _f_tot_impon, _f_tot_impor, _f_tot_netto; + real _nf_tot_totale, _nf_tot_snsrit, _nf_tot_impon, _nf_tot_impor, _nf_tot_netto; + void aggiorna_totali_C(const char tipo); + void aggiorna_totali_D(const char tipo); + void aggiorna_totali_D1(const char tipo); + void aggiorna_totali_E(const char tipo); + void aggiorna_totali_E1(const char tipo); - TRelation* _rel; - TCursor* _cur; - TSorted_cursor* _sorted_cur; + TRelation* _rel; + TCursor* _cur; + TSorted_cursor* _sorted_cur; protected: - long _Items; // numero di record che hanno passato il filtro - PagineQD _PaginaCorrente; - void set_curr_page(PagineQD pagina) { _PaginaCorrente = pagina; } - virtual void inc_curr_page(); - virtual void next_page(TPrinter& pr); - bool _modulaser; // se stampa per modulaser - bool _posiziona; // se deve fare posizionamento - TipoDitta _tipo_ditta; // tipo ditta: normale, estinto, dichiarante - int _num_foglio; // numero foglio - TString _cofi_dic; // cod.fis. dichiarante - bool _can_print_tot_fis, _can_print_tot_nofis; - bool _finite_fis, _finite_nofis, _LastDitta, _EndPrintDitta; - bool _GiaStampatiFis, _GiaStampatiNoFis, _PaginaPosizionamento; - bool _GiaPosizionato, _GiaMessoStartDoc, _GiaMessoStartPage[QD_PAGINE]; // flag per modulaser - int _CtrNoFisStampati, _CtrFisStampati; // contatori p.f. e p.g. stampate - long _codditta; // ditta in stampa - int _RigaCorr; // contatore riga corrente - TString16 _quadro; // codice quadro in stampa + long _Items; // numero di record che hanno passato il filtro + PagineQD _PaginaCorrente; + void set_curr_page(PagineQD pagina) { _PaginaCorrente = pagina; } + virtual void inc_curr_page(); + virtual void next_page(TPrinter& pr); + bool _modulaser; // se stampa per modulaser + bool _posiziona; // se deve fare posizionamento + TipoDitta _tipo_ditta; // tipo ditta: normale, estinto, dichiarante + int _num_foglio; // numero foglio + TString _cofi_dic; // cod.fis. dichiarante + bool _can_print_tot_fis, _can_print_tot_nofis; + bool _finite_fis, _finite_nofis, _LastDitta, _EndPrintDitta; + bool _GiaStampatiFis, _GiaStampatiNoFis, _PaginaPosizionamento; + bool _GiaPosizionato, _GiaMessoStartDoc, _GiaMessoStartPage[QD_PAGINE]; // flag per modulaser + int _CtrNoFisStampati, _CtrFisStampati; // contatori p.f. e p.g. stampate + long _codditta; // ditta in stampa + int _RigaCorr; // contatore riga corrente + TString16 _quadro; // codice quadro in stampa virtual TCursor* cursor() const { return _cur; } virtual TRelation* relation() const { return _rel; } - void stampa_testata(TPrinter& pr); - virtual void stampa_totali(TPrinter& pr); - virtual void aggiorna_totali(const char tipo); - virtual void set_body(TPrinter& pr, const char tipo, const bool UsaProgind); - void StampaPagina(PagineQD PaginaCorrente, const bool StampaTotali, const long Fis, const long NoFis); - void posiziona(); - void fill_page(TPrinter& pr, const int righe); - void put_modulaser(TPrintrow& row, ModulaserKey key, int page=0); - void ClearFlagModulaser(); - bool PaginaPosizionamento() const; + void stampa_testata(TPrinter& pr); + virtual void stampa_totali(TPrinter& pr); + virtual void aggiorna_totali(const char tipo); + virtual void set_body(TPrinter& pr, const char tipo, const bool UsaProgind); + void StampaPagina(PagineQD PaginaCorrente, const bool StampaTotali, const long Fis, const long NoFis); + void posiziona(); + void fill_page(TPrinter& pr, const int righe); + void put_modulaser(TPrintrow& row, ModulaserKey key, int page=0); + void ClearFlagModulaser(); + bool PaginaPosizionamento() const; virtual bool InitPrint(const long codditta); - bool _UsaProgind; // usa la progind solo se non e' stampa a video + bool _UsaProgind; // usa la progind solo se non e' stampa a video public: - const long filtra(const long codditta); - virtual bool UsaSortedCursor() { return TRUE; } + const long filtra(const long codditta); + virtual bool UsaSortedCursor() { return TRUE; } - TProgind* _prog; // progind usata in print() + TProgind* _prog; // progind usata in print() void set_progind(TProgind* prog, bool usaprogind) { _prog = prog; _UsaProgind = usaprogind; } - long codditta() const { return _codditta; } - void set_codditta(const long ditta) { _codditta = ditta; } - void set_posiziona(const bool posiz) { _posiziona = posiz; _GiaPosizionato = FALSE; } - void can_print_tot_fis(const bool canpr) { _can_print_tot_fis = canpr; } - void can_print_tot_nofis(const bool canpr) { _can_print_tot_nofis = canpr; } - void set_last_ditta(const bool last) { _LastDitta = last; } - bool last_ditta() const { return _LastDitta; } - bool EndJob() const { return _LastDitta && _EndPrintDitta; } - bool ultima_fis(); - bool ultima_nofis(); - TString& cofi_dic() { return _cofi_dic; } - void set_cofi_dic(const char* cofi) { _cofi_dic = cofi; } - TipoDitta tipo_ditta() const { return _tipo_ditta; } - void set_tipo_ditta(TipoDitta tipo) { _tipo_ditta = tipo; } - bool modulaser() const { return _modulaser; } - void set_modulaser(const bool modul) { _modulaser = modul; } - void set_num_foglio(const int foglio) { _num_foglio = foglio; } - int num_foglio() const { return _num_foglio; } - void azzera_totali(); - PagineQD curr_page() const { return _PaginaCorrente; } - TCursor& cur(); - TProgind* progind() { return _prog; } - bool usaprogind() const { return _UsaProgind; } - virtual void set_cur_rel(TRelation* rel, TCursor* cur); - virtual void close_print(); - virtual bool print(const long codditta, const long NumFis, const long NumNoFis); + long codditta() const { return _codditta; } + void set_codditta(const long ditta) { _codditta = ditta; } + void set_posiziona(const bool posiz) { _posiziona = posiz; _GiaPosizionato = FALSE; } + void can_print_tot_fis(const bool canpr) { _can_print_tot_fis = canpr; } + void can_print_tot_nofis(const bool canpr) { _can_print_tot_nofis = canpr; } + void set_last_ditta(const bool last) { _LastDitta = last; } + bool last_ditta() const { return _LastDitta; } + bool EndJob() const { return _LastDitta && _EndPrintDitta; } + bool ultima_fis(); + bool ultima_nofis(); + TString& cofi_dic() { return _cofi_dic; } + void set_cofi_dic(const char* cofi) { _cofi_dic = cofi; } + TipoDitta tipo_ditta() const { return _tipo_ditta; } + void set_tipo_ditta(TipoDitta tipo) { _tipo_ditta = tipo; } + bool modulaser() const { return _modulaser; } + void set_modulaser(const bool modul) { _modulaser = modul; } + void set_num_foglio(const int foglio) { _num_foglio = foglio; } + int num_foglio() const { return _num_foglio; } + void azzera_totali(); + PagineQD curr_page() const { return _PaginaCorrente; } + TCursor& cur(); + TProgind* progind() { return _prog; } + bool usaprogind() const { return _UsaProgind; } + virtual void set_cur_rel(TRelation* rel, TCursor* cur); + virtual void close_print(); + virtual bool print(const long codditta, const long NumFis, const long NumNoFis); TDicForm(const char* form, const char* quadro); virtual ~TDicForm() {} @@ -545,7 +545,7 @@ void TDicForm::put_modulaser(TPrintrow& row, ModulaserKey Cmd, int page) if (!_GiaMessoStartDoc) { // riga = VK_STARTDOC; - riga = "\xf"; // Printer escape: font 17cpi + riga = "\xf"; // Printer escape: font 17cpi riga << VK_STARTDOC; _GiaMessoStartDoc = TRUE; } @@ -974,9 +974,9 @@ HIDDEN const int HEADER_SECONDA_G = 7; class TQuadroG : public TDicForm { private: - long _items_g, _items_gd; - void stampa_prospetti1_2(TPrinter& pr, const bool UsaProgind); - void stampa_prospetti3_4(TPrinter& pr, const bool UsaProgind); + long _items_g, _items_gd; + void stampa_prospetti1_2(TPrinter& pr, const bool UsaProgind); + void stampa_prospetti3_4(TPrinter& pr, const bool UsaProgind); protected: virtual void inc_curr_page(); @@ -986,8 +986,8 @@ class TQuadroG : public TDicForm virtual void set_body(TPrinter& pr, const char tipo, const bool UsaProgind) {} public: - virtual bool UsaSortedCursor() { return FALSE; } - virtual bool print(const long codditta, const long NumFis, const long NumNoFis); + virtual bool UsaSortedCursor() { return FALSE; } + virtual bool print(const long codditta, const long NumFis, const long NumNoFis); void set_items_gd(const long itg, const long itgd) { _items_g = itg; _items_gd = itgd; } TQuadroG(const char* form, const char* quadro) : TDicForm(form, quadro), @@ -1125,7 +1125,7 @@ void TQuadroG::stampa_prospetti3_4(TPrinter& pr, const bool UsaProgind) { TForm_item& c2 = sez.find_field(i); TForm_item& c7 = sez.find_field(i+65); - int src=0; // determina quale posizione va letta dalla token-string per il campo corrente + int src=0; // determina quale posizione va letta dalla token-string per il campo corrente switch (i) { case 1: @@ -1244,7 +1244,7 @@ bool TQuadroG::print(const long codditta, const long NumFis, const long NumNoFis /////////////////////////////////////////////////////////////////////////////////////////// // -// Distinta G +// Distinta G // /////////////////////////////////////////////////////////////////////////////////////////// @@ -1256,17 +1256,17 @@ HIDDEN const int QGD_RIGHE_PRIMA = 8; class TDistintaG : public TQuadroG { private: - real _f_tot_utspet, _f_tot_utpag, _f_tot_rope, _f_tot_ropespet; - real _nf_tot_utspet, _nf_tot_utpag, _nf_tot_rope, _nf_tot_ropespet; - void aggiorna_totali(const char tipo); - void stampa_totali(TPrinter& pr); - void stampa_testata(TPrinter& pr); - virtual void next_page(TPrinter& pr); - virtual void set_body(TPrinter& pr, const char tipo, const bool UsaProgind); + real _f_tot_utspet, _f_tot_utpag, _f_tot_rope, _f_tot_ropespet; + real _nf_tot_utspet, _nf_tot_utpag, _nf_tot_rope, _nf_tot_ropespet; + void aggiorna_totali(const char tipo); + void stampa_totali(TPrinter& pr); + void stampa_testata(TPrinter& pr); + virtual void next_page(TPrinter& pr); + virtual void set_body(TPrinter& pr, const char tipo, const bool UsaProgind); public: - virtual bool UsaSortedCursor() { return FALSE; } - virtual bool print(const long codditta, const long NumFis, const long NumNoFis); + virtual bool UsaSortedCursor() { return FALSE; } + virtual bool print(const long codditta, const long NumFis, const long NumNoFis); TDistintaG(const char* form, const char* quadro) : TQuadroG(form,quadro) {} virtual ~TDistintaG() {} @@ -1624,7 +1624,7 @@ bool TDistintaG::print(const long codditta, const long NumFis, const long NumNoF class TStDicArray : public TObject { private: - TArray _store; + TArray _store; public: TToken_string& operator[](int i); int curr_index() const { return _store.last(); } @@ -1711,43 +1711,43 @@ void TStDicArray::add(const long codditta, const TipoDitta tipo, const int num_f class TStampaQuadro : public TApplication { private: - TDicForm* _form; + TDicForm* _form; protected: - TMask* _m; - TRelation* _rel; - TCursor* _cur; - TSorted_cursor* _sorted_cur; - TString16 _quadro; - TString80 _title; - char _livello; // "S" studio, "D" singola ditta - long _codditta; - TStDicArray _ditte; - TConfig* _cnf; - TString16 _section; - bool _singola_ditta; - int _anno_dic; + TMask* _m; + TRelation* _rel; + TCursor* _cur; + TSorted_cursor* _sorted_cur; + TString16 _quadro; + TString80 _title; + char _livello; // "S" studio, "D" singola ditta + long _codditta; + TStDicArray _ditte; + TConfig* _cnf; + TString16 _section; + bool _singola_ditta; + int _anno_dic; - virtual TDicForm* build_form(); - virtual TCursor* build_cursor(); - virtual TDicForm* get_form() const { return _form; } - virtual TRelation* get_relation() const { return _rel; } - virtual TCursor* get_cursor() const { return _cur; } + virtual TDicForm* build_form(); + virtual TCursor* build_cursor(); + virtual TDicForm* get_form() const { return _form; } + virtual TRelation* get_relation() const { return _rel; } + virtual TCursor* get_cursor() const { return _cur; } virtual TSorted_cursor* get_sorted_cursor() const { return _sorted_cur; } - virtual void on_config_change(); - virtual void fill_estinti(const long CodDic); - virtual void print(); - virtual bool create(); - virtual bool destroy(); - virtual bool menu(MENU_TAG); - virtual const char* mask(const char* quadro); - virtual bool print_quadro(TString& quadro, const int OffsetDitta=-1); - virtual bool UsaSortedCursor() const { return TRUE; } - virtual bool ContaTipiPer() const { return TRUE; } + virtual void on_config_change(); + virtual void fill_estinti(const long CodDic); + virtual void print(); + virtual bool create(); + virtual bool destroy(); + virtual bool menu(MENU_TAG); + virtual const char* mask(const char* quadro); + virtual bool print_quadro(TString& quadro, const int OffsetDitta=-1); + virtual bool UsaSortedCursor() const { return TRUE; } + virtual bool ContaTipiPer() const { return TRUE; } public: - virtual TSorted_cursor* sorted_cur() const { return _sorted_cur; } + virtual TSorted_cursor* sorted_cur() const { return _sorted_cur; } const char* taitol() { return _title; } TStampaQuadro(const char* quadro, const char livel); @@ -2171,17 +2171,17 @@ void TStampaQuadro::print() class TStampaQuadroG : public TStampaQuadro { private: - TQuadroG* _form_g; - TDistintaG* _form_gd; - TRelation* _rel_g, * _rel_gd; - TCursor* _cur_g, * _cur_gd; + TQuadroG* _form_g; + TDistintaG* _form_gd; + TRelation* _rel_g, * _rel_gd; + TCursor* _cur_g, * _cur_gd; protected: - virtual TCursor* build_cursor(); - virtual TDicForm* build_form(); - virtual TDicForm* get_form() const { return _form_g; } - virtual bool destroy(); - bool print_quadro(TString& quadro, const int OffsetDitta=-1); + virtual TCursor* build_cursor(); + virtual TDicForm* build_form(); + virtual TDicForm* get_form() const { return _form_g; } + virtual bool destroy(); + bool print_quadro(TString& quadro, const int OffsetDitta=-1); public: TStampaQuadroG(const char* quadro, const char livel) : TStampaQuadro(quadro,livel) {} @@ -2338,13 +2338,13 @@ HIDDEN const int QG1_PAGINE = 1; class TQuadroG1 : public TDicForm { private: - long _items; - void stampa_prospetto(TPrinter& pr, const bool UsaProgind); + long _items; + void stampa_prospetto(TPrinter& pr, const bool UsaProgind); public: - virtual bool UsaSortedCursor() { return FALSE; } - virtual bool print(const long codditta, const long NumFis=0L, const long NumNoFis=0L); - //virtual bool print(const long codditta); + virtual bool UsaSortedCursor() { return FALSE; } + virtual bool print(const long codditta, const long NumFis=0L, const long NumNoFis=0L); + //virtual bool print(const long codditta); TQuadroG1(const char* form, const char* quadro) : TDicForm(form, quadro) {} virtual ~TQuadroG1() {} @@ -2465,22 +2465,22 @@ void TQuadroG1::stampa_prospetto(TPrinter& pr, const bool UsaProgind) class TStampaQuadroG1 : public TStampaQuadro { private: - TQuadroG1* _form; - TRelation* _rel; - TCursor* _cur; + TQuadroG1* _form; + TRelation* _rel; + TCursor* _cur; protected: - virtual TCursor* get_cursor() const { return _cur; } - virtual TRelation* get_relation() const { return _rel; } - virtual bool ContaTipiPer() const { return FALSE; } - virtual bool UsaSortedCursor() const { return FALSE; } - virtual TDicForm* get_form() const { return _form; } - virtual TDicForm* build_form(); - virtual TCursor* build_cursor(); -// virtual void fill_estinti(const long CodDic); - virtual bool destroy(); -// bool print_quadro(TString& quadro, const int OffsetDitta=-1); -// virtual void print(); + virtual TCursor* get_cursor() const { return _cur; } + virtual TRelation* get_relation() const { return _rel; } + virtual bool ContaTipiPer() const { return FALSE; } + virtual bool UsaSortedCursor() const { return FALSE; } + virtual TDicForm* get_form() const { return _form; } + virtual TDicForm* build_form(); + virtual TCursor* build_cursor(); +// virtual void fill_estinti(const long CodDic); + virtual bool destroy(); +// bool print_quadro(TString& quadro, const int OffsetDitta=-1); +// virtual void print(); public: TStampaQuadroG1(const char* quadro, const char livel) : TStampaQuadro(quadro,livel) {} }; @@ -2682,24 +2682,24 @@ HIDDEN const int HEADER_SECONDA_F = 7; class TQuadroF : public TDicForm { private: - real pa3t, pa4t, pa5t, pa6t, pa7t; // totali prosp. A - real pb3t, pb4t, pc3t, pc4t, pd3t, pd4t; // totali prosp, B, C e D - int _ptrA, _ptrB, _ptrC, _ptrD; // puntatori alle righe dei prospetti - long _items; - int stampa_prospetto_A(TPrinter& pr, const bool UsaProgind); - int stampa_prospetto_B(TPrinter& pr, const bool UsaProgind); - int stampa_prospetto_C(TPrinter& pr, const bool UsaProgind); - int stampa_prospetto_D(TPrinter& pr, const bool UsaProgind); - TRecord_array* _prosp_a, *_prosp_b, *_prosp_c, *_prosp_d; - void azzera_contatori(); - void aggiorna_totali(char tipoprosp, TRectype& r); - void stampa_totali(char tipoprosp, TPrinter& pr, const bool UsaProgind); + real pa3t, pa4t, pa5t, pa6t, pa7t; // totali prosp. A + real pb3t, pb4t, pc3t, pc4t, pd3t, pd4t; // totali prosp, B, C e D + int _ptrA, _ptrB, _ptrC, _ptrD; // puntatori alle righe dei prospetti + long _items; + int stampa_prospetto_A(TPrinter& pr, const bool UsaProgind); + int stampa_prospetto_B(TPrinter& pr, const bool UsaProgind); + int stampa_prospetto_C(TPrinter& pr, const bool UsaProgind); + int stampa_prospetto_D(TPrinter& pr, const bool UsaProgind); + TRecord_array* _prosp_a, *_prosp_b, *_prosp_c, *_prosp_d; + void azzera_contatori(); + void aggiorna_totali(char tipoprosp, TRectype& r); + void stampa_totali(char tipoprosp, TPrinter& pr, const bool UsaProgind); public: - virtual bool UsaSortedCursor() { return FALSE; } - virtual bool print(const long codditta, const long numfis=0L, const long numnofis=0L); - virtual void inc_curr_page(); - virtual void next_page(TPrinter& pr); + virtual bool UsaSortedCursor() { return FALSE; } + virtual bool print(const long codditta, const long numfis=0L, const long numnofis=0L); + virtual void inc_curr_page(); + virtual void next_page(TPrinter& pr); TQuadroF(const char* form, const char* quadro) : TDicForm(form, quadro) {} virtual ~TQuadroF() {} @@ -2708,7 +2708,7 @@ class TQuadroF : public TDicForm void TQuadroF::azzera_contatori() { pa3t = pa4t = pa5t = pa6t = pa7t = ZERO; - pb3t=pb4t=pc3t=pc4t=pd3t=pd4t = ZERO; // totali prosp, B, C e D + pb3t=pb4t=pc3t=pc4t=pd3t=pd4t = ZERO; // totali prosp, B, C e D _ptrA = _ptrB = _ptrC = _ptrD = 1; } @@ -3196,20 +3196,20 @@ int TQuadroF::stampa_prospetto_A(TPrinter& pr, const bool UsaProgind) class TStampaQuadroF : public TStampaQuadro { private: - TQuadroF* _form; - TRelation* _rel; - TCursor* _cur; + TQuadroF* _form; + TRelation* _rel; + TCursor* _cur; protected: - virtual bool ContaTipiPer() const { return FALSE; } - virtual bool UsaSortedCursor() const { return FALSE; } - virtual TDicForm* get_form() const { return _form; } - virtual TDicForm* build_form(); - virtual TCursor* build_cursor(); - virtual TCursor* get_cursor() const { return _cur; } - virtual TRelation* get_relation() const { return _rel; } - virtual bool destroy(); -// virtual void print(); + virtual bool ContaTipiPer() const { return FALSE; } + virtual bool UsaSortedCursor() const { return FALSE; } + virtual TDicForm* get_form() const { return _form; } + virtual TDicForm* build_form(); + virtual TCursor* build_cursor(); + virtual TCursor* get_cursor() const { return _cur; } + virtual TRelation* get_relation() const { return _rel; } + virtual bool destroy(); +// virtual void print(); public: TStampaQuadroF(const char* quadro, const char livel) : TStampaQuadro(quadro,livel) {} @@ -3258,17 +3258,17 @@ HIDDEN const int HEADER_SECONDA_H = 7; class TQuadroH : public TDicForm { private: - real _rC2t, _rC3t; // totali colonna 2 e 3 - long _items; - void azzera_contatori(); -// void aggiorna_totali(char tipoprosp, TRectype& r); -// void stampa_totali(char tipoprosp, TPrinter& pr, const bool UsaProgind); + real _rC2t, _rC3t; // totali colonna 2 e 3 + long _items; + void azzera_contatori(); +// void aggiorna_totali(char tipoprosp, TRectype& r); +// void stampa_totali(char tipoprosp, TPrinter& pr, const bool UsaProgind); public: - virtual bool UsaSortedCursor() { return FALSE; } - virtual bool print(const long codditta, const long numfis=0L, const long numnofis=0L); - virtual void inc_curr_page(); - virtual void next_page(TPrinter& pr); + virtual bool UsaSortedCursor() { return FALSE; } + virtual bool print(const long codditta, const long numfis=0L, const long numnofis=0L); + virtual void inc_curr_page(); + virtual void next_page(TPrinter& pr); TQuadroH(const char* form, const char* quadro) : TDicForm(form, quadro) {} virtual ~TQuadroH() {} @@ -3319,13 +3319,12 @@ int stampa_quadro(int argc, char* argv[]) TStampaQuadroG1 app(quadro, livello); app.run(argc, argv, app.taitol()); } -/* + if (quadro == "H") { TStampaQuadroH app(quadro, livello); app.run(argc, argv, app.taitol()); } -*/ } return 0; } diff --git a/m770/pe1.h b/m770/pe1.h index 0ec7d6cd8..259bcc53d 100755 --- a/m770/pe1.h +++ b/m770/pe1.h @@ -1,18 +1,18 @@ -#ifndef _PE1_H -#define _PE1_H - -//771230m.uml (prospetto E1) -#define PE1F_CODCAUS 113 -#define PE1F_IMPONIBILE 119 -#define PE1F_RITENUTA 160 -#define PE1F_COMPENSO 161 -#define PE1F_CODCAUS2 162 -#define F_CODANAGR2 170 -#define F_RAGSOC2 171 -#define PE1F_HPERC 172 -#define PE1F_CODDITTA 181 -#define PE1F_DESCRCAUS 184 -#define PE1F_RAGDITTA 185 - -#endif - +#ifndef _PE1_H +#define _PE1_H + +//771230m.uml (prospetto E1) +#define PE1F_CODCAUS 113 +#define PE1F_IMPONIBILE 119 +#define PE1F_RITENUTA 160 +#define PE1F_COMPENSO 161 +#define PE1F_CODCAUS2 162 +#define F_CODANAGR2 170 +#define F_RAGSOC2 171 +#define PE1F_HPERC 172 +#define PE1F_CODDITTA 181 +#define PE1F_DESCRCAUS 184 +#define PE1F_RAGDITTA 185 + +#endif + diff --git a/m770/rpag.h b/m770/rpag.h index 5381be5dd..74b457dd2 100755 --- a/m770/rpag.h +++ b/m770/rpag.h @@ -1,23 +1,23 @@ -// Mod.770 - Scheda percipienti - Righe Pagamenti - -#ifndef __RPAG_H -#define __RPAG_H - -#define PAG_CODDITTA "CODDITTA" -#define PAG_TIPOA "TIPOA" -#define PAG_CODANAGR "CODANAGR" -#define PAG_NPROG "NPROG" -#define PAG_NRIGA "NRIGA" -#define PAG_DATAPAG "DATAPAG" -#define PAG_IMPONIBILE "IMPONIBILE" -#define PAG_PERC "PERC" -#define PAG_RITENUTA "RITENUTA" -#define PAG_COMPENSO "COMPENSO" -#define PAG_NETTO "NETTO" -#define PAG_NUMVERS "NUMVERS" -#define PAG_NUMPAG "NUMPAG" -#define PAG_SPESA "SPESA" -#define PAG_INPSPERC "CTSSNPERC" -#define PAG_INPSCOMP "CTSSNCOMP" - -#endif +// Mod.770 - Scheda percipienti - Righe Pagamenti + +#ifndef __RPAG_H +#define __RPAG_H + +#define PAG_CODDITTA "CODDITTA" +#define PAG_TIPOA "TIPOA" +#define PAG_CODANAGR "CODANAGR" +#define PAG_NPROG "NPROG" +#define PAG_NRIGA "NRIGA" +#define PAG_DATAPAG "DATAPAG" +#define PAG_IMPONIBILE "IMPONIBILE" +#define PAG_PERC "PERC" +#define PAG_RITENUTA "RITENUTA" +#define PAG_COMPENSO "COMPENSO" +#define PAG_NETTO "NETTO" +#define PAG_NUMVERS "NUMVERS" +#define PAG_NUMPAG "NUMPAG" +#define PAG_SPESA "SPESA" +#define PAG_INPSPERC "CTSSNPERC" +#define PAG_INPSCOMP "CTSSNCOMP" + +#endif