Merge remote-tracking branch 'origin/R_10_00' into R_10_00
This commit is contained in:
commit
6ad2695d78
3
cd/test/fp0788.txt
Normal file
3
cd/test/fp0788.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fp0.exe
|
||||||
|
|
||||||
|
Sistemato calcolo importo riga per chi non espone gli sconti in fattura
|
19
cd/test/fp0788a.ini
Normal file
19
cd/test/fp0788a.ini
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[fp1]
|
||||||
|
File(0) = fp0.exe|X
|
||||||
|
Patch = 0788
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[fp]
|
||||||
|
Data = 13-05-2019
|
||||||
|
Descrizione = Fattura Elettronica
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = cg,ve
|
||||||
|
OEM =
|
||||||
|
Patch = 788
|
||||||
|
PostProcess =
|
||||||
|
PreProcess =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/fp0788a1.zip
Normal file
BIN
cd/test/fp0788a1.zip
Normal file
Binary file not shown.
@ -404,7 +404,7 @@ class TFPRiga_documento : public TRiga_documento
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
real prezzo(bool scontato, bool lordo, int ndec = AUTO_DECIMALS) const;
|
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;
|
real quantita() const;
|
||||||
TString& quantita_string() const;
|
TString& quantita_string() const;
|
||||||
|
|
||||||
|
@ -1222,7 +1222,7 @@ const TString& TDoc_fp::converti_prezzo(const real& prezzo) const
|
|||||||
{
|
{
|
||||||
TCurrency app(prezzo, _doc_cambio._cod_val, _doc_cambio._cambio, true);
|
TCurrency app(prezzo, _doc_cambio._cod_val, _doc_cambio._cambio, true);
|
||||||
app.change_to_euro_val();
|
app.change_to_euro_val();
|
||||||
ret << app.get_num().string(0,8);
|
ret << app.get_num().string(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret << prezzo;
|
ret << prezzo;
|
||||||
@ -1237,8 +1237,9 @@ void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) con
|
|||||||
const real qta = rdoc->quantita();
|
const real qta = rdoc->quantita();
|
||||||
// Prendendo la stringa non ho problemi in scrittura della query, a volte accadono cose stupide
|
// Prendendo la stringa non ho problemi in scrittura della query, a volte accadono cose stupide
|
||||||
TString& qta_string = rdoc->quantita_string();
|
TString& qta_string = rdoc->quantita_string();
|
||||||
real prezzo_unit = rdoc->prezzo(_nascondi_sconti_righe_fatt, false, 5);
|
real prezzo_unit = rdoc->prezzo(_nascondi_sconti_righe_fatt, false);
|
||||||
real prezzo_tot = rdoc->importo(true, false);
|
real prezzo_tot = rdoc->imponibile(false);
|
||||||
|
|
||||||
|
|
||||||
if(qta < ZERO)
|
if(qta < ZERO)
|
||||||
{
|
{
|
||||||
@ -1344,7 +1345,7 @@ bool TDoc_fp::add_cassa_previdenziale(TRiga_documento& rdoc)
|
|||||||
|
|
||||||
// Resto
|
// Resto
|
||||||
const TSpesa_prest& sp = rdoc.spesa();
|
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;
|
const real importo_cassa = imponibile_ritenuta * sp.perc() / CENTO;
|
||||||
|
|
||||||
paf0800f.set("P8_TIPOCASSA", sp.cassa_previdenziale());
|
paf0800f.set("P8_TIPOCASSA", sp.cassa_previdenziale());
|
||||||
@ -1539,7 +1540,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
real imponibile = doc.imponibile(true);
|
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
|
// Nel dubbio risetto
|
||||||
@ -1799,7 +1801,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
// Altrimenti lo metto in riga
|
// Altrimenti lo metto in riga
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const real imp = rdoc->importo(true, false);
|
const real imp = rdoc->imponibile(false);
|
||||||
real qta = UNO;
|
real qta = UNO;
|
||||||
bool qta_inverse = false;
|
bool qta_inverse = false;
|
||||||
if (sp.is_tipo())
|
if (sp.is_tipo())
|
||||||
@ -1823,7 +1825,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
real prz = imp;
|
real prz = imp;
|
||||||
if (qta != UNO)
|
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())
|
if (prz.is_zero() && !imp.is_zero())
|
||||||
{
|
{
|
||||||
const TPrice price(imp / qta);
|
const TPrice price(imp / qta);
|
||||||
@ -1883,8 +1885,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
|
|
||||||
// Metto i dati come si trattasse di una riga normalissima
|
// Metto i dati come si trattasse di una riga normalissima
|
||||||
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
||||||
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0, 8));
|
paf1800f.set("PI_QUANTITA", rdoc->get_real(RDOC_QTA).string(0));
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(rdoc->prezzo(false, false, 8)));
|
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)));
|
paf1800f.set("PI_PRZTOTALE", converti_prezzo(rdoc->prezzo(false, false) * rdoc->get_real(RDOC_QTA)));
|
||||||
|
|
||||||
TRiepilogo_agg& riepilogo_agg = _riepilogo_agg[rdoc->iva().codice()];
|
TRiepilogo_agg& riepilogo_agg = _riepilogo_agg[rdoc->iva().codice()];
|
||||||
@ -1999,8 +2001,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
paf3000f.set("PT_COMMENTO", "Spese incasso");
|
paf3000f.set("PT_COMMENTO", "Spese incasso");
|
||||||
paf1800f.set("PI_QUANTITA", UNO);
|
paf1800f.set("PI_QUANTITA", UNO);
|
||||||
real imponibile = doc.imponibile();
|
real imponibile = doc.imponibile();
|
||||||
paf1800f.set("PI_PREZZOUNIT", 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, 6, _netto)));
|
paf1800f.set("PI_PRZTOTALE", converti_prezzo(doc.spese_incasso(imponibile, AUTO_DECIMALS, _netto)));
|
||||||
|
|
||||||
set_IVA(ini_get_string(CONFIG_DITTA, "ve", "SPINCODIVA"), paf1800f);
|
set_IVA(ini_get_string(CONFIG_DITTA, "ve", "SPINCODIVA"), paf1800f);
|
||||||
ok &= insert(paf1800f) && insert(paf3000f);
|
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);
|
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());
|
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
|
real TFPRiga_documento::quantita() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user