Correzione gestione saldaconto extra-contabile

git-svn-id: svn://10.65.10.50/trunk@2630 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-02-22 10:55:36 +00:00
parent 66649d22c5
commit 3df72bb904
2 changed files with 28 additions and 19 deletions

View File

@ -1256,6 +1256,9 @@ bool TGame_mask::edit_scadenza_handler(TMask_field& f, KEY k)
// Se ho cancellato il pagamento chiudo la maschera
if (m.is_running() && !game.esiste(nriga, nrata, nrigp))
m.stop_run(K_FORCE_CLOSE);
#ifdef __EXTRA__
game.rewrite(); // In extra-contabile salvo subito!
#endif
}
}
else
@ -1342,34 +1345,40 @@ bool TGame_mask::nuovo_handler(TMask_field& f, KEY k)
// Creazione nuova partita
TPartita& game = app().partite().partita(gm.conto(), anno, numero);
bool edit = FALSE;
// N.B. Le fatture non possone essere editate in modo contabile
if (tm != tm_fattura)
{
const int nriga = TPartita::UNASSIGNED;
const int nrata = TPartita::UNASSIGNED;
const int nrigp = gm.nuovo_pagamento(game, nriga, nrata, tm);
gm.edit_pagamento(game, nriga, nrata, nrigp);
edit = gm.edit_pagamento(game, nriga, nrata, nrigp);
#ifdef __EXTRA__
if (edit) game.rewrite();
#endif
}
#ifdef __EXTRA__
else
{
gm.edit_fattura(game, 0);
}
edit = gm.edit_fattura(game, 0);
#endif
if (game.ok())
{
gm.set(P_ANNO, anno);
gm.set(P_NUMERO, numero);
gm._changed = TRUE;
}
else
{
if (!game.is_on_file())
app().partite().destroy(game);
}
// Aggiorna sheet partite: aggiunge la nuova partita e lo riordina
gm.fill_partite();
if (edit)
{
if (game.ok())
{
gm.set(P_ANNO, anno);
gm.set(P_NUMERO, numero);
gm._changed = TRUE;
}
else
{
if (!game.is_on_file())
app().partite().destroy(game);
}
// Aggiorna sheet partite: aggiunge la nuova partita e lo riordina
gm.fill_partite();
} // Sono state apportate modifiche
}
}
@ -1713,7 +1722,7 @@ bool TPrimanota_application::edit_partite(const TMask& m, int riga)
return FALSE; // Esci se il conto della riga cliente non e' valido
const char rt = m.get(CG_ROWTYPE)[0];
if (rt == 'T' && tipo <= ' ')
if (rt == 'T' && tipo <= ' ') // Nelle note di credito DEVE essere un clifo
return FALSE;
TMovimentoPN* pn = (TMovimentoPN*)get_relation();

View File

@ -1092,7 +1092,7 @@ bool TPartita::write(bool re) const
{
if (ok())
{
((TPartita*)this)->chiusa(TRUE); // Aggiorna flag di chiusura (non si sa mai)
chiusa(TRUE); // Aggiorna flag di chiusura (non si sa mai)
if (conto().tipo() > ' ')
{