Modificate funzioni user_create e user_destroy

git-svn-id: svn://10.65.10.50/trunk@603 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-11-11 17:47:21 +00:00
parent 55f8ebba30
commit 430a49010b
22 changed files with 318 additions and 287 deletions

View File

@ -32,8 +32,8 @@ class BA3200_application : public TPrintapp
public:
virtual void user_create() ;
virtual void user_destroy() ;
virtual bool user_create() ;
virtual bool user_destroy() ;
virtual bool set_print(int) ;
virtual void set_page(int, int);
@ -324,8 +324,7 @@ void BA3200_application::set_relations()
line = rpt.line();
}
}
void BA3200_application::user_create()
bool BA3200_application::user_create()
{
_tabname = argv(2);
@ -370,13 +369,15 @@ void BA3200_application::user_create()
set_footers();
set_translations();
set_relations();
return TRUE;
}
void BA3200_application::user_destroy()
bool BA3200_application::user_destroy()
{
delete _msk;
delete _cur;
delete _rel;
return TRUE;
}
int ba3200(int argc, char* argv[])

View File

@ -26,8 +26,8 @@ class BA3300_application : public TPrintapp
public:
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
virtual void user_destroy();
virtual void user_create() ;
virtual bool user_destroy();
virtual bool user_create() ;
bool set_print(int);
const char* decodifica_reg ();
@ -237,7 +237,7 @@ const char* BA3300_application::decodifica_reg ()
return _tab->curr().get ("S0");
}
void BA3300_application::user_create()
bool BA3300_application::user_create()
{
enable_print_menu();
@ -252,9 +252,10 @@ void BA3300_application::user_create()
add_cursor (NULL);
set_auto_ff (TRUE);
return TRUE;
}
void BA3300_application::user_destroy() // releasev e arrmask
bool BA3300_application::user_destroy() // releasev e arrmask
{
delete _msk;
delete _nditte;
@ -262,6 +263,7 @@ void BA3300_application::user_destroy() // releasev e arrmask
delete _comuni;
delete _anag;
delete _tab;
return TRUE;
}
int ba3300(int argc, char* argv[])

View File

@ -57,8 +57,8 @@ class BA3600_application : public TPrintapp
public:
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
void user_create() ;
void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
bool set_print(int);
virtual bool preprocess_page (int,int);
@ -452,7 +452,7 @@ void BA3600_application::crea_intestazione()
set_header (7, (const char *) sep);
}
void BA3600_application::user_create()
bool BA3600_application::user_create()
{
_nditte = new TLocalisamfile (LF_NDITTE);
@ -461,9 +461,10 @@ void BA3600_application::user_create()
_tab_reg = new TTable (TAB_REG);
_msk = new TMask("ba3600a");
return TRUE;
}
void BA3600_application::user_destroy()
bool BA3600_application::user_destroy()
{
delete _msk;
@ -471,6 +472,7 @@ void BA3600_application::user_destroy()
delete _tab_lbu;
delete _tab_reg;
delete _nditte;
return TRUE;
}
int ba3600 (int argc, char* argv[])

View File

@ -2,7 +2,7 @@
PAGE "Stampa indici libro unico" -1 -1 78 20
RADIOBUTTON F_TIPO_STAMPA 25
RADIOBUTTON F_TIPO_STAMPA 29
BEGIN
PROMPT 4 2 "Tipo stampa registro "
HELP "Indicare il tipo di stampa che si vuole eseguire"

View File

@ -58,8 +58,8 @@ class BA3800_application : public TPrintapp
public:
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
void user_create() ;
void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
virtual bool set_print(int);
virtual bool preprocess_page (int,int);
@ -1798,7 +1798,7 @@ void BA3800_application::init_sort()
_sort->init();
}
void BA3800_application::user_create()
bool BA3800_application::user_create()
{
_nditte = new TLocalisamfile (LF_NDITTE);
_comuni = new TLocalisamfile (LF_COMUNI);
@ -1808,9 +1808,10 @@ void BA3800_application::user_create()
_clifo = new TLocalisamfile (LF_CLIFO);
_tabivd = new TTable (TAB_IVD);
return TRUE;
}
void BA3800_application::user_destroy()
bool BA3800_application::user_destroy()
{
delete _tabivd;
delete _nditte;
@ -1819,6 +1820,7 @@ void BA3800_application::user_destroy()
delete _anag;
delete _pconti;
delete _clifo;
return TRUE;
}
int ba3800 (int argc, char* argv[])

View File

@ -449,7 +449,7 @@ bool BA6100_App::set_print(int)
return TRUE;
}
void BA6100_App::user_create()
bool BA6100_App::user_create()
{
TToken_string rxp(40);
@ -543,10 +543,10 @@ void BA6100_App::user_create()
set_wait_threshold(0);
p.addstatus(1);
return TRUE;
}
void BA6100_App::user_destroy()
bool BA6100_App::user_destroy()
{
if (_rel_fis) delete _rel_fis;
if (_rel_giu) delete _rel_giu;
@ -554,6 +554,7 @@ void BA6100_App::user_destroy()
if (_frpos) delete _frpos;
delete _comuni;
return TRUE;
}

View File

@ -50,8 +50,8 @@ protected:
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
virtual void user_create();
virtual void user_destroy();
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int n);
virtual void process_link(int id, const char* txt);

View File

