Patch level : 12.0 no-patch
Files correlati : fp Commento : - Sistemato CAP italiani, era sbagliato il controllo - Tolto segno quando metto gli importi in negativo forzando il segno corretto
This commit is contained in:
parent
4c4812d296
commit
c6d8cc2653
@ -889,7 +889,9 @@ 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));
|
||||
|
||||
real& qta = rdoc->get_real(RDOC_QTA);
|
||||
real qta = rdoc->get_real(RDOC_QTA);
|
||||
// Prendendo la stringa non ho problemi in scrittura della query, a volte accadono cose stupide
|
||||
const TString& qta_string = rdoc->get(RDOC_QTA);
|
||||
|
||||
real prezzo_unit;
|
||||
real prezzo_tot;
|
||||
@ -899,17 +901,17 @@ void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TRiga_documento* rdoc) const
|
||||
if (qta == ZERO)
|
||||
qta = UNO;
|
||||
|
||||
paf1800f.set("PI_QUANTITA", qta.string());
|
||||
paf1800f.set("PI_QUANTITA", qta_string);
|
||||
prezzo_unit = rdoc->prezzo(false, false);
|
||||
prezzo_tot = rdoc->importo(true, false);
|
||||
}
|
||||
else if(qta < ZERO)
|
||||
{
|
||||
// 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);
|
||||
// Metto la qualità senza il segno
|
||||
paf1800f.set("PI_QUANTITA", qta_string.mid(1));
|
||||
// E i prezzi in negativo, perchè l'importo non ha lo stesso segno del prezzo?
|
||||
prezzo_unit = -abs(rdoc->prezzo(false, false));
|
||||
prezzo_tot = -abs(rdoc->importo(true, false));
|
||||
}
|
||||
|
||||
// Salvo tutto
|
||||
@ -1101,16 +1103,21 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
// DatiSede
|
||||
|
||||
|
||||
paf0400f.set("P4_SEDEIND", cliente.via_residenza());
|
||||
paf0400f.set("P4_SEDENRCIVICO", cliente.civico_residenza());
|
||||
paf0400f.set("P4_SEDEIND", cliente.via_residenza());
|
||||
paf0400f.set("P4_SEDENRCIVICO", cliente.civico_residenza());
|
||||
paf0400f.set("P4_SEDECOMUNE", cliente.comune_residenza());
|
||||
paf0400f.set("P4_SEDENAZ", cliente.stato_residenza_ISO());
|
||||
|
||||
// I clienti esteri possono avere CAP alfanumerici, li tolgo
|
||||
if (cliente.stato_residenza_ISO() != "IT")
|
||||
{
|
||||
paf0400f.set("P4_SEDECAP", "00000");
|
||||
}
|
||||
else
|
||||
{
|
||||
paf0400f.set("P4_SEDECAP", cliente.CAP_residenza());
|
||||
paf0400f.set("P4_SEDECOMUNE", cliente.comune_residenza());
|
||||
paf0400f.set("P4_SEDENAZ", cliente.stato_residenza_ISO());
|
||||
if (cliente.italiano())
|
||||
{
|
||||
paf0400f.set("P4_SEDECAP", "00000");
|
||||
paf0400f.set("P4_SEDEPROV", cliente.provincia_residenza());
|
||||
}
|
||||
paf0400f.set("P4_SEDEPROV", cliente.provincia_residenza());
|
||||
}
|
||||
|
||||
paf0400f.set("P4_GESTIONE", "D");
|
||||
ok &= insert(paf0400f);
|
||||
|
Loading…
x
Reference in New Issue
Block a user