Patch level : 12.0 334
Files correlati : 777.exe Commento : Aggiornamento C.U. 2017 Modificati i parametri secondo la nuova gestione e aggiunto controlli: DA002010: Il nuovo controllo sul valore 2 non rientra tra quello che fa campo, se trovo 2 rimetto 0 AU001029: Se Campo non riesce a trovare il codice dell'ente previdenziale adesso non elabora i dati previdenziali, chiedere a Ilaria se vuole un popup che avvisa l'utente git-svn-id: svn://10.65.10.50/branches/R_10_00@23545 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
60e9538ed6
commit
fa7b6c2a57
@ -48,7 +48,7 @@ const TString& get_telephone(const TRectype& rec, const char* pref, const char*
|
||||
// TTracciatoCU
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
#define CU_DEFAULT_NAME "MODCUR16"
|
||||
#define CU_DEFAULT_NAME "MODCUR17"
|
||||
|
||||
class TTracciatoCU : public TTracciato770
|
||||
{
|
||||
@ -91,24 +91,50 @@ TTracciatoCU::TTracciatoCU(char tipo)
|
||||
add_field("Nome", AN,117, 20);
|
||||
add_field("Denominazione (Alternativo a 12 e 13)",AN,137, 60);
|
||||
add_field("Indirizzo E-mail", AN,197,100);
|
||||
add_field("Telefono o Cellulare", AN,297, 12);
|
||||
add_field("FAX", AN,309, 12); // 17
|
||||
add_field("Telefono o Fax", AN,297, 12);
|
||||
add_field("Eventi Eccezionali", AN,309, 1); // 17
|
||||
|
||||
add_field("Codice fiscale del rappresentante", CF,321,16); // 18
|
||||
add_field("Codice carica del rappresentante", NU,337, 2);
|
||||
add_field("Cognome", AN,339,24);
|
||||
add_field("Nome", AN,363,20);
|
||||
add_field("Codice fiscale del dichiarante", CN,383,11);
|
||||
add_field("Codice fiscale del rappresentante", CF,310,16); // 18
|
||||
add_field("Codice carica del rappresentante", NU,326, 2);
|
||||
add_field("Cognome", AN,328,24);
|
||||
add_field("Nome", AN,352,20);
|
||||
add_field("Codice fiscale del dichiarante", CN,372,11);
|
||||
|
||||
add_field("Numero comunicaz. lavoro dipendente", NU, 394, 8); // 23
|
||||
add_field("Numero comunicaz. lavoro autonomo", NU, 402, 8);
|
||||
add_field("Casella quadro CT", CB, 410, 1);
|
||||
add_field("Firma del dichiarante", CB, 411, 1);
|
||||
add_filler(383,19); // 23
|
||||
add_field("Numero comunicaz. relative a certificazioni",NU, 402, 8);
|
||||
add_field("Casella quadro CT", CB, 410, 1);
|
||||
add_field("Firma del dichiarante", CB, 411, 1);
|
||||
|
||||
add_field("Codice fiscale intermediario", CF, 412, 16); // 27
|
||||
add_field("Impegno a trasmettere la dichiaraz.", NU, 428, 1);
|
||||
add_field("Data dell'impegno", DT, 429, 8);
|
||||
add_field("Firma dell'intermediario", CB, 437, 1);
|
||||
add_filler(438, 1);
|
||||
add_filler(439, 40);
|
||||
add_filler(479, 2);
|
||||
add_filler(481, 5);
|
||||
add_filler(486, 35);
|
||||
add_filler(521, 6);
|
||||
add_filler(527, 3);
|
||||
add_filler(530, 8);
|
||||
add_filler(538, 1);
|
||||
add_filler(539,1305); // 40
|
||||
|
||||
add_field("Spazio riservato al Servizio Telematico",AN,1844,20); // 41
|
||||
add_filler(1864, 7);
|
||||
add_filler(1871, 3);
|
||||
add_filler(1874, 3);
|
||||
add_filler(1877, 1);
|
||||
add_filler(1878, 1);
|
||||
add_filler(1879, 1);
|
||||
add_filler(1880, 1);
|
||||
add_filler(1881, 1);
|
||||
add_filler(1882, 1);
|
||||
add_filler(1883,15); // 51
|
||||
|
||||
add_filler(1898, 1); // 52
|
||||
add_filler(1899, 2); // 53
|
||||
|
||||
add_field("Codice fiscale intermediario", CF, 412,16); // 27
|
||||
add_field("Impegno a trasmettere la dichiaraz.", NU, 428, 1);
|
||||
add_field("Data dell'impegno", DT, 429, 8);
|
||||
add_field("Firma dell'intermediario", CB, 437, 1);
|
||||
} else
|
||||
if (tipo == 'D')
|
||||
{
|
||||
@ -125,10 +151,17 @@ TTracciatoCU::TTracciatoCU(char tipo)
|
||||
} else
|
||||
if (tipo == 'H')
|
||||
{
|
||||
add_field("Codice fiscale del sostituto", CF, 2, 16); // 2
|
||||
add_field("Progressivo modulo", NU, 18, 8); // 3
|
||||
add_field("Codice fiscale percipiente", CF, 26, 16); // 4
|
||||
add_field("Progressivo certificazione", NU, 42, 5); // 5
|
||||
add_field("Codice fiscale del sostituto", CF, 2, 16); // 2
|
||||
add_field("Progressivo modulo", NU, 18, 8); // 3
|
||||
add_field("Codice fiscale percipiente", CF, 26, 16); // 4
|
||||
add_field("Progressivo certificazione", NU, 42, 5); // 5
|
||||
add_filler(47, 17); // 6
|
||||
add_field("Spazio a disposizione dell'utente", NU, 64, 6); // 7
|
||||
add_filler(70, 14); // 8
|
||||
add_filler(84, 1); // 9
|
||||
add_filler(85, 4); // 10
|
||||
add_filler(89, 1); // 11
|
||||
|
||||
} else
|
||||
if (tipo == 'Z')
|
||||
{
|
||||
@ -138,6 +171,13 @@ TTracciatoCU::TTracciatoCU(char tipo)
|
||||
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_filler(70,9);
|
||||
add_filler(79,9);
|
||||
add_filler(88,1810); // 11
|
||||
|
||||
add_filler(1898,1); // 11
|
||||
add_filler(1899,2); //12
|
||||
}
|
||||
}
|
||||
|
||||
@ -485,8 +525,8 @@ void TTrasferimentoCU::set_operazione(char t, const TString& iden)
|
||||
TRecnotype TTrasferimentoCU::conta_certificazioni() const
|
||||
{
|
||||
int anno = _anno;
|
||||
if (anno < 2015)
|
||||
anno = 2015;
|
||||
if (anno < 2016)
|
||||
anno = 2016;
|
||||
|
||||
TString query;
|
||||
query.format("USE %d SELECT (ANNO=%d)&&(CODANAGR>0)\nFROM CODDITTA=%ld\nTO CODDITTA=%ld",
|
||||
@ -538,9 +578,9 @@ bool TTrasferimentoCU::append_record_b()
|
||||
cantread_box("legale rappresentante");
|
||||
}
|
||||
|
||||
rec.set(23, 0); // Dichiarazioni relative a dipendenti
|
||||
rec.set(24, conta_certificazioni()); // Certificazioni per autonomi e provvigioni
|
||||
rec.set(26, true); // Firma
|
||||
rec.set(23, ""); // Dichiarazioni relative a dipendenti
|
||||
rec.set(24, conta_certificazioni()); // Certificazioni per autonomi e provvigioni
|
||||
rec.set(26, true); // Firma
|
||||
|
||||
if (_codfis_int.full())
|
||||
{
|
||||
@ -632,7 +672,10 @@ bool TTrasferimentoCU::append_record_d(const TRectype& qla, TLog_report& log)
|
||||
const TRectype& anag = cache().get_rec(LF_ANAG, qla.get("TIPOA"), qla.get("CODANAGR"));
|
||||
rec.np_put("DA002008", anag.get(ANA_CATPAR));
|
||||
rec.np_put("DA002009", anag.get_long(ANA_EVECC));
|
||||
rec.np_put("DA002010", anag.get_long(ANA_ESCPRECOMP));
|
||||
long int da2010 = anag.get_long(ANA_ESCPRECOMP);
|
||||
// Tolla 2017: Aggiunto questo controllo in quanto noi non gestiamo nessuno dei quadri che richiedono il valore 2
|
||||
if(da2010 == 2) da2010 = 0;
|
||||
rec.np_put("DA002010", da2010);
|
||||
|
||||
const TString& causale = qla.get("CAUSALE");
|
||||
if (causale == "N")
|
||||
@ -731,38 +774,45 @@ bool TTrasferimentoCU::append_record_h(const TRectype& qla, int modulo, TLog_rep
|
||||
const real cal = qla.get_real("ALTRICONTR");
|
||||
const real cdo = qla.get_real("CONTRDOV");
|
||||
const real cve = qla.get_real("CONTRVER");
|
||||
|
||||
if (!cce.is_zero() || !cal.is_zero() || !ccp.is_zero() || !cdo.is_zero() || !cve.is_zero())
|
||||
{
|
||||
TString8 entprev = qla.get("ENTEPREV");
|
||||
TString4 cat = qla.get("CATEGORIA");
|
||||
TString cfep;
|
||||
if (entprev.blank())
|
||||
{
|
||||
const TRectype& aperc = cache().get_rec(LF_PERC, qla.get("CODDITTA"), qla.get("TIPO"), qla.get("CODANAGR"));
|
||||
const TRectype& aperc = cache().get_rec(LF_PERC, qla.get("CODDITTA"), qla.get("TIPOA"), qla.get("CODANAGR")); // Perchè prima era TIPO ?
|
||||
entprev = aperc.get("ENTEPREV");
|
||||
cat = aperc.get("CATEGORIA");
|
||||
}
|
||||
if (entprev.full())
|
||||
{
|
||||
const TRectype& inps = cache().get("%ENT", entprev);
|
||||
rec.np_put("AU001029", inps.get("S5")); // codice fiscale ente previdenziale
|
||||
cfep << inps.get("S5");
|
||||
rec.np_put("AU001029", cfep); // codice fiscale ente previdenziale
|
||||
rec.np_put("AU001030", inps.get("S0")); // denominazione ente previdenziale
|
||||
rec.np_put("AU001031", inps.get("S6")); // codice ente previdenziale (2, 4, A)
|
||||
//rec.np_put("AU001031", inps.get("S6")); // codice ente previdenziale (2, 4, A)
|
||||
|
||||
TToken_string cod_az; cod_az.format("77ENT|%s|%05ld",(const char*)entprev, qla.get_long("CODDITTA"));
|
||||
const TString& azienda = cache().get(LF_MULTIREL, cod_az, "DATA");
|
||||
rec.np_put("AU001032", azienda); // codice azienda presso ente previdenziale
|
||||
if(cfep.full())
|
||||
rec.np_put("AU001032", azienda); // codice azienda presso ente previdenziale
|
||||
}
|
||||
|
||||
rec.np_put("AU001033", cat);
|
||||
rec.np_put("AU001034", cce); // contributi a carico erogante
|
||||
rec.np_put("AU001035", ccp); // contributi a carico percipiente
|
||||
if (!cal.is_zero())
|
||||
{
|
||||
rec.np_put("AU001036", true); // altri contributi?
|
||||
rec.np_put("AU001037", cal); // importo altri contributi
|
||||
}
|
||||
rec.np_put("AU001038", cdo); // contributi dovuti
|
||||
rec.np_put("AU001039", cve); // contributi versati
|
||||
// 2017: É stato aggiunto un controllo a AU001029, se è empty salto tutto questo pezzo
|
||||
if(cfep.full())
|
||||
{
|
||||
rec.np_put("AU001033", cat);
|
||||
rec.np_put("AU001034", cce); // contributi a carico erogante
|
||||
rec.np_put("AU001035", ccp); // contributi a carico percipiente
|
||||
if (!cal.is_zero())
|
||||
{
|
||||
rec.np_put("AU001036", true); // altri contributi?
|
||||
rec.np_put("AU001037", cal); // importo altri contributi
|
||||
}
|
||||
rec.np_put("AU001038", cdo); // contributi dovuti
|
||||
rec.np_put("AU001039", cve); // contributi versati
|
||||
}
|
||||
}
|
||||
|
||||
_data.add(rec);
|
||||
@ -808,7 +858,7 @@ bool TTrasferimentoCU::split(const char* path)
|
||||
{
|
||||
TRecordCU rec;
|
||||
rec.tipo_record('A'); // Compila record di testata A
|
||||
rec.set(3, "CUR16"); // Codice fornitura
|
||||
rec.set(3, "CUR17"); // Codice fornitura
|
||||
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
|
||||
@ -900,7 +950,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", 2015);
|
||||
const int anno = ini_get_int(CONFIG_STUDIO, "77", "AnnoDic", 2016);
|
||||
o.set(anno);
|
||||
}
|
||||
break;
|
||||
@ -956,12 +1006,16 @@ class TCU_app : public TSkeleton_application
|
||||
{
|
||||
public:
|
||||
virtual void main_loop();
|
||||
void isUpdated();
|
||||
};
|
||||
|
||||
void TCU_app::main_loop()
|
||||
{
|
||||
TCU_mask m;
|
||||
|
||||
// Eseguo controllo adeguamento database 2017
|
||||
isUpdated();
|
||||
|
||||
while (m.run() == K_ENTER)
|
||||
{
|
||||
const int anno = m.get_int(F_ANNO);
|
||||
@ -1028,8 +1082,39 @@ void TCU_app::main_loop()
|
||||
}
|
||||
}
|
||||
|
||||
void TCU_app::isUpdated()
|
||||
{
|
||||
TRelation anagr(LF_ANAG);
|
||||
TCursor c(&anagr);
|
||||
long int items = c.items();
|
||||
TProgress_monitor p(items, "Aggiornamento valori per CU");
|
||||
bool trovato = false;
|
||||
// Eseguo questo controllo per verificare la presenza di di EVECC == 6 ma fa schifo.
|
||||
for(c=0; c.pos() < items && !trovato; ++c)
|
||||
{
|
||||
TRectype r = c.curr();
|
||||
if(r.get_int("EVECC") == 6)
|
||||
trovato = true;
|
||||
}
|
||||
if(!trovato)
|
||||
{
|
||||
for(c=0; c.pos() < items; ++c)
|
||||
{
|
||||
if (!p.add_status())
|
||||
break;
|
||||
TRectype r = c.curr();
|
||||
if(r.get_int("EVECC") == 8)
|
||||
{
|
||||
r.put("EVECC", 6);
|
||||
r.write_rewrite(anagr.lfile());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int m777200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TCU_app app;
|
||||
app.run(argc, argv, TR("Certificazione Unica"));
|
||||
return 0;
|
||||
|
@ -24,7 +24,7 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Invio Certificazione Unica 2015" -1 -1 72 8
|
||||
PAGE "Invio Certificazione Unica 2016" -1 -1 72 8
|
||||
|
||||
GROUPBOX DLG_NULL 78 5
|
||||
BEGIN
|
||||
|
@ -588,7 +588,7 @@ void TCU_report::create_logo(TReport_section& header)
|
||||
{
|
||||
add_big_text(header, 4, 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, "2016", COLOR_LTGRAY).set_vertical_alignment('B');
|
||||
add_big_text(header, 6,12, "2017", COLOR_LTGRAY).set_vertical_alignment('B');
|
||||
|
||||
TReport_field* txt = new TReport_field(&header);
|
||||
txt->set_type('I');
|
||||
@ -692,7 +692,7 @@ void TCU_report::create_D()
|
||||
txt->set_font(fnt_big);
|
||||
body.add(txt);
|
||||
|
||||
add_boxed_field(body, 8, 68, 4, "2015", "");
|
||||
add_boxed_field(body, 8, 68, 4, "2016", "");
|
||||
|
||||
add_band(body, 12, 35);
|
||||
|
||||
@ -727,14 +727,15 @@ 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/2014");
|
||||
add_underlined_text(body, 0, "DOMICILIO FISCALE ALL'1/1/2016");
|
||||
add_labeled_field(body, 0, 0, 50, "#DA002020", "Comune");
|
||||
add_labeled_field(body, 0, CU_AFTER_LAST, 3, "#DA002021", "Provincia (sigla)");
|
||||
add_labeled_field(body, 0, CU_ALIGN_RIGHT, 6, "#DA002022", "Codice comune");
|
||||
add_underlined_text(body, 4, "DOMICILIO FISCALE ALL'1/1/2015");
|
||||
add_labeled_field(body, 1, 0, 50, "#DA002023", "Comune");
|
||||
add_labeled_field(body, 1, CU_AFTER_LAST, 3, "#DA002024", "Provincia (sigla)");
|
||||
add_labeled_field(body, 1, CU_ALIGN_RIGHT, 6, "#DA002025", "Codice comune");
|
||||
add_underlined_text(body, 4, "DOMICILIO FISCALE ALL'1/1/2017");
|
||||
add_labeled_field(body, 1, 0, 48, "#DA002023", "Comune");
|
||||
add_labeled_field(body, 1, 50, 3, "#DA002024", "Provincia (sigla)");
|
||||
add_labeled_field(body, 1, 56, 3, "#DA002025", " Codice comune");
|
||||
add_labeled_field(body, 1, CU_ALIGN_RIGHT, 3, "#DA002026", "Fusione comuni");
|
||||
end_paragraph(body);
|
||||
|
||||
begin_paragraph(body, CU_AFTER_LAST, 3, "DATI RELATIVI\nAL RAPPRESENTANTE", 0x2);
|
||||
@ -821,9 +822,9 @@ void TCU_report::create_H()
|
||||
begin_paragraph(body, -1, 12, "DATI PREVIDENZIALI");
|
||||
add_labeled_field (body, 0, tab1, CU_EURO_LEN, "#AU001029", "Codice fiscale Ente previdenziale", 'C');
|
||||
add_labeled_field (body, 0, tab2, 38, "#AU001030", "Denominazione Ente previdenziale", 'C');
|
||||
add_labeled_field (body, 1, tab1, CU_EURO_LEN/2, "#AU001031", "Codice\nEnte previdenziale", 'C');
|
||||
add_labeled_field (body, 1, tab2, CU_EURO_LEN, "#AU001032", "Codice azienda", 'C');
|
||||
add_labeled_field (body, 1, tab3, CU_EURO_LEN/2, "#AU001033", "Categoria", 'C');
|
||||
//add_labeled_field (body, 1, tab1, CU_EURO_LEN/2, "#AU001031", "Codice\nEnte previdenziale", 'C');
|
||||
add_labeled_field (body, 1, tab1, CU_EURO_LEN, "#AU001032", "Codice azienda", 'C');
|
||||
add_labeled_field (body, 1, tab2, CU_EURO_LEN/2, "#AU001033", "Categoria", 'C');
|
||||
add_labeled_number(body, 2, tab1, CU_EURO_LEN, "#AU001034", "Contributi previdenziali\na carico del soggetto erogante", 'C');
|
||||
add_labeled_number(body, 2, tab2, CU_EURO_LEN, "#AU001035", "Contributi previdenziali\na carico del percipiente", 'C');
|
||||
add_labeled_bool (body, 2, tab3, CU_EURO_LEN/4, "#AU001036", "Altri contributi");
|
||||
@ -865,13 +866,13 @@ void TCU_report::create_H()
|
||||
_row_height = 300;
|
||||
add_labeled_field (body, 0, tab1, CU_EURO_LEN, "#AU001101", "Codice fiscale del debitore principale", 'C');
|
||||
add_labeled_number(body, 0, tab2, CU_EURO_LEN-4, "#AU001102", "Somme erogate", 'C');
|
||||
add_labeled_bool (body, 0, CU_ALIGN_RIGHT, 2, "#AU001104", "Ritenute non operate");
|
||||
add_labeled_number(body, 0, CU_BEFORE_LAST, CU_EURO_LEN-4, "#AU001103", "Ritenute operate", 'C');
|
||||
add_labeled_number(body, 0, CU_ALIGN_RIGHT, CU_EURO_LEN-6, "#AU001104", "Somme erogate non tassate"); //
|
||||
add_labeled_number(body, 0, CU_BEFORE_LAST, CU_EURO_LEN-4, "#AU001103", "Ritenute operate", 'C'); //
|
||||
_row_offset -= 100;
|
||||
add_labeled_field (body, 1, tab1, CU_EURO_LEN, "#AU001105", "", 'C');
|
||||
add_labeled_number(body, 1, tab2, CU_EURO_LEN-4, "#AU001106", "", 'C');
|
||||
add_labeled_bool (body, 1, CU_ALIGN_RIGHT, 2, "#AU001108", "");
|
||||
add_labeled_number(body, 1, CU_BEFORE_LAST, CU_EURO_LEN-4, "#AU001107", "", 'C');
|
||||
add_labeled_number(body, 1, CU_ALIGN_RIGHT, CU_EURO_LEN-6, "#AU001108", ""); //
|
||||
add_labeled_number(body, 1, CU_BEFORE_LAST, CU_EURO_LEN-4, "#AU001107", "", 'C'); //
|
||||
end_paragraph(body);
|
||||
|
||||
begin_paragraph(body, -1, 6, "Somme corrisposte a titolo di indennità di esproprio, altre indennità e interessi");
|
||||
|
Loading…
x
Reference in New Issue
Block a user