@ -31,8 +31,8 @@ class BA6200_application : public TPrintapp
TDate _data_stampa;
protected:
virtual void user_create() ;
virtual void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
virtual bool set_print(int m);
virtual bool preprocess_page (int,int);
@ -246,7 +246,7 @@ void BA6200_application::crea_intestazione()
set_header (6,"@85g------------@97g-----@103g-----@109g-----@115g-------");
}
void BA6200_application::user_create()
bool BA6200_application::user_create()
{
_rel = new TRelation (LF_COMUNI);
@ -259,14 +259,16 @@ void BA6200_application::user_create()
_descr_comune = new TParagraph_string ("",25);
_msk = new TMask("ba6200a");
return TRUE;
}
void BA6200_application::user_destroy()
bool BA6200_application::user_destroy()
{
delete _msk;
delete _rel;
delete _comuni;
delete _descr_comune;
return TRUE;
}
int ba6200(int argc, char* argv[])

View File

@ -1,101 +1,101 @@
#include "batbues.h"
TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Uffici esattoria" -1 -1 78 18
NUMBER FLD_TABUES_CODTAB 3
BEGIN
PROMPT 3 1 "Codice "
FIELD %UES->CODTAB
FLAGS "RZ"
KEY 1
USE %UES
INPUT CODTAB FLD_TABUES_CODTAB
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@25" S0
OUTPUT FLD_TABUES_CODTAB CODTAB
OUTPUT FLD_TABUES_S0 S0
HELP "Codice dell'ufficio esattoria"
CHECKTYPE REQUIRED
END
STRING FLD_TABUES_S0 25
BEGIN
PROMPT 3 3 "Ufficio "
FIELD %UES->S0
KEY 2
USE %UES KEY 2
INPUT S0 FLD_TABUES_S0
DISPLAY "Descrizione@25" S0
DISPLAY "Codice" CODTAB
OUTPUT FLD_TABUES_CODTAB CODTAB
OUTPUT FLD_TABUES_S0 S0
HELP "Descrizione dell'ufficio esattoria"
CHECKTYPE REQUIRED
END
STRING FLD_TABUES_S1 35
BEGIN
PROMPT 3 5 "Indirizzo "
FIELD %UES->S1
HELP "Indirizzo della sede dell'ufficio esattoria"
END
STRING FLD_TABUES_S3 10
BEGIN
PROMPT 56 5 "N."
FIELD %UES->S3
HELP "Numero civico della sede dell'ufficio esattoria"
END
STRING FLD_TABUES_S6 4
BEGIN
PROMPT 3 7 "Comune "
FIELD %UES->S6
FLAGS "U"
USE LF_COMUNI
INPUT STATO ""
INPUT COM FLD_TABUES_S6
#include <comdcod.h>
OUTPUT FLD_TABUES_S6 COM
OUTPUT FLD_TABUES_S6_COMUNI_DENCOM DENCOM
OUTPUT FLD_TABUES_S6_COMUNI_PROVCOM PROVCOM
OUTPUT FLD_TABUES_S6_COMUNI_CAPCOM CAPCOM
HELP "Codice del comune della sede dell'ufficio esattoria"
CHECKTYPE NORMAL
END
STRING FLD_TABUES_S6_COMUNI_DENCOM 50
BEGIN
PROMPT 3 9 "Nome "
FLAGS "D"
END
STRING FLD_TABUES_S6_COMUNI_PROVCOM 6
BEGIN
PROMPT 3 11 "Provincia "
FLAGS "D"
END
STRING FLD_TABUES_S6_COMUNI_CAPCOM 5
BEGIN
PROMPT 56 11 "CAP "
FIELD %UES->S7
HELP "Numero civico della sede dell'ufficio esattoria"
END
STRING FLD_TABUES_S4 10
BEGIN
PROMPT 3 13 "C.Corr.Postale "
FIELD %UES->S4
HELP "Numero di conto corrente postale dell'ufficio"
END
ENDPAGE
ENDMASK
#include "batbues.h"
TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Uffici esattoria" -1 -1 78 18
NUMBER FLD_TABUES_CODTAB 3
BEGIN
PROMPT 3 1 "Codice "
FIELD %UES->CODTAB
FLAGS "RZ"
KEY 1
USE %UES
INPUT CODTAB FLD_TABUES_CODTAB
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@25" S0
OUTPUT FLD_TABUES_CODTAB CODTAB
OUTPUT FLD_TABUES_S0 S0
HELP "Codice dell'ufficio esattoria"
CHECKTYPE REQUIRED
END
STRING FLD_TABUES_S0 25
BEGIN
PROMPT 3 3 "Ufficio "
FIELD %UES->S0
KEY 2
USE %UES KEY 2
INPUT S0 FLD_TABUES_S0
DISPLAY "Descrizione@25" S0
DISPLAY "Codice" CODTAB
OUTPUT FLD_TABUES_CODTAB CODTAB
OUTPUT FLD_TABUES_S0 S0
HELP "Descrizione dell'ufficio esattoria"
CHECKTYPE REQUIRED
END
STRING FLD_TABUES_S1 35
BEGIN
PROMPT 3 5 "Indirizzo "
FIELD %UES->S1
HELP "Indirizzo della sede dell'ufficio esattoria"
END
STRING FLD_TABUES_S3 10
BEGIN
PROMPT 56 5 "N."
FIELD %UES->S3
HELP "Numero civico della sede dell'ufficio esattoria"
END
STRING FLD_TABUES_S6 4
BEGIN
PROMPT 3 7 "Comune "
FIELD %UES->S6
FLAGS "U"
USE LF_COMUNI
INPUT STATO ""
INPUT COM FLD_TABUES_S6
#include <comdcod.h>
OUTPUT FLD_TABUES_S6 COM
OUTPUT FLD_TABUES_S6_COMUNI_DENCOM DENCOM
OUTPUT FLD_TABUES_S6_COMUNI_PROVCOM PROVCOM
OUTPUT FLD_TABUES_S6_COMUNI_CAPCOM CAPCOM
HELP "Codice del comune della sede dell'ufficio esattoria"
CHECKTYPE NORMAL
END
STRING FLD_TABUES_S6_COMUNI_DENCOM 50
BEGIN
PROMPT 3 9 "Nome "
FLAGS "D"
END
STRING FLD_TABUES_S6_COMUNI_PROVCOM 6
BEGIN
PROMPT 3 11 "Provincia "
FLAGS "D"
END
STRING FLD_TABUES_S6_COMUNI_CAPCOM 5
BEGIN
PROMPT 56 11 "CAP "
FIELD %UES->S7
HELP "Numero civico della sede dell'ufficio esattoria"
END
STRING FLD_TABUES_S4 10
BEGIN
PROMPT 3 13 "C.Corr.Postale "
FIELD %UES->S4
HELP "Numero di conto corrente postale dell'ufficio"
END
ENDPAGE
ENDMASK

