Corrette stampe dei quadri A?

git-svn-id: svn://10.65.10.50/trunk@3629 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-09-19 10:43:25 +00:00
parent d588908f71
commit feaeb40e8b
5 changed files with 2711 additions and 2719 deletions

View File

@ -24,8 +24,8 @@ END
GENERAL
BEGIN
OFFSET 0 0
FONT "Roman 17cpi"
SIZE 12
FONT "Courier New"
SIZE 11
CARATTERE "X"
INIZIO_POS 3 2
FINE_POS 131

View File

@ -356,7 +356,7 @@ END
NUMERO 25
BEGIN
KEY "NUMERO ISCRIZIONE ALBO"
PROMPT 119 9 ""
PROMPT 125 9 ""
FIELD 104@->I1
END

View File

@ -407,21 +407,21 @@ SECTION FOOTER LAST 2
NUMERO 10
BEGIN
KEY "REDDITO CORRISPOSTO"
PROMPT 43 5 ""
PROMPT 43 1 ""
PICTURE "###.###.###.###^^^"
END
NUMERO 12
BEGIN
KEY "REDDITO CORRISPOSTO"
PROMPT 77 5 ""
PROMPT 77 1 ""
PICTURE "###.###.###.###^^^"
END
STRINGA 2
BEGIN
KEY "FIRMA"
PROMPT 83 8 ""
PROMPT 83 4 ""
FIELD 106@->RAGSOC
END

View File

