Corretto il calcolo del prezzo scontato e la selezione delle righe da

escludere.


git-svn-id: svn://10.65.10.50/trunk@3538 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1996-09-07 10:57:19 +00:00
parent e5d57a12bf
commit aa45f91009
2 changed files with 9 additions and 3 deletions

View File

@ -831,6 +831,7 @@ bool TStampa_Doc_Vendita::filter_rows(const TRelation * r)
TString tr(s.get(0));
TString ar(s.get(1));
tr.trim();ar.trim();
if (tr.empty() && ar.empty()) continue;
if (tr.empty() && ar == codart) rt = FALSE;
else if (tr == tiporiga)
if (ar.empty() || (ar.not_empty() && ar == codart)) rt = FALSE;
@ -944,9 +945,13 @@ void TStampa_Doc_Vendita::print() {
printer().open(); // apre la stampante
TRectype arec= doc.curr(); // copia il record di fine cursore
cur.setregion(darec, arec); // imposta il filtro sul cursore di stampa (nell'ordine giusto :-)
TProgind pi(cur.items(),"Stampa documenti in corso...",FALSE,TRUE,10);
const bool is_vis = printer().printtype() == screenvis;
TProgind* pi;
if (!is_vis)
pi = new TProgind(cur.items(),"Stampa documenti in corso...",FALSE,TRUE,10);
for (cur= 0; cur.pos()<cur.items(); ++cur) { // ciclo sugli elementi del cursore di stampa
pi.addstatus(1L);
if (!is_vis)
pi->addstatus(1L);
tip.put("CODTAB", doc.get("TIPODOC")); // posiziona la tabella dei tipi di documento
int err=tip.read(); // legge la tabella
if (err==NOERR) { // se non ci sono errori procede con la stampa
@ -1004,6 +1009,7 @@ void TStampa_Doc_Vendita::print() {
break;
}
}
if (!is_vis) delete pi;
if (_form)
{
delete _form;

View File

@ -81,7 +81,7 @@ void TDocumentoEsteso::compile_summary()
{
_condv->set_sconto(sconto);
sc = 100.0 - _condv->sconto_val();
price = ((price * sc) / 100.0);
price = (price * sc);
}
price.round(val ? _parm.pri_val : _parm.pri_lit); // prezzo scontato
qta.round(val ? _parm.qta_val : _parm.qta_lit);