View File

@ -29,8 +29,8 @@ class CG0400_application : public TPrintapp
real _imposta_acq, _lordo_acq, _totimponibile_acq, _totimposta_acq, _totlordo_acq;
public:
void user_create();
void user_destroy();
bool user_create();
bool user_destroy();
bool set_print(int);
bool menu(MENU_TAG m) { return TPrintapp::menu(m); }
@ -49,7 +49,7 @@ public:
};
void CG0400_application::user_create()
bool CG0400_application::user_create()
{
_tabpim = new TTable(TAB_PIM);
_tabreg = new TTable(TAB_REG);
@ -58,9 +58,10 @@ void CG0400_application::user_create()
_attiv = new TLocalisamfile(LF_ATTIV);
_com = new TLocalisamfile(LF_COMUNI);
_msk = new TMask("cg0400a");
return TRUE;
}
void CG0400_application::user_destroy()
bool CG0400_application::user_destroy()
{
delete _msk;
delete _tabpim;
@ -69,6 +70,7 @@ void CG0400_application::user_destroy()
delete _nditte;
delete _com;
delete _attiv;
return TRUE;
}
void CG0400_application::fai_ricerca(int i)

View File

@ -77,8 +77,8 @@ class CG1100_application : public TPrintapp
public:
virtual void user_destroy() ;
virtual void user_create() ;
virtual bool user_destroy() ;
virtual bool user_create() ;
virtual void set_page (int,int);
virtual bool preprocess_print (int,int);
@ -1182,7 +1182,7 @@ const char * CG1100_application::decodifica_codanabil (const char * codpcab)
return _tab_anabil.curr().get ("S0");
}
void CG1100_application::user_create()
bool CG1100_application::user_create()
{
_rel = new TRelation (LF_PCON);
_msk = new TMask ("cg1100a") ;
@ -1205,10 +1205,10 @@ void CG1100_application::user_create()
_salto_pag = FALSE;
_bil = new bil_ivd;
_sort = new TSort();
return TRUE;
}
void CG1100_application::user_destroy()
bool CG1100_application::user_destroy()
{
delete _msk;
delete _rel;
@ -1216,6 +1216,7 @@ void CG1100_application::user_destroy()
delete _descr;
delete _bil;
delete _sort;
return TRUE;
}
int cg1100(int argc, char* argv[])

View File