@ -81,13 +81,13 @@ bool TDicForm::InitPrint(const long codditta)
}
const bool was_open = pr.isopen();
if (!was_open && !pr.open())
return FALSE;
set_last_page(FALSE);
set_background(1, TRUE);
set_curr_page(PRIMA);
if (!was_open && !pr.open())
return FALSE;
do_events();
_Items = filtra(codditta);
@ -103,7 +103,7 @@ bool TDicForm::InitPrint(const long codditta)
if (pr.printtype() != screenvis)
{
TString msg(60);
msg.format("Elaborazione in corso ditta %ld", codditta);
msg.format("Elaborazione della ditta %ld", codditta);
_prog = new TProgind(_Items, msg, FALSE,TRUE);
}
return TRUE;
@ -508,7 +508,7 @@ bool TDicForm::PaginaPosizionamento() const
int TDicForm::dic_form_len() const
{
if (curr_page() == PRIMA)
if (curr_page() == PRIMA && _PaginaPosizionamento && !_GiaPosizionato)
return QD_FORMLEN_PRIMA;
else
return QD_FORMLEN;
@ -524,16 +524,12 @@ void TDicForm::fill_page(TPrinter& pr, const int righe)
// form feed
if (righe < 0)
{
// const int stop = PaginaPosizionamento() ? QD_FORMLEN_PRIMA : QD_FORMLEN;
const int stop = dic_form_len();
for (int i = _RigaCorr; i < stop; i++)
{
if (i == 0)
if (_modulaser)
{
if (!_GiaMessoStartPage[pagina])
if (i == 0 && _modulaser && !_GiaMessoStartPage[pagina])
put_modulaser(row, STARTPAGE, pagina);
}
// Sull'ultima riga metto il codice ditta
if (i == stop - 2)
{
@ -543,25 +539,24 @@ void TDicForm::fill_page(TPrinter& pr, const int righe)
TString16 ditta; ditta << _codditta;
row.put(ditta, POS_DITTA);
pr.print(row);
}
else
pr.print(row);
row.reset();
}
_RigaCorr = 0;
return;
}
else // righe > 0
{
for (int i=0; i < righe; i++)
{
if (i == 0 && _modulaser && !_GiaMessoStartPage[pagina])
{
put_modulaser(row, STARTPAGE, pagina);
else
row.reset();
pr.print(row);
row.reset();
}
else
pr.print(row);
_RigaCorr++;
}
}
@ -605,7 +600,7 @@ void TDicForm::stampa_testata(TPrinter& pr)
}
// Righe da saltare nelle prime pag. dei moduli successivi al primo (che' son
// senza le righe del posizionamento...)
int HEADER_PRIMA_NOPOS = 3;
int HEADER_PRIMA_NOPOS = 2;
head.update();
for (word j = 0; j <= r; j++)
{
@ -626,12 +621,10 @@ void TDicForm::stampa_testata(TPrinter& pr)
if (!PaginaPosizionamento())
fill_page(pr, HEADER_PRIMA_NOPOS);
}
else
{
pr.print(head.row(j));
_RigaCorr++;
}
}
}
void TDicForm::next_page(TPrinter& pr)
@ -1558,7 +1551,8 @@ bool TStampaQuadro::print_quadro(const int OffsetDitta, const bool modulaser)
// Setta formlen prima di printer.open per avere la lunghezza giusta nel caso di
// stampa a video
printer().formlen(QD_FORMLEN);
bool ok = printer().open();
const bool ok = printer().open();
CHECK(ok, "La stampante non si apre");
ff->set_cursor(get_cursor());
ff->azzera_totali();
@ -2680,7 +2674,8 @@ bool TStampaQuadroG::print_quadro(const int OffsetDitta, const bool modulaser)
// Setta formlen prima di printer.open per avere la lunghezza giusta nel caso di
// stampa a video
printer().formlen(QG_FORMLEN);
bool ok = printer().open();
const bool ok = printer().open();
CHECK(ok, "La stampante non si apre");
_form_g->set_cursor(_cur_g);
_form_gd->set_cursor(_cur_gd);
@ -3742,7 +3737,8 @@ bool TStampaBusta::print_quadro(const int OffsetDitta, const bool modulaser)
// Setta formlen prima di printer.open per avere la lunghezza giusta nel caso di stampa a video
printer().formlen(ff->height());
bool ok = printer().open();
const bool ok = printer().open();
CHECK(ok, "La stampante non si apre");
ff->set_modulaser(modulaser);
@ -3816,10 +3812,11 @@ int stampa_quadro(int argc, char* argv[])
default: app = new TStampaQuadroA(quadro, livello); break;
}
}
else if (quadro[0] == 'B' && quadro[1] != 'a')
else if (quadro[0] == 'B')
{
switch (quadro[1])
switch (toupper(quadro[1]))
{
case 'A': app = new TStampaBase(livello); break;
case 'U': app = new TStampaBusta(quadro, livello); break;
default : app = new TStampaQuadroB(quadro, livello); break;
}
@ -3836,10 +3833,6 @@ int stampa_quadro(int argc, char* argv[])
{
app = new TStampaQuadroG1(livello);
}
else if (quadro == "Base")
{
app = new TStampaBase(livello);
}
else if (quadro == "H")
{
app = new TStampaQuadroH(quadro, livello);

View File

@ -129,12 +129,12 @@ void TQuadroA::preprocess_corpo(const TRectype& rec)
TPrint_section& body = section('B', odd_page);
for (int i = 2; i <= 12; i++)
{
TForm_item& f = body.field(i);
TForm_item& f = body.find_field(i);
f.enable(rett_con != 'B');
}
// Stampa solo le date di fine rapporto del 95
TForm_item& datafr = body.field(16);
TForm_item& datafr = body.find_field(16);
const TDate dfr = rec.get("DATAFR");
datafr.enable(dfr.year() == 1995);
}
@ -260,8 +260,6 @@ bool TQuadroA::print(const long codditta, const long NumFis, const long NumNoFis
stampero_ultimo &= cur.pos() == cur.items()-1;
}
// Usato per stampare la VK_ENDDOC in fill_page()
_EndPrintDitta=stampato_ultimo;
if (!stampato_ultimo)
preprocess_corpo(cur.curr());
@ -323,11 +321,14 @@ bool TQuadroA::print(const long codditta, const long NumFis, const long NumNoFis
jump_to_line(pr, riga_totali(QUARTA));
if (stampato_ultimo)
{
stampa_totali(pr);
stampa_totali(pr); // Stampa totali e firma
stampati_totali = TRUE;
}
else
stampa_firma(pr);
stampa_firma(pr); // Stampa solo la firma senza i totali
// Usato per stampare la VK_ENDDOC in fill_page()
_EndPrintDitta = TRUE;
next_page(pr);
elementi = 0;
@ -449,7 +450,7 @@ void TQuadroA2::preprocess_corpo(const TRectype& rec)
TPrint_section& body = section('B', odd_page);
for (int i = 2; i <= 7; i++)
{
TForm_item& f = body.field(i);
TForm_item& f = body.find_field(i);
f.enable(add);
}
}
@ -527,14 +528,12 @@ void TQuadroH::inc_curr_page()
if (_PaginaCorrente == PRIMA)
_PaginaCorrente = SECONDA;
else
if (_PaginaCorrente == SECONDA)
_PaginaCorrente = PRIMA;
}
int TQuadroH::elementi_pagina(PaginaQuadro p) const
{
const int n[2] = { 21, 27 };
return n[p-PRIMA];
return p == PRIMA ? 21 : 27;
}
int TQuadroH::prima_riga(PaginaQuadro p) const