Patch level : 12.0 788
Files correlati : fp0 Commento : - Rifatto calcolo imponibile, adesso al posto di chiamare la funzione di TDocumento importo() chiama imponibile() - Tolti decimali di troppo, adesso vengono usati quelli impostati nella valuta
This commit is contained in:
parent
deb1e4fc3a
commit
34dfb4a576
@ -404,7 +404,7 @@ class TFPRiga_documento : public TRiga_documento
|
||||
{
|
||||
public:
|
||||
real prezzo(bool scontato, bool lordo, int ndec = AUTO_DECIMALS) const;
|
||||
real importo(bool scontato, bool lordo, int ndec = AUTO_DECIMALS) const;
|
||||
real imponibile(const bool lordo) const;
|
||||
real quantita() const;
|
||||
TString& quantita_string() const;
|
||||
|
||||
|
@ -1205,7 +1205,7 @@ const TString& TDoc_fp::converti_prezzo(const real& prezzo) const
|
||||
{
|
||||
TCurrency app(prezzo, _doc_cambio._cod_val, _doc_cambio._cambio, true);
|
||||
app.change_to_euro_val();
|
||||
ret << app.get_num().string(0,8);
|
||||
ret << app.get_num().string(0);
|
||||
}
|
||||
else
|
||||
ret << prezzo;
|
||||
@ -1220,8 +1220,9 @@ void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) con
|
||||
const real qta = rdoc->quantita();
|
||||
// Prendendo la stringa non ho problemi in scrittura della query, a volte accadono cose stupide
|
||||
TString& qta_string = rdoc->quantita_string();
|
||||
real prezzo_unit = rdoc->prezzo(_nascondi_sconti_righe_fatt, false, 5);
|
||||
real prezzo_tot = rdoc->importo(true, false);
|
||||
real prezzo_unit = rdoc->prezzo(_nascondi_sconti_righe_fatt, false);
|
||||
real prezzo_tot = rdoc->imponibile(false);
|
||||
|
||||
|
||||
if(qta < ZERO)
|
||||
{
|
||||
@ -1327,7 +1328,7 @@ bool TDoc_fp::add_cassa_previdenziale(TRiga_documento& rdoc)
|
||||
|
||||
// Resto
|
||||
const TSpesa_prest& sp = rdoc.spesa();
|
||||
const real imponibile_ritenuta = calc_ritenuta(rdoc.doc());
|
||||
const real imponibile_ritenuta = rdoc.doc().ritenute();//calc_ritenuta(rdoc.doc());
|
||||
const real importo_cassa = imponibile_ritenuta * sp.perc() / CENTO;
|
||||
|
||||
paf0800f.set("P8_TIPOCASSA", sp.cassa_previdenziale());
|
||||
@ -1522,7 +1523,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
}
|
||||
{
|
||||
real imponibile = doc.imponibile(true);
|
||||
paf0700f.set("P7_IMPORTOBOLLO", converti_prezzo(doc.bolli(imponibile, 8)));
|
||||
TExchange exchange(_doc_cambio._cod_val);
|
||||
paf0700f.set("P7_IMPORTOBOLLO", converti_prezzo(doc.bolli(imponibile, exchange.decimals())));
|
||||
}
|
||||
|
||||
// Nel dubbio risetto
|
||||
@ -1782,7 +1784,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
// Altrimenti lo metto in riga
|
||||
else
|
||||
{
|
||||
const real imp = rdoc->importo(true, false);
|
||||
const real imp = rdoc->imponibile(false);
|
||||
real qta = UNO;
|
||||
bool qta_inverse = false;
|
||||
if (sp.is_tipo())
|
||||
@ -1806,7 +1808,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
real prz = imp;
|
||||
if (qta != UNO)
|
||||
{
|
||||
prz = rdoc->prezzo(_nascondi_sconti_righe_fatt, false, 8);
|
||||
prz = rdoc->prezzo(_nascondi_sconti_righe_fatt, false);
|
||||
if (prz.is_zero() && !imp.is_zero())
|
||||
{
|
||||
const TPrice price(imp / qta);
|
||||
@ -1866,8 +1868,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
|
||||
// Metto i dati come si trattasse di una riga normalissima
|
||||
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
||||
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0, 8));
|
||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(rdoc->prezzo(false, false, 8)));
|
||||
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0));
|
||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(rdoc->prezzo(false, false)));
|
||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(rdoc->prezzo(false, false) * rdoc->get_real(RDOC_QTA)));
|
||||
|
||||
TRiepilogo_agg& riepilogo_agg = _riepilogo_agg[rdoc->iva().codice()];
|
||||
@ -1982,8 +1984,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
paf3000f.set("PT_COMMENTO", "Spese incasso");
|
||||
paf1800f.set("PI_QUANTITA", UNO);
|
||||
real imponibile = doc.imponibile();
|
||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(doc.spese_incasso(imponibile, 6, _netto)));
|
||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(doc.spese_incasso(imponibile, 6, _netto)));
|
||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(doc.spese_incasso(imponibile, AUTO_DECIMALS, _netto)));
|
||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(doc.spese_incasso(imponibile, AUTO_DECIMALS, _netto)));
|
||||
|
||||
set_IVA(ini_get_string(CONFIG_DITTA, "ve", "SPINCODIVA"), paf1800f);
|
||||
ok &= insert(paf1800f) && insert(paf3000f);
|
||||
|
@ -16,10 +16,10 @@ real TFPRiga_documento::prezzo(const bool scontato, const bool lordo, const int
|
||||
return field_prezzo.full() ? get_real(field_prezzo) : TRiga_documento::prezzo(scontato, lordo, ndec);
|
||||
}
|
||||
|
||||
real TFPRiga_documento::importo(const bool scontato, const bool lordo, const int ndec) const
|
||||
real TFPRiga_documento::imponibile(const bool lordo) const
|
||||
{
|
||||
const TString& field_importo = fp_righe_custom().get_imponibile(tipo().codice(), doc().tipo().codice());
|
||||
return field_importo.full() ? get_real(field_importo) : TRiga_documento::importo(scontato, lordo, ndec);
|
||||
return field_importo.full() ? get_real(field_importo) : TRiga_documento::imponibile(lordo);
|
||||
}
|
||||
|
||||
real TFPRiga_documento::quantita() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user