@ -60,8 +60,8 @@ public:
virtual bool preprocess_print(int file, int counter);
virtual print_action postprocess_print(int file, int counter);
virtual void preprocess_header();
virtual void user_create();
virtual bool destroy();
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int);
int ccur() { return _sort == 1 ? _cur_1 : _cur_2; }
@ -902,7 +902,7 @@ bool CG1200_App::preprocess_print(int file, int counter)
return TRUE;
}
void CG1200_App::user_create()
bool CG1200_App::user_create()
{
// set relation and cursors
_rel = new TRelation(LF_CLIFO);
@ -925,9 +925,10 @@ void CG1200_App::user_create()
add_file(LF_INDSP,LF_CLIFO);
}
enable_print_menu();
return TRUE;
}
bool CG1200_App::destroy()
bool CG1200_App::user_destroy()
{
if (_rel)
delete _rel;

View File

@ -109,8 +109,8 @@ public:
TDate _inizioEs, _fineEs;
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
void user_create() ;
void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
bool set_print(int);
void next_c();
@ -162,7 +162,7 @@ public:
CG1500_application() {}
};
HIDDEN CG1500_application * app() { return (CG1500_application*) MainApp(); }
HIDDEN inline CG1500_application & app() { return (CG1500_application&) main_app(); }
TDate InizioEsercizio(int anno)
{
@ -227,8 +227,8 @@ HIDDEN int date2esc(const TDate& d, int* prevesc)
const TDate ia(esc.get("D0")); // Data inizio esercizio
const TDate fa(esc.get("D1")); // Data fine esercizio
const anno = esc.get_int("CODTAB");
app()->_inizioEs = ia;
app()->_fineEs = fa;
app()._inizioEs = ia;
app()._fineEs = fa;
if (d >= ia && d <= fa)
return anno;
if (prevesc) *prevesc = anno;
@ -415,7 +415,7 @@ bool mask_date(TMask_field& f, KEY k)
else if (id == F_DATAA)
f.mask().field(F_DATAA).set(FineEsercizio(anno));
}
app()->_annoapp = anno;
app()._annoapp = anno;
}
else
{
@ -427,9 +427,9 @@ bool mask_date(TMask_field& f, KEY k)
else
{
//date2esc(datada);
//const TString16 ie(app()->_inizioEs.string());
//const TString16 fe(app()->_fineEs.string());
//if (datada < app()->_inizioEs || dataa > app()->_fineEs)
//const TString16 ie(app()._inizioEs.string());
//const TString16 fe(app()._fineEs.string());
//if (datada < app()._inizioEs || dataa > app()._fineEs)
//{
// f.error_box("Le date devono essere comprese tra %s e %s",
// (const char*)ie, (const char*)fe);
@ -438,8 +438,8 @@ bool mask_date(TMask_field& f, KEY k)
if (id == F_DATAA)
{
TDate from (f.mask().get(id - 1));
app()->_annoapp = date2esc(from);
if ( app()->_annoapp != date2esc(data) )
app()._annoapp = date2esc(from);
if ( app()._annoapp != date2esc(data) )
{
f.error_box("Le date devono appartenere ad uno stesso esercizio attivo della ditta");
return FALSE;
@ -2906,7 +2906,7 @@ const char* CG1500_application::DescrizioneConto(int g, int c, long s,
return TMP;
}
void CG1500_application::user_create()
bool CG1500_application::user_create()
{
_stampa_width = 132;
_rel = new TRelation(LF_CLIFO);
@ -2926,9 +2926,10 @@ void CG1500_application::user_create()
_tmp_saldi_ricavi = new TIsamtempfile(LF_SALDI);
_tmp_saldi_conti_uno = new TIsamtempfile(LF_SALDI);
_tmp_saldi_conti_due = new TIsamtempfile(LF_SALDI);
return TRUE;
}
void CG1500_application::user_destroy()
bool CG1500_application::user_destroy()
{
delete _rel;
delete _cur;
@ -2947,6 +2948,7 @@ void CG1500_application::user_destroy()
delete _tmp_saldi_ricavi;
delete _tmp_saldi_conti_uno;
delete _tmp_saldi_conti_due;
return TRUE;
}
void CG1500_application::leggi_pcon()

View File

@ -270,6 +270,7 @@ class CG1600_application : public TPrintapp
TLocalisamfile* _anag;
TLocalisamfile* _pconti;
TLocalisamfile* _clifo;
TLocalisamfile* _saldi;
const char* _buff;
TSort* _sort;
Anni_es _anni_es;
@ -321,8 +322,8 @@ public:
TDate _inizioEs, _fineEs;
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
void user_create() ;
void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
bool set_print(int);
virtual bool preprocess_page (int,int);
@ -378,7 +379,7 @@ public:
CG1600_application() {}
};
HIDDEN CG1600_application * a() {return (CG1600_application*) MainApp(); }
HIDDEN inline CG1600_application & a() {return (CG1600_application&) main_app(); }
void CG1600_application::postclose_print()
{
@ -448,8 +449,8 @@ HIDDEN int date2esc(const TDate& d, int* prevesc)
{
const TDate ia(esc.get("D0")); // Data inizio esercizio
const TDate fa(esc.get("D1")); // Data fine esercizio
a()->_inizioEs = ia;
a()->_fineEs = fa;
a()._inizioEs = ia;
a()._fineEs = fa;
const anno = esc.get_int("CODTAB");
if (d >= ia && d <= fa)
return anno;
@ -478,14 +479,14 @@ bool data_limite (TMask_field& f, KEY key)
if (annoese != 0)
{
a()->_anni_es.aggiungi_anno(annoese, in, fin);
a()->_data_fine_ese = fin;
a()->_data_ini_ese = in;
a()._anni_es.aggiungi_anno(annoese, in, fin);
a()._data_fine_ese = fin;
a()._data_ini_ese = in;
a()->_anno_esercizio = annoese;
a()._anno_esercizio = annoese;
if (datalim == botime)
a()->_datalimite = a()->_data_fine_ese;
a()._datalimite = a()._data_fine_ese;
else
if ((datalim < in)||(datalim > fin))
{
@ -493,7 +494,7 @@ bool data_limite (TMask_field& f, KEY key)
return FALSE;
}
else
a()->_datalimite = datalim;
a()._datalimite = datalim;
}
else
if (annoese == 0)
@ -512,17 +513,17 @@ bool data_limite (TMask_field& f, KEY key)
return FALSE;
}
a()->_data_ini_ese = a()->_inizioEs;
a()->_data_fine_ese = a()->_fineEs;
a()._data_ini_ese = a()._inizioEs;
a()._data_fine_ese = a()._fineEs;
a()->_datalimite = datalim;
a()->_anno_esercizio = anno;
a()._datalimite = datalim;
a()._anno_esercizio = anno;
}
}
}
TString data1 = a()->_datalimite.string();
TString data2 = a()->_data_ini_ese.string();
TString data3 = a()->_data_fine_ese.string();
TString data1 = a()._datalimite.string();
TString data2 = a()._data_ini_ese.string();
TString data3 = a()._data_fine_ese.string();
return TRUE;
}
@ -554,18 +555,18 @@ bool data_bil_raff (TMask_field& f, KEY key)
if (datalim != botime)
{
date2esc(datalim);
in = a()->_inizioEs;
in = a()._inizioEs;
}
else
a()->_anni_es.aggiungi_anno(annoese, in, fin);
a()._anni_es.aggiungi_anno(annoese, in, fin);
TString instr = in.string();
if (dataraf != botime)
{
anno = date2esc(dataraf);
in_raf = a()->_inizioEs;
fin_raf = a()->_fineEs;
a()->_anno_esercizio_raf = anno;
in_raf = a()._inizioEs;
fin_raf = a()._fineEs;
a()._anno_esercizio_raf = anno;
}
else
anno == 1;
@ -590,20 +591,20 @@ bool data_bil_raff (TMask_field& f, KEY key)
return FALSE;
}
a()->_databilrafr = dataraf;
a()->_data_ini_raf = in_raf;
a()->_data_fine_raf = fin_raf;
a()._databilrafr = dataraf;
a()._data_ini_raf = in_raf;
a()._data_fine_raf = fin_raf;
//}
}
else
if (annoraf != 0)
{
a()->_anni_es.aggiungi_anno(annoraf, in_raf, fin_raf);
a()->_data_fine_raf = fin_raf;
a()->_data_ini_raf = in_raf;
a()._anni_es.aggiungi_anno(annoraf, in_raf, fin_raf);
a()._data_fine_raf = fin_raf;
a()._data_ini_raf = in_raf;
if (dataraf == botime)
a()->_databilrafr = fin_raf;
a()._databilrafr = fin_raf;
else
if (dataraf < in_raf || dataraf > fin_raf)
@ -612,17 +613,17 @@ bool data_bil_raff (TMask_field& f, KEY key)
return FALSE;
}
else
a()->_databilrafr = dataraf;
a()->_anno_esercizio_raf = annoraf;
a()._databilrafr = dataraf;
a()._anno_esercizio_raf = annoraf;
}
}
} // IF (key == K_ENTER)
TString data1 = in.string();
TString data2 = in_raf.string();
TString data3 = fin_raf.string();
TString data4 = a()->_databilrafr.string();
TString data5 = a()->_data_ini_raf.string();
TString data6 = a()->_data_fine_raf.string();
TString data4 = a()._databilrafr.string();
TString data5 = a()._data_ini_raf.string();
TString data6 = a()._data_fine_raf.string();
return TRUE;
}
@ -772,19 +773,19 @@ bool data_inizio(TMask_field& f, KEY k)
anno = f.mask().get_int(F_ANNOESE);
data = f.mask().get (F_DATAINI);
a()->_anno_esercizio = anno;
a()._anno_esercizio = anno;
if (k == K_ENTER)
{
if (anno != 0)
{
a()->_anni_es.aggiungi_anno(anno, in, fin);
a()->_data_ini_ese = in;
a()->_data_fine_ese = fin;
a()->_anno_esercizio = anno;
a()._anni_es.aggiungi_anno(anno, in, fin);
a()._data_ini_ese = in;
a()._data_fine_ese = fin;
a()._anno_esercizio = anno;
if (data == botime)
a()->_dataini = in;
a()._dataini = in;
else
if (data < in || data > fin)
{
@ -792,7 +793,7 @@ bool data_inizio(TMask_field& f, KEY k)
return FALSE;
}
else
a()->_dataini = data;
a()._dataini = data;
}
else
if (anno == 0)
@ -811,13 +812,13 @@ bool data_inizio(TMask_field& f, KEY k)
return FALSE;
}
a()->_anno_esercizio = anno;
a()->_dataini = data;
a()._anno_esercizio = anno;
a()._dataini = data;
}
}
TString datastr = a()->_dataini.string();
TString data1 = a()->_data_ini_ese.string();
TString data2 = a()->_data_fine_ese.string();
TString datastr = a()._dataini.string();
TString data1 = a()._data_ini_ese.string();
TString data2 = a()._data_fine_ese.string();
return TRUE;
}
@ -830,18 +831,18 @@ bool data_fine(TMask_field& f, KEY k)
annoes = f.mask().get_int(F_ANNOESE);
data = f.mask().get (F_DATAFINE);
data_ini = f.mask().get (F_DATAINI);
a()->_anno_esercizio = annoes;
a()._anno_esercizio = annoes;
if (k == K_ENTER)
{
if (annoes != 0)
{
a()->_anni_es.aggiungi_anno(annoes, in, fin);
a()->_data_ini_ese = in;
a()->_data_fine_ese = fin;
a()._anni_es.aggiungi_anno(annoes, in, fin);
a()._data_ini_ese = in;
a()._data_fine_ese = fin;
if (data == botime)
a()->_datafine = fin;
a()._datafine = fin;
else
if (data < in || data > fin)
{
@ -849,7 +850,7 @@ bool data_fine(TMask_field& f, KEY k)
return FALSE;
}
else
a()->_datafine = data;
a()._datafine = data;
}
else
if (annoes == 0)
@ -861,16 +862,16 @@ bool data_fine(TMask_field& f, KEY k)
}
date2esc(data_ini);
TString data3 = a()->_inizioEs.string();
TString data4 = a()->_fineEs.string();
TString data3 = a()._inizioEs.string();
TString data4 = a()._fineEs.string();
if (data < a()->_inizioEs || data > a()->_fineEs)
if (data < a()._inizioEs || data > a()._fineEs)
{
f.error_box("La data non appartiene all' esercizio indicato");
return FALSE;
}
else
a()->_datafine = data;
a()._datafine = data;
}
if (data < data_ini)
@ -881,9 +882,9 @@ bool data_fine(TMask_field& f, KEY k)
}
TString datastr = a()->_datafine.string();
TString data1 = a()->_data_ini_ese.string();
TString data2 = a()->_data_fine_ese.string();
TString datastr = a()._datafine.string();
TString data1 = a()._data_ini_ese.string();
TString data2 = a()._data_fine_ese.string();
return TRUE;
}
@ -4893,7 +4894,7 @@ void CG1600_application::init_sort()
_sort->init();
}
void CG1600_application::user_create()
bool CG1600_application::user_create()
{
_nditte = new TLocalisamfile (LF_NDITTE);
_comuni = new TLocalisamfile (LF_COMUNI);
@ -4901,15 +4902,17 @@ void CG1600_application::user_create()
_anag = new TLocalisamfile (LF_ANAG);
_pconti = new TLocalisamfile (LF_PCON);
_clifo = new TLocalisamfile (LF_CLIFO);
_saldi = new TLocalisamfile (LF_SALDI);
_descr = new TParagraph_string ("",40);
_tabivd = new TTable (TAB_IVD);
_tabesc = new TTable (TAB_ESC);
_msk = new TMask("cg1600a");
return TRUE;
}
void CG1600_application::user_destroy()
bool CG1600_application::user_destroy()
{
delete _msk;
@ -4920,8 +4923,10 @@ void CG1600_application::user_destroy()
delete _unloc;
delete _anag;
delete _pconti;
delete _clifo;
delete _clifo;
delete _saldi;
delete _descr;
return TRUE;
}
int cg1600 (int argc, char* argv[])

