diff --git a/cg/cg2105.cpp b/cg/cg2105.cpp index b5345d184..71502c823 100755 --- a/cg/cg2105.cpp +++ b/cg/cg2105.cpp @@ -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(); diff --git a/cg/saldacon.cpp b/cg/saldacon.cpp index 3033254bd..0112edd1b 100755 --- a/cg/saldacon.cpp +++ b/cg/saldacon.cpp @@ -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() > ' ') {