Implementazione del PIM13 (finalmente): migliorata gestione ventilazione
e corrispettivi. Cambiato nome da _BolgArray/_BolgItem (veramente poco significativo) in _Iva11Array/Iva11Item. Migliorata l'indentazione in cg4301.cpp. Tolte alcune istruzioni commentate ed oramai fossilizzate da secoli. git-svn-id: svn://10.65.10.50/trunk@5425 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c1f7bec192
commit
773c181813
@ -297,7 +297,7 @@ void TProgressivi_iva::look_pim()
|
|||||||
if (anno != _anno) continue;
|
if (anno != _anno) continue;
|
||||||
|
|
||||||
if (_st_inizio_anno)
|
if (_st_inizio_anno)
|
||||||
if (mese > _mese)
|
if ((mese > _mese) || (_mese == 13 && mese < 13))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!_st_inizio_anno)
|
if (!_st_inizio_anno)
|
||||||
|
@ -33,8 +33,8 @@ int main(int argc,char** argv)
|
|||||||
default:
|
default:
|
||||||
error_box(usage, argv[0]);
|
error_box(usage, argv[0]);
|
||||||
}
|
}
|
||||||
|
exit(0);
|
||||||
return n < 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,33 +17,32 @@
|
|||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
|
|
||||||
|
|
||||||
// Methods of _BolgArray
|
// Methods of _Iva11Array
|
||||||
bool _BolgArray::add(const real& val, const char* fld_name, int num_file)
|
bool _Iva11Array::add(const real& val, const char* fld_name, int num_file)
|
||||||
{
|
{
|
||||||
_BolgItem bolg;
|
_Iva11Item iva11;
|
||||||
const bool is_key = TAssoc_array::is_key(fld_name);
|
const bool is_key = TAssoc_array::is_key(fld_name);
|
||||||
_BolgItem& bi = is_key ? (_BolgItem&)find(fld_name) : bolg;
|
_Iva11Item& bi = is_key ? (_Iva11Item&)find(fld_name) : iva11;
|
||||||
bi.value() += val;
|
bi.value() += val;
|
||||||
if (num_file != LF_TAB1100A) bi.file() = num_file;
|
if (num_file != LF_TAB1100A) bi.file() = num_file;
|
||||||
return TAssoc_array::add(fld_name,bi,is_key);
|
return TAssoc_array::add(fld_name,bi,is_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _BolgArray::sub(const real& val, const char* fld_name, int num_file)
|
bool _Iva11Array::sub(const real& val, const char* fld_name, int num_file)
|
||||||
{
|
{
|
||||||
const real v1 = val * (-1.0);
|
const real v1 = val * (-1.0);
|
||||||
return add(v1,fld_name, num_file);
|
return add(v1,fld_name, num_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _BolgArray::zero(const char* fld_name)
|
void _Iva11Array::zero(const char* fld_name)
|
||||||
{
|
{
|
||||||
_BolgItem bolg;
|
_Iva11Item iva11;
|
||||||
const bool is_key = TAssoc_array::is_key(fld_name);
|
const bool is_key = TAssoc_array::is_key(fld_name);
|
||||||
_BolgItem& bi = is_key ? (_BolgItem&)find(fld_name) : bolg;
|
_Iva11Item& bi = is_key ? (_Iva11Item&)find(fld_name) : iva11;
|
||||||
bi.value() = 0.0;
|
bi.value() = 0.0;
|
||||||
TAssoc_array::add(fld_name,bi,is_key);
|
TAssoc_array::add(fld_name,bi,is_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Methods of application!
|
// Methods of application!
|
||||||
real TLiquidazione_app::CENTO(100.0);
|
real TLiquidazione_app::CENTO(100.0);
|
||||||
|
|
||||||
@ -422,10 +421,8 @@ bool TLiquidazione_app::set_print(int)
|
|||||||
break;
|
break;
|
||||||
case 2: // estrazione deleghe
|
case 2: // estrazione deleghe
|
||||||
_isprint = FALSE;
|
_isprint = FALSE;
|
||||||
//12/12/1995
|
|
||||||
_selected.reset();
|
_selected.reset();
|
||||||
_ditte->check(-1, FALSE);
|
_ditte->check(-1, FALSE);
|
||||||
//fine
|
|
||||||
build_ditte_sheet(all);
|
build_ditte_sheet(all);
|
||||||
while (set_deleghe())
|
while (set_deleghe())
|
||||||
{
|
{
|
||||||
@ -449,10 +446,8 @@ bool TLiquidazione_app::set_print(int)
|
|||||||
case 3: // calcolo acconto
|
case 3: // calcolo acconto
|
||||||
_isprint = TRUE;
|
_isprint = TRUE;
|
||||||
_month = 12;
|
_month = 12;
|
||||||
//12/12/1995
|
|
||||||
_selected.reset();
|
_selected.reset();
|
||||||
_ditte->check(-1, FALSE);
|
_ditte->check(-1, FALSE);
|
||||||
//fine
|
|
||||||
build_ditte_sheet(all);
|
build_ditte_sheet(all);
|
||||||
real inf; real ina; // cotale obbrobrio non fu da me cercato, ne' mai condiviso
|
real inf; real ina; // cotale obbrobrio non fu da me cercato, ne' mai condiviso
|
||||||
while (set_acconto(inf, ina))
|
while (set_acconto(inf, ina))
|
||||||
@ -635,26 +630,6 @@ bool TLiquidazione_app::what_freq_handler(TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TLiquidazione_app::lst_tm_handler(TMask_field& f, KEY key)
|
|
||||||
{
|
|
||||||
if (key == K_SPACE)
|
|
||||||
{
|
|
||||||
TString s(f.get());
|
|
||||||
if (s == "13")
|
|
||||||
{
|
|
||||||
f.mask().field(CG43_LST_CALC_13A).show();
|
|
||||||
f.mask().field(CG43_LST_CALC).hide();
|
|
||||||
f.mask().field(CG43_LST_CALC).set("3");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
f.mask().field(CG43_LST_CALC_13A).hide();
|
|
||||||
f.mask().field(CG43_LST_CALC).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TLiquidazione_app::select_button(TMask_field& f, KEY key)
|
bool TLiquidazione_app::select_button(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE)
|
||||||
@ -748,8 +723,6 @@ bool TLiquidazione_app::set_liquidazione()
|
|||||||
m.set_handler(CG43_FLD_DFR, fr_ditt_handler);
|
m.set_handler(CG43_FLD_DFR, fr_ditt_handler);
|
||||||
m.set_handler(CG43_RDB_VERS, what_freq_handler);
|
m.set_handler(CG43_RDB_VERS, what_freq_handler);
|
||||||
m.set_handler(CG43_FLD_ANNO, ch_year_handler);
|
m.set_handler(CG43_FLD_ANNO, ch_year_handler);
|
||||||
m.set_handler(CG43_LST_MESE, lst_tm_handler);
|
|
||||||
m.set_handler(CG43_LST_TRIM, lst_tm_handler);
|
|
||||||
m.set_handler(CG43_BUT_SEL, select_button);
|
m.set_handler(CG43_BUT_SEL, select_button);
|
||||||
m.set_handler(CG43_BUT_ANN, reset_button);
|
m.set_handler(CG43_BUT_ANN, reset_button);
|
||||||
|
|
||||||
|
23
cg/cg4300.h
23
cg/cg4300.h
@ -175,31 +175,30 @@ public:
|
|||||||
virtual ~_ErrItem() {}
|
virtual ~_ErrItem() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// _BolgItem e' una contrazione di Bolgia, serve per memorizzare gli elementi
|
// _Iva11Item serve per memorizzare gli elementi da trasferire su tab1100
|
||||||
// da trasferire su tab1100
|
class _Iva11Item : public TObject
|
||||||
class _BolgItem : public TObject
|
|
||||||
{
|
{
|
||||||
real _value;
|
real _value;
|
||||||
int _file;
|
int _file;
|
||||||
public:
|
public:
|
||||||
virtual TObject* dup() const { return new _BolgItem(*this); }
|
virtual TObject* dup() const { return new _Iva11Item(*this); }
|
||||||
real& value() { return _value; }
|
real& value() { return _value; }
|
||||||
int& file() { return _file; }
|
int& file() { return _file; }
|
||||||
void zero() { _value = 0.0; _file = LF_TAB1100A; }
|
void zero() { _value = 0.0; _file = LF_TAB1100A; }
|
||||||
_BolgItem() { _file = LF_TAB1100A; }
|
_Iva11Item() { _file = LF_TAB1100A; }
|
||||||
virtual ~_BolgItem() {}
|
virtual ~_Iva11Item() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Definisco solo i metodi add e sub, per aggiungere elementi _BolgItem
|
// Definisco solo i metodi add e sub, per aggiungere elementi _Iva11Item
|
||||||
// per il resto e' un normalissimo TAssoc_array
|
// per il resto e' un normalissimo TAssoc_array
|
||||||
class _BolgArray : public TAssoc_array
|
class _Iva11Array : public TAssoc_array
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool add(const real& val, const char* fld_name, int num_file = LF_TAB1100A);
|
bool add(const real& val, const char* fld_name, int num_file = LF_TAB1100A);
|
||||||
bool sub(const real& val, const char* fld_name, int num_file = LF_TAB1100A);
|
bool sub(const real& val, const char* fld_name, int num_file = LF_TAB1100A);
|
||||||
void zero(const char* fld_name);
|
void zero(const char* fld_name);
|
||||||
_BolgArray() {}
|
_Iva11Array() {}
|
||||||
virtual ~_BolgArray() {}
|
virtual ~_Iva11Array() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
@ -264,7 +263,7 @@ class TLiquidazione_app : public TPrint_application
|
|||||||
TAssoc_array _reg_arr; // cache dei registri.
|
TAssoc_array _reg_arr; // cache dei registri.
|
||||||
TAssoc_array _iva11_arr; // array contenente le informazioni da trasferire.
|
TAssoc_array _iva11_arr; // array contenente le informazioni da trasferire.
|
||||||
// La chiave di ordinamento e' sul codice attivita'.
|
// La chiave di ordinamento e' sul codice attivita'.
|
||||||
// Ogni elemento dell'array e' un _BolgArray
|
// Ogni elemento dell'array e' un _Iva11Array
|
||||||
// La cui chiave e' a sua volta sul nome campo
|
// La cui chiave e' a sua volta sul nome campo
|
||||||
|
|
||||||
// totali vari per attivita'
|
// totali vari per attivita'
|
||||||
@ -283,7 +282,7 @@ class TLiquidazione_app : public TPrint_application
|
|||||||
TCursor* _cur;
|
TCursor* _cur;
|
||||||
|
|
||||||
// files, tables
|
// files, tables
|
||||||
TRelation* _tab11; // un giorno tab1100a e tab1100b sarano un unico file!
|
TRelation* _tab11; // un giorno tab1100a e tab1100b saranno un unico file!
|
||||||
TRelation* _nditte;
|
TRelation* _nditte;
|
||||||
TLocalisamfile* _mov;
|
TLocalisamfile* _mov;
|
||||||
TLocalisamfile* _rmoviva;
|
TLocalisamfile* _rmoviva;
|
||||||
|
234
cg/cg4301.cpp
234
cg/cg4301.cpp
@ -76,15 +76,6 @@ bool TLiquidazione_app::recalc_all()
|
|||||||
// riaggiusta relazione
|
// riaggiusta relazione
|
||||||
_nditte->read();
|
_nditte->read();
|
||||||
|
|
||||||
// decidi per stocazzo di annuale
|
|
||||||
// ***************** Previous kasin ***************************
|
|
||||||
// per QUALSIASI annuale il mese diventa 13
|
|
||||||
// _isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
|
||||||
// (_month == 13 && (mens || _isbenzinaro));
|
|
||||||
// _isriepilogo = _month == 13 && !mens;
|
|
||||||
// if (_isannual) _month = 13; // che ti piaccia o no
|
|
||||||
// ************************************************************
|
|
||||||
|
|
||||||
// strasemplificato: per l'annuale si sceglie annuale, altrimenti
|
// strasemplificato: per l'annuale si sceglie annuale, altrimenti
|
||||||
// e' la 12ma anche per le trimestrali.
|
// e' la 12ma anche per le trimestrali.
|
||||||
_isannual = _isriepilogo = _month == 13;
|
_isannual = _isriepilogo = _month == 13;
|
||||||
@ -99,14 +90,15 @@ bool TLiquidazione_app::recalc_all()
|
|||||||
_canprint = is_month_ok_strict(_month) || _month == 13;
|
_canprint = is_month_ok_strict(_month) || _month == 13;
|
||||||
|
|
||||||
/* --------------------------------------------------------------
|
/* --------------------------------------------------------------
|
||||||
* Ricalcola i mesi necessari, tutti se annuale
|
* Ricalcola i mesi necessari: annuale e' un mese unico da 1/1 al 31/12
|
||||||
* --------------------------------------------------------------
|
* --------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int need_refresh = FALSE;
|
int need_refresh = FALSE;
|
||||||
if (_recalc != ever)
|
if (_recalc != ever)
|
||||||
{
|
{
|
||||||
for (int m = 1; m < _month; m++)
|
int m = _month == 13 ? _month : 1;
|
||||||
|
for (; m < _month; m++)
|
||||||
if (is_month_ok_strict(m) && (!look_lim(m) || !_lim->get_bool("B0")))
|
if (is_month_ok_strict(m) && (!look_lim(m) || !_lim->get_bool("B0")))
|
||||||
{
|
{
|
||||||
need_refresh = TRUE;
|
need_refresh = TRUE;
|
||||||
@ -158,19 +150,12 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
// stato effettuato per scelta dello stronzo commercialista.
|
// stato effettuato per scelta dello stronzo commercialista.
|
||||||
|
|
||||||
look_lim(liq_month(month), TRUE);
|
look_lim(liq_month(month), TRUE);
|
||||||
//modifica del 19/01/1996
|
|
||||||
//if (_isfinal && _lim->get_bool("B1")) // && _month != 13)
|
|
||||||
// return TRUE;
|
|
||||||
//fine
|
|
||||||
|
|
||||||
{
|
{
|
||||||
TConfig cnf(CONFIG_DITTA, "cg");
|
TConfig cnf(CONFIG_DITTA, "cg");
|
||||||
|
|
||||||
//MI3262...
|
|
||||||
//_isdiffacc = cnf.get_bool("GeLiDi"); //usato per stampa acconto in coda ai registri
|
|
||||||
_isdiffacc = is_differita();
|
_isdiffacc = is_differita();
|
||||||
|
_isdifferita = _isdiffacc;
|
||||||
_isdifferita = _isdiffacc;// && _month != 13;
|
|
||||||
_isintr = !cnf.get_bool("InTrTr") && _freqviva != "M";
|
_isintr = !cnf.get_bool("InTrTr") && _freqviva != "M";
|
||||||
if (_isbenzinaro)
|
if (_isbenzinaro)
|
||||||
_gest4 = cnf.get_bool("GesT74");
|
_gest4 = cnf.get_bool("GesT74");
|
||||||
@ -201,10 +186,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
zero_firm(month);
|
zero_firm(month);
|
||||||
|
|
||||||
// casini per stampa minchie in coda ai registri
|
// casini per stampa minchie in coda ai registri
|
||||||
//22/12/1995
|
|
||||||
bool riepliq = _isregis ? _riepilogo : FALSE;
|
bool riepliq = _isregis ? _riepilogo : FALSE;
|
||||||
bool stliq = TRUE;
|
bool stliq = TRUE;
|
||||||
//fine
|
|
||||||
|
|
||||||
_nditte->save_status();
|
_nditte->save_status();
|
||||||
if (_nditte->is_first_match(LF_ATTIV))
|
if (_nditte->is_first_match(LF_ATTIV))
|
||||||
@ -230,9 +213,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
if (_prind) _prind->set_text(buf);
|
if (_prind) _prind->set_text(buf);
|
||||||
|
|
||||||
// se ricalcola l'annuale si tiene tutte le vendite e corrispettivi di
|
// se ricalcola l'annuale si tiene tutte le vendite e corrispettivi di
|
||||||
// tutti i lerci mesi
|
// tutti i lerci mesi. Analogamente se sta calcolando una trimestrale.
|
||||||
// Analogamente se sta calcolando una trimestrale
|
// Nel caso di trimestrale con ricalcolo trimestri precedenti azzera
|
||||||
if (!(_month == 13 && month > 1 || _freqviva == "T" && (month != 4 && month != 7 && month != 10)))
|
// ad ogni inizio di trimestre.
|
||||||
|
if (!(_freqviva == "T" && (month != 4 && month != 7 && month != 10 && month != 13)))
|
||||||
{
|
{
|
||||||
_vend_arr.destroy();
|
_vend_arr.destroy();
|
||||||
_corr_arr.destroy();
|
_corr_arr.destroy();
|
||||||
@ -285,15 +269,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
|
|
||||||
for (_reg->first(); _reg->good(); _reg->next())
|
for (_reg->first(); _reg->good(); _reg->next())
|
||||||
{
|
{
|
||||||
//22/12/1995
|
|
||||||
//if (codatt == _reg->get("S8") || quater)
|
|
||||||
if (codatt == _reg->get("S8"))
|
if (codatt == _reg->get("S8"))
|
||||||
{
|
{
|
||||||
//if (!riepliq) riepliq = _reg->get_bool("B6");
|
|
||||||
//if (!stliq) stliq = _reg->get_bool("B7");
|
|
||||||
if (_reg->get_int("I0") == 2)
|
if (_reg->get_int("I0") == 2)
|
||||||
if (!_isvent) _isvent = _reg->get_bool("B3");
|
if (!_isvent) _isvent = _reg->get_bool("B3");
|
||||||
//fine
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,10 +286,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
if (!update_att(month, cattiv) && stliq)
|
if (!update_att(month, cattiv) && stliq)
|
||||||
describe_error("Attivita' non ricalcolate: possibili errori",
|
describe_error("Attivita' non ricalcolate: possibili errori",
|
||||||
codatt);
|
codatt);
|
||||||
//13/12/1995
|
|
||||||
if (month == 13)
|
if (month == 13)
|
||||||
recalc_annual(cattiv);
|
recalc_annual(cattiv);
|
||||||
//fine
|
|
||||||
|
|
||||||
// vediamo se c'e' qualcosa da raccontare
|
// vediamo se c'e' qualcosa da raccontare
|
||||||
gheravergot = _isannual || _isriepilogo;
|
gheravergot = _isannual || _isriepilogo;
|
||||||
@ -337,11 +314,6 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
// sui files adibiti a mantenere le informazioni per IVA 11: tab1100a e tab1100b
|
// sui files adibiti a mantenere le informazioni per IVA 11: tab1100a e tab1100b
|
||||||
if (_is_interactive && month == 13)
|
if (_is_interactive && month == 13)
|
||||||
iva11_set_arr_pim(codatt); // scorre tutti i maledetti PIM di questa ditta/attivita' per completare _iva11_arr
|
iva11_set_arr_pim(codatt); // scorre tutti i maledetti PIM di questa ditta/attivita' per completare _iva11_arr
|
||||||
// Ehm. Ehmm... Nota da fare in futuro non appena si ha un poco di tempo.
|
|
||||||
// Attualmente iva11_set_arr() scorre tutti i PIM. Tale funzione viene chiamata per ogni
|
|
||||||
// attivita' della ditta corrente.
|
|
||||||
// Si potrebbe ottimizzare il tutto scorrendo PIM una sola volta per tutte le ditte e tutte le
|
|
||||||
// attivita' (ovviamente solo per il mese 13).
|
|
||||||
}
|
}
|
||||||
while (_nditte->next_match(LF_ATTIV));
|
while (_nditte->next_match(LF_ATTIV));
|
||||||
|
|
||||||
@ -362,7 +334,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
|
|
||||||
// Se siamo in annuale e se non e' stato indicato di ricalcolare (stampa liquidazione chiamata
|
// Se siamo in annuale e se non e' stato indicato di ricalcolare (stampa liquidazione chiamata
|
||||||
// dalla stampa registri) non riscrivere i risultati delle liquidazioni,
|
// dalla stampa registri) non riscrivere i risultati delle liquidazioni,
|
||||||
if ((is_month_ok_strict(month) && _month != 13 && _recalc != never) || month == 13)
|
if ((is_month_ok_strict(month) && _month != 13 && _recalc != never) || _is_interactive /*month == 13*/ )
|
||||||
write_liq(month, atts);
|
write_liq(month, atts);
|
||||||
|
|
||||||
// rimborso infraannuale
|
// rimborso infraannuale
|
||||||
@ -422,13 +394,12 @@ bool TLiquidazione_app::update_att(int month, const char* codatt,
|
|||||||
{
|
{
|
||||||
zero_att(month,codatt);
|
zero_att(month,codatt);
|
||||||
recalc_att(month,codatt);
|
recalc_att(month,codatt);
|
||||||
if (_freqviva == "M" || (_freqviva == "T" && is_trim(month)) || _month == 13)
|
// Ricalcolo ventilazione:
|
||||||
|
// - tutti i mesi se e' mensile
|
||||||
|
// - nei mesi 3,6,9,12 se trimestrale
|
||||||
|
if (_freqviva == "M" || (_freqviva == "T" && is_trim(month)))
|
||||||
recalc_ventilation(month, codatt);
|
recalc_ventilation(month, codatt);
|
||||||
recalc_corrispettivi(month, codatt);
|
recalc_corrispettivi(month, codatt);
|
||||||
//13/12/1995
|
|
||||||
// if (month == 13)
|
|
||||||
// recalc_annual(codatt);
|
|
||||||
//fine
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok || calc;
|
return ok || calc;
|
||||||
@ -550,6 +521,9 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
real agr_imp = 0.0;
|
real agr_imp = 0.0;
|
||||||
real agr_iva = 0.0;
|
real agr_iva = 0.0;
|
||||||
|
|
||||||
|
// Spiegazione dell'arcano segreto sulle agenzie viaggio:
|
||||||
|
// non viene applicata la setregion() al cursore perche' e' necessario
|
||||||
|
// tenere conto della DATA74TER se presente.
|
||||||
if (!_isviaggio)
|
if (!_isviaggio)
|
||||||
{
|
{
|
||||||
TRectype from(_cur->curr()); from.zero();
|
TRectype from(_cur->curr()); from.zero();
|
||||||
@ -651,7 +625,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
|
|
||||||
TString codiva = _iva->get("CODTAB");
|
TString codiva = _iva->get("CODTAB");
|
||||||
TString tipoiva = _iva->get("S1");
|
TString tipoiva = _iva->get("S1");
|
||||||
TString riga11_v = _iva->get("S0");
|
|
||||||
TString tipoes_v = _iva->get("S2");
|
TString tipoes_v = _iva->get("S2");
|
||||||
TString tipoes_a = _iva->get("S9");
|
TString tipoes_a = _iva->get("S9");
|
||||||
int tipoagr = atoi(_iva->get("S4"));
|
int tipoagr = atoi(_iva->get("S4"));
|
||||||
@ -689,32 +662,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
* considerano (Scudler 1994)
|
* considerano (Scudler 1994)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* In liq. annuale si totalizzano
|
|
||||||
* solo le stranezze che seguono
|
|
||||||
*/
|
|
||||||
if (month == 13)
|
|
||||||
{
|
|
||||||
// Filling dell'array per IVA11
|
// Filling dell'array per IVA11
|
||||||
if (_is_interactive && _month == 13)
|
if (_is_interactive && month == 13)
|
||||||
iva11_set_arr(trueatt);
|
iva11_set_arr(trueatt);
|
||||||
|
|
||||||
|
|
||||||
// si contano soltanto le vendite.
|
|
||||||
bool okc = tipomov == vendita;
|
|
||||||
// purche' ...
|
|
||||||
bool cond1 = (rcs.get_bool("AUTOFATT") && tipoiva == "NS" && tipodoc == "AF");
|
|
||||||
// oppure ...
|
|
||||||
bool cond2 = (rcs.get_bool("AUTOFATT") && tipoiva == "NS" && tipodoc != "AF" &&
|
|
||||||
rcs.get_bool("INTRACOM") && rcs.get_bool("VALINTRA"));
|
|
||||||
/*
|
|
||||||
* Fatture in ritardo vengono considerate solo in dichiarazione
|
|
||||||
* annuale, ma vanno comunque sommate per i porci registri
|
|
||||||
*/
|
|
||||||
if (!(okc && (cond1 || cond2)) && !fattrit)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (noninc) // non incassati: non devono entrare in nessun altro calcolo
|
if (noninc) // non incassati: non devono entrare in nessun altro calcolo
|
||||||
{
|
{
|
||||||
nin_imp = imponibile;
|
nin_imp = imponibile;
|
||||||
@ -1003,7 +954,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
* possono anche essere sul registro vendite. Indi le schiaffo dentro
|
* possono anche essere sul registro vendite. Indi le schiaffo dentro
|
||||||
* a R5 e R6 anche nel caso vi sia un documento FS registrato sul registro
|
* a R5 e R6 anche nel caso vi sia un documento FS registrato sul registro
|
||||||
* delle vendite. Nel caso in futuro si accorgessero finalmente della puttanata
|
* delle vendite. Nel caso in futuro si accorgessero finalmente della puttanata
|
||||||
* galattiche che mi hanno fatto fare basta eliminare il controllo su FS
|
* galattica che mi hanno fatto fare basta eliminare il controllo su FS
|
||||||
* nel caso si tratti di non corrispettivi (vedi sotto).
|
* nel caso si tratti di non corrispettivi (vedi sotto).
|
||||||
* Da togliere anche nella :describe_pim() in cg4304.cpp.
|
* Da togliere anche nella :describe_pim() in cg4304.cpp.
|
||||||
*
|
*
|
||||||
@ -1150,8 +1101,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
}
|
}
|
||||||
imp += imponibile;
|
imp += imponibile;
|
||||||
ivp += imposta;
|
ivp += imposta;
|
||||||
//fci += imponibile;
|
|
||||||
//fcv += imposta;
|
|
||||||
_pim->put("I0",NETTO);
|
_pim->put("I0",NETTO);
|
||||||
}
|
}
|
||||||
} // if corrisp
|
} // if corrisp
|
||||||
@ -1160,9 +1109,9 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
imp += imponibile;
|
imp += imponibile;
|
||||||
ivp += imposta;
|
ivp += imposta;
|
||||||
if (tipodoc == "FS") // Questo e' per l'errore MI3404
|
if (tipodoc == "FS") // Questo e' per l'errore MI3404
|
||||||
{ // Dicono che una volta funzionasse, ci credo poco...
|
{
|
||||||
ifs += imponibile; // Anyway, comincio a condividere appieno i commenti sparsi qua e
|
ifs += imponibile;
|
||||||
vfs += imposta; // la da Ferdinando...
|
vfs += imposta;
|
||||||
}
|
}
|
||||||
_pim->put("I0",NETTO);
|
_pim->put("I0",NETTO);
|
||||||
}
|
}
|
||||||
@ -1290,9 +1239,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
if (!_prorata.is_zero() && month != 13)
|
if (!_prorata.is_zero() && month != 13)
|
||||||
{
|
{
|
||||||
prorata = acquisti_iva * (_prorata / CENTO);
|
prorata = acquisti_iva * (_prorata / CENTO);
|
||||||
//13/12/1995
|
|
||||||
//prorata.round(ROUND_MILLELIRE);
|
|
||||||
//fine
|
|
||||||
acquisti_iva -= prorata;
|
acquisti_iva -= prorata;
|
||||||
}
|
}
|
||||||
look_plm(month, codatt, TRUE);
|
look_plm(month, codatt, TRUE);
|
||||||
@ -1444,9 +1390,9 @@ void TLiquidazione_app::iva11_set_arr(const TString& codatt)
|
|||||||
const bool is_acquisto = tipomov == acquisto;
|
const bool is_acquisto = tipomov == acquisto;
|
||||||
|
|
||||||
|
|
||||||
_BolgArray b_arr;
|
_Iva11Array b_arr;
|
||||||
const bool is_key = _iva11_arr.is_key(codatt);
|
const bool is_key = _iva11_arr.is_key(codatt);
|
||||||
_BolgArray& array = is_key ? (_BolgArray&)_iva11_arr.find(codatt) : b_arr;
|
_Iva11Array& array = is_key ? (_Iva11Array&)_iva11_arr.find(codatt) : b_arr;
|
||||||
|
|
||||||
|
|
||||||
// TAB11_RQA34 ovvero "RQA34" non viene trasferito!
|
// TAB11_RQA34 ovvero "RQA34" non viene trasferito!
|
||||||
@ -1612,56 +1558,11 @@ void TLiquidazione_app::iva11_set_arr(const TString& codatt)
|
|||||||
if (is_vendita)
|
if (is_vendita)
|
||||||
{
|
{
|
||||||
if (corrisp && tipoiva != "VE" && (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC") )
|
if (corrisp && tipoiva != "VE" && (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC") )
|
||||||
// x13
|
|
||||||
return;
|
return;
|
||||||
/*
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
real p = ali/CENTO;
|
|
||||||
lordo2netto(imponibile,imposta,p);// In tal caso scorpora l'iva dall'imponibile...
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// fine x13
|
|
||||||
if (tipodoc == "CN" || tipodoc == "SN" || tipodoc == "RN") // salta i non incassati
|
if (tipodoc == "CN" || tipodoc == "SN" || tipodoc == "RN") // salta i non incassati
|
||||||
return;
|
return;
|
||||||
if (!valintra)
|
if (!valintra)
|
||||||
{
|
{
|
||||||
// x13
|
|
||||||
/* if (tipodoc != "AF" && ((_isagricolo && tipoagr==2) || !_isagricolo))
|
|
||||||
{
|
|
||||||
if (ali == 4.00)
|
|
||||||
{
|
|
||||||
array.add(imponibile,TAB11_EC101);
|
|
||||||
array.add(imposta,TAB11_EC201);
|
|
||||||
}
|
|
||||||
else if (ali == 9.00)
|
|
||||||
{
|
|
||||||
array.add(imponibile,TAB11_EC102);
|
|
||||||
array.add(imposta,TAB11_EC202);
|
|
||||||
}
|
|
||||||
else if (ali == 10.00)
|
|
||||||
{
|
|
||||||
array.add(imponibile,TAB11_EC103);
|
|
||||||
array.add(imposta,TAB11_EC203);
|
|
||||||
}
|
|
||||||
else if (ali == 13.00)
|
|
||||||
{
|
|
||||||
array.add(imponibile,TAB11_EC104);
|
|
||||||
array.add(imposta,TAB11_EC204);
|
|
||||||
}
|
|
||||||
else if (ali == 16.00)
|
|
||||||
{
|
|
||||||
array.add(imponibile,TAB11_EC105);
|
|
||||||
array.add(imposta,TAB11_EC205);
|
|
||||||
}
|
|
||||||
else if (ali == 19.00)
|
|
||||||
{
|
|
||||||
array.add(imponibile,TAB11_EC106);
|
|
||||||
array.add(imposta,TAB11_EC206);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// fine x13
|
|
||||||
if (tipoes_v == "24")
|
if (tipoes_v == "24")
|
||||||
array.add(imponibile,TAB11_EC107);
|
array.add(imponibile,TAB11_EC107);
|
||||||
if (tipoes_v == "21")
|
if (tipoes_v == "21")
|
||||||
@ -1777,9 +1678,9 @@ void TLiquidazione_app::iva11_set_arr_pim(const TString& codatt)
|
|||||||
int tipocr,tipodet,tagr;
|
int tipocr,tipodet,tagr;
|
||||||
real aliq, imp, iva, vtot, atot, ivav, ivaa, adf, adi, a13i, a13v;
|
real aliq, imp, iva, vtot, atot, ivav, ivaa, adf, adi, a13i, a13v;
|
||||||
TString16 cur_att;
|
TString16 cur_att;
|
||||||
_BolgArray b_arr;
|
_Iva11Array b_arr;
|
||||||
const bool is_key = _iva11_arr.is_key(codatt);
|
const bool is_key = _iva11_arr.is_key(codatt);
|
||||||
_BolgArray& array = is_key ? (_BolgArray&)_iva11_arr.find(codatt) : b_arr;
|
_Iva11Array& array = is_key ? (_Iva11Array&)_iva11_arr.find(codatt) : b_arr;
|
||||||
// Scorporo corretto dei corrispettivi in R3
|
// Scorporo corretto dei corrispettivi in R3
|
||||||
TAssoc_array corr_ann;
|
TAssoc_array corr_ann;
|
||||||
_CorrItem cx,*cc;
|
_CorrItem cx,*cc;
|
||||||
@ -1788,6 +1689,7 @@ void TLiquidazione_app::iva11_set_arr_pim(const TString& codatt)
|
|||||||
for (_pim->first(); !_pim->eof(); _pim->next())
|
for (_pim->first(); !_pim->eof(); _pim->next())
|
||||||
{
|
{
|
||||||
if (_year != *_pim_anno) continue;
|
if (_year != *_pim_anno) continue;
|
||||||
|
if (*_pim_mese != "13") continue;
|
||||||
cur_att = *_pim_codatt;
|
cur_att = *_pim_codatt;
|
||||||
cur_att.rtrim(1);
|
cur_att.rtrim(1);
|
||||||
if (codatt != cur_att) continue; // considera solo quelli dell'anno, obviously.
|
if (codatt != cur_att) continue; // considera solo quelli dell'anno, obviously.
|
||||||
@ -2017,13 +1919,12 @@ void TLiquidazione_app::iva11_set_arr_pim(const TString& codatt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Hisss... Rettifica l'importo di EC115: EC115 = EC116 + EC117 + EC115
|
// Mmmhh.. Rettifica l'importo di EC115: EC115 = EC116 + EC117 + EC115
|
||||||
// Va beh...
|
|
||||||
real r16, r17;
|
real r16, r17;
|
||||||
if (array.is_key(TAB11_EC116))
|
if (array.is_key(TAB11_EC116))
|
||||||
r16 = ((_BolgItem&)array[TAB11_EC116]).value();
|
r16 = ((_Iva11Item&)array[TAB11_EC116]).value();
|
||||||
if (array.is_key(TAB11_EC117))
|
if (array.is_key(TAB11_EC117))
|
||||||
r17 = ((_BolgItem&)array[TAB11_EC117]).value();
|
r17 = ((_Iva11Item&)array[TAB11_EC117]).value();
|
||||||
r17+=r16;
|
r17+=r16;
|
||||||
array.add(r17,TAB11_EC115);
|
array.add(r17,TAB11_EC115);
|
||||||
|
|
||||||
@ -2035,8 +1936,7 @@ void TLiquidazione_app::iva11_set_arr_pim(const TString& codatt)
|
|||||||
array.add(ala,TAB11_R1,LF_TAB1100B);
|
array.add(ala,TAB11_R1,LF_TAB1100B);
|
||||||
array.add(alv,TAB11_R2,LF_TAB1100B);
|
array.add(alv,TAB11_R2,LF_TAB1100B);
|
||||||
|
|
||||||
// Uargh, Uargh. Mo' mi pappo i PLM per compilare T1, T1C, T2, T2C, T3, T5 e T6
|
// Mo' si pappa i PLM per compilare T1, T1C, T2, T2C, T3, T5 e T6
|
||||||
// Ah, Ah, Ah!
|
|
||||||
// ATTENZIONE: solo per i regimi 74ter (ag. viaggio)
|
// ATTENZIONE: solo per i regimi 74ter (ag. viaggio)
|
||||||
for (_plm->first();!_plm->eof();_plm->next())
|
for (_plm->first();!_plm->eof();_plm->next())
|
||||||
{
|
{
|
||||||
@ -2067,11 +1967,11 @@ void TLiquidazione_app::iva11_write(bool reset_r1r2)
|
|||||||
|
|
||||||
TString ditta,attiv,fld_name;
|
TString ditta,attiv,fld_name;
|
||||||
|
|
||||||
_BolgArray * bolg_arr;
|
_Iva11Array * iva11_arr;
|
||||||
_BolgItem * bolg;
|
_Iva11Item * iva11;
|
||||||
int i=0,err;
|
int i=0,err;
|
||||||
// Ciclo sulle attivita'
|
// Ciclo sulle attivita'
|
||||||
for (bolg_arr = (_BolgArray *) _iva11_arr.first_item(); bolg_arr != NULL && i < items; i++,bolg_arr = (_BolgArray*)_iva11_arr.succ_item())
|
for (iva11_arr = (_Iva11Array *) _iva11_arr.first_item(); iva11_arr != NULL && i < items; i++,iva11_arr = (_Iva11Array*)_iva11_arr.succ_item())
|
||||||
{
|
{
|
||||||
// Setta i campi chiave per entrambi i files della relazione
|
// Setta i campi chiave per entrambi i files della relazione
|
||||||
ditta.format("%05ld",_nditte->curr().get_long(NDT_CODDITTA));
|
ditta.format("%05ld",_nditte->curr().get_long(NDT_CODDITTA));
|
||||||
@ -2085,14 +1985,14 @@ void TLiquidazione_app::iva11_write(bool reset_r1r2)
|
|||||||
tab1100b.put(TAB11_TADITT,ditta);
|
tab1100b.put(TAB11_TADITT,ditta);
|
||||||
tab1100b.put(TAB11_TACATT,attiv);
|
tab1100b.put(TAB11_TACATT,attiv);
|
||||||
|
|
||||||
const int bolg_items = bolg_arr->items();
|
const int iva11_items = iva11_arr->items();
|
||||||
int j=0;
|
int j=0;
|
||||||
// Ciclo sugli elementi per compilare i campi della relazione
|
// Ciclo sugli elementi per compilare i campi della relazione
|
||||||
for (bolg = (_BolgItem *)bolg_arr->first_item(); bolg != NULL && j<bolg_items;j++,bolg = (_BolgItem *)bolg_arr->succ_item())
|
for (iva11 = (_Iva11Item *)iva11_arr->first_item(); iva11 != NULL && j<iva11_items;j++,iva11 = (_Iva11Item *)iva11_arr->succ_item())
|
||||||
{
|
{
|
||||||
fld_name = bolg_arr->get_hashobj()->key();
|
fld_name = iva11_arr->get_hashobj()->key();
|
||||||
if (reset_r1r2 && (fld_name == TAB11_R1 || fld_name == TAB11_R2)) continue; // salta R1/R2 se devono rimanere a zero
|
if (reset_r1r2 && (fld_name == TAB11_R1 || fld_name == TAB11_R2)) continue; // salta R1/R2 se devono rimanere a zero
|
||||||
_tab11->lfile(bolg->file()).put(fld_name,bolg->value());
|
_tab11->lfile(iva11->file()).put(fld_name,iva11->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_tab11->write() != NOERR)
|
if (_tab11->write() != NOERR)
|
||||||
@ -2183,8 +2083,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
differita = FALSE;
|
differita = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Modifiche per PIM13
|
||||||
for (int m = 1; m <= 13; m++)
|
int m = (month == 13) ? 13 : 1;
|
||||||
|
for (; m <= 13; m++)
|
||||||
{
|
{
|
||||||
// ciclo su tutti i mesi del caso (1 o 3;
|
// ciclo su tutti i mesi del caso (1 o 3;
|
||||||
// tutti se annuale)
|
// tutti se annuale)
|
||||||
@ -2428,9 +2329,11 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
look_pla(att, TRUE);
|
look_pla(att, TRUE);
|
||||||
_pla->put("R8", prorata);
|
_pla->put("R8", prorata);
|
||||||
_pla->rewrite();
|
_pla->rewrite();
|
||||||
look_lia();
|
if (look_lia(0l, TRUE))
|
||||||
|
{
|
||||||
_lia->put("R5", cred_cost);
|
_lia->put("R5", cred_cost);
|
||||||
_lia->rewrite();
|
_lia->rewrite();
|
||||||
|
}
|
||||||
_year = yr;
|
_year = yr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2477,8 +2380,6 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
/*
|
/*
|
||||||
* acconto dicembre se previsto
|
* acconto dicembre se previsto
|
||||||
*/
|
*/
|
||||||
//if ((month == 12 && _isbenzinaro) ||
|
|
||||||
// (month >= 12 && _freqviva == "M"))
|
|
||||||
if (((month+deltam) >= 12 && _freqviva == "M") || //solo freq. M puo'
|
if (((month+deltam) >= 12 && _freqviva == "M") || //solo freq. M puo'
|
||||||
(month == 12 && _isbenzinaro && _gest4) || //essere differita
|
(month == 12 && _isbenzinaro && _gest4) || //essere differita
|
||||||
(month == 13 && _freqviva == "T"))
|
(month == 13 && _freqviva == "T"))
|
||||||
@ -2518,7 +2419,6 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
* FALSE per ditte mensili e liq. annuale
|
* FALSE per ditte mensili e liq. annuale
|
||||||
* Ulteriormente smentito e rettificato
|
* Ulteriormente smentito e rettificato
|
||||||
*/
|
*/
|
||||||
//if (_isintr && month < 13)
|
|
||||||
bool true_trim = (month == 3 || month == 6 || month == 9);
|
bool true_trim = (month == 3 || month == 6 || month == 9);
|
||||||
if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4)
|
if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4)
|
||||||
|| (month == 13 && !(_isbenzinaro && _gest4)) ))
|
|| (month == 13 && !(_isbenzinaro && _gest4)) ))
|
||||||
@ -2530,7 +2430,6 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//questo serve anche per la visualizzazione e per l'estrazione deleghe
|
//questo serve anche per la visualizzazione e per l'estrazione deleghe
|
||||||
//if (_isintr && month < 13)
|
|
||||||
if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4)
|
if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4)
|
||||||
|| (month == 13 && !(_isbenzinaro && _gest4)) ))
|
|| (month == 13 && !(_isbenzinaro && _gest4)) ))
|
||||||
_lim->put("R10",interesse_trimestrale(_month));
|
_lim->put("R10",interesse_trimestrale(_month));
|
||||||
@ -2547,19 +2446,13 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
_lim->put("R12", res_cred);
|
_lim->put("R12", res_cred);
|
||||||
_lim->put("R13", res_debt);
|
_lim->put("R13", res_debt);
|
||||||
|
|
||||||
//modifica del 19/01/1996
|
|
||||||
//if (!_recalc_only)
|
|
||||||
if (!_recalc_only && _recalc != never)
|
if (!_recalc_only && _recalc != never)
|
||||||
{
|
{
|
||||||
_lim->put("B0","X");
|
_lim->put("B0","X");
|
||||||
_lim->put("B1","X");
|
_lim->put("B1","X");
|
||||||
}
|
}
|
||||||
//fine
|
|
||||||
|
|
||||||
//modifica del 19/01/1996
|
|
||||||
//if (_isfinal) _lim->put("B1", "X");
|
|
||||||
if (_recalc_only) _lim->put("B1", "X");
|
if (_recalc_only) _lim->put("B1", "X");
|
||||||
//fine
|
|
||||||
|
|
||||||
if (wasdifferita) _isdifferita = TRUE;
|
if (wasdifferita) _isdifferita = TRUE;
|
||||||
|
|
||||||
@ -2571,18 +2464,6 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
if (month == 13)
|
if (month == 13)
|
||||||
{
|
{
|
||||||
// molto codice duplicato, ma ne val la pena (vedi sopra)
|
// molto codice duplicato, ma ne val la pena (vedi sopra)
|
||||||
//iva_vend.round(ROUND_MILLELIRE);
|
|
||||||
//iva_acq.round(ROUND_MILLELIRE);
|
|
||||||
//detrazioni.round(ROUND_MILLELIRE);
|
|
||||||
//versamenti.round(ROUND_MILLELIRE);
|
|
||||||
//vers_int.round(ROUND_MILLELIRE);
|
|
||||||
//rimborsi.round(ROUND_MILLELIRE);
|
|
||||||
//rettifiche.round(ROUND_MILLELIRE);
|
|
||||||
//deb_mens.round(ROUND_MILLELIRE);
|
|
||||||
//cred_prec.round(ROUND_MILLELIRE);
|
|
||||||
//tot_cong.round(ROUND_MILLELIRE);
|
|
||||||
//acc_dec.round(ROUND_MILLELIRE);
|
|
||||||
//debt_precd.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(iva_vend);
|
round_mille_lire(iva_vend);
|
||||||
round_mille_lire(iva_acq);
|
round_mille_lire(iva_acq);
|
||||||
round_mille_lire(detrazioni);
|
round_mille_lire(detrazioni);
|
||||||
@ -2608,19 +2489,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
|
|
||||||
if (!_isagricolo) res_cred += detrazioni;
|
if (!_isagricolo) res_cred += detrazioni;
|
||||||
|
|
||||||
// res_debt.round();
|
|
||||||
// res_cred.round();
|
|
||||||
|
|
||||||
// TString r1(res_debt.string());
|
|
||||||
// TString r2(res_cred.string());
|
|
||||||
|
|
||||||
// real rd(r1);
|
|
||||||
// real rc(r2);
|
|
||||||
|
|
||||||
risultato = res_debt - res_cred;
|
risultato = res_debt - res_cred;
|
||||||
|
|
||||||
// TString r3(risultato.string());
|
|
||||||
|
|
||||||
// tut ricalcule', riscrivem
|
// tut ricalcule', riscrivem
|
||||||
_lim->put("R0", risultato);
|
_lim->put("R0", risultato);
|
||||||
_lim->put("R2", cred_cost);
|
_lim->put("R2", cred_cost);
|
||||||
@ -2686,7 +2556,8 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
|||||||
|
|
||||||
for (_pim->first(); !_pim->eof(); _pim->next())
|
for (_pim->first(); !_pim->eof(); _pim->next())
|
||||||
{
|
{
|
||||||
if (_year != *_pim_anno) continue;
|
if (_year != *_pim_anno || _month != atoi(*_pim_mese)) // In questo caso _month vale sempre 13
|
||||||
|
continue;
|
||||||
|
|
||||||
int tipocr = atoi(*_pim_tipocr);
|
int tipocr = atoi(*_pim_tipocr);
|
||||||
codiva = *_pim_codiva;
|
codiva = *_pim_codiva;
|
||||||
@ -2745,7 +2616,7 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
|||||||
// calcola esenti, cessioni, lordo vendite, prorata pagato
|
// calcola esenti, cessioni, lordo vendite, prorata pagato
|
||||||
// e IVA acquisti dai plm/ptm/pum/pam/pom
|
// e IVA acquisti dai plm/ptm/pum/pam/pom
|
||||||
|
|
||||||
for (int i = 1; i <= 13; i++)
|
for (int i = 1; i <= 12; i++)
|
||||||
{
|
{
|
||||||
if (!look_plm(i,aaa))
|
if (!look_plm(i,aaa))
|
||||||
continue;
|
continue;
|
||||||
@ -2759,6 +2630,19 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
|||||||
pro_pag += _plm->get_real("R2");
|
pro_pag += _plm->get_real("R2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Modifiche per PIM13
|
||||||
|
if (look_plm(13,aaa))
|
||||||
|
{
|
||||||
|
// Nota:
|
||||||
|
// l'iva acquisti del mese 13 memorizzata in PLM->R1, e' si' la sommatoria
|
||||||
|
// di tutte le imposte relative agli acquisti di tutti i mesi, ma andrebbe sottratto il
|
||||||
|
// totale prorata pagato (pro_pag), reperibile dai mesi precedenti (PLM->R2)
|
||||||
|
real iv = _plm->get_real("R1"); // Iva acquisti annuale
|
||||||
|
iv -= pro_pag; // Si sottraggano i prorata pagati
|
||||||
|
_plm->put("R1",iv); // Si riscriva il tutto
|
||||||
|
_plm->rewrite();
|
||||||
|
}
|
||||||
|
|
||||||
_pla->put("R0", vendite);
|
_pla->put("R0", vendite);
|
||||||
_pla->put("R1", es_b1);
|
_pla->put("R1", es_b1);
|
||||||
_pla->put("R2", es_b2);
|
_pla->put("R2", es_b2);
|
||||||
|
@ -183,16 +183,7 @@ void TLiquidazione_app::add_corrisp(int month, const char* codreg, real& r,
|
|||||||
|
|
||||||
void TLiquidazione_app::lordo2netto(const real& totale, real& imponibile, real& imposta, const real& aliquota)
|
void TLiquidazione_app::lordo2netto(const real& totale, real& imponibile, real& imposta, const real& aliquota)
|
||||||
{
|
{
|
||||||
/* *** Questo e' stato preso da recalc_corrispettivi()
|
/* *** Questo e' stato preso da recalc_corrispettivi() */
|
||||||
real imposta = (abs(ci->_totale) * ci->_aliquota)/(ci->_aliquota + 1.00);
|
|
||||||
imposta.ceil();
|
|
||||||
if (ci->_totale.sign() < 0) imposta = -imposta;
|
|
||||||
real imponibile = ci->_totale - imposta;
|
|
||||||
// quadratura del cerchione
|
|
||||||
real delta = ci->_totale - imponibile - imposta;
|
|
||||||
if (!delta.is_zero())
|
|
||||||
imposta += delta;
|
|
||||||
*/
|
|
||||||
imposta = (abs(totale) * aliquota)/(aliquota + 1.00);
|
imposta = (abs(totale) * aliquota)/(aliquota + 1.00);
|
||||||
imposta.ceil();
|
imposta.ceil();
|
||||||
if (totale.sign() < 0) imposta = -imposta;
|
if (totale.sign() < 0) imposta = -imposta;
|
||||||
@ -271,7 +262,6 @@ bool TLiquidazione_app::look_pum(int m, const char* a, bool create)
|
|||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
|
|
||||||
_pum->zero();
|
_pum->zero();
|
||||||
//(*_pum_codatt) = format("%06ld", atol(a));
|
|
||||||
(*_pum_codatt) = format("%6s", a);
|
(*_pum_codatt) = format("%6s", a);
|
||||||
(*_pum_mese) = format("%02d",m);
|
(*_pum_mese) = format("%02d",m);
|
||||||
(*_pum_anno) = _year;
|
(*_pum_anno) = _year;
|
||||||
@ -294,7 +284,6 @@ bool TLiquidazione_app::look_pom(int m, const char* a, bool create)
|
|||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
|
|
||||||
_pom->zero();
|
_pom->zero();
|
||||||
//(*_pom_codatt) = format("%06ld", atol(a));
|
|
||||||
(*_pom_codatt) = format("%6s", a);
|
(*_pom_codatt) = format("%6s", a);
|
||||||
(*_pom_mese) = format("%02d",m);
|
(*_pom_mese) = format("%02d",m);
|
||||||
(*_pom_anno) = _year;
|
(*_pom_anno) = _year;
|
||||||
@ -317,7 +306,6 @@ bool TLiquidazione_app::look_pam(int m, const char* a, bool create)
|
|||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
|
|
||||||
_pam->zero();
|
_pam->zero();
|
||||||
//(*_pam_codatt) = format("%06ld", atol(a));
|
|
||||||
(*_pam_codatt) = format("%6s", a);
|
(*_pam_codatt) = format("%6s", a);
|
||||||
(*_pam_mese) = format("%02d",m);
|
(*_pam_mese) = format("%02d",m);
|
||||||
(*_pam_anno) = _year;
|
(*_pam_anno) = _year;
|
||||||
@ -452,7 +440,6 @@ bool TLiquidazione_app::look_ppa(int month, const char* codatt, int type, bool c
|
|||||||
_ppa->zero();
|
_ppa->zero();
|
||||||
(*_ppa_year) = _year;
|
(*_ppa_year) = _year;
|
||||||
(*_ppa_month) = format("%02d",month);
|
(*_ppa_month) = format("%02d",month);
|
||||||
//(*_ppa_codatt) = format("%06ld", atol(codatt));
|
|
||||||
(*_ppa_codatt) = format("%6s", codatt);
|
(*_ppa_codatt) = format("%6s", codatt);
|
||||||
(*_ppa_kind) = type;
|
(*_ppa_kind) = type;
|
||||||
TString ctab = _ppa_r->get("CODTAB");
|
TString ctab = _ppa_r->get("CODTAB");
|
||||||
@ -527,10 +514,6 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
|
|||||||
cab = _nditte->lfile().get("CABBAN");
|
cab = _nditte->lfile().get("CABBAN");
|
||||||
if (abi.empty())
|
if (abi.empty())
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
abi = anag.get("CODABI");
|
|
||||||
cab = anag.get("CODCAB");
|
|
||||||
*/
|
|
||||||
TConfig c (CONFIG_STUDIO, "cg");
|
TConfig c (CONFIG_STUDIO, "cg");
|
||||||
abi = c.get("CodABI");
|
abi = c.get("CodABI");
|
||||||
cab = c.get("CodCAB");
|
cab = c.get("CodCAB");
|
||||||
@ -726,14 +709,11 @@ real TLiquidazione_app::versamenti_IVA(int month, const char* types, bool intr)
|
|||||||
int tp = typ.get_int(i);
|
int tp = typ.get_int(i);
|
||||||
if (look_del(month,tp))
|
if (look_del(month,tp))
|
||||||
{
|
{
|
||||||
//if (_del->get_bool("B0") || _is_visliq) // solo se stampata, a meno
|
|
||||||
// che non sia per visliq
|
|
||||||
real importo_dovuto_non_arrotondato(_del->get_real("R2"));
|
real importo_dovuto_non_arrotondato(_del->get_real("R2"));
|
||||||
real interessi(_del->get_real("R1"));
|
real interessi(_del->get_real("R1"));
|
||||||
real importo_dovuto_arrotondato(_del->get_real("R0"));
|
real importo_dovuto_arrotondato(_del->get_real("R0"));
|
||||||
real work(importo_dovuto_non_arrotondato);
|
real work(importo_dovuto_non_arrotondato);
|
||||||
|
|
||||||
//work.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(work);
|
round_mille_lire(work);
|
||||||
if (_month == 13 && _freqviva == "T" && importo_dovuto_arrotondato == work)
|
if (_month == 13 && _freqviva == "T" && importo_dovuto_arrotondato == work)
|
||||||
ret += importo_dovuto_non_arrotondato; // Questo e' l'importo lordo non arrotondato!!
|
ret += importo_dovuto_non_arrotondato; // Questo e' l'importo lordo non arrotondato!!
|
||||||
@ -839,10 +819,5 @@ bool TLiquidazione_app::look_conc(TString& uffcon, TString& uffiva)
|
|||||||
if (ucc.read() == NOERR)
|
if (ucc.read() == NOERR)
|
||||||
uffiva = ucc.get("S0");
|
uffiva = ucc.get("S0");
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
uffiva = comuni.get("DENCOM");
|
|
||||||
if (!comuni.get("PROVCOM").empty())
|
|
||||||
uffiva << " (" << comuni.get("PROVCOM") << ")";
|
|
||||||
*/
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
352
cg/cg4303.cpp
352
cg/cg4303.cpp
@ -6,22 +6,6 @@
|
|||||||
|
|
||||||
#include "cg4300.h"
|
#include "cg4300.h"
|
||||||
|
|
||||||
class Annual_item : public TObject
|
|
||||||
{
|
|
||||||
real _imposta;
|
|
||||||
real _imponibile;
|
|
||||||
TString _codiva;
|
|
||||||
TString _other;
|
|
||||||
public:
|
|
||||||
virtual TObject* dup() const { return new Annual_item(*this); }
|
|
||||||
real& imposta() { return _imposta;}
|
|
||||||
real& imponibile() { return _imponibile;}
|
|
||||||
TString& codiva() { return _codiva;}
|
|
||||||
TString& other() { return _other;}
|
|
||||||
Annual_item() { _imposta = 0.0; _imponibile = 0.0; _codiva = ""; _other = ""; }
|
|
||||||
virtual ~Annual_item() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
void TLiquidazione_app::add_plafond(int month, const char* codatt, int type,
|
void TLiquidazione_app::add_plafond(int month, const char* codatt, int type,
|
||||||
real& howmuch, bool intra)
|
real& howmuch, bool intra)
|
||||||
{
|
{
|
||||||
@ -35,13 +19,6 @@ void TLiquidazione_app::add_plafond(int month, const char* codatt, int type,
|
|||||||
|
|
||||||
if (intra) r1 += howmuch;
|
if (intra) r1 += howmuch;
|
||||||
else r0 += howmuch;
|
else r0 += howmuch;
|
||||||
//06/12/1995
|
|
||||||
/*
|
|
||||||
if (r2 < (r0+r1))
|
|
||||||
describe_error("Acquisti in eccesso rispetto al plafond disponibile",
|
|
||||||
att.cut(5));
|
|
||||||
*/
|
|
||||||
//fine
|
|
||||||
_ppa_r->put("R0",r0);
|
_ppa_r->put("R0",r0);
|
||||||
_ppa_r->put("R1",r1);
|
_ppa_r->put("R1",r1);
|
||||||
_ppa->rewrite();
|
_ppa->rewrite();
|
||||||
@ -100,44 +77,13 @@ void TLiquidazione_app::recalc_corrispettivi(int month, const char* codatt)
|
|||||||
const int items = _corr_arr.items();
|
const int items = _corr_arr.items();
|
||||||
if (items == 0) return;
|
if (items == 0) return;
|
||||||
real imponibile,imposta;
|
real imponibile,imposta;
|
||||||
// Nota: i commenti marcati con x13 indicano modifiche da rimuovere non appena implementato
|
|
||||||
// correttamente il mese 13
|
|
||||||
// x13
|
|
||||||
TString key;
|
|
||||||
bool is_key;
|
|
||||||
TAssoc_array corr_ann; // Contiene corrispettivi annuali (temporaneo, da correggere
|
|
||||||
// non appena implementato correttamente il mese 13)
|
|
||||||
_CorrItem cx;
|
|
||||||
|
|
||||||
// Se siamo in annuale non aggiornare i PIM/PAM/PLM dei mesi calcolati
|
// Se siamo in annuale non aggiornare i PIM/PAM/PLM dei mesi calcolati
|
||||||
if (_month == 13 && month < 13) return;
|
|
||||||
// fine x13
|
|
||||||
|
|
||||||
// ricalcola (solo per il mese in corso!) operando sull'array
|
// ricalcola (solo per il mese in corso!) operando sull'array
|
||||||
for (int i = 0; i < items; i++)
|
for (int i = 0; i < items; i++)
|
||||||
{
|
{
|
||||||
_CorrItem* ci = (_CorrItem*)&_corr_arr[i];
|
_CorrItem* ci = (_CorrItem*)&_corr_arr[i];
|
||||||
// memorizza per codiva
|
// memorizza per codiva
|
||||||
// x13
|
|
||||||
if ((month != 13 && ci->_month != month) || ci->_codatt != codatt) continue;
|
|
||||||
|
|
||||||
key = ci->_codiva;
|
|
||||||
is_key = corr_ann.is_key(key);
|
|
||||||
cx._totale = 0;
|
|
||||||
_CorrItem& ca = is_key ? (_CorrItem&) corr_ann[key] : cx;
|
|
||||||
ca._totale += ci->_totale;
|
|
||||||
if (!is_key) // se non c'e' lo aggiunge
|
|
||||||
{
|
|
||||||
ca._aliquota = ci->_aliquota;
|
|
||||||
/*
|
|
||||||
ca._codreg = ci->_codreg;
|
|
||||||
ca._tipodet = ci->_tipodet;
|
|
||||||
*/
|
|
||||||
corr_ann.add(key,ca);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
continue;
|
|
||||||
// fine x13
|
|
||||||
|
|
||||||
if (ci->_month != month || ci->_codatt != codatt)
|
if (ci->_month != month || ci->_codatt != codatt)
|
||||||
continue;
|
continue;
|
||||||
@ -154,54 +100,7 @@ void TLiquidazione_app::recalc_corrispettivi(int month, const char* codatt)
|
|||||||
vaf += imponibile;
|
vaf += imponibile;
|
||||||
_pam->put("R1", vaf);
|
_pam->put("R1", vaf);
|
||||||
_pam->rewrite();
|
_pam->rewrite();
|
||||||
|
|
||||||
// Aggiorno i luridi pim
|
|
||||||
look_pim(month, codatt, ci->_codreg, "", ci->_codiva, ci->_tipodet, TRUE);
|
|
||||||
|
|
||||||
imponibile += _pim->get_real("R0");
|
|
||||||
imposta += _pim->get_real("R1");
|
|
||||||
_pim->put("R0", imponibile);
|
|
||||||
_pim->put("R1", imposta);
|
|
||||||
_pim->rewrite();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
// Dopo aver calcolato la somma dei corrispettivi annualmente, li scorpora
|
|
||||||
// x13
|
|
||||||
// if (month == 13)
|
|
||||||
//{
|
|
||||||
real imp,iva,imp1,iva1;
|
|
||||||
_CorrItem* cc;
|
|
||||||
// Per le prossime scritture(PAM e PLM) uso impropriamente il mese 12, lo so e' terribile...
|
|
||||||
// ma non appena possibile il mese 13 sara' disponibile tutto sara' piu' bello.
|
|
||||||
//const int m = month == 13 ? 12 : month;
|
|
||||||
for (cc = (_CorrItem *)corr_ann.first_item(); cc != NULL; cc = (_CorrItem *)corr_ann.succ_item())
|
|
||||||
{
|
|
||||||
lordo2netto(cc->_totale, imp, iva, cc->_aliquota);
|
|
||||||
imponibile += imp;
|
|
||||||
imposta += iva;
|
|
||||||
/*
|
|
||||||
look_pim(m, codatt, cc->_codreg, "", corr_ann.get_hashobj()->key(), cc->_tipodet, TRUE);
|
|
||||||
imp1 = _pim->get_real("R0");
|
|
||||||
iva1 = _pim->get_real("R1");
|
|
||||||
imp1 += imp;
|
|
||||||
iva1 += iva;
|
|
||||||
_pim->put("R0",imp1);
|
|
||||||
_pim->put("R1",iva1);
|
|
||||||
_pim->rewrite();
|
|
||||||
*/
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
look_plm(month, codatt); // Aggiorna l'iva vendite in PLM...
|
|
||||||
real ive = _plm->get_real("R0");
|
|
||||||
ive += imposta;
|
|
||||||
_plm->put("R0",ive);
|
|
||||||
// ed il volume d'affari in PAM
|
|
||||||
real vaf = _pam->get_real("R1");
|
|
||||||
vaf += imponibile;
|
|
||||||
_pam->put("R1",vaf);
|
|
||||||
_plm->rewrite();
|
|
||||||
_pam->rewrite();
|
|
||||||
// fine x13
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ricalcolo della malefica ventilazione
|
// ricalcolo della malefica ventilazione
|
||||||
@ -211,8 +110,6 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
|
|
||||||
TString att(codatt);
|
TString att(codatt);
|
||||||
|
|
||||||
TArray annual_vent;
|
|
||||||
Annual_item a_item;
|
|
||||||
|
|
||||||
// 1) ricalcola i pim dei mesi dal primo al corrente se necessario
|
// 1) ricalcola i pim dei mesi dal primo al corrente se necessario
|
||||||
recalc rcl = _recalc;
|
recalc rcl = _recalc;
|
||||||
@ -223,7 +120,9 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
|
|
||||||
_vent_arr.destroy();
|
_vent_arr.destroy();
|
||||||
|
|
||||||
for (m = 1; m <= month; m++)
|
m = month == 13 ? 13 : 1; // In annuale legge solo il PIM13
|
||||||
|
|
||||||
|
for (; m <= month; m++)
|
||||||
{
|
{
|
||||||
// aggiunge gli acquisti del mese m operando sui pim
|
// aggiunge gli acquisti del mese m operando sui pim
|
||||||
for (_pim->first(); !_pim->eof(); _pim->next())
|
for (_pim->first(); !_pim->eof(); _pim->next())
|
||||||
@ -275,33 +174,23 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
real totacq = 0.0;
|
real totacq = 0.0;
|
||||||
real totven = 0.0;
|
real totven = 0.0;
|
||||||
|
|
||||||
for (int j = 0; j < _vent_arr.items(); j++)
|
const int vent_items = _vent_arr.items();
|
||||||
|
for (int j = 0; j < vent_items; j++)
|
||||||
{
|
{
|
||||||
_VentItem& vv = (_VentItem&)_vent_arr[j];
|
_VentItem& vv = (_VentItem&)_vent_arr[j];
|
||||||
totacq += vv._totale;
|
totacq += vv._totale;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool is_annual_or_trim = (_month == 13 && month == 13) || (_freqviva == "T");
|
|
||||||
for (j = 0; is_annual_or_trim && j < _vend_arr.items(); j++)
|
|
||||||
{
|
|
||||||
_VendItem& vi = (_VendItem&)_vend_arr[j];
|
|
||||||
totven += vi._totale;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3) ricalcola (solo per il mese in corso!) operando sull'array
|
// 3) ricalcola (solo per il mese in corso!) operando sull'array
|
||||||
for (int i = 0; i < _vend_arr.items(); i++)
|
const int vend_items = _vend_arr.items();
|
||||||
|
for (int i = 0; i < vend_items; i++)
|
||||||
{
|
{
|
||||||
_VendItem* vi = (_VendItem*)&_vend_arr[i];
|
_VendItem* vi = (_VendItem*)&_vend_arr[i];
|
||||||
if (vi->_month != month && !is_annual_or_trim)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// questo serve solo per il prospettino di m.
|
|
||||||
if (!is_annual_or_trim)
|
|
||||||
totven += vi->_totale;
|
totven += vi->_totale;
|
||||||
|
|
||||||
// 3.2) calcola percentuali di ripartizione e prepara l'affettatrice
|
// 3.2) calcola percentuali di ripartizione e prepara l'affettatrice
|
||||||
TDistrib dst(!is_annual_or_trim ? vi->_totale : totven,ROUND_LIRA);
|
TDistrib dst(vi->_totale, ROUND_LIRA);
|
||||||
for (j = 0; j < _vent_arr.items(); j++)
|
for (j = 0; j < vent_items; j++)
|
||||||
{
|
{
|
||||||
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
||||||
dst.add(vv->_totale/totacq);
|
dst.add(vv->_totale/totacq);
|
||||||
@ -310,7 +199,7 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
// 3.3) affetta l'importo
|
// 3.3) affetta l'importo
|
||||||
real tlor = 0.0;
|
real tlor = 0.0;
|
||||||
|
|
||||||
for (j = 0; j < _vent_arr.items(); j++)
|
for (j = 0; j < vent_items; j++)
|
||||||
{
|
{
|
||||||
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
||||||
real imponibile = dst.get();
|
real imponibile = dst.get();
|
||||||
@ -331,17 +220,6 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
if ((totven - tlor) == real(1.0))
|
if ((totven - tlor) == real(1.0))
|
||||||
imposta += real(1.0);
|
imposta += real(1.0);
|
||||||
|
|
||||||
if (is_annual_or_trim)
|
|
||||||
{
|
|
||||||
// memorizza i dati della ventilazione annuale in un TArray
|
|
||||||
a_item.imposta() = imposta;
|
|
||||||
a_item.imponibile() = imponibile;
|
|
||||||
a_item.codiva() = vv->_codiva;
|
|
||||||
a_item.other() = vv->_other;
|
|
||||||
annual_vent.add(a_item);
|
|
||||||
continue;
|
|
||||||
} else if (_month != 13)
|
|
||||||
{
|
|
||||||
// aggiusto l'IVA vendite nei plm
|
// aggiusto l'IVA vendite nei plm
|
||||||
look_plm(month, codatt);
|
look_plm(month, codatt);
|
||||||
real ive = _plm->get_real("R0");
|
real ive = _plm->get_real("R0");
|
||||||
@ -375,73 +253,6 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
_pim->rewrite();
|
_pim->rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_annual_or_trim)
|
|
||||||
{
|
|
||||||
// Cazzeggia e riscrive i PIM/PAM/PLM (veid sopra) ripartendo equamente gli importi annuali
|
|
||||||
// tra i vari mesi, tipodet e codici IVA.
|
|
||||||
const int slices = _vend_arr.items();
|
|
||||||
const int a_items = annual_vent.items();
|
|
||||||
real perc(1.0),imp_fetta, iva_fetta, tot_imp, tot_iva, delta;
|
|
||||||
perc /= slices;
|
|
||||||
for (i = 0; i < a_items; i++)
|
|
||||||
{
|
|
||||||
Annual_item& item = (Annual_item&) annual_vent[i];
|
|
||||||
TDistrib imp_s(item.imponibile(),ROUND_LIRA);
|
|
||||||
TDistrib iva_s(item.imposta(),ROUND_LIRA);
|
|
||||||
tot_imp = 0.0; tot_iva = 0.0;
|
|
||||||
for (j = 0; j < slices; j++)
|
|
||||||
{
|
|
||||||
imp_s.add(perc); iva_s.add(perc);
|
|
||||||
}
|
|
||||||
for (j = 0; j < slices; j++)
|
|
||||||
{
|
|
||||||
_VendItem * vi = (_VendItem*) &_vend_arr[j];
|
|
||||||
imp_fetta = imp_s.get();
|
|
||||||
iva_fetta = iva_s.get();
|
|
||||||
tot_imp += imp_fetta; tot_iva += iva_fetta; // Serve per eventuali perdite di lirette...
|
|
||||||
if (j == (slices - 1))
|
|
||||||
{
|
|
||||||
delta = item.imponibile() - tot_imp;
|
|
||||||
if (!delta.is_zero()) imp_fetta += delta; // Aggiusta l'ultima fetta(IVA e IMPONIBILE)
|
|
||||||
delta = item.imposta() - tot_iva; // per eventali perdite di lire nella ripartizione
|
|
||||||
if (!delta.is_zero()) iva_fetta += delta;
|
|
||||||
}
|
|
||||||
// aggiusto l'IVA vendite nei plm
|
|
||||||
look_plm(vi->_month, codatt);
|
|
||||||
real ive = _plm->get_real("R0");
|
|
||||||
ive += iva_fetta;
|
|
||||||
_plm->put("R0",ive);
|
|
||||||
_plm->rewrite();
|
|
||||||
// .. e il volume di affari nei pam
|
|
||||||
real vaf = _pam->get_real("R1");
|
|
||||||
vaf += imp_fetta;
|
|
||||||
_pam->put("R1", vaf);
|
|
||||||
_pam->rewrite();
|
|
||||||
// Aggiorno i luridi pim
|
|
||||||
bool was = look_pim(vi->_month, codatt, vi->_codreg, "0", item.codiva(), vi->_tipodet, TRUE);
|
|
||||||
|
|
||||||
imp_fetta += _pim->get_real("R0");
|
|
||||||
iva_fetta += _pim->get_real("R1");
|
|
||||||
_pim->put("R0", imp_fetta);
|
|
||||||
_pim->put("R1", iva_fetta);
|
|
||||||
_pim->put("S4", item.other());
|
|
||||||
// segnale per comodita' in stampa prospetto
|
|
||||||
_pim->put("B1","X");
|
|
||||||
// se e' nuovo, il segnale per usare l'importo nel calcolo del rimborso
|
|
||||||
// viene amorosamente messo a quanto il codice IVA prevede
|
|
||||||
if (!was)
|
|
||||||
{
|
|
||||||
look_iva(item.codiva());
|
|
||||||
_pim->put("I1", (long)vendita);
|
|
||||||
if (!_iva->get_bool("B4")) _pim->put("B3", "X");
|
|
||||||
}
|
|
||||||
_pim->rewrite();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
totven = 0.0; // Questa va azzerato, poiche' quando ancora non era prevista
|
|
||||||
break; // la ventilazione annuale , registrava totven come 0.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// memorizza totali per il prospettino di m.
|
// memorizza totali per il prospettino di m.
|
||||||
look_plm(month, codatt);
|
look_plm(month, codatt);
|
||||||
@ -452,22 +263,6 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
_pam->rewrite();
|
_pam->rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// questa servIVA per il rimborso secondo le
|
|
||||||
// nuove cazzonorme, mai entrate in vigore ma
|
|
||||||
// devotamente programmate
|
|
||||||
//class rObj : public TObject
|
|
||||||
//{
|
|
||||||
//public:
|
|
||||||
// real _imp;
|
|
||||||
// real _iva;
|
|
||||||
// real _perc;
|
|
||||||
//
|
|
||||||
// rObj() {}
|
|
||||||
// virtual ~rObj() {}
|
|
||||||
//};
|
|
||||||
|
|
||||||
|
|
||||||
_DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
_DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
||||||
bool stliq)
|
bool stliq)
|
||||||
{
|
{
|
||||||
@ -490,7 +285,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
|||||||
if (is_mens) m = month; // per le mensili considera solo il mese attuale
|
if (is_mens) m = month; // per le mensili considera solo il mese attuale
|
||||||
else m = next_trim(month)-2; // per le trimestrali considera i mesi del trimestre
|
else m = next_trim(month)-2; // per le trimestrali considera i mesi del trimestre
|
||||||
|
|
||||||
if (month == 13) m = 1; // se annuale considera tutti i mesi
|
if (month == 13) m = 13; // se annuale considera solo il mese 13
|
||||||
|
|
||||||
// variabili per condizione 2
|
// variabili per condizione 2
|
||||||
real vtot = 0.0;
|
real vtot = 0.0;
|
||||||
@ -533,127 +328,6 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
|||||||
d->_r1 = vol_aff;
|
d->_r1 = vol_aff;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------- condizione 2
|
|
||||||
// u' casinu pazzescu d'u nuiu guvernu
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
Sembra che sia stato annullato subito dopo che ho finito di scrivere
|
|
||||||
queste 150 righe di casino
|
|
||||||
***********************************************************************
|
|
||||||
// due array dove ficcare i totali per
|
|
||||||
// codiva in ordine di imponibile
|
|
||||||
TArray varr, aarr;
|
|
||||||
|
|
||||||
// scorri i bellissimi progressivi mensili rimborso
|
|
||||||
for (_rmb->first(); !_rmb->eof(); _rmb->next())
|
|
||||||
{
|
|
||||||
int year = atoi((const char*)_year);
|
|
||||||
int ryear = atoi((const char*)(*_rmb_anno));
|
|
||||||
int rmese = atoi((const char*)(*_rmb_mese));
|
|
||||||
|
|
||||||
if (year != ryear || (rmese < (month - 2) || rmese > month))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
real imp = _rmb->get("R0");
|
|
||||||
real iva = _rmb->get("R1");
|
|
||||||
real per = _rmb->get("R2");
|
|
||||||
|
|
||||||
rObj* rb = new rObj;
|
|
||||||
rb->_imp = imp;
|
|
||||||
rb->_iva = iva;
|
|
||||||
rb->_perc = per;
|
|
||||||
|
|
||||||
TArray& arr = (tiporeg)atoi((const char*)(*_rmb_tiporeg)) == vendita ? varr : aarr;
|
|
||||||
|
|
||||||
for (int i = 0; i < arr.items(); i++)
|
|
||||||
{
|
|
||||||
rObj& robj = (rObj&)arr[i];
|
|
||||||
if (robj._imp < imp)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
arr.insert(rb, i);
|
|
||||||
|
|
||||||
// totali imponibili
|
|
||||||
if ((tiporeg)atoi((const char*)(*_rmb_tiporeg)) == vendita)
|
|
||||||
vtot += imp;
|
|
||||||
else
|
|
||||||
atot += imp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// se ci sono due o piu' imponibili uguali devo
|
|
||||||
// sostituire l'imposta con la media delle aliquote
|
|
||||||
// ciclo uguale sui due array
|
|
||||||
for (int w = 0; w < 2; w++)
|
|
||||||
{
|
|
||||||
TArray& arr = w == 0 ? varr : aarr;
|
|
||||||
for (int i = 0; i < arr.items(); i++)
|
|
||||||
{
|
|
||||||
rObj& robj = (rObj&)arr[i];
|
|
||||||
real impref = robj._imp;
|
|
||||||
real perc = robj._perc;
|
|
||||||
|
|
||||||
for (int j = i+1; j < arr.items(); j++)
|
|
||||||
{
|
|
||||||
rObj& rbj = (rObj&)arr[j];
|
|
||||||
if (rbj._imp != impref)
|
|
||||||
break;
|
|
||||||
perc += rbj._perc;
|
|
||||||
}
|
|
||||||
// riaggiustesbimo
|
|
||||||
if (j > i+1)
|
|
||||||
{
|
|
||||||
// funzionerebbe comunque ma risparmiamo una
|
|
||||||
// divisione per 1
|
|
||||||
real ndiv(j-i);
|
|
||||||
perc /= ndiv;
|
|
||||||
for (; i < j; i++)
|
|
||||||
{
|
|
||||||
rObj& rbj = (rObj&)arr[i];
|
|
||||||
rbj._iva = rbj._imp * (perc/CENTO);
|
|
||||||
rbj._iva.round(ROUND_LIRA);
|
|
||||||
}
|
|
||||||
i --;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 51 per cento
|
|
||||||
vtot *= PERC_IMP_RIMBORSABILE;
|
|
||||||
atot *= PERC_IMP_RIMBORSABILE;
|
|
||||||
|
|
||||||
for (w = 0; w < 2; w++)
|
|
||||||
{
|
|
||||||
TArray& arr = w == 0 ? varr : aarr;
|
|
||||||
real timp = w == 0 ? vtot : atot;
|
|
||||||
real tiva = 0.0;
|
|
||||||
|
|
||||||
for (int i = 0; i < arr.items(); i++)
|
|
||||||
{
|
|
||||||
rObj& robj = (rObj&)arr[i];
|
|
||||||
if (timp >= robj._imp)
|
|
||||||
{
|
|
||||||
tiva += robj._iva;
|
|
||||||
timp -= robj._imp;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
real perc = timp/robj._imp;
|
|
||||||
if (!perc.is_zero())
|
|
||||||
{
|
|
||||||
real ttiv = robj._iva * perc;
|
|
||||||
ttiv.round(ROUND_LIRA);
|
|
||||||
tiva += ttiv;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (w == 0) ivav = tiva;
|
|
||||||
else ivaa = tiva;
|
|
||||||
}
|
|
||||||
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
// Condizione 2...
|
// Condizione 2...
|
||||||
// scorri i bellissimi progressivi mensili
|
// scorri i bellissimi progressivi mensili
|
||||||
// Nota: i valori ricavati vanno poi integrati con R3, dove sono memorizzati i corrispettivi da scorporare
|
// Nota: i valori ricavati vanno poi integrati con R3, dove sono memorizzati i corrispettivi da scorporare
|
||||||
@ -681,10 +355,10 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
|||||||
if (!is_mens) // Trimestrali
|
if (!is_mens) // Trimestrali
|
||||||
{
|
{
|
||||||
if (year != ryear ||
|
if (year != ryear ||
|
||||||
(month != 13 && (rmese < (next_trim(month)-2) || rmese > month)))
|
(rmese < (next_trim(month)-2) || rmese > month))
|
||||||
continue;
|
continue;
|
||||||
} else // Mensili
|
} else // Mensili
|
||||||
if (year != ryear || (month != rmese && month != 13))
|
if (year != ryear || month != rmese)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int tipomov = (tiporeg)_pim->get_long("I1");
|
int tipomov = (tiporeg)_pim->get_long("I1");
|
||||||
|
142
cg/cg4304.cpp
142
cg/cg4304.cpp
@ -119,7 +119,6 @@ void TLiquidazione_app::describe_att(int month, const char* codatt,
|
|||||||
describe_agricolo(month, codatt);
|
describe_agricolo(month, codatt);
|
||||||
if (atts.items() == 1 && _isviaggio)
|
if (atts.items() == 1 && _isviaggio)
|
||||||
describe_viaggio(month, codatt);
|
describe_viaggio(month, codatt);
|
||||||
if (/* isresult || month == 13 */ TRUE)
|
|
||||||
describe_pims(month,codatt);
|
describe_pims(month,codatt);
|
||||||
if (atts.items() == 1)
|
if (atts.items() == 1)
|
||||||
describe_consistence(codatt);
|
describe_consistence(codatt);
|
||||||
@ -257,7 +256,8 @@ void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
|
|||||||
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
||||||
TString tipoiva = _iva->get("S1");
|
TString tipoiva = _iva->get("S1");
|
||||||
|
|
||||||
if (_year != *_pim_anno) continue;
|
if (_year != *_pim_anno || (month == 13 && mese < 13))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (imponibile.is_zero() && imposta.is_zero()) continue;
|
if (imponibile.is_zero() && imposta.is_zero()) continue;
|
||||||
|
|
||||||
@ -335,13 +335,7 @@ void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
|
|||||||
{
|
{
|
||||||
_DescrItem* d = new _DescrItem(REGAGR);
|
_DescrItem* d = new _DescrItem(REGAGR);
|
||||||
|
|
||||||
for (int mese = 1; mese <= month; mese++)
|
look_plm(month,codatt);
|
||||||
{
|
|
||||||
if (!is_month_ok(mese,month))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!look_plm(mese, codatt))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
d->_r0 += _plm->get_real("R5");
|
d->_r0 += _plm->get_real("R5");
|
||||||
d->_r1 += _plm->get_real("R6");
|
d->_r1 += _plm->get_real("R6");
|
||||||
@ -352,7 +346,6 @@ void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
|
|||||||
d->_r6 += _plm->get_real("R11");
|
d->_r6 += _plm->get_real("R11");
|
||||||
d->_r7 += _pum->get_real("R10");
|
d->_r7 += _pum->get_real("R10");
|
||||||
d->_r8 += _pum->get_real("R11");
|
d->_r8 += _pum->get_real("R11");
|
||||||
}
|
|
||||||
// Aggiungo anche questi per comodita' futura.
|
// Aggiungo anche questi per comodita' futura.
|
||||||
// in caso di ditta a regime agricolo
|
// in caso di ditta a regime agricolo
|
||||||
// alias:
|
// alias:
|
||||||
@ -374,10 +367,7 @@ void TLiquidazione_app::describe_viaggio(int month, const char* codatt)
|
|||||||
|
|
||||||
_DescrItem* d = new _DescrItem(REGVIA);
|
_DescrItem* d = new _DescrItem(REGVIA);
|
||||||
|
|
||||||
for (int mese = 1; mese <= month; mese++)
|
look_plm(month, codatt);
|
||||||
{
|
|
||||||
if (!is_month_ok(mese,month) || !look_plm(mese, codatt))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
d->_r0 += _plm->get_real("R5"); // corrispettivi CEE
|
d->_r0 += _plm->get_real("R5"); // corrispettivi CEE
|
||||||
d->_r1 += _plm->get_real("R9"); // corrispettivi misti CEE
|
d->_r1 += _plm->get_real("R9"); // corrispettivi misti CEE
|
||||||
@ -386,7 +376,6 @@ void TLiquidazione_app::describe_viaggio(int month, const char* codatt)
|
|||||||
d->_r4 += _plm->get_real("R10"); // acquisti misti parte CEE
|
d->_r4 += _plm->get_real("R10"); // acquisti misti parte CEE
|
||||||
d->_r5 += _plm->get_real("R8"); // acquisti fuori CEE
|
d->_r5 += _plm->get_real("R8"); // acquisti fuori CEE
|
||||||
d->_r6 += _plm->get_real("R11"); // acquisti misti parte fuori CEE
|
d->_r6 += _plm->get_real("R11"); // acquisti misti parte fuori CEE
|
||||||
}
|
|
||||||
|
|
||||||
// credito di costo precedente (CHECK annuale)
|
// credito di costo precedente (CHECK annuale)
|
||||||
d->_r8 = credito_costo_prec(month);
|
d->_r8 = credito_costo_prec(month);
|
||||||
@ -394,14 +383,6 @@ void TLiquidazione_app::describe_viaggio(int month, const char* codatt)
|
|||||||
// Solita minchiatina dell'arrotondamento alle 1000 lirette se siamo in annuale
|
// Solita minchiatina dell'arrotondamento alle 1000 lirette se siamo in annuale
|
||||||
if (month == 13)
|
if (month == 13)
|
||||||
{
|
{
|
||||||
//d->_r0.round(ROUND_MILLELIRE);
|
|
||||||
//d->_r1.round(ROUND_MILLELIRE);
|
|
||||||
//d->_r2.round(ROUND_MILLELIRE);
|
|
||||||
//d->_r3.round(ROUND_MILLELIRE);
|
|
||||||
//d->_r4.round(ROUND_MILLELIRE);
|
|
||||||
//d->_r5.round(ROUND_MILLELIRE);
|
|
||||||
//d->_r6.round(ROUND_MILLELIRE);
|
|
||||||
//d->_r8.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(d->_r0);
|
round_mille_lire(d->_r0);
|
||||||
round_mille_lire(d->_r1);
|
round_mille_lire(d->_r1);
|
||||||
round_mille_lire(d->_r2);
|
round_mille_lire(d->_r2);
|
||||||
@ -416,7 +397,6 @@ void TLiquidazione_app::describe_viaggio(int month, const char* codatt)
|
|||||||
d->_r9 = (d->_r1 * d->_r7)/CENTO;
|
d->_r9 = (d->_r1 * d->_r7)/CENTO;
|
||||||
|
|
||||||
if (month==13)
|
if (month==13)
|
||||||
//d->_r9.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(d->_r9);
|
round_mille_lire(d->_r9);
|
||||||
else
|
else
|
||||||
d->_r9.round(ROUND_LIRA);
|
d->_r9.round(ROUND_LIRA);
|
||||||
@ -429,7 +409,6 @@ void TLiquidazione_app::describe_viaggio(int month, const char* codatt)
|
|||||||
{
|
{
|
||||||
d->_r11 = (d->_r10/(alcnt/CENTO)) * (aliva/CENTO); // iva dovuta
|
d->_r11 = (d->_r10/(alcnt/CENTO)) * (aliva/CENTO); // iva dovuta
|
||||||
if (month == 13)
|
if (month == 13)
|
||||||
//d->_r11.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(d->_r11);
|
round_mille_lire(d->_r11);
|
||||||
else d->_r11.ceil(ROUND_LIRA);
|
else d->_r11.ceil(ROUND_LIRA);
|
||||||
}
|
}
|
||||||
@ -534,7 +513,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcmp((const char*)*_pim_codatt, att) == 0 &&
|
if (strcmp((const char*)*_pim_codatt, att) == 0 &&
|
||||||
(is_month_ok(atoi(*_pim_mese),month)) &&
|
(is_month_plain(atoi(*_pim_mese))) &&
|
||||||
_year == (const char*)*_pim_anno)
|
_year == (const char*)*_pim_anno)
|
||||||
{
|
{
|
||||||
// vedi se c'e' gia' un item corrispondente
|
// vedi se c'e' gia' un item corrispondente
|
||||||
@ -599,12 +578,10 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
real cvv = _pim->get_real("R1"); // iva totale
|
real cvv = _pim->get_real("R1"); // iva totale
|
||||||
real cfi = _pim->get_real("R13"); // imp. falsi corrispettivi
|
real cfi = _pim->get_real("R13"); // imp. falsi corrispettivi
|
||||||
real cfv = _pim->get_real("R14"); // iva falsi corrispettivi
|
real cfv = _pim->get_real("R14"); // iva falsi corrispettivi
|
||||||
// Qui comincia la modifica per l'errore MI3404...
|
// MI3404...
|
||||||
// Giochiamo sopra la particolarita' che se non e' un registro di corrispettivi
|
// Giochiamo sopra la particolarita' che se non e' un registro di corrispettivi
|
||||||
// allora se R5 o R6 sono <> 0 significa che trattasi di documento FS,
|
// allora se R5 o R6 sono <> 0 significa che trattasi di documento FS,
|
||||||
// che pertanto va stornato dal totale corrispettivi. (Cosi' vuole Vladimiro,
|
// che pertanto va stornato dal totale corrispettivi. (Cosi' volle Vladimiro)
|
||||||
// anche se sono sempre piu' convinto che sia una trojata).
|
|
||||||
// Va beh, OBBEDISCO.
|
|
||||||
real ifs(_pim->get_real("R5")); // imp. fatture con scontrino
|
real ifs(_pim->get_real("R5")); // imp. fatture con scontrino
|
||||||
real vfs(_pim->get_real("R6")); // iva fatture con scontrino
|
real vfs(_pim->get_real("R6")); // iva fatture con scontrino
|
||||||
if (!corrisp)
|
if (!corrisp)
|
||||||
@ -757,7 +734,10 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
|
|
||||||
TToken_string ttm("0|0|0");
|
TToken_string ttm("0|0|0");
|
||||||
|
|
||||||
for (int m = 1; m <= month && m < 13; m++)
|
const bool annual = month == 13;
|
||||||
|
const int limit = annual ? 13 : month;
|
||||||
|
int m = annual ? month : 1;
|
||||||
|
for (; m <= limit; m++)
|
||||||
{
|
{
|
||||||
if (!is_month_ok(m,month)) continue;
|
if (!is_month_ok(m,month)) continue;
|
||||||
|
|
||||||
@ -866,22 +846,15 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
if (pr > 0.0)
|
if (pr > 0.0)
|
||||||
{
|
{
|
||||||
topay = (iaq + ppg) * (pr / CENTO);
|
topay = (iaq + ppg) * (pr / CENTO);
|
||||||
//topay.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(topay);
|
round_mille_lire(topay);
|
||||||
}
|
}
|
||||||
co = topay - ppg;
|
co = topay - ppg;
|
||||||
//co.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(co);
|
round_mille_lire(co);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_DescrItem* dd = new _DescrItem(ANNUAL);
|
_DescrItem* dd = new _DescrItem(ANNUAL);
|
||||||
|
|
||||||
// MonsterFish: arrotonda alle 1000 LIRE B1,B2,B3,B4
|
// MonsterFish: arrotonda alle 1000 LIRE B1,B2,B3,B4
|
||||||
//e1.round(ROUND_MILLELIRE);
|
|
||||||
//e2.round(ROUND_MILLELIRE);
|
|
||||||
//e3.round(ROUND_MILLELIRE);
|
|
||||||
//ris.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(e1);
|
round_mille_lire(e1);
|
||||||
round_mille_lire(e2);
|
round_mille_lire(e2);
|
||||||
round_mille_lire(e3);
|
round_mille_lire(e3);
|
||||||
@ -977,18 +950,11 @@ _DescrItem* TLiquidazione_app::describe_deleghe(int month)
|
|||||||
{
|
{
|
||||||
real iva = _lim->get_real("R0") + _lim->get_real("R14");
|
real iva = _lim->get_real("R0") + _lim->get_real("R14");
|
||||||
if (month == 13)
|
if (month == 13)
|
||||||
//iva.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(iva);
|
round_mille_lire(iva);
|
||||||
if (iva >= IVA_DA_RIPORTARE)
|
if (iva >= IVA_DA_RIPORTARE)
|
||||||
_stampa_vers = TRUE;
|
_stampa_vers = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***13/02/1996
|
|
||||||
int mese = month;
|
|
||||||
if (_freqviva == "T" && _isannual) mese = 12;
|
|
||||||
if (!look_del(mese,7) && !stampa_vers) return NULL;
|
|
||||||
***/
|
|
||||||
|
|
||||||
_stampa_acc = (month == 12 && (_freqviva == "M" || (_isbenzinaro && _gest4)))
|
_stampa_acc = (month == 12 && (_freqviva == "M" || (_isbenzinaro && _gest4)))
|
||||||
||(month == 13 && _freqviva == "T" && !(_isbenzinaro && _gest4));
|
||(month == 13 && _freqviva == "T" && !(_isbenzinaro && _gest4));
|
||||||
|
|
||||||
@ -1077,10 +1043,7 @@ void TLiquidazione_app::describe_consistence(const char* codatt)
|
|||||||
|
|
||||||
void TLiquidazione_app::describe_error(const char* err, const char* codatt)
|
void TLiquidazione_app::describe_error(const char* err, const char* codatt)
|
||||||
{
|
{
|
||||||
//if (!_isprint || !_canprint) return;
|
|
||||||
//06/12/1995
|
|
||||||
if (!_isprint || !_canprint || (_isregis && _isfinal)) return;
|
if (!_isprint || !_canprint || (_isregis && _isfinal)) return;
|
||||||
//fine
|
|
||||||
_errors.add(new _ErrItem(err,codatt,_nditte->curr().get("CODDITTA")));
|
_errors.add(new _ErrItem(err,codatt,_nditte->curr().get("CODDITTA")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1212,7 +1175,6 @@ void TLiquidazione_app::set_att(_DescrItem& d)
|
|||||||
|
|
||||||
void TLiquidazione_app::set_plafond(_DescrItem& d)
|
void TLiquidazione_app::set_plafond(_DescrItem& d)
|
||||||
{
|
{
|
||||||
//if (_isregis) return;
|
|
||||||
if (_isregis && _isfinal) return;
|
if (_isregis && _isfinal) return;
|
||||||
|
|
||||||
set_bookmark("Quadro plafond", _att_bookmark);
|
set_bookmark("Quadro plafond", _att_bookmark);
|
||||||
@ -1254,7 +1216,8 @@ void TLiquidazione_app::set_plafond(_DescrItem& d)
|
|||||||
void TLiquidazione_app::set_liqacc(_DescrItem& d)
|
void TLiquidazione_app::set_liqacc(_DescrItem& d)
|
||||||
{
|
{
|
||||||
real r1 = d._r0 + d._r1 + d._r2 + d._r4;
|
real r1 = d._r0 + d._r1 + d._r2 + d._r4;
|
||||||
real r2 = d._r5;// + d._r10; //MI2258 (A me sembra una cagata, ma con certa gente non si riesce a parlare)
|
//real r2 = d._r5 + d._r10;
|
||||||
|
real r2 = d._r5; //MI2258 (A me sembra una cagata, ma con certa gente non si riesce a parlare)
|
||||||
real r3 = r2 + d._r9 + d._r7;
|
real r3 = r2 + d._r9 + d._r7;
|
||||||
if ((d._r3).sign() > 0) r1 += d._r3;
|
if ((d._r3).sign() > 0) r1 += d._r3;
|
||||||
else r3 += abs(d._r3);
|
else r3 += abs(d._r3);
|
||||||
@ -1522,7 +1485,7 @@ void TLiquidazione_app::set_pumpam(_DescrItem& d)
|
|||||||
printed = TRUE;
|
printed = TRUE;
|
||||||
real prc(dp.get(0));
|
real prc(dp.get(0));
|
||||||
|
|
||||||
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@69g%r",
|
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@58g%r",
|
||||||
(const char*)prc.string(), &(d._r11));
|
(const char*)prc.string(), &(d._r11));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1543,11 +1506,11 @@ void TLiquidazione_app::set_pumpam(_DescrItem& d)
|
|||||||
"@77gimposta@91gdetrazione");
|
"@77gimposta@91gdetrazione");
|
||||||
set_row(4,"");
|
set_row(4,"");
|
||||||
}
|
}
|
||||||
else /* if (!d._f1) */
|
else
|
||||||
set_row(1,"");
|
set_row(1,"");
|
||||||
|
|
||||||
// form feed
|
// form feed
|
||||||
/* if (printed || !d._f1) */ set_auto_ff(TRUE);
|
set_auto_ff(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TLiquidazione_app::set_grand(_DescrItem& d)
|
void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||||
@ -1644,7 +1607,6 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
|||||||
{
|
{
|
||||||
real iva = abs(risultato);
|
real iva = abs(risultato);
|
||||||
if (_isannual || _isriepilogo)
|
if (_isannual || _isriepilogo)
|
||||||
//iva.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(iva);
|
round_mille_lire(iva);
|
||||||
set_row(rw++,"@23gCREDITO ATTUALE@58g%r",&iva);
|
set_row(rw++,"@23gCREDITO ATTUALE@58g%r",&iva);
|
||||||
if (_is_visliq)
|
if (_is_visliq)
|
||||||
@ -1657,11 +1619,9 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_month == 13)
|
if (_month == 13)
|
||||||
//interessi.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(interessi);
|
round_mille_lire(interessi);
|
||||||
real iva = risultato + interessi;
|
real iva = risultato + interessi;
|
||||||
if (_isannual || _isriepilogo)
|
if (_isannual || _isriepilogo)
|
||||||
// iva.round(ROUND_MILLELIRE);
|
|
||||||
round_mille_lire(iva);
|
round_mille_lire(iva);
|
||||||
if (!iva.is_zero())
|
if (!iva.is_zero())
|
||||||
{
|
{
|
||||||
@ -1708,12 +1668,10 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
|||||||
|
|
||||||
// rapportini per rimborso infraannuale
|
// rapportini per rimborso infraannuale
|
||||||
// non si stampano se la stampa serve per la visualizz.
|
// non si stampano se la stampa serve per la visualizz.
|
||||||
//modifica del 07/07/1995
|
// solo in st.di prova in coda ai registri deve scendere
|
||||||
//*** solo in st.di prova in coda ai registri deve scendere
|
|
||||||
// il prospetto di rimborso
|
// il prospetto di rimborso
|
||||||
//*** sempre (cioe' in bollato e in prova) deve scendere
|
// sempre (cioe' in bollato e in prova) deve scendere
|
||||||
// il prospettino versamento (boh???????????????????)
|
// il prospettino versamento
|
||||||
//if (d._arr.items() > 0 && !_is_visliq && !_isregis)
|
|
||||||
if (d._arr.items() > 0 && !_is_visliq)
|
if (d._arr.items() > 0 && !_is_visliq)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < d._arr.items(); i++)
|
for (int i = 0; i < d._arr.items(); i++)
|
||||||
@ -1774,11 +1732,6 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
|||||||
else if (di._flags == DELEGA)
|
else if (di._flags == DELEGA)
|
||||||
{
|
{
|
||||||
int rr = rw;
|
int rr = rw;
|
||||||
/*
|
|
||||||
if (rw < (printer().formlen() - 10))
|
|
||||||
rw = printer().formlen() - 10;
|
|
||||||
*/
|
|
||||||
//11/10/1995
|
|
||||||
int cont = 10;
|
int cont = 10;
|
||||||
if (di._s4 == "ACC")
|
if (di._s4 == "ACC")
|
||||||
{
|
{
|
||||||
@ -1788,7 +1741,6 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
|||||||
}
|
}
|
||||||
if (rw < (printer().formlen() - cont))
|
if (rw < (printer().formlen() - cont))
|
||||||
rw = printer().formlen() - cont;
|
rw = printer().formlen() - cont;
|
||||||
//fine
|
|
||||||
|
|
||||||
for (int i = rr; i < rw; i++) set_row(i,"");
|
for (int i = rr; i < rw; i++) set_row(i,"");
|
||||||
|
|
||||||
@ -1800,7 +1752,6 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
|||||||
// la cincia non vuole lo zero
|
// la cincia non vuole lo zero
|
||||||
if (atof(vr) == 0.0 && vr[vr.len()-1] == '0') vr[vr.len()-1] = ' ';
|
if (atof(vr) == 0.0 && vr[vr.len()-1] == '0') vr[vr.len()-1] = ' ';
|
||||||
|
|
||||||
//11/10/1995
|
|
||||||
if (di._s4 == "ACC")
|
if (di._s4 == "ACC")
|
||||||
{
|
{
|
||||||
TToken_string ac(di._s5);
|
TToken_string ac(di._s5);
|
||||||
@ -1831,7 +1782,6 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
|||||||
set_row(rw++, "@68gConcessione %s", (const char*)loc);
|
set_row(rw++, "@68gConcessione %s", (const char*)loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if (_stampa_vers) set_row(rw++, "- SALDO -");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_stampa_acc && _stampa_vers) set_row(rw++, "- SALDO -");
|
if (_stampa_acc && _stampa_vers) set_row(rw++, "- SALDO -");
|
||||||
@ -1877,17 +1827,14 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
|
|||||||
bool ret = FALSE;
|
bool ret = FALSE;
|
||||||
|
|
||||||
int row = get_maxrow()+1;
|
int row = get_maxrow()+1;
|
||||||
//14/12/1995. Correzione errore MI0952
|
|
||||||
if (row == 1) row = 4;
|
if (row == 1) row = 4;
|
||||||
//fine
|
|
||||||
|
|
||||||
if (d._f0 & IS_PRORATA)
|
if (d._f0 & IS_PRORATA)
|
||||||
{
|
{
|
||||||
// non lo ha stampato prima se annuale, perche' vladimiro il nefido
|
// non lo ha stampato prima se annuale, perche' vladimiro il nefido
|
||||||
// pretende l'assurdo aggiornamento della perc. a quella nuova
|
// pretende l'assurdo aggiornamento della perc. a quella nuova
|
||||||
|
|
||||||
//set_row(++row, "%% PRO-RATA ed IVA non detraibile (%s%%)@69g%r",
|
row++;
|
||||||
// (const char*)(d._r2.string()), &(d._r6));
|
|
||||||
set_row(++row,"CALCOLO DELLA PERCENTUALE DI INDETRAIBILITA'");
|
set_row(++row,"CALCOLO DELLA PERCENTUALE DI INDETRAIBILITA'");
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
@ -1896,20 +1843,18 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
|
|||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
set_print_zero(TRUE);
|
set_print_zero(TRUE);
|
||||||
set_row(row++,"");
|
set_row(row++,"");
|
||||||
//set_row(row++,"CALCOLO DELLA PERCENTUALE DI INDETRAIBILITA'");
|
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@58g%r",
|
||||||
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@69g%r",
|
|
||||||
(const char*)(d._r2.string()), &(d._r6));
|
(const char*)(d._r2.string()), &(d._r6));
|
||||||
//set_row(row++,"");
|
|
||||||
set_row(row++,"B1 - Operazioni esenti, escluse da nr. 1 a 9 e 11 art. 10 %r", &(d._r1));
|
set_row(row++,"B1 - Operazioni esenti, escluse da nr. 1 a 9 e 11 art. 10 %r", &(d._r1));
|
||||||
set_row(row++,"B2 - Operazioni esenti, di cui nr. 11 art. 10 %r", &(d._r4));
|
set_row(row++,"B2 - Operazioni esenti, di cui nr. 11 art. 10 %r", &(d._r4));
|
||||||
set_row(row++,"B3 - Operazioni esenti da nr. 1 a 9 art. 10 %r", &(d._r5));
|
set_row(row++,"B3 - Operazioni esenti da nr. 1 a 9 art. 10 %r", &(d._r5));
|
||||||
set_row(row++,"Volume d'affari - B3 %r", &(d._r0));
|
set_row(row++,"Volume d'affari - B3 %r", &(d._r0));
|
||||||
set_row(row++,"Indetraibilita'@30g%r%%", &(d._r2));
|
set_row(row++,"Indetraibilita'@58g%r%%", &(d._r2));
|
||||||
if (!(d._r3.is_zero()))
|
if (!(d._r3.is_zero()))
|
||||||
{
|
{
|
||||||
const char* sss = d._r3.sign() < 0 ? "credito" : "debito";
|
const char* sss = d._r3.sign() < 0 ? "credito" : "debito";
|
||||||
real ccc = abs(d._r3);
|
real ccc = abs(d._r3);
|
||||||
set_row(row++,"Conguaglio a %s@30g%r", sss, &ccc);
|
set_row(row++,"Conguaglio a %s@58g%r", sss, &ccc);
|
||||||
}
|
}
|
||||||
set_print_zero(FALSE);
|
set_print_zero(FALSE);
|
||||||
}
|
}
|
||||||
@ -1982,7 +1927,6 @@ void TLiquidazione_app::set_regagr(_DescrItem& d)
|
|||||||
real ivadt_amm = agr_1 + agr_3 + ivadt;
|
real ivadt_amm = agr_1 + agr_3 + ivadt;
|
||||||
|
|
||||||
// percentuale detraibilita'
|
// percentuale detraibilita'
|
||||||
// real pdetr = ();
|
|
||||||
set_bookmark("Prospetto regime agricolo", _att_bookmark);
|
set_bookmark("Prospetto regime agricolo", _att_bookmark);
|
||||||
|
|
||||||
set_row(1,"@50gPROSPETTO REGIME AGRICOLO");
|
set_row(1,"@50gPROSPETTO REGIME AGRICOLO");
|
||||||
@ -2065,19 +2009,14 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
|
|||||||
real& cred_cos = d._r8;
|
real& cred_cos = d._r8;
|
||||||
real& ivm = d._r9;
|
real& ivm = d._r9;
|
||||||
|
|
||||||
//real perc_r = (acq_misCEE * CENTO)/(acq_misCEE + acq_misnoCEE); perc_r.round(2);
|
|
||||||
//real ivm = (corr_misCEE * perc_r)/CENTO; ivm.round(ROUND_LIRA);
|
|
||||||
real tc = (corr_CEE + ivm);
|
real tc = (corr_CEE + ivm);
|
||||||
real ta = (acq_CEE + acq_misCEE);
|
real ta = (acq_CEE + acq_misCEE);
|
||||||
//real bi = tc - ta - cred_cos;
|
|
||||||
real& bi = d._r10;
|
real& bi = d._r10;
|
||||||
real& dovuta = d._r11;
|
real& dovuta = d._r11;
|
||||||
|
|
||||||
real tcc = corr_CEE + corr_noCEE + corr_misCEE;
|
real tcc = corr_CEE + corr_noCEE + corr_misCEE;
|
||||||
real tco = acq_CEE + acq_noCEE + acq_misCEE + acq_misnoCEE;
|
real tco = acq_CEE + acq_noCEE + acq_misCEE + acq_misnoCEE;
|
||||||
real tma = acq_CEE + acq_misCEE;
|
real tma = acq_CEE + acq_misCEE;
|
||||||
// real rip = perc_r; rip.round(2);
|
|
||||||
// real cim = (d._r1 * d._r7)/CENTO; cim.round(ROUND_LIRA);
|
|
||||||
|
|
||||||
|
|
||||||
set_print_zero(TRUE);
|
set_print_zero(TRUE);
|
||||||
@ -2198,8 +2137,6 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
|
|||||||
{
|
{
|
||||||
real aliva = aliquota_agvia();
|
real aliva = aliquota_agvia();
|
||||||
real alcnt = aliva + CENTO;
|
real alcnt = aliva + CENTO;
|
||||||
//real dovuta = (bi/(alcnt/CENTO)) * (aliva/CENTO);
|
|
||||||
//dovuta.ceil(ROUND_LIRA); // ceil voluto da MI3074
|
|
||||||
|
|
||||||
tmp = bi.string(REAL_PICTURE); tmp.ltrim();
|
tmp = bi.string(REAL_PICTURE); tmp.ltrim();
|
||||||
up = tmp;
|
up = tmp;
|
||||||
@ -2228,38 +2165,26 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
|
|||||||
|
|
||||||
void TLiquidazione_app::set_acconto_p(_DescrItem& d)
|
void TLiquidazione_app::set_acconto_p(_DescrItem& d)
|
||||||
{
|
{
|
||||||
//set_print_zero(TRUE);
|
|
||||||
|
|
||||||
const char* errmsg[3] = {
|
const char* errmsg[3] = {
|
||||||
{"manca la tabella risultati liquidazione per l'anno corrente"},
|
{"manca la tabella risultati liquidazione per l'anno corrente"},
|
||||||
{"manca la tabella risultati liquidazione per l'anno precedente"},
|
{"manca la tabella risultati liquidazione per l'anno precedente"},
|
||||||
{"manca la tabella dichiarazione annuale per l'anno precedente"}};
|
{"manca la tabella dichiarazione annuale per l'anno precedente"}};
|
||||||
|
|
||||||
set_row(1,"%t@7g%t",&(d._s0), &(d._s1));
|
set_row(1,"%t@7g%t",&(d._s0), &(d._s1));
|
||||||
if (d._f2)
|
if (d._f2)
|
||||||
set_row(1,"@50g@b*** %s ***@r", errmsg[d._f2 -1]);
|
set_row(1,"@50g@b*** %s ***@r", errmsg[d._f2 -1]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (d._f0) // base anno in corso
|
if (d._f0) // base anno in corso
|
||||||
{
|
{
|
||||||
if (d._f1) // stampa base di calcolo
|
if (d._f1) // stampa base di calcolo
|
||||||
{
|
{
|
||||||
/***
|
|
||||||
real bc = d._r0;
|
|
||||||
if (bc.sign() < 0)
|
|
||||||
{
|
|
||||||
bc = abs(bc);
|
|
||||||
set_row(1,"@73g%r@86g%r@119g%s", &bc, &d._r1,
|
|
||||||
d._f3 ? "Si" : "No");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
set_row(1,"@55g%r@86g%r@119g%s", &bc, &(d._r1),
|
|
||||||
d._f3 ? "Si" : "No");
|
|
||||||
***/
|
|
||||||
set_row(1,"@58g%r@74g%r@96g%r@122g%s", &(d._r3),
|
set_row(1,"@58g%r@74g%r@96g%r@122g%s", &(d._r3),
|
||||||
&(d._r2), &(d._r1), d._f3 ? "Si" : "No");
|
&(d._r2), &(d._r1), d._f3 ? "Si" : "No");
|
||||||
}
|
}
|
||||||
else set_row(1,"@62g%r@91g%s", &(d._r1), d._f3 ? "Si" : "No");
|
else
|
||||||
|
set_row(1,"@62g%r@91g%s", &(d._r1), d._f3 ? "Si" : "No");
|
||||||
}
|
}
|
||||||
else //metodo storico
|
else //metodo storico
|
||||||
{
|
{
|
||||||
@ -2268,8 +2193,7 @@ else
|
|||||||
else
|
else
|
||||||
set_row(1,"@87g%r",&(d._r1));
|
set_row(1,"@87g%r",&(d._r1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//set_print_zero(FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TLiquidazione_app::set_acchead_p(_DescrItem& d)
|
void TLiquidazione_app::set_acchead_p(_DescrItem& d)
|
||||||
@ -2383,8 +2307,6 @@ void TLiquidazione_app::set_deltab(_DescrItem& d, bool iscred)
|
|||||||
tel << tt.get(9);
|
tel << tt.get(9);
|
||||||
TString desc(tt.get(10));
|
TString desc(tt.get(10));
|
||||||
|
|
||||||
//tp += in; //comprendeva gia' gli interessi!
|
|
||||||
|
|
||||||
set_row(rw++, "%-5s@8g%-30s@40g%1s %s @55g%r %5s %5s %3s %-.45s",
|
set_row(rw++, "%-5s@8g%-30s@40g%1s %s @55g%r %5s %5s %3s %-.45s",
|
||||||
(const char*)cod, (const char*)diocantaro, (const char*)frq,
|
(const char*)cod, (const char*)diocantaro, (const char*)frq,
|
||||||
(const char*)tel, &tp, (const char*)abi,
|
(const char*)tel, &tp, (const char*)abi,
|
||||||
|
@ -106,8 +106,6 @@ bool TLiquidazione_app::extract_deleghe()
|
|||||||
{
|
{
|
||||||
_isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74_4");
|
_isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74_4");
|
||||||
bool mens = _freqviva == "M";
|
bool mens = _freqviva == "M";
|
||||||
//_isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
|
||||||
// (_month == 13 && (mens || _isbenzinaro));
|
|
||||||
_isriepilogo = _month == 13;
|
_isriepilogo = _month == 13;
|
||||||
_isendliq = _isannual || _isriepilogo;
|
_isendliq = _isannual || _isriepilogo;
|
||||||
|
|
||||||
@ -179,7 +177,6 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
|
|||||||
real nrnd = topay;
|
real nrnd = topay;
|
||||||
topay.round(-3); // importo totale del versamento arrotondato
|
topay.round(-3); // importo totale del versamento arrotondato
|
||||||
|
|
||||||
//bool wasdel = look_del(month, _isannual ? 2 : 1);
|
|
||||||
bool wasdel = look_del(month, 1);
|
bool wasdel = look_del(month, 1);
|
||||||
|
|
||||||
//la stampa deve essere fatta sia se a credito che a debito
|
//la stampa deve essere fatta sia se a credito che a debito
|
||||||
@ -193,7 +190,6 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
|
|||||||
tt->add("");
|
tt->add("");
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (topay.sign() > 0)
|
|
||||||
if (versare)
|
if (versare)
|
||||||
{
|
{
|
||||||
look_del(month, 1, TRUE); //ci mette abi, cab o con
|
look_del(month, 1, TRUE); //ci mette abi, cab o con
|
||||||
@ -219,12 +215,6 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc)
|
|||||||
tt->add(_del->get("S9"));
|
tt->add(_del->get("S9"));
|
||||||
tt->add(_nditte->curr().get("PTEL"));
|
tt->add(_nditte->curr().get("PTEL"));
|
||||||
tt->add(_nditte->curr().get("TEL"));
|
tt->add(_nditte->curr().get("TEL"));
|
||||||
/***
|
|
||||||
TString desc(_del->get("S1"));
|
|
||||||
if (desc.not_empty())
|
|
||||||
tt->add(desc);
|
|
||||||
else tt->add(_del->get("S2"));
|
|
||||||
***/
|
|
||||||
TString desc;
|
TString desc;
|
||||||
if (_del->get("S9").not_empty())
|
if (_del->get("S9").not_empty())
|
||||||
{
|
{
|
||||||
@ -355,9 +345,6 @@ bool TLiquidazione_app::set_acconto(real& inf, real& ina)
|
|||||||
_isbase = m.get_bool(CHK_CGC_BASE);
|
_isbase = m.get_bool(CHK_CGC_BASE);
|
||||||
_basecalc = (tbc)m.get_long(RDB_CGC_BASE);
|
_basecalc = (tbc)m.get_long(RDB_CGC_BASE);
|
||||||
|
|
||||||
//inf = real(m.get(FLD_CGC_INF));
|
|
||||||
//ina = real(m.get(FLD_CGC_INA));
|
|
||||||
|
|
||||||
inf = ina = ZERO;
|
inf = ina = ZERO;
|
||||||
|
|
||||||
switch (k)
|
switch (k)
|
||||||
@ -456,11 +443,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
|||||||
real acq_intr = 0.0;
|
real acq_intr = 0.0;
|
||||||
bool isdifferita = FALSE;
|
bool isdifferita = FALSE;
|
||||||
bool error = FALSE;
|
bool error = FALSE;
|
||||||
// MI3262
|
// MI3262...
|
||||||
//{
|
|
||||||
// TConfig cnf(CONFIG_DITTA, "cg");
|
|
||||||
// isdifferita = cnf.get_bool("GeLiDi");
|
|
||||||
//}
|
|
||||||
isdifferita = is_differita();
|
isdifferita = is_differita();
|
||||||
TString16 tipo_acc;
|
TString16 tipo_acc;
|
||||||
|
|
||||||
@ -598,9 +581,6 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
|||||||
// calcola l'acconto
|
// calcola l'acconto
|
||||||
if (look_lim(12)) //posiziona anche la tabella lam
|
if (look_lim(12)) //posiziona anche la tabella lam
|
||||||
{
|
{
|
||||||
// bc = result_liq(12);
|
|
||||||
// somma i non fatturati/non annotati
|
|
||||||
// bc += inf + ina;
|
|
||||||
cre = _lim->get_real("R12");
|
cre = _lim->get_real("R12");
|
||||||
|
|
||||||
//quando calcolo la 12° ci vado a sommare il
|
//quando calcolo la 12° ci vado a sommare il
|
||||||
@ -613,7 +593,6 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
|||||||
|
|
||||||
if (bc.sign() > 0) acc = bc;
|
if (bc.sign() > 0) acc = bc;
|
||||||
|
|
||||||
// 11/09/1995
|
|
||||||
iva_ven = _lam->get_real("R0"); //iva sulle vendite annotate fino al 20/12
|
iva_ven = _lam->get_real("R0"); //iva sulle vendite annotate fino al 20/12
|
||||||
iva_acq = _lam->get_real("R1"); //iva sugli acquisti annotati fino al 20/12
|
iva_acq = _lam->get_real("R1"); //iva sugli acquisti annotati fino al 20/12
|
||||||
cre_pre = _lam->get_real("R2"); //credito precedente
|
cre_pre = _lam->get_real("R2"); //credito precedente
|
||||||
@ -650,14 +629,10 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
|||||||
// pulisci il water
|
// pulisci il water
|
||||||
_comp_acconto = FALSE;
|
_comp_acconto = FALSE;
|
||||||
_isprint = FALSE;
|
_isprint = FALSE;
|
||||||
/*
|
|
||||||
update_firm(12);
|
|
||||||
*/
|
|
||||||
for (int i = 1; i <= _month; i++)
|
for (int i = 1; i <= _month; i++)
|
||||||
if (is_month_plain(i))
|
if (is_month_plain(i))
|
||||||
update_firm(i);
|
update_firm(i);
|
||||||
|
|
||||||
//18/10/1995
|
|
||||||
_lim->put("B0","");
|
_lim->put("B0","");
|
||||||
_lim->rewrite();
|
_lim->rewrite();
|
||||||
if (look_lim(13))
|
if (look_lim(13))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user