From 84e255f919eaf4c9b1edf0bdd87c8e959b57a9c8 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 14 Jan 2009 09:51:53 +0000 Subject: [PATCH] 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 --- ce/ce2100a.uml | 13 +----------- ce/ce2101.cpp | 56 +++++++++++++++++++++++++++++++------------------- ce/ce3100.cpp | 47 ++++++++++++++++++++++-------------------- ce/ce3100a.uml | 13 +----------- 4 files changed, 62 insertions(+), 67 deletions(-) diff --git a/ce/ce2100a.uml b/ce/ce2100a.uml index 9b7514e2f..010ced748 100755 --- a/ce/ce2100a.uml +++ b/ce/ce2100a.uml @@ -1,18 +1,7 @@ #include "ce2100a.h" TOOLBAR "topbar" 0 0 0 2 - -BUTTON DLG_OK 10 2 -BEGIN - PROMPT -12 -11 "~Elabora" - PICTURE BMP_ELABORA -END - -BUTTON DLG_QUIT 10 2 -BEGIN - PROMPT -22 -11 "" -END - +#include ENDPAGE PAGE "Calcolo ammortamenti" -1 -1 78 18 diff --git a/ce/ce2101.cpp b/ce/ce2101.cpp index 78fbf1a4c..afce8c224 100755 --- a/ce/ce2101.cpp +++ b/ce/ce2101.cpp @@ -17,7 +17,6 @@ #include "../cg/cglib01.h" - /////////////////////////////////////////////////////////// // 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()) { - const real numele = _salpro.get_real(SALCE_NUMELE)+tmv.get_real(MOVCE_NUMELE); - const real mva = mov_val_amm(tmv) / numele; - if (ammini_get_bool(AMMCE_CSCEN) && mva < un_milione()) + real mva1 = mov_val_amm(tmv); // Valore ammortizzabile di un singolo elemento + if (mva1 > ZERO) + { + 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.zero(AMMMV_PEANT); @@ -1284,9 +1288,14 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm } else { - 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); + // La finanziaria 2009 permette l'ammortamento civilistico al 100% + // dei cespiti acquistati dal 2007 + 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); @@ -1795,9 +1804,9 @@ void TCespite::calc_amm_residui(bool is_valid) else // Nessuna forzatura { // Leggo percentuali teoriche da AMMINI - _ammpro.put(AMMCE_PNOR, ammini_get(AMMCE_PNOR)); - _ammpro.put(AMMCE_PANT, ammini_get(AMMCE_PANT)); - _ammpro.put(AMMCE_PACC, ammini_get(AMMCE_PACC)); + _ammpro.put(AMMCE_PNOR, ammini_get_real(AMMCE_PNOR)); + _ammpro.put(AMMCE_PANT, ammini_get_real(AMMCE_PANT)); + _ammpro.put(AMMCE_PACC, ammini_get_real(AMMCE_PACC)); // Percentuale minima quote perse 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 && !cce.professionista() && dtfunz >= inies) { - // Calcolo il valore di un singolo elemento (se non nullo!) - real vam = val_amm(); - if (vam > ZERO) + // Calcolo il valore di un singolo elemento per vedere se e' inferiore al milione di lire + real vam1 = val_amm(); + if (vam1 > ZERO) { const real numele = _salpro.get_real(SALCE_NUMELE); 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.zero(AMMCE_PANT); _ammpro.zero(AMMCE_PACC); @@ -1834,11 +1843,16 @@ void TCespite::calc_amm_residui(bool is_valid) } else { - 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 50% nel primo esercizio + // La finanziaria 2009 permette l'ammortamento civilistico al 100% + // anche dei cespiti acquistati dal 2007 + if (_ammpro.get_int(AMMCE_TPAMM) != 2 || dtfunz.year() < 2007) + { + 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); 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); _ammpro.put(AMMCE_QACC, qacc); diff --git a/ce/ce3100.cpp b/ce/ce3100.cpp index 711bb2e2a..a627e6e9b 100755 --- a/ce/ce3100.cpp +++ b/ce/ce3100.cpp @@ -757,46 +757,49 @@ void TRegistro_cespiti::print_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); - msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG02); - TString80 key; key.format("%04d",_mask->get_int(F_ESERCIZIO)); + msg = recammce.get_bool(AMMCE_MSG02); + TString key; key.format("%04d",_mask->get_int(F_ESERCIZIO)); const TRectype& cce = cache().get("CCE", key); - 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")); + 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")); section.find_field(FR_FE_MSG2).set(key); 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); - if (usoprom==2 || usoprom==4) - key=TR("Ammortamento ridotto al 50% per bene in uso promiscuo"); - else if (usoprom==3 || usoprom==5) - key=TR("Ammortamento ridotto all'80% per bene in uso promiscuo"); + switch (usoprom) + { + case 2: key=TR("Ammortamento ridotto al 50% per bene in uso promiscuo"); break; + 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).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); - msg = _form->cursor()->curr(LF_AMMCE).get_bool(AMMCE_MSG05); + msg = recammce.get_bool(AMMCE_MSG05); 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.update(); _form->set_pagina(); - word y1 = section.find_field(FR_FE_QNOR).y(); - word y2 = section.find_field(FR_FE_MSG6).y(); + const word y1 = section.find_field(FR_FE_QNOR).y(); + const word y2 = section.find_field(FR_FE_MSG6).y(); for (word i = 0; i < section.height(); i++) { + TPrintrow& row = section.row(i); if (i+1>=y1 && i+1<= y2) { - TPrintrow& row = section.row(i); - TString256 rowstr = row.row(); - if (!rowstr.blank()) - printer().print(section.row(i)); + const TFixed_string rowstr(row.row()); + if (rowstr.blank()) + continue; } - else - printer().print(section.row(i)); + printer().print(row); } - return; } void TRegistro_cespiti::header_categoria(const int categoria) diff --git a/ce/ce3100a.uml b/ce/ce3100a.uml index beabf779d..405670d8f 100755 --- a/ce/ce3100a.uml +++ b/ce/ce3100a.uml @@ -1,18 +1,7 @@ #include "ce3100a.h" TOOLBAR "topbar" 0 0 0 2 - -BUTTON DLG_PRINT 10 2 -BEGIN - PROMPT -12 -11 "" - PICTURE BMP_PRINT -END - -BUTTON DLG_QUIT 10 2 -BEGIN - PROMPT -22 -11 "" -END - +#include ENDPAGE PAGE "Stampa Registro cespiti" -1 -1 78 6