View File

@ -71,7 +71,7 @@ END
LIST F_TIPOSTAMPA1 23
BEGIN
PROMPT 4 7 "Tipo stampa1 "
PROMPT 4 7 "Tipo stampa "
ITEM "1|Per data "
MESSAGE HIDE,F_DATALIM
MESSAGE RESET,F_DATALIM
@ -86,7 +86,7 @@ END
DATE F_DATASTAMPA
BEGIN
PROMPT 4 4 "Data stampa "
PROMPT 4 8 "Data stampa "
FLAGS "A"
END

View File

@ -36,8 +36,8 @@ protected:
virtual bool set_print(int);
public:
void user_create() ;
void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
void get_dati_ditta();
void setta_righe_descr(TParagraph_string*,enum descr);
int stampa_intestazione_ditta();
@ -274,7 +274,7 @@ bool CG1700_application::set_print(int)
}
void CG1700_application::user_create()
bool CG1700_application::user_create()
{
_msk = new TMask("cg1700a");
_rel = new TRelation (LF_CAUSALI);
@ -293,9 +293,10 @@ void CG1700_application::user_create()
_descr_causale = new TParagraph_string ("",23);
add_file(LF_CAUSALI);
add_file(LF_RCAUSALI,LF_CAUSALI);
return TRUE;
}
void CG1700_application::user_destroy()
bool CG1700_application::user_destroy()
{
delete _msk;
delete _cur;
@ -307,6 +308,7 @@ void CG1700_application::user_destroy()
delete _anag;
delete _descr_conto;
delete _descr_causale;
return TRUE;
}
int cg1700(int argc, char* argv[])

