Merge branch 'R_10_00' of http://10.65.20.33/sirio/CAMPO/campo into R_10_00

This commit is contained in:
Sirio Builder 2019-02-28 12:16:20 +01:00
commit 3d900b80e9
10 changed files with 18 additions and 88 deletions

View File

@ -79,7 +79,6 @@ void TRiepilogoIVA_app::main_loop()
{
damese = 1;
amese = 12;
recset->set_annuale(true);
}
const TDate da(1, damese, anno);

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);
TMask& msk = f.mask();
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);
app()._is_liq_acconto = (m == 20);
if (app()._is_liq_acconto)
m = 12;
const int m = (vers == 3) ? msk.get_int(CG43_LST_TRIM) : msk.get_int(CG43_LST_MESE);
const TRectype & lim = app().get_lim(m);
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_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)
{
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 (month > 3)
@ -788,11 +778,7 @@ bool TLiquidazione_app::chk_calculate_handler(TMask_field& f, KEY key)
TMask& m = f.mask();
// 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);
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 int mese = vers == 3 ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE);
const bool abilita = m.get_bool(CG43_CHK_CALCULATE) && mese != 13;
m.enable(CG43_LST_CALC, abilita);
}
@ -907,19 +893,10 @@ bool TLiquidazione_app::set_liquidazione()
// handlers have set everything
_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);
_date = m.get(CG43_FLD_DATA);
_isprint = m.get_bool(CG43_CHK_STAMPA);
_recalc = m.get_bool(CG43_CHK_CALCULATE) ? one : never;
_printonly = !m.get_bool(CG43_CHK_CALCULATE);
_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)
bool _lim_cleared;
bool _definitiva;
bool _is_liq_acconto;
bool _end_cassa;
real _diff_ven_ap, _diff_ven_ap_iva, _diff_acq_ap, _diff_acq_ap_iva;

View File

@ -27,16 +27,15 @@ BEGIN
CHECKTYPE REQUIRED
END
LIST CG43_LST_MESE 20
LIST CG43_LST_MESE 15
BEGIN
PROMPT 28 3 "Periodo "
HELP "Mese per cui effettuare il calcolo liquidazione"
ITEM "13|13a liquid."
ITEM "20|Acconto Dicembre"
FLAGS "MP"
END
LIST CG43_LST_TRIM 20
LIST CG43_LST_TRIM 15
BEGIN
PROMPT 28 3 "Periodo "
HELP "Trimestre di cui effettuare il calcolo liquidazione"
@ -45,7 +44,6 @@ BEGIN
ITEM "9|3 Trimestre "
ITEM "12|4 Trimestre"
ITEM "13|13a liquid."
ITEM "20|Acconto Dicembre"
END
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
ret = x <= 13;
}
}
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
{
if (month <= 12)
{
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));
}
return (regyear == year) && ((regmonth == month && liqmonth == 0) || (liqmonth == month));
else // Annuale, month == 13
return (regyear == year && liqmonth != 12) || (regyear == year + 1 && liqmonth == 12);
}

View File

@ -1440,9 +1440,6 @@ void TLiquidazione_app::set_firm(_DescrItem& d)
if (d._s2 == "T")
tim_title << format(FR(" del %d° Trimestre %s"), d._f1/3, (const char*) _year);
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);
}
@ -1504,9 +1501,6 @@ void TLiquidazione_app::set_att(_DescrItem& d)
if (d._s4 == "T")
tim_title << format(FR(" del %d° Trimestre %s"), d._f1 / 3, (const char*)_year);
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);
}

View File

@ -158,20 +158,18 @@ BEGIN
GROUP 3
END
LISTBOX FINO_A_MESE 20
LISTBOX FINO_A_MESE 10
BEGIN
PROMPT 3 9 "Fino al mese "
HELP "Mese fino al quale eseguire la stampa"
ITEM "20|Acconto di dicembre"
FLAGS "M"
GROUP 1
END
LISTBOX MESE 20
LISTBOX MESE 10
BEGIN
PROMPT 3 9 "Mese "
HELP "Mese di cui eseguire la stampa"
ITEM "20|Acconto di dicembre"
FLAGS "M"
GROUP 2
END

View File

@ -125,8 +125,6 @@ void TRiepilogoIVA_app::main_loop()
recset->set_registrazioneIVAritardo(m.get_bool(F_REGRIT));
recset->set_from(m.get_date(F_DADATA));
recset->set_to(m.get_date(F_ADATA));
recset->set_annuale((m.get_date(F_DADATA).month() == 1) && (m.get_date(F_ADATA).month() == 12)
);
recset->set_from_conto(m.get_long(F_DAGRUPPO), m.get_long(F_DACONTO), m.get_long(F_DASOTTOC));
if (m.get_long(F_DAGRUPPO) != 0)

View File

@ -1,16 +1,4 @@
#include "cglib05.h"
#include <utility.h>
enum tiporeg {
vendita = 1,
acquisto = 2,
riepilogativo = 3,
incassi = 4,
giornale = 5,
sociale = 6,
cespiti = 7
};
///////////////////////////////////////////////////////////
// TRiepilogoIVA_recordset
///////////////////////////////////////////////////////////
@ -63,7 +51,7 @@ void TRiepilogoIVA_recordset::requery()
TAssoc_array work_array;
TString16 reg_fieldname; reg_fieldname << LF_MOV << "." << MOV_REG;
TString16 datareg_fieldname; datareg_fieldname << LF_MOV << "." << MOV_DATAREG;
TString16 datadoc_fieldname; datadoc_fieldname << LF_MOV << "." << MOV_DATADOC;
TString16 datacomp_fieldname; datacomp_fieldname << LF_MOV << "." << MOV_MESELIQ;
TString16 meseliq_fieldname; meseliq_fieldname << LF_MOV << "." << MOV_MESELIQ;
int p = wrk.find("FROMDATE");
@ -126,19 +114,7 @@ void TRiepilogoIVA_recordset::requery()
}
if (registrazioneIVAritardo())
{
const TDate datadoc = recset.get(datadoc_fieldname).as_date();
const TString4 codreg = recset.get(reg_fieldname).as_string();
const TRegistro reg(codreg);
const TipoIVA tipo = reg.iva(); // 1=Vendite; 2=Acquisti
const bool fatt_rit_2018 = recset.get(TOSTRING(LF_MOV) "." MOV_DATAREG).as_bool() && (data.year() >= 2018);
const int year_diff = data.year() - datadoc.year();
const bool fattritind = ((tipo == iva_acquisti) && fatt_rit_2018) &&
((year_diff > 2) || ((year_diff >= 1) && data.month() >= 5));
const bool fattrit = ((tipo == iva_acquisti) && !fattritind && fatt_rit_2018) && (year_diff >= 1);
if (fattrit && !annuale() && _to_date.year() == datadoc.year())
continue;
TDate datacomp = recset.get(datacomp_fieldname).as_date();
}
if (senzacompetenzaIVA() && (data < _from_date || data > _to_date))
continue;
@ -299,9 +275,9 @@ const TVariant& TRiepilogoIVA_recordset::get(unsigned int column) const
}
TRiepilogoIVA_recordset::TRiepilogoIVA_recordset() : TRecordset(), _pos(0), _from_date(botime), _to_date(eotime),
_from_gruppo(0), _from_conto(0), _from_sottoconto(0L),
_to_gruppo(999), _to_conto(999), _to_sottoconto(999999L), _freezed(false), _annuale(false)
_from_gruppo(0), _from_conto(0), _from_sottoconto(0L),
_to_gruppo(999), _to_conto(999), _to_sottoconto(999999L),
_freezed(false)
{
add_field(_alfafld, 101, 4, COD);
add_field(_alfafld, 102, 50, DESC);

View File

@ -32,7 +32,6 @@ class TRiepilogoIVA_recordset : public TRecordset
long _to_sottoconto;
TArray _info;
bool _freezed;
bool _annuale;
protected:
virtual const TVariant& get_field(int num, const char* field) const;
@ -60,11 +59,9 @@ public:
virtual bool set_senzacompetenzaIVA(bool on) { return true; }
virtual bool set_competenzadiversaIVA(bool on) { return false; }
virtual bool set_registrazioneIVAritardo(bool on) { return false; }
virtual bool set_annuale(bool on) { _annuale = on; return _annuale; }
virtual bool senzacompetenzaIVA() const { return true; }
virtual bool competenzadiversaIVA() const { return false; }
virtual bool registrazioneIVAritardo() const { return false; }
virtual bool annuale() const { return _annuale; }
virtual bool senzacompetenzaIVA() { return true; }
virtual bool competenzadiversaIVA() { return false; }
virtual bool registrazioneIVAritardo() { return false; }
TRiepilogoIVA_recordset();
virtual ~TRiepilogoIVA_recordset() { }