Corretta stampa Sig. o Sig.ra nella stampa delle etichette delle persone fisiche
git-svn-id: svn://10.65.10.50/trunk@253 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7b2d537322
commit
19a035c659
15
ba/ba0.cpp
15
ba/ba0.cpp
@ -86,7 +86,8 @@ class TMenu_application : public TApplication
|
|||||||
protected:
|
protected:
|
||||||
void load_menu();
|
void load_menu();
|
||||||
int do_level();
|
int do_level();
|
||||||
bool create();
|
virtual bool create();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TMenu_application(const char* name) : _name(name) {}
|
TMenu_application(const char* name) : _name(name) {}
|
||||||
@ -179,9 +180,16 @@ int TMenu_application::do_level()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool TMenu_application::create()
|
bool TMenu_application::create()
|
||||||
{
|
{
|
||||||
load_menu();
|
load_menu();
|
||||||
|
dispatch_e_menu(BAR_ITEM(1));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMenu_application::menu(MENU_TAG)
|
||||||
|
{
|
||||||
int refarray[256];
|
int refarray[256];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@ -213,14 +221,13 @@ bool TMenu_application::create()
|
|||||||
else _level = (--i >= 0) ? refarray[i] : 0;
|
else _level = (--i >= 0) ? refarray[i] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_run();
|
return FALSE;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
const char* menu = (argc < 2) ? "prassi.mnu" : argv[1];
|
const char* menu = (argc < 2) ? "prassi.mnu" : argv[1];
|
||||||
TMenu_application ma(menu);
|
TMenu_application ma(menu);
|
||||||
ma.run(argc, argv, "PRASSI");
|
ma.run(argc, argv, "Menu principale");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ void BA6100_App::process_link(int id, const char* txt)
|
|||||||
{
|
{
|
||||||
if (id == _ana_link)
|
if (id == _ana_link)
|
||||||
{
|
{
|
||||||
TString ss = "1|"; ss << txt;
|
TString80 ss = "1|"; ss << txt;
|
||||||
TMessage fs(cmd2name("ba4","-1"), MSG_LN, ss);
|
TMessage fs(cmd2name("ba4","-1"), MSG_LN, ss);
|
||||||
TMailbox m;
|
TMailbox m;
|
||||||
m.send(fs);
|
m.send(fs);
|
||||||
@ -51,10 +51,9 @@ void BA6100_App::process_link(int id, const char* txt)
|
|||||||
}
|
}
|
||||||
else if (id == _dit_link)
|
else if (id == _dit_link)
|
||||||
{
|
{
|
||||||
TString ss = "1|"; ss << txt << "|" << txt;
|
TString80 ss = "1|"; ss << txt << "|" << txt;
|
||||||
TMessage fs(cmd2name("ba4","-2"), MSG_LN, ss);
|
TMessage fs(cmd2name("ba4","-2"), MSG_LN, ss);
|
||||||
TMailbox m;
|
fs.send();
|
||||||
m.send(fs);
|
|
||||||
TExternal_app ba4("ba4 -2");
|
TExternal_app ba4("ba4 -2");
|
||||||
if (ba4.run()) beep();
|
if (ba4.run()) beep();
|
||||||
}
|
}
|
||||||
@ -165,8 +164,9 @@ void BA6100_App::preprocess_etichette()
|
|||||||
|
|
||||||
if (_pr_what == anafis)
|
if (_pr_what == anafis)
|
||||||
{
|
{
|
||||||
_surname = _name.mid(30,50); _surname.trim();
|
_surname = _name.mid(30); _surname.trim();
|
||||||
_name = _name.mid(0,30); _name.trim();
|
_name = _name.cut(30); _name.trim();
|
||||||
|
_sex = get_field(LF_ANAGFIS,"SESSO")[0] == 'M' ? "Sig." : "Sig.ra";
|
||||||
}
|
}
|
||||||
switch (_ind_what)
|
switch (_ind_what)
|
||||||
{
|
{
|
||||||
@ -453,7 +453,7 @@ bool BA6100_App::set_print(int)
|
|||||||
void BA6100_App::user_create()
|
void BA6100_App::user_create()
|
||||||
{
|
{
|
||||||
TToken_string rxp(40);
|
TToken_string rxp(40);
|
||||||
{
|
|
||||||
TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30);
|
TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30);
|
||||||
|
|
||||||
// setup relation
|
// setup relation
|
||||||
@ -544,7 +544,7 @@ void BA6100_App::user_create()
|
|||||||
set_wait_threshold(0);
|
set_wait_threshold(0);
|
||||||
|
|
||||||
p.addstatus(1);
|
p.addstatus(1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BA6100_App::user_destroy()
|
void BA6100_App::user_destroy()
|
||||||
@ -561,6 +561,6 @@ void BA6100_App::user_destroy()
|
|||||||
int ba6100(int argc, char* argv[])
|
int ba6100(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
BA6100_App app;
|
BA6100_App app;
|
||||||
app.run(argc, argv, "Stampe Anagrafiche");
|
app.run(argc, argv, "Stampa Anagrafiche");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
207
ba/ba6100.h
207
ba/ba6100.h
@ -1,103 +1,104 @@
|
|||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <iostream.h>
|
#include <iostream.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <lffiles.h>
|
#include <lffiles.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include "ba6100a.h"
|
#include "ba6100a.h"
|
||||||
#include "ba6100b.h"
|
#include "ba6100b.h"
|
||||||
|
|
||||||
#define M_SET_PRINTER MENU_FILE + 1100
|
#define M_SET_PRINTER MENU_FILE + 1100
|
||||||
#define M_PRINT MENU_FILE + 1101
|
#define M_PRINT MENU_FILE + 1101
|
||||||
#define MENU_TYPE MENU_FILE + 1102
|
#define MENU_TYPE MENU_FILE + 1102
|
||||||
|
|
||||||
enum pt { undefined = 0, elenco = 1, schede = 2, rubriche = 3, etichette = 4 };
|
enum pt { undefined = 0, elenco = 1, schede = 2, rubriche = 3, etichette = 4 };
|
||||||
enum pw { anafis = 0, anagiu = 1, nditte = 2 };
|
enum pw { anafis = 0, anagiu = 1, nditte = 2 };
|
||||||
enum in { residenza = 1, domfisc = 2, corrispondenza = 3 };
|
enum in { residenza = 1, domfisc = 2, corrispondenza = 3 };
|
||||||
|
|
||||||
bool mask_reset_fields(TMask_field& mf, KEY k);
|
bool mask_reset_fields(TMask_field& mf, KEY k);
|
||||||
|
|
||||||
class BA6100_App : public TPrintapp
|
class BA6100_App : public TPrintapp
|
||||||
{
|
{
|
||||||
friend bool mask_reset_fields(TMask_field& mf, KEY k);
|
friend bool mask_reset_fields(TMask_field& mf, KEY k);
|
||||||
|
|
||||||
pt _pr_type;
|
pt _pr_type;
|
||||||
pw _pr_what;
|
pw _pr_what;
|
||||||
TRelation* _rel_fis;
|
TRelation* _rel_fis;
|
||||||
TRelation* _rel_giu;
|
TRelation* _rel_giu;
|
||||||
TRelation* _rel_dit;
|
TRelation* _rel_dit;
|
||||||
int _cfis1, _cgiu1, _cdit1;
|
int _cfis1, _cgiu1, _cdit1;
|
||||||
int _cfis2, _cgiu2, _cdit2;
|
int _cfis2, _cgiu2, _cdit2;
|
||||||
int _sort;
|
int _sort;
|
||||||
bool _inclditte;
|
bool _inclditte;
|
||||||
TLocalisamfile* _comuni;
|
TLocalisamfile* _comuni;
|
||||||
// settings etichette
|
// settings etichette
|
||||||
in _ind_what;
|
in _ind_what;
|
||||||
int _ind_row, _ind_col, _rows_et, _cols_et;
|
int _ind_row, _ind_col, _rows_et, _cols_et;
|
||||||
int _piv_row, _piv_col, _cod_row, _cod_col;
|
int _piv_row, _piv_col, _cod_row, _cod_col;
|
||||||
bool _is_piv, _is_cod;
|
bool _is_piv, _is_cod;
|
||||||
bool* _frpos;
|
bool* _frpos;
|
||||||
TString _cod, _cofi, _name, _surname, _address,
|
TString _cod, _cofi, _name, _surname, _address,
|
||||||
_cap, _prov, _com, _civ, _stato, _phone;
|
_cap, _prov, _com, _civ, _stato, _phone;
|
||||||
|
TString16 _sex;
|
||||||
int _ana_link, _dit_link;
|
|
||||||
|
int _ana_link, _dit_link;
|
||||||
protected:
|
|
||||||
|
protected:
|
||||||
virtual void set_page(int file, int cnt);
|
|
||||||
virtual bool preprocess_page(int file, int counter);
|
virtual void set_page(int file, int cnt);
|
||||||
virtual void user_create();
|
virtual bool preprocess_page(int file, int counter);
|
||||||
virtual void user_destroy();
|
virtual void user_create();
|
||||||
virtual bool set_print(int n);
|
virtual void user_destroy();
|
||||||
virtual void process_link(int id, const char* txt);
|
virtual bool set_print(int n);
|
||||||
|
virtual void process_link(int id, const char* txt);
|
||||||
public:
|
|
||||||
|
public:
|
||||||
|
|
||||||
int cfis() { return _sort == 1 ? _cfis1 : _cfis2; }
|
|
||||||
int cgiu() { return _sort == 1 ? _cgiu1 : _cgiu2; }
|
int cfis() { return _sort == 1 ? _cfis1 : _cfis2; }
|
||||||
int cdit() { return _sort == 1 ? _cdit1 : _cdit2; }
|
int cgiu() { return _sort == 1 ? _cgiu1 : _cgiu2; }
|
||||||
|
int cdit() { return _sort == 1 ? _cdit1 : _cdit2; }
|
||||||
TRectype& look_com(const char* cod);
|
|
||||||
const char* look_tab(const char* tabname, const char* cod,
|
TRectype& look_com(const char* cod);
|
||||||
const char* fld = "S0");
|
const char* look_tab(const char* tabname, const char* cod,
|
||||||
|
const char* fld = "S0");
|
||||||
// bel casino, le schede
|
|
||||||
void set_scheda_anagiu();
|
// bel casino, le schede
|
||||||
void set_scheda_anafis();
|
void set_scheda_anagiu();
|
||||||
void set_scheda_ditta();
|
void set_scheda_anafis();
|
||||||
void set_scheda_attiv();
|
void set_scheda_ditta();
|
||||||
void set_scheda_registro();
|
void set_scheda_attiv();
|
||||||
void set_scheda_unloc();
|
void set_scheda_registro();
|
||||||
void set_scheda_socio();
|
void set_scheda_unloc();
|
||||||
void preprocess_etichette();
|
void set_scheda_socio();
|
||||||
void set_rubriche();
|
void preprocess_etichette();
|
||||||
void set_elenco();
|
void set_rubriche();
|
||||||
void set_schede();
|
void set_elenco();
|
||||||
void set_etichette();
|
void set_schede();
|
||||||
void set_headers();
|
void set_etichette();
|
||||||
|
void set_headers();
|
||||||
const char* get_field(int ln, const char* fn)
|
|
||||||
{ return current_cursor()->curr(ln).get(fn); }
|
const char* get_field(int ln, const char* fn)
|
||||||
|
{ return current_cursor()->curr(ln).get(fn); }
|
||||||
void init_print();
|
|
||||||
|
void init_print();
|
||||||
BA6100_App() : TPrintapp(), _cod(5), _cofi(30), _name(20), _surname(30),
|
|
||||||
_address(50), _cap(10), _prov(2), _com(50), _civ(5),
|
BA6100_App() : TPrintapp(), _cod(5), _cofi(30), _name(20), _surname(30),
|
||||||
_stato(40), _phone(30)
|
_address(50), _cap(10), _prov(2), _com(50), _civ(5),
|
||||||
|
_stato(40), _phone(30)
|
||||||
{
|
|
||||||
_rel_fis = _rel_giu = _rel_dit = NULL;
|
{
|
||||||
_pr_type = undefined; _pr_what = anafis;
|
_rel_fis = _rel_giu = _rel_dit = NULL;
|
||||||
_inclditte = FALSE;
|
_pr_type = undefined; _pr_what = anafis;
|
||||||
_ind_what = residenza;
|
_inclditte = FALSE;
|
||||||
_rows_et = 9; _cols_et = 40;
|
_ind_what = residenza;
|
||||||
_is_piv = TRUE; _is_cod = FALSE;
|
_rows_et = 9; _cols_et = 40;
|
||||||
_piv_row = 7; _cod_row = 2; _ind_row = 3;
|
_is_piv = TRUE; _is_cod = FALSE;
|
||||||
_piv_col = _ind_col = 3; _cod_col = 6;
|
_piv_row = 7; _cod_row = 2; _ind_row = 3;
|
||||||
_frpos = NULL;
|
_piv_col = _ind_col = 3; _cod_col = 6;
|
||||||
}
|
_frpos = NULL;
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
@ -91,19 +91,19 @@ BEGIN
|
|||||||
PROMPT 4 11 "Salva impostazioni"
|
PROMPT 4 11 "Salva impostazioni"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_OK 9 3
|
BUTTON DLG_OK 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 30 12 "Conferma"
|
PROMPT -13 -1 "Conferma"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_CANCEL 9 3
|
BUTTON DLG_CANCEL 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 44 12 "Annulla"
|
PROMPT -23 -1 "Annulla"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON BUT_BA6B_RESET 5 3
|
BUTTON BUT_BA6B_RESET 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 12 "Reset"
|
PROMPT -33 -1 "~Reset"
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
@ -831,11 +831,8 @@ void BA6100_App::set_etichette()
|
|||||||
if (_pr_what == anagiu)
|
if (_pr_what == anagiu)
|
||||||
set_row(namerow,TString(format("@%dg#t",_ind_col)), &_name);
|
set_row(namerow,TString(format("@%dg#t",_ind_col)), &_name);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_row(namerow,TString(format("@%dg%s #t #t",_ind_col,
|
set_row(namerow,TString(format("@%dg#t #t #t",_ind_col)), &_sex, &_name, &_surname);
|
||||||
*((const char *)get_field(LF_ANAGFIS,"SESSO")) == 'M' ?
|
|
||||||
"Sig." : "Sig.ra")),
|
|
||||||
&_name, &_surname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_row(_ind_row,TString(format("@%dg#t #t", _ind_col)), &_address, &_civ);
|
set_row(_ind_row,TString(format("@%dg#t #t", _ind_col)), &_address, &_civ);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user