1997-06-17 15:50:08 +00:00
|
|
|
|
#include <form.h>
|
|
|
|
|
#include <mask.h>
|
1997-12-05 16:26:15 +00:00
|
|
|
|
#include <printapp.h>
|
|
|
|
|
#include <recarray.h>
|
|
|
|
|
#include <tabutil.h>
|
|
|
|
|
#include <utility.h>
|
1997-06-17 15:50:08 +00:00
|
|
|
|
|
|
|
|
|
#include "soggetti.h"
|
1997-12-05 16:26:15 +00:00
|
|
|
|
#include "benem.h"
|
|
|
|
|
#include "donaz.h"
|
1997-06-17 15:50:08 +00:00
|
|
|
|
#include "sezioni.h"
|
|
|
|
|
#include <comuni.h>
|
|
|
|
|
|
|
|
|
|
#include "at2.h"
|
|
|
|
|
#include "at2700a.h"
|
|
|
|
|
|
1997-12-05 16:26:15 +00:00
|
|
|
|
#include "at4100b.h"
|
|
|
|
|
#include "at4100c.h"
|
1997-06-17 15:50:08 +00:00
|
|
|
|
|
1997-12-05 16:26:15 +00:00
|
|
|
|
#define ALIAS_CTD 700 // categoria donatori
|
|
|
|
|
#define ALIAS_CTN1 701 // categoria non donatori 1
|
|
|
|
|
#define ALIAS_CTN2 702 // categoria non donatori 2
|
|
|
|
|
|
|
|
|
|
#define ALIAS_TCS 200 // tipi/esiti controlli sanitari
|
|
|
|
|
#define ALIAS_LDN 400 // punti di prelievo
|
|
|
|
|
|
|
|
|
|
#define ALIAS_LCPDOM 100 // localita' postale di domicilio
|
|
|
|
|
#define ALIAS_COMDOM 501 // comune di domicilio
|
|
|
|
|
#define ALIAS_COMNAS 500 // comune di nascita
|
|
|
|
|
|
|
|
|
|
#define ALIAS_BNZ 600 // benemerenze
|
|
|
|
|
#define ALIAS_GAZ 300 // gruppi aziendale
|
|
|
|
|
|
1998-02-23 08:30:28 +00:00
|
|
|
|
enum ts { undefined=0, sintetico=1, completo=2, schede=3, etichette=4, cartoline=5, personale=6 };
|
1997-06-17 15:50:08 +00:00
|
|
|
|
|
|
|
|
|
// definizione form per etichette
|
|
|
|
|
class TEti_percat_form : public TForm
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual TCursor* cursor() const;
|
|
|
|
|
virtual TRelation* relation() const;
|
|
|
|
|
TPrint_section& get_body() { return section('B'); } ;
|
1998-02-23 08:30:28 +00:00
|
|
|
|
TPrint_section& get_head() { return section('H'); } ;
|
|
|
|
|
TPrint_section& get_foot() { return section('F'); } ;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TEti_percat_form(): TForm() {};
|
|
|
|
|
TEti_percat_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
|
|
|
|
: TForm(form,code,editlevel,desc) {};
|
|
|
|
|
virtual ~TEti_percat_form() {};
|
|
|
|
|
};
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
class TStampaPerCategorie : public TPrintapp
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
static bool filter_func_percat(const TRelation* rel);
|
|
|
|
|
|
|
|
|
|
TRelation* _rel;
|
|
|
|
|
TMask* _msk;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
TLocalisamfile* _benem;
|
|
|
|
|
TLocalisamfile* _donaz;
|
|
|
|
|
TRecord_array* _sbenemerenze;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TEti_percat_form* _form_eti;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
TEti_percat_form* _form_car;
|
|
|
|
|
TEti_percat_form* _form_sch;
|
1998-02-23 08:30:28 +00:00
|
|
|
|
TEti_percat_form* _form_per;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TAssoc_array _catdon;
|
|
|
|
|
TAssoc_array _catnondon;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
TParagraph_string _cognome_nome, _dencom, _benemerenza;
|
|
|
|
|
TString80 _rigastampa;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TDate _data_stampa;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
ts _tipostampa;
|
|
|
|
|
TString16 _lettini, _lettfin, _capini, _capfin;
|
|
|
|
|
TString16 _gruppoazie, _gruppoold;
|
|
|
|
|
bool _pergruppo;
|
|
|
|
|
int _contatore;
|
|
|
|
|
TString16 _codsez, _codsot, _orario, _datacart;
|
|
|
|
|
TString80 _invitoper, _data, _presso1, _presso2, _presso3, _presso4;
|
|
|
|
|
TString80 _note, _intest1, _intest2, _intest3, _intest4;
|
|
|
|
|
bool _usomodo, _usasez;
|
1998-02-16 13:45:58 +00:00
|
|
|
|
int _etlarghezza, _etcolonne, _schxpag, _lenpage;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
bool _stampa80;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual bool user_create();
|
|
|
|
|
virtual bool user_destroy();
|
|
|
|
|
virtual bool set_print(int m);
|
|
|
|
|
virtual void set_page(int file, int cnt);
|
|
|
|
|
virtual bool preprocess_page (int file, int counter);
|
1997-12-05 16:26:15 +00:00
|
|
|
|
virtual print_action postprocess_print(int file, int counter);
|
|
|
|
|
ts dati_cartolina();
|
1997-06-17 15:50:08 +00:00
|
|
|
|
|
|
|
|
|
public:
|
1997-12-05 16:26:15 +00:00
|
|
|
|
void dati_sezione(const TString16 codsez, const TString16 codsot);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
void crea_intestazione();
|
|
|
|
|
void filtra_sezioni();
|
1997-12-05 16:26:15 +00:00
|
|
|
|
void header_gruppo(const TString16 gruppo);
|
|
|
|
|
void footer_gruppo();
|
1997-06-17 15:50:08 +00:00
|
|
|
|
void header_sezione(const TString16 codsez, const TString16 codsot);
|
1997-12-05 16:26:15 +00:00
|
|
|
|
void footer_sezione();
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TMask& app_mask() { return *_msk; }
|
|
|
|
|
|
1997-12-05 16:26:15 +00:00
|
|
|
|
TStampaPerCategorie() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",30), _benemerenza("",11) {}
|
1997-06-17 15:50:08 +00:00
|
|
|
|
};
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
HIDDEN inline TStampaPerCategorie& app() { return (TStampaPerCategorie&) main_app(); }
|
1997-06-17 15:50:08 +00:00
|
|
|
|
|
|
|
|
|
TCursor* TEti_percat_form::cursor() const { return app().current_cursor(); }
|
|
|
|
|
|
|
|
|
|
TRelation* TEti_percat_form::relation() const { return cursor()->relation(); }
|
|
|
|
|
|
1997-12-05 16:26:15 +00:00
|
|
|
|
void TStampaPerCategorie::dati_sezione(const TString16 codsez, const TString16 codsot)
|
|
|
|
|
{
|
|
|
|
|
_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1);
|
|
|
|
|
_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2);
|
|
|
|
|
_intest3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ3);
|
|
|
|
|
_intest4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ4);
|
|
|
|
|
if (_usasez)
|
|
|
|
|
{
|
|
|
|
|
if (_presso1.blank())
|
|
|
|
|
{
|
|
|
|
|
_presso1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE1);
|
|
|
|
|
_presso2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE2);
|
|
|
|
|
_presso3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE3);
|
|
|
|
|
_presso4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE4);
|
|
|
|
|
}
|
|
|
|
|
if (_orario.blank())
|
|
|
|
|
_orario = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVORA);
|
|
|
|
|
if (_note.blank())
|
|
|
|
|
_note = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVNOTE);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ts TStampaPerCategorie::dati_cartolina()
|
|
|
|
|
{
|
|
|
|
|
TMask msk("at4100b");
|
|
|
|
|
if (msk.run() == K_ENTER)
|
|
|
|
|
{
|
|
|
|
|
_invitoper = msk.get(F_INVITOPER);
|
|
|
|
|
_data = msk.get(F_DATA);
|
|
|
|
|
_presso1 = msk.get(F_PRESSO1);
|
|
|
|
|
_presso2 = msk.get(F_PRESSO2);
|
|
|
|
|
_presso3 = msk.get(F_PRESSO3);
|
|
|
|
|
_presso4 = msk.get(F_PRESSO4);
|
|
|
|
|
_datacart = msk.get(F_DATACART);
|
|
|
|
|
_orario = msk.get(F_ORARIO);
|
|
|
|
|
_note = msk.get(F_NOTE);
|
|
|
|
|
_usasez = msk.get_bool(F_USASEZ);
|
|
|
|
|
return cartoline;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return undefined;
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
void TStampaPerCategorie::filtra_sezioni()
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
const TString16 sezini = _msk->get(F_SEZINI);
|
|
|
|
|
const TString16 sotini = _msk->get(F_SOTINI);
|
|
|
|
|
const TString16 sezfin = _msk->get(F_SEZFIN);
|
|
|
|
|
const TString16 sotfin = _msk->get(F_SOTFIN);
|
|
|
|
|
TRectype da(LF_SOGGETTI);
|
|
|
|
|
TRectype a(LF_SOGGETTI);
|
|
|
|
|
if (sezini.not_empty())
|
|
|
|
|
da.put(SOG_CODSEZ, sezini);
|
|
|
|
|
if (sotini.not_empty())
|
|
|
|
|
da.put(SOG_CODSOT, sotini);
|
|
|
|
|
if (sezfin.not_empty())
|
|
|
|
|
a.put(SOG_CODSEZ, sezfin);
|
|
|
|
|
if (sotfin.not_empty())
|
|
|
|
|
a.put(SOG_CODSOT, sotfin);
|
|
|
|
|
current_cursor()->setregion(da, a);
|
|
|
|
|
}
|
|
|
|
|
|
1997-12-05 16:26:15 +00:00
|
|
|
|
void TStampaPerCategorie::footer_gruppo()
|
|
|
|
|
{
|
|
|
|
|
// stampa totale soggetti appartenenti al gruppo
|
|
|
|
|
reset_footer();
|
|
|
|
|
TString sep(80);
|
|
|
|
|
sep.fill('-');
|
|
|
|
|
set_footer(2, (const char *) sep);
|
|
|
|
|
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
|
|
|
|
|
printer().formfeed();
|
|
|
|
|
reset_footer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print_action TStampaPerCategorie::postprocess_print(int file, int counter)
|
|
|
|
|
{
|
|
|
|
|
if (_contatore > 0)
|
|
|
|
|
{
|
|
|
|
|
if (_pergruppo)
|
|
|
|
|
footer_gruppo();
|
|
|
|
|
else
|
|
|
|
|
footer_sezione();
|
|
|
|
|
}
|
1998-02-16 13:45:58 +00:00
|
|
|
|
if ((_tipostampa == schede) && (_schxpag > 1))
|
|
|
|
|
printer().formlen(_lenpage);
|
1997-12-05 16:26:15 +00:00
|
|
|
|
return NEXT_PAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TStampaPerCategorie::footer_sezione()
|
|
|
|
|
{
|
|
|
|
|
// stampa totale soggetti appartenenti alla sezione
|
|
|
|
|
reset_footer();
|
|
|
|
|
TString sep(80);
|
|
|
|
|
sep.fill('-');
|
|
|
|
|
set_footer(2, (const char *) sep);
|
|
|
|
|
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
|
|
|
|
|
printer().formfeed();
|
|
|
|
|
reset_footer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TStampaPerCategorie::header_gruppo(const TString16 gruppo)
|
|
|
|
|
{
|
|
|
|
|
TString intestazione(132);
|
|
|
|
|
intestazione = "GRUPPO AZIENDALE ";
|
|
|
|
|
intestazione << gruppo;
|
|
|
|
|
intestazione << " - ";
|
|
|
|
|
intestazione << current_cursor()->curr(-ALIAS_GAZ).get("S0");
|
|
|
|
|
if (_stampa80)
|
|
|
|
|
intestazione.center_just(80);
|
|
|
|
|
else
|
|
|
|
|
intestazione.center_just(132);
|
|
|
|
|
set_header(1,"@0g%s", (const char*) intestazione);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
void TStampaPerCategorie::set_page(int file, int cnt)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
1997-12-05 16:26:15 +00:00
|
|
|
|
switch (_tipostampa)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
case etichette:
|
1997-12-05 16:26:15 +00:00
|
|
|
|
{
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TPrint_section& corpo = _form_eti->get_body();
|
1997-12-05 16:26:15 +00:00
|
|
|
|
for (int r=1;r<=_etcolonne;r++)
|
|
|
|
|
{
|
|
|
|
|
if (current_cursor()->pos()<current_cursor()->items())
|
|
|
|
|
{
|
|
|
|
|
force_setpage(TRUE);
|
|
|
|
|
corpo.update();
|
|
|
|
|
for (word i = 0; i < corpo.height(); i++)
|
|
|
|
|
{
|
|
|
|
|
TPrintrow& riga = corpo.row(i);
|
|
|
|
|
TString256 riga1 = riga.row();
|
|
|
|
|
riga1.cut(_etlarghezza);
|
|
|
|
|
int colonna = ((r-1)*_etlarghezza);
|
|
|
|
|
TString16 formato;
|
1998-05-11 09:46:37 +00:00
|
|
|
|
formato << '@' << colonna << 'g';
|
1997-12-05 16:26:15 +00:00
|
|
|
|
riga1.insert(formato,0);
|
|
|
|
|
set_row(i+1,riga1);
|
|
|
|
|
}
|
|
|
|
|
if (r < _etcolonne)
|
|
|
|
|
++(*current_cursor());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
1998-02-23 08:30:28 +00:00
|
|
|
|
case personale:
|
|
|
|
|
{
|
|
|
|
|
TPrint_section& corpo = _form_per->get_body();
|
|
|
|
|
force_setpage(TRUE);
|
|
|
|
|
corpo.update();
|
1998-05-11 09:46:37 +00:00
|
|
|
|
TString riga1;
|
1998-02-23 08:30:28 +00:00
|
|
|
|
for (word i = 0; i < corpo.height(); i++)
|
|
|
|
|
{
|
|
|
|
|
TPrintrow& riga = corpo.row(i);
|
1998-05-11 09:46:37 +00:00
|
|
|
|
riga1 = riga.row();
|
1998-02-23 08:30:28 +00:00
|
|
|
|
set_row(i+1,riga1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//force_setpage(TRUE);
|
|
|
|
|
//corpo.update_and_print(TRUE);
|
|
|
|
|
}
|
|
|
|
|
break;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
case schede:
|
|
|
|
|
{
|
|
|
|
|
TPrint_section& corpo = _form_sch->get_body();
|
|
|
|
|
corpo.update_and_print(TRUE);
|
|
|
|
|
force_setpage(TRUE);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case cartoline:
|
|
|
|
|
{
|
|
|
|
|
TPrint_section& corpo = _form_car->get_body();
|
|
|
|
|
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
|
|
|
|
const TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
|
|
|
|
|
if ((_codsez!=codsez)||(_codsot!=codsot))
|
|
|
|
|
{
|
|
|
|
|
_codsez = codsez;
|
|
|
|
|
_codsot = codsot;
|
|
|
|
|
dati_sezione(codsez, codsot);
|
|
|
|
|
corpo.reset();
|
|
|
|
|
TForm_item& intest1 = corpo.find_field(CAR_INTEST1);
|
|
|
|
|
intest1.set(_intest1);
|
|
|
|
|
TForm_item& intest2 = corpo.find_field(CAR_INTEST2);
|
|
|
|
|
intest2.set(_intest2);
|
|
|
|
|
TForm_item& intest3 = corpo.find_field(CAR_INTEST3);
|
|
|
|
|
intest3.set(_intest3);
|
|
|
|
|
TForm_item& intest4 = corpo.find_field(CAR_INTEST4);
|
|
|
|
|
intest4.set(_intest4);
|
|
|
|
|
TForm_item& invito = corpo.find_field(CAR_INVITOPER);
|
|
|
|
|
invito.set(_invitoper);
|
|
|
|
|
TForm_item& data = corpo.find_field(CAR_DATA);
|
|
|
|
|
data.set(_data);
|
|
|
|
|
TForm_item& presso1 = corpo.find_field(CAR_PRESSO1);
|
|
|
|
|
presso1.set(_presso1);
|
|
|
|
|
TForm_item& presso2 = corpo.find_field(CAR_PRESSO2);
|
|
|
|
|
presso2.set(_presso2);
|
|
|
|
|
TForm_item& presso3 = corpo.find_field(CAR_PRESSO3);
|
|
|
|
|
presso3.set(_presso3);
|
|
|
|
|
TForm_item& presso4 = corpo.find_field(CAR_PRESSO4);
|
|
|
|
|
presso4.set(_presso4);
|
|
|
|
|
TForm_item& orario = corpo.find_field(CAR_ORARIO);
|
|
|
|
|
orario.set(_orario);
|
|
|
|
|
TForm_item& datacart = corpo.find_field(CAR_DATACART);
|
|
|
|
|
datacart.set(_datacart);
|
|
|
|
|
TForm_item& note = corpo.find_field(CAR_NOTE);
|
|
|
|
|
note.set(_note);
|
|
|
|
|
}
|
1997-06-17 15:50:08 +00:00
|
|
|
|
corpo.update();
|
1997-12-05 16:26:15 +00:00
|
|
|
|
for (word i = 0; i < corpo.height(); i++)
|
|
|
|
|
{
|
|
|
|
|
TPrintrow& riga = corpo.row(i);
|
|
|
|
|
set_row(i+1,riga);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
case sintetico:
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
1998-05-25 13:20:15 +00:00
|
|
|
|
if (_stampa80)
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
|
|
|
|
set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
|
|
|
|
set_row(3,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_CATDON));
|
|
|
|
|
set_row(1,"@9g#a", &_cognome_nome);
|
|
|
|
|
set_row(3,"@9g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
|
|
|
|
set_row(1,"@35g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR));
|
|
|
|
|
set_row(2,"@35g#a", &_dencom);
|
|
|
|
|
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_TELABI));
|
|
|
|
|
set_row(2,"@67g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
|
|
|
|
set_row(3,"@67g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
|
|
|
|
set_row(4,"");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
|
|
|
|
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
|
|
|
|
set_row(1,"@12g#a", &_cognome_nome);
|
|
|
|
|
set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
|
|
|
|
set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR));
|
|
|
|
|
set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI));
|
|
|
|
|
set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
|
|
|
|
set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
|
|
|
|
set_row(2,"@49g#a", &_dencom);
|
|
|
|
|
set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
|
|
|
|
set_row(3,"");
|
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case completo:
|
|
|
|
|
{
|
|
|
|
|
if (_stampa80)
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
|
|
|
|
set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
|
|
|
|
set_row(3,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_CATDON));
|
|
|
|
|
|
|
|
|
|
set_row(1,"@9g@S",FLD(LF_SOGGETTI,SOG_COGNOME));
|
|
|
|
|
set_row(2,"@9g@S",FLD(LF_SOGGETTI,SOG_NOME));
|
|
|
|
|
set_row(3,"@9g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
|
|
|
|
set_row(4,"@9g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR));
|
|
|
|
|
set_row(5,"@9g#a", &_dencom);
|
|
|
|
|
|
|
|
|
|
set_row(1,"@40g@S", FLD(LF_SOGGETTI,SOG_TELABI));
|
|
|
|
|
set_row(2,"@40g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
|
|
|
|
set_row(3,"@40g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
|
|
|
|
set_row(4,"@40g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAZIE));
|
|
|
|
|
set_row(5,"@40g@S", FLD(LF_SOGGETTI,SOG_PROFESS));
|
|
|
|
|
|
|
|
|
|
set_row(1,"@56gGr @S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
|
|
|
|
|
set_row(2,"@56gRh @S", FLD(LF_SOGGETTI,SOG_RHANTID));
|
|
|
|
|
set_row(3,"@56gFe @S", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
|
|
|
|
|
set_row(4,"@56gKe @S", FLD(LF_SOGGETTI,SOG_KELL));
|
|
|
|
|
set_row(5,"@56gDu @S", FLD(LF_SOGGETTI,SOG_DU));
|
|
|
|
|
|
|
|
|
|
set_row(1,"@66g@S", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
|
|
|
|
set_row(2,"@70g@n", FLD(LF_SOGGETTI,SOG_TOTDON));
|
|
|
|
|
set_row(3,"@66g@S", FLD(LF_SOGGETTI,SOG_DATAISC));
|
|
|
|
|
set_row(4,"@66g#a", &_benemerenza);
|
|
|
|
|
|
|
|
|
|
set_row(1,"@77g@S", FLD(LF_SOGGETTI,SOG_STATO));
|
|
|
|
|
set_row(2,"@77g@S", FLD(LF_SOGGETTI,SOG_IDON1));
|
|
|
|
|
set_row(3,"@77g@S", FLD(LF_SOGGETTI,SOG_IDON2));
|
|
|
|
|
set_row(4,"@77g@S", FLD(LF_SOGGETTI,SOG_IDON3));
|
|
|
|
|
set_row(5,"@77g@S", FLD(LF_SOGGETTI,SOG_IDON4));
|
|
|
|
|
|
|
|
|
|
set_row(6,"");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
|
|
|
|
set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
|
|
|
|
set_row(3,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_CATDON));
|
|
|
|
|
|
|
|
|
|
set_row(1,"@9g@S",FLD(LF_SOGGETTI,SOG_COGNOME));
|
|
|
|
|
set_row(2,"@9g@S",FLD(LF_SOGGETTI,SOG_NOME));
|
|
|
|
|
set_row(3,"@9g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
1998-05-11 09:46:37 +00:00
|
|
|
|
set_row(4,"@9g@S", FLD(-ALIAS_COMNAS,COM_DENCOM));
|
1997-12-05 16:26:15 +00:00
|
|
|
|
|
|
|
|
|
set_row(1,"@35g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR));
|
|
|
|
|
set_row(2,"@35g#a", &_dencom);
|
|
|
|
|
|
|
|
|
|
set_row(1,"@66g@S", FLD(LF_SOGGETTI,SOG_TELABI));
|
|
|
|
|
set_row(2,"@66g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
|
|
|
|
set_row(3,"@66g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
|
|
|
|
set_row(4,"@66g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAZIE));
|
|
|
|
|
set_row(5,"@66g@S", FLD(LF_SOGGETTI,SOG_PROFESS));
|
|
|
|
|
|
|
|
|
|
set_row(1,"@82gGr @S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
|
|
|
|
|
set_row(2,"@82gRh @S", FLD(LF_SOGGETTI,SOG_RHANTID));
|
|
|
|
|
set_row(3,"@82gFe @S", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
|
|
|
|
|
set_row(4,"@82gKe @S", FLD(LF_SOGGETTI,SOG_KELL));
|
|
|
|
|
set_row(5,"@82gDu @S", FLD(LF_SOGGETTI,SOG_DU));
|
|
|
|
|
|
|
|
|
|
set_row(1,"@94g@S", FLD(LF_SOGGETTI,SOG_STATO));
|
|
|
|
|
set_row(2,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON1));
|
|
|
|
|
set_row(3,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON2));
|
|
|
|
|
set_row(4,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON3));
|
|
|
|
|
set_row(5,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON4));
|
|
|
|
|
|
|
|
|
|
set_row(1,"@98g@S", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
|
|
|
|
set_row(2,"@100g@n", FLD(LF_SOGGETTI,SOG_TOTDON));
|
|
|
|
|
set_row(3,"@98g@S", FLD(LF_SOGGETTI,SOG_DATAISC));
|
|
|
|
|
set_row(4,"@98g#a", &_benemerenza);
|
|
|
|
|
|
|
|
|
|
set_row(6,"");
|
|
|
|
|
}
|
1997-06-17 15:50:08 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
bool TStampaPerCategorie::filter_func_percat(const TRelation* rel)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
bool filtrato = FALSE;
|
|
|
|
|
TLocalisamfile& sog = rel->lfile();
|
1997-08-01 14:49:53 +00:00
|
|
|
|
// filtro per categorie donatori
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TAssoc_array& categorie = app()._catdon;
|
|
|
|
|
if (categorie.items() != 0)
|
|
|
|
|
{
|
|
|
|
|
const TString16 cat = sog.get(SOG_CATDON);
|
|
|
|
|
filtrato = categorie.is_key((const char*) cat);
|
|
|
|
|
}
|
|
|
|
|
if (!filtrato)
|
|
|
|
|
{
|
|
|
|
|
// filtro per categorie non donatori
|
|
|
|
|
TAssoc_array& categorie = app()._catnondon;
|
|
|
|
|
if (categorie.items() != 0)
|
|
|
|
|
{
|
|
|
|
|
const TString16 cat1 = sog.get(SOG_CATNOND1);
|
|
|
|
|
const TString16 cat2 = sog.get(SOG_CATNOND2);
|
|
|
|
|
filtrato = (categorie.is_key((const char*) cat1) || categorie.is_key((const char*) cat2)) ;
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-08-01 14:49:53 +00:00
|
|
|
|
// se non ho selezionato categorie il soggetto va filtrato comunque
|
1997-06-17 15:50:08 +00:00
|
|
|
|
if (app()._catdon.items() == 0 && app()._catnondon.items() == 0)
|
|
|
|
|
filtrato = TRUE;
|
1997-08-01 14:49:53 +00:00
|
|
|
|
// filtro per iniziale cognome
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (filtrato && (!app()._lettini.blank()) && (!app()._lettfin.blank()))
|
1997-08-01 14:49:53 +00:00
|
|
|
|
{
|
|
|
|
|
TString80 cognome = sog.get(SOG_COGNOME);
|
1998-05-25 13:20:15 +00:00
|
|
|
|
int leni = app()._lettini.len();
|
|
|
|
|
TString16 cognomei = cognome.left(leni);
|
|
|
|
|
int lenf = app()._lettfin.len();
|
|
|
|
|
TString16 cognomef = cognome.left(lenf);
|
|
|
|
|
if (!(cognomei >= app()._lettini && cognomef <= app()._lettfin))
|
1997-08-01 14:49:53 +00:00
|
|
|
|
filtrato = FALSE;
|
|
|
|
|
}
|
1997-06-17 15:50:08 +00:00
|
|
|
|
return filtrato;
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
void TStampaPerCategorie::header_sezione(const TString16 codsez, const TString16 codsot)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
|
|
|
|
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
|
|
|
|
TString intestazione(132);
|
|
|
|
|
intestazione = "Sezione: ";
|
|
|
|
|
intestazione << codsez;
|
1998-05-11 09:46:37 +00:00
|
|
|
|
intestazione << '/';
|
1997-06-17 15:50:08 +00:00
|
|
|
|
intestazione << codsot;
|
1998-05-11 09:46:37 +00:00
|
|
|
|
intestazione << ' ';
|
1997-06-17 15:50:08 +00:00
|
|
|
|
intestazione << densez;
|
|
|
|
|
if ((densot.ok())&& (densot.not_empty()))
|
|
|
|
|
{
|
1998-05-11 09:46:37 +00:00
|
|
|
|
intestazione << '/';
|
1997-06-17 15:50:08 +00:00
|
|
|
|
intestazione << densot;
|
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_stampa80)
|
|
|
|
|
intestazione.center_just(80);
|
|
|
|
|
else
|
|
|
|
|
intestazione.center_just(132);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
set_header(1,"@0g%s", (const char*) intestazione);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
bool TStampaPerCategorie::preprocess_page(int file, int counter)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
1998-02-23 08:30:28 +00:00
|
|
|
|
TRectype& recsog = current_cursor()->curr();
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_tipostampa==sintetico||_tipostampa==completo)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
TString80 nome = recsog.get(SOG_COGNOME);
|
1998-05-11 09:46:37 +00:00
|
|
|
|
nome << ' ';
|
1997-06-17 15:50:08 +00:00
|
|
|
|
nome << recsog.get(SOG_NOME);
|
|
|
|
|
_cognome_nome = nome;
|
|
|
|
|
TString256 localita = "";
|
1997-12-05 16:26:15 +00:00
|
|
|
|
localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S6");
|
1997-06-17 15:50:08 +00:00
|
|
|
|
if (localita.not_empty() && localita.ok())
|
|
|
|
|
{
|
1998-05-11 09:46:37 +00:00
|
|
|
|
localita << ' ';
|
1997-12-05 16:26:15 +00:00
|
|
|
|
localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S0");
|
1997-06-17 15:50:08 +00:00
|
|
|
|
localita << " - ";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
1998-05-11 09:46:37 +00:00
|
|
|
|
localita << ' ';
|
1997-06-17 15:50:08 +00:00
|
|
|
|
}
|
|
|
|
|
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
1998-05-11 09:46:37 +00:00
|
|
|
|
localita << ' ' << current_cursor()->curr(LF_COMUNI).get(COM_PROVCOM);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
localita.trim();
|
|
|
|
|
_dencom = localita;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
// cerco ultima benemerenza
|
|
|
|
|
TString80 benemerenza = "";
|
|
|
|
|
const long codice = recsog.get_long(SOG_CODICE);
|
|
|
|
|
TRectype* key = new TRectype(LF_BENEM);
|
|
|
|
|
key->put(BEN_CODICE,codice);
|
|
|
|
|
const int err = _sbenemerenze->read(key);
|
|
|
|
|
if (err == NOERR)
|
|
|
|
|
{
|
|
|
|
|
const int ultima = _sbenemerenze->rows();
|
|
|
|
|
if (ultima != 0)
|
|
|
|
|
{
|
|
|
|
|
TString16 codben = _sbenemerenze->row(ultima).get(BEN_TIPOBEN);
|
|
|
|
|
TTable bnz("BNZ");
|
|
|
|
|
bnz.put("CODTAB",codben);
|
|
|
|
|
if (bnz.read() == NOERR)
|
|
|
|
|
benemerenza << bnz.get("S0");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
benemerenza.cut(21);
|
|
|
|
|
_benemerenza = benemerenza;
|
1998-02-23 08:30:28 +00:00
|
|
|
|
}
|
|
|
|
|
// salto pagina se cambio sezione o gruppo aziendale
|
|
|
|
|
if (_tipostampa==sintetico || _tipostampa==completo || _tipostampa==personale)
|
|
|
|
|
{
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_pergruppo)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
1997-12-05 16:26:15 +00:00
|
|
|
|
TString16 grupponew = current_cursor()->curr(LF_SOGGETTI).get(SOG_GRUPPOAZIE);
|
|
|
|
|
if (grupponew != _gruppoold )
|
|
|
|
|
{
|
|
|
|
|
if (_gruppoold != "**")
|
|
|
|
|
footer_gruppo();
|
|
|
|
|
_contatore = 0;
|
|
|
|
|
_gruppoold = grupponew;
|
|
|
|
|
header_gruppo(grupponew);
|
|
|
|
|
}
|
1997-06-17 15:50:08 +00:00
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
|
|
|
|
const TString16 codsot = recsog.get(SOG_CODSOT);
|
|
|
|
|
if ((_codsez!=codsez)||(_codsot!=codsot))
|
|
|
|
|
{
|
|
|
|
|
if (_codsez != "**")
|
|
|
|
|
footer_sezione();
|
|
|
|
|
_contatore = 0;
|
|
|
|
|
_codsez = codsez;
|
|
|
|
|
_codsot = codsot;
|
|
|
|
|
header_sezione(codsez, codsot);
|
|
|
|
|
}
|
1998-05-25 13:20:15 +00:00
|
|
|
|
if (((_tipostampa==sintetico) && ((_stampa80 && printer().rows_left()<4) || (printer().rows_left()<3))) || (printer().rows_left()<6 && _tipostampa==completo))
|
1998-02-23 08:30:28 +00:00
|
|
|
|
printer().formfeed();
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_tipostampa==etichette)
|
|
|
|
|
if (printer().rows_left() < _form_eti->get_body().height())
|
|
|
|
|
printer().formfeed();
|
|
|
|
|
_contatore++;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
bool TStampaPerCategorie::set_print(int m)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
1997-12-05 16:26:15 +00:00
|
|
|
|
_tipostampa = undefined;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
KEY tasto;
|
|
|
|
|
tasto = _msk->run();
|
|
|
|
|
switch (tasto)
|
|
|
|
|
{
|
1997-12-05 16:26:15 +00:00
|
|
|
|
case F_SINTETICO:
|
|
|
|
|
_tipostampa=sintetico;
|
|
|
|
|
break;
|
|
|
|
|
case F_COMPLETO:
|
|
|
|
|
_tipostampa=completo;
|
|
|
|
|
break;
|
1998-02-23 08:30:28 +00:00
|
|
|
|
case F_PERSONALE:
|
|
|
|
|
_tipostampa=personale;
|
|
|
|
|
break;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
case F_SCHEDE:
|
|
|
|
|
_tipostampa=schede;
|
1998-02-16 13:45:58 +00:00
|
|
|
|
if (_schxpag > 1)
|
|
|
|
|
printer().formlen(_lenpage/_schxpag);
|
1997-12-05 16:26:15 +00:00
|
|
|
|
break;
|
|
|
|
|
case F_ETICHETTE:
|
|
|
|
|
_tipostampa=etichette;
|
|
|
|
|
break;
|
|
|
|
|
case F_CARTOLINE:
|
|
|
|
|
_tipostampa=cartoline;
|
|
|
|
|
break;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_tipostampa != undefined)
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_tipostampa == cartoline)
|
|
|
|
|
dati_cartolina();
|
|
|
|
|
_codsez = "**";
|
|
|
|
|
_codsot = "**";
|
|
|
|
|
_gruppoold = "**";
|
|
|
|
|
_contatore = 0;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
TString80 chiave = "";
|
1997-12-05 16:26:15 +00:00
|
|
|
|
_pergruppo = _msk->get_bool(F_PERGRUPPO);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
bool percap = _msk->get_bool(F_PERCAP);
|
1997-12-05 16:26:15 +00:00
|
|
|
|
_capini = _msk->get(F_CAPINI);
|
|
|
|
|
_capfin = _msk->get(F_CAPFIN);
|
|
|
|
|
_lettini = _msk->get(F_LETTINI);
|
|
|
|
|
_lettini.left(15);
|
|
|
|
|
_lettfin = _msk->get(F_LETTFIN);
|
|
|
|
|
_lettfin.left(15);
|
1998-02-23 08:30:28 +00:00
|
|
|
|
if (_pergruppo)
|
|
|
|
|
{
|
|
|
|
|
_gruppoazie = _msk->get(F_GRUPPOAZIE);
|
|
|
|
|
if (_gruppoazie.empty())
|
|
|
|
|
chiave << "90->GRUPPOAZIE|";
|
|
|
|
|
}
|
1997-06-17 15:50:08 +00:00
|
|
|
|
if (percap)
|
1997-12-05 16:26:15 +00:00
|
|
|
|
chiave << "90->DOM_CAP|90->DOM_CODCOM|90->DOM_CODLOC|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
1997-06-17 15:50:08 +00:00
|
|
|
|
else
|
1998-02-23 08:30:28 +00:00
|
|
|
|
{
|
|
|
|
|
if (_pergruppo)
|
|
|
|
|
chiave << "UPPER(90->COGNOME)|UPPER(90->NOME)";
|
|
|
|
|
else
|
|
|
|
|
chiave << "90->CODSEZ|90->CODSOT|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
TString256 filtro = "";
|
|
|
|
|
if (_gruppoazie.not_empty())
|
|
|
|
|
filtro.format("(90->GRUPPOAZIE == \"%s\")",(const char*)_gruppoazie);
|
|
|
|
|
if (_capini.not_empty())
|
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << " && ";
|
|
|
|
|
filtro << format("(90->DOM_CAP >= \"%s\")",(const char*)_capini);
|
|
|
|
|
}
|
|
|
|
|
if (_capfin.not_empty())
|
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << " && ";
|
|
|
|
|
filtro << format("(90->DOM_CAP <= \"%s\")",(const char*)_capfin);
|
|
|
|
|
}
|
|
|
|
|
bool notiziario = _msk->get_bool(F_NOTIZIARIO);
|
|
|
|
|
if (notiziario)
|
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << " && ";
|
|
|
|
|
filtro << "(90->NOTIZIARIO == \"X\")";
|
|
|
|
|
}
|
|
|
|
|
const TString16 sezini = _msk->get(F_SEZINI);
|
|
|
|
|
const TString16 sotini = _msk->get(F_SOTINI);
|
|
|
|
|
const TString16 sezfin = _msk->get(F_SEZFIN);
|
|
|
|
|
const TString16 sotfin = _msk->get(F_SOTFIN);
|
|
|
|
|
TRectype da(LF_SOGGETTI);
|
|
|
|
|
TRectype a(LF_SOGGETTI);
|
|
|
|
|
if (sezini.not_empty())
|
|
|
|
|
da.put(SOG_CODSEZ, sezini);
|
|
|
|
|
if (sotini.not_empty())
|
|
|
|
|
da.put(SOG_CODSOT, sotini);
|
|
|
|
|
if (sezfin.not_empty())
|
|
|
|
|
a.put(SOG_CODSEZ, sezfin);
|
|
|
|
|
if (sotfin.not_empty())
|
|
|
|
|
a.put(SOG_CODSOT, sotfin);
|
|
|
|
|
current_cursor()->setregion(da, a);
|
|
|
|
|
current_cursor()->setfilter(filtro, TRUE);
|
|
|
|
|
((TSorted_cursor*)current_cursor())->change_order(chiave);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
reset_files();
|
|
|
|
|
add_file(LF_SOGGETTI);
|
1998-02-04 13:46:27 +00:00
|
|
|
|
_catdon.destroy();
|
1997-06-17 15:50:08 +00:00
|
|
|
|
const TString16 catpri = _msk->get(F_CAT1);
|
|
|
|
|
const TString16 catsec = _msk->get(F_CAT2);
|
|
|
|
|
const TString16 catter = _msk->get(F_CAT3);
|
|
|
|
|
const TString16 catqua = _msk->get(F_CAT4);
|
|
|
|
|
const TString16 catqui = _msk->get(F_CAT5);
|
|
|
|
|
const TString16 catses = _msk->get(F_CAT6);
|
|
|
|
|
if (catpri.not_empty() && catpri.ok())
|
|
|
|
|
_catdon.add((const char*) catpri);
|
|
|
|
|
if (catsec.not_empty() && catsec.ok())
|
|
|
|
|
_catdon.add((const char*) catsec);
|
|
|
|
|
if (catter.not_empty() && catter.ok())
|
|
|
|
|
_catdon.add((const char*) catter);
|
|
|
|
|
if (catqua.not_empty() && catqua.ok())
|
|
|
|
|
_catdon.add((const char*) catqua);
|
|
|
|
|
if (catqui.not_empty() && catqui.ok())
|
|
|
|
|
_catdon.add((const char*) catqui);
|
|
|
|
|
if (catses.not_empty() && catses.ok())
|
|
|
|
|
_catdon.add((const char*) catses);
|
1998-02-04 13:46:27 +00:00
|
|
|
|
_catnondon.destroy();
|
1997-06-17 15:50:08 +00:00
|
|
|
|
const TString16 catnpri = _msk->get(F_CATN1);
|
|
|
|
|
const TString16 catnsec = _msk->get(F_CATN2);
|
|
|
|
|
const TString16 catnter = _msk->get(F_CATN3);
|
|
|
|
|
const TString16 catnqua = _msk->get(F_CATN4);
|
|
|
|
|
const TString16 catnqui = _msk->get(F_CATN5);
|
|
|
|
|
const TString16 catnses = _msk->get(F_CATN6);
|
|
|
|
|
if (catnpri.not_empty() && catnpri.ok())
|
|
|
|
|
_catnondon.add((const char*) catnpri);
|
|
|
|
|
if (catnsec.not_empty() && catnsec.ok())
|
|
|
|
|
_catnondon.add((const char*) catnsec);
|
|
|
|
|
if (catnter.not_empty() && catnter.ok())
|
|
|
|
|
_catnondon.add((const char*) catnter);
|
|
|
|
|
if (catnqua.not_empty() && catnqua.ok())
|
|
|
|
|
_catnondon.add((const char*) catnqua);
|
|
|
|
|
if (catnqui.not_empty() && catnqui.ok())
|
|
|
|
|
_catnondon.add((const char*) catnqui);
|
|
|
|
|
if (catnses.not_empty() && catnses.ok())
|
|
|
|
|
_catnondon.add((const char*) catnses);
|
|
|
|
|
current_cursor()->set_filterfunction (filter_func_percat);
|
|
|
|
|
reset_print();
|
|
|
|
|
crea_intestazione();
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
void TStampaPerCategorie::crea_intestazione()
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
reset_header();
|
1997-12-05 16:26:15 +00:00
|
|
|
|
TString sep(132);
|
|
|
|
|
if (_tipostampa==sintetico)
|
|
|
|
|
sep = "ELENCO SINTETICO PER CATEGORIE";
|
|
|
|
|
if (_tipostampa==completo)
|
|
|
|
|
sep = "ELENCO COMPLETO PER CATEGORIE";
|
|
|
|
|
if (_tipostampa==sintetico || _tipostampa==completo)
|
|
|
|
|
{
|
|
|
|
|
printer().footerlen(3);
|
|
|
|
|
|
|
|
|
|
if (_stampa80)
|
|
|
|
|
sep.center_just(80);
|
|
|
|
|
else
|
|
|
|
|
sep.center_just(132);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
set_header(2, "@0g%s", (const char*) sep);
|
|
|
|
|
TString16 data_stampa = _data_stampa.string();
|
|
|
|
|
set_header(2,"@0g%10s", (const char*) data_stampa);
|
|
|
|
|
sep = "";
|
|
|
|
|
sep << "Pag. @#";
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_stampa80)
|
|
|
|
|
set_header(2, "@73g%s", (const char*) sep);
|
|
|
|
|
else
|
|
|
|
|
set_header(2, "@110g%s", (const char*) sep);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
sep = "";
|
|
|
|
|
sep.fill('-');
|
1998-05-25 13:20:15 +00:00
|
|
|
|
if (_stampa80)
|
|
|
|
|
sep.cut(80);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
set_header(3, (const char *) sep);
|
1997-12-05 16:26:15 +00:00
|
|
|
|
}
|
1998-02-23 08:30:28 +00:00
|
|
|
|
if (_tipostampa==personale)
|
|
|
|
|
{
|
|
|
|
|
TPrint_section& testata = _form_per->get_head();
|
|
|
|
|
testata.update();
|
|
|
|
|
for (word i=0; i<testata.height(); i++)
|
|
|
|
|
{
|
|
|
|
|
TPrintrow& riga = testata.row(i);
|
|
|
|
|
TString256 riga1 = riga.row();
|
|
|
|
|
set_header(i+1,riga1);
|
|
|
|
|
}
|
|
|
|
|
TPrint_section& piede = _form_per->get_foot();
|
|
|
|
|
piede.update();
|
|
|
|
|
for (i=0; i<piede.height(); i++)
|
|
|
|
|
{
|
|
|
|
|
TPrintrow& riga = piede.row(i);
|
|
|
|
|
TString256 riga1 = riga.row();
|
|
|
|
|
set_footer(i+1,riga1);
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
if (_tipostampa==sintetico)
|
|
|
|
|
{
|
1998-05-25 13:20:15 +00:00
|
|
|
|
if (_stampa80)
|
|
|
|
|
{
|
|
|
|
|
_dencom.set_width(30);
|
|
|
|
|
set_header(4,"@0gCodice@9gCognome e nome@35gIndirizzo@67gTelefono abit.");
|
|
|
|
|
set_header(5,"@0gTessera@35gCAP/Localit<69>/Comune/Prov.@67gTelefono lavoro");
|
|
|
|
|
set_header(6,"@0gCat.don.@9gData nascita@67gTelefono altro");
|
|
|
|
|
set_header(7,"@0g--------@9g-------------------------@35g------------------------------@67g--------------");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_dencom.set_width(50);
|
|
|
|
|
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
|
|
|
|
|
set_header(5,"@0gTessera@49gCAP/Localit<69>/Comune/Prov.@116gTelefono altro");
|
|
|
|
|
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
|
|
|
|
|
}
|
1997-12-05 16:26:15 +00:00
|
|
|
|
}
|
|
|
|
|
if (_tipostampa==completo)
|
|
|
|
|
{
|
|
|
|
|
_dencom.set_width(30);
|
|
|
|
|
if (_stampa80)
|
|
|
|
|
{
|
|
|
|
|
set_header(4,"@0g Codice@9gCognome@40gTelefono abit.@56gTipizza@66gUlt.donaz.@77gSt.");
|
|
|
|
|
set_header(5,"@0g Tessera@9gNome@40gTelefono lavoro@56gzione@66gTot.donaz.@77gId.");
|
|
|
|
|
set_header(6,"@0g Categ.@9gData di nascita@40gTelefono altro@66gData iscr.");
|
|
|
|
|
set_header(7,"@9gIndirizzo@40gGruppo aziend.@66gUlt.benem.");
|
|
|
|
|
set_header(8,"@40gProfessione");
|
|
|
|
|
set_header(9,"@0g--------@9g------------------------------@40g---------------@56g---------@66g----------@77g---");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_header(4,"@0g Codice@9gCognome@35gIndirizzo@66gTelefono abit.@82gTipizza@92gStato@98gUlt.donaz.");
|
|
|
|
|
set_header(5,"@0g Tessera@9gNome@66gTelefono lavoro@82gzione@92gIdon.@98gTot.donaz.");
|
|
|
|
|
set_header(6,"@0g Categ.@9gData di nascita@66gTelefono altro@98gData iscr.");
|
|
|
|
|
set_header(7,"@66gGruppo aziend.@98gUlt.benem.");
|
|
|
|
|
set_header(8,"@66gProfessione");
|
|
|
|
|
set_header(9,"@0g--------@9g-------------------------@35g------------------------------@66g---------------@82g---------@92g-----@98g----------");
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-06-17 15:50:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
bool TStampaPerCategorie::user_create()
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
_rel = new TRelation(LF_SOGGETTI);
|
1997-12-05 16:26:15 +00:00
|
|
|
|
_rel->add(LF_DONAZ, "CODICE==CODICE", 1);
|
|
|
|
|
_rel->add(LF_BENEM, "CODICE==CODICE", 1);
|
1997-06-17 15:50:08 +00:00
|
|
|
|
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
1997-12-05 16:26:15 +00:00
|
|
|
|
_rel->add("BNZ", "CODTAB==TIPOBEN", 1, LF_BENEM, ALIAS_BNZ);
|
|
|
|
|
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
|
|
|
|
_rel->add("CTN", "CODTAB==CATNOND1",1,0,ALIAS_CTN1);
|
|
|
|
|
_rel->add("CTN", "CODTAB==CATNOND2",1,0,ALIAS_CTN2);
|
|
|
|
|
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
|
|
|
|
_rel->add("LDN", "CODTAB==PUNTORACC",1,0,ALIAS_LDN);
|
|
|
|
|
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM);
|
|
|
|
|
_rel->add("GAZ", "CODTAB==GRUPPOAZIE",1,0,ALIAS_GAZ);
|
|
|
|
|
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMDOM);
|
|
|
|
|
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
|
|
|
|
|
_rel->add(LF_MEDICI, "CODMED==CODMED");
|
|
|
|
|
_donaz = new TLocalisamfile(LF_DONAZ);
|
|
|
|
|
_benem = new TLocalisamfile(LF_BENEM);
|
|
|
|
|
_sbenemerenze = new TRecord_array(LF_BENEM,BEN_PROGBEN);
|
1998-02-23 08:30:28 +00:00
|
|
|
|
add_cursor(new TSorted_cursor(_rel,"SOG_CODSEZ|SOG_CODSOT","",3));
|
1997-06-17 15:50:08 +00:00
|
|
|
|
_msk = new TMask("at2700a");
|
1997-12-05 16:26:15 +00:00
|
|
|
|
|
|
|
|
|
TConfig config(CONFIG_STUDIO);
|
|
|
|
|
TString16 etformato = config.get("EtFormato");
|
|
|
|
|
_etlarghezza = config.get_int("EtLarghezza");
|
|
|
|
|
_etcolonne = config.get_int("EtColonne");
|
|
|
|
|
_form_eti = new TEti_percat_form(etformato);
|
|
|
|
|
_stampa80 = config.get_bool("Stampa80");
|
|
|
|
|
_form_car = new TEti_percat_form("ATCARTO1");
|
1998-02-16 13:45:58 +00:00
|
|
|
|
TString16 schformato = config.get("SchFormato");
|
|
|
|
|
_schxpag = config.get_int("SchXPag");
|
|
|
|
|
_form_sch = new TEti_percat_form(schformato);
|
1998-02-23 08:30:28 +00:00
|
|
|
|
TString16 performato = config.get("ElencoFormato");
|
|
|
|
|
_form_per = new TEti_percat_form(performato);
|
1998-02-16 13:45:58 +00:00
|
|
|
|
_lenpage = printer().formlen();
|
1997-06-17 15:50:08 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
|
bool TStampaPerCategorie::user_destroy()
|
1997-06-17 15:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
delete _msk;
|
|
|
|
|
delete _rel;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
delete _benem;
|
|
|
|
|
delete _donaz;
|
|
|
|
|
delete _sbenemerenze;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
delete _form_eti;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
delete _form_car;
|
|
|
|
|
delete _form_sch;
|
1998-02-23 08:30:28 +00:00
|
|
|
|
delete _form_per;
|
1997-06-17 15:50:08 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int at2700(int argc, char* argv[])
|
|
|
|
|
{
|
1997-08-01 14:49:53 +00:00
|
|
|
|
TStampaPerCategorie a;
|
1997-12-05 16:26:15 +00:00
|
|
|
|
a.run(argc, argv, "Stampa soggetti per categorie");
|
1997-06-17 15:50:08 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|