Patch level : 12.0 880

Files correlati     : f9.exe
Commento            :
- Per estrazione normale spostato campo descrizione nella maschera estrazione e eliminata la maschera descrizione (solo per estrazione singola)
- Chiusura automatica maschera dopo estrazione
- Pulito campo descrizione dopo estrazione
- Corretta canzellazione estrazione
This commit is contained in:
Simone Palacino 2019-09-25 17:43:55 +02:00
parent b88e2959c0
commit 1001f22adc
3 changed files with 21 additions and 16 deletions

View File

@ -67,7 +67,7 @@ const char* check_str(const TString& str)
// TEstrai_mask
////////////////////////////////////////////////////////
TEstrai_mask::TEstrai_mask() : TMask("Estrazione", 1, 60, 10)
TEstrai_mask::TEstrai_mask() : TMask("Estrazione", 1, 60, 16)
{
add_button_tool(DLG_ELABORA, "Estrai", TOOL_ELABORA);
add_button_tool(DLG_NULL, "", 0);
@ -80,6 +80,8 @@ TEstrai_mask::TEstrai_mask() : TMask("Estrazione", 1, 60, 10)
add_list(ES_FLAGPROV, 0, "Flag provvisorio", 2, 4, 1, "", "P|D", "Provvisorio|Definitivo");
add_groupbox(ES_TIPOGROUP, 0, "Selezionare documenti da estrarre:", 32, 3, 28, 3, "");
add_list(ES_TIPODOC, 0, "Tipi documento", 33, 4, 1, "", "A|V", "Acquisti|Vendite");
add_groupbox(ES_DESCGROUP, 0, "Inserire descrizione estrazione:", 1, 6, 59, 3, "");
add_string(ES_DESCR, 0, "Descrizione", 2, 7, 250, "", 40);
TMask::set_handler(DLG_ELABORA, estrai_handler);
TMask::set_handler(ES_DATAINI, dataini_handler);
@ -90,11 +92,9 @@ TEstrai_mask::TEstrai_mask() : TMask("Estrazione", 1, 60, 10)
set(ES_DATAEND, today);
}
bool TEstrai_mask::estrai_handler(TMask_field& f, unsigned short key)
bool TEstrai_mask::estrai_handler(TMask_field& f, KEY key)
{
auto& msk = (TEstrai_mask&)f.mask(); // this
TF9_app::descr_msk().run();
msk._descr.cut(0) << TF9_app::descr_msk().get(DES_TEXT);
auto& msk = (TEstrai_mask&)f.mask(); // this estrai_mask
const int stato = app().estrai();
if (stato == 1)
{
@ -106,6 +106,8 @@ bool TEstrai_mask::estrai_handler(TMask_field& f, unsigned short key)
app().segna_in_errore();
warning_box("L'estrazione non e' stata completata. Controllare il log degli errori.");
}
msk.field(ES_DESCR).set("");
msk.stop_run(K_FORCE_CLOSE);
return true;
}
@ -117,13 +119,13 @@ void TEstrai_mask::enable_fields(bool en)
enable(ES_TIPODOC, en);
}
bool TEstrai_mask::enable_handler(TMask_field& f, unsigned short key)
bool TEstrai_mask::enable_handler(TMask_field& f, KEY key)
{
((TEstrai_mask&)f.mask()).enable_fields();
return true;
}
bool TEstrai_mask::dataini_handler(TMask_field& f, unsigned short key)
bool TEstrai_mask::dataini_handler(TMask_field& f, KEY key)
{
TMask& msk = f.mask();
if (key == K_TAB)
@ -134,7 +136,7 @@ bool TEstrai_mask::dataini_handler(TMask_field& f, unsigned short key)
return true;
}
bool TEstrai_mask::dataend_handler(TMask_field& f, unsigned short key)
bool TEstrai_mask::dataend_handler(TMask_field& f, KEY key)
{
TMask& msk = f.mask();
if (key == K_TAB)
@ -150,7 +152,7 @@ bool TEstrai_mask::dataend_handler(TMask_field& f, unsigned short key)
// TMonitor_mask
////////////////////////////////////////////////////////
bool TMonitor_mask::save_conf_handler(TMask_field& f, unsigned short key)
bool TMonitor_mask::save_conf_handler(TMask_field& f, KEY key)
{
TMask& m = f.mask();
TF9_app& a = app();
@ -302,7 +304,7 @@ void TMonitor_mask::delete_pack(const bool all) const
" SELECT @flag_prov AS FLAG, @stato AS STATO;\n"
"END";
db().sq_set_exec(query);
if(db().sq_get("FLAG") != 'P' && db().sq_get("STATO") != "02" && !all)
if(db().sq_get("FLAG") != "P" && db().sq_get("STATO") != "02" && !all)
{
warning_box("E' possibile eliminare solo un'estrazione provvisoria o in stato di errore diagnostica gestionale.");
return;
@ -503,6 +505,7 @@ int TF9_app::estrai_single(TToken_string& row, char flagprov, char tipodoc)
_head.id_estr.cut(0) << today.date2ansi() << _estr_msk->get(ES_FLAGPROV) << "X" << next_estr_today(tipo);
descr_msk().run();
_head.descr = descr_msk().get(DES_TEXT);
descr_msk().set(DES_TEXT, "");
_head.user = user();
_head.addr_cart = _addr_doc;

View File

@ -42,10 +42,10 @@ class TEstrai_mask : public TMask
void enable_fields(bool en = true);
static bool estrai_handler(TMask_field& f, unsigned short key);
static bool enable_handler(TMask_field& f, unsigned short key);
static bool dataini_handler(TMask_field& f, unsigned short key);
static bool dataend_handler(TMask_field& f, unsigned short key);
static bool estrai_handler(TMask_field& f, KEY key);
static bool enable_handler(TMask_field& f, KEY key);
static bool dataini_handler(TMask_field& f, KEY key);
static bool dataend_handler(TMask_field& f, KEY key);
public:
TString& get_descr() { return _descr; }
TEstrai_mask();
@ -94,7 +94,7 @@ class TF9_app : public TSkeleton_application
char get_tipodoc_escl() const { return _tipodoc_escl; }
TipoIVA get_tipoiva() const { return get_tipodoc() == 'A' ? iva_acquisti : iva_vendite; }
TipoIVA get_tipoiva_escl() const { return get_tipodoc_escl() == 'A' ? iva_acquisti : iva_vendite; }
TString& get_descr() const { return _estr_msk->get_descr(); }
TString get_descr() const { return _estr_msk->get(ES_DESCR); }
bool is_provviso() const { return _estr_msk->get(ES_FLAGPROV)[0] == 'P'; }
//void fill();
@ -152,7 +152,7 @@ class TMonitor_mask : public TAutomask
vector<TToken_string> _fppro;
friend class TF9_app;
static bool save_conf_handler(TMask_field& f, unsigned short key);
static bool save_conf_handler(TMask_field& f, KEY key);
void controllo_errori() const;
// Riempie sheet per visualizzare le estrazioni

View File

@ -40,6 +40,8 @@
#define ES_DATEGROUP 505
#define ES_FLAGGROUP 506
#define ES_TIPOGROUP 507
#define ES_DESCGROUP 508
#define ES_DESCR 509
// Campi maschera configurazione
#define CF_CODGROUP 501