Patch level : 12.0 384

Files correlati     : cg4.exe
Commento            : Corretto in funzionamento per fatture per cassa pagate in anticipo e calcolo pro-rata per le fatture per cassa.

git-svn-id: svn://10.65.10.50/branches/R_10_00@23792 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
mtollari 2017-05-08 14:14:18 +00:00
parent 3cba07219a
commit 35abcc4a6c
3 changed files with 13 additions and 19 deletions

View File

@ -1184,7 +1184,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
#ifdef DBG #ifdef DBG
const long nr = _mov->get_long(MOV_NUMREG); const long nr = _mov->get_long(MOV_NUMREG);
if (nr == 30579 || nr == 30582) if (nr == 29252)
int i = 1 ; int i = 1 ;
#endif #endif
@ -1459,7 +1459,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
#ifdef DBG #ifdef DBG
const long nr = _mov->get_long(MOV_NUMREG); const long nr = _mov->get_long(MOV_NUMREG);
if (nr == 30579 || nr == 30582) if (nr == 29252)
int i = 1 ; int i = 1 ;
#endif #endif
@ -1485,10 +1485,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
if (bRowIsMovDiff && tm == tm_fattura) if (bRowIsMovDiff && tm == tm_fattura)
{ {
const TDate datareg = _mov->get(MOV_DATAREG); const TDate datareg = _mov->get_date(MOV_DATAREG);
const int m = datareg.month(); int mesereg = datareg.month();
const bool ok = is_month_ok(month, m); const bool ok = is_month_ok(month, mesereg) && (atoi(_year) == datareg.year());
if (!ok && civa.senza_imposta()) if (!ok && civa.senza_imposta())
continue; continue;
if (is_detr_diff == 1 && !ok) if (is_detr_diff == 1 && !ok)
@ -1503,7 +1503,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
id.put("TIPOATT", rmi_tipoatt); id.put("TIPOATT", rmi_tipoatt);
id.put("ANNOLIQ", datareg.year()); id.put("ANNOLIQ", datareg.year());
int mesereg = datareg.month();
if (_freqviva[0] == 'T') if (_freqviva[0] == 'T')
{ {
const int resto = mesereg % 3; const int resto = mesereg % 3;
@ -1880,8 +1879,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
const int tipodet = is_detraibile == 0 ? 0 : tipoind; const int tipodet = is_detraibile == 0 ? 0 : tipoind;
real imponibile = is_detraibile == 0 ? impon_det : impon_ind; real imponibile = is_detraibile == 0 ? impon_det : impon_ind;
real imposta = is_detraibile == 0? impos_det : impos_ind; real imposta = is_detraibile == 0? impos_det : impos_ind;
const int m = _mov->get_date(MOV_DATAREG).month(); const TDate datareg = _mov->get_date(MOV_DATAREG);
const bool ok = is_month_ok(month, m); const bool ok = is_month_ok(month, datareg.month()) && (atoi(_year) == datareg.year());
if (civa.senza_imposta() && !ok) if (civa.senza_imposta() && !ok)
continue; continue;
@ -3199,7 +3198,7 @@ void TLiquidazione_app::iva11_set_arr_phase_1(const TString& codatt)
{ {
const bool t1 = tipoagr == 1; const bool t1 = tipoagr == 1;
const bool t1_3 = tipoagr == 1 || tipoagr == 3; const bool t1_3 = tipoagr == 1 || tipoagr == 3;
if (ali == 2.00) if (ali == DUE)
{ {
if (t1) if (t1)
{ {
@ -3529,8 +3528,8 @@ void TLiquidazione_app::iva11_set_arr_phase_2(const TString& codatt)
// Calcola le maledette aliquote medie... // Calcola le maledette aliquote medie...
real alv,ala; real alv,ala;
if (vtot != 0.0) { alv = ivav/vtot; alv *= CENTO; alv.round(2); } if (vtot != ZERO) { alv = ivav/vtot; alv *= CENTO; alv.round(2); }
if (atot != 0.0) { ala = ivaa/atot; ala *= CENTO; ala.round(2); } if (atot != ZERO) { ala = ivaa/atot; ala *= CENTO; ala.round(2); }
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);

View File

@ -221,7 +221,7 @@ void TLiquidazione_app::lordo2netto(const real& totale, real& imponibile, real&
const int dec = TCurrency::get_firm_dec(); const int dec = TCurrency::get_firm_dec();
if (dec == 0) // Lire if (dec == 0) // Lire
{ {
imposta = (abs(totale) * aliquota)/(aliquota + 1.00); imposta = (abs(totale) * aliquota)/(aliquota + UNO);
imposta.ceil(); imposta.ceil();
if (totale.sign() < 0) imposta = -imposta; if (totale.sign() < 0) imposta = -imposta;
imponibile = totale - imposta; imponibile = totale - imposta;
@ -232,7 +232,7 @@ void TLiquidazione_app::lordo2netto(const real& totale, real& imponibile, real&
} }
else // Euro else // Euro
{ {
imposta = (totale * aliquota)/(aliquota + 1.00); imposta = (totale * aliquota)/(aliquota + UNO);
imposta.round(dec); imposta.round(dec);
imponibile = totale - imposta; imponibile = totale - imposta;
} }

View File

@ -1123,11 +1123,6 @@ int TRiga_partite::calcola_pagato_periodo(const TDate& dal, const TDate& al, TIm
if (!is_fattura()) if (!is_fattura())
return flag; return flag;
#ifdef DBG
if (get_long(PART_NREG) == 15985)
int cazzone = 2;
#endif
TPointer_array pags; TPointer_array pags;
const int lastr = rate(); const int lastr = rate();