Modifiche alla stampa registri

git-svn-id: svn://10.65.10.50/trunk@197 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1994-09-08 16:15:07 +00:00
parent f114c65d04
commit fbcc614384
3 changed files with 269 additions and 243 deletions

View File

@ -4,7 +4,7 @@
#include "cg4400.h"
#include "cg4400a.h"
static TString256 TMP;
TFixed_string TMP (__tmp, MAXSTR);
HIDDEN CG4400_application * app() { return (CG4400_application*) MainApp(); }
@ -329,7 +329,7 @@ const char * CG4400_application::descr_doc(const char * tipo)
else
TMP = "";
return TMP;
return __tmp;
}
const char * CG4400_application::descr_iva(const char * cod)
@ -344,7 +344,7 @@ const char * CG4400_application::descr_iva(const char * cod)
else
TMP = "";
return TMP;
return __tmp;
}
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");
else
TMP = "";
return TMP;
return __tmp;
}
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);
else
TMP = "";
return TMP;
return __tmp;
}
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);
else
TMP = "";
return TMP;
return __tmp;
}
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()
{
reset_print();
TString riga(_stampa_width);
int r=1, rr=0, row=0;
real tot_imponib, tot_imposta, tot_imponibp, tot_impostap;
@ -728,7 +729,13 @@ void CG4400_application::set_page_tot_reg()
}
_doc_array.destroy();
if (rr > 0)
rr++;
else
rr = r;
if (_nrec > 0) //numero records di rmoviva
{
set_row(++rr, "@26g---------- P E R I O D O ----------");
if (_tipo_stampa != 3)
set_row(rr,"@82g------ P R O G R E S S I V I ------");
@ -752,7 +759,6 @@ void CG4400_application::set_page_tot_reg()
set_row(rr++, "@86gImponibile@106gImposta");
else rr++;
rr++;
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00;
_tot_iva_array.sort(compare_rows);
@ -777,7 +783,6 @@ void CG4400_application::set_page_tot_reg()
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)
@ -791,7 +796,6 @@ void CG4400_application::set_page_tot_reg()
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];
@ -866,6 +870,7 @@ void CG4400_application::set_page_tot_reg()
}
_iva_array.destroy();
}
}
}
bool CG4400_application::compila_reg(const TMask& m)
@ -989,7 +994,7 @@ bool CG4400_application::preprocess_print(int file, int counter)
_doc_array.destroy();
_dataregp = "";
_mov_empty = TRUE;
//_primast = get_page_number();
_primast = _u_stampata;
set_print_zero();
}
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, "@72g%r", &totdoc);
int nrec = riga_rmoviva();
if (nrec > 0)
_nrec = riga_rmoviva();
if (_nrec > 0)
{
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);
}
_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);
//set_row(_r, "@124g%d", tipocr);
if (_tipo_stampa == 3) //stampa di prova
{
set_row(_r, "@125g%6d", numreg);
@ -1123,7 +1130,9 @@ void CG4400_application::aggiorna_reg()
long pag;
//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;
Tabreg.zero();
@ -1141,6 +1150,7 @@ void CG4400_application::aggiorna_reg()
}
if (_tipo_stampa == 2) //stampa su libro unico
//sulla tabella %inl (indice libro unico) devo generare una riga per ogni registro stampato
if (!_mov_empty)
{
bool trovato = FALSE;
codtab = "";
@ -1180,12 +1190,12 @@ void CG4400_application::aggiorna_reg()
nuovo.put("CODTAB", cod);
nuovo.put("I0", (long)_annoes);
nuovo.put("I1", (long)_fino_a_mese);
nuovo.put("I2", (long)_u_stampata + 1);
nuovo.put("I3", (long)(_u_stampata + ultimast));
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));
nuovo.put("I6", (long)(numini + ultimast - 1));
if (trovato)
TabInl.rewrite(nuovo);
@ -1207,7 +1217,7 @@ void CG4400_application::aggiorna_lib()
if (lbu.read() == NOERR)
{
lbu.put("I0", (long) _fino_a_mese);
lbu.put("I1", (long) _u_stampata - 1);
lbu.put("I1", (long) _u_stampata);
lbu.rewrite();
}
}
@ -1255,7 +1265,7 @@ print_action CG4400_application::postprocess_print(int file, int counter)
if ( (_tipo_stampa != 3) && (!_stampa_tutti_i_registri) )
aggiorna_reg();
if (_stampa_tutti_i_registri)
if (!_mov_empty )
//if (!_mov_empty )
{
if (_tipo_stampa == 2)
++ _u_stampata;
@ -1314,7 +1324,7 @@ bool CG4400_application::set_print(int n)
if (set_ditte(m))
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);
//Se stampa di prova l'utente indica data_da e data_a
if (_tipo_stampa == 3)
@ -1355,7 +1365,7 @@ bool CG4400_application::set_print(int n)
compila_lib();
stampa_registri_IVA(m);
}
else warning_box("Nessuna ditta selezionata!");
else warning_box("Nessuna ditta selezionata!");
return FALSE;
}
@ -1393,6 +1403,7 @@ void CG4400_application::stampa_registri_IVA(const TMask& m)
anno = atoi(codtab.mid(0,4));
if (anno > _annoes)
break;
if (anno == _annoes)
if ( (tipo == 1) || (tipo == 2) ) //registro iva
{
_tipo_reg = _tabreg->get_int("I0");

View File

@ -24,6 +24,9 @@
#include "cglib03.h"
//const int MAXSTR = 255;
//static char __tmp[MAXSTR];
//enum STAMPA { bollati=1, unici=2 };
const int TABREG = (int)TTable::name2log("REG");
@ -75,10 +78,11 @@ class CG4400_application : public TPrintapp
TArray_sheet *_ditte;
TBit_array _selected;
TArray _nomiditte; //array descrizioni ditte per sheet
TRecnotype _nrec;
bool _mov_empty, _stampa_ind_ditta, _stampa_tutti_i_registri;
char _frequiva;
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 _annoes, _r, _stampa_width; // riga corrente di stampa
real _totale_doc;

View File

@ -13,7 +13,6 @@
#include "cg4400.h"
static TString256 tmp;
TRectype& TDati_ditta::look_com(const char * cod)
{
@ -40,8 +39,8 @@ TDati_ditta::~TDati_ditta()
void TDati_ditta::get_dati_ditta ()
{
TString16 codanagr;
char tipoa;
TString codanagr;
TString tipoa;
_nditte->zero();
_nditte->put(NDT_CODDITTA, _codditta);
@ -50,8 +49,8 @@ void TDati_ditta::get_dati_ditta ()
if (_nditte->bad()) _nditte->zero();
_ragsoc = _nditte->get(NDT_RAGSOC);
codanagr = _nditte->get(NDT_CODANAGR);
tipoa = _nditte->get_char(NDT_TIPOA);
codanagr = _nditte->curr().get(NDT_CODANAGR);
tipoa = _nditte->curr().get(NDT_TIPOA);
_anag->setkey(1);
_anag->zero();
@ -88,22 +87,34 @@ void TDati_ditta::get_dati_ditta ()
const char * TDati_ditta::prima_riga()
{
//TString riga(_stampa_width);
//tmp = "";
TString tmp(132);
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;
}
const char * TDati_ditta::seconda_riga()
{
TString riga(_stampa_width);
tmp = "";
riga = "Data @<";
riga.right_just(_stampa_width-15);
riga.overwrite (format ("Partita iva %s @26gCodice fiscale %s",
//TString riga(_stampa_width);
//tmp = "";
TString tmp(132);
tmp = "Data @<";
tmp.right_just(_stampa_width-15);
tmp.overwrite (format ("Partita iva %s @26gCodice fiscale %s",
(const char*)_paiva, (const char*)_cofi));
tmp = riga;
return __tmp;
//tmp = riga;
return tmp;
}