Aggiunta possibilita' di specificare il profilo utente sulla

command line. Corretta la stampa del MESSAGE _UFFCSERVoUFFIIDD,
specificando il campo sul quale stampare.


git-svn-id: svn://10.65.10.50/trunk@2129 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1995-11-10 15:29:55 +00:00
parent 7e2210bf5e
commit 6785364819

View File

@ -19,10 +19,10 @@ protected:
virtual word set_body(word p, bool u);
public:
TTab_form(const char* name);
TTab_form(const char* name, const char * code);
};
TTab_form::TTab_form(const char* name) : TForm(name)
TTab_form::TTab_form(const char* name, const char * code) : TForm(name, code)
{
TCursor* c = cursor();
if (c == NULL)
@ -53,9 +53,11 @@ bool TTab_form::validate(TForm_item& fld, TToken_string& s)
if (code == "_CENSERoUFFIMP")
{
const int a_comres = s.get_int(); // Alias del comune di residenza (fiscale)
const int a_comres = s.get_int();
// Alias del comune di residenza (fiscale)
const int a_anagr = s.get_int(); // Alias dell'anagrafica della persona
TString i_cod(s.get()); // Eventuale Id del campo codice (solo se != 0)
TString16 i_des(s.get()); // Id del campo descrizione Centro Servizio (obbligatorio)
TString16 i_cod(s.get()); // Eventuale Id del campo codice (solo se != 0)
TString16 cod_us_uid; // Codice del Centro servizio o ufficio imposte dirette (NON E' IL CODICE DEL COMUNE)
TString80 desc; // Denominzazione centro servizi o ufficio imposte
@ -106,12 +108,17 @@ bool TTab_form::validate(TForm_item& fld, TToken_string& s)
_result = " ";
_result << " " << desc;
if (i_des.not_empty())
{
TForm_item& fi = fld.find_field(i_des);
fi.set(_result);
}
if (i_cod.not_empty())
{
TForm_item& fi = fld.find_field(i_cod);
fi.set(cod_us_uid);
}
fld.set(_result);
}
return TRUE;
}
return TForm::validate(fld, s);
@ -141,12 +148,16 @@ bool TForm_printer::create()
if (argc() < 3)
return error_box("Specificare il nome del profilo di stampa");
TFilename form(argv(2)); form.ext("frm");
long code=0;
if (argc() == 4)
code = atol(argv(3));
if (!fexist(form))
return error_box("Il profilo %s non esiste", (const char*)form);
return error_box("Il profilo %s non esiste", (const char*)form);
form.ext("");
_tabcom = new TLocalisamfile(LF_TABCOM);
TTab_form f(form);
TTab_form f(form, (code != 0) ? format("%05ld",code) : "");
f.print();
stop_run();
return TRUE;