Patch level : 12.0 672
Files correlati : fp Commento : Sistemata qta e prezzo
This commit is contained in:
parent
05b0b09830
commit
390a86bef8
@ -868,20 +868,32 @@ void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TRiga_documento* rdoc) const
|
||||
// Setto l'unità di misura
|
||||
paf1800f.set("PI_UNITAMISURA", rdoc->get(RDOC_UMQTA));
|
||||
|
||||
const real& qta = rdoc->get_real(RDOC_QTA);
|
||||
TString qta_string = rdoc->get(RDOC_QTA);
|
||||
real& qta = rdoc->get_real(RDOC_QTA);
|
||||
|
||||
real prezzo_unit;
|
||||
real prezzo_tot;
|
||||
|
||||
if (qta >= ZERO)
|
||||
{
|
||||
paf1800f.set("PI_QUANTITA", qta_string);
|
||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(rdoc->prezzo(false, false)));
|
||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(rdoc->importo(true, false)));
|
||||
if (qta == ZERO)
|
||||
qta = UNO;
|
||||
|
||||
paf1800f.set("PI_QUANTITA", qta.string());
|
||||
prezzo_unit = rdoc->prezzo(false, false);
|
||||
prezzo_tot = rdoc->importo(true, false);
|
||||
}
|
||||
else
|
||||
else if(qta < ZERO)
|
||||
{
|
||||
paf1800f.set("PI_QUANTITA", qta_string);
|
||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(-rdoc->prezzo(true, false)));
|
||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(rdoc->importo(true, false)));
|
||||
// Metto la qualità in positivo
|
||||
paf1800f.set("PI_QUANTITA", abs(qta).string());
|
||||
// E i prezzi in negativo
|
||||
prezzo_unit = -rdoc->prezzo(false, false);
|
||||
prezzo_tot = -rdoc->importo(true, false);
|
||||
}
|
||||
|
||||
// Salvo tutto
|
||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(prezzo_unit));
|
||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(prezzo_tot));
|
||||
}
|
||||
|
||||
bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user