From b531719f8d88a588be20ee0bd144cc924601cec8 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 25 Jun 2011 17:55:28 +0000 Subject: [PATCH] Patch level : 10.1036 Files correlati : cg0.exe Ricompilazione Demo : [ ] Commento : Nuova funzione per avere un nuovo codice cliente con incrementi maggiori di uno. Il default e' cento, altrimenti bisogandefinire nel paragrafo cg del config ditta la variabile CliForModule= Bisogna poi aggiungere un bottone alla toolbar dei clienti tipo il seguente BU 262 BE PR 13 1 "Prompt" END git-svn-id: svn://10.65.10.50/branches/R_10_00@22325 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg0200.cpp | 21 +++++++++++++++++++++ cg/cg0200.h | 1 + 2 files changed, 22 insertions(+) diff --git a/cg/cg0200.cpp b/cg/cg0200.cpp index 043832025..4bb53c735 100755 --- a/cg/cg0200.cpp +++ b/cg/cg0200.cpp @@ -562,6 +562,19 @@ HIDDEN bool codalleg_handler(TMask_field& f, KEY key) return true; } +HIDDEN bool altnewcli_handler(TMask_field& f, KEY key) +{ + TMask& m = f.mask(); + if (key == K_SPACE && m.mode() == MODE_INS) + { + long divisore = ini_get_int(CONFIG_DITTA, "cg", "CliForModule", 100); + const long cod = (m.get_long(F_CODCF) / divisore + 1) * divisore; + + m.set(F_CODCF, cod); + } + return true; +} + HIDDEN bool contrlav_handler(TMask_field& f, KEY key) { if (key == K_SPACE) @@ -604,6 +617,8 @@ void TClifo_application::on_config_change() init_pages(*_msk); _msk->show(-9, _gessal); // Mostra campi Estratti conto _msk->enable(DLG_CONTRLAV, main_app().has_module(LVAUT)); + if (_msk->id2pos(DLG_ALTNEWCLI) >= 0) + _msk->set_handler(DLG_ALTNEWCLI, altnewcli_handler); } @@ -625,6 +640,8 @@ void TClifo_application::init_query_mode(TMask& m) m.show(F_CODLIST, _liscatven); m.show(F_CODLIST1, !_liscatven); m.disable(DLG_CONTRLAV); + if (m.id2pos(DLG_ALTNEWCLI) >= 0) + m.disable(DLG_ALTNEWCLI); } void TClifo_application::init_query_insert_mode(TMask& m) @@ -642,6 +659,8 @@ void TClifo_application::init_insert_mode(TMask& m) if (_geslv) m.set(F_ARTSEP, "X"); } + if (m.id2pos(DLG_ALTNEWCLI) >= 0) + m.enable(DLG_ALTNEWCLI); } void TClifo_application::init_modify_mode(TMask& m) @@ -650,6 +669,8 @@ void TClifo_application::init_modify_mode(TMask& m) if(_gesven) m.enable_page(10, _geslv); m.enable(DLG_CONTRLAV, _geslv && m.get(F_TIPOCF) == "C"); + if (m.id2pos(DLG_ALTNEWCLI) >= 0) + m.disable(DLG_ALTNEWCLI); } void TClifo_application::set_pnae(TMask& m, TToken_string& nonacc, TToken_string& nonscd) diff --git a/cg/cg0200.h b/cg/cg0200.h index af56710ac..8ee5b73f7 100755 --- a/cg/cg0200.h +++ b/cg/cg0200.h @@ -153,6 +153,7 @@ #define F_CODCAUSINC 259 #define F_STATONASC 260 #define F_DESTANASC 261 +#define DLG_ALTNEWCLI 262 #define DLG_RIC 300 #define DLG_CST 301