Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Stampe soggetti: configurazione stampante per etichette + totale soggetti per sezione git-svn-id: svn://10.65.10.50/trunk@7697 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a615320d1f
commit
34f0b7cd93
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "at2.h"
|
#include "at2.h"
|
||||||
#include "at2800a.h"
|
#include "at2800a.h"
|
||||||
|
#include "atlib.h"
|
||||||
|
|
||||||
#define ALIAS_LCP 100
|
#define ALIAS_LCP 100
|
||||||
#define ALIAS_TCS 200
|
#define ALIAS_TCS 200
|
||||||
@ -37,6 +38,7 @@ class TStampaNonDon : public TPrintapp
|
|||||||
TEti_nondon_form* _form_eti;
|
TEti_nondon_form* _form_eti;
|
||||||
TAssoc_array _categorie;
|
TAssoc_array _categorie;
|
||||||
int _cur;
|
int _cur;
|
||||||
|
int _contatore;
|
||||||
TParagraph_string _cognome_nome, _dencom;
|
TParagraph_string _cognome_nome, _dencom;
|
||||||
TDate _data_stampa;
|
TDate _data_stampa;
|
||||||
TDate _data;
|
TDate _data;
|
||||||
@ -51,11 +53,13 @@ protected:
|
|||||||
virtual bool set_print(int m);
|
virtual bool set_print(int m);
|
||||||
virtual void set_page(int file, int cnt);
|
virtual void set_page(int file, int cnt);
|
||||||
virtual bool preprocess_page (int file, int counter);
|
virtual bool preprocess_page (int file, int counter);
|
||||||
|
virtual print_action postprocess_print(int file, int counter);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void crea_intestazione();
|
void crea_intestazione();
|
||||||
void filtra_sezioni();
|
void filtra_sezioni();
|
||||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||||
|
void footer_sezione();
|
||||||
TMask& app_mask() { return *_msk; }
|
TMask& app_mask() { return *_msk; }
|
||||||
|
|
||||||
TStampaNonDon() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
TStampaNonDon() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
||||||
@ -207,6 +211,18 @@ void TStampaNonDon::header_sezione(const TString16 codsez, const TString16 codso
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TStampaNonDon::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();
|
||||||
|
}
|
||||||
|
|
||||||
bool TStampaNonDon::preprocess_page(int file, int counter)
|
bool TStampaNonDon::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
if (_tipostampa == elenco)
|
if (_tipostampa == elenco)
|
||||||
@ -239,36 +255,51 @@ bool TStampaNonDon::preprocess_page(int file, int counter)
|
|||||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||||
{
|
{
|
||||||
if (_codsez != "**")
|
if (_codsez != "**")
|
||||||
printer().formfeed();
|
//printer().formfeed();
|
||||||
|
footer_sezione();
|
||||||
_codsez = codsez;
|
_codsez = codsez;
|
||||||
_codsot = codsot;
|
_codsot = codsot;
|
||||||
|
_contatore = 0;
|
||||||
header_sezione(codsez, codsot);
|
header_sezione(codsez, codsot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_tipostampa==etichette)
|
if (_tipostampa==etichette)
|
||||||
if (printer().rows_left() < _form_eti->get_body().height())
|
if (printer().rows_left() < _form_eti->get_body().height())
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
|
_contatore++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_action TStampaNonDon::postprocess_print(int file, int counter)
|
||||||
|
{
|
||||||
|
if (_contatore > 0)
|
||||||
|
footer_sezione();
|
||||||
|
return NEXT_PAGE;
|
||||||
|
}
|
||||||
|
|
||||||
bool TStampaNonDon::set_print(int m)
|
bool TStampaNonDon::set_print(int m)
|
||||||
{
|
{
|
||||||
|
TPrinter& p = printer();
|
||||||
|
p.read_configuration();
|
||||||
_tipostampa = undefined;
|
_tipostampa = undefined;
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
tasto = _msk->run();
|
tasto = _msk->run();
|
||||||
switch (tasto)
|
switch (tasto)
|
||||||
{
|
{
|
||||||
case F_ELENCO:
|
case F_ELENCO:
|
||||||
|
{
|
||||||
_tipostampa = elenco;
|
_tipostampa = elenco;
|
||||||
_codsez = "**";
|
_codsez = "**";
|
||||||
_codsot = "**";
|
_codsot = "**";
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
case F_ETICHETTE:
|
case F_ETICHETTE:
|
||||||
_tipostampa = etichette;
|
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (_tipostampa != undefined)
|
if (_tipostampa != undefined)
|
||||||
{
|
{
|
||||||
|
_contatore = 0;
|
||||||
reset_files();
|
reset_files();
|
||||||
add_file(LF_SOGGETTI);
|
add_file(LF_SOGGETTI);
|
||||||
filtra_sezioni();
|
filtra_sezioni();
|
||||||
@ -310,7 +341,8 @@ void TStampaNonDon::crea_intestazione()
|
|||||||
{
|
{
|
||||||
reset_header();
|
reset_header();
|
||||||
if (_tipostampa == elenco)
|
if (_tipostampa == elenco)
|
||||||
{
|
{
|
||||||
|
printer().footerlen(5);
|
||||||
TString sep(132);
|
TString sep(132);
|
||||||
sep = "ELENCO SOGGETTI CHE NON DONANO DAL ";
|
sep = "ELENCO SOGGETTI CHE NON DONANO DAL ";
|
||||||
if (app()._data.ok())
|
if (app()._data.ok())
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "at2.h"
|
#include "at2.h"
|
||||||
#include "at2900a.h"
|
#include "at2900a.h"
|
||||||
|
#include "atlib.h"
|
||||||
|
|
||||||
#define ALIAS_LCP 100
|
#define ALIAS_LCP 100
|
||||||
#define ALIAS_TCS 200
|
#define ALIAS_TCS 200
|
||||||
@ -51,6 +52,7 @@ class TFrequenza : public TPrintapp
|
|||||||
TString16 _codsez, _codsot;
|
TString16 _codsez, _codsot;
|
||||||
int _etlarghezza, _etcolonne;
|
int _etlarghezza, _etcolonne;
|
||||||
bool _stampa80;
|
bool _stampa80;
|
||||||
|
int _contatore;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
@ -58,13 +60,14 @@ protected:
|
|||||||
virtual bool set_print(int m);
|
virtual bool set_print(int m);
|
||||||
virtual void set_page(int file, int cnt);
|
virtual void set_page(int file, int cnt);
|
||||||
virtual bool preprocess_page (int file, int counter);
|
virtual bool preprocess_page (int file, int counter);
|
||||||
|
virtual print_action postprocess_print(int file, int counter);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void crea_intestazione();
|
void crea_intestazione();
|
||||||
void filtra_sezioni();
|
void filtra_sezioni();
|
||||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||||
|
void footer_sezione();
|
||||||
TMask& app_mask() { return *_msk; }
|
TMask& app_mask() { return *_msk; }
|
||||||
|
|
||||||
TFrequenza() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50), _numdonsog("",5), _dataultdon("",10) {}
|
TFrequenza() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50), _numdonsog("",5), _dataultdon("",10) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -279,7 +282,8 @@ bool TFrequenza::preprocess_page(int file, int counter)
|
|||||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||||
{
|
{
|
||||||
if (_codsez != "**")
|
if (_codsez != "**")
|
||||||
printer().formfeed();
|
footer_sezione();
|
||||||
|
_contatore = 0;
|
||||||
_codsez = codsez;
|
_codsez = codsez;
|
||||||
_codsot = codsot;
|
_codsot = codsot;
|
||||||
header_sezione(codsez, codsot);
|
header_sezione(codsez, codsot);
|
||||||
@ -288,24 +292,48 @@ bool TFrequenza::preprocess_page(int file, int counter)
|
|||||||
if (_tipostampa==etichette)
|
if (_tipostampa==etichette)
|
||||||
if (printer().rows_left() < _form_eti->get_body().height())
|
if (printer().rows_left() < _form_eti->get_body().height())
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
|
_contatore++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_action TFrequenza::postprocess_print(int file, int counter)
|
||||||
|
{
|
||||||
|
if (_contatore > 0)
|
||||||
|
footer_sezione();
|
||||||
|
return NEXT_PAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TFrequenza::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();
|
||||||
|
}
|
||||||
|
|
||||||
bool TFrequenza::set_print(int m)
|
bool TFrequenza::set_print(int m)
|
||||||
{
|
{
|
||||||
|
TPrinter& p = printer();
|
||||||
|
p.read_configuration();
|
||||||
_tipostampa = undefined;
|
_tipostampa = undefined;
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
tasto = _msk->run();
|
tasto = _msk->run();
|
||||||
switch (tasto)
|
switch (tasto)
|
||||||
{
|
{
|
||||||
case F_ELENCO:
|
case F_ELENCO:
|
||||||
|
{
|
||||||
_tipostampa = elenco;
|
_tipostampa = elenco;
|
||||||
_codsez = "**";
|
_codsez = "**";
|
||||||
_codsot = "**";
|
_codsot = "**";
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
case F_ETICHETTE:
|
case F_ETICHETTE:
|
||||||
_tipostampa = etichette;
|
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (_tipostampa != undefined)
|
if (_tipostampa != undefined)
|
||||||
{
|
{
|
||||||
@ -337,6 +365,7 @@ bool TFrequenza::set_print(int m)
|
|||||||
_categorie.add((const char*) catses);
|
_categorie.add((const char*) catses);
|
||||||
current_cursor()->set_filterfunction (filter_func_freq);
|
current_cursor()->set_filterfunction (filter_func_freq);
|
||||||
reset_print();
|
reset_print();
|
||||||
|
printer().footerlen(0);
|
||||||
crea_intestazione();
|
crea_intestazione();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -379,7 +408,6 @@ void TFrequenza::crea_intestazione()
|
|||||||
set_header(6,"@0gCateg.@9gNato il@44gTelefono altro");
|
set_header(6,"@0gCateg.@9gNato il@44gTelefono altro");
|
||||||
set_header(7,"@0g--------@9g----------------------------------@44g--------------@60g----------");
|
set_header(7,"@0g--------@9g----------------------------------@44g--------------@60g----------");
|
||||||
_cognome_nome.set_width(35);
|
_cognome_nome.set_width(35);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -388,6 +416,7 @@ void TFrequenza::crea_intestazione()
|
|||||||
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------@132g----------");
|
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------@132g----------");
|
||||||
_cognome_nome.set_width(25);
|
_cognome_nome.set_width(25);
|
||||||
}
|
}
|
||||||
|
printer().footerlen(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user