View File

@ -119,8 +119,8 @@ protected:
public:
void user_create() ;
void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
bool segnala_errori_primariga();
bool segnala_errori_ogniriga();
bool segnala_errori_iva();
@ -139,6 +139,9 @@ public:
virtual ~CG3100_application() {}
};
HIDDEN inline CG3100_application & app()
{ return (CG3100_application&)main_app();}
HIDDEN int date2esc(const TDate& d, int* prevesc)
{
if (prevesc) *prevesc = 0;
@ -207,17 +210,16 @@ bool annoes(TMask_field& f, KEY k)
bool data_inizio(TMask_field& f, KEY k)
{
CG3100_application * app = (CG3100_application*)MainApp();
if (k == K_ENTER)
{
int decidi;
int anno = f.mask().get_int (F_ANNO);
TDate data = f.mask().get(F_DATAINI);
if (app->_masc == "cg3100a")
if (app()._masc == "cg3100a")
decidi = f.mask().get_int (F_DECIDI);
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
if ( anno != 0 && ( (app()._masc == "cg3100b") ||
((app()._masc == "cg3100a" ) && (decidi == 2)) ) )
{
if (!data.ok()) //se la data e' vuota
f.mask().field(F_DATAINI).set(InizioEsercizio(anno));
@ -234,7 +236,6 @@ else
bool data_fine(TMask_field& f, KEY k)
{
CG3100_application * app = (CG3100_application*)MainApp();
if (k == K_ENTER)
{
@ -242,18 +243,18 @@ bool data_fine(TMask_field& f, KEY k)
int anno = f.mask().get_int (F_ANNO);
TDate dataini = f.mask().get(F_DATAINI);
TDate datafin = f.mask().get(F_DATAFIN);
if (app->_masc == "cg3100a")
if (app()._masc == "cg3100a")
decidi = f.mask().get_int (F_DECIDI);
if ( (app->_masc == "cg3100b") ||
((app->_masc == "cg3100a" ) && (decidi == 2)) )
if ( (app()._masc == "cg3100b") ||
((app()._masc == "cg3100a" ) && (decidi == 2)) )
if ( dataini.ok() && datafin.ok() )
if (dataini > datafin)
{
f.error_box("La data iniziale non deve essere superiore alla data finale");
return FALSE;
}
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
if ( anno != 0 && ( (app()._masc == "cg3100b") ||
((app()._masc == "cg3100a" ) && (decidi == 2)) ) )
{
TDate fine = FineEsercizio(anno + 1);
if (fine == botime)
@ -510,7 +511,6 @@ const int CodiceRegistro (const char* cod, int anno)
bool filter_func_fatture (const TRelation * rel)
{
CG3100_application * app = (CG3100_application*)MainApp();
int tipo_reg;
int ann_reg;
TString cod_reg;
@ -522,21 +522,21 @@ bool filter_func_fatture (const TRelation * rel)
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
from.zero();
to.zero();
if (app->_annoes != 0) //anno esercizio specificato nella maschera
if (app()._annoes != 0) //anno esercizio specificato nella maschera
{
from.put(MOV_ANNOES, app->_annoes);
to.put(MOV_ANNOES, app->_annoes);
from.put(MOV_ANNOES, app()._annoes);
to.put(MOV_ANNOES, app()._annoes);
}
if (app->_data_ini.ok())
from.put(MOV_DATAREG, app->_data_ini);
from.put(MOV_TIPO, app->_tipo_ini);
if (app->_codice_ini != 0)
from.put(MOV_CODCF, app->_codice_ini);
if (app->_data_fin.ok())
to.put(MOV_DATAREG, app->_data_fin);
to.put(MOV_TIPO, app->_tipo_fin);
if (app->_codice_fin != 0)
to.put(MOV_CODCF, app->_codice_fin);
if (app()._data_ini.ok())
from.put(MOV_DATAREG, app()._data_ini);
from.put(MOV_TIPO, app()._tipo_ini);
if (app()._codice_ini != 0)
from.put(MOV_CODCF, app()._codice_ini);
if (app()._data_fin.ok())
to.put(MOV_DATAREG, app()._data_fin);
to.put(MOV_TIPO, app()._tipo_fin);
if (app()._codice_fin != 0)
to.put(MOV_CODCF, app()._codice_fin);
if (((mov->curr() >= from) && (mov->curr() <= to)) &&
((tipo_reg == 1) || (tipo_reg == 2)))
@ -547,28 +547,27 @@ bool filter_func_fatture (const TRelation * rel)
bool filter_func (const TRelation * rel)
{
CG3100_application * app = (CG3100_application*)MainApp();
int tipo_reg, ann_reg;
TString cod_reg, causale;
TLocalisamfile* mov = &(rel->lfile(LF_MOV));
TRectype from (mov->curr());
TRectype to (mov->curr());
switch (app->_scelta_stampa)
switch (app()._scelta_stampa)
{
case 0:
ann_reg = mov->get_int(MOV_ANNOIVA);
causale = mov->get (MOV_CODCAUS);
from.zero();
to.zero();
if ( (app->_decidi == 2) && (app->_annoes != 0) )
if ( (app()._decidi == 2) && (app()._annoes != 0) )
{
from.put(MOV_ANNOES, app->_annoes);
to.put(MOV_ANNOES, app->_annoes);
from.put(MOV_ANNOES, app()._annoes);
to.put(MOV_ANNOES, app()._annoes);
}
from.put(MOV_CODCAUS, app->_causale_ini);
to.put(MOV_CODCAUS, app->_causale_fin);
from.put(MOV_REG, app->_registro_ini);
to.put(MOV_REG, app->_registro_fin);
from.put(MOV_CODCAUS, app()._causale_ini);
to.put(MOV_CODCAUS, app()._causale_fin);
from.put(MOV_REG, app()._registro_ini);
to.put(MOV_REG, app()._registro_fin);
if ((mov->curr() >= from) && (mov->curr() <= to))
return TRUE;
break;
@ -579,13 +578,13 @@ bool filter_func (const TRelation * rel)
causale = mov->get (MOV_CODCAUS);
from.zero();
to.zero();
if ( (app->_decidi == 2) && (app->_annoes != 0) )
if ( (app()._decidi == 2) && (app()._annoes != 0) )
{
from.put(MOV_ANNOES, app->_annoes);
to.put(MOV_ANNOES, app->_annoes);
from.put(MOV_ANNOES, app()._annoes);
to.put(MOV_ANNOES, app()._annoes);
}
from.put(MOV_CODCAUS, app->_causale_ini);
to.put(MOV_CODCAUS, app->_causale_fin);
from.put(MOV_CODCAUS, app()._causale_ini);
to.put(MOV_CODCAUS, app()._causale_fin);
if (((mov->curr() >= from) && (mov->curr() <= to)) &&
((tipo_reg != 1) && (tipo_reg != 2)))
@ -1601,7 +1600,7 @@ else _err.set(4);
clifo.zero();
clifo.put(CLI_CODCF, calleg);
clifo.put(CLI_TIPOCF,_tipo);
if (clifo.read == NOERR)
if (clifo.read() == NOERR)
{
bool sospall = clifo.get_bool(CLI_SOSPESO);
long codall = clifo.get_long(CLI_CODALLEG);
@ -2121,7 +2120,7 @@ return TRUE;
}
void CG3100_application::user_create()
bool CG3100_application::user_create()
{
_relmov1 = new TRelation (LF_MOV);
_relmov2 = new TRelation (LF_MOV);
@ -2156,9 +2155,10 @@ void CG3100_application::user_create()
_tabtpd = new TTable(TAB_TPD);
_tabreg = new TTable("REG");
_tabes = new TTable("ESC");
return TRUE;
}
void CG3100_application::user_destroy() // releasev e arrmask
bool CG3100_application::user_destroy() // releasev e arrmask
{
//delete _msk;
delete _relmov;
@ -2172,7 +2172,7 @@ void CG3100_application::user_destroy() // releasev e arrmask
delete _tabtpd;
delete _rmoviva;
delete _saldi;
return TRUE;
}
void CG3100_application::init_print(const TMask& msk)

View File

@ -90,20 +90,20 @@ END
DATE F_DATAINI
BEGIN
PROMPT 19 11 "Stampa mov. dalla data "
PROMPT 16 11 "Stampa mov. dalla data "
//HELP "Se non indicato nessun valore viene effettuata una stampa completa in ordine di data"
GROUP 3
END
DATE F_DATAFIN
BEGIN
PROMPT 55 11 "alla data "
PROMPT 52 11 "alla data "
GROUP 3
END
NUMBER F_NUMEROINI 7
BEGIN
PROMPT 19 12 "Stampa mov. dal numero "
PROMPT 16 12 "Stampa mov. dal numero "
USE LF_MOV KEY 1
INPUT NUMREG F_NUMEROINI
DISPLAY "Numero@6" NUMREG
@ -119,7 +119,7 @@ END
NUMBER F_NUMEROFIN 7
BEGIN
PROMPT 55 12 "al numero "
PROMPT 52 12 "al numero "
COPY USE F_NUMEROINI
INPUT NUMREG F_NUMEROFIN
COPY DISPLAY F_NUMEROINI

View File

@ -81,8 +81,8 @@ class CG3200_application : public TPrintapp
TString _dataregrmovstring,_importo_str,_saldo_movimenti_str,_saldo_progressivi_str;
protected:
virtual void user_create() ;
virtual void user_destroy();
virtual bool user_create() ;
virtual bool user_destroy();
virtual bool set_print(int m);
virtual bool preprocess_print(int file, int counter);
@ -1901,7 +1901,7 @@ const char* CG3200_application::descrizione_conto()
return tmp;
}
void CG3200_application::user_create()
bool CG3200_application::user_create()
{
TToken_string exp;
@ -1934,9 +1934,10 @@ void CG3200_application::user_create()
_msk->set_handler(F_SOTTOCFINE_FORN, sottoc_handler_fine);
_inizio_stampa = TRUE;
return TRUE;
}
void CG3200_application::user_destroy()
bool CG3200_application::user_destroy()
{
delete _msk;
delete _rel;
@ -1950,6 +1951,7 @@ void CG3200_application::user_destroy()
delete _tabtpd;
delete _tabreg;
delete _tabesc;
return TRUE;
}

View File

@ -87,8 +87,8 @@ public:
int riga (int i) const { return _frm->riga(i); }
const char * formato (int i) const { return _frm->formato(i); }
virtual void user_create () ;
virtual void user_destroy () ;
virtual bool user_create () ;
virtual bool user_destroy () ;
virtual bool set_print (int);
bool set_impostazione();
@ -257,7 +257,7 @@ void CG3300_application::init_sort()
_sort->init();
}
void CG3300_application::user_create()
bool CG3300_application::user_create()
{
_nditte = new TLocalisamfile (LF_NDITTE);
_alleg = new TLocalisamfile (LF_ALLEG);
@ -273,9 +273,10 @@ void CG3300_application::user_create()
_cur_null = add_cursor (NULL);
init_sort();
return TRUE;
}
void CG3300_application::user_destroy()
bool CG3300_application::user_destroy()
{
delete _alleg;
delete _clifo;
@ -287,6 +288,7 @@ void CG3300_application::user_destroy()
delete _recb;
delete _frm;
delete _t;
return TRUE;
}
bool CG3300_application::set_ricalcola()

View File

@ -99,8 +99,8 @@ public:
virtual bool preprocess_print(int, int);
virtual print_action postprocess_print(int, int);
virtual void postclose_print();
virtual void user_create();
virtual void user_destroy();
virtual bool user_create();
virtual bool user_destroy();
virtual void set_page (int, int);
void set_rows (int, int);
void set_page_132(int, int);
@ -251,7 +251,7 @@ void CG3400_application::get_dati_ditta ()
}
}
void CG3400_application::user_create()
bool CG3400_application::user_create()
{
_ae = 0;
_tabreg = new TTable ("REG");
@ -285,9 +285,10 @@ void CG3400_application::user_create()
add_file (LF_MOV);
add_file (LF_RMOV);
add_file (LF_RMOVIVA);
return TRUE;
}
void CG3400_application::user_destroy()
bool CG3400_application::user_destroy()
{
delete _rel;
delete _cur;
@ -303,6 +304,7 @@ void CG3400_application::user_destroy()
delete _descr_causale;
delete _nditte;
delete _anag;
return TRUE;
}
void CG3400_application::aggiorna_mov()

View File

@ -40,8 +40,8 @@ class CG3500_application : public TPrintapp
public:
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
void user_create() ;
void user_destroy();
bool user_create() ;
bool user_destroy();
bool set_print(int);
virtual bool preprocess_print(int,int);
@ -751,7 +751,7 @@ TDate CG3500_application::UltimaData(int g, int c, long s)
return uldata;
}
void CG3500_application::user_create()
bool CG3500_application::user_create()
{
_clifo = new TLocalisamfile(LF_CLIFO);
_com = new TLocalisamfile(LF_COMUNI);
@ -760,9 +760,10 @@ void CG3500_application::user_create()
_nditte = new TLocalisamfile(LF_NDITTE);
_anag = new TLocalisamfile(LF_ANAG);
_tmp_saldi = new TIsamtempfile (LF_SALDI);
return TRUE;
}
void CG3500_application::user_destroy()
bool CG3500_application::user_destroy()
{
delete _com;
delete _pcn;
@ -771,6 +772,7 @@ void CG3500_application::user_destroy()
delete _nditte;
delete _anag;
delete _tmp_saldi;
return TRUE;
}
bool CG3500_application::set_print(int)