diff --git a/src/cg/cg0500.h b/src/cg/cg0500.h index 8dd44b4e9..3532341c8 100755 --- a/src/cg/cg0500.h +++ b/src/cg/cg0500.h @@ -38,6 +38,7 @@ #define F_MOVCGIND 235 #define F_RIL_FT_EM_RI 236 #define F_DATAREG_PREC 237 +#define F_FAT_RITARDO_IND 238 #define SS_TIPO 101 #define SS_SEZIONE 102 diff --git a/src/cg/cg0500a.uml b/src/cg/cg0500a.uml index 89a922b78..225a59c51 100755 --- a/src/cg/cg0500a.uml +++ b/src/cg/cg0500a.uml @@ -245,9 +245,16 @@ BEGIN GROUP 2 END +BOOLEAN F_FAT_RITARDO_IND +BEGIN + PROMPT 34 8 "Fattura in ritardo indeducibile" + FIELD RITFATTIND + GROUP 2 +END + STRING F_COD_CAUS_IM 3 BEGIN - PROMPT 34 8 "Codice causale collegata " + PROMPT 34 9 "Codice causale collegata " FLAGS "UZ" FIELD CODCAUSIM USE LF_CAUSALI diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index 4a6c09f87..93ae7c4d3 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -1146,7 +1146,13 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & continue; } const TRectype& rcs = _cur->curr(LF_CAUSALI); - const bool fattrit = rcs.get_bool(CAU_RITFATT); + const TDate datareg = _mov->get_date(MOV_DATAREG); + const TDate datadoc = _mov->get_date(MOV_DATADOC); + const bool dataritind = ((datareg.year() - datadoc.year()) > 1 ) || + (((datareg.year() - datadoc.year()) == 1) && datareg.month() >= 5); + const bool datarit = !dataritind && ((datareg.year() - datadoc.year()) == 1); + const bool fattritind = rcs.get_bool(CAU_RITFATTIND) || dataritind; + const bool fattrit = rcs.get_bool(CAU_RITFATT) || datarit; const bool cau_intra = rcs.get_bool(CAU_INTRACOM); const bool cau_valintra = rcs.get_bool(CAU_VALINTRA); @@ -1440,9 +1446,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & // da evitare di dover controllare mese e anno sul PIM const bool was_riv = (tipoiva != "NS") && (tipocr == 1 || tipocr ==5); real percind; - const int tipoind = get_tipodet_from_rmi(_rmoviva->curr(), _mov->curr(), percind, true); + int tipoind = get_tipodet_from_rmi(_rmoviva->curr(), _mov->curr(), percind, true); const int decimals = TCurrency::get_firm_dec(); + if (tipoind == 0 && fattritind) + tipoind = 9; + const real imponibile_orig = _rmoviva->get_real(RMI_IMPONIBILE); real imposta_orig = _rmoviva->get_real(RMI_IMPOSTA); const real lordo_orig = imponibile_orig + imposta_orig; @@ -1485,6 +1494,13 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & analizza_IVA(imponibile_orig, imposta_orig, percind, corrisp, false, codiva, impon_det, impos_det, impon_ind, impos_ind); + if (fattritind) + { + impon_ind += impon_det; + impon_det = ZERO; + impos_ind += impos_det; + impos_det = ZERO; + } for (int is_detr_diff = 1; is_detr_diff >= 0; is_detr_diff--) { real diff_impr = (is_detr_diff == 0) ? impon_det : impon_ind; @@ -1949,7 +1965,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & } // Le fatture in ritardo non vanno considerate nel periodo ma solo nell'annuale - if (!fattrit || (fattrit /*&& _isagricolo*/ && _month == 13)) // normale + if (!fattrit || (fattrit && _month == 13)) // normale { // ***************************************** diff --git a/src/cg/f26.dir b/src/cg/f26.dir index 0ba20e75b..4ff6f8270 100755 --- a/src/cg/f26.dir +++ b/src/cg/f26.dir @@ -1,3 +1,3 @@ 26 0 -$caus|0|0|88|0|Causali contabili|60|| +$caus|0|0|89|0|Causali contabili|60|| diff --git a/src/cg/f26.trr b/src/cg/f26.trr index 7e46f079a..80017dd38 100755 --- a/src/cg/f26.trr +++ b/src/cg/f26.trr @@ -1,5 +1,5 @@ 26 -28 +29 CODCAUS|1|3|0|Codice causale DESCR|1|50|0|Descrizione causale TIPODOC|1|2|0|Tipo documento @@ -13,7 +13,8 @@ NUMDOC|8|1|0|Numero documento AUTOFATT|8|1|0|Autofattura art. ?? MOVSEZ|8|1|0|Movimento sezionale ?? TIPOMOV|2|1|0|Tipo movimento saldaconto -RITFATT|8|1|0| +RITFATT|8|1|0|Fattura in ritardo +RITFATTIND|8|1|0|Fattura in ritardo indeducibile COLLCESP|1|1|0|Collegamnto ai cespiti M770|1|1|0|Collegamento al 770 CODCAUSIM|1|3|0|Codice causale incasso immediato