Tolto bottone cancel dalla generazione archivi durante la scelta ditta da menu

Cambiata gestione configurazione di stampa registro per registro


git-svn-id: svn://10.65.10.50/trunk@1535 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-07-03 08:09:33 +00:00
parent c880db2a71
commit 228c4eb467
4 changed files with 69 additions and 30 deletions

View File

@ -140,7 +140,6 @@ bool TMenu_application::build_firm_data(long codditta, bool flagcom)
return error_box("Impossibile copiare il file %s della ditta %ld",
ntrc, codditta);
begin_wait();
TDir dir, dir1;
TTrec rec;
@ -166,7 +165,7 @@ bool TMenu_application::build_firm_data(long codditta, bool flagcom)
rec.zero();
}
TString80 mess("Generazione archivi della ditta "); mess << codditta;
TProgind p(maxeod0 ? maxeod0 : 1, mess, TRUE, TRUE, 70);
TProgind p(maxeod0 ? maxeod0 : 1, mess, FALSE, TRUE, 70);
for (int i = LF_DIR + 1; i <= maxeod0; i++)
{
@ -200,7 +199,6 @@ bool TMenu_application::build_firm_data(long codditta, bool flagcom)
if (c.get_bool("StiReg"))
{
TTable reg("REG");
for (reg.first(_lock); reg.good(); reg.next(_lock))
{
reg.put("B9", "X");
@ -209,7 +207,6 @@ bool TMenu_application::build_firm_data(long codditta, bool flagcom)
}
set_firm(codditta);
set_autoload_new_files(TRUE);
end_wait();
return TRUE;
}

View File

@ -16,13 +16,14 @@ class TGeneric_table_app : public Tab_application
bool _exist_journal;
bool _stampa_intest;
protected:
protected: // TRelation_application
virtual bool user_create() ;
virtual bool protected_record(TRectype& rec) ;
virtual void init_insert_mode(TMask& m) ;
virtual void init_modify_mode(TMask& m);
virtual int write(TMask& m);
public:
virtual void init_insert_mode(TMask& m) ;
virtual bool protected_record(TRectype& rec) ;
bool exist_journal() {return _exist_journal;}
TGeneric_table_app() : _exist_journal(FALSE), _stampa_intest(FALSE) {}
@ -34,31 +35,46 @@ HIDDEN inline TGeneric_table_app& app() { return (TGeneric_table_app&) main_app(
void TGeneric_table_app::init_insert_mode(TMask& m)
{
if (get_tabname() != "REG") return;
long ditta = get_firm();
int anno = atoi(m.get(F_ANNO));
m.set(F_STAMPA_INTESTAZIONE, _stampa_intest ? "X" : "");
if (ditta != _oldditta || anno != _oldanno)
if (get_tabname() == "REG")
{
_oldditta = ditta;
_oldanno = anno;
const long ditta = get_firm();
const int anno = atoi(m.get(F_ANNO));
TTable reg(get_tabname());
reg.zero();
reg.put("CODTAB", m.get(F_ANNO));
m.set(F_STAMPA_INTESTAZIONE, _stampa_intest ? "X" : "");
TRectype to(reg.curr());
_exist_journal = FALSE;
if (ditta != _oldditta || anno != _oldanno)
{
_oldditta = ditta;
_oldanno = anno;
for (reg.read(_isgteq); !_exist_journal && reg.good() && reg.curr() <= to; reg.next())
_exist_journal = (reg.get_long("I0") == REG_JOURNAL);
}
TTable reg(get_tabname());
reg.zero();
reg.put("CODTAB", m.get(F_ANNO));
TRectype to(reg.curr());
_exist_journal = FALSE;
for (reg.read(_isgteq); !_exist_journal && reg.good() && reg.curr() <= to; reg.next())
_exist_journal = (reg.get_long("I0") == REG_JOURNAL);
}
}
}
void TGeneric_table_app::init_modify_mode(TMask& m)
{
Tab_application::init_modify_mode(m);
if (get_tabname() == "REG")
{
TString16 config;
config.format("REG%05ld", m.get_long(F_CODDITTA));
config << m.get(F_CODICE);
TConfig ini(CONFIG_STAMPE, config);
const int what = ini.get_int("Type", NULL, -1, -1);
m.set(F_CONFIG, what >= 0 ? "X" : "");
m.enable(F_CONFIG, what >= 0);
}
}
bool TGeneric_table_app::protected_record(TRectype& rec)
{
bool prot = rec.get_bool(FPC);
@ -98,17 +114,21 @@ HIDDEN bool printer_handler(TMask_field& f, KEY k)
TString16 config;
config.format("REG%05ld", m.get_long(F_CODDITTA));
config << m.get(F_CODICE);
if (config.len() == 11)
{
TPrinter& p = printer();
p.set_printtype(normprinter); // Force configuration update
p.read_configuration(config);
p.set();
m.enable(F_CONFIG);
m.set(F_CONFIG, "X");
p.read_configuration();
}
else
return error_box("Nessun registro selezionato");
}
return TRUE;
}
@ -145,7 +165,7 @@ bool TGeneric_table_app::user_create()
mask.set_handler(F_PRINTER, printer_handler);
TConfig st(CONFIG_STUDIO, "cg");
_stampa_intest = st.get_bool("StiReg");
_stampa_intest = st.get_bool("StiReg");
}
if (name == "%DEL")
mask.set_handler(F_IMPORTO, impdel_handler);
@ -153,6 +173,22 @@ bool TGeneric_table_app::user_create()
return TRUE;
}
int TGeneric_table_app::write(TMask& m)
{
if (get_tabname() == "REG" && !m.get_bool(F_CONFIG))
{
TString16 config;
config.format("REG%05ld", m.get_long(F_CODDITTA));
config << m.get(F_CODICE);
TConfig ini(CONFIG_STAMPE, config);
const int what = ini.get_int("Type", NULL, -1, -1);
if (what >= 0)
ini.set("Type", -1);
}
return Tab_application::write(m);
}
int ba3100(int argc, char* argv[])
{
TGeneric_table_app a ;

View File

@ -46,3 +46,4 @@
#define F_RAGSOC 165
#define F_PRINTER 201
#define F_CONFIG 202

View File

@ -232,7 +232,12 @@ END
BUTTON F_PRINTER 32 2
BEGIN
PROMPT -11 17 "Configurazione stampante"
PROMPT 1 17 "Configurazione stampante"
END
BOOLEAN F_CONFIG
BEGIN
PROMPT 40 17 "Stampante configurata"
END
ENDPAGE