Patch level : 10.0

Files correlati     : ve0.exe
Ricompilazione Demo : [ ]
Commento            :
Corretta gestione commessa di default sulle risorse: quando e' vuota non deve azzerare quella impostata manualmente sulla riga documento


git-svn-id: svn://10.65.10.50/trunk@19680 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-11-30 10:42:00 +00:00
parent 29426b3a46
commit a412d6aeaf
2 changed files with 22 additions and 15 deletions

View File

@ -1856,8 +1856,8 @@ real TDocumento::imponibile(bool spese, int ndec) const
if (physical_rows() > 0) if (physical_rows() > 0)
{ {
TAssoc_array & table = ((TDocumento *)this)->tabella_iva(); TAssoc_array & table = ((TDocumento *)this)->tabella_iva();
for (TRiepilogo_iva * ri = (TRiepilogo_iva *) table.get(); ri != NULL; table.restart();
ri = (TRiepilogo_iva *) table.get()) for (TRiepilogo_iva* ri = (TRiepilogo_iva*)table.get(); ri != NULL; ri = (TRiepilogo_iva*)table.get())
val += ri->imponibile(spese); val += ri->imponibile(spese);
if (ndec == AUTO_DECIMALS) if (ndec == AUTO_DECIMALS)
@ -2370,12 +2370,12 @@ real TDocumento::provvigione(bool first, int ndec) const
real TDocumento::valore(bool totale, bool lordo, int ndec) const real TDocumento::valore(bool totale, bool lordo, int ndec) const
{ {
real val; real val;
for (int i = physical_rows(); i>0; i--) TDocumento& doc = *(TDocumento*)this;
FOR_EACH_PHYSICAL_RDOC_BACK(doc, i, r)
{ {
const TRiga_documento &r = physical_row(i); const char t = r->tipo().tipo();
//if (r.is_merce() || r.is_spese() || r.is_prestazione()) if (strchr("MSPRA", t) != NULL) // Merce, Spese, Prestazioni, Risorse, Attrezzature
if (strchr("MSPRA", r.tipo().tipo()) != NULL) // Merce, Spese, Prestazioni, Risorse, Attrezzature val += r->valore(totale, lordo, ndec);
val += r.valore(totale, lordo, ndec);
} }
return val; return val;
} }

View File

@ -2304,7 +2304,7 @@ bool sppr_handler( TMask_field& f, KEY key )
if (posiva >= 0) if (posiva >= 0)
iva_handler(row_mask.fld(posiva), 0); iva_handler(row_mask.fld(posiva), 0);
if (row_mask.id2pos(FR_CDC1) >= 0) if (row_mask.id2pos(FR_CDC1) >= 0 && sp.get("S1").full())
{ {
const TString80 cdc(sp.cdc()); const TString80 cdc(sp.cdc());
const TString80 cms(sp.cms()); const TString80 cms(sp.cms());
@ -2319,17 +2319,24 @@ bool sppr_handler( TMask_field& f, KEY key )
const TFieldref& fr = *e.field(); const TFieldref& fr = *e.field();
if (fr.name() == RDOC_CODCOSTO) if (fr.name() == RDOC_CODCOSTO)
{
if (cdc.full())
e.set(cdc.sub(fr.from(), fr.to())); e.set(cdc.sub(fr.from(), fr.to()));
else } else
if (fr.name() == RDOC_CODCMS) if (fr.name() == RDOC_CODCMS)
{
if (cms.full())
e.set(cms.sub(fr.from(), fr.to())); e.set(cms.sub(fr.from(), fr.to()));
else } else
if (fr.name() == RDOC_FASCMS) if (fr.name() == RDOC_FASCMS)
{
if (fase.full())
e.set(fase.sub(fr.from(), fr.to())); e.set(fase.sub(fr.from(), fr.to()));
} }
} }
} }
} }
}
return true; return true;
} }