From 4094974be3c3f706dfe0fe2b7e99947c0fb84459 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 22 Sep 2003 14:19:52 +0000 Subject: [PATCH] Patch level : 2003 578 Files correlati : sv0.exe Ricompilazione Demo : [ ] Commento : GF20071 La statistica per articoli omaggio non funziona ne se la configurazione dice RAGGRUPPA OMAGGI CON MERCE e neanche nel caso contrario git-svn-id: svn://10.65.10.50/trunk@11427 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- sv/sv0400.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sv/sv0400.cpp b/sv/sv0400.cpp index 5b863ac58..3bde48ff7 100755 --- a/sv/sv0400.cpp +++ b/sv/sv0400.cpp @@ -5,11 +5,12 @@ class TParametri_stat : public TConfig_application { - bool _recalculated; + bool _recalc_needed; protected: virtual const char* get_mask_name() const { return "sv0400a"; } virtual bool postprocess_config_changed (const char*, const char*, const char*, const char*); + virtual bool user_destroy() ; public: TParametri_stat(); @@ -17,17 +18,26 @@ public: bool TParametri_stat::postprocess_config_changed (const char*, const char*, const char*, const char*) { - bool recalc = !_recalculated && yesno_box("Si desidera ricalcolare le statistiche ora?"); - if (recalc) - { - TExternal_app app("sv2 -0"); - _recalculated = app.run() == 0; - } + _recalc_needed = TRUE; return TRUE; } +bool TParametri_stat::user_destroy() +{ + const bool ok = TConfig_application::user_destroy(); + if (ok) + { + if (_recalc_needed && yesno_box("Si desidera ricalcolare le statistiche ora?")) + { + TExternal_app app("sv2 -0"); + app.run(); + } + } + return ok; +} + TParametri_stat::TParametri_stat() - : TConfig_application(CONFIG_DITTA), _recalculated(FALSE) + : TConfig_application(CONFIG_DITTA), _recalc_needed(FALSE) { } int sv0400(int argc, char* argv[])