Correzioni stampa registri senza IVA per cassa

git-svn-id: svn://10.65.10.50/branches/R_10_00@22978 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2014-07-30 12:55:26 +00:00
parent 7af7ae89b7
commit 811f84501b
5 changed files with 68 additions and 31 deletions

View File

@ -1491,6 +1491,7 @@ END
STRING F_PADESTIN 6
BEGIN
PROMPT 2 18 "Destinatario "
FLAGS "U"
MODULES PA
HELP "Codice dell'ufficio dell'amministrazione destinatario della fattura"
FIELD LF_CFVEN->PADESTIN
@ -1499,6 +1500,7 @@ END
STRING F_PARIFAMM 20
BEGIN
PROMPT 27 18 "Riferimento amministrazione "
FLAGS "U"
MODULES PA
HELP "Codice del cedente presso l'amministrazione"
FIELD LF_CFVEN->PARIFAMM

View File

@ -3858,16 +3858,11 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
look_pla(att, TRUE);
_pla->put("R8", prorata);
_pla->rewrite();
if (look_lia(0l, TRUE))
if (look_lia(0l, true))
{
if (atoi(_year) >= 2000)
{
real cc = cred_cost;
round_imposta(cc);
_lia->put("R5", cc);
}
else
_lia->put("R5", cred_cost);
real cc = cred_cost;
round_imposta(cc);
_lia->put("R5", cc);
_lia->rewrite();
}
_year = yr;
@ -4065,8 +4060,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
// AWFUL! se siamo in annuale, occorre arrotondare alle 1000 lire
// schiaffo tutto il codice nell'IF che segue, e se lo si vuole togliere
// non si fara' che scancellare tutto il blocco
const bool after2000 = atoi(_year) >= 2000; // CM000222
if (month == 13 || after2000)
//const bool after2000 = atoi(_year) >= 2000; // Nel 2014 mi pare una formalità
//if (month == 13 || after2000)
{
// molto codice duplicato, ma ne val la pena (vedi sopra)
round_imposta(iva_vend);
@ -4094,6 +4090,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
res_cred = iva_acq + versamenti + vers_int + cred_prec - cred_trasf + acc_dec + credito_utilizzato_iva + crediti_speciali + fdiffinc_iva_acq;
res_debt = iva_vend + rimborsi + debt_precd + imposta_non_versata + fdiffinc_iva;
/* Obsolescenza pura nel 2014
if (atoi(_year) < 1998) // Non vale piu' dal 1998 in poi; iva_acq e' gia' ok e cosi' res_cred.
{
if (tot_cong.sign() > 0)
@ -4101,6 +4098,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
else
res_cred -= tot_cong;
}
*/
if (rettifiche.sign() >= 0)
res_debt += rettifiche;
@ -4136,12 +4134,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
_lim->put("R11", acc_dec);
_lim->put("R12", res_cred);
_lim->put("R13", res_debt);
if (after2000) // Anche R14
{
real ivi = _lim->get("R14");
round_imposta(ivi);
_lim->put("R14", ivi);
}
real ivi = _lim->get("R14"); round_imposta(ivi);
_lim->put("R14", ivi);
_lim->put("R15", credito_utilizzato_iva);
if (month == 13)

View File

@ -836,7 +836,7 @@ real TLiquidazione_app::credito_prec(int month)
real c = ZERO;
const bool lia_ok = look_lia();
const bool old_age = atoi(_year) < 2000 || _lia->get("S9") != "NV";
const bool old_age = /*atoi(_year) < 2000 ||*/ _lia->get("S9") != "NV";
if (is_first_month(month))
{

View File

@ -1270,8 +1270,7 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts, _DescrItem*
d->_s6 = _lim->get("S2");
}
d->_r11 = _lim->get_real("R10"); // tasso di interesse (Non arrotondare!)
d->_r11 = _lim->get_real("R10"); // tasso di interesse (Non arrotondare!)
d->_r15 = _lim->get_real("R15"); // Credito utilizzato IVA
d->_r16 = _lim->get_real("R16"); // Credito utilizzato F24
d->_r17 = _lim->get_real("R17"); // Variazioni d'imposta
@ -1287,8 +1286,15 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts, _DescrItem*
if (_month == 13)
{
const int anno_prossimo = atoi(_year)+1;
if (look_lia(0l, FALSE, anno_prossimo))
const int anno = atoi(_year);
// Credito utilizzato inizio anno (aggiunto 29-07-2014)
if (look_lia(0l, false, anno))
{
if (_lia->get("S6") != "NV")
d->_r15 = _lia->get_real("R15");
}
if (look_lia(0l, false, anno+1))
d->_r20 = _lia->get_real("R0"); // Credito da riportare all'anno prossimo
}
@ -1306,6 +1312,7 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts, _DescrItem*
_DescrItem* dv = describe_deleghe(month);
if (dv != NULL) d->_arr.add(dv);
}
_descr_arr.add(d);
}
@ -1915,14 +1922,26 @@ void TLiquidazione_app::set_pim_head(_DescrItem& d)
set_row(r++,"");
if (d._flags == PIM_HEAD_D)
{
set_row(r++, TR("Movimenti a liquidazione differita o per cassa registrati nel periodo"));
TString msg;
msg = TR("Movimenti registrati nel periodo a liquidazione differita");
const TDate data(1, _month <= 12 ? _month : 12 , atoi(_year));
if (gestione_IVAxCassa(data))
msg << TR(" o per cassa");
set_row(r++, msg);
set_bookmark(TR("Riepilogo progressivi a liquidazione differita"), _att_bookmark);
// print_dainc_diff_log(r, d._f2, d._f3); // 15-03-2013 obosleto in quanto stampato su registri?
}
else
if (d._flags == PIM_HEAD_DI)
{
set_row(r++, TR("Incassi/pagamenti a liquidazione differita o per cassa"));
TString msg;
msg = TR("Incassi/pagamenti a liquidazione differita");
const TDate data(1, _month <= 12 ? _month : 12 , atoi(_year));
if (gestione_IVAxCassa(data))
msg << TR(" o per cassa");
set_row(r++, msg);
set_bookmark(TR("Riepilogo progressivi a liquidazione differita incassati"), _att_bookmark);
// print_inc_diff_log(r, d._f2, d._f3);
}
@ -2550,7 +2569,7 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw)
rw++;
print_importo(rw++, TR("Variazioni d'imposta"), variazioni_imposta, _is_visliq);
print_importo(rw++, TR("Imposta non versata"), imposta_non_versata, _is_visliq);
if (debt_prec > ZERO)
set_row(rw++,FR("@11gDebito o credito da liquidazione precedente@75g%r"), &debt_prec);
else
@ -2561,7 +2580,7 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw)
}
set_row(rw++,FR("%s@11gRimborsi%s@75g%r"),
_is_visliq ? "$[r]" : "", _is_visliq ? "$[n]" : "", &rimborso);
set_row(rw++,FR("@11gCredito IVA compensabile detratto@58g%r"), &credito_utilizzato_iva);
set_row(rw++, FR("@11gCredito IVA compensabile detratto@58g%r"), &credito_utilizzato_iva);
real cre_deb_per = risultato + crediti_speciali + acc_dec + vers_int;
if (_month == 13) cre_deb_per += versamenti;

