Corretta gestione totali documento nella prima pagina delle fatture extra

git-svn-id: svn://10.65.10.50/trunk@2635 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-02-23 11:39:41 +00:00
parent 9364f68d85
commit 3ea8c74b38
2 changed files with 18 additions and 13 deletions

View File

@ -109,8 +109,9 @@ TFattura_mask::~TFattura_mask()
real TFattura_mask::totale_rate(bool val) const real TFattura_mask::totale_rate(bool val) const
{ {
const TPagamento& pag = pagamento(); const TPagamento& pag = pagamento();
real tot = pag.importo_da_dividere(val); real tot;
tot += pag.importo_da_non_dividere(val); for (int r = pag.n_rate()-1; r >= 0; r--)
tot += pag.importo_rata(r, val);
return tot; return tot;
} }
@ -766,8 +767,8 @@ void TFattura_mask::write_scadenze() const
bool sposta = newgame != NULL; bool sposta = newgame != NULL;
if (sposta) if (sposta)
{ {
sposta = yesno_box("Si desidera spostare la fattura ed i " sposta = yesno_box("Si desidera spostare la fattura e gli eventuali\n"
"pagamenti relativi nella nuova partita?"); "pagamenti relativi nella partita %d %s?", anno, (const char*)numpart);
} }
if (sposta) if (sposta)
{ {
@ -903,12 +904,15 @@ bool TSaldaconto_app::totale_handler(TMask_field& f, KEY k)
k = K_TAB; k = K_TAB;
} }
if (k == K_TAB && f.focusdirty()) if (k == K_TAB)
{ {
app().gioca_cambi(m);
if (is_fatt) if (is_fatt)
{ {
update_rate(m); if (f.focusdirty())
{
app().gioca_cambi(m);
update_rate(m);
}
real tot(f.get()); real tot(f.get());
tot -= m.get_real(E_IMPOSTE); tot -= m.get_real(E_IMPOSTE);
m.set(FS_IMPONIBILI, tot); m.set(FS_IMPONIBILI, tot);
@ -959,12 +963,13 @@ bool TSaldaconto_app::totale_handler(TMask_field& f, KEY k)
bool TSaldaconto_app::imposte_handler(TMask_field& f, KEY key) bool TSaldaconto_app::imposte_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty()) if (key == K_TAB)
{ {
TMask& m = f.mask(); TMask& m = f.mask();
if (is_fattura(m)) if (is_fattura(m))
{ {
update_rate(m); if (f.focusdirty())
update_rate(m);
m.set(FS_IMPOSTE, f.get()); m.set(FS_IMPOSTE, f.get());
} }
} }