diff --git a/ve/velib03.cpp b/ve/velib03.cpp index 863d28a42..7bdc4e85e 100755 --- a/ve/velib03.cpp +++ b/ve/velib03.cpp @@ -160,10 +160,10 @@ void TDocumento::init() _cod_occas = new TRecfield(*this, "OCFPI"); _provv_agente = new TProvvigioni_agente; + _sconto = _esenzione = NULL; _stato_originale = ' '; _dirty_deny = false; - _spese_updated = false; check_modules(); @@ -684,7 +684,6 @@ int TDocumento::read(TBaseisamfile& f, word op, word lockop) if (is_fattura()) set_riga_esenzione(); _stato_originale = stato(); - _spese_updated = get_bool(DOC_SPESEUPD); if (err == NOERR && tipo_valido() && tipo().statistiche() && _has_stat_ven) { @@ -876,8 +875,7 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const if (!doc_bloccato) { - myself.put(DOC_SPESEUPD, _spese_updated); - if(tipo().spese_aut() && !_spese_updated) + if(tipo().spese_aut() && !get_bool("SPESEUPD")) { TString16 name("CODSP0"); TString_array spese; @@ -2290,7 +2288,8 @@ TRecord_array& TDocumento::body(int logicnum) const void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, TSheet_field * sh) { - if (_spese_updated) + const bool updated = get_bool("SPESEUPD"); + if (updated) return; const bool interactive = sh != NULL; @@ -2386,7 +2385,7 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, } } } - _spese_updated = true; + put("SPESEUPD", true); } real TDocumento::calc_conai_qta(int type)