2004-11-29 09:52:49 +00:00
|
|
|
#ifndef __CALIB01_H
|
|
|
|
#define __CALIB01_H
|
|
|
|
|
|
|
|
#ifndef __AUTOMASK_H
|
|
|
|
#include <automask.h>
|
|
|
|
#endif
|
|
|
|
|
2005-01-17 15:26:07 +00:00
|
|
|
#ifndef __MULTIREC_H
|
|
|
|
#include <multirec.h>
|
|
|
|
#endif
|
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
#ifndef __RELAPP_H
|
|
|
|
#include <relapp.h>
|
|
|
|
#endif
|
|
|
|
|
2005-05-17 15:38:08 +00:00
|
|
|
#ifndef __CGLIB03_H
|
2005-06-27 16:35:27 +00:00
|
|
|
class TBill;
|
2005-05-17 15:38:08 +00:00
|
|
|
#endif
|
|
|
|
|
2005-09-16 14:52:59 +00:00
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TConfig_anal
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2005-09-19 10:16:43 +00:00
|
|
|
TConfig& ca_config();
|
2005-09-16 14:52:59 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TConfig_anal
|
|
|
|
///////////////////////////////////////////////////////////
|
2005-05-17 15:38:08 +00:00
|
|
|
|
2005-01-14 15:14:34 +00:00
|
|
|
class TMultilevel_code_info : public TObject
|
2004-11-29 09:52:49 +00:00
|
|
|
{
|
2005-03-08 15:55:27 +00:00
|
|
|
int _logicnum; // Logic number of main file
|
|
|
|
TString_array _prompt; // Prompts of mask fields
|
|
|
|
TString_array _picture; // Pictures of mask fields
|
|
|
|
TArray _key1_fields; // TFieldrefs of key 1 mask fields
|
|
|
|
TArray _key2_fields; // TFieldrefs of key 2 mask fields
|
|
|
|
int _parentnum; // Logic number of parent file (LF_FASI only)
|
2005-09-19 10:16:43 +00:00
|
|
|
TString8 _editor; // Riga di comando del programma gestore
|
2004-12-15 13:55:45 +00:00
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
protected:
|
2005-01-14 15:14:34 +00:00
|
|
|
bool get_cfg_vars(TString& key, TString& des) const;
|
|
|
|
const char* get_key_fieldname(int k = 1) const;
|
|
|
|
void add_fieldref(int k, int from, int to);
|
|
|
|
|
|
|
|
public:
|
|
|
|
int levels() const;
|
|
|
|
int len(int level) const;
|
2005-07-07 17:05:02 +00:00
|
|
|
int total_len(int level) const;
|
2005-01-14 15:14:34 +00:00
|
|
|
const TString& picture(int level) const;
|
2005-02-02 10:02:36 +00:00
|
|
|
bool is_numeric_picture(int level) const;
|
2005-04-01 11:01:55 +00:00
|
|
|
bool is_required(int level) const;
|
2005-01-14 15:14:34 +00:00
|
|
|
const TString& prompt(int level) const;
|
|
|
|
const TFieldref& fieldref(int level, int key = 1) const;
|
2005-09-19 13:13:47 +00:00
|
|
|
int logic() const { return _logicnum; }
|
2005-03-08 15:55:27 +00:00
|
|
|
int parent() const { return _parentnum; }
|
2005-09-19 10:16:43 +00:00
|
|
|
const TString& editor() const { return _editor; }
|
2005-10-10 11:26:19 +00:00
|
|
|
int pack(TString& code) const; // Toglie i pipe
|
|
|
|
int unpack(TString& code) const; // Aggiunge i pipe
|
2005-01-14 15:14:34 +00:00
|
|
|
|
|
|
|
TMultilevel_code_info(int logicnum);
|
|
|
|
virtual ~TMultilevel_code_info() { }
|
|
|
|
};
|
|
|
|
|
2005-02-02 10:02:36 +00:00
|
|
|
const TMultilevel_code_info& ca_multilevel_code_info(int logicnum);
|
2005-10-10 11:26:19 +00:00
|
|
|
const TMultilevel_code_info* ca_multilevel_code_info_by_index(int level);
|
2005-02-02 10:02:36 +00:00
|
|
|
bool ca_test_multilevel_field(TEdit_field& fld, int level);
|
2005-04-20 14:48:20 +00:00
|
|
|
int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y, short key_id, short des_id,
|
2006-02-02 01:51:04 +00:00
|
|
|
unsigned int mode = 0x0, const char* fieldname = NULL, int from = 0);
|
2005-01-14 15:14:34 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TSimple_anal_msk
|
|
|
|
///////////////////////////////////////////////////////////
|
2004-11-29 09:52:49 +00:00
|
|
|
|
2005-01-14 15:14:34 +00:00
|
|
|
class TSimple_anal_msk : public TAutomask
|
|
|
|
{
|
2004-11-29 09:52:49 +00:00
|
|
|
protected:
|
2005-01-14 15:14:34 +00:00
|
|
|
bool test_key_field(short id);
|
2004-11-29 09:52:49 +00:00
|
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
2004-12-15 13:55:45 +00:00
|
|
|
virtual void read(const char* msk);
|
2005-01-14 15:14:34 +00:00
|
|
|
|
|
|
|
void append_select_clause(ostream& out, int level) const;
|
|
|
|
void create_key_browse(TEdit_field& kfld, int level);
|
|
|
|
void create_des_browse(TEdit_field& kfld, int level);
|
2004-12-15 13:55:45 +00:00
|
|
|
virtual int create_key_fields();
|
2005-01-14 15:14:34 +00:00
|
|
|
|
2004-12-01 14:57:03 +00:00
|
|
|
virtual short create_tree_field();
|
2004-12-01 10:56:41 +00:00
|
|
|
int compute_offset() const;
|
2005-01-14 15:14:34 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
TSimple_anal_msk() { }
|
2004-11-29 09:52:49 +00:00
|
|
|
|
|
|
|
public:
|
2004-12-15 13:55:45 +00:00
|
|
|
void update_tree_field();
|
|
|
|
|
|
|
|
const TFieldref& fieldref(int n, int key = 1) const;
|
|
|
|
int fieldrefs(int key = 1) const;
|
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
virtual int get_logicnum() const pure;
|
2004-12-20 10:26:43 +00:00
|
|
|
virtual short get_field_id(int n, int key = 1) const;
|
2004-12-15 13:55:45 +00:00
|
|
|
|
|
|
|
virtual const TToken_string& get_key_value(const TRectype& rec, int k = 1) const;
|
|
|
|
virtual const TToken_string& get_key_value(int k = 1) const;
|
2004-11-29 09:52:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_app
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TAnal_app : public TRelation_application
|
|
|
|
{
|
|
|
|
TRelation* _rel;
|
2005-01-14 15:14:34 +00:00
|
|
|
TSimple_anal_msk* _msk;
|
2004-11-29 09:52:49 +00:00
|
|
|
|
2005-03-02 15:28:14 +00:00
|
|
|
virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
|
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
protected:
|
|
|
|
virtual TMask* get_mask(int) { return _msk; }
|
|
|
|
virtual TRelation* get_relation() const { return _rel; }
|
|
|
|
virtual bool user_create();
|
|
|
|
virtual bool user_destroy();
|
2004-12-15 13:55:45 +00:00
|
|
|
virtual int write(const TMask& m);
|
|
|
|
virtual int rewrite(const TMask& m);
|
2005-04-20 22:59:40 +00:00
|
|
|
void init_key_fields(TSimple_anal_msk & m) const;
|
|
|
|
virtual void init_query_mode(TMask& mask);
|
|
|
|
virtual void init_modify_mode(TMask& mask);
|
|
|
|
virtual void init_insert_mode(TMask& mask);
|
2004-11-29 09:52:49 +00:00
|
|
|
|
|
|
|
protected:
|
2005-01-14 15:14:34 +00:00
|
|
|
virtual TSimple_anal_msk* create_mask() const pure;
|
2004-11-29 09:52:49 +00:00
|
|
|
virtual TRelation* create_relation() const;
|
|
|
|
};
|
|
|
|
|
2005-01-17 15:26:07 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_mov
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TAnal_mov : public TMultiple_rectype
|
|
|
|
{
|
2005-02-02 16:28:42 +00:00
|
|
|
TAssoc_array _saldi;
|
|
|
|
|
|
|
|
protected:
|
2008-04-28 09:37:19 +00:00
|
|
|
void saldo_set_reset(const TRectype& row, bool reset);
|
2005-02-02 16:28:42 +00:00
|
|
|
void load_saldi(bool reset);
|
2005-04-23 22:14:29 +00:00
|
|
|
void kill_saldi() { _saldi.destroy(); }
|
2005-02-02 16:28:42 +00:00
|
|
|
void update_saldi(bool kill);
|
2008-04-28 09:37:19 +00:00
|
|
|
bool save_saldi(const int anno = 0);
|
2005-06-27 16:35:27 +00:00
|
|
|
void update_datacomp() const;
|
2005-02-02 16:28:42 +00:00
|
|
|
|
2005-01-17 15:26:07 +00:00
|
|
|
public:
|
2005-02-02 16:28:42 +00:00
|
|
|
virtual int readat(TBaseisamfile& f, TRecnotype nrec, word lockop);
|
|
|
|
virtual int read(TBaseisamfile& f, word op, word lockop);
|
|
|
|
virtual int write(TBaseisamfile& f) const;
|
|
|
|
virtual int rewrite(TBaseisamfile& f) const;
|
|
|
|
virtual int remove(TBaseisamfile& f) const;
|
2005-11-25 23:08:41 +00:00
|
|
|
virtual void zero(char c = '\0');
|
2005-01-17 15:26:07 +00:00
|
|
|
|
2005-02-02 16:28:42 +00:00
|
|
|
public:
|
|
|
|
int read(long numreg, word lockop = _nolock); // Funzione read di comodo
|
2008-09-01 15:36:24 +00:00
|
|
|
void update_totdoc();
|
2005-01-17 15:26:07 +00:00
|
|
|
TAnal_mov(long numreg = 0);
|
2005-12-20 12:45:01 +00:00
|
|
|
TAnal_mov(const TRectype& rec); //accetta LF_MOVANA,LF_RMOVANA,LF_MOV
|
2005-01-17 15:26:07 +00:00
|
|
|
};
|
|
|
|
|
2005-03-16 12:12:22 +00:00
|
|
|
///////////////////////////////////////////////////////////
|
2007-06-21 14:59:20 +00:00
|
|
|
// TAnal_ripartizioni_batch (ahi!)
|
2005-03-16 12:12:22 +00:00
|
|
|
///////////////////////////////////////////////////////////
|
2008-09-01 15:36:24 +00:00
|
|
|
class TAnal_bill;
|
2005-03-16 12:12:22 +00:00
|
|
|
|
2007-06-21 14:59:20 +00:00
|
|
|
class TAnal_ripartizioni_batch : public TRecord_array
|
2005-03-16 12:12:22 +00:00
|
|
|
{
|
2007-06-21 14:59:20 +00:00
|
|
|
TRectype _rip;
|
2008-04-15 14:29:54 +00:00
|
|
|
private:
|
2008-09-01 15:36:24 +00:00
|
|
|
int read_rip_3(TLocalisamfile& rip, const char tiporip, const int gr, const int co, const long sot,
|
|
|
|
const int annoes, const int indbil, const int classe_mov) const;
|
2008-05-13 13:22:22 +00:00
|
|
|
int read_rip_4(TLocalisamfile& rip, const char* codcosto, const char* commessa, const char* fase,
|
2008-04-15 14:29:54 +00:00
|
|
|
const int annoes, const int indbil, const int classe_mov) const;
|
2005-03-16 12:12:22 +00:00
|
|
|
public:
|
2007-06-21 14:59:20 +00:00
|
|
|
const TRectype& head() const { return _rip; }
|
|
|
|
int indbil() const;
|
2008-09-01 15:36:24 +00:00
|
|
|
char tiporip() const;
|
|
|
|
int read (const char tiporip, const char* codice);
|
2008-05-13 13:22:22 +00:00
|
|
|
int read (const char* codcosto, const char* commessa, const char* fase, const int annoes, const int indbil, const int classe_mov);
|
2008-09-01 15:36:24 +00:00
|
|
|
int read (const char tiporip, const int gr, const int co, const long sot, const int annoes, const int indbil, const int classe_mov);
|
|
|
|
|
2007-06-21 14:59:20 +00:00
|
|
|
TAnal_ripartizioni_batch();
|
2005-03-16 12:12:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TCache_ripartizioni
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TCache_ripartizioni : public TCache
|
|
|
|
{
|
2007-06-21 14:59:20 +00:00
|
|
|
int _codes;
|
2007-02-06 23:50:51 +00:00
|
|
|
TDate _dal, _al;
|
|
|
|
|
2005-03-16 12:12:22 +00:00
|
|
|
protected:
|
|
|
|
virtual TObject* key2obj(const char* key);
|
|
|
|
|
|
|
|
public:
|
2007-06-21 14:59:20 +00:00
|
|
|
void set_esercizio(const int codes);
|
2008-09-01 15:36:24 +00:00
|
|
|
//batch
|
2008-05-13 13:22:22 +00:00
|
|
|
const TAnal_ripartizioni_batch& righe(const char* costo, const char* commessa, const char* fase,
|
2008-04-15 14:29:54 +00:00
|
|
|
const int annoes, const int indbil, const char tipomov);
|
2008-09-01 15:36:24 +00:00
|
|
|
//pareggio
|
|
|
|
const TAnal_ripartizioni_batch& righe(const TBill& bill, const int annoes, const char tipomov);
|
|
|
|
//batch
|
|
|
|
const TAnal_ripartizioni_batch& righe(const TAnal_bill& bill, const int annoes, const int indbil, const char tipomov);
|
|
|
|
//interattive per conversione e contabilizzazione (usate da cacnv e da contabilizzazione analitica docs)
|
|
|
|
const TAnal_ripartizioni_batch& righe_interattive(const TBill& bill, const int annoes, const char tipomov = ' ');
|
|
|
|
|
|
|
|
TCache_ripartizioni();
|
2005-03-16 12:12:22 +00:00
|
|
|
};
|
|
|
|
|
2007-07-10 15:23:41 +00:00
|
|
|
// metodi di implosione movimenti ripartiti!! Serve nel ribaltamento movimenti, stampa rendiconto...
|
2008-06-27 11:12:19 +00:00
|
|
|
bool ca_implode_rows(const TRecord_array& input_rows, TRecord_array& compact_rows);
|
2007-07-10 15:23:41 +00:00
|
|
|
bool ca_ori_present(const TRectype& rec);
|
|
|
|
bool ca_can_merge_rows(const TRectype& compact_rec, const TRectype& rec);
|
|
|
|
void ca_taglia_campo(TRectype& src, const char* campo_src, TRectype& dst, const char* campo_dst);
|
|
|
|
void ca_copia_campo(const TRectype& src, const char* campo_src, TRectype& dst, const char* campo_dst);
|
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
#endif
|