Modifiche alla stampa registri
git-svn-id: svn://10.65.10.50/trunk@197 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f114c65d04
commit
fbcc614384
463
cg/cg4400.cpp
463
cg/cg4400.cpp
@ -4,7 +4,7 @@
|
|||||||
#include "cg4400.h"
|
#include "cg4400.h"
|
||||||
#include "cg4400a.h"
|
#include "cg4400a.h"
|
||||||
|
|
||||||
static TString256 TMP;
|
TFixed_string TMP (__tmp, MAXSTR);
|
||||||
|
|
||||||
HIDDEN CG4400_application * app() { return (CG4400_application*) MainApp(); }
|
HIDDEN CG4400_application * app() { return (CG4400_application*) MainApp(); }
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ const char * CG4400_application::descr_doc(const char * tipo)
|
|||||||
else
|
else
|
||||||
TMP = "";
|
TMP = "";
|
||||||
|
|
||||||
return TMP;
|
return __tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * CG4400_application::descr_iva(const char * cod)
|
const char * CG4400_application::descr_iva(const char * cod)
|
||||||
@ -344,7 +344,7 @@ const char * CG4400_application::descr_iva(const char * cod)
|
|||||||
else
|
else
|
||||||
TMP = "";
|
TMP = "";
|
||||||
|
|
||||||
return TMP;
|
return __tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * CG4400_application::desc_attivita(const char * codatt)
|
const char * CG4400_application::desc_attivita(const char * codatt)
|
||||||
@ -357,7 +357,7 @@ const char * CG4400_application::desc_attivita(const char * codatt)
|
|||||||
TMP = attiv.get("S0");
|
TMP = attiv.get("S0");
|
||||||
else
|
else
|
||||||
TMP = "";
|
TMP = "";
|
||||||
return TMP;
|
return __tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * CG4400_application::ricerca_cf(char tipocf, long codcf)
|
const char * CG4400_application::ricerca_cf(char tipocf, long codcf)
|
||||||
@ -369,7 +369,7 @@ const char * CG4400_application::ricerca_cf(char tipocf, long codcf)
|
|||||||
TMP = _clifo->get(CLI_RAGSOC);
|
TMP = _clifo->get(CLI_RAGSOC);
|
||||||
else
|
else
|
||||||
TMP = "";
|
TMP = "";
|
||||||
return TMP;
|
return __tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * CG4400_application::ricerca_occ(const char * occ)
|
const char * CG4400_application::ricerca_occ(const char * occ)
|
||||||
@ -383,7 +383,7 @@ const char * CG4400_application::ricerca_occ(const char * occ)
|
|||||||
TMP = occas.get(OCC_RAGSOC);
|
TMP = occas.get(OCC_RAGSOC);
|
||||||
else
|
else
|
||||||
TMP = "";
|
TMP = "";
|
||||||
return TMP;
|
return __tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG4400_application::user_create()
|
void CG4400_application::user_create()
|
||||||
@ -706,6 +706,7 @@ void CG4400_application::cerca_reg(const TString& c, byte& t, TDate& d)
|
|||||||
|
|
||||||
void CG4400_application::set_page_tot_reg()
|
void CG4400_application::set_page_tot_reg()
|
||||||
{
|
{
|
||||||
|
reset_print();
|
||||||
TString riga(_stampa_width);
|
TString riga(_stampa_width);
|
||||||
int r=1, rr=0, row=0;
|
int r=1, rr=0, row=0;
|
||||||
real tot_imponib, tot_imposta, tot_imponibp, tot_impostap;
|
real tot_imponib, tot_imposta, tot_imponibp, tot_impostap;
|
||||||
@ -728,144 +729,148 @@ void CG4400_application::set_page_tot_reg()
|
|||||||
}
|
}
|
||||||
_doc_array.destroy();
|
_doc_array.destroy();
|
||||||
|
|
||||||
rr++;
|
if (rr > 0)
|
||||||
set_row(++rr, "@26g---------- P E R I O D O ----------");
|
rr++;
|
||||||
if (_tipo_stampa != 3)
|
else
|
||||||
set_row(rr,"@82g------ P R O G R E S S I V I ------");
|
rr = r;
|
||||||
rr++;
|
|
||||||
set_row(rr, "Cod.");
|
|
||||||
if (_tipo_reg == 2)
|
|
||||||
{
|
|
||||||
set_row(rr, "@36gA C Q U I S T I");
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rr, "@92gA C Q U I S T I");
|
|
||||||
}
|
|
||||||
if (_tipo_reg == 1)
|
|
||||||
{
|
|
||||||
set_row(rr, "@37gV E N D I T E");
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rr, "@93gV E N D I T E");
|
|
||||||
}
|
|
||||||
rr++;
|
|
||||||
set_row(rr, "iva Descrizione@30gImponibile@49gImposta");
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rr++, "@86gImponibile@106gImposta");
|
|
||||||
else rr++;
|
|
||||||
rr++;
|
|
||||||
|
|
||||||
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
|
||||||
|
|
||||||
_tot_iva_array.sort(compare_rows);
|
|
||||||
|
|
||||||
for (int k = 0; k < _tot_iva_array.items(); k++)
|
|
||||||
{
|
|
||||||
TRiga& riga = (TRiga&)_tot_iva_array[k];
|
|
||||||
row = rr+k;
|
|
||||||
set_row(row, "%3s", (const char*)riga._codiva);
|
|
||||||
TString descr = descr_iva(riga._codiva);
|
|
||||||
set_row(row, "@5g%s", (const char*)descr);
|
|
||||||
set_row(row, "@25g%r", &riga._imponibile);
|
|
||||||
set_row(row, "@41g%r", &riga._imposta);
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
{
|
|
||||||
set_row(row, "@81g%r", &riga._imponibilep);
|
|
||||||
set_row(row, "@98g%r", &riga._impostap);
|
|
||||||
}
|
|
||||||
tot_imponib += riga._imponibile;
|
|
||||||
tot_imposta += riga._imposta;
|
|
||||||
tot_imponibp += riga._imponibilep;
|
|
||||||
tot_impostap += riga._impostap;
|
|
||||||
}
|
|
||||||
_tot_iva_array.destroy();
|
|
||||||
|
|
||||||
row++;
|
if (_nrec > 0) //numero records di rmoviva
|
||||||
set_row(++row, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(row, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
|
||||||
//la stampa "tipi di indetraibilita'" viene fatta solo per gli acquisti
|
|
||||||
if (_tipo_reg == 2)
|
|
||||||
{
|
{
|
||||||
row+=2;
|
set_row(++rr, "@26g---------- P E R I O D O ----------");
|
||||||
int tdetprec = -1;
|
if (_tipo_stampa != 3)
|
||||||
int rw = row;
|
set_row(rr,"@82g------ P R O G R E S S I V I ------");
|
||||||
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
rr++;
|
||||||
|
set_row(rr, "Cod.");
|
||||||
_iva_array.sort(compare);
|
if (_tipo_reg == 2)
|
||||||
|
|
||||||
for (int s = 0; s < _iva_array.items(); s++)
|
|
||||||
{
|
{
|
||||||
TRigaiva& riga = (TRigaiva&)_iva_array[s];
|
set_row(rr, "@36gA C Q U I S T I");
|
||||||
switch (riga._tipodet)
|
|
||||||
{
|
|
||||||
case 1: if (riga._tipodet != tdetprec)
|
|
||||||
{
|
|
||||||
set_row(rw++, "----- Indetraibile su op.es. -----");
|
|
||||||
set_row(rw, "Cod.");
|
|
||||||
rw++;
|
|
||||||
set_row(rw, "iva Descrizione@30gImponibile@49gImposta");
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rw++, "@86gImponibile@106gImposta");
|
|
||||||
else rw++;
|
|
||||||
rw++;
|
|
||||||
}
|
|
||||||
rw = setta_riga(rw, riga, tot_imponib, tot_imposta, tot_imponibp, tot_impostap);
|
|
||||||
tdetprec = riga._tipodet;
|
|
||||||
break;
|
|
||||||
case 3: if (tdetprec == 1)
|
|
||||||
{
|
|
||||||
set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
|
||||||
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
|
||||||
rw+=2;
|
|
||||||
}
|
|
||||||
if (riga._tipodet != tdetprec)
|
|
||||||
{
|
|
||||||
set_row(rw++, "----- Passaggi interni -----");
|
|
||||||
set_row(rw, "Cod.");
|
|
||||||
rw++;
|
|
||||||
set_row(rw, "iva Descrizione@30gImponibile@49gImposta");
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rw++, "@86gImponibile@106gImposta");
|
|
||||||
else rw++;
|
|
||||||
rw++;
|
|
||||||
}
|
|
||||||
rw = setta_riga(rw, riga, tot_imponib, tot_imposta, tot_imponibp, tot_impostap);
|
|
||||||
tdetprec = riga._tipodet;
|
|
||||||
break;
|
|
||||||
case 9: if ( (tdetprec == 1) || (tdetprec == 3) )
|
|
||||||
{
|
|
||||||
set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
|
||||||
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
|
||||||
rw+=2;
|
|
||||||
}
|
|
||||||
if (riga._tipodet != tdetprec)
|
|
||||||
{
|
|
||||||
set_row(rw++, "----- N.D. 9 - acquisti indeducibili per ART.19 -----");
|
|
||||||
set_row(rw, "Cod.");
|
|
||||||
rw++;
|
|
||||||
set_row(rw, "iva Descrizione@30gImponibile@49gImposta");
|
|
||||||
if (_tipo_stampa != 3)
|
|
||||||
set_row(rw++, "@86gImponibile@106gImposta");
|
|
||||||
else rw++;
|
|
||||||
rw++;
|
|
||||||
}
|
|
||||||
rw = setta_riga(rw, riga, tot_imponib, tot_imposta, tot_imponibp, tot_impostap);
|
|
||||||
tdetprec = riga._tipodet;
|
|
||||||
break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tdetprec == 9)
|
|
||||||
{
|
|
||||||
set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
|
||||||
if (_tipo_stampa != 3)
|
if (_tipo_stampa != 3)
|
||||||
set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
set_row(rr, "@92gA C Q U I S T I");
|
||||||
}
|
}
|
||||||
_iva_array.destroy();
|
if (_tipo_reg == 1)
|
||||||
}
|
{
|
||||||
|
set_row(rr, "@37gV E N D I T E");
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rr, "@93gV E N D I T E");
|
||||||
|
}
|
||||||
|
rr++;
|
||||||
|
set_row(rr, "iva Descrizione@30gImponibile@49gImposta");
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rr++, "@86gImponibile@106gImposta");
|
||||||
|
else rr++;
|
||||||
|
rr++;
|
||||||
|
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
||||||
|
|
||||||
|
_tot_iva_array.sort(compare_rows);
|
||||||
|
|
||||||
|
for (int k = 0; k < _tot_iva_array.items(); k++)
|
||||||
|
{
|
||||||
|
TRiga& riga = (TRiga&)_tot_iva_array[k];
|
||||||
|
row = rr+k;
|
||||||
|
set_row(row, "%3s", (const char*)riga._codiva);
|
||||||
|
TString descr = descr_iva(riga._codiva);
|
||||||
|
set_row(row, "@5g%s", (const char*)descr);
|
||||||
|
set_row(row, "@25g%r", &riga._imponibile);
|
||||||
|
set_row(row, "@41g%r", &riga._imposta);
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
{
|
||||||
|
set_row(row, "@81g%r", &riga._imponibilep);
|
||||||
|
set_row(row, "@98g%r", &riga._impostap);
|
||||||
|
}
|
||||||
|
tot_imponib += riga._imponibile;
|
||||||
|
tot_imposta += riga._imposta;
|
||||||
|
tot_imponibp += riga._imponibilep;
|
||||||
|
tot_impostap += riga._impostap;
|
||||||
|
}
|
||||||
|
_tot_iva_array.destroy();
|
||||||
|
row++;
|
||||||
|
set_row(++row, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(row, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
||||||
|
//la stampa "tipi di indetraibilita'" viene fatta solo per gli acquisti
|
||||||
|
if (_tipo_reg == 2)
|
||||||
|
{
|
||||||
|
row+=2;
|
||||||
|
int tdetprec = -1;
|
||||||
|
int rw = row;
|
||||||
|
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
||||||
|
|
||||||
|
_iva_array.sort(compare);
|
||||||
|
for (int s = 0; s < _iva_array.items(); s++)
|
||||||
|
{
|
||||||
|
TRigaiva& riga = (TRigaiva&)_iva_array[s];
|
||||||
|
switch (riga._tipodet)
|
||||||
|
{
|
||||||
|
case 1: if (riga._tipodet != tdetprec)
|
||||||
|
{
|
||||||
|
set_row(rw++, "----- Indetraibile su op.es. -----");
|
||||||
|
set_row(rw, "Cod.");
|
||||||
|
rw++;
|
||||||
|
set_row(rw, "iva Descrizione@30gImponibile@49gImposta");
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rw++, "@86gImponibile@106gImposta");
|
||||||
|
else rw++;
|
||||||
|
rw++;
|
||||||
|
}
|
||||||
|
rw = setta_riga(rw, riga, tot_imponib, tot_imposta, tot_imponibp, tot_impostap);
|
||||||
|
tdetprec = riga._tipodet;
|
||||||
|
break;
|
||||||
|
case 3: if (tdetprec == 1)
|
||||||
|
{
|
||||||
|
set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
||||||
|
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
||||||
|
rw+=2;
|
||||||
|
}
|
||||||
|
if (riga._tipodet != tdetprec)
|
||||||
|
{
|
||||||
|
set_row(rw++, "----- Passaggi interni -----");
|
||||||
|
set_row(rw, "Cod.");
|
||||||
|
rw++;
|
||||||
|
set_row(rw, "iva Descrizione@30gImponibile@49gImposta");
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rw++, "@86gImponibile@106gImposta");
|
||||||
|
else rw++;
|
||||||
|
rw++;
|
||||||
|
}
|
||||||
|
rw = setta_riga(rw, riga, tot_imponib, tot_imposta, tot_imponibp, tot_impostap);
|
||||||
|
tdetprec = riga._tipodet;
|
||||||
|
break;
|
||||||
|
case 9: if ( (tdetprec == 1) || (tdetprec == 3) )
|
||||||
|
{
|
||||||
|
set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
||||||
|
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
|
||||||
|
rw+=2;
|
||||||
|
}
|
||||||
|
if (riga._tipodet != tdetprec)
|
||||||
|
{
|
||||||
|
set_row(rw++, "----- N.D. 9 - acquisti indeducibili per ART.19 -----");
|
||||||
|
set_row(rw, "Cod.");
|
||||||
|
rw++;
|
||||||
|
set_row(rw, "iva Descrizione@30gImponibile@49gImposta");
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rw++, "@86gImponibile@106gImposta");
|
||||||
|
else rw++;
|
||||||
|
rw++;
|
||||||
|
}
|
||||||
|
rw = setta_riga(rw, riga, tot_imponib, tot_imposta, tot_imponibp, tot_impostap);
|
||||||
|
tdetprec = riga._tipodet;
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tdetprec == 9)
|
||||||
|
{
|
||||||
|
set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
|
||||||
|
if (_tipo_stampa != 3)
|
||||||
|
set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap);
|
||||||
|
}
|
||||||
|
_iva_array.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG4400_application::compila_reg(const TMask& m)
|
bool CG4400_application::compila_reg(const TMask& m)
|
||||||
@ -989,7 +994,7 @@ bool CG4400_application::preprocess_print(int file, int counter)
|
|||||||
_doc_array.destroy();
|
_doc_array.destroy();
|
||||||
_dataregp = "";
|
_dataregp = "";
|
||||||
_mov_empty = TRUE;
|
_mov_empty = TRUE;
|
||||||
//_primast = get_page_number();
|
_primast = _u_stampata;
|
||||||
set_print_zero();
|
set_print_zero();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1086,8 +1091,8 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
set_row(_r, "@70g%2s", (const char*) _tipodoc);
|
set_row(_r, "@70g%2s", (const char*) _tipodoc);
|
||||||
set_row(_r, "@72g%r", &totdoc);
|
set_row(_r, "@72g%r", &totdoc);
|
||||||
|
|
||||||
int nrec = riga_rmoviva();
|
_nrec = riga_rmoviva();
|
||||||
if (nrec > 0)
|
if (_nrec > 0)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < _riga_rmi.items(); j++)
|
for (int j = 0; j < _riga_rmi.items(); j++)
|
||||||
{
|
{
|
||||||
@ -1100,9 +1105,11 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
set_row(rr, "@108g%r", &riga._imposta);
|
set_row(rr, "@108g%r", &riga._imposta);
|
||||||
}
|
}
|
||||||
_riga_rmi.destroy();
|
_riga_rmi.destroy();
|
||||||
|
int tipocr = _cur->file(LF_RMOVIVA)->get_int(RMI_TIPOCR);
|
||||||
|
set_row(_r, "@124g%d", tipocr);
|
||||||
}
|
}
|
||||||
int tipocr = _cur->file(LF_RMOVIVA)->get_int(RMI_TIPOCR);
|
//int tipocr = _cur->file(LF_RMOVIVA)->get_int(RMI_TIPOCR);
|
||||||
set_row(_r, "@124g%d", tipocr);
|
//set_row(_r, "@124g%d", tipocr);
|
||||||
if (_tipo_stampa == 3) //stampa di prova
|
if (_tipo_stampa == 3) //stampa di prova
|
||||||
{
|
{
|
||||||
set_row(_r, "@125g%6d", numreg);
|
set_row(_r, "@125g%6d", numreg);
|
||||||
@ -1123,7 +1130,9 @@ void CG4400_application::aggiorna_reg()
|
|||||||
long pag;
|
long pag;
|
||||||
//long stampate;
|
//long stampate;
|
||||||
|
|
||||||
const word ultimast = get_page_number();
|
word ultimast = get_page_number();
|
||||||
|
if (_stampa_tutti_i_registri) //ho fatto un salto pagina dopo avere stampato un registro
|
||||||
|
--ultimast;
|
||||||
|
|
||||||
codtab << _annoes << _codreg;
|
codtab << _annoes << _codreg;
|
||||||
Tabreg.zero();
|
Tabreg.zero();
|
||||||
@ -1141,59 +1150,60 @@ void CG4400_application::aggiorna_reg()
|
|||||||
}
|
}
|
||||||
if (_tipo_stampa == 2) //stampa su libro unico
|
if (_tipo_stampa == 2) //stampa su libro unico
|
||||||
//sulla tabella %inl (indice libro unico) devo generare una riga per ogni registro stampato
|
//sulla tabella %inl (indice libro unico) devo generare una riga per ogni registro stampato
|
||||||
{
|
if (!_mov_empty)
|
||||||
bool trovato = FALSE;
|
|
||||||
codtab = "";
|
|
||||||
codtab << _annoes << _codlib;
|
|
||||||
TabInl.zero();
|
|
||||||
TRectype nuovo (TabInl.curr());
|
|
||||||
TRectype recprec (TabInl.curr());
|
|
||||||
TabInl.put("CODTAB", codtab);
|
|
||||||
|
|
||||||
TRectype rec (TabInl.curr());
|
|
||||||
TabInl.read (_isgteq);
|
|
||||||
for (; !TabInl.eof(); TabInl.next())
|
|
||||||
{
|
|
||||||
if (TabInl.curr() != rec) break;
|
|
||||||
|
|
||||||
trovato = TRUE;
|
|
||||||
recprec = TabInl.curr();
|
|
||||||
}
|
|
||||||
|
|
||||||
TString cod = "";
|
|
||||||
if (trovato)
|
|
||||||
{
|
|
||||||
TString16 cod_inl = recprec.get("CODTAB");
|
|
||||||
long numero_riga = atol(cod_inl.mid(7,6)) + 1;
|
|
||||||
TString16 num_riga (format("%6d", numero_riga));
|
|
||||||
cod_inl = cod_inl.mid(0,7);
|
|
||||||
nuovo = recprec;
|
|
||||||
cod << cod_inl << num_riga;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TString16 num_riga ( format("%6d", 1L) );
|
bool trovato = FALSE;
|
||||||
cod << codtab << num_riga;
|
codtab = "";
|
||||||
}
|
codtab << _annoes << _codlib;
|
||||||
|
TabInl.zero();
|
||||||
long numini = _pagine_stampate + 1;
|
TRectype nuovo (TabInl.curr());
|
||||||
nuovo.put("CODTAB", cod);
|
TRectype recprec (TabInl.curr());
|
||||||
nuovo.put("I0", (long)_annoes);
|
TabInl.put("CODTAB", codtab);
|
||||||
nuovo.put("I1", (long)_fino_a_mese);
|
|
||||||
nuovo.put("I2", (long)_u_stampata + 1);
|
TRectype rec (TabInl.curr());
|
||||||
nuovo.put("I3", (long)(_u_stampata + ultimast));
|
TabInl.read (_isgteq);
|
||||||
nuovo.put("I4", get_firm());
|
for (; !TabInl.eof(); TabInl.next())
|
||||||
nuovo.put("S0", _codreg);
|
{
|
||||||
nuovo.put("I5", (long)numini);
|
if (TabInl.curr() != rec) break;
|
||||||
nuovo.put("I6", (long)(numini + ultimast));
|
|
||||||
|
trovato = TRUE;
|
||||||
if (trovato)
|
recprec = TabInl.curr();
|
||||||
TabInl.rewrite(nuovo);
|
}
|
||||||
else
|
|
||||||
TabInl.write(nuovo);
|
TString cod = "";
|
||||||
|
if (trovato)
|
||||||
_u_stampata += ultimast;
|
{
|
||||||
}
|
TString16 cod_inl = recprec.get("CODTAB");
|
||||||
|
long numero_riga = atol(cod_inl.mid(7,6)) + 1;
|
||||||
|
TString16 num_riga (format("%6d", numero_riga));
|
||||||
|
cod_inl = cod_inl.mid(0,7);
|
||||||
|
nuovo = recprec;
|
||||||
|
cod << cod_inl << num_riga;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TString16 num_riga ( format("%6d", 1L) );
|
||||||
|
cod << codtab << num_riga;
|
||||||
|
}
|
||||||
|
|
||||||
|
long numini = _pagine_stampate + 1;
|
||||||
|
nuovo.put("CODTAB", cod);
|
||||||
|
nuovo.put("I0", (long)_annoes);
|
||||||
|
nuovo.put("I1", (long)_fino_a_mese);
|
||||||
|
nuovo.put("I2", (long)(_primast + 1));
|
||||||
|
nuovo.put("I3", (long)(_primast + ultimast));
|
||||||
|
nuovo.put("I4", get_firm());
|
||||||
|
nuovo.put("S0", _codreg);
|
||||||
|
nuovo.put("I5", (long)numini);
|
||||||
|
nuovo.put("I6", (long)(numini + ultimast - 1));
|
||||||
|
|
||||||
|
if (trovato)
|
||||||
|
TabInl.rewrite(nuovo);
|
||||||
|
else
|
||||||
|
TabInl.write(nuovo);
|
||||||
|
|
||||||
|
_u_stampata += ultimast;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG4400_application::aggiorna_lib()
|
void CG4400_application::aggiorna_lib()
|
||||||
@ -1207,7 +1217,7 @@ void CG4400_application::aggiorna_lib()
|
|||||||
if (lbu.read() == NOERR)
|
if (lbu.read() == NOERR)
|
||||||
{
|
{
|
||||||
lbu.put("I0", (long) _fino_a_mese);
|
lbu.put("I0", (long) _fino_a_mese);
|
||||||
lbu.put("I1", (long) _u_stampata - 1);
|
lbu.put("I1", (long) _u_stampata);
|
||||||
lbu.rewrite();
|
lbu.rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1255,12 +1265,12 @@ print_action CG4400_application::postprocess_print(int file, int counter)
|
|||||||
if ( (_tipo_stampa != 3) && (!_stampa_tutti_i_registri) )
|
if ( (_tipo_stampa != 3) && (!_stampa_tutti_i_registri) )
|
||||||
aggiorna_reg();
|
aggiorna_reg();
|
||||||
if (_stampa_tutti_i_registri)
|
if (_stampa_tutti_i_registri)
|
||||||
if (!_mov_empty )
|
//if (!_mov_empty )
|
||||||
{
|
{
|
||||||
if (_tipo_stampa == 2)
|
if (_tipo_stampa == 2)
|
||||||
++ _u_stampata;
|
++ _u_stampata;
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (_stampa_tutti_i_registri)
|
if (_stampa_tutti_i_registri)
|
||||||
{
|
{
|
||||||
@ -1314,7 +1324,7 @@ bool CG4400_application::set_print(int n)
|
|||||||
if (set_ditte(m))
|
if (set_ditte(m))
|
||||||
if (_selected.ones() > 0l)
|
if (_selected.ones() > 0l)
|
||||||
{
|
{
|
||||||
_annoes = m.get_int(ANNO);
|
_annoes = m.get_int(ANNO);//in realta' e' l'anno IVA !!!
|
||||||
_tipo_stampa = m.get_int(TIPO_STAMPA);
|
_tipo_stampa = m.get_int(TIPO_STAMPA);
|
||||||
//Se stampa di prova l'utente indica data_da e data_a
|
//Se stampa di prova l'utente indica data_da e data_a
|
||||||
if (_tipo_stampa == 3)
|
if (_tipo_stampa == 3)
|
||||||
@ -1355,7 +1365,7 @@ bool CG4400_application::set_print(int n)
|
|||||||
compila_lib();
|
compila_lib();
|
||||||
stampa_registri_IVA(m);
|
stampa_registri_IVA(m);
|
||||||
}
|
}
|
||||||
else warning_box("Nessuna ditta selezionata!");
|
else warning_box("Nessuna ditta selezionata!");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1393,26 +1403,27 @@ void CG4400_application::stampa_registri_IVA(const TMask& m)
|
|||||||
anno = atoi(codtab.mid(0,4));
|
anno = atoi(codtab.mid(0,4));
|
||||||
if (anno > _annoes)
|
if (anno > _annoes)
|
||||||
break;
|
break;
|
||||||
if ( (tipo == 1) || (tipo == 2) ) //registro iva
|
if (anno == _annoes)
|
||||||
{
|
if ( (tipo == 1) || (tipo == 2) ) //registro iva
|
||||||
_tipo_reg = _tabreg->get_int("I0");
|
{
|
||||||
_desc_lib = _tabreg->get("S0");
|
_tipo_reg = _tabreg->get_int("I0");
|
||||||
if (_tipo_stampa != 3)
|
_desc_lib = _tabreg->get("S0");
|
||||||
_data_da = _tabreg->get_date("D3");
|
if (_tipo_stampa != 3)
|
||||||
_pagine_stampate = _tabreg->get_int("I1");
|
_data_da = _tabreg->get_date("D3");
|
||||||
_codreg = codtab.mid(4,3);
|
_pagine_stampate = _tabreg->get_int("I1");
|
||||||
_codatt = _tabreg->get("S8");
|
_codreg = codtab.mid(4,3);
|
||||||
_attivita = desc_attivita(_codatt);
|
_codatt = _tabreg->get("S8");
|
||||||
_desc_lib = _tabreg->get ("S0");
|
_attivita = desc_attivita(_codatt);
|
||||||
//_primast = get_page_number();
|
_desc_lib = _tabreg->get ("S0");
|
||||||
//if (!_mov_empty )
|
//_primast = get_page_number();
|
||||||
// printer().formfeed();
|
//if (!_mov_empty )
|
||||||
_cur->set_filterfunction(NULL);
|
// printer().formfeed();
|
||||||
_cur->set_filterfunction(filter_func);
|
_cur->set_filterfunction(NULL);
|
||||||
//set_page_number(_u_stampata + 1);
|
_cur->set_filterfunction(filter_func);
|
||||||
print();
|
//set_page_number(_u_stampata + 1);
|
||||||
if (_tipo_stampa != 3) aggiorna_reg();
|
print();
|
||||||
}
|
if (_tipo_stampa != 3) aggiorna_reg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_tipo_stampa == 2)
|
if (_tipo_stampa == 2)
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
#include "cglib03.h"
|
#include "cglib03.h"
|
||||||
|
|
||||||
|
//const int MAXSTR = 255;
|
||||||
|
//static char __tmp[MAXSTR];
|
||||||
|
|
||||||
//enum STAMPA { bollati=1, unici=2 };
|
//enum STAMPA { bollati=1, unici=2 };
|
||||||
const int TABREG = (int)TTable::name2log("REG");
|
const int TABREG = (int)TTable::name2log("REG");
|
||||||
|
|
||||||
@ -75,10 +78,11 @@ class CG4400_application : public TPrintapp
|
|||||||
TArray_sheet *_ditte;
|
TArray_sheet *_ditte;
|
||||||
TBit_array _selected;
|
TBit_array _selected;
|
||||||
TArray _nomiditte; //array descrizioni ditte per sheet
|
TArray _nomiditte; //array descrizioni ditte per sheet
|
||||||
|
TRecnotype _nrec;
|
||||||
bool _mov_empty, _stampa_ind_ditta, _stampa_tutti_i_registri;
|
bool _mov_empty, _stampa_ind_ditta, _stampa_tutti_i_registri;
|
||||||
char _frequiva;
|
char _frequiva;
|
||||||
TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg;
|
TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg;
|
||||||
long _n_ditte, _u_stampata;
|
long _n_ditte, _u_stampata, _primast;
|
||||||
int _fino_a_mese, _tipo_reg, _tipo_stampa, _pagine_stampate;
|
int _fino_a_mese, _tipo_reg, _tipo_stampa, _pagine_stampate;
|
||||||
int _annoes, _r, _stampa_width; // riga corrente di stampa
|
int _annoes, _r, _stampa_width; // riga corrente di stampa
|
||||||
real _totale_doc;
|
real _totale_doc;
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include "cg4400.h"
|
#include "cg4400.h"
|
||||||
|
|
||||||
static TString256 tmp;
|
|
||||||
|
|
||||||
TRectype& TDati_ditta::look_com(const char * cod)
|
TRectype& TDati_ditta::look_com(const char * cod)
|
||||||
{
|
{
|
||||||
@ -40,8 +39,8 @@ TDati_ditta::~TDati_ditta()
|
|||||||
|
|
||||||
void TDati_ditta::get_dati_ditta ()
|
void TDati_ditta::get_dati_ditta ()
|
||||||
{
|
{
|
||||||
TString16 codanagr;
|
TString codanagr;
|
||||||
char tipoa;
|
TString tipoa;
|
||||||
|
|
||||||
_nditte->zero();
|
_nditte->zero();
|
||||||
_nditte->put(NDT_CODDITTA, _codditta);
|
_nditte->put(NDT_CODDITTA, _codditta);
|
||||||
@ -50,8 +49,8 @@ void TDati_ditta::get_dati_ditta ()
|
|||||||
if (_nditte->bad()) _nditte->zero();
|
if (_nditte->bad()) _nditte->zero();
|
||||||
|
|
||||||
_ragsoc = _nditte->get(NDT_RAGSOC);
|
_ragsoc = _nditte->get(NDT_RAGSOC);
|
||||||
codanagr = _nditte->get(NDT_CODANAGR);
|
codanagr = _nditte->curr().get(NDT_CODANAGR);
|
||||||
tipoa = _nditte->get_char(NDT_TIPOA);
|
tipoa = _nditte->curr().get(NDT_TIPOA);
|
||||||
|
|
||||||
_anag->setkey(1);
|
_anag->setkey(1);
|
||||||
_anag->zero();
|
_anag->zero();
|
||||||
@ -88,22 +87,34 @@ void TDati_ditta::get_dati_ditta ()
|
|||||||
|
|
||||||
const char * TDati_ditta::prima_riga()
|
const char * TDati_ditta::prima_riga()
|
||||||
{
|
{
|
||||||
|
//TString riga(_stampa_width);
|
||||||
|
//tmp = "";
|
||||||
|
TString tmp(132);
|
||||||
get_dati_ditta();
|
get_dati_ditta();
|
||||||
tmp << "Ditta " << _codditta << ' ' << _ragsoc << " Via " << _viafis << ' '
|
|
||||||
<< _cap << ' ' << _comunefis << ' ' << _provfis;
|
/*
|
||||||
|
riga.format("Ditta %d %s Via %s %s %s %s", _codditta,
|
||||||
|
(const char *)_ragsoc,(const char *)_viafis, (const char *)_cap,
|
||||||
|
(const char *)_comunefis, (const char *)_provfis);
|
||||||
|
*/
|
||||||
|
tmp.format("Ditta %ld ", _codditta);
|
||||||
|
tmp << format("%s %s %s %s %s",
|
||||||
|
(const char *)_ragsoc,(const char *)_viafis, (const char *)_cap,
|
||||||
|
(const char *)_comunefis, (const char *)_provfis);
|
||||||
|
//tmp = riga;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * TDati_ditta::seconda_riga()
|
const char * TDati_ditta::seconda_riga()
|
||||||
{
|
{
|
||||||
TString riga(_stampa_width);
|
//TString riga(_stampa_width);
|
||||||
tmp = "";
|
//tmp = "";
|
||||||
riga = "Data @<";
|
TString tmp(132);
|
||||||
riga.right_just(_stampa_width-15);
|
tmp = "Data @<";
|
||||||
riga.overwrite (format ("Partita iva %s @26gCodice fiscale %s",
|
tmp.right_just(_stampa_width-15);
|
||||||
(const char*)_paiva, (const char*)_cofi));
|
tmp.overwrite (format ("Partita iva %s @26gCodice fiscale %s",
|
||||||
tmp = riga;
|
(const char*)_paiva, (const char*)_cofi));
|
||||||
return __tmp;
|
//tmp = riga;
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user