View File

@ -1904,14 +1904,20 @@ real TStampa_registri_app::stampa_valori_plafonds(const real& r1, const int mese
bool TStampa_registri_app::some_IVAxCassa(int da_mese, int a_mese) const
{
if (_tipo_reg != vendita && _tipo_reg != acquisto)
if ((_tipo_reg != vendita || _corrispettivi) && _tipo_reg != acquisto )
return false;
if (ini_get_bool(CONFIG_STUDIO, "cg", "NoIdRg"))
return false;
if (_tipo_reg == acquisto && !gestione_IVAxCassa(_data_da))
{
int cazzone = 1;
// return false;
}
TString query;
query = "USE IVADIFF KEY 2 SELECT (TIPOMOV>2)&&(MESELIQ<13)";
query << "USE IVADIFF KEY 2 SELECT (TIPOMOV>2)&&(MESELIQ<13)&&(TIPOIVA=" << _tipo_reg << ')';
query << "\nFROM ANNOLIQ=" << _data_da.year() << " MESELIQ=" << da_mese;
query << "\nTO ANNOLIQ=" << _data_a.year() << " MESELIQ=" << a_mese;
TISAM_recordset id(query);
@ -1932,7 +1938,9 @@ bool TStampa_registri_app::some_IVAxCassa(int da_mese, int a_mese) const
bool TStampa_registri_app::print_IVAxCassa(int da_month, int a_month)
{
if (_tipo_reg != vendita && _tipo_reg != acquisto)
// 3 Test paranoici già effettuati dalla funzione SomeIVAxCassa
if ((_tipo_reg != vendita || _corrispettivi) && _tipo_reg != acquisto)
return false;
// Non stampare il prospetto IVA differita sui registri
@ -1942,6 +1950,14 @@ bool TStampa_registri_app::print_IVAxCassa(int da_month, int a_month)
return false;
}
const bool IVAxCassa = gestione_IVAxCassa(_data_da);
if (_tipo_reg == acquisto && !IVAxCassa)
{
_riga_prospettoXcassa.destroy(); // ????
return false;
}
TPrinter& pr = printer();
TPrintrow riga;
const TString linea(_stampa_width, '-');
@ -1994,7 +2010,12 @@ bool TStampa_registri_app::print_IVAxCassa(int da_month, int a_month)
riga.reset();
if (_tipo_reg == vendita)
riga.put(TR("DETTAGLIO INCASSI FATTURE CON IVA DIFFERITA O PER CASSA"), 40);
{
TString msg = TR("DETTAGLIO INCASSI FATTURE CON IVA DIFFERITA");
if (IVAxCassa)
msg << TR(" O PER CASSA");
riga.put(msg, 40);
}
else
riga.put(TR("DETTAGLIO PAGAMENTI FATTURE CON IVA PER CASSA"), 40);
pr.print(riga);
@ -2623,7 +2644,7 @@ print_action TStampa_registri_app::postprocess_page (int file, int counter)
}
_datareg = save_date;
}
const int a_mese = _datareg.month();
int da_mese = 0;
if (_frequiva == 'T')