Patch level :4.0
Files correlati :cg7.exe Ricompilazione Demo : [ ] Commento :aggiunto il trattamento delle ive parzialmente indetraibili nel programma enrichettico git-svn-id: svn://10.65.10.50/trunk@14791 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4a6b388bd4
commit
be9173fe19
@ -287,6 +287,8 @@ protected:
|
|||||||
long calcola_fattura_originale(long nreg) const;
|
long calcola_fattura_originale(long nreg) const;
|
||||||
bool calcola_imponibile_totdoc(const long nreg, const TRectype& pag_rec,
|
bool calcola_imponibile_totdoc(const long nreg, const TRectype& pag_rec,
|
||||||
real& imponibile, real& totdoc, real& totpagato, real& iva_indetraibile) const;
|
real& imponibile, real& totdoc, real& totpagato, real& iva_indetraibile) const;
|
||||||
|
void calcola_imposte(const real& importo, const real& imposta,
|
||||||
|
const TString& codind, real& iva_det, real& iva_ind) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const real get_importo() {return _importo;}
|
const real get_importo() {return _importo;}
|
||||||
@ -633,8 +635,8 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe)
|
|||||||
//accresce l'importo tot_imp relativo alla coppia codiva+codconto corrente
|
//accresce l'importo tot_imp relativo alla coppia codiva+codconto corrente
|
||||||
const real imponibile = pn.iva(l).get_real(RMI_IMPONIBILE);
|
const real imponibile = pn.iva(l).get_real(RMI_IMPONIBILE);
|
||||||
const real imposta = pn.iva(l).get_real(RMI_IMPOSTA);
|
const real imposta = pn.iva(l).get_real(RMI_IMPOSTA);
|
||||||
const TString4 tipodet = pn.iva(l).get(RMI_TIPODET);
|
const TString4 codind = pn.iva(l).get(RMI_TIPODET);
|
||||||
pn.analizza_riga_IVA(imponibile, imposta, caus, anno, codiva, tipodet, imp_detr,
|
pn.analizza_riga_IVA(imponibile, imposta, caus, anno, codiva, codind, imp_detr,
|
||||||
iva_detr, imp_indetr, iva_indetr);
|
iva_detr, imp_indetr, iva_indetr);
|
||||||
*tot_imp += imp_detr + imp_indetr + iva_indetr;
|
*tot_imp += imp_detr + imp_indetr + iva_indetr;
|
||||||
//aggiungere qui eventuale imposta
|
//aggiungere qui eventuale imposta
|
||||||
@ -956,6 +958,34 @@ void TInvioP::lettura_conti(TAssoc_array& assoc, const char tipoconto)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TInvioP::calcola_imposte(const real& importo, const real& imposta,
|
||||||
|
const TString& codind, real& iva_det, real& iva_ind) const
|
||||||
|
{
|
||||||
|
iva_det = imposta;
|
||||||
|
iva_ind = ZERO;
|
||||||
|
|
||||||
|
//esiste un codice di indetraibilita'?
|
||||||
|
if (codind.full())
|
||||||
|
{
|
||||||
|
real perc = ZERO;
|
||||||
|
const TRectype& rec = cache().get("%DET", codind);
|
||||||
|
if (rec.empty())
|
||||||
|
{
|
||||||
|
if (strchr("139", codind[0]) != NULL) // Clausola di salvaguardia
|
||||||
|
perc = CENTO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (rec.get_int("I0") > 0)
|
||||||
|
perc = rec.get_real("R0");
|
||||||
|
}
|
||||||
|
//valori delle varie ive
|
||||||
|
iva_ind = imposta * perc / CENTO;
|
||||||
|
iva_ind.round(2);
|
||||||
|
iva_det = imposta - iva_ind;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool TInvioP::calcola_imponibile_totdoc(const long nreg, const TRectype& pag_rec, real& imponibile, real& totdoc, real& totpagato, real& iva_indetraibile) const
|
bool TInvioP::calcola_imponibile_totdoc(const long nreg, const TRectype& pag_rec, real& imponibile, real& totdoc, real& totpagato, real& iva_indetraibile) const
|
||||||
{
|
{
|
||||||
totpagato = pag_rec.get_real(PAGSCA_IMPORTO);
|
totpagato = pag_rec.get_real(PAGSCA_IMPORTO);
|
||||||
@ -1012,20 +1042,24 @@ bool TInvioP::calcola_imponibile_totdoc(const long nreg, const TRectype& pag_rec
|
|||||||
if (conto.indicatore_bilancio() != 5)
|
if (conto.indicatore_bilancio() != 5)
|
||||||
{
|
{
|
||||||
const real importo = rmoviva.get_real(RMI_IMPONIBILE);
|
const real importo = rmoviva.get_real(RMI_IMPONIBILE);
|
||||||
real iva = rmoviva.get_real(RMI_IMPOSTA);
|
const real iva = rmoviva.get_real(RMI_IMPOSTA);
|
||||||
const TString& tipodet = rmoviva.get(RMI_TIPODET);
|
//trattamento delle ive indetraibili!
|
||||||
|
const TString& codind = rmoviva.get(RMI_TIPODET);
|
||||||
|
|
||||||
imponibile += importo;
|
imponibile += importo;
|
||||||
if (tipodet.full())
|
|
||||||
|
real iva_det, iva_ind;
|
||||||
|
//calcola i valori dell'iva detraibile e delle ive indetraibili in diverse percentuali
|
||||||
|
calcola_imposte(importo, iva, codind, iva_det, iva_ind);
|
||||||
|
//se esiste un'iva indetraibile..
|
||||||
|
if (iva_ind != ZERO)
|
||||||
{
|
{
|
||||||
//serve per i casi speciali con fdr in regime fidcale diverso da quello..
|
iva_indetraibile += iva_ind;
|
||||||
//..della fattura
|
imponibile += iva_ind;
|
||||||
iva_indetraibile += iva;
|
|
||||||
imponibile += iva;
|
|
||||||
}
|
}
|
||||||
else
|
//l'iva detraibile va sempre bene sommata alle imposte
|
||||||
imposta += iva;
|
imposta += iva_det;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
totdoc = totale_documento(pn); //tot doc con ritenute fiscali + ritenute sociali
|
totdoc = totale_documento(pn); //tot doc con ritenute fiscali + ritenute sociali
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user