1997-11-17 15:08:54 +00:00
|
|
|
|
//AB2100.H: Classe principale e definizione di costanti
|
|
|
|
|
#ifndef _AB2100_H
|
|
|
|
|
|
|
|
|
|
#ifndef __APPLICAT_H
|
|
|
|
|
#include <applicat.h> //Definizione della classe TApplication
|
2003-04-14 15:45:48 +00:00
|
|
|
|
#endif
|
1997-11-17 15:08:54 +00:00
|
|
|
|
|
2003-04-14 15:45:48 +00:00
|
|
|
|
#ifndef __FILETEXT_H
|
|
|
|
|
#include <filetext.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
1997-11-17 15:08:54 +00:00
|
|
|
|
#ifndef __MASK_H
|
|
|
|
|
#include <mask.h> //Definizione della maschera
|
2003-04-14 15:45:48 +00:00
|
|
|
|
#endif
|
1997-11-17 15:08:54 +00:00
|
|
|
|
|
|
|
|
|
#define ID_NULLO 0
|
|
|
|
|
|
1998-01-28 10:10:50 +00:00
|
|
|
|
//Costanti di definizione dei tipi record
|
1997-11-17 15:08:54 +00:00
|
|
|
|
#define MOVIMENTO1 "MOVI1"
|
|
|
|
|
#define MOVIMENTO2 "MOVI2"
|
|
|
|
|
#define MOVIMENTO3 "MOVI3"
|
|
|
|
|
#define MOVIMENTO4 "MOVI4"
|
|
|
|
|
#define MOVIMENTO5 "MOVI5"
|
|
|
|
|
|
|
|
|
|
#define TIPO_TABELLA_PERIODI "TBBBD"
|
|
|
|
|
#define SIGLA_TABELLA_PERIODI "BB"
|
|
|
|
|
|
|
|
|
|
#define TIPO_SRELAZ "STABI"
|
|
|
|
|
#define TIPO_VOCI "ATAB2"
|
|
|
|
|
|
|
|
|
|
#define TIPO_VOCI "ATAB2"
|
|
|
|
|
|
|
|
|
|
//Costanti di posizionamento nel record_text
|
|
|
|
|
#define SIGLA_TAB_PER 1
|
|
|
|
|
|
|
|
|
|
//Costanti di posizionamento nel record_text dei MOVIMENTI e DETTAGLI
|
|
|
|
|
#define CODICE_DITTA_MOVDETT 1
|
|
|
|
|
#define ANNO_BILANCIO_MOVDETT 2
|
|
|
|
|
#define CODICE_PERIODO_MOVDETT 3
|
|
|
|
|
#define CODICE_TABELLA_MOVDETT 4
|
|
|
|
|
#define CONTO_COGE_MOVDETT 5
|
|
|
|
|
#define PROGRESSIVO_DETT_MOVDETT 6
|
|
|
|
|
#define NUMERO_REG_MOVDETT 8
|
|
|
|
|
#define NUMERO_RIGA_MOVDETT 9
|
|
|
|
|
#define SALDO_INIZIO_ANNO_MOVDETT 13
|
|
|
|
|
#define PROGRESSIVO_DARE_MOVDETT 14
|
|
|
|
|
#define PROGRESSIVO_AVERE_MOVDETT 15
|
|
|
|
|
#define RICLASSIFICAZIONE_DARE_MOVDETT 16
|
|
|
|
|
#define RICLASSIFICAZIONE_AVERE_MOVDETT 17
|
|
|
|
|
#define FLAG_DA_MOVDETT 17
|
|
|
|
|
#define IMPORTO_MOVDETT 19
|
|
|
|
|
#define FLAG_RICLASSIFICAZIONE_MOVDETT 21
|
|
|
|
|
#define SALDO_INIZIO_ANNO_SLD_MOVDETT 9
|
|
|
|
|
#define PROGRESSIVO_DARE_SLD_MOVDETT 10
|
|
|
|
|
#define PROGRESSIVO_AVERE_SLD_MOVDETT 11
|
|
|
|
|
#define RICLASSIFICAZIONE_DARE_SLD_MOVDETT 12
|
|
|
|
|
#define RICLASSIFICAZIONE_AVERE_SLD_MOVDETT 13
|
|
|
|
|
|
|
|
|
|
//Costanti di posizionamento nel record_text per VOCI
|
|
|
|
|
#define TIPO_VOCE_VOCI 6
|
|
|
|
|
#define NCA_VOCI 4
|
|
|
|
|
#define CODVC_VOCI 1
|
|
|
|
|
#define CODCOMP_ANA_VOCI 2
|
|
|
|
|
#define DESCR1_VOCI 5
|
|
|
|
|
#define DESCR2_VOCI 43
|
|
|
|
|
#define VOCI_INCIDENZA 41
|
|
|
|
|
|
|
|
|
|
//Costanti di posizionamento nel record_text per SOTTORELAZIONI
|
|
|
|
|
#define CODAN_SOTTOREL 1
|
|
|
|
|
#define CODVC_SOTTOREL 2
|
|
|
|
|
#define NCOMP_SOTTOREL 3
|
|
|
|
|
#define NSREL_SOTTOREL 5
|
|
|
|
|
|
1998-01-28 10:10:50 +00:00
|
|
|
|
//Costanti tipi di ricesione
|
|
|
|
|
#define RICEZIONE_INTERNA 1
|
|
|
|
|
#define RICEZIONE_AS400 2
|
1998-01-28 16:46:36 +00:00
|
|
|
|
#define RICEZIONE_USER_DEFINED 3
|
1998-01-28 10:10:50 +00:00
|
|
|
|
|
|
|
|
|
//Definizione dei flag
|
|
|
|
|
#define FLAG_COGE '1'
|
|
|
|
|
#define FLAG_DETT '2'
|
|
|
|
|
#define FLAG_MOVIMENTO '3' // cos<6F> i movs sono alla fine
|
|
|
|
|
#define FLAG_INDICE "I"
|
|
|
|
|
#define FLAG_SOTTOD "S"
|
|
|
|
|
#define FLAG_COMPOSTA "C"
|
|
|
|
|
#define FLAG_ANALISI "A"
|
|
|
|
|
#define FLAG_VOCI "V"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define FLAG_COGE_CG "CG"
|
|
|
|
|
#define FLAG_DETT_DT "DT"
|
|
|
|
|
#define FLAG_CLIENTE_CL "CL"
|
|
|
|
|
#define FLAG_FORNITORE_FO "FO"
|
|
|
|
|
#define FLAG_MOVIMENTO_MO "MO" // cos<6F> i movs sono alla fine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Definizioni di constanti per il record di testata
|
|
|
|
|
#define RECORD_TESTA "1"
|
|
|
|
|
#define ABILITATO "X"
|
|
|
|
|
#define AB_PIANO_CONTI 2
|
|
|
|
|
#define AB_PERIODI_BIL 3
|
|
|
|
|
#define AB_ANALISI 4
|
|
|
|
|
#define AB_SALDI 8
|
|
|
|
|
#define AB_DETT 9
|
|
|
|
|
#define AB_MOV 10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TAlbero_record : public TAssoc_array
|
|
|
|
|
{
|
|
|
|
|
static TToken_string wrk_string;
|
|
|
|
|
public:
|
|
|
|
|
void dept_first(TToken_string key, TRectype * padre, TRectype * prec, int &curr_id, TString_array & allkeys, TToken_string ** prog_key);
|
|
|
|
|
|
|
|
|
|
TToken_string& cerca_fratello (TToken_string &key, TString_array& allkeys, TToken_string ** next_key);
|
|
|
|
|
TToken_string& cerca_figlio (TToken_string &key, TString_array& allkeys, TToken_string ** next_key);
|
|
|
|
|
TAlbero_record() {}
|
|
|
|
|
virtual ~TAlbero_record(){}
|
|
|
|
|
};
|
|
|
|
|
|
1998-01-28 16:46:36 +00:00
|
|
|
|
class TFile_text_AS400: public TFile_text
|
|
|
|
|
{
|
|
|
|
|
TAssoc_array _last_id;
|
|
|
|
|
// static long _idcaradd;
|
|
|
|
|
long _idncomp;
|
2004-03-13 09:03:18 +00:00
|
|
|
|
TString16 _tipo_bilancio;
|
1998-01-28 16:46:36 +00:00
|
|
|
|
//long _idcoldich;
|
|
|
|
|
TString _codvc_prec;
|
1998-01-28 10:10:50 +00:00
|
|
|
|
|
1998-01-28 16:46:36 +00:00
|
|
|
|
inline const TString & get_tipo_bil() const {return _tipo_bilancio;}
|
|
|
|
|
protected:
|
|
|
|
|
// virtual void preformat_field(TRelation& rel,const TFieldref&field,const TRecord_text& rec,TString &str);
|
|
|
|
|
virtual void preformat_field(const TFieldref&field,TString &str,TRelation& rel,const TString &tipo_tr);
|
|
|
|
|
void cambia_anno(TString& str);
|
|
|
|
|
void cambia_data(TString& str);
|
|
|
|
|
virtual bool pre_writerel(TRelation& rel,const TRecord_text& rec);
|
|
|
|
|
void scrivi_temp_link(TRelation& rel,const TRecord_text& rec);
|
|
|
|
|
void aggiorna_rel_link(TLocalisamfile &relvoc);
|
|
|
|
|
public:
|
|
|
|
|
void set_tipo_bilancio(const TString & tipo_bil) {_tipo_bilancio = tipo_bil;}
|
1998-01-28 10:10:50 +00:00
|
|
|
|
|
1998-01-28 16:46:36 +00:00
|
|
|
|
TFile_text_AS400(const char* file_name, const char* set_config_name);
|
|
|
|
|
virtual ~TFile_text_AS400() {}
|
|
|
|
|
};
|
1997-11-17 15:08:54 +00:00
|
|
|
|
|
1998-01-28 16:46:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TObject_reception:public TObject
|
|
|
|
|
{
|
1998-01-28 10:10:50 +00:00
|
|
|
|
protected:
|
1998-01-28 16:46:36 +00:00
|
|
|
|
TFile_text* _trasfile; //File di testo da cui ricevere
|
|
|
|
|
public:
|
|
|
|
|
TFile_text * trans_file() {return _trasfile;}
|
|
|
|
|
virtual void ricevi(TMask &);
|
|
|
|
|
TObject_reception() {_trasfile = NULL;}
|
|
|
|
|
TObject_reception(const TFilename &percorso) ;
|
|
|
|
|
virtual ~TObject_reception() {}
|
1998-01-28 10:10:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
1998-01-28 16:46:36 +00:00
|
|
|
|
|
1998-01-28 10:10:50 +00:00
|
|
|
|
//Classe derivata per la ricezione
|
1998-01-28 16:46:36 +00:00
|
|
|
|
class TRicezione_AS400 : public TObject_reception
|
1998-01-28 10:10:50 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private:
|
1998-01-28 16:46:36 +00:00
|
|
|
|
void build_balancetree(int);
|
|
|
|
|
void build_ana_tree(long&, TRectype&, TRectype*, TRectype*, TAssoc_array&);
|
|
|
|
|
void build_relana(TString&, const TMask&, const TFilename&);
|
1998-01-28 10:10:50 +00:00
|
|
|
|
void naviga_array(TAlbero_record &a);
|
|
|
|
|
void scrivi_array(TAssoc_array &s_rec, int);
|
|
|
|
|
|
|
|
|
|
protected:
|
1998-01-28 16:46:36 +00:00
|
|
|
|
TFile_text_AS400 *trasfile() {return (TFile_text_AS400 *)_trasfile;}
|
|
|
|
|
virtual void leggi_temp_link(TRectype& cur_rec,TToken_string& k);
|
|
|
|
|
//Questa funzione <20> da usare solo in fase di debug
|
2003-04-14 15:45:48 +00:00
|
|
|
|
#ifdef DBG
|
|
|
|
|
void print_ana_tree(int & level, TRectype&,FILE * stream);
|
|
|
|
|
#endif
|
1998-01-28 10:10:50 +00:00
|
|
|
|
public:
|
1998-01-28 16:46:36 +00:00
|
|
|
|
virtual void ricevi(TMask &);
|
|
|
|
|
TRicezione_AS400(const TFilename &percorso);
|
1998-01-28 10:10:50 +00:00
|
|
|
|
virtual ~TRicezione_AS400() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
1998-01-28 16:46:36 +00:00
|
|
|
|
//Classe derivata per la ricezione
|
|
|
|
|
class TRicezione_userdef : public TObject_reception
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
//virtual void ricevi(TMask &);
|
|
|
|
|
TRicezione_userdef(const TString & config, const TFilename &percorso) ;
|
|
|
|
|
virtual ~TRicezione_userdef() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//classe derivata nella quale viene gestita la funzione di trasferimento
|
1998-01-30 16:32:36 +00:00
|
|
|
|
class TTrasfer: public TSkeleton_application
|
1998-01-28 16:46:36 +00:00
|
|
|
|
{
|
|
|
|
|
// private:
|
|
|
|
|
// TArray _files;
|
|
|
|
|
protected:
|
|
|
|
|
// TFile_text* _trasfile; //File di testo
|
1998-01-30 16:32:36 +00:00
|
|
|
|
// virtual bool menu(MENU_TAG) pure; //Gli dico che non <20> implementata in questa classe, ma obbligatoriamente in un'altra
|
|
|
|
|
virtual void main_loop() pure; //Gli dico che non <20> implementata in questa classe, ma obbligatoriamente in un'altra
|
1998-01-28 16:46:36 +00:00
|
|
|
|
//Controlla che il percorso e il file specificati esistono
|
|
|
|
|
static bool inseriscipercorso(TMask_field& f, KEY k);
|
|
|
|
|
public:
|
|
|
|
|
TTrasfer() {}
|
|
|
|
|
virtual ~TTrasfer() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TRicezione:public TTrasfer
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
TArray _files;
|
|
|
|
|
|
|
|
|
|
TObject_reception *_rice;
|
|
|
|
|
|
|
|
|
|
protected:
|
1998-01-30 16:32:36 +00:00
|
|
|
|
// virtual bool create();
|
|
|
|
|
// virtual bool destroy();
|
|
|
|
|
// virtual bool menu(MENU_TAG);
|
|
|
|
|
virtual void main_loop();
|
1998-01-28 16:46:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
//Seleziona da quale file prelevare le informazioni del tracciato record
|
|
|
|
|
// void set_config_name(TString&,TMask&);
|
|
|
|
|
TObject_reception *set_transfer(int tipo_ricezione ,const TFilename & percorso_temp, const TString & config_file_temp);
|
|
|
|
|
TObject_reception *transfer() {return _rice;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TFile_text * trans_file() {return _rice->trans_file();}
|
1998-01-30 16:32:36 +00:00
|
|
|
|
TRicezione() {_rice=NULL;}
|
1998-01-28 16:46:36 +00:00
|
|
|
|
virtual ~TRicezione() {}
|
|
|
|
|
};
|
|
|
|
|
|
1998-01-30 16:32:36 +00:00
|
|
|
|
class TObject_send:public TObject
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
TFile_text* _trasfile; //File di testo da cui ricevere
|
|
|
|
|
public:
|
|
|
|
|
TFile_text * trans_file() {return _trasfile;}
|
|
|
|
|
|
|
|
|
|
virtual void converti(int);
|
|
|
|
|
virtual void converti(int main_file,const char * tabname);
|
|
|
|
|
TObject_send() {_trasfile = NULL;}
|
|
|
|
|
TObject_send(const TFilename &percorso);
|
|
|
|
|
virtual ~TObject_send() { delete _trasfile;}
|
|
|
|
|
};
|
1998-01-28 16:46:36 +00:00
|
|
|
|
|
1998-01-28 10:10:50 +00:00
|
|
|
|
//Classe derivata per il trasferimento
|
1998-01-30 16:32:36 +00:00
|
|
|
|
class TInvio:public TTrasfer
|
1998-01-28 10:10:50 +00:00
|
|
|
|
{
|
1998-01-30 16:32:36 +00:00
|
|
|
|
TObject_send *_invio;
|
1998-01-28 10:10:50 +00:00
|
|
|
|
protected:
|
1998-01-30 16:32:36 +00:00
|
|
|
|
//virtual bool menu(MENU_TAG);
|
|
|
|
|
virtual void main_loop();
|
1998-01-28 10:10:50 +00:00
|
|
|
|
static bool inseriscipercorso(TMask_field& f, KEY k);
|
1998-01-30 16:32:36 +00:00
|
|
|
|
public:
|
|
|
|
|
TInvio() {}
|
|
|
|
|
virtual ~TInvio() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TInvio_AS400:public TObject_send
|
|
|
|
|
{
|
|
|
|
|
protected:
|
1998-01-28 10:10:50 +00:00
|
|
|
|
void trasferisci_albero(TRectype &,TRecord_text&, TAssoc_array&);
|
|
|
|
|
bool cerca_padre(TLocalisamfile &, TRectype &);
|
|
|
|
|
long my_num(TLocalisamfile&, TAssoc_array&);
|
|
|
|
|
bool mov_da_scrivere(TRectype &);
|
|
|
|
|
void formatta(TRecord_text&,TRectype&,int&);
|
1998-01-30 16:32:36 +00:00
|
|
|
|
|
1998-01-28 10:10:50 +00:00
|
|
|
|
public:
|
1998-01-30 16:32:36 +00:00
|
|
|
|
virtual void converti(int);
|
|
|
|
|
TInvio_AS400(const TFilename &percorso);
|
1998-01-28 16:46:36 +00:00
|
|
|
|
virtual ~TInvio_AS400() {}
|
1998-01-30 16:32:36 +00:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TInvio_user_defined:public TObject_send
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
// virtual void converti(int) {} //DA definire
|
|
|
|
|
TInvio_user_defined(const TString & config, const TFilename &percorso);
|
|
|
|
|
virtual ~TInvio_user_defined() {}
|
1997-11-17 15:08:54 +00:00
|
|
|
|
};
|
|
|
|
|
|
1998-01-30 16:32:36 +00:00
|
|
|
|
|
|
|
|
|
|
1997-12-15 11:12:32 +00:00
|
|
|
|
// **********************
|
|
|
|
|
// da spostare in ablib01
|
|
|
|
|
|
|
|
|
|
class TAdditional_car: public TRectype
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
virtual void put_str(const char* fieldname, const char* val);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
bool same_as(real id);
|
|
|
|
|
TAdditional_car();
|
|
|
|
|
virtual ~TAdditional_car() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************/
|
|
|
|
|
|
|
|
|
|
class TAdditional_cars: public TLocalisamfile
|
|
|
|
|
{
|
|
|
|
|
long _lastid; // usato in caso di lock
|
|
|
|
|
public:
|
|
|
|
|
long lastid();
|
|
|
|
|
TAdditional_car & current()
|
|
|
|
|
{return (TAdditional_car & )(TLocalisamfile::curr());}
|
|
|
|
|
virtual int write();
|
|
|
|
|
//int write();
|
|
|
|
|
TAdditional_cars(TFilelock lockmode=_manulock);
|
|
|
|
|
virtual ~TAdditional_cars() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TAdditional_col: public TRectype
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TAdditional_col();
|
|
|
|
|
virtual ~TAdditional_col() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TAdditional_cols: public TLocalisamfile
|
|
|
|
|
{
|
|
|
|
|
static long _lastid;
|
|
|
|
|
public:
|
|
|
|
|
//long lastid();
|
|
|
|
|
virtual int write();
|
|
|
|
|
TAdditional_cols();
|
|
|
|
|
virtual ~TAdditional_cols() {}
|
|
|
|
|
};
|
1997-11-17 15:08:54 +00:00
|
|
|
|
|
1998-01-28 10:10:50 +00:00
|
|
|
|
|
1997-11-17 15:08:54 +00:00
|
|
|
|
#endif //_AB2100_H
|
1997-12-15 11:12:32 +00:00
|
|
|
|
|