diff --git a/cg/cg0200.cpp b/cg/cg0200.cpp index 4bb53c735..9ed89b870 100755 --- a/cg/cg0200.cpp +++ b/cg/cg0200.cpp @@ -39,7 +39,6 @@ protected: virtual bool changing_mask(int mode) { return false; } virtual bool save_and_new() const { return _savenew; } virtual bool protected_record(TRectype &rec); - virtual bool get_next_key(TToken_string& key); void init_pages(TMask& m); virtual void init_query_mode(TMask& m); virtual void init_query_insert_mode(TMask& m); @@ -81,6 +80,7 @@ protected: virtual bool has_filtered_cursor() const { return true;} public: + virtual bool get_next_key(TToken_string& key); // @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata virtual bool check_autorization() const {return false;} @@ -565,12 +565,17 @@ HIDDEN bool codalleg_handler(TMask_field& f, KEY key) HIDDEN bool altnewcli_handler(TMask_field& f, KEY key) { TMask& m = f.mask(); - if (key == K_SPACE && m.mode() == MODE_INS) + if (key == K_SPACE) { long divisore = ini_get_int(CONFIG_DITTA, "cg", "CliForModule", 100); - const long cod = (m.get_long(F_CODCF) / divisore + 1) * divisore; + TToken_string key; + + app().get_next_key(key); + const long cod = (atol(key.get(3)) / divisore + 1) * divisore; m.set(F_CODCF, cod); + if (m.mode() == MODE_QUERY) + m.stop_run(K_AUTO_ENTER); } return true; } @@ -641,7 +646,7 @@ void TClifo_application::init_query_mode(TMask& m) m.show(F_CODLIST1, !_liscatven); m.disable(DLG_CONTRLAV); if (m.id2pos(DLG_ALTNEWCLI) >= 0) - m.disable(DLG_ALTNEWCLI); + m.enable(DLG_ALTNEWCLI); } void TClifo_application::init_query_insert_mode(TMask& m)