Files correlati : Ricompilazione Demo : [ ] Commento :riporto gestione ripartizioni interattive per conversione git-svn-id: svn://10.65.10.50/trunk@17147 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			224 lines
		
	
	
		
			7.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			224 lines
		
	
	
		
			7.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #ifndef __CALIB01_H
 | |
| #define __CALIB01_H
 | |
| 
 | |
| #ifndef __AUTOMASK_H
 | |
| #include <automask.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __MULTIREC_H
 | |
| #include <multirec.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __RELAPP_H
 | |
| #include <relapp.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __CGLIB03_H
 | |
| class TBill;
 | |
| #endif
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| //  TConfig_anal
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| TConfig& ca_config();
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| //  TConfig_anal
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TMultilevel_code_info : public TObject
 | |
| {
 | |
|   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)
 | |
|   TString8 _editor;            // Riga di comando del programma gestore
 | |
| 
 | |
| protected:
 | |
|   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;
 | |
|   int total_len(int level) const;
 | |
|   const TString& picture(int level) const;
 | |
|   bool is_numeric_picture(int level) const;
 | |
|   bool is_required(int level) const;
 | |
|   const TString& prompt(int level) const;
 | |
|   const TFieldref& fieldref(int level, int key = 1) const;
 | |
| 	int logic() const { return _logicnum; }
 | |
|   int parent() const { return _parentnum; }
 | |
|   const TString& editor() const { return _editor; }
 | |
|   int pack(TString& code) const;    // Toglie i pipe
 | |
|   int unpack(TString& code) const;  // Aggiunge i pipe
 | |
| 
 | |
|   TMultilevel_code_info(int logicnum);
 | |
|   virtual ~TMultilevel_code_info() { }
 | |
| };
 | |
| 
 | |
| const TMultilevel_code_info& ca_multilevel_code_info(int logicnum);
 | |
| const TMultilevel_code_info* ca_multilevel_code_info_by_index(int level);
 | |
| bool ca_test_multilevel_field(TEdit_field& fld, int level);
 | |
| int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y, short key_id, short des_id, 
 | |
|                      unsigned int mode = 0x0, const char* fieldname = NULL, int from = 0);
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // TSimple_anal_msk
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TSimple_anal_msk : public TAutomask
 | |
| {
 | |
| protected:
 | |
|   bool test_key_field(short id);
 | |
|   virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
 | |
|   virtual void read(const char* msk);
 | |
|     
 | |
|   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);
 | |
|   virtual int create_key_fields();
 | |
| 
 | |
|   virtual short create_tree_field();
 | |
|   int compute_offset() const;
 | |
| 
 | |
| protected:
 | |
|   TSimple_anal_msk() { }
 | |
| 
 | |
| public:
 | |
|   void update_tree_field();
 | |
| 
 | |
|   const TFieldref& fieldref(int n, int key = 1) const;
 | |
|   int fieldrefs(int key = 1) const;
 | |
|   
 | |
|   virtual int get_logicnum() const pure;
 | |
|   virtual short get_field_id(int n, int key = 1) const;
 | |
|   
 | |
|   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;
 | |
| };
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // TAnal_app
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TAnal_app : public TRelation_application
 | |
| {
 | |
|   TRelation* _rel;
 | |
|   TSimple_anal_msk* _msk;
 | |
| 
 | |
|   virtual const char * extra_modules() const {return "cm";} //funziona anche con autorizzazione CM
 | |
| 
 | |
| protected:
 | |
|   virtual TMask* get_mask(int) { return _msk; }
 | |
|   virtual TRelation* get_relation() const { return _rel; }
 | |
|   virtual bool user_create();
 | |
|   virtual bool user_destroy();
 | |
|   virtual int write(const TMask& m);
 | |
|   virtual int rewrite(const TMask& m);
 | |
|   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);
 | |
| 
 | |
| protected:
 | |
|   virtual TSimple_anal_msk* create_mask() const pure;
 | |
|   virtual TRelation* create_relation() const;
 | |
| };
 | |
| 
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // TAnal_mov
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TAnal_mov : public TMultiple_rectype
 | |
| {
 | |
|   TAssoc_array _saldi;
 | |
| 
 | |
| protected:
 | |
|   void saldo_set_reset(const TRectype& row, bool reset);
 | |
|   void load_saldi(bool reset);
 | |
|   void kill_saldi() { _saldi.destroy(); }
 | |
|   void update_saldi(bool kill);
 | |
|   bool save_saldi(const int anno = 0);
 | |
|   void update_datacomp() const;
 | |
| 
 | |
| public:
 | |
|   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;
 | |
| 	virtual void zero(char c = '\0');
 | |
| 
 | |
| public:
 | |
|   int read(long numreg, word lockop = _nolock); // Funzione read di comodo
 | |
|   void update_totdoc();
 | |
|   TAnal_mov(long numreg = 0);
 | |
| 	TAnal_mov(const TRectype& rec);	//accetta LF_MOVANA,LF_RMOVANA,LF_MOV
 | |
| };
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| //  TAnal_ripartizioni_batch (ahi!)
 | |
| ///////////////////////////////////////////////////////////
 | |
| class TAnal_bill;
 | |
| 
 | |
| class TAnal_ripartizioni_batch : public TRecord_array
 | |
| {
 | |
|   TRectype _rip;
 | |
| private:
 | |
|   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;
 | |
|   int read_rip_4(TLocalisamfile& rip, const char* codcosto, const char* commessa, const char* fase,
 | |
|                  const int annoes, const int indbil, const int classe_mov) const;
 | |
| public:
 | |
|   const TRectype& head() const { return _rip; }
 | |
|   int indbil() const;
 | |
|   char tiporip() const;
 | |
|   int read (const char tiporip, const char* codice);
 | |
|   int read (const char* codcosto, const char* commessa, const char* fase, const int annoes, const int indbil, const int classe_mov);
 | |
|   int read (const char tiporip, const int gr, const int co, const long sot, const int annoes, const int indbil, const int classe_mov);
 | |
|   
 | |
|   TAnal_ripartizioni_batch();
 | |
| };
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| //  TCache_ripartizioni
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TCache_ripartizioni : public TCache
 | |
| {
 | |
|   int _codes;
 | |
| 	TDate _dal, _al;
 | |
| 
 | |
| protected:
 | |
|   virtual TObject* key2obj(const char* key);
 | |
| 
 | |
| public:
 | |
| 	void set_esercizio(const int codes);
 | |
|   //batch
 | |
|   const TAnal_ripartizioni_batch& righe(const char* costo, const char* commessa, const char* fase,
 | |
|                                         const int annoes, const int indbil, const char tipomov);
 | |
|   //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();
 | |
| };
 | |
| 
 | |
| // metodi di implosione movimenti ripartiti!! Serve nel ribaltamento movimenti, stampa rendiconto...
 | |
| bool ca_implode_rows(const TRecord_array& input_rows, TRecord_array& compact_rows);
 | |
| 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);
 | |
| 
 | |
| #endif
 |