Stampa registri completa (senza ancora liquidazione)

git-svn-id: svn://10.65.10.50/trunk@216 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1994-09-12 07:42:21 +00:00
parent efa6c4e8ee
commit 2b1c61fb33
4 changed files with 2079 additions and 2062 deletions

View File

@ -4,7 +4,7 @@
#include "cg4400.h"
#include "cg4400a.h"
HIDDEN TString256 TMP;
static TString256 TMP;
HIDDEN CG4400_application * app() { return (CG4400_application*) MainApp(); }
@ -46,13 +46,13 @@ HIDDEN int compare(const TObject** o1, const TObject** o2)
}
/*
bool CG4400_application::libro_giornale_iva_unico()
{
bool CG4400_application::libro_giornale_iva_unico()
{
TConfig conf(CONFIG_DITTA);
return conf.get("StLgiU") == "X";
}
*/
}
*/
bool mask_select (TMask_field& f, KEY k)
{
@ -71,17 +71,20 @@ bool mask_select (TMask_field& f, KEY k)
{
if (app()->_selected[i]) continue;
TToken_string d = (const char*)((TToken_string&)app()->_nomiditte[i]);
TString cod = d.get(0);
TString cod = d.get(1);
app()->_ditte->add(d);
if (!from.empty() || !to.empty())
{
if (from.empty()) from = "0";
if (to.empty()) to = "999999999";
if (to.empty()) to = "999999";
if (atol(cod) >= atol(from) && atol(cod) <= atol(to))
{
selected.set(chk++);
app()->_ditte->check(chk++);
}
}
}
// seleziona e aggiungi alle gia' selezionate
if (app()->_ditte->run() == K_ENTER)
{
@ -131,6 +134,35 @@ bool mask_annulla (TMask_field& f, KEY k)
return TRUE;
}
bool mask_from_to (TMask_field& f, KEY k)
{
if (k == K_TAB)
{
app()->_selected.reset();
TString from, to;
const short id = f.dlg();
from = f.mask().get(id-1);
to = f.mask().get(id);
int i;
if (!from.empty() || !to.empty())
{
long chk = 0l;
if (from.empty()) from = "0";
if (to.empty()) to = "999999";
for (i = 0; i < app()->_nomiditte.items(); i++)
{
TToken_string d = (const char*)((TToken_string&)app()->_nomiditte[i]);
TString cod = d.get(1);
if (atol(cod) >= atol(from) && atol(cod)<= atol(to))
app()->_selected.set(chk++);
}
}
}
return TRUE;
}
bool mask_mese (TMask_field& f, KEY k)
{
if (k == K_ENTER)
@ -192,8 +224,8 @@ bool mask_data (TMask_field& f, KEY k)
}
/*
bool mask_fino_a_mese (TMask_field& f, KEY k)
{
bool mask_fino_a_mese (TMask_field& f, KEY k)
{
if (k == K_ENTER)
{
TTable TabReg ("REG");
@ -258,8 +290,8 @@ bool mask_data (TMask_field& f, KEY k)
}
}
return TRUE;
}
*/
}
*/
//da una SHEET non e' possibile mandare messaggi nella maschera!!!
HIDDEN bool my_handler (TMask_field& f, KEY k)
@ -650,8 +682,8 @@ void CG4400_application::cerca_reg(const TString& c, byte& t, TDate& d)
}
/*
bool CG4400_application::controlla_mov()
{
bool CG4400_application::controlla_mov()
{
bool ok = TRUE;
if (_stampa_tutti_i_registri)
@ -673,10 +705,10 @@ void CG4400_application::cerca_reg(const TString& c, byte& t, TDate& d)
leggi_movimenti(_data_da, _codreg, ok);
return ok;
}
}
void CG4400_application::leggi_movimenti(const TDate& d, const TString& cod, bool& ok)
{
void CG4400_application::leggi_movimenti(const TDate& d, const TString& cod, bool& ok)
{
TLocalisamfile mov (LF_MOV);
bool stampato;
long numreg;
@ -701,8 +733,8 @@ void CG4400_application::cerca_reg(const TString& c, byte& t, TDate& d)
}
mov.next();
}
}
*/
}
*/
void CG4400_application::set_page_tot_reg()
{
@ -1444,10 +1476,10 @@ bool CG4400_application::set_ditte(TMask& m)
m.field(TIPO_STAMPA).set("1");
m.set_handler (TIPO_STAMPA, my_handler);
m.set_handler (A_CODICE, mask_from_to);
m.set_handler (DA_DATA, mask_data);
m.set_handler (A_DATA, mask_data);
m.set_handler (MESE, mask_mese);
//m.set_handler (FINO_A_MESE, mask_fino_a_mese);
m.set_handler (CODICE_LIB_UN, mask_cod);
m.set_handler (DLG_SELECT, mask_select);
m.set_handler (F_ANNULLA, mask_annulla);
@ -1460,7 +1492,7 @@ bool CG4400_application::set_ditte(TMask& m)
tasto = m.run();
// m.first_focus(tasto);
// m.first_focus(tasto);
return tasto == K_ENTER;
}
@ -1496,7 +1528,7 @@ void CG4400_application::preprocess_header()
_datareg.year());
else data.format("%s %s %d", (const char*)"mese di", itom(_fino_a_mese), _annoes);
}
else
else
data = _data_da.string();
reset_header();
@ -1545,7 +1577,7 @@ else
set_header(r, "@128gNum.");
r++;
set_header(r, "Data reg. prot.@17gData@25gNumero Codice Ragione sociale/descrizione@68gO Doc.@76gTotale doc.@91gImponibile Iva %s@112gImposta@124g%s",
(const char*) nd2, (const char*) cor);
(const char*) nd2, (const char*) cor);
if (_tipo_stampa == 4)
set_header(r, "@128gop.");
r++;

View File

@ -24,14 +24,12 @@
#include "cglib03.h"
//const int MAXSTR = 255;
//static char __tmp[MAXSTR];
//enum STAMPA { bollati=1, unici=2 };
const int TABREG = (int)TTable::name2log("REG");
bool filter_func (const TRelation*);
bool my_handler (TMask_field&, KEY);
bool mask_from_to (TMask_field&, KEY);
bool mask_cod (TMask_field&, KEY);
bool mask_data (TMask_field&, KEY);
bool mask_mese (TMask_field&, KEY);
@ -61,8 +59,8 @@ class CG4400_application : public TPrintapp
{
friend bool filter_func (const TRelation *r);
friend bool mask_cod (TMask_field&, KEY);
friend bool mask_from_to (TMask_field&, KEY);
friend bool mask_mese (TMask_field&, KEY);
//friend bool mask_fino_a_mese (TMask_field&, KEY);
friend bool my_handler (TMask_field&, KEY);
friend bool mask_select (TMask_field&, KEY);
friend bool mask_verifica (TMask_field&, KEY);

View File

@ -13,6 +13,7 @@
#include "cg4400.h"
static TString256 tmp;
TRectype& TDati_ditta::look_com(const char * cod)
{
@ -39,8 +40,8 @@ TDati_ditta::~TDati_ditta()
void TDati_ditta::get_dati_ditta ()
{
TString codanagr;
TString tipoa;
TString16 codanagr;
char tipoa;
_nditte->zero();
_nditte->put(NDT_CODDITTA, _codditta);
@ -49,8 +50,8 @@ void TDati_ditta::get_dati_ditta ()
if (_nditte->bad()) _nditte->zero();
_ragsoc = _nditte->get(NDT_RAGSOC);
codanagr = _nditte->curr().get(NDT_CODANAGR);
tipoa = _nditte->curr().get(NDT_TIPOA);
codanagr = _nditte->get(NDT_CODANAGR);
tipoa = _nditte->get_char(NDT_TIPOA);
_anag->setkey(1);
_anag->zero();
@ -87,34 +88,20 @@ void TDati_ditta::get_dati_ditta ()
const char * TDati_ditta::prima_riga()
{
//TString riga(_stampa_width);
//tmp = "";
TString tmp(132);
get_dati_ditta();
/*
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;
tmp << "Ditta " << _codditta << ' ' << _ragsoc << " Via " << _viafis << ' '
<< _cap << ' ' << _comunefis << ' ' << _provfis;
return tmp;
}
const char * TDati_ditta::seconda_riga()
{
//TString riga(_stampa_width);
//tmp = "";
TString tmp(132);
tmp = "";
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;
}