Patch level : 12.0 564
Files correlati : cg4.exe Modificata la liquidazione delle fatture in ritardo Aggiunta la gestione dell'uscita dal regime di cassa Sistemata la cancellazione di IVADIFF nei mesi e in 13. git-svn-id: svn://10.65.10.50/branches/R_10_00@24468 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4a166a54ed
commit
48aeea1dba
@ -304,6 +304,7 @@ class TLiquidazione_app : public TPrint_application
|
|||||||
int _monthinatt; // mese inizio attivita' (serve per differita)
|
int _monthinatt; // mese inizio attivita' (serve per differita)
|
||||||
bool _lim_cleared;
|
bool _lim_cleared;
|
||||||
bool _definitiva;
|
bool _definitiva;
|
||||||
|
bool _end_cassa;
|
||||||
|
|
||||||
real _diff_ven_ap, _diff_ven_ap_iva, _diff_acq_ap, _diff_acq_ap_iva;
|
real _diff_ven_ap, _diff_ven_ap_iva, _diff_acq_ap, _diff_acq_ap_iva;
|
||||||
real _imposta_inc_diff_ven, _imposta_inc_cassa_ven, _imposta_inc_diff_acq, _imposta_inc_cassa_acq;
|
real _imposta_inc_diff_ven, _imposta_inc_cassa_ven, _imposta_inc_diff_acq, _imposta_inc_cassa_acq;
|
||||||
|
@ -1134,15 +1134,15 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
const TRectype & lia = get_lia();
|
const TRectype & lia = get_lia();
|
||||||
|
|
||||||
TDate data_end_cassa = lia.get_date("D1");
|
TDate data_end_cassa = lia.get_date("D1");
|
||||||
bool end_cassa = lia.get_bool("B5") && data_end_cassa.ok() && data_rif_cassa > data_end_cassa;
|
_end_cassa = lia.get_bool("B5") && data_end_cassa.ok() && (month < 12 && data_rif_cassa.month() == data_end_cassa.month());
|
||||||
|
|
||||||
if (!end_cassa && month > 11)
|
if (!_end_cassa && month > 11)
|
||||||
{
|
{
|
||||||
data_end_cassa = eotime;
|
data_end_cassa = eotime;
|
||||||
const TRectype & lia = get_lia(0, false, year_int + 1);
|
const TRectype & lia = get_lia(0, false, year_int + 1);
|
||||||
|
|
||||||
end_cassa = !lia.get_bool("B5");
|
_end_cassa = !lia.get_bool("B5");
|
||||||
if (end_cassa)
|
if (_end_cassa)
|
||||||
data_end_cassa = data_rif_cassa;
|
data_end_cassa = data_rif_cassa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1156,7 +1156,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
long nr = _mov->get_long(MOV_NUMREG);
|
long nr = _mov->get_long(MOV_NUMREG);
|
||||||
|
|
||||||
if (nr == 1931434 || nr == 1931437)
|
if (nr == 22060 || nr == 27710)
|
||||||
int i = 1;
|
int i = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1236,10 +1236,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
nr = _mov->get_long(MOV_NUMREG);
|
nr = _mov->get_long(MOV_NUMREG);
|
||||||
|
|
||||||
if (nr == 25722 ||
|
if (nr == 22060 || nr == 27710)
|
||||||
nr == 25863 ||
|
|
||||||
nr == 27888 ||
|
|
||||||
nr == 28033)
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1256,7 +1253,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
const char sezfat = tipomov == vendita ? 'D' : 'A';
|
const char sezfat = tipomov == vendita ? 'D' : 'A';
|
||||||
const char sezpag = (sezfat=='D') ? 'A' : 'D';
|
const char sezpag = (sezfat=='D') ? 'A' : 'D';
|
||||||
const long numreg = _mov->get_long(MOV_NUMREG);
|
const long numreg = _mov->get_long(MOV_NUMREG);
|
||||||
TDate datainc;
|
TDate datainc = fine;
|
||||||
real tot_incassato, tot_da_incassare;
|
real tot_incassato, tot_da_incassare;
|
||||||
int flag_pg_nc = 0; // Ci sono pagamenti (0x1) e/o note di credito(0x2) ?
|
int flag_pg_nc = 0; // Ci sono pagamenti (0x1) e/o note di credito(0x2) ?
|
||||||
bool game_found = false;
|
bool game_found = false;
|
||||||
@ -1283,6 +1280,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
TImporto pg_per, nc_per;
|
TImporto pg_per, nc_per;
|
||||||
bool regular_month = orizzonte >= date;
|
bool regular_month = orizzonte >= date;
|
||||||
bool first_month = regular_month && date > inizio + 1L;
|
bool first_month = regular_month && date > inizio + 1L;
|
||||||
|
#ifdef DBG
|
||||||
|
nr = _mov->get_long(MOV_NUMREG);
|
||||||
|
|
||||||
|
if (nr == 22060 || nr == 27710)
|
||||||
|
int i = 1;
|
||||||
|
#endif
|
||||||
flag_pg_nc = rp.calcola_pagato_periodo(first_month ? botime : inizio + 1L, orizzonte, pg_per, nc_per, &pagscatt) && regular_month;
|
flag_pg_nc = rp.calcola_pagato_periodo(first_month ? botime : inizio + 1L, orizzonte, pg_per, nc_per, &pagscatt) && regular_month;
|
||||||
if (pagscatt.items() >= 2)
|
if (pagscatt.items() >= 2)
|
||||||
{
|
{
|
||||||
@ -1299,7 +1302,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (iva_diff || sarebbe_maturata(_mov->curr(), inizio+1L, fine) || (iva_cass && end_cassa))
|
if (iva_diff || sarebbe_maturata(_mov->curr(), inizio+1L, fine) || (iva_cass && _end_cassa))
|
||||||
{
|
{
|
||||||
TPointer_array pagscaold;
|
TPointer_array pagscaold;
|
||||||
TImporto pg_tot, nc_tot;
|
TImporto pg_tot, nc_tot;
|
||||||
@ -1366,7 +1369,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Fattura più vecchia di un anno a ente NON pubblico
|
// Fattura più vecchia di un anno a ente NON pubblico
|
||||||
if (sarebbe_maturata(_mov->curr(), inizio+1L, fine) || (iva_cass && end_cassa))
|
if (sarebbe_maturata(_mov->curr(), inizio+1L, fine) || (iva_cass && _end_cassa))
|
||||||
tot_da_incassare = _mov->get_real(MOV_TOTDOC);
|
tot_da_incassare = _mov->get_real(MOV_TOTDOC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1376,7 +1379,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
tot_incassato = tot_da_incassare;
|
tot_incassato = tot_da_incassare;
|
||||||
|
|
||||||
datainc = data_maturazione_IVA_diff(_mov->curr());
|
datainc = data_maturazione_IVA_diff(_mov->curr());
|
||||||
if (iva_cass && end_cassa)
|
if (iva_cass && _end_cassa)
|
||||||
datainc = data_end_cassa;
|
datainc = data_end_cassa;
|
||||||
_mov->put(MOV_DATAINC, datainc);
|
_mov->put(MOV_DATAINC, datainc);
|
||||||
if (datainc < date)
|
if (datainc < date)
|
||||||
@ -1526,10 +1529,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
nr = _mov->get_long(MOV_NUMREG);
|
nr = _mov->get_long(MOV_NUMREG);
|
||||||
|
|
||||||
if (nr == 25722 ||
|
if (nr == 22060 || nr == 27710)
|
||||||
nr == 25863 ||
|
|
||||||
nr == 27888 ||
|
|
||||||
nr == 28033)
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1558,20 +1558,21 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
if (diff_totr == ZERO)
|
if (diff_totr == ZERO)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TDate datafat;
|
TDate datafat= _mov->get_date(MOV_DATAREG);
|
||||||
long numreg = _rmoviva->get_long(RMI_NUMREG);
|
long numreg = _rmoviva->get_long(RMI_NUMREG);
|
||||||
|
sezfat = tipomov == vendita ? 'D' : 'A';
|
||||||
|
|
||||||
|
if (is_detr_diff == 1 || civa.tipo() == "NS")
|
||||||
|
continue;
|
||||||
|
if (bIsMovDiff && tm == tm_fattura)
|
||||||
|
{
|
||||||
const TDate datareg = _mov->get_date(MOV_DATAREG);
|
const TDate datareg = _mov->get_date(MOV_DATAREG);
|
||||||
int mesereg = datareg.month();
|
int mesereg = datareg.month();
|
||||||
bool ok = is_month_ok(mesereg, month) && (atoi(_year) == datareg.year());
|
bool ok = is_month_ok(mesereg, month) && (atoi(_year) == datareg.year());
|
||||||
|
|
||||||
if (!ok && (iva_cass && end_cassa && month < 13))
|
if (ok)
|
||||||
ok = (datareg.year() < atoi(_year)) || (mesereg <= month);
|
|
||||||
if (!ok || is_detr_diff == 1 || civa.tipo() == "NS")
|
|
||||||
continue;
|
|
||||||
if (bIsMovDiff && tm == tm_fattura)
|
|
||||||
{
|
{
|
||||||
datafat = datareg;
|
datafat = datareg;
|
||||||
sezfat = tipomov == vendita ? 'D' : 'A';
|
|
||||||
id.put(RMI_NUMREG, _rmoviva->get(RMI_NUMREG));
|
id.put(RMI_NUMREG, _rmoviva->get(RMI_NUMREG));
|
||||||
id.put(RMI_NUMRIG, _rmoviva->get(RMI_NUMRIG));
|
id.put(RMI_NUMRIG, _rmoviva->get(RMI_NUMRIG));
|
||||||
id.put("NUMPRO", 0);
|
id.put("NUMPRO", 0);
|
||||||
@ -1603,6 +1604,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
if (ew != NOERR)
|
if (ew != NOERR)
|
||||||
cantwrite_box(id.description());
|
cantwrite_box(id.description());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (bIsMovDiff && !pagscatt.empty())
|
if (bIsMovDiff && !pagscatt.empty())
|
||||||
{
|
{
|
||||||
@ -1614,6 +1616,29 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
{
|
{
|
||||||
const TRectype& pagsca = *(TRectype*)obj;
|
const TRectype& pagsca = *(TRectype*)obj;
|
||||||
const int nrigp = pagsca.get_int(PAGSCA_NRIGP);
|
const int nrigp = pagsca.get_int(PAGSCA_NRIGP);
|
||||||
|
TDate datapag;
|
||||||
|
if (nrigp > 0 && nrigp < 9999)
|
||||||
|
{
|
||||||
|
const TPartita& p = arrpart.partita(pagsca);
|
||||||
|
const TRiga_partite& rp = p.riga(nrigp);
|
||||||
|
|
||||||
|
datapag = rp.get(PART_DATAPAG);
|
||||||
|
if (!datapag.ok())
|
||||||
|
datapag = rp.get(PART_DATADOC);
|
||||||
|
if (!datapag.ok())
|
||||||
|
datapag = rp.get(PART_DATAREG);
|
||||||
|
if (datapag < datafat)
|
||||||
|
datapag = datafat;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
datapag = _mov->get_date(MOV_DATAINC);
|
||||||
|
|
||||||
|
bool ok = is_month_ok(datapag.month(), month) && (atoi(_year) == datapag.year());
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
// if (!ok && (iva_cass && end_cassa && month < 13))
|
||||||
|
// ok = (datareg.year() < atoi(_year)) || (mesereg <= month);
|
||||||
|
|
||||||
id.zero();
|
id.zero();
|
||||||
id.put(RMI_NUMREG, _rmoviva->get(RMI_NUMREG));
|
id.put(RMI_NUMREG, _rmoviva->get(RMI_NUMREG));
|
||||||
@ -1659,16 +1684,16 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
id.put(PART_TIPOMOV, tipomov_pag);
|
id.put(PART_TIPOMOV, tipomov_pag);
|
||||||
id.put("NUMREGP", nregpag);
|
id.put("NUMREGP", nregpag);
|
||||||
id.put("NUMRIGP", nrigpag);
|
id.put("NUMRIGP", nrigpag);
|
||||||
TDate d = rp.get(PART_DATAPAG);
|
/* TDate d = rp.get(PART_DATAPAG);
|
||||||
if (!d.ok())
|
if (!d.ok())
|
||||||
d = rp.get(PART_DATADOC);
|
d = rp.get(PART_DATADOC);
|
||||||
if (!d.ok())
|
if (!d.ok())
|
||||||
d = rp.get(PART_DATAREG);
|
d = rp.get(PART_DATAREG);
|
||||||
if (d < datafat)
|
if (d < datafat)
|
||||||
d = datafat;
|
d = datafat; */
|
||||||
|
|
||||||
id.put("DATAREGP", d);
|
id.put("DATAREGP", datapag);
|
||||||
id.put("ANNOLIQ", d.year());
|
id.put("ANNOLIQ", datapag.year());
|
||||||
pagtmp = p.importo_pagsca(pagsca);
|
pagtmp = p.importo_pagsca(pagsca);
|
||||||
pagtmp.normalize(sezpag);
|
pagtmp.normalize(sezpag);
|
||||||
ultimo = (r == pagscatt.last()) && partita_chiusa_al(p, fine);
|
ultimo = (r == pagscatt.last()) && partita_chiusa_al(p, fine);
|
||||||
@ -1727,10 +1752,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
bool pag_found = false;
|
bool pag_found = false;
|
||||||
|
|
||||||
int err = rid.read(_isgteq);
|
int err = rid.read(_isgteq);
|
||||||
#ifdef DBG
|
|
||||||
if (nr == 29283)
|
|
||||||
int i = 1;
|
|
||||||
#endif
|
|
||||||
TDate orizzonte = fine; // caso tradizionale
|
TDate orizzonte = fine; // caso tradizionale
|
||||||
|
|
||||||
if (iva_cass)
|
if (iva_cass)
|
||||||
@ -1816,6 +1837,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (is_date_ok(date, month, liqmonth, year_int) && is_detr_diff == 0) // 5-3-2014
|
if (is_date_ok(date, month, liqmonth, year_int) && is_detr_diff == 0) // 5-3-2014
|
||||||
{
|
{
|
||||||
diff_imp = diff_impr;
|
diff_imp = diff_impr;
|
||||||
|
@ -630,8 +630,8 @@ void TLiquidazione_app::zero_diff(int month, const char* codatt)
|
|||||||
if (!_nditte->is_first_match(LF_ATTIV))
|
if (!_nditte->is_first_match(LF_ATTIV))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (month > 12 || (_freqviva == "T" && (month % 3) != 1)) // rischioso non farlo in tredicesima
|
// if (month > 12 || (_freqviva == "T" && (month % 3) != 1)) // rischioso non farlo in tredicesima
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
TFast_isamfile fid(LF_IVADIFF);
|
TFast_isamfile fid(LF_IVADIFF);
|
||||||
if (fid.status() != NOERR)
|
if (fid.status() != NOERR)
|
||||||
@ -641,38 +641,49 @@ void TLiquidazione_app::zero_diff(int month, const char* codatt)
|
|||||||
query << "USE IVADIFF KEY 2"; // Key 2 = ANNOLIQ+MESELIQ+...
|
query << "USE IVADIFF KEY 2"; // Key 2 = ANNOLIQ+MESELIQ+...
|
||||||
query << "\nFROM ANNOLIQ=" << _year;
|
query << "\nFROM ANNOLIQ=" << _year;
|
||||||
// Se calcolo gennaio (o marzo trimestrale) azzero tutto l'anno, altrimenti solo il mese selezionato
|
// Se calcolo gennaio (o marzo trimestrale) azzero tutto l'anno, altrimenti solo il mese selezionato
|
||||||
// if (month > (_freqviva == "T" ? 3 : 1))
|
if (month < 13)
|
||||||
query << " MESELIQ=" << month;
|
query << " MESELIQ=" << month;
|
||||||
|
|
||||||
query << "\nTO ANNOLIQ=" << _year; // Dal 18-06-2014 lascia stare l'anno prossimo!
|
query << "\nTO ANNOLIQ=" << _year; // Dal 18-06-2014 lascia stare l'anno prossimo!
|
||||||
|
if (month < 13)
|
||||||
query << " MESELIQ=" << month + (_freqviva == "T" ? 2 : 0);
|
query << " MESELIQ=" << month + (_freqviva == "T" ? 2 : 0);
|
||||||
|
|
||||||
TISAM_recordset id(query);
|
TISAM_recordset id(query);
|
||||||
|
|
||||||
TString msg;
|
TString msg;
|
||||||
msg.format("Azzeramento IVADIFF %s %s attività %s", month <= 12 ? itom(month) : "13ma", (const char*)_year, codatt);
|
msg.format("Azzeramento fatture IVADIFF %s %s attività %s", month <= 12 ? itom(month) : "13ma", (const char*)_year, codatt);
|
||||||
TProgress_monitor pi(id.items(), msg, false);
|
TProgress_monitor pi(id.items(), msg, false);
|
||||||
TLocalisamfile& file = id.cursor()->file();
|
TLocalisamfile& file = id.cursor()->file();
|
||||||
for (bool ok = id.move_first(); ok; ok = id.move_next())
|
for (bool ok = id.move_first(); ok; ok = id.move_next())
|
||||||
{
|
{
|
||||||
pi.add_status(1);
|
pi.add_status(1);
|
||||||
/* file.zero("ANNOLIQ");
|
|
||||||
file.zero("MESELIQ");
|
|
||||||
file.zero("IMPORTO");
|
|
||||||
file.zero("IMPONIBILE");
|
|
||||||
file.zero("IMPOSTA");
|
|
||||||
file.zero("DATAREG");
|
|
||||||
file.zero("NUMREGP");
|
|
||||||
file.zero("NUMRIGP");
|
|
||||||
file.zero("DATAREGP");
|
|
||||||
file.zero("DATAREGP");
|
|
||||||
file.zero("TIPOMOV");
|
|
||||||
file.zero("TIPOIVA");
|
|
||||||
file.zero("TIPOATT");
|
|
||||||
file.zero("TIPODIFF");
|
|
||||||
file.zero("CHIUSA");
|
|
||||||
file.rewrite(); */
|
|
||||||
file.remove();
|
file.remove();
|
||||||
}
|
}
|
||||||
|
query = "USE IVADIFF KEY 3"; // Key 3 = DATAREGP+....
|
||||||
|
TDate inizio(1, month == 13 ? 1 : month, atoi(_year));
|
||||||
|
query << "\nFROM DATAREGP=" << inizio << "";
|
||||||
|
|
||||||
|
// Se calcolo gennaio (o marzo trimestrale) azzero tutto l'anno, altrimenti solo il mese selezionato
|
||||||
|
// if (month > (_freqviva == "T" ? 3 : 1))
|
||||||
|
|
||||||
|
TDate fine(1, month == 13 ? 12 : month + (_freqviva == "T" ? 2 : 0), atoi(_year));
|
||||||
|
fine.set_end_month();
|
||||||
|
|
||||||
|
query << "\nTO DATAREGP=" << fine; // Dal 18-06-2014 lascia stare l'anno prossimo!
|
||||||
|
// query << "\nANNOLIQ=" << eotime.year();
|
||||||
|
// query << "\nMESELIQ=" << eotime.month();
|
||||||
|
|
||||||
|
id.set(query);
|
||||||
|
id.requery();
|
||||||
|
|
||||||
|
msg.format("Azzeramento pagamenti IVADIFF %s %s attività %s", month <= 12 ? itom(month) : "13ma", (const char*)_year, codatt);
|
||||||
|
TProgress_monitor pi2(id.items(), msg, false);
|
||||||
|
TLocalisamfile& file2 = id.cursor()->file();
|
||||||
|
for (bool ok = id.move_first(); ok; ok = id.move_next())
|
||||||
|
{
|
||||||
|
pi2.add_status(1);
|
||||||
|
file2.remove();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2545,9 +2545,10 @@ void TLiquidazione_app::set_iva_succ(int& rw)
|
|||||||
{
|
{
|
||||||
TString query;
|
TString query;
|
||||||
|
|
||||||
query << "USE IVADIFF KEY 2"
|
query << "USE IVADIFF KEY 2";
|
||||||
<< "\nFROM ANNOLIQ=" << _year
|
if (!_end_cassa)
|
||||||
<< "\nTO ANNOLIQ=" << _year;
|
query << "\nFROM ANNOLIQ=" << _year;
|
||||||
|
query << "\nTO ANNOLIQ=" << _year;
|
||||||
TISAM_recordset id(query);
|
TISAM_recordset id(query);
|
||||||
const TDate da_datareg(1, 1, atoi(_year));
|
const TDate da_datareg(1, 1, atoi(_year));
|
||||||
const TDate a_datareg(31, 12, atoi(_year));
|
const TDate a_datareg(31, 12, atoi(_year));
|
||||||
@ -2594,6 +2595,9 @@ void TLiquidazione_app::set_iva_succ(int& rw)
|
|||||||
ven_xcas.normalize('D');
|
ven_xcas.normalize('D');
|
||||||
acq_xcas.normalize('A');
|
acq_xcas.normalize('A');
|
||||||
acq_diff.normalize('A');
|
acq_diff.normalize('A');
|
||||||
|
if (_end_cassa)
|
||||||
|
set_row(rw++, FR("@11g@bOPERAZIONI EFFETTUATE FINO ALL'ANNO CON IMPOSTA ESIGIBILE NEGLI ANNI SUCCESSIVI@r"));
|
||||||
|
else
|
||||||
set_row(rw++, FR("@11g@bOPERAZIONI EFFETTUATE NELL'ANNO CON IMPOSTA ESIGIBILE NEGLI ANNI SUCCESSIVI@r"));
|
set_row(rw++, FR("@11g@bOPERAZIONI EFFETTUATE NELL'ANNO CON IMPOSTA ESIGIBILE NEGLI ANNI SUCCESSIVI@r"));
|
||||||
const real vd = ven_diff.valore();
|
const real vd = ven_diff.valore();
|
||||||
const real vc = ven_xcas.valore();
|
const real vc = ven_xcas.valore();
|
||||||
|
@ -1309,20 +1309,7 @@ int TStampa_registri_app::stampa_prospetto_IVA(int rr, int tipo_prosp)
|
|||||||
if (tipo_prosp == 0) // Stampa il prospetto iniziale per progressivi attuali (periodo)
|
if (tipo_prosp == 0) // Stampa il prospetto iniziale per progressivi attuali (periodo)
|
||||||
{
|
{
|
||||||
reset_print();
|
reset_print();
|
||||||
/* nel fondo pagina
|
|
||||||
TString riga(_stampa_width, '-');
|
|
||||||
set_row(rr++, riga);
|
|
||||||
|
|
||||||
riga = TR("Legenda Tipo Operazione: 1=intra; 2=AF art.34 comma 3");
|
|
||||||
if (_auto_intraf)
|
|
||||||
riga << TR("; 3=intra e AF art.34 comma 3");
|
|
||||||
riga << TR("; 4=liquidazione differita");
|
|
||||||
if (has_module(ICAUT))
|
|
||||||
riga << TR("; 5=IVA per cassa");
|
|
||||||
if (_annoIVA >= 2015)
|
|
||||||
riga << TR("; 6=Scissione pagamenti art.17 ter");
|
|
||||||
set_row(rr++, riga);
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (_st_tot_fin)
|
if (_st_tot_fin)
|
||||||
{
|
{
|
||||||
@ -1555,13 +1542,11 @@ void TStampa_registri_app::set_page_tot_reg()
|
|||||||
|
|
||||||
//*****deve azzerare i totali progressivi dei riporti e segnalare all'header di non stampare
|
//*****deve azzerare i totali progressivi dei riporti e segnalare all'header di non stampare
|
||||||
//la riga di riporto
|
//la riga di riporto
|
||||||
_totali_stampati = true; //siamo in stampa totali, quindi...
|
|
||||||
_riporti = false; //inoltre non deve stapare riporti mentre stampa i totali
|
|
||||||
_totdoc_prog = _totimpn_prog = _totimps_prog = ZERO;
|
|
||||||
reset_print();
|
reset_print();
|
||||||
|
|
||||||
if (_esiste_riga_iva && _stampa)
|
if (_esiste_riga_iva && _stampa)
|
||||||
{
|
{
|
||||||
|
_totali_finali = true; //siamo in stampa totali, quindi...
|
||||||
for (int tipo_prosp = 0; tipo_prosp <= 2/* (_tipo_reg == vendita ? 2 : 1) */; tipo_prosp++)
|
for (int tipo_prosp = 0; tipo_prosp <= 2/* (_tipo_reg == vendita ? 2 : 1) */; tipo_prosp++)
|
||||||
{
|
{
|
||||||
TRiga_array& arriva = tipo_prosp == 0 ? _tot_iva_array : (tipo_prosp == 1 ? _tot_prec_iva_array : (_tipo_reg == vendita ? _riga_split : _riga_competenza));
|
TRiga_array& arriva = tipo_prosp == 0 ? _tot_iva_array : (tipo_prosp == 1 ? _tot_prec_iva_array : (_tipo_reg == vendita ? _riga_split : _riga_competenza));
|
||||||
@ -1570,6 +1555,9 @@ void TStampa_registri_app::set_page_tot_reg()
|
|||||||
if (!printed)
|
if (!printed)
|
||||||
{
|
{
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
|
_totali_stampati = true; //siamo in stampa totali, quindi...
|
||||||
|
_riporti = false; //inoltre non deve stapare riporti mentre stampa i totali
|
||||||
|
_totdoc_prog = _totimpn_prog = _totimps_prog = ZERO;
|
||||||
rr = stampa_prospetto_IVA(rr, 0); // Intestazione prospetto IVA per aliquota
|
rr = stampa_prospetto_IVA(rr, 0); // Intestazione prospetto IVA per aliquota
|
||||||
printed = true;
|
printed = true;
|
||||||
}
|
}
|
||||||
@ -1644,7 +1632,6 @@ void TStampa_registri_app::set_page_tot_reg()
|
|||||||
}
|
}
|
||||||
} // for
|
} // for
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printed)
|
if (printed)
|
||||||
{
|
{
|
||||||
flush();
|
flush();
|
||||||
@ -2335,6 +2322,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
_auto_intraf = false;
|
_auto_intraf = false;
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
_totali_stampati = false; //siamo al cambio periodo (mese/trimestre),quindi resetto il flag di stampa totali
|
_totali_stampati = false; //siamo al cambio periodo (mese/trimestre),quindi resetto il flag di stampa totali
|
||||||
|
_totali_finali = false;
|
||||||
_riporti = false;//e pure quello dei riporti,visto che "A Riporto" non va nella prima pagina del mese
|
_riporti = false;//e pure quello dei riporti,visto che "A Riporto" non va nella prima pagina del mese
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2466,12 +2454,12 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
set_row(_r, "@31g%6ld", codcf);
|
set_row(_r, "@31g%6ld", codcf);
|
||||||
if (meseliq > 0)
|
if (meseliq > 0)
|
||||||
set_row(_r, "@62g%02d", meseliq);
|
set_row(_r, "@62g%02d", meseliq);
|
||||||
set_row(_r, "@65g%2s", (const char*) _tipodoc);
|
set_row(_r, "@67g%2s", (const char*) _tipodoc);
|
||||||
if (fattrit)
|
if (fattrit)
|
||||||
set_row(_r, "@67gCD");
|
set_row(_r, "@69gD");
|
||||||
else
|
else
|
||||||
if (fattritind)
|
if (fattritind)
|
||||||
set_row(_r, "@67gCI");
|
set_row(_r, "@69gI");
|
||||||
if (_stampa_width == 132)
|
if (_stampa_width == 132)
|
||||||
set_row(_r, "@70g%r", &totdoc);
|
set_row(_r, "@70g%r", &totdoc);
|
||||||
else
|
else
|
||||||
@ -2618,7 +2606,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
tipo_op = "5";
|
tipo_op = "5";
|
||||||
}
|
}
|
||||||
|
|
||||||
set_row(_r, "@66g%s", (const char*)tipo_op);
|
set_row(_r, "@65g%s", (const char*)tipo_op);
|
||||||
|
|
||||||
if (_tipo_stampa == prova) //stampa di prova
|
if (_tipo_stampa == prova) //stampa di prova
|
||||||
{
|
{
|
||||||
@ -2960,16 +2948,16 @@ void TStampa_registri_app::preprocess_header()
|
|||||||
{
|
{
|
||||||
if (_stampa_width == 132)
|
if (_stampa_width == 132)
|
||||||
{
|
{
|
||||||
set_header(r,FR("@10gNum.@19gDocumento@61gMese@66gT Tipo@102gCod %c@123gT %c@128gNum"), nd1, tipo);
|
set_header(r,FR("@10gNum.@19gDocumento@61gMese@65gT Tipo@102gCod %c@123gT %c@128gNum"), nd1, tipo);
|
||||||
r++;
|
r++;
|
||||||
set_header(r, FR("Data reg. prot.@17gData@24gNumero Codice Ragione sociale/descr. liq.@66gO Doc.@74gTotale doc.@90gImponibile IVA %c@115gImposta@123g%c %c@128gReg"), nd2, cor, type);
|
set_header(r, FR("Data reg. prot.@17gData@24gNumero Codice Ragione sociale/descr. liq.@65gO Doc.@74gTotale doc.@90gImponibile IVA %c@115gImposta@123g%c %c@128gReg"), nd2, cor, type);
|
||||||
r++;
|
r++;
|
||||||
}
|
}
|
||||||
else //stampa a 198
|
else //stampa a 198
|
||||||
{
|
{
|
||||||
set_header(r,FR("Registrazione Documento@61gMese@66gT Tipo@110gCod %c@132g%c T@139gNum."), nd1, tipo, cor);
|
set_header(r,FR("Registrazione Documento@61gMese@65gT Tipo@110gCod %c@132g%c T@139gNum."), nd1, tipo, cor);
|
||||||
r++;
|
r++;
|
||||||
set_header(r, FR("Data Protocollo Data@24gNumero Codice Ragione sociale/descr. liq.@66gO Documento@80gTot.Documento@98gImponibile IVA %c@124gImposta@132g%c %c@139gReg."), nd2, type, cor);
|
set_header(r, FR("Data Protocollo Data@24gNumero Codice Ragione sociale/descr. liq.@65gO Documento@80gTot.Documento@98gImponibile IVA %c@124gImposta@132g%c %c@139gReg."), nd2, type, cor);
|
||||||
r++;
|
r++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2982,7 +2970,7 @@ void TStampa_registri_app::preprocess_header()
|
|||||||
{
|
{
|
||||||
if (_stampa_width == 132)
|
if (_stampa_width == 132)
|
||||||
{
|
{
|
||||||
set_header(r,FR("@10gNum.@19gDocumento@61gMese@66gT Tipo@102gCod %c@123gT %c"), nd1, tipo);
|
set_header(r,FR("@10gNum.@19gDocumento@61gMese@67gT Tipo@102gCod %c@123gT %c"), nd1, tipo);
|
||||||
if (_tipo_stampa == rif_giornale) //stampa definitiva con rif. al libro giornale
|
if (_tipo_stampa == rif_giornale) //stampa definitiva con rif. al libro giornale
|
||||||
set_header(r, FR("@128gNum."));
|
set_header(r, FR("@128gNum."));
|
||||||
r++;
|
r++;
|
||||||
@ -2994,7 +2982,7 @@ void TStampa_registri_app::preprocess_header()
|
|||||||
}
|
}
|
||||||
else //stampa a 198
|
else //stampa a 198
|
||||||
{
|
{
|
||||||
set_header(r,FR("Registrazione Documento@61gMese@66gT Tipo@110gCod %c@132g%c T"), nd1, tipo);
|
set_header(r,FR("Registrazione Documento@61gMese@67gT Tipo@110gCod %c@132g%c T"), nd1, tipo);
|
||||||
if (_tipo_stampa == rif_giornale)
|
if (_tipo_stampa == rif_giornale)
|
||||||
set_header(r, FR("@139gNum."));
|
set_header(r, FR("@139gNum."));
|
||||||
r++;
|
r++;
|
||||||
@ -3038,6 +3026,7 @@ void TStampa_registri_app::preprocess_header()
|
|||||||
// set_header(r++, riga);
|
// set_header(r++, riga);
|
||||||
set_header(r++, "");
|
set_header(r++, "");
|
||||||
_totali_stampati = false;
|
_totali_stampati = false;
|
||||||
|
_totali_finali = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3045,26 +3034,34 @@ void TStampa_registri_app::preprocess_header()
|
|||||||
void TStampa_registri_app::preprocess_footer()
|
void TStampa_registri_app::preprocess_footer()
|
||||||
{
|
{
|
||||||
reset_footer();
|
reset_footer();
|
||||||
|
|
||||||
if (!_totali_stampati)
|
if (!_totali_stampati)
|
||||||
{
|
{
|
||||||
int r = 1;
|
int r = 1;
|
||||||
TString riga(_stampa_width);
|
TString riga(_stampa_width);
|
||||||
riga.fill('-');
|
riga.fill('-');
|
||||||
set_footer(r++, riga);
|
set_footer(r++, riga);
|
||||||
|
if (!_totali_finali)
|
||||||
|
{
|
||||||
if (_stampa_width == 132)
|
if (_stampa_width == 132)
|
||||||
set_footer(r++, FR("@0gTotale progressivi@70g%15s@85g%15s@107g%15s"),
|
set_footer(r++, FR("@0gTotale progressivi@70g%15s@85g%15s@107g%15s"),
|
||||||
_totdoc_prog.string(".2"), _totimpn_prog.string(".2"), _totimps_prog.string(".2"));
|
_totdoc_prog.string(".2"), _totimpn_prog.string(".2"), _totimps_prog.string(".2"));
|
||||||
|
else
|
||||||
if (_stampa_width == 198)
|
if (_stampa_width == 198)
|
||||||
set_footer(r++, FR("@0gTotale progressivi@78g%15s@93g%15s@116g%15s"),
|
set_footer(r++, FR("@0gTotale progressivi@78g%15s@93g%15s@116g%15s"),
|
||||||
_totdoc_prog.string(".2"), _totimpn_prog.string(".2"), _totimps_prog.string(".2"));
|
_totdoc_prog.string(".2"), _totimpn_prog.string(".2"), _totimps_prog.string(".2"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_stampa_width == 132)
|
||||||
|
set_footer(r++, FR("@0gTotale @70g%15s@85g%15s@107g%15s"),
|
||||||
|
_totdoc_prog.string(".2"), _totimpn_prog.string(".2"), _totimps_prog.string(".2"));
|
||||||
|
else
|
||||||
|
if (_stampa_width == 198)
|
||||||
|
set_footer(r++, FR("@0gTotale @78g%15s@93g%15s@116g%15s"),
|
||||||
|
_totdoc_prog.string(".2"), _totimpn_prog.string(".2"), _totimps_prog.string(".2"));
|
||||||
|
}
|
||||||
set_footer(r++, riga);
|
set_footer(r++, riga);
|
||||||
|
|
||||||
/* TString riga(_stampa_width, '-');
|
|
||||||
|
|
||||||
set_footer(r++, riga); */
|
|
||||||
riga = TR("Legenda Tipo Operazione: 1=intra; 2=AF art.34 comma 3");
|
riga = TR("Legenda Tipo Operazione: 1=intra; 2=AF art.34 comma 3");
|
||||||
if (_auto_intraf)
|
if (_auto_intraf)
|
||||||
riga << TR("; 3=intra e AF art.34 comma 3");
|
riga << TR("; 3=intra e AF art.34 comma 3");
|
||||||
@ -3074,11 +3071,8 @@ void TStampa_registri_app::preprocess_footer()
|
|||||||
if (_annoIVA >= 2015)
|
if (_annoIVA >= 2015)
|
||||||
riga << TR("; 6=Scissione pagamenti art.17 ter");
|
riga << TR("; 6=Scissione pagamenti art.17 ter");
|
||||||
set_footer(r++, riga);
|
set_footer(r++, riga);
|
||||||
|
|
||||||
_riporti = true;
|
|
||||||
}
|
}
|
||||||
else
|
_riporti = !_totali_finali;
|
||||||
_riporti = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampa_registri_app::on_page_printed(int file)
|
void TStampa_registri_app::on_page_printed(int file)
|
||||||
@ -3726,6 +3720,7 @@ bool TStampa_registri_app::set_print(int n)
|
|||||||
_rows_left = 69;
|
_rows_left = 69;
|
||||||
_riporti = false;
|
_riporti = false;
|
||||||
_totali_stampati = false;
|
_totali_stampati = false;
|
||||||
|
_totali_finali = false;
|
||||||
|
|
||||||
_annoIVA = m.get_int(ANNO);//in realta' e' l'anno IVA !!!
|
_annoIVA = m.get_int(ANNO);//in realta' e' l'anno IVA !!!
|
||||||
_tipo_stampa = (tipo_stampa) m.get_int(TIPO_STAMPA);
|
_tipo_stampa = (tipo_stampa) m.get_int(TIPO_STAMPA);
|
||||||
|
@ -50,7 +50,7 @@ class TStampa_registri_app : public TPrintapp
|
|||||||
bool _rif_vid, _intesta_vidi, _intesta_liq, _stampa_data_reg, _ok_vidi, _stampa_num_pag;
|
bool _rif_vid, _intesta_vidi, _intesta_liq, _stampa_data_reg, _ok_vidi, _stampa_num_pag;
|
||||||
bool _sosp_imposta, _riep_liq;
|
bool _sosp_imposta, _riep_liq;
|
||||||
bool _st_tot_fin;
|
bool _st_tot_fin;
|
||||||
bool _riporti, _totali_stampati;
|
bool _riporti, _totali_stampati, _totali_finali;
|
||||||
char _frequiva, _tipo_riepilogativo, _freq_riepilogo;
|
char _frequiva, _tipo_riepilogativo, _freq_riepilogo;
|
||||||
TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg;
|
TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg;
|
||||||
TDate _u_data;
|
TDate _u_data;
|
||||||
|
@ -20,6 +20,7 @@ IMPORTO|4|18|3|Importo
|
|||||||
IMPONIBILE|4|18|3|Imponibile
|
IMPONIBILE|4|18|3|Imponibile
|
||||||
IMPOSTA|4|18|3|Imposta
|
IMPOSTA|4|18|3|Imposta
|
||||||
CHIUSA|8|1|0|Partita chiusa
|
CHIUSA|8|1|0|Partita chiusa
|
||||||
2
|
3
|
||||||
NUMREG+NUMRIG+NUMPRO|
|
NUMREG+NUMRIG+NUMPRO|
|
||||||
ANNOLIQ+MESELIQ+DATAREGP|X
|
ANNOLIQ+MESELIQ+DATAREGP|X
|
||||||
|
DATAREGP+ANNOLIQ+MESELIQ|X
|
||||||
|
Loading…
x
Reference in New Issue
Block a user