Modifiche al quadro G e aggiunta Quadro H

git-svn-id: svn://10.65.10.50/trunk@3318 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
ale 1996-08-02 09:24:23 +00:00
parent d79bae9f3e
commit afaf8fdc58
7 changed files with 2362 additions and 2074 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ BEGIN
FI 131 FI 131
END END
SECTION HEADER FIRST 28 SECTION HEADER FIRST 17
NUMBER 14 NUMBER 14
BEGIN BEGIN
@ -42,204 +42,300 @@ END
SECTION BODY ODD 8 SECTION BODY ODD 8
LISTA 100
BEGIN
KEY "Tipo anagrafica"
FIELD 216@->TIPOA
ITEM "F| " MESSAGE ENABLE,1@|DISABLE,2@
ITEM "G| " MESSAGE ENABLE,2@|DISABLE,1@
END
STRINGA 1 STRINGA 1
BEGIN BEGIN
KEY "COD.FIS" KEY "COD.FIS"
PROMPT 10 2 "" PROMPT 10 1 ""
FIELD 216@->COFI FIELD 216@->COFI
END END
STRING 2 STRING 2
BEGIN BEGIN
KEY "COGNOME" KEY "COGNOME"
PROMPT 42 2 "" PROMPT 43 1 ""
FIELD 216@->RAGSOC[1,30] FIELD 216@->RAGSOC[1,30]
GROUP 1
END END
STRING 3 STRING 3
BEGIN BEGIN
KEY "NOME" KEY "NOME"
PROMPT 81 2 "" PROMPT 82 1 ""
FIELD 216@->RAGSOC[31,50] FIELD 216@->RAGSOC[31,50]
GROUP 1 GROUP 1
END END
STRING 102
BEGIN
KEY "RAGSOC GIURIDICHE"
PROMPT 54 2 ""
FIELD 216@->RAGSOC
GROUP 2
END
STRING 4 STRING 4
BEGIN BEGIN
KEY "DATA NASCITA" KEY "DATA NASCITA"
PROMPT 114 2 "" PROMPT 10 3 ""
FIELD 218@->DATANASC FIELD 218@->DATANASC
END END
STRING 5 STRING 5
BEGIN BEGIN
KEY "SESSO" KEY "SESSO"
PROMPT 129 2 "" PROMPT 36 3 ""
FIELD 218@->SESSO FIELD 218@->SESSO
END END
STRING 6 STRING 6
BEGIN BEGIN
KEY "COMUNE DI NASCITA" KEY "COMUNE DI NASCITA"
PROMPT 10 4 "" PROMPT 44 3 ""
FIELD 313@->DENCOM FIELD 313@->DENCOM
GROUP 1
END
STRING 101
BEGIN
KEY "COMUNE DI RESIDENZA GIURIDICHE"
PROMPT 10 4 ""
FIELD 413@->DENCOM
GROUP 2
END END
STRING 7 STRING 7
BEGIN BEGIN
KEY "PROV DI NASCITA" KEY "PROV DI NASCITA"
PROMPT 47 4 "" PROMPT 117 3 ""
FIELD 313@->PROVCOM FIELD 313@->PROVCOM
GROUP 1
END END
STRING 8 STRING 8
BEGIN BEGIN
KEY "COMUNE DI RESIDENZA" KEY "COMUNE DI RESIDENZA"
PROMPT 53 4 "" PROMPT 10 5 ""
FIELD 413@->DENCOM FIELD 413@->DENCOM
GROUP 1
END END
STRING 9 STRING 9
BEGIN BEGIN
KEY "PROV. RESIDENZA" KEY "PROV. RESIDENZA"
PROMPT 88 4 "" PROMPT 58 5 ""
FIELD 413@->PROVCOM FIELD 413@->PROVCOM
END END
STRING 106 STRING 101
BEGIN BEGIN
KEY "PROV. RESIDENZA GIURIDICHE" KEY "VIA RES."
PROMPT 61 4 "" PROMPT 94 5 ""
FIELD 413@->PROVCOM FIELD 216@->INDRES[1,18]
GROUP 2 FLAGS "H"
MESSAGE COPY,10
END
STRING 102
BEGIN
KEY "NUM.CIV"
PROMPT 93 5 ""
FLAGS "H"
FIELD 216@->CIVRES
MESSAGE APPEND,10
END END
STRING 10 STRING 10
BEGIN BEGIN
KEY "VIA RES." KEY "VIA RES. + numcivres"
PROMPT 94 4 "" PROMPT 66 5 ""
FIELD 216@->INDRES[1,18]
FLAGS "H"
MESSAGE COPY,12|COPY,107
END END
STRING 11 STRING 11
BEGIN
KEY "NUM.CIV"
PROMPT 93 4 ""
FLAGS "H"
FIELD 216@->CIVRES
MESSAGE APPEND,12|APPEND,107
END
STRING 12
BEGIN
KEY "VIA RES. + numcivres"
PROMPT 95 4 ""
GROUP 1
END
STRING 107
BEGIN
KEY "VIA RES GIURIDICHE"
PROMPT 69 4 ""
GROUP 2
END
STRING 19
BEGIN BEGIN
KEY "NUMERO QUOTE" KEY "NUMERO QUOTE"
PROMPT 128 4 "" PROMPT 125 5 ""
FIELD 101->NUMQUOTE FIELD 101->NUMQUOTE
PICTURE "####^^^" PICTURE "####^^^"
END END
STRING 20 NUMBER 12
BEGIN BEGIN
KEY "UTILI SPETTANTI" KEY "UTILI SPETTANTI"
PROMPT 55 5 "" PROMPT 31 7 ""
FIELD 101->UTSPETT FIELD 101->UTSPETT
PICTURE "#########^^^" PICTURE "###.###.###^^^"
MESSAGE ADD,FO->12
END END
STRING 21 NUMBER 13
BEGIN
KEY "UTILI PAGATI"
PROMPT 75 5 ""
FIELD 101->UTPAG
PICTURE "#########^^^"
END
STRING 22
BEGIN
KEY "RITENUTE OPERATE SUGLI UT.PAGATI"
PROMPT 88 5 ""
FIELD 101->ROPE
PICTURE "###@@"
END
STRING 23
BEGIN BEGIN
KEY "RIT.OPERATE SUGLI UTILI SPETTANTI" KEY "RIT.OPERATE SUGLI UTILI SPETTANTI"
PROMPT 100 5 "" PROMPT 59 7 ""
FIELD 101->ROPESPET FIELD 101->ROPESPET
PICTURE "#########^^^" PICTURE "###.###.###^^^"
MESSAGE ADD,FO->13
END
NUMBER 14
BEGIN
KEY "UTILI PAGATI"
PROMPT 93 7 ""
FIELD 101->UTPAG
PICTURE "###.###.###^^^"
MESSAGE ADD,FO->14
END
NUMBER 15
BEGIN
KEY "RITENUTE OPERATE SUGLI UT.PAGATI"
PROMPT 120 7 ""
FIELD 101->ROPE
PICTURE "###.###.###^^^"
MESSAGE ADD,FO->15
END END
END END
SECTION BODY EVEN 2 SECTION BODY EVEN 6
NUMBER 1 STRINGA 1
BEGIN
KEY "COD.FIS"
PROMPT 10 1 ""
FIELD 216@->COFI
END
STRING 2
BEGIN
KEY "RAGSOC GIURIDICHE"
PROMPT 44 1 ""
FIELD 216@->RAGSOC
END
STRING 3
BEGIN
KEY "COMUNE DI RESIDENZA GIURIDICHE"
PROMPT 10 3 ""
FIELD 413@->DENCOM
END
STRING 4
BEGIN
KEY "PROV. RESIDENZA GIURIDICHE"
PROMPT 61 3 ""
FIELD 413@->PROVCOM
END
STRING 5
BEGIN
KEY "VIA RES. GIURIDICHE"
PROMPT 94 3 ""
FIELD 216@->INDRES[1,18]
FLAGS "H"
MESSAGE COPY,7
END
STRING 6
BEGIN
KEY "NUM.CIV GIURIDICHE"
PROMPT 93 3 ""
FLAGS "H"
FIELD 216@->CIVRES
MESSAGE APPEND,7
END
STRING 7
BEGIN
KEY "VIA RES. + numcivres"
PROMPT 69 3 ""
END
STRING 11
BEGIN
KEY "NUMERO QUOTE"
PROMPT 128 3 ""
FIELD 101->NUMQUOTE
PICTURE "####^^^"
END
NUMBER 12
BEGIN
KEY "UTILI SPETTANTI"
PROMPT 31 5 ""
FIELD 101->UTSPETT
PICTURE "###.###.###^^^"
MESSAGE ADD,FE->12
END
NUMBER 13
BEGIN
KEY "RIT.OPERATE SUGLI UTILI SPETTANTI"
PROMPT 59 5 ""
FIELD 101->ROPESPET
PICTURE "###.###.###^^^"
MESSAGE ADD,FE->13
END
NUMBER 14
BEGIN
KEY "UTILI PAGATI"
PROMPT 93 5 ""
FIELD 101->UTPAG
PICTURE "###.###.###^^^"
MESSAGE ADD,FE->14
END
NUMBER 15
BEGIN
KEY "RITENUTE OPERATE SUGLI UT.PAGATI"
PROMPT 120 5 ""
FIELD 101->ROPE
PICTURE "###.###.###^^^"
MESSAGE ADD,FE->15
END
END
SECTION FOOTER ODD 2
NUMBER 12
BEGIN BEGIN
KEY "TOTALE UT.SPETT." KEY "TOTALE UT.SPETT."
PROMPT 36 1 "" PROMPT 31 1 ""
PICTURE "###.###.###^^^"
END END
NUMBER 2 NUMBER 13
BEGIN BEGIN
KEY "TOTALE R.OPE.SU UT.SPETT." KEY "TOTALE R.OPE.SU UT.SPETT."
PROMPT 55 1 "" PROMPT 59 1 ""
PICTURE "###.###.###^^^"
END END
NUMBER 3 NUMBER 14
BEGIN BEGIN
KEY "TOTALE UTILI PAGATI" KEY "TOTALE UTILI PAGATI"
PROMPT 75 1 "" PROMPT 93 1 ""
PICTURE "###.###.###^^^"
END END
NUMBER 4 NUMBER 15
BEGIN
KEY "TOTALE R.OPE.SU UT.PAGATI"
PROMPT 120 1 ""
PICTURE "###.###.###^^^"
END
END
SECTION FOOTER EVEN 2
NUMBER 12
BEGIN
KEY "TOTALE UT.SPETT."
PROMPT 31 1 ""
PICTURE "###.###.###^^^"
END
NUMBER 13
BEGIN BEGIN
KEY "TOTALE R.OPE.SU UT.SPETT." KEY "TOTALE R.OPE.SU UT.SPETT."
PROMPT 101 1 "" PROMPT 59 1 ""
PICTURE "###.###.###^^^"
END
NUMBER 14
BEGIN
KEY "TOTALE UTILI PAGATI"
PROMPT 93 1 ""
PICTURE "###.###.###^^^"
END
NUMBER 15
BEGIN
KEY "TOTALE R.OPE.SU UT.PAGAI"
PROMPT 120 1 ""
PICTURE "###.###.###^^^"
END END
END END

209
m770/77qh.frm Executable file
View File

@ -0,0 +1,209 @@
USE 43
JOIN 9 TO 43 INTO CODDITTA=CODDITTA
JOIN 6 TO 9 ALIAS 116 INTO TIPOA=TIPOA CODANAGR=CODANAGR
JOIN 8 TO 6 ALIAS 118 INTO CODANAGR=CODANAGR
JOIN 13 TO 8 ALIAS 113 INTO COM=COMNASC
JOIN 13 TO 6 ALIAS 213 INTO COM=COMRF(COMRES)
JOIN %ENT TO 43 ALIAS 214 INTO CODTAB=H1ENTE
END
DESCRIPTION
BEGIN
61->* "Quadro H 770"
9->* "Ditte"
6->* "Anagrafica persone fisiche e giuridiche"
8->* "Anagrafica persone fisiche"
113@->* "Comuni"
213@->* "Comuni"
END
GENERAL
BEGIN
OFFSET 0 0
FONT "Courier 17cpi"
SIZE 11
CA "X"
IN 3 2
FI 131
END
SECTION HEADER FIRST 22
LISTA 9
BEGIN
KEY "Tipo anagrafica"
FLAGS "H"
FIELD 116@->TIPOA
ITEM "F|Fisica" MESSAGE SHOW,1@|HIDE,2@
ITEM "G|Giuridica" MESSAGE SHOW,2@|HIDE,1@
END
STRINGA 1
BEGIN
KEY "CODICE FISCALE"
PROMPT 3 12 ""
FIELD 116@->COFI
END
STRINGA 2
BEGIN
KEY "RAGIONE SOCIALE"
PROMPT 39 12 ""
FIELD 116@->RAGSOC
GROUP 2
END
STRINGA 3
BEGIN
KEY "COGNOME"
PROMPT 39 12 ""
FIELD 116@->RAGSOC[1,30]
GROUP 1
END
STRINGA 4
BEGIN
KEY "NOME"
PROMPT 17 14 ""
FIELD 116@->RAGSOC[31,50]
GROUP 1
END
STRINGA 5
BEGIN
KEY "SESSO"
PROMPT 56 14 ""
FIELD 118@->SESSO
GROUP 1
END
STRINGA 6
BEGIN
KEY "DATA DI NASCITA"
PROMPT 63 14 ""
FIELD 118@->DATANASC
GROUP 1
END
STRINGA 7
BEGIN
KEY "COMUNE DI NASCITA"
PROMPT 83 14 ""
FIELD 113@->DENCOM
GROUP 1
END
STRINGA 8
BEGIN
KEY "PROV. DI NASCITA"
PROMPT 122 14 ""
FIELD 113@->PROVCOM
GROUP 1
END
STRINGA 10
BEGIN
KEY "COMUNE DI RES.FISCALE"
PROMPT 17 16 ""
FIELD 213@->DENCOM
END
STRINGA 11
BEGIN
KEY "PROV DI RES.FISCALE"
PROMPT 56 16 ""
FIELD 213@->PROVCOM
END
STRINGA 12
BEGIN
KEY "VIA di RES."
PROMPT 67 16 ""
FIELD 116@->INDRF
FLAGS "H"
MESSAGE COPY,17
END
STRINGA 15
BEGIN
KEY "NUM. CIVICO di RES."
PROMPT 103 16 ""
FIELD 116@->CIVRF
FLAGS "H"
MESSAGE APPEND,17
END
STRINGA 17
BEGIN
KEY "VIA + NUM CIV. DI RES."
PROMPT 67 16 ""
END
STRINGA 16
BEGIN
KEY "CAP"
PROMPT 124 16 ""
FIELD 116@->CAPRF
END
STRINGA 13
BEGIN
KEY "CODICE FISCALE DICHIARANTE"
PROMPT 105 19 ""
END
NUMBER 14
BEGIN
KEY "NUM. FOGLIO"
PROMPT 125 21 ""
FLAGS "H"
END
END
SECTION BODY ODD 2
STRINGA 1
BEGIN
KEY "ENTE PREVIDENZIALE"
PROMPT 8 1 ""
FIELD 214@->S0
END
NUMBER 2
BEGIN
KEY "CONTR.OBB. CARICO DATORE LAVORO"
PROMPT 88 1 ""
PICTURE "###.###.###^^^"
MESSAGE ADD,FL->2
FIELD 43->H1DAT
END
NUMBER 3
BEGIN
KEY "CONTR.OBB. CARICO DIPENDENTE"
PROMPT 119 1 ""
PICTURE "###.###.###^^^"
MESSAGE ADD,FL->3
FIELD 43->H1LAV
END
END
SECTION FOOTER LAST 2
NUMBER 2
BEGIN
KEY "TOTALE CONTR.OBB. DATORE LAVORO"
PROMPT 88 1 ""
PICTURE "###.###.###^^^"
END
NUMBER 3
BEGIN
KEY "TOTALE CONTR.OBB DIPENDENTE."
PROMPT 119 1 ""
PICTURE "###.###.###^^^"
END
END

View File

@ -674,100 +674,6 @@ void TDicForm::stampa_totali(TPrinter& pr)
pr.print(totali.row(i)); pr.print(totali.row(i));
_RigaCorr++; _RigaCorr++;
} }
/*
PaginaQuadro PagCorr = curr_page();
TPrint_section& foot = section('B', even_page);
const char* pic = "############";
bool stampa = FALSE;
TForm_item& ttotale = foot.find_field(TOT_TOTALE);
TForm_item& tsnsrit = foot.find_field(TOT_SNSRIT);
TForm_item& timpon = foot.find_field(TOT_IMPON);
TForm_item& timpor = foot.find_field(TOT_IMPOR);
TForm_item& tnetto = foot.find_field(TOT_NETTO);
const bool stampa_tot_fis = ultima_fis();
const bool stampa_tot_nofis = ultima_nofis();
if (stampa_tot_fis)
if (PagCorr == TERZA) // Scrive totali p.fisiche
{
stampa=TRUE;
TString ftot(_f_tot_totale.string(pic));
TString fsnsrit(_f_tot_snsrit.string(pic));
TString fimpon(_f_tot_impon.string(pic));
TString fimpor(_f_tot_impor.string(pic));
TString fnetto(_f_tot_netto.string(pic));
// Toglie le migliaia
ftot.cut(ftot.len() - 3);
fsnsrit.cut(fsnsrit.len()-3);
fimpon.cut(fimpon.len()-3);
fimpor.cut(fimpor.len()-3);
fnetto.cut(fnetto.len()-3);
if (ftot.empty()) ftot = "0";
if (fsnsrit.empty()) fsnsrit = "0";
if (fimpon.empty()) fimpon = "0";
if (fimpor.empty()) fimpor = "0";
if (fnetto.empty()) fnetto = "0";
// Setta i campi
ttotale.set(ftot);
tsnsrit.set(fsnsrit);
timpon.set(fimpon);
timpor.set(fimpor);
tnetto.set(fnetto);
_GiaStampatiFis = TRUE;
const int NUMPER_TERZA = 6;
const int NUM_RIGHE = 8;
const int gap = ((NUMPER_TERZA - _CtrFisStampati) * NUM_RIGHE)+1;
if (gap>0)
fill_page(pr,gap);
}
if (stampa_tot_nofis)
if (PagCorr == QUARTA) // Scrive totali p.non fisiche
{
stampa=TRUE;
TString ftot(_nf_tot_totale.string(pic));
TString fsnsrit(_nf_tot_snsrit.string(pic));
TString fimpon(_nf_tot_impon.string(pic));
TString fimpor(_nf_tot_impor.string(pic));
TString fnetto(_nf_tot_netto.string(pic));
// Toglie le migliaia
ftot.cut(ftot.len() - 3);
fsnsrit.cut(fsnsrit.len()-3);
fimpon.cut(fimpon.len()-3);
fimpor.cut(fimpor.len()-3);
fnetto.cut(fnetto.len()-3);
if (ftot.empty()) ftot = "0";
if (fsnsrit.empty()) fsnsrit = "0";
if (fimpon.empty()) fimpon = "0";
if (fimpor.empty()) fimpor = "0";
if (fnetto.empty()) fnetto = "0";
// Setta i campi
ttotale.set(ftot);
tsnsrit.set(fsnsrit);
timpon.set(fimpon);
timpor.set(fimpor);
tnetto.set(fnetto);
_GiaStampatiNoFis = TRUE;
const int NUMPER_QUARTA = 6;
const int NUM_RIGHE = 8;
const int gap = ((NUMPER_QUARTA - _CtrNoFisStampati) * NUM_RIGHE)+1;
if (gap > 0)
fill_page(pr,gap);
}
if (stampa)
{
foot.update();
for (word j = 0; j < foot.height(); j++)
{
pr.print(foot.row(j));
_RigaCorr++;
}
foot.reset(); // non stampare piu' questi totali!
}
*/
} }
void TDicForm::stampa_testata(TPrinter& pr) void TDicForm::stampa_testata(TPrinter& pr)
@ -834,57 +740,7 @@ void TDicForm::azzera_totali()
for (int f = foot.fields()-1; f >= 0; f--) for (int f = foot.fields()-1; f >= 0; f--)
foot.field(f).set(""); foot.field(f).set("");
} }
/*
void TDicForm::aggiorna_totali_E(const char tipo)
{
}
void TDicForm::aggiorna_totali_E1(const char tipo)
{
}
void TDicForm::aggiorna_totali_D(const char tipo)
{
real totale, netto, impon, nsrit, impor;
TCursor* cur = cursor();
TRectype& crr = cur->curr();
totale = crr.get_real(QUD_TOTALE);
netto = crr.get_real(QUD_NETTO);
impon = crr.get_real(QUD_IMPONIBILE);
impor = crr.get_real(QUD_IMPORTO);
nsrit = crr.get_real(QUD_SOMME);
if (tipo == 'F')
{
_f_tot_totale += totale;
_f_tot_netto += netto;
_f_tot_impon += impon;
_f_tot_snsrit += nsrit;
_f_tot_impor += impor;
}
else
{
_nf_tot_totale += totale;
_nf_tot_netto += netto;
_nf_tot_impon += impon;
_nf_tot_snsrit += nsrit;
_nf_tot_impor += impor;
}
}
void TDicForm::aggiorna_totali(const char tipo)
{
if (_quadro == "D")
aggiorna_totali_D(tipo);
if (_quadro == "E")
aggiorna_totali_E(tipo);
if (_quadro == "E1")
aggiorna_totali_E1(tipo);
}
*/
void TDicForm::set_body(TPrinter& pr, const char tipo) void TDicForm::set_body(TPrinter& pr, const char tipo)
{ {
TPrint_section& body = section('B', odd_page); TPrint_section& body = section('B', odd_page);
@ -1096,64 +952,102 @@ void TQuadroG::stampa_prospetti3_4(TPrinter& pr)
TToken_string p36b(r.get("P36B")); TToken_string p36b(r.get("P36B"));
// colonna 2 e 7 // colonna 2 e 7
for (int i=1; i<=5; i++) int k = 1;
real tot2,tot7,tot_tot2,tot_tot7;
tot2 = ZERO;
tot7 = ZERO;
tot_tot2 = ZERO;
tot_tot7 = ZERO;
for (int i=0; i<19; i++)
{ {
TForm_item& c2 = sez.find_field(i); if (i == 6 || i == 10 || i == 13 || i ==16) continue;
TForm_item& c7 = sez.find_field(i+65);
int src=0; // determina quale posizione va letta dalla token-string per il campo corrente real token2 (p33a.get(i));
switch (i) real token7 (p36b.get(i));
tot2 += token2;
tot7 += token7;
tot_tot2 += token2;
tot_tot7 += token7;
if (i == 5 || i == 9 || i == 12 || i == 15 || i == 18)
{ {
case 1: TForm_item& c2 = sez.find_field(k);
src = 0; TForm_item& c7 = sez.find_field(k+54);
break;
case 2: c2.set(tot2.string());
src = 7; c7.set(tot7.string());
break; k++;
case 3: tot2 = ZERO;
src = 10; tot7 = ZERO;
break; if (i == 18)
case 4: {
src = 12; TForm_item& t2 = sez.find_field(k);
break; TForm_item& t7 = sez.find_field(k+54);
case 5:
src = 14; t2.set(tot_tot2.string());
break; t7.set(tot_tot7.string());
}
}
} }
c2.set(p33a.get(src)); const int RIGHE_P3 = 21;
c7.set(p36b.get(src));
}
const int RIGHE_P3 = 20;
// Colonna 3 // Colonna 3
const int START_P3_COL3 = 6; const int START_P3_COL3 = 7;
int c3=0; int c3=0;
for (i = 0; i < RIGHE_P3; i++) real totale = ZERO;
for (i = 0, k = 0; i < RIGHE_P3; i++)
{ {
c3 = START_P3_COL3 + i; if (i == 6 || i == 10 || i == 13 || i ==16 || i == 19) continue;
c3 = START_P3_COL3 + k;
TForm_item& c5a = sez.find_field(c3); TForm_item& c5a = sez.find_field(c3);
c5a.set(p33b.get(i)); real importo (p33b.get(i));
if (i != 20)
c5a.set(importo.string());
else
c5a.set(totale.string());
totale += importo;
k++;
} }
// Colonna 5 // Colonna 5
const int START_P3_COL5 = c3 + 1; const int START_P3_COL5 = c3 + 1;
int c5=0; int c5=0;
for (i = 0; i < RIGHE_P3; i++) totale = ZERO;
for (i = 0, k = 0; i < RIGHE_P3; i++)
{ {
c5 = START_P3_COL5 + i; if (i == 6 || i == 10 || i == 13 || i ==16 || i == 19) continue;
TForm_item& c6a = sez.find_field(c5);
c6a.set(p35b.get(i)); c5 = START_P3_COL5 + k;
TForm_item& c5a = sez.find_field(c5);
real importo (p35b.get(i));
if (i != 20)
c5a.set(importo.string());
else
c5a.set(totale.string());
totale += importo;
k++;
} }
// Colonna 6 // Colonna 6
const int START_P3_COL6 = c5 + 1; const int START_P3_COL6 = c5 + 1;
int c6=0; int c6=0;
for (i = 0; i < RIGHE_P3; i++) totale = ZERO;
for (i = 0, k = 0; i < RIGHE_P3; i++)
{ {
c6 = START_P3_COL6 + i; if (i == 6 || i == 10 || i == 13 || i ==16 || i == 19) continue;
c6 = START_P3_COL6 + k;
TForm_item& c6a = sez.find_field(c6); TForm_item& c6a = sez.find_field(c6);
c6a.set(p36a.get(i)); real importo (p36a.get(i));
if (i != 20)
c6a.set(importo.string());
else
c6a.set(totale.string());
totale += importo;
k++;
} }
sez.update(); sez.update();
@ -1215,7 +1109,6 @@ bool TQuadroG::print(const long codditta, const long NumFis, const long NumNoFis
return TRUE; return TRUE;
} }
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// //
// Distinta G // Distinta G
@ -1224,20 +1117,20 @@ bool TQuadroG::print(const long codditta, const long NumFis, const long NumNoFis
HIDDEN const int QGD_FORMLEN = 72; HIDDEN const int QGD_FORMLEN = 72;
HIDDEN const int QGD_PAGINE = 2; HIDDEN const int QGD_PAGINE = 2;
HIDDEN const int HEADER_SECONDA_GD = 7; HIDDEN const int HEADER_PRIMA_GD = 17;
HIDDEN const int QGD_RIGHE_PRIMA = 8; HIDDEN const int HEADER_SECONDA_GD = 15;
HIDDEN const int QGD_RIGHE_PRIMA = 5;
HIDDEN const int QGD_RIGHE_SECONDA = 6;
class TDistintaG : public TQuadroG class TDistintaG : public TQuadroG
{ {
private: private:
real _f_tot_utspet, _f_tot_utpag, _f_tot_rope, _f_tot_ropespet; virtual void stampa_totali(TPrinter& pr);
real _nf_tot_utspet, _nf_tot_utpag, _nf_tot_rope, _nf_tot_ropespet;
void aggiorna_totali(const char tipo);
void stampa_totali(TPrinter& pr);
void stampa_testata(TPrinter& pr);
virtual void next_page(TPrinter& pr); virtual void next_page(TPrinter& pr);
virtual void set_body(TPrinter& pr, const char tipo); virtual void set_body(TPrinter& pr, const char tipo);
void stampa_testata(TPrinter& pr);
public: public:
virtual bool print(const long codditta, const long NumFis, const long NumNoFis); virtual bool print(const long codditta, const long NumFis, const long NumNoFis);
@ -1245,136 +1138,47 @@ class TDistintaG : public TQuadroG
virtual ~TDistintaG() {} virtual ~TDistintaG() {}
}; };
void TDistintaG::next_page(TPrinter& pr)
{
PaginaQuadro PagCorr = curr_page();
// if (PagCorr == SECONDA)
stampa_totali(pr);
fill_page(pr, -1); // formfeed "adattato"
inc_curr_page();
}
void TDistintaG::aggiorna_totali(const char tipo)
{
real utspet, utpag, rope, ropespet;
TCursor* cur = cursor();
TRectype& crr = cur->curr();
utspet = crr.get_real(QGD_UTSPETT);
utpag = crr.get_real(QGD_UTPAG);
rope = crr.get_real(QGD_ROPE);
ropespet = crr.get_real(QGD_ROPESPET);
if (tipo == 'F')
{
_f_tot_utspet += utspet;
_f_tot_utpag += utpag;
_f_tot_rope += rope;
_f_tot_ropespet += ropespet;
}
else
{
_nf_tot_utspet += utspet;
_nf_tot_utpag += utpag;
_nf_tot_rope += rope;
_nf_tot_ropespet += ropespet;
}
}
void TDistintaG::stampa_totali(TPrinter& pr) void TDistintaG::stampa_totali(TPrinter& pr)
{ {
PaginaQuadro PagCorr = curr_page(); PaginaQuadro PagCorr = curr_page();
TPrint_section& foot = section('B', even_page); if (PagCorr == PRIMA)
const word righe = foot.height();
const char* pic = "############";
bool stampa = FALSE;
TForm_item& ttotale = foot.find_field(TOT_TOTALE);
TForm_item& tsnsrit = foot.find_field(TOT_SNSRIT);
TForm_item& timpon = foot.find_field(TOT_IMPON);
TForm_item& timpor = foot.find_field(TOT_IMPOR);
const bool stampa_tot_fis = ultima_fis();
const bool stampa_tot_nofis = ultima_nofis();
if (stampa_tot_fis)
if (PagCorr == PRIMA) // Scrive totali p.fisiche
{ {
stampa=TRUE; TPrint_section& totali = section('F', odd_page);
TString ftot(_f_tot_utspet.string(pic)); totali.update();
TString fsnsrit(_f_tot_utpag.string(pic)); for (int i = 0; i < totali.items(); i++)
TString fimpon(_f_tot_rope.string(pic));
TString fimpor(_f_tot_ropespet.string(pic));
// Toglie le migliaia
ftot.cut(ftot.len() - 3);
fsnsrit.cut(fsnsrit.len()-3);
fimpon.cut(fimpon.len()-3);
fimpor.cut(fimpor.len()-3);
if (ftot.empty()) ftot = "0";
if (fsnsrit.empty()) fsnsrit = "0";
if (fimpon.empty()) fimpon = "0";
if (fimpor.empty()) fimpor = "0";
// Setta i campi
ttotale.set(ftot);
tsnsrit.set(fsnsrit);
timpon.set(fimpon);
timpor.set(fimpor);
_GiaStampatiFis = TRUE;
const int NUMPER_TERZA = 6;
const int NUM_RIGHE = 8;
const int gap = ((NUMPER_TERZA - _CtrFisStampati) * NUM_RIGHE)+1;
if (gap>0)
fill_page(pr,gap);
}
if (stampa_tot_nofis)
if (PagCorr == SECONDA) // Scrive totali p.non fisiche
{ {
stampa=TRUE; pr.print(totali.row(i));
TString ftot (_nf_tot_utspet.string(pic));
TString fsnsrit(_nf_tot_utpag.string(pic));
TString fimpon (_nf_tot_rope.string(pic));
TString fimpor (_nf_tot_ropespet.string(pic));
// Toglie le migliaia
ftot.cut(ftot.len() - 3);
fsnsrit.cut(fsnsrit.len()-3);
fimpon.cut(fimpon.len()-3);
fimpor.cut(fimpor.len()-3);
if (ftot.empty()) ftot = "0";
if (fsnsrit.empty()) fsnsrit = "0";
if (fimpon.empty()) fimpon = "0";
if (fimpor.empty()) fimpor = "0";
// Setta i campi
ttotale.set(ftot);
tsnsrit.set(fsnsrit);
timpon.set(fimpon);
timpor.set(fimpor);
_GiaStampatiNoFis = TRUE;
const int NUMPER_QUARTA = 6;
const int NUM_RIGHE = 8;
const int gap = ((NUMPER_QUARTA - _CtrNoFisStampati) * NUM_RIGHE)+1;
if (gap > 0)
fill_page(pr,gap);
}
if (stampa)
{
foot.update();
for (word j = 0; j < righe; j++)
{
pr.print(foot.row(j));
_RigaCorr++; _RigaCorr++;
} }
foot.reset(); // non stampare piu' questi totali!
} }
else
if (PagCorr == SECONDA)
{
TPrint_section& totali = section('F', even_page);
totali.update();
for (int i = 0; i < totali.items(); i++)
{
pr.print(totali.row(i));
_RigaCorr++;
}
}
}
void TDistintaG::next_page(TPrinter& pr)
{
PaginaQuadro PagCorr = curr_page();
if (PagCorr == PRIMA)
jump_to_line(pr,57);
else
if (PagCorr == SECONDA)
jump_to_line(pr,51);
stampa_totali(pr);
TPrint_section& body = section('F', last_page);
body.reset();
fill_page(pr, -1); // formfeed "adattato"
inc_curr_page();
} }
void TDistintaG::stampa_testata(TPrinter& pr) void TDistintaG::stampa_testata(TPrinter& pr)
@ -1388,20 +1192,36 @@ void TDistintaG::stampa_testata(TPrinter& pr)
TString fstr(10); fstr << _num_foglio; TString fstr(10); fstr << _num_foglio;
nf.set(fstr); nf.set(fstr);
_num_foglio++; _num_foglio++;
fill_page(pr, HEADER_PRIMA_GD);
} }
void TDistintaG::set_body(TPrinter& pr, const char tipo) void TDistintaG::set_body(TPrinter& pr, const char tipo)
{
if (tipo == 'F')
{ {
TPrint_section& body = section('B', odd_page); TPrint_section& body = section('B', odd_page);
body.reset(); body.reset();
body.update(); body.update();
aggiorna_totali(tipo);
const int body_righe = body.height(); const int body_righe = body.height();
for (int i=0; i < body_righe; i++) for (int i=0; i < body_righe; i++)
{ {
pr.print(body.row(i)); pr.print(body.row(i));
_RigaCorr++; _RigaCorr++;
} }
}
else
if (tipo == 'G')
{
TPrint_section& body = section('B', even_page);
body.reset();
body.update();
const int body_righe = body.height();
for (int i=0; i < body_righe; i++)
{
pr.print(body.row(i));
_RigaCorr++;
}
}
if (usa_progind()) if (usa_progind())
progind()->addstatus(1); progind()->addstatus(1);
} }
@ -1506,7 +1326,7 @@ bool TDistintaG::print(const long codditta, const long NumFis, const long NumNoF
{ {
// Reset del flag di pagina con posiz. // Reset del flag di pagina con posiz.
if (_posiziona && _PaginaPosizionamento) _PaginaPosizionamento = FALSE; if (_posiziona && _PaginaPosizionamento) _PaginaPosizionamento = FALSE;
for (int righe=0; righe < QD_RIGHE_SECONDA; righe++) for (int righe=0; righe < QGD_RIGHE_SECONDA; righe++)
{ {
if (!righe) if (!righe)
_CtrNoFisStampati = 0; _CtrNoFisStampati = 0;
@ -4005,40 +3825,6 @@ bool TStampaQuadroF::user_destroy()
return TRUE; return TRUE;
} }
///////////////////////////////////////////////////////////////////////////////////////////
//
// Quadro H
//
///////////////////////////////////////////////////////////////////////////////////////////
HIDDEN const int QH_FORMLEN = 72;
HIDDEN const int QH_PAGINE = 2;
HIDDEN const int HEADER_SECONDA_H = 7;
class TQuadroH : public TDicForm
{
private:
real _rC2t, _rC3t; // totali colonna 2 e 3
long _items;
void azzera_contatori();
// void aggiorna_totali(char tipoprosp, TRectype& r);
// void stampa_totali(char tipoprosp, TPrinter& pr);
public:
virtual bool print(const long codditta, const long numfis=0L, const long numnofis=0L);
virtual void inc_curr_page();
virtual void next_page(TPrinter& pr);
TQuadroH(const char* form, const char* quadro) : TDicForm(form, quadro) {}
virtual ~TQuadroH() {}
};
void TQuadroH::azzera_contatori()
{
_rC2t = _rC3t = ZERO;
}
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Quadro 770/A // Quadro 770/A
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -4952,6 +4738,153 @@ bool TStampaQuadroC::user_create()
return TRUE; return TRUE;
} }
///////////////////////////////////////////////////////////////////////////////////////////
//
// Quadro H
//
///////////////////////////////////////////////////////////////////////////////////////////
class TQuadroH : public TQuadroA
{
enum { QH_FORMLEN = 72 };
protected:
virtual int elementi_pagina(PaginaQuadro p) const;
virtual int prima_riga(PaginaQuadro p) const;
virtual bool print(const long codditta, const long NumFis, const long NumNoFis);
virtual void inc_curr_page();
public:
TQuadroH(const char* form, const char* quadro) : TQuadroA(form, quadro) { }
virtual ~TQuadroH() { }
};
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];
}
int TQuadroH::prima_riga(PaginaQuadro p) const
{
return p == PRIMA ? 24 : 9;
}
bool TQuadroH::print(const long codditta, const long NumFis, const long NumNoFis)
{
TCursor& cur = *cursor();
TPrinter& pr = printer();
if (!InitPrint(codditta))
return FALSE;
pr.formlen(QH_FORMLEN);
int elementi = 0; // Numero di elementi stampati in questa pagina
bool stampato_ultimo = FALSE;
bool stampati_totali = FALSE;
cur = 0;
while (!stampati_totali)
{
bool stampero_ultimo = stampato_ultimo == FALSE;
if (stampero_ultimo)
stampero_ultimo &= cur.pos() == cur.items()-1;
switch(_PaginaCorrente)
{
case PRIMA:
if (_modulaser)
ClearFlagModulaser();
if (elementi == 0)
{
stampa_testata(pr);
jump_to_line(pr, prima_riga(PRIMA));
}
if (!stampato_ultimo)
{
stampa_corpo(pr);
stampato_ultimo = stampero_ultimo;
}
elementi++;
if (elementi >= elementi_pagina(PRIMA))
{
next_page(pr);
elementi = 0;
}
break;
case SECONDA:
if (!stampato_ultimo)
{
if (elementi == 0)
jump_to_line(pr, prima_riga(SECONDA));
stampa_corpo(pr);
stampato_ultimo = stampero_ultimo;
}
elementi++;
if (elementi >= elementi_pagina(SECONDA))
{
if (stampato_ultimo)
{
jump_to_line(pr, riga_totali(SECONDA));
stampa_totali(pr);
stampati_totali = TRUE;
}
next_page(pr);
elementi = 0;
}
break;
default:
CHECK(0, "Invalid Quadro A page");
break;
}
if (!stampato_ultimo)
++cur;
}
close_print();
return TRUE;
}
class TStampaQuadroH : public TStampaQuadroA
{
protected:
virtual bool user_create();
public:
TStampaQuadroH(const char* quadro, char livel) : TStampaQuadroA(quadro, livel) { }
virtual ~TStampaQuadroH() { }
};
bool TStampaQuadroH::user_create()
{
_form = new TQuadroH("77QH", quadro());
TString sortkey(80);
sortkey.format("CODDITTA|H1ANNO|H1ENTE", LF_QUAH, LF_QUAH);
_cur = new TSorted_cursor(_form->TForm::relation(), sortkey);
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
// //
// MAIN // MAIN
@ -5008,12 +4941,11 @@ int stampa_quadro(int argc, char* argv[])
{ {
app = new TStampaQuadroG1(livello); app = new TStampaQuadroG1(livello);
} }
/*
else if (quadro == "H") else if (quadro == "H")
{ {
app = new TStampaQuadroH app(quadro, livello); app = new TStampaQuadroH(quadro, livello);
} }
*/
if (app != NULL) if (app != NULL)
{ {
app->run(argc, argv, app->taitol()); app->run(argc, argv, app->taitol());
@ -5022,3 +4954,4 @@ int stampa_quadro(int argc, char* argv[])
} }
return 0; return 0;
}