Patch level : 12.0 no-patch

Files correlati     : cg
Commento            :
Ripristinata versione precedente
This commit is contained in:
AlexBonazzi 2019-02-13 17:42:52 +01:00
parent 60b8437b9c
commit 11c75dbf2e
5 changed files with 8 additions and 46 deletions

View File

@ -586,15 +586,10 @@ bool TLiquidazione_app::ch_year_handler(TMask_field& f, KEY key)
(wht)f.mask().get_int(CG43_RDB_VERS) : all); (wht)f.mask().get_int(CG43_RDB_VERS) : all);
TMask& msk = f.mask(); TMask& msk = f.mask();
const int vers = msk.get_int(CG43_RDB_VERS); const int vers = msk.get_int(CG43_RDB_VERS);
int m = (vers == 3) ? msk.get_int(CG43_LST_TRIM) : msk.get_int(CG43_LST_MESE); const int m = (vers == 3) ? msk.get_int(CG43_LST_TRIM) : msk.get_int(CG43_LST_MESE);
app()._is_liq_acconto = (m == 20);
if (app()._is_liq_acconto)
m = 12;
const TRectype & lim = app().get_lim(m); const TRectype & lim = app().get_lim(m);
const bool def = lim.get_bool("B1"); const bool def = lim.get_bool("B1");
const bool calc = app()._is_liq_acconto || (!def && (lim.empty() || lim.get_bool("B0"))); const bool calc = !def && (lim.empty() || lim.get_bool("B0"));
msk.set(CG43_CHK_CALCULATE, app()._lim_cleared && calc, 0x3); msk.set(CG43_CHK_CALCULATE, app()._lim_cleared && calc, 0x3);
msk.set(CG43_CHK_FINAL, app()._lim_cleared && def, 0x3); msk.set(CG43_CHK_FINAL, app()._lim_cleared && def, 0x3);
@ -695,11 +690,6 @@ bool TLiquidazione_app::what_freq_handler(TMask_field& f, KEY key)
if (key == K_SPACE) if (key == K_SPACE)
{ {
int month = f.mask().get_int(CG43_LST_MESE); int month = f.mask().get_int(CG43_LST_MESE);
app()._is_liq_acconto = (month == 20);
if (app()._is_liq_acconto)
month = 12;
if (f.get()[0] == '3') // trimestre intelligente if (f.get()[0] == '3') // trimestre intelligente
{ {
if (month > 3) if (month > 3)
@ -788,11 +778,7 @@ bool TLiquidazione_app::chk_calculate_handler(TMask_field& f, KEY key)
TMask& m = f.mask(); TMask& m = f.mask();
// Abilita solo se il mese di ricalcolo e' != 13 (annuale) e non e' checkkato il campo // Abilita solo se il mese di ricalcolo e' != 13 (annuale) e non e' checkkato il campo
const int vers = m.get_int(CG43_RDB_VERS); const int vers = m.get_int(CG43_RDB_VERS);
int mese = vers == 3 ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE); const int mese = vers == 3 ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE);
app()._is_liq_acconto = (mese == 20);
if (app()._is_liq_acconto)
mese = 12;
const bool abilita = m.get_bool(CG43_CHK_CALCULATE) && mese != 13; const bool abilita = m.get_bool(CG43_CHK_CALCULATE) && mese != 13;
m.enable(CG43_LST_CALC, abilita); m.enable(CG43_LST_CALC, abilita);
} }
@ -907,19 +893,10 @@ bool TLiquidazione_app::set_liquidazione()
// handlers have set everything // handlers have set everything
_month = _what == trimestre ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE); _month = _what == trimestre ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE);
app()._is_liq_acconto = (_month == 20);
if (app()._is_liq_acconto)
{
_month = 12;
_recalc = one;
}
else
_recalc = m.get_bool(CG43_CHK_CALCULATE) ? one : never;
_year = m.get(CG43_FLD_ANNO); _year = m.get(CG43_FLD_ANNO);
_date = m.get(CG43_FLD_DATA); _date = m.get(CG43_FLD_DATA);
_isprint = m.get_bool(CG43_CHK_STAMPA); _isprint = m.get_bool(CG43_CHK_STAMPA);
_recalc = m.get_bool(CG43_CHK_CALCULATE) ? one : never;
_printonly = !m.get_bool(CG43_CHK_CALCULATE); _printonly = !m.get_bool(CG43_CHK_CALCULATE);
_definitiva = m.get_bool(CG43_CHK_FINAL); _definitiva = m.get_bool(CG43_CHK_FINAL);

View File

@ -304,7 +304,6 @@ 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 _is_liq_acconto;
bool _end_cassa; 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;

View File

@ -27,16 +27,15 @@ BEGIN
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END
LIST CG43_LST_MESE 20 LIST CG43_LST_MESE 15
BEGIN BEGIN
PROMPT 28 3 "Periodo " PROMPT 28 3 "Periodo "
HELP "Mese per cui effettuare il calcolo liquidazione" HELP "Mese per cui effettuare il calcolo liquidazione"
ITEM "13|13a liquid." ITEM "13|13a liquid."
ITEM "20|Acconto Dicembre"
FLAGS "MP" FLAGS "MP"
END END
LIST CG43_LST_TRIM 20 LIST CG43_LST_TRIM 15
BEGIN BEGIN
PROMPT 28 3 "Periodo " PROMPT 28 3 "Periodo "
HELP "Trimestre di cui effettuare il calcolo liquidazione" HELP "Trimestre di cui effettuare il calcolo liquidazione"
@ -45,7 +44,6 @@ BEGIN
ITEM "9|3 Trimestre " ITEM "9|3 Trimestre "
ITEM "12|4 Trimestre" ITEM "12|4 Trimestre"
ITEM "13|13a liquid." ITEM "13|13a liquid."
ITEM "20|Acconto Dicembre"
END END
BOOLEAN CG43_CHK_CALCULATE BOOLEAN CG43_CHK_CALCULATE

View File

@ -57,8 +57,7 @@ bool TLiquidazione_app::is_month_ok(int x, int mtocalc) const
{ {
// per l'annuale ritorna true per tutti i mesi da liquidare // per l'annuale ritorna true per tutti i mesi da liquidare
ret = x <= 13; ret = x <= 13;
} }
return ret; return ret;
} }
@ -139,12 +138,7 @@ bool TLiquidazione_app::is_date_ok(const TDate& d, int month, int liqmonth, int
else // Nuova selezione dal 1998 in poi else // Nuova selezione dal 1998 in poi
{ {
if (month <= 12) if (month <= 12)
{ return (regyear == year) && ((regmonth == month && liqmonth == 0) || (liqmonth == month));
if (_is_liq_acconto)
return (regyear == year) && ((regmonth == month && liqmonth == 0) || (liqmonth == month)) && (d.day() <= _ver->giorno_acc());
else
return (regyear == year) && ((regmonth == month && liqmonth == 0) || (liqmonth == month));
}
else // Annuale, month == 13 else // Annuale, month == 13
return (regyear == year && liqmonth != 12) || (regyear == year + 1 && liqmonth == 12); return (regyear == year && liqmonth != 12) || (regyear == year + 1 && liqmonth == 12);
} }

View File

@ -1439,9 +1439,6 @@ void TLiquidazione_app::set_firm(_DescrItem& d)
if (d._s2 == "T") if (d._s2 == "T")
tim_title << format(FR(" del %d° Trimestre %s"), d._f1/3, (const char*) _year); tim_title << format(FR(" del %d° Trimestre %s"), d._f1/3, (const char*) _year);
else else
if (_is_liq_acconto)
tim_title << format(FR(" al %d %s %s"), _ver->giorno_acc(), itom(d._f1), (const char*)_year);
else
tim_title << format(FR(" del mese di %s %s"), itom(d._f1), (const char*)_year); tim_title << format(FR(" del mese di %s %s"), itom(d._f1), (const char*)_year);
} }
@ -1503,9 +1500,6 @@ void TLiquidazione_app::set_att(_DescrItem& d)
if (d._s4 == "T") if (d._s4 == "T")
tim_title << format(FR(" del %d° Trimestre %s"), d._f1 / 3, (const char*)_year); tim_title << format(FR(" del %d° Trimestre %s"), d._f1 / 3, (const char*)_year);
else else
if (_is_liq_acconto)
tim_title << format(FR(" al %d %s %s"), _ver->giorno_acc(), itom(d._f1), (const char*)_year);
else
tim_title << format(FR(" del mese di %s %s"), itom(d._f1), (const char*)_year); tim_title << format(FR(" del mese di %s %s"), itom(d._f1), (const char*)_year);
} }