Patch level : 12.0 562
Files correlati : cg4.exe Modificata la liquidazione delle fatture in ritardo Aggiunta la gestione dell'uscita dal regime di cassa git-svn-id: svn://10.65.10.50/branches/R_10_00@24460 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a494d167aa
commit
8664c36a2a
@ -1765,13 +1765,13 @@ void TMastrini_grid::cell_request(long rec, short id, TGrid_cell& cell)
|
|||||||
TString descr = rmov.get(RMV_DESCR);
|
TString descr = rmov.get(RMV_DESCR);
|
||||||
if (riga.tipo() == riga_mastrino)
|
if (riga.tipo() == riga_mastrino)
|
||||||
{
|
{
|
||||||
if (descr.empty())
|
if (descr.blank())
|
||||||
{
|
{
|
||||||
const TRectype& mov = _mastrino.testata(rec);
|
const TRectype& mov = _mastrino.testata(rec);
|
||||||
descr = mov.get(MOV_DESCR);
|
descr = mov.get(MOV_DESCR);
|
||||||
if (descr.empty())
|
if (descr.blank())
|
||||||
{
|
{
|
||||||
TBill uncle(rmov,true);
|
TBill uncle(rmov);
|
||||||
descr = uncle.descrizione();
|
descr = uncle.descrizione();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1779,7 +1779,7 @@ void TMastrini_grid::cell_request(long rec, short id, TGrid_cell& cell)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Bug 0001748: ignora descrizioni generate da contabilizzazione
|
// Bug 0001748: ignora descrizioni generate da contabilizzazione
|
||||||
if (descr.empty() || descr == _mastrino.conto().descrizione())
|
if (descr.blank() || descr == _mastrino.conto().descrizione())
|
||||||
{
|
{
|
||||||
const TBill conto(rmov);
|
const TBill conto(rmov);
|
||||||
descr = conto.descrizione();
|
descr = conto.descrizione();
|
||||||
|
@ -591,7 +591,8 @@ public:
|
|||||||
void set_pim_head(_DescrItem& d);
|
void set_pim_head(_DescrItem& d);
|
||||||
// void set_liqacc_1999(_DescrItem& d);
|
// void set_liqacc_1999(_DescrItem& d);
|
||||||
|
|
||||||
int print_acc_diff_xcassa(const _DescrItem& d);
|
// int calc_inc_diff(int tipoiva, real& imponibile_diff, real& imposta_diff, real& imponibile_xcas, real& imposta_xcas);
|
||||||
|
int print_acc_diff_xcassa(const _DescrItem& d);
|
||||||
void set_liqacc_2000(_DescrItem& d);
|
void set_liqacc_2000(_DescrItem& d);
|
||||||
|
|
||||||
// Utility per stampare nella colonna debito o credito
|
// Utility per stampare nella colonna debito o credito
|
||||||
|
@ -1077,8 +1077,26 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
const TDate inizio(fromdate - 1L);
|
const TDate inizio(fromdate - 1L);
|
||||||
|
|
||||||
TDate todate(1, month == 13 ? 12 : month, year_int);
|
TDate todate(1, month == 13 ? 12 : month, year_int);
|
||||||
|
TDate data_rif_cassa(todate);
|
||||||
|
TDate fine(todate);
|
||||||
|
|
||||||
|
if (year_int >= 2017 && month == 13)
|
||||||
|
{
|
||||||
|
todate.set_month(4);
|
||||||
|
todate.set_year(year_int + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
data_rif_cassa.set_end_month();
|
||||||
|
if (_is_liq_acconto)
|
||||||
|
{
|
||||||
|
todate.set_day(t.day());
|
||||||
|
fine.set_day(t.day());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
todate.set_end_month();
|
todate.set_end_month();
|
||||||
const TDate fine(todate);
|
fine.set_end_month();
|
||||||
|
}
|
||||||
|
|
||||||
from.put(MOV_REG, fromreg);
|
from.put(MOV_REG, fromreg);
|
||||||
to.put(MOV_REG, toreg);
|
to.put(MOV_REG, toreg);
|
||||||
@ -1120,6 +1138,21 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
pimsg << TR("mese ") << itom(month);
|
pimsg << TR("mese ") << itom(month);
|
||||||
pimsg << ' ' << year_int << ')';
|
pimsg << ' ' << year_int << ')';
|
||||||
|
|
||||||
|
const TRectype & lia = get_lia();
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
if (!end_cassa && month > 11)
|
||||||
|
{
|
||||||
|
data_end_cassa = eotime;
|
||||||
|
const TRectype & lia = get_lia(0, false, year_int + 1);
|
||||||
|
|
||||||
|
end_cassa = !lia.get_bool("B5");
|
||||||
|
if (end_cassa)
|
||||||
|
data_end_cassa = data_rif_cassa;
|
||||||
|
}
|
||||||
|
|
||||||
TProgress_monitor pi(items, pimsg, false);
|
TProgress_monitor pi(items, pimsg, false);
|
||||||
for (; _cur->pos() < items; ++(*_cur))
|
for (; _cur->pos() < items; ++(*_cur))
|
||||||
{
|
{
|
||||||
@ -1128,7 +1161,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
|
|
||||||
TDate date = _mov->get(MOV_DATAREG);
|
TDate date = _mov->get(MOV_DATAREG);
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
const long nr = _mov->get_long(MOV_NUMREG);
|
long nr = _mov->get_long(MOV_NUMREG);
|
||||||
|
|
||||||
if (nr == 1931434 || nr == 1931437)
|
if (nr == 1931434 || nr == 1931437)
|
||||||
int i = 1;
|
int i = 1;
|
||||||
@ -1159,7 +1192,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
const TRectype& rcs = _cur->curr(LF_CAUSALI);
|
const TRectype& rcs = _cur->curr(LF_CAUSALI);
|
||||||
const TDate datareg = _mov->get_date(MOV_DATAREG);
|
const TDate datareg = _mov->get_date(MOV_DATAREG);
|
||||||
const TDate datadoc = _mov->get_date(MOV_DATADOC);
|
const TDate datadoc = _mov->get_date(MOV_DATADOC);
|
||||||
const bool fatt_rit_2018 = atoi(_year) >= 2018 && _mov->get_bool(MOV_RITFATT);
|
const bool fatt_rit_2018 = _mov->get_bool(MOV_RITFATT) && (datareg.year() >= 2018);
|
||||||
const int year_diff = datareg.year() - datadoc.year();
|
const int year_diff = datareg.year() - datadoc.year();
|
||||||
const bool dataritind = ((tipomov == acquisto) && fatt_rit_2018) &&
|
const bool dataritind = ((tipomov == acquisto) && fatt_rit_2018) &&
|
||||||
((year_diff > 2) || ((year_diff >= 1) && datareg.month() >= 5));
|
((year_diff > 2) || ((year_diff >= 1) && datareg.month() >= 5));
|
||||||
@ -1208,11 +1241,13 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
TPointer_array pagscatt; // Righe di pagsca interessate
|
TPointer_array pagscatt; // Righe di pagsca interessate
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
if (nr == 1931434 || nr == 1931437)
|
nr = _mov->get_long(MOV_NUMREG);
|
||||||
int i = 1;
|
|
||||||
|
if (nr == 27891)
|
||||||
|
int i = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fattrit && _month == 5)
|
if (fattrit && _month == 13)
|
||||||
dok = true;
|
dok = true;
|
||||||
|
|
||||||
if (bIsMovDiff && tm == tm_fattura)
|
if (bIsMovDiff && tm == tm_fattura)
|
||||||
@ -1268,7 +1303,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (iva_diff || sarebbe_maturata(_mov->curr(), inizio+1L, fine))
|
if (iva_diff || sarebbe_maturata(_mov->curr(), inizio+1L, fine) || end_cassa)
|
||||||
{
|
{
|
||||||
TPointer_array pagscaold;
|
TPointer_array pagscaold;
|
||||||
TImporto pg_tot, nc_tot;
|
TImporto pg_tot, nc_tot;
|
||||||
@ -1335,7 +1370,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))
|
if (sarebbe_maturata(_mov->curr(), inizio+1L, fine) || end_cassa)
|
||||||
tot_da_incassare = _mov->get_real(MOV_TOTDOC);
|
tot_da_incassare = _mov->get_real(MOV_TOTDOC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1345,6 +1380,11 @@ 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 (end_cassa)
|
||||||
|
{
|
||||||
|
if (!datainc.ok() || datainc > data_end_cassa)
|
||||||
|
datainc = data_end_cassa;
|
||||||
|
}
|
||||||
_mov->put(MOV_DATAINC, datainc);
|
_mov->put(MOV_DATAINC, datainc);
|
||||||
if (datainc < date)
|
if (datainc < date)
|
||||||
datainc = date;
|
datainc = date;
|
||||||
@ -1784,7 +1824,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
|
|
||||||
// Cumula l'ammontare delle operazioni attive/passive
|
// Cumula l'ammontare delle operazioni attive/passive
|
||||||
// per la dichiarazione annuale dati iva e quadro VT
|
// per la dichiarazione annuale dati iva e quadro VT
|
||||||
if (month == 13 && !fattrit)
|
if (month == 13)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (tipomov == vendita)
|
if (tipomov == vendita)
|
||||||
@ -1975,7 +2015,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Le fatture in ritardo non vanno considerate nel periodo ma solo nell'annuale
|
// Le fatture in ritardo non vanno considerate nel periodo ma solo nell'annuale
|
||||||
if (_year >= 2018 && fattrit && _month == 5)
|
if (_year >= 2018 && fattrit && _month == 13)
|
||||||
cred_fattrit += imposta;
|
cred_fattrit += imposta;
|
||||||
else
|
else
|
||||||
if (!fattrit || (fattrit && _month == 13)) // normale
|
if (!fattrit || (fattrit && _month == 13)) // normale
|
||||||
@ -2362,10 +2402,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
vendite += imponibile;
|
vendite += imponibile;
|
||||||
vendite_iva += imposta;
|
vendite_iva += imposta;
|
||||||
}
|
}
|
||||||
else if (tipomov == acquisto && (liq || fattrit && month == 13))
|
else if (tipomov == acquisto && (liq || (fattrit && month == 13)))
|
||||||
{
|
{
|
||||||
// totale acquisti
|
// totale acquisti
|
||||||
acquisti += imponibile;
|
acquisti += imponibile;
|
||||||
acquisti_iva += imposta;
|
acquisti_iva += imposta;
|
||||||
|
|
||||||
// Controlla se la data del documento si riferisce all'anno precedente (PRORATA 1998)
|
// Controlla se la data del documento si riferisce all'anno precedente (PRORATA 1998)
|
||||||
|
@ -2355,7 +2355,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
real corrval = mov.get_real(MOV_CORRVALUTA);
|
real corrval = mov.get_real(MOV_CORRVALUTA);
|
||||||
const bool autof = caus.get_bool(CAU_AUTOFATT);
|
const bool autof = caus.get_bool(CAU_AUTOFATT);
|
||||||
const tiporeg tipomov = (tiporeg)_tabreg->get_int("I0"); // 1=Vendite; 2=Acquisti
|
const tiporeg tipomov = (tiporeg)_tabreg->get_int("I0"); // 1=Vendite; 2=Acquisti
|
||||||
const bool fatt_rit_2018 = _annoIVA >= 2018 && mov.get_bool(MOV_RITFATT);
|
const bool fatt_rit_2018 = _datareg.year() >= 2018 && mov.get_bool(MOV_RITFATT);
|
||||||
const int year_diff = _datareg.year() - datadoc.year();
|
const int year_diff = _datareg.year() - datadoc.year();
|
||||||
const bool dataritind = ((tipomov == acquisto) && fatt_rit_2018) &&
|
const bool dataritind = ((tipomov == acquisto) && fatt_rit_2018) &&
|
||||||
((year_diff > 2) || ((year_diff >= 1) && _datareg.month() >= 5));
|
((year_diff > 2) || ((year_diff >= 1) && _datareg.month() >= 5));
|
||||||
|
@ -107,7 +107,7 @@ BOOLEAN F_GESIC
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 7 "Gestione IVA per cassa"
|
PROMPT 4 7 "Gestione IVA per cassa"
|
||||||
FIELD B5
|
FIELD B5
|
||||||
MESSAGE FALSE DISABLE,F_ICDAL|DISABLE,F_ICAL
|
MESSAGE FALSE CLEAR,F_ICDAL|CLEAR,F_ICAL
|
||||||
MESSAGE TRUE ENABLE,F_ICDAL|ENABLE,F_ICAL
|
MESSAGE TRUE ENABLE,F_ICDAL|ENABLE,F_ICAL
|
||||||
MODULE IC
|
MODULE IC
|
||||||
END
|
END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user