Patch level : 10.0

Files correlati     : ce2.exe ce3.exe
Ricompilazione Demo : [ ]
Commento            :
0001094: finanziaria 2009
La finanziaria del 2009 prevede di NON applicare la riduzione dell'aliquota al 50% per il primo anno. Mi servirebbe urgentemente la modifica.


git-svn-id: svn://10.65.10.50/trunk@18022 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-01-14 09:51:53 +00:00
parent 0f45d2c98d
commit 84e255f919
4 changed files with 62 additions and 67 deletions

View File

@ -1,18 +1,7 @@
#include "ce2100a.h" #include "ce2100a.h"
TOOLBAR "topbar" 0 0 0 2 TOOLBAR "topbar" 0 0 0 2
#include <elabar.h>
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -11 "~Elabora"
PICTURE BMP_ELABORA
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -11 ""
END
ENDPAGE ENDPAGE
PAGE "Calcolo ammortamenti" -1 -1 78 18 PAGE "Calcolo ammortamenti" -1 -1 78 18

View File

@ -17,7 +17,6 @@
#include "../cg/cglib01.h" #include "../cg/cglib01.h"
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Utility // Utility
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -1274,9 +1273,14 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
if (_salini.get_int(SALCE_ANNIAMM) == 0 && tipo() == tc_materiale && !cce.professionista()) if (_salini.get_int(SALCE_ANNIAMM) == 0 && tipo() == tc_materiale && !cce.professionista())
{ {
const real numele = _salpro.get_real(SALCE_NUMELE)+tmv.get_real(MOVCE_NUMELE); real mva1 = mov_val_amm(tmv); // Valore ammortizzabile di un singolo elemento
const real mva = mov_val_amm(tmv) / numele; if (mva1 > ZERO)
if (ammini_get_bool(AMMCE_CSCEN) && mva < un_milione()) {
const real numele = _salpro.get_real(SALCE_NUMELE)+tmv.get_real(MOVCE_NUMELE);
if (numele > ZERO)
mva1 /= numele;
}
if (ammini_get_bool(AMMCE_CSCEN) && mva1 < un_milione())
{ {
ammmv.put(AMMMV_PENOR, CENTO); ammmv.put(AMMMV_PENOR, CENTO);
ammmv.zero(AMMMV_PEANT); ammmv.zero(AMMMV_PEANT);
@ -1284,9 +1288,14 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
} }
else else
{ {
ammmv.put(AMMMV_PENOR, ammmv.get_real(AMMMV_PNOR)/2.0); // La finanziaria 2009 permette l'ammortamento civilistico al 100%
ammmv.put(AMMMV_PEANT, ammmv.get_real(AMMMV_PANT)/2.0); // dei cespiti acquistati dal 2007
ammmv.put(AMMMV_PEACC, ammmv.get_real(AMMMV_PACC)/2.0); if (ammmv.get_int(AMMMV_TPAMM) != 2 || tmv.get_date(MOVCE_DTMOV).year() < 2007)
{
ammmv.put(AMMMV_PENOR, ammmv.get_real(AMMMV_PNOR)/2.0);
ammmv.put(AMMMV_PEANT, ammmv.get_real(AMMMV_PANT)/2.0);
ammmv.put(AMMMV_PEACC, ammmv.get_real(AMMMV_PACC)/2.0);
}
} }
} }
real resamm = mov_res_amm(tmv, tmvam); real resamm = mov_res_amm(tmv, tmvam);
@ -1795,9 +1804,9 @@ void TCespite::calc_amm_residui(bool is_valid)
else // Nessuna forzatura else // Nessuna forzatura
{ {
// Leggo percentuali teoriche da AMMINI // Leggo percentuali teoriche da AMMINI
_ammpro.put(AMMCE_PNOR, ammini_get(AMMCE_PNOR)); _ammpro.put(AMMCE_PNOR, ammini_get_real(AMMCE_PNOR));
_ammpro.put(AMMCE_PANT, ammini_get(AMMCE_PANT)); _ammpro.put(AMMCE_PANT, ammini_get_real(AMMCE_PANT));
_ammpro.put(AMMCE_PACC, ammini_get(AMMCE_PACC)); _ammpro.put(AMMCE_PACC, ammini_get_real(AMMCE_PACC));
// Percentuale minima quote perse // Percentuale minima quote perse
real pmat = get_real(CESPI_PMAT) / 2.0; real pmat = get_real(CESPI_PMAT) / 2.0;
@ -1805,15 +1814,15 @@ void TCespite::calc_amm_residui(bool is_valid)
if (tc == tc_materiale && _salini.get_int(SALCE_ANNIAMM) == 0 && if (tc == tc_materiale && _salini.get_int(SALCE_ANNIAMM) == 0 &&
!cce.professionista() && dtfunz >= inies) !cce.professionista() && dtfunz >= inies)
{ {
// Calcolo il valore di un singolo elemento (se non nullo!) // Calcolo il valore di un singolo elemento per vedere se e' inferiore al milione di lire
real vam = val_amm(); real vam1 = val_amm();
if (vam > ZERO) if (vam1 > ZERO)
{ {
const real numele = _salpro.get_real(SALCE_NUMELE); const real numele = _salpro.get_real(SALCE_NUMELE);
if (numele > ZERO) if (numele > ZERO)
vam /= numele; vam1 /= numele;
} }
if (ammini_get_bool(AMMCE_CSCEN) && vam < un_milione()) if (ammini_get_bool(AMMCE_CSCEN) && vam1 < un_milione())
{ {
_ammpro.put(AMMCE_PNOR, CENTO); _ammpro.put(AMMCE_PNOR, CENTO);
_ammpro.zero(AMMCE_PANT); _ammpro.zero(AMMCE_PACC); _ammpro.zero(AMMCE_PANT); _ammpro.zero(AMMCE_PACC);
@ -1834,11 +1843,16 @@ void TCespite::calc_amm_residui(bool is_valid)
} }
else else
{ {
ammpro_put_perc(AMMCE_PNOR, ammini_get_real(AMMCE_PNOR)/2.0); // La finanziaria 2009 permette l'ammortamento civilistico al 100%
ammpro_put_perc(AMMCE_PANT, ammini_get_real(AMMCE_PANT)/2.0); // anche dei cespiti acquistati dal 2007
ammpro_put_perc(AMMCE_PACC, ammini_get_real(AMMCE_PACC)/2.0); if (_ammpro.get_int(AMMCE_TPAMM) != 2 || dtfunz.year() < 2007)
pmat /= 2.0; pmat.round(3); {
_ammpro.put(AMMCE_MSG01, "X"); // Ammortamento al 50% nel primo esercizio ammpro_put_perc(AMMCE_PNOR, ammini_get_real(AMMCE_PNOR)/2.0);
ammpro_put_perc(AMMCE_PANT, ammini_get_real(AMMCE_PANT)/2.0);
ammpro_put_perc(AMMCE_PACC, ammini_get_real(AMMCE_PACC)/2.0);
pmat /= 2.0; pmat.round(3);
_ammpro.put(AMMCE_MSG01, "X"); // Ammortamento al 40-50-80-90% nel primo esercizio
}
} }
} }
} }
@ -1864,7 +1878,7 @@ void TCespite::calc_amm_residui(bool is_valid)
resamm -= qnor + _ammpro.get_real(AMMCE_FPRIVATO); resamm -= qnor + _ammpro.get_real(AMMCE_FPRIVATO);
const real pacc = _ammpro.get_real(AMMCE_PACC); const real pacc = _ammpro.get_real(AMMCE_PACC);
if (resamm > ZERO && pacc > ZERO && quote_perse == ZERO) if (resamm > ZERO && pacc > ZERO && quote_perse.is_zero())
{ {
const real qacc = calc_quota(val_amm(), pacc, resamm, per_eff); const real qacc = calc_quota(val_amm(), pacc, resamm, per_eff);
_ammpro.put(AMMCE_QACC, qacc); _ammpro.put(AMMCE_QACC, qacc);

View File

@ -757,46 +757,49 @@ void TRegistro_cespiti::print_valorifinali()
TPrint_section& section = _form->get_valorifinali(); TPrint_section& section = _form->get_valorifinali();
bool msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG01); bool msg = recammce.get_bool(AMMCE_MSG01);
section.find_field(FR_FE_MSG1).enable(msg); section.find_field(FR_FE_MSG1).enable(msg);
msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG02); msg = recammce.get_bool(AMMCE_MSG02);
TString80 key; key.format("%04d",_mask->get_int(F_ESERCIZIO)); TString key; key.format("%04d",_mask->get_int(F_ESERCIZIO));
const TRectype& cce = cache().get("CCE", key); const TRectype& cce = cache().get("CCE", key);
long giorni = (_mask->get_date(F_DATAFINE) - _mask->get_date(F_DATAINIZIO) + 1); const long giorni = (_mask->get_date(F_DATAFINE) - _mask->get_date(F_DATAINIZIO) + 1);
key.format(FR("Amm.to ragguagliato all'esercizio di %3d giorni su %3d"),giorni, cce.get_int("I3")); key.format(FR("Amm.to ragguagliato all'esercizio di %3d giorni su %3d"), giorni, cce.get_int("I3"));
section.find_field(FR_FE_MSG2).set(key); section.find_field(FR_FE_MSG2).set(key);
section.find_field(FR_FE_MSG2).enable(msg); section.find_field(FR_FE_MSG2).enable(msg);
msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG03); msg = recammce.get_bool(AMMCE_MSG03);
const int usoprom = _form->cursor()->curr().get_int(CESPI_USOPROM); const int usoprom = _form->cursor()->curr().get_int(CESPI_USOPROM);
if (usoprom==2 || usoprom==4) switch (usoprom)
key=TR("Ammortamento ridotto al 50% per bene in uso promiscuo"); {
else if (usoprom==3 || usoprom==5) case 2: key=TR("Ammortamento ridotto al 50% per bene in uso promiscuo"); break;
key=TR("Ammortamento ridotto all'80% per bene in uso promiscuo"); case 3: key=TR("Ammortamento ridotto all'80% per bene in uso promiscuo agenti/rappresentanti"); break;
case 4: key=TR("Ammortamento ridotto al 40% per auto in uso promiscuo"); break;
case 5: key=TR("Ammortamento ridotto al 90% per auto in fringe benefit"); break;
case 6: key=TR("Ammortamento ridotto all'80% per cellulari in uso promiscuo"); break;
default: break;
}
section.find_field(FR_FE_MSG3).set(key); section.find_field(FR_FE_MSG3).set(key);
section.find_field(FR_FE_MSG3).enable(msg); section.find_field(FR_FE_MSG3).enable(msg);
msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG04); msg = recammce.get_bool(AMMCE_MSG04);
section.find_field(FR_FE_MSG4).enable(msg); section.find_field(FR_FE_MSG4).enable(msg);
msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG05); msg = recammce.get_bool(AMMCE_MSG05);
section.find_field(FR_FE_MSG5).enable(msg); section.find_field(FR_FE_MSG5).enable(msg);
msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG06); msg = recammce.get_bool(AMMCE_MSG06);
section.find_field(FR_FE_MSG6).enable(msg); section.find_field(FR_FE_MSG6).enable(msg);
section.update(); section.update();
_form->set_pagina(); _form->set_pagina();
word y1 = section.find_field(FR_FE_QNOR).y(); const word y1 = section.find_field(FR_FE_QNOR).y();
word y2 = section.find_field(FR_FE_MSG6).y(); const word y2 = section.find_field(FR_FE_MSG6).y();
for (word i = 0; i < section.height(); i++) for (word i = 0; i < section.height(); i++)
{ {
TPrintrow& row = section.row(i);
if (i+1>=y1 && i+1<= y2) if (i+1>=y1 && i+1<= y2)
{ {
TPrintrow& row = section.row(i); const TFixed_string rowstr(row.row());
TString256 rowstr = row.row(); if (rowstr.blank())
if (!rowstr.blank()) continue;
printer().print(section.row(i));
} }
else printer().print(row);
printer().print(section.row(i));
} }
return;
} }
void TRegistro_cespiti::header_categoria(const int categoria) void TRegistro_cespiti::header_categoria(const int categoria)

View File

@ -1,18 +1,7 @@
#include "ce3100a.h" #include "ce3100a.h"
TOOLBAR "topbar" 0 0 0 2 TOOLBAR "topbar" 0 0 0 2
#include <printbar.h>
BUTTON DLG_PRINT 10 2
BEGIN
PROMPT -12 -11 ""
PICTURE BMP_PRINT
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -11 ""
END
ENDPAGE ENDPAGE
PAGE "Stampa Registro cespiti" -1 -1 78 6 PAGE "Stampa Registro cespiti" -1 -1 78 6