From 2a4fdcc1844ec8fe91e1a3f010e2b0da06ac09e1 Mon Sep 17 00:00:00 2001 From: nik Date: Fri, 24 Mar 1995 11:19:54 +0000 Subject: [PATCH] Aggiunta stampa riepilogo progressivi IVA git-svn-id: svn://10.65.10.50/trunk@1163 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg0.url | 15 +- cg/cg0400.cpp | 536 ++++++++++++++++++++++++++++++++++++++++++------- cg/cg0400.h | 5 +- cg/cg0400a.uml | 22 +- cg/cg0400b.uml | 72 +++++++ 5 files changed, 563 insertions(+), 87 deletions(-) create mode 100755 cg/cg0400b.uml diff --git a/cg/cg0.url b/cg/cg0.url index 59f376a6e..cf2da2256 100755 --- a/cg/cg0.url +++ b/cg/cg0.url @@ -1,13 +1,13 @@ #include MENU TASK_MENUBAR - SUBMENU MENU_FILE "~File" + SUBMENU MENU_FILE "~File" MENUBAR MENU_BAR(1) MENU MENU_BAR(1) - SUBMENU MENU_FILE "~File" + SUBMENU MENU_FILE "~File" MENUBAR MENU_BAR(2) @@ -15,16 +15,17 @@ MENUBAR MENU_BAR(2) MENU MENU_BAR(2) SUBMENU MENU_FILE "~File" + MENUBAR MENU_BAR(3) MENU MENU_BAR(3) - SUBMENU MENU_FILE "~File" + SUBMENU MENU_FILE "~File" + ITEM BAR_ITEM(1) "~Progressivi" + ITEM BAR_ITEM(2) "~Riepilogo" + -/* - * cg0 -4 - */ MENUBAR MENU_BAR(4) MENU MENU_BAR(4) - SUBMENU MENU_FILE "~File" + SUBMENU MENU_FILE "~File" diff --git a/cg/cg0400.cpp b/cg/cg0400.cpp index f059dd44f..f2858b6bd 100755 --- a/cg/cg0400.cpp +++ b/cg/cg0400.cpp @@ -16,21 +16,114 @@ #include "cg0.h" #include "cg0400.h" +HIDDEN TString80 TMP; + +enum liste { + visualizza=1, + stampa=2, +}; + struct Importi { real imponibile; real imposta; }; +struct TRiga_gen : public TArray +{ + TString16 _codiva; + real _impoven, _imposven; //imponibile e imposta vendite + real _impoacq, _imposacq; //imponibile e imposta acquisti + real _impobd, _imposbd; //imponibile e imposta importazioni (ovvero bolle doganali) + + TRiga_gen (const char* codiva, const real& impov, const real& imposv, const real& impoa, const real& imposa, const real& impobd, const real& imposbd): + _codiva(codiva),_impoven(impov),_imposven(imposv),_impoacq(impoa),_imposacq(imposa),_impobd(impobd),_imposbd(imposbd) {} +}; + +class TGen_array : public TArray +{ +public: + bool add_riga(const char* codiva, const real& imponibilev, const real& impostav, const real& imponibilea, const real& impostaa, const real& imponibilebd, const real& impostabd); + TRiga_gen& riga(int i) { return (TRiga_gen&)(*this)[i]; } +}; + +bool TGen_array::add_riga(const char* codiva, const real& imponibilev, const real& impostav, const real& imponibilea, const real& impostaa, const real& imponibilebd, const real& impostabd) +{ + bool found = FALSE; + for (int i = 0; i < items(); i++) + { + TRiga_gen& r = riga(i); + if (r._codiva==codiva) + { + found = TRUE; + r._impoven += imponibilev; + r._imposven += impostav; + r._impoacq += imponibilea; + r._imposacq += impostaa; + r._impobd += imponibilebd; + r._imposbd += impostabd; + } + } + if (!found) + { + TRiga_gen* r = new TRiga_gen(codiva,imponibilev,impostav,imponibilea,impostaa,imponibilebd,impostabd); + add(r); + } + return found; +}; + +struct TRiga_iva : public TArray +{ + tiporec _tipo; + real _imponibile, _imposta, _detrazione; + + TRiga_iva (const tiporec& tipo, const real& impo, const real& impos, const real& detr): + _tipo(tipo),_imponibile(impo),_imposta(impos), _detrazione(detr) {} +}; + +class TIva_array : public TArray +{ +public: + bool add_riga(const tiporec& tipo, const real& imponibile, const real& imposta, const real& detr); + TRiga_iva& riga(int i) { return (TRiga_iva&)(*this)[i]; } +}; + +bool TIva_array::add_riga(const tiporec& tipo, const real& imponibile, const real& imposta, const real& detr) +{ + bool found = FALSE; + for (int i = 0; i < items(); i++) + { + TRiga_iva& r = riga(i); + if (r._tipo == tipo) + { + found = TRUE; + r._imponibile += imponibile; + r._imposta += imposta; + r._detrazione += detr; + } + } + if (!found) + { + TRiga_iva* r = new TRiga_iva(tipo,imponibile,imposta,detr); + add(r); + } + return found; +}; + class CG0400_application : public TPrintapp { - TTable* _tabpim, * _tabreg; - TLocalisamfile* _nditte, * _attiv, * _anag, * _com; + TTable* _tabpim, * _tabreg, * _tabais, * _tablia; + TLocalisamfile* _nditte, * _anag, * _com; TMask* _msk; TDate _data; - int _sospmsk, _tipoprog, _livelloprog, _tipo_crmsk, _annoiva, _i; + int _sospmsk, _tipoprog, _livelloprog, _tipo_aliq, _tipo_attiv, _annoiva, _i; + int _mese, _anno; + bool _st_inizio_anno; + TIva_array _iva_array; + TGen_array _gen_array; TString _cap,_cofi,_paiva,_ragsoc,_comunefis,_provfis,_viafis,_codivamsk,_codattmsk; - //bool _vuoilordi; + TString _datast; Importi _mesi[13]; + liste _tipo_lista; public: virtual bool user_create(); @@ -38,38 +131,93 @@ public: virtual bool set_print(int); virtual bool preprocess_page(int,int); virtual print_action postprocess_page(int,int); - void cerca_i_pim(); - void azzera_mesi(); - void get_dati_ditta(); - void setta_intestazione(); - void calcola_totali(real&,real&); - int stampa_intestazione_ditta(); + void cerca_i_pim(); + void azzera_mesi(); + void get_dati_ditta(); + void setta_intestazione(); + void calcola_totali(real&,real&); + void cerca_tipo(tiporec, real&, real&, real&); + int stampa_intestazione_ditta(); + const char* desc_attivita(const char*); + const char* desc_iva(const char*); + char look_lia(long ditta = 0l); + void look_pim(); + void intestazione(); CG0400_application(){}; }; +HIDDEN int compare_rows(const TObject** o1, const TObject** o2) +{ + TRiga_gen* r1 = (TRiga_gen*)*o1; + TRiga_gen* r2 = (TRiga_gen*)*o2; + + return (strcmp((const char*)r1->_codiva, (const char*)r2->_codiva)); +} + +const char* CG0400_application::desc_attivita(const char* codatt) +{ + TTable attiv ("%AIS"); + attiv.zero(); + attiv.put("CODTAB", codatt); + if (attiv.read()==NOERR) + TMP = attiv.get("S0"); + else + TMP = ""; + return TMP; +} + +const char* CG0400_application::desc_iva(const char* cod) +{ + TTable tab_iva("%IVA"); + TString codtab(format ("%-4s", cod)); + + tab_iva.zero(); + tab_iva.put("CODTAB", codtab); + if (tab_iva.read()==NOERR) + TMP = tab_iva.get("S0"); + else + TMP = ""; + + return TMP; +} + +char CG0400_application::look_lia(long ditta) +{ + if (ditta == 0l) ditta = get_firm(); + + TString16 y; y.format("%05ld%04d", ditta, _anno); + + _tablia->zero(); + _tablia->put("CODTAB", y); + + if (_tablia->read() != NOERR) + _tablia->zero(); + + return _tablia->get_char("S7"); +} bool CG0400_application::user_create() { _tabpim = new TTable(TAB_PIM); _tabreg = new TTable(TAB_REG); + _tabais = new TTable("%AIS"); + _tablia = new TTable("%LIA"); _anag = new TLocalisamfile(LF_ANAG); _nditte = new TLocalisamfile(LF_NDITTE); - _attiv = new TLocalisamfile(LF_ATTIV); _com = new TLocalisamfile(LF_COMUNI); - _msk = new TMask("cg0400a"); return TRUE; } bool CG0400_application::user_destroy() { - delete _msk; delete _tabpim; delete _tabreg; + delete _tabais; + delete _tablia; delete _anag; delete _nditte; delete _com; - delete _attiv; return TRUE; } @@ -82,6 +230,58 @@ void CG0400_application::azzera_mesi() } } +void CG0400_application::look_pim() +{ + TTable pim("PIM"); + for (pim.first(); !pim.eof(); pim.next()) + { + real imponibile, imposta; + tiporec tipo; + + TString80 codtab = pim.get("CODTAB"); + int anno = atoi(codtab.mid(0,4)); + int mese = atoi(codtab.mid(13,2)); + TString16 codiva = codtab.mid(16,4); + codiva = codiva.trim(); + + if (anno != _anno) continue; + + if (_st_inizio_anno) + if (mese > _mese) + continue; + + if (!_st_inizio_anno) + if (mese != _mese) + continue; + + while (classify_pim(pim.curr(), imponibile, imposta, tipo)) + { + switch(tipo) + { + case acq_norm: + _gen_array.add_riga(codiva,ZERO,ZERO,imponibile,imposta,ZERO,ZERO); + break; + case vend_norm: + _gen_array.add_riga(codiva,imponibile,imposta,ZERO,ZERO,ZERO,ZERO); + break; + case bolle_doganali: + _gen_array.add_riga(codiva,ZERO,ZERO,ZERO,ZERO,imponibile,imposta); + break; + case acq_amm_ultdetr: + { + real detr = imponibile * real(0.06); + _iva_array.add_riga(tipo,imponibile,imposta,detr); + } + break; + default: + _iva_array.add_riga(tipo,imponibile,imposta,ZERO); + break; + } + } + } + _gen_array.sort(compare_rows); // ordinamento per codice iva +} + void CG0400_application::cerca_i_pim() { TTable pim("PIM"); @@ -118,7 +318,7 @@ void CG0400_application::cerca_i_pim() { case acq_norm: if (_tipoprog == 1) break; //vendite - if (_tipo_crmsk == 1) //nella maschera e' stato richiesto + if (_tipo_aliq == 1) //nella maschera e' stato richiesto { //acquisti in genere impo += imponibile; impos += imposta; @@ -142,7 +342,7 @@ void CG0400_application::cerca_i_pim() break; case acq_ind_op_es: if (_tipoprog == 1) break; - if (_tipo_crmsk == 2) + if (_tipo_aliq == 2) { impo += imponibile; impos += imposta; @@ -150,7 +350,7 @@ void CG0400_application::cerca_i_pim() break; case acq_ind_pass_int: if (_tipoprog == 1) break; - if (_tipo_crmsk == 3) + if (_tipo_aliq == 3) { impo += imponibile; impos += imposta; @@ -158,7 +358,7 @@ void CG0400_application::cerca_i_pim() break; case acq_ind_art_19: if (_tipoprog == 1) break; - if (_tipo_crmsk == 4) + if (_tipo_aliq == 4) { impo += imponibile; impos += imposta; @@ -166,7 +366,7 @@ void CG0400_application::cerca_i_pim() break; case base_ventilazione: if (_tipoprog == 1) break; - if (_tipo_crmsk == 5) + if (_tipo_aliq == 5) { impo += imponibile; impos += imposta; @@ -174,7 +374,7 @@ void CG0400_application::cerca_i_pim() break; case bolle_doganali: if (_tipoprog == 1) break; - if (_tipo_crmsk == 6) + if (_tipo_aliq == 6) { impo += imponibile; impos += imposta; @@ -182,7 +382,7 @@ void CG0400_application::cerca_i_pim() break; case acq_beni_riv: if (_tipoprog == 1) break; - if (_tipo_crmsk == 1) + if (_tipo_attiv == 1) { impo += imponibile; impos += imposta; @@ -190,7 +390,7 @@ void CG0400_application::cerca_i_pim() break; case acq_beni_ammort: if (_tipoprog == 1) break; - if (_tipo_crmsk == 2) + if (_tipo_attiv == 2) { impo += imponibile; impos += imposta; @@ -198,7 +398,7 @@ void CG0400_application::cerca_i_pim() break; case acq_beni_ammort_nd: if (_tipoprog == 1) break; - if (_tipo_crmsk == 3) + if (_tipo_attiv == 3) { impo += imponibile; impos += imposta; @@ -206,7 +406,7 @@ void CG0400_application::cerca_i_pim() break; case acq_beni_leasing: if (_tipoprog == 1) break; - if (_tipo_crmsk == 4) + if (_tipo_attiv == 4) { impo += imponibile; impos += imposta; @@ -214,12 +414,19 @@ void CG0400_application::cerca_i_pim() break; case acq_amm_ultdetr: if (_tipoprog == 1) break; - if (_tipo_crmsk == 6) + if (_tipo_attiv == 5) { impo += imponibile; impos += imposta; } break; + case cess_amm: + if (_tipoprog == 2) break; + if (_livelloprog == 2) //Nel caso di vendite per attivita' il tipo costo/ricavo + { //viene forzato a 4 => cessione beni ammortizzabili + impo += imponibile; + impos += imposta; + } default: break; } @@ -231,37 +438,73 @@ void CG0400_application::cerca_i_pim() } -bool CG0400_application::set_print(int) +bool CG0400_application::set_print(int m) { - KEY tasto; - tasto = _msk->run(); - if (tasto == K_ENTER) - { - _annoiva = _msk->get_int(F_ANNO); - //_vuoilordi = _msk->get_bool(F_VUOILORDI); - _tipoprog = _msk->get_int(F_TIPO); // 1 <=> vendite; 2 <=> acquisti - if (_tipoprog == 1) - _sospmsk = _msk->get_int(F_TIPOTAB); //vendite in genere; vendite in sospensione d'imposta - _livelloprog = _msk->get_int(F_LIVELLO); - _codivamsk = _msk->get(F_CODIVA); - _codattmsk = _msk->get(F_ATTIVITA); - //if (_tipoprog == 2) - if (_livelloprog == 1) //si tratta di una aliquota - _tipo_crmsk = _msk->get_int(F_TIPOTABE); - else //si tratta di una attivita' - _tipo_crmsk = _msk->get_int(F_TIPOTABEL); - - set_real_picture("###.###.###.###"); - set_print_zero(); + TString16 masc = ""; + + switch(m) + { + case 1: + masc = "cg0400a"; + _tipo_lista = visualizza; + break; + case 2: + masc = "cg0400b"; + _tipo_lista = stampa; + break; + default: + break; + } + TMask msk(masc); + + if (msk.run() != K_ENTER) return FALSE; + + switch (_tipo_lista) + { + case visualizza: + { + _sospmsk = _tipo_aliq = _tipo_attiv = 0; + _annoiva = msk.get_int(F_ANNO); + _tipoprog = msk.get_int(F_TIPO); // 1 <=> vendite; 2 <=> acquisti + _livelloprog = msk.get_int(F_LIVELLO); // 1 <=> aliquota; 2 <=> attivita' + _codivamsk = msk.get(F_CODIVA); + _codattmsk = msk.get(F_ATTIVITA); + if (_livelloprog == 1 && _tipoprog == 2) + _tipo_aliq = msk.get_int(F_TIPOTABE); + if (_livelloprog == 2 && _tipoprog == 2) + _tipo_attiv = msk.get_int(F_TIPOTABEL); + if (_tipoprog == 1 && _livelloprog == 1) + _sospmsk = msk.get_int(F_TIPOTAB); //vendite in genere; vendite in sospensione d'imposta setta_intestazione(); - azzera_mesi(); cerca_i_pim(); - - return TRUE; - } - return FALSE; + } + break; + case stampa: +{ + _anno = msk.get_int(F_ANNO); + _datast = msk.get(F_DATASTAMPA); + _mese = msk.get_int(F_MESE); + _st_inizio_anno = msk.get_bool(F_STAMPA); + + intestazione(); + + _iva_array.destroy(); + _gen_array.destroy(); + + look_pim(); +} +break; +default: +break; +} + +set_real_picture("###.###.###.###"); +set_print_zero(FALSE); +printer().footerlen(5); + +return TRUE; } void CG0400_application::calcola_totali(real& imp, real& imps) @@ -273,41 +516,142 @@ void CG0400_application::calcola_totali(real& imp, real& imps) } } +void CG0400_application::cerca_tipo(tiporec t, real& imp, real& imps, real& det) +{ + int k = 0; + bool trovato = FALSE; + imp = imps = det = ZERO; + while ( k < _iva_array.items() && !trovato) + { + TRiga_iva& riga = (TRiga_iva&)_iva_array[k]; + if (t == riga._tipo) + trovato = TRUE; + else k++; + } + if (trovato) + { + TRiga_iva& riga = (TRiga_iva&)_iva_array[k]; + imp = riga._imponibile; + imps = riga._imposta; + det = riga._detrazione; + } +} bool CG0400_application::preprocess_page(int file, int counter) { reset_print(); + switch (_tipo_lista) + { + case stampa: + { + real t_impov,t_imposv,t_impoa,t_imposa,t_impobd,t_imposbd; + t_impov = t_imposv = t_impoa = t_imposa = t_impobd = t_imposbd = ZERO; + int r = 1; + set_row(++r, "Cod.@40gVENDITE@77gACQUISTI@113gIMPORTAZIONI"); + set_row(++r, "IVA Descrizione@29gImponibile@48gImposta@67gImponibile@86gImposta@105gImponibile@124gImposta"); + r+=2; + for (int k = 0; k < _gen_array.items(); k++, r++) + { + TRiga_gen& riga = (TRiga_gen&)_gen_array[k]; + set_row(r, "%-4s", (const char*)riga._codiva); + TString80 descr = desc_iva(riga._codiva); + set_row(r, "@5g%-.18s",(const char*)descr); + if (riga._impoven != ZERO) + set_row(r, "@24g%r", &riga._impoven); + if (riga._imposven != ZERO) + set_row(r, "@40g%r", &riga._imposven); + if (riga._impoacq != ZERO) + set_row(r, "@62g%r", &riga._impoacq); + if (riga._imposacq != ZERO) + set_row(r, "@78g%r", &riga._imposacq); + if (riga._impobd != ZERO) + set_row(r, "@100g%r", &riga._impobd); + if (riga._imposbd != ZERO) + set_row(r, "@116g%r", &riga._imposbd); + + t_impov += riga._impoven; + t_imposv += riga._imposven; + t_impoa += riga._impoacq; + t_imposa += riga._imposacq; + t_impobd += riga._impobd; + t_imposbd += riga._imposbd; + } + _gen_array.destroy(); + r+=2; + set_row(r++, "Totale@24g%r@40g%r@62g%r@78g%r@100g%r@116g%r", + &t_impov,&t_imposv,&t_impoa,&t_imposa,&t_impobd,&t_imposbd); + r++; + real im, is, d; //inizializzati in cerca_tipo() + + cerca_tipo(acq_ind_op_es,im,is,d); + t_impoa += im; + t_imposa += is; + set_row(r++, "Totali acquisti indeducibili su ricavi esenti@62g%r@78g%r", &im, &is); + cerca_tipo(acq_ind_art_19,im,is,d); + t_impoa += im; + t_imposa += is; + set_row(r++, "Totali acquisti indeducibili per ART.19@62g%r@78g%r", &im, &is); + cerca_tipo(acq_ind_pass_int,im,is,d); + t_impoa += im; + t_imposa += is; + set_row(r++, "Totali acquisti indeducibili per passaggi interni@62g%r@78g%r", &im, &is); + r+=2; + set_row(r++, "Totale generale IVA@24g%r@40g%r@62g%r@78g%r@100g%r@116g%r", + &t_impov,&t_imposv,&t_impoa,&t_imposa,&t_impobd,&t_imposbd); + r+=3; + set_row(r++, "ALTRI DATI RELATIVI ALLA DICHIARAZIONE@54gImponibile@74gImposta@91gDetrazione"); + r++; + cerca_tipo(acq_simp,im,is,d); + set_row(r++, "Acquisti in sospensione d'imposta@49g%r@66g%r", &im, &is); + cerca_tipo(vend_simp,im,is,d); + set_row(r++, "Vendite in sospensione d'imposta@49g%r@66g%r", &im, &is); + cerca_tipo(cess_amm,im,is,d); + set_row(r++, "Cessione beni ammortizzabili@49g%r@66g%r", &im, &is); + cerca_tipo(acq_beni_riv,im,is,d); + set_row(r++, "Acquisto beni destinati alla rivendita@49g%r@66g%r", &im, &is); + cerca_tipo(acq_beni_ammort,im,is,d); + set_row(r++, "Acquisto beni ammortizzabili iva detraibile@49g%r@66g%r", &im, &is); + cerca_tipo(acq_beni_ammort_nd,im,is,d); + set_row(r++, "Acquisto beni ammortizzabili iva non detraibile@49g%r@66g%r", &im, &is); + cerca_tipo(acq_beni_leasing,im,is,d); + set_row(r++, "Altri beni strumentali acquisiti in leasing@49g%r@66g%r", &im, &is); + cerca_tipo(acq_amm_ultdetr,im,is,d); + set_row(r++, "Acquisto beni soggetti a detrazione (6%%)@49g%r@66g%r@86g%r", &im, &is, &d); + + _iva_array.destroy(); + } + break; + + case visualizza: +{ if (counter) _i++; else _i = 1; const char* mese = itom(_i); - set_row(1,"%s", mese); set_row(1,"@26g%r", &_mesi[_i].imponibile); set_row(1,"@56g%r", &_mesi[_i].imposta); - //if (_vuoilordi) - // set_row(1,"@48g%r", &_lordo_v); - if (_i == 12) { real tot_impo = ZERO; real tot_imposta = ZERO; - calcola_totali(tot_impo, tot_imposta); - TString dep = ""; set_row(2,(const char*) dep); set_row(3,"@8gTotale"); set_row(3,"@26g%r", &tot_impo); set_row(3,"@56g%r", &tot_imposta); - // if (_vuoilordi) - // set_row(3,"@48g%r", &_totlordo_v); } +} +break; - return TRUE; +default: +break; +} +return TRUE; } TRectype& look_com (const char * cod, TLocalisamfile *comuni) @@ -416,7 +760,7 @@ void CG0400_application::setta_intestazione() else //acquisti { if (_livelloprog == 1) //per codice iva - switch (_tipo_crmsk) + switch (_tipo_aliq) { case 1: set_header(r, "Acquisti in genere"); @@ -440,7 +784,7 @@ void CG0400_application::setta_intestazione() break; } else //per attivita' - switch (_tipo_crmsk) + switch (_tipo_attiv) { case 1: set_header(r, "Acquisti beni per rivendita"); @@ -466,15 +810,73 @@ void CG0400_application::setta_intestazione() set_header(r++, "IVA %s",(const char*) _codivamsk); else set_header(r++, "ATTIVITA' %s",(const char*)_codattmsk); set_header(++r, "@29gImponibile@60gImposta"); - //if (_vuoilordi) - // set_header(r, "@21gImponibile@40gImposta@50gImporto lordo"); - //else set_header(r, "@21gImponibile@40gImposta"); +} + +void CG0400_application::intestazione() +{ + int soh = 1; + TString sep(132); + TString ragsoc(50); + TString attprev(5); + TString16 descf; + + TLocalisamfile nditte(LF_NDITTE); + nditte.zero(); + nditte.put(NDT_CODDITTA, get_firm()); + if (nditte.read() == NOERR) + { + ragsoc = nditte.get(NDT_RAGSOC); + attprev = nditte.get(NDT_CODATTPREV); + } + + TString80 descr = desc_attivita(attprev); + + reset_header(); + + char f = look_lia(); + if (f == 'T') + descf = " TRIMESTRALE"; + else if (f == 'M') + descf = " MENSILE"; + else descf = ""; + + sep << "Ditta " << get_firm(); + sep << " " << ragsoc; + sep << " " << descf; + + sep.left_just(132); + + set_header (soh++, (const char*) sep); + + sep = ""; + sep << "Data " << _datast; + sep << " Pag. @#"; + + sep.right_just(127); + + sep.overwrite ("RIEPILOGO PROGRESSIVI"); + set_header (soh++, (const char*)sep); + sep.fill('-'); + set_header (soh++, (const char *) sep); + set_header (soh++, "Riepilogo progressivi IVA del periodo %s %d Cod. Att. %s %s", itom(_mese), _anno, (const char*) attprev, (const char*) descr); + set_header (soh++, (const char *) sep); } print_action CG0400_application::postprocess_page(int file, int counter) { - if (_i < 12) return REPEAT_PAGE; - else return NEXT_PAGE; + switch (_tipo_lista) + { + case visualizza: + { + if (_i < 12) return REPEAT_PAGE; + else return NEXT_PAGE; + } + break; + +default: + break; +} + return NEXT_PAGE; } int cg0400(int argc,char* argv[]) diff --git a/cg/cg0400.h b/cg/cg0400.h index 8af94a2b9..a92cc1cb1 100755 --- a/cg/cg0400.h +++ b/cg/cg0400.h @@ -4,7 +4,6 @@ #define TAB_REG "REG" #define TAB_PIM "PIM" - #define F_CODDITTA 101 #define F_ANNO 102 #define F_TIPO 103 @@ -16,6 +15,10 @@ #define F_TIPOTABEL 109 #define F_RAGSOC 110 #define F_TIPO1 111 +#define F_DATASTAMPA 112 +#define F_MESE 113 +#define F_STAMPA 114 + #endif // __CG0400_H diff --git a/cg/cg0400a.uml b/cg/cg0400a.uml index ca99b34c0..6095c4741 100755 --- a/cg/cg0400a.uml +++ b/cg/cg0400a.uml @@ -39,7 +39,7 @@ BEGIN PROMPT 3 5 "Tipo progressivi " HELP "Tipo di riepilogo da effettuare" ITEM "1|Vendite" - MESSAGE HIDE,F_TIPOTABE|SHOW,F_TIPOTAB|HIDE,F_TIPOTABEL + MESSAGE HIDE,F_TIPOTABE|HIDE,F_TIPOTABEL|SHOW,F_TIPOTAB MESSAGE COPY,F_TIPO1 ITEM "2|Acquisti" MESSAGE SHOW,F_TIPOTABE|HIDE,F_TIPOTABEL|HIDE,F_TIPOTAB @@ -52,7 +52,7 @@ BEGIN PROMPT 3 5 "Tipo progressivi " HELP "Tipo di riepilogo da effettuare" ITEM "1|Vendite" - MESSAGE HIDE,F_TIPOTABE|HIDE,F_TIPOTABEL|SHOW,F_TIPOTAB + MESSAGE HIDE,F_TIPOTABE|HIDE,F_TIPOTABEL|HIDE,F_TIPOTAB MESSAGE COPY,F_TIPO ITEM "2|Acquisti" MESSAGE HIDE,F_TIPOTABE|SHOW,F_TIPOTABEL|HIDE,F_TIPOTAB @@ -65,10 +65,10 @@ BEGIN PROMPT 38 5 "Livello progressivi " HELP "Tipo di raggruppamento dei riepiloghi" ITEM "1|Per aliquota" - MESSAGE HIDE,F_ATTIVITA|SHOW,F_CODIVA + MESSAGE HIDE,F_ATTIVITA|SHOW,F_CODIVA|SHOW,F_TIPOTAB MESSAGE HIDE,F_TIPO1|SHOW,F_TIPO|K_SPACE,F_TIPO ITEM "2|Per attivita'" - MESSAGE SHOW,F_ATTIVITA|HIDE,F_CODIVA + MESSAGE SHOW,F_ATTIVITA|HIDE,F_CODIVA|HIDE,F_TIPOTAB MESSAGE HIDE,F_TIPO|SHOW,F_TIPO1|K_SPACE,F_TIPO1 END @@ -102,7 +102,6 @@ BEGIN PROMPT 3 10 "Codice attivita' " HELP "Codice dell'attivita' di cui si vuole il riepilogo" USE LF_ATTIV - FLAGS "H" JOIN %AIS TO LF_ATTIV INTO CODTAB=CODATT CHECKTYPE REQUIRED INPUT CODDITTA F_CODDITTA SELECT @@ -144,18 +143,17 @@ BEGIN END /* -BOOLEAN F_VUOILORDI -BEGIN - PROMPT 4 16 "Visualizzazione importi lordi " - HELP "Indicare se visualizzare anche gli importi lordi" -END -*/ - BUTTON DLG_PRINT 10 2 BEGIN PROMPT -12 -1 "~Stampa" MESSAGE EXIT,K_ENTER END +*/ + +BUTTON DLG_OK 10 2 +BEGIN + PROMPT -12 -1 "" +END BUTTON DLG_QUIT 10 2 BEGIN diff --git a/cg/cg0400b.uml b/cg/cg0400b.uml new file mode 100755 index 000000000..ac13b421c --- /dev/null +++ b/cg/cg0400b.uml @@ -0,0 +1,72 @@ +#include "cg0400.h" + +PAGE "Stampa riepilogo progressivi IVA" -1 -1 78 16 + +GROUPBOX DLG_NULL 78 3 +BEGIN + PROMPT 1 0 "" +END + +NUMBER F_CODDITTA 5 +BEGIN + PROMPT 3 1 "Ditta " + FLAGS "FRD" + USE LF_NDITTE KEY 1 + CHECKTYPE REQUIRED + INPUT CODDITTA F_CODDITTA + DISPLAY "Codice" CODDITTA + DISPLAY "Ragione sociale @50" RAGSOC + OUTPUT F_RAGSOC RAGSOC +END + +STRING F_RAGSOC 50 +BEGIN + PROMPT 17 1 "Ragione " + FLAGS "D" +END + +DATE F_DATASTAMPA +BEGIN + PROMPT 3 4 "Data stampa " + HELP "Data in cui viene effettuata la stampa" + FLAGS "A" +END + +NUMBER F_ANNO 4 +BEGIN + PROMPT 3 6 "Anno riepilogo " + FLAGS "A" + CHECKTYPE REQUIRED +END + +LISTBOX F_MESE 9 +BEGIN + PROMPT 3 7 "Mese riepilogo " + FLAGS "AM" +END + +BOOLEAN F_STAMPA +BEGIN + PROMPT 3 9 "Stampa progressivi da inizio anno " +END + +/* +BUTTON DLG_PRINT 10 2 +BEGIN + PROMPT -12 -1 "~Stampa" +END +*/ + +BUTTON DLG_OK 10 2 +BEGIN + PROMPT -12 -1 "" +END + +BUTTON DLG_QUIT 10 2 +BEGIN + PROMPT -22 -1 "" +END + +ENDPAGE + +ENDMASK