diff --git a/src/m770/777100.cpp b/src/m770/777100.cpp index 3e93a9ea3..b0cbc5229 100755 --- a/src/m770/777100.cpp +++ b/src/m770/777100.cpp @@ -28,7 +28,7 @@ // Utility /////////////////////////////////////////////////////////// -const int ANNO_PAG = 2017; +const int ANNO_PAG = LAST_YEARN; /////////////////////////////////////////////////////////// // TForm770 @@ -435,8 +435,8 @@ TRecnotype TForm770::trasfer(long codditta, TTrasferimento770& file, char rectyp switch (rectype) { - case 'E': rec.set(8, CF_PRODUTTORE); break; - case 'H': rec.set(9, CF_PRODUTTORE); break; + case 'E': rec.set(8, get_iva_sirio()); break; + case 'H': rec.set(9, get_iva_sirio()); break; default : break; } @@ -717,7 +717,7 @@ bool TTrasferimento770::append_record_b() TRecord770 rec('B'); // Compila record di testata B rec.set(2, cod_fis_dic()); rec.set(3, 1); // Modulo (deve essere sempre 1) - rec.set(7, CF_PRODUTTORE); // CF del produttore Sirio + rec.set(7, get_iva_sirio()); // CF del produttore Sirio const TAnagrafica dich(LF_ANAG, _tipoa_dic, _codan_dic); if (dich.fisica()) @@ -960,7 +960,7 @@ bool TTrasferimento770::split(const char* path) TRecord770 recf('F'); recf.set(2, cod_fis_dic()); recf.set(3, 1); - recf.set(8, CF_PRODUTTORE); + recf.set(8, get_iva_sirio()); FOR_EACH_ARRAY_ITEM(riep_sx, i, obj) { const real* val = (const real*)obj; @@ -1004,7 +1004,7 @@ bool TTrasferimento770::split(const char* path) rec.tipo_record('J'); rec.set(2, cod_fis_dic()); rec.set(3, 1); - rec.set(8, CF_PRODUTTORE); + rec.set(8, get_iva_sirio()); FOR_EACH_ARRAY_ITEM(riep_ss, i, obj) { const real* val = (const real*)obj; diff --git a/src/m770/777200.cpp b/src/m770/777200.cpp index da436cc22..caa536df5 100755 --- a/src/m770/777200.cpp +++ b/src/m770/777200.cpp @@ -48,7 +48,7 @@ const TString& get_telephone(const TRectype& rec, const char* pref, const char* // TTracciatoCU /////////////////////////////////////////////////////////// -#define CU_DEFAULT_NAME "MODCUR17" +#define CU_DEFAULT_NAME "MODCUR" THIS_YEAR class TTracciatoCU : public TTracciato770 { @@ -167,20 +167,18 @@ TTracciatoCU::TTracciatoCU(char tipo) if (tipo == 'Z') { add_filler(2, 14); - add_field("Numero record di tipo 'B'", NU, 16, 9); // 3 - add_field("Numero record di tipo 'C'", NU, 25, 9); - add_field("Numero record di tipo 'D'", NU, 34, 9); - add_field("Numero record di tipo 'G'", NU, 43, 9); // 6 - add_field("Numero record di tipo 'H'", NU, 52, 9); - /* - add_filler(31,9); + add_field("Numero record di tipo 'B'", NU, 16, 9, 3); // 3 + add_field("Numero record di tipo 'C'", NU, 25, 9, 4); + add_field("Numero record di tipo 'D'", NU, 34, 9, 5); + add_field("Numero record di tipo 'G'", NU, 43, 9, 6); // 6 + add_field("Numero record di tipo 'H'", NU, 52, 9, 7); + add_field("Numero record di tipo 'L'", NU, 61, 9, 8); add_filler(70,9); add_filler(79,9); add_filler(88,1810); // 11 add_filler(1898,1); // 11 add_filler(1899,2); //12 - */ } } @@ -528,8 +526,8 @@ void TTrasferimentoCU::set_operazione(char t, const TString& iden) TRecnotype TTrasferimentoCU::conta_certificazioni() const { int anno = _anno; - if (anno < 2017) - anno = 2017; + if (anno < LAST_YEARN) + anno = LAST_YEARN; TString query; query.format("USE %d SELECT (ANNO=%d)&&(CODANAGR>0)\nFROM CODDITTA=%ld\nTO CODDITTA=%ld", @@ -546,7 +544,7 @@ bool TTrasferimentoCU::append_record_b() TRecordCU rec('B'); // Compila record di testata B rec.set(2, cod_fis_dic()); rec.set(3, 1); // Modulo (deve essere sempre 1) - rec.set(8, CF_PRODUTTORE); // CF del produttore Sirio + rec.set(8, get_iva_sirio()); // CF del produttore Sirio rec.set(10, _tipo_operazione == 'A'); rec.set(11, _tipo_operazione == 'S'); @@ -884,7 +882,7 @@ bool TTrasferimentoCU::split(const char* path) { TRecordCU rec; rec.tipo_record('A'); // Compila record di testata A - rec.set(3, "CUR17"); // Codice fornitura + rec.set(3, "CUR18"); // Codice fornitura 2018 rec.set(4, 1); // Tipo fornitore: 01=Soggetto che invia la propria dichiarazione; 10=CAF rec.set(5, _codfis_int.full() ? _codfis_int : cod_fis_dic()); // Codice fiscale del fornitore outfile << rec; // Scrive record testata @@ -924,7 +922,7 @@ bool TTrasferimentoCU::split(const char* path) rec.set(5, totale['D'-'A']); // Totale D rec.set(6, totale['G'-'A']); // Totale G rec.set(7, totale['H'-'A']); // Totale H - + rec.set(8, 0); // Totale L (Noi non li facciamo) // Scrive record di coda outfile << rec; } @@ -976,7 +974,7 @@ bool TCU_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) case F_ANNO: if (e == fe_init) { - const int anno = ini_get_int(CONFIG_STUDIO, "77", "AnnoDic", 2017); + const int anno = ini_get_int(CONFIG_STUDIO, "77", "AnnoDic", LAST_YEARN); o.set(anno); } break; diff --git a/src/m770/777200.h b/src/m770/777200.h index 2d1a9df31..88f23141d 100644 --- a/src/m770/777200.h +++ b/src/m770/777200.h @@ -5,6 +5,12 @@ #include #endif +// Nota che sono stati definiti anche in 777lib +#define THIS_YEAR "2018" +#define THIS_YEARN 2018 +#define LAST_YEAR "2017" +#define LAST_YEARN 2017 + class TRecordCU; class TTrasferimentoCU : public TRecordset diff --git a/src/m770/777201.cpp b/src/m770/777201.cpp index 4b0a6ff6e..df45fd22b 100644 --- a/src/m770/777201.cpp +++ b/src/m770/777201.cpp @@ -588,7 +588,7 @@ void TCU_report::create_logo(TReport_section& header) { add_big_text(header, 3, 0, "CERTIFICAZIONE", COLOR_GRAY).set_vertical_alignment('T'); add_big_text(header, 6, 0, "UNICA", COLOR_BLACK).set_vertical_alignment('B'); - add_big_text(header, 6,12, "2018", COLOR_LTGRAY).set_vertical_alignment('B'); + add_big_text(header, 6,12, THIS_YEAR, COLOR_LTGRAY).set_vertical_alignment('B'); TReport_field* txt = new TReport_field(&header); txt->set_type('I'); @@ -693,7 +693,7 @@ void TCU_report::create_D() txt->set_font(fnt_big); body.add(txt); - add_boxed_field(body, 8, 68, 4, "2017", ""); + add_boxed_field(body, 8, 68, 4, LAST_YEAR, ""); add_band(body, 12, 35); @@ -728,12 +728,12 @@ void TCU_report::create_D() end_paragraph(body); begin_paragraph(body, CU_AFTER_LAST, 8, ""); - add_underlined_text(body, 0, "DOMICILIO FISCALE ALL'1/1/2017"); + add_underlined_text(body, 0, "DOMICILIO FISCALE ALL'1/1/" LAST_YEAR); add_labeled_field(body, 0, 0, 48, "#DA002020", "Comune"); add_labeled_field(body, 0, 50, 3, "#DA002021", "Provincia (sigla)"); add_labeled_field(body, 0, 56, 3, "#DA002022", "Codice comune"); add_labeled_field(body, 0, CU_ALIGN_RIGHT, 3, "#DA002023", "Fusione comuni"); - add_underlined_text(body, 4, "DOMICILIO FISCALE ALL'1/1/2018"); + add_underlined_text(body, 4, "DOMICILIO FISCALE ALL'1/1/" THIS_YEAR); add_labeled_field(body, 1, 0, 48, "#DA002024", "Comune"); add_labeled_field(body, 1, 50, 3, "#DA002025", "Provincia (sigla)"); add_labeled_field(body, 1, 56, 3, "#DA002026", " Codice comune"); diff --git a/src/m770/777lib.cpp b/src/m770/777lib.cpp index 12078e6d8..a21df17ea 100644 --- a/src/m770/777lib.cpp +++ b/src/m770/777lib.cpp @@ -163,7 +163,7 @@ TTracciato770::TTracciato770(char tipo) : _tipo(tipo) add_field("Casella prospetto SV", CB, 816, 1); add_field("Casella prospetto SX", CB, 817, 1); // 81 add_field("Casella prospetto SY", CB, 818, 1); - add_field("Presenza 770 ordinario 2017", CB, 819, 1); + add_field("Presenza 770 ordinario " THIS_YEAR, CB, 819, 1); add_field("Codice fiscale parte restante", CF, 820,16); add_field("Protocollo telematico", NU, 836,17); // 85 add_field("Progressivo telematico", NU, 853, 6); @@ -263,14 +263,14 @@ TTracciato770::TTracciato770(char tipo) : _tipo(tipo) if (tipo == 'Z') { add_filler(2, 14); - add_field("Numero record di tipo 'B'", NU, 16, 9); // 3 - add_field("Numero record di tipo 'D'", NU, 25, 9); - add_field("Numero record di tipo 'E'", NU, 34, 9); - add_field("Numero record di tipo 'F'", NU, 43, 9); // 6 - add_field("Numero record di tipo 'G'", NU, 52, 9); - add_field("Numero record di tipo 'H'", NU, 61, 9); - add_field("Numero record di tipo 'I'", NU, 70, 9); - add_field("Numero record di tipo 'J'", NU, 79, 9); // 10 + add_field("Numero record di tipo 'B'", NU, 16, 9, 3); // 3 + add_field("Numero record di tipo 'C'", NU, 25, 9, 4); + add_field("Numero record di tipo 'D'", NU, 34, 9, 5); + add_field("Numero record di tipo 'G'", NU, 43, 9, 6); + add_field("Numero record di tipo 'H'", NU, 52, 9, 7); + add_field("Numero record di tipo 'L'", NU, 61, 9, 8); + add_filler(70, 9); + add_filler(79, 9); add_filler(88, 1810); } } diff --git a/src/m770/777lib.h b/src/m770/777lib.h index 6d5c77076..a5e23d56d 100644 --- a/src/m770/777lib.h +++ b/src/m770/777lib.h @@ -6,7 +6,13 @@ #endif // Codice fiscale di Sirio Informatica e Sistemi S.p.A. -#define CF_PRODUTTORE "04879210963" +#define CF_PRODUTTORE get_iva_sirio(); + +// Nota che sono anche definiti in 777200.h +#define THIS_YEAR "2018" +#define THIS_YEARN 2018 +#define LAST_YEAR "2017" +#define LAST_YEARN 2017 enum { CODE_SIZE = 8, FIELD_SIZE = 16, BLOCK_SIZE = 24, HEADER_SIZE = 89, USEABLE_SIZE = 1800, TOTAL_SIZE = 1900 };