Files correlati : tc2.exe Ricompilazione Demo : [ ] Commento : Invio a IPSOA git-svn-id: svn://10.65.10.50/branches/R_10_00@21404 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			193 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			193 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#include <automask.h>
 | 
						|
#include <applicat.h>
 | 
						|
#include <recarray.h>
 | 
						|
#include <relation.h>
 | 
						|
#include <reprint.h>
 | 
						|
#include <reputils.h>
 | 
						|
#include <textset.h>
 | 
						|
#include "../cg/cg2103.h"
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// TIP_mask
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
 | 
						|
class TIP_mask : public TAutomask
 | 
						|
{
 | 
						|
  clock_t _next_update;
 | 
						|
  bool _updating;
 | 
						|
 | 
						|
private:
 | 
						|
  bool apply_filter(const TRecordset& righe) const;
 | 
						|
  void serialize(bool bSave);
 | 
						|
 | 
						|
protected:
 | 
						|
  virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
 | 
						|
 | 
						|
public:
 | 
						|
  TIP_mask(const char * maskname);
 | 
						|
  ~TIP_mask();
 | 
						|
};
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// TCausali_cache
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
 | 
						|
class TCausali_cache : public TCache
 | 
						|
{
 | 
						|
protected:
 | 
						|
  virtual TObject* key2obj(const char* key);
 | 
						|
 | 
						|
public:
 | 
						|
  const TCausale& causale(const char* codice, int annoiva);
 | 
						|
};
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// TRiclassifica_cache
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
 | 
						|
class TIPRiclassifica_cache : public TCache
 | 
						|
{
 | 
						|
	TLocalisamfile _multirel;
 | 
						|
protected:
 | 
						|
  virtual TObject* key2obj(const char* key);
 | 
						|
public:
 | 
						|
	const char * sdecode(const char* tab, const TString& cod);
 | 
						|
	long decode(const char* tab, const TString& cod);
 | 
						|
	TIPRiclassifica_cache() : _multirel(LF_MULTIREL) { _multirel.setkey(2);}
 | 
						|
};
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// TIP_sender
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
const long TSbill2ricl(char & t, int gr, int co, long so);
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// TIP_sender
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
class TIP_textset : public TCSV_recordset
 | 
						|
{
 | 
						|
 | 
						|
	TAssoc_array _colnames;
 | 
						|
 | 
						|
protected:
 | 
						|
  void add_field(const char* name = "Filler", int len = 0, const char * tipo = "C");
 | 
						|
 | 
						|
public:
 | 
						|
  virtual bool destroy(TRecnotype r);
 | 
						|
  virtual bool set(const char* field, const TVariant& v);
 | 
						|
  void set(const char* field, const TString & str) { set(field, TVariant(str)); }
 | 
						|
  void set(const char* field, const int n)    { set(field, TVariant((long)n)); }
 | 
						|
  void set(const char* field, const char* s)  { set(field, TVariant(s)); }
 | 
						|
  void set(const char* field, const TDate& d) { set(field, TVariant(d)); }
 | 
						|
  void set(const char* field, const real& v)  { set(field, TVariant(v)); }
 | 
						|
	int find_column(const char * name);
 | 
						|
  
 | 
						|
	TIP_textset(const char* query = "") : TCSV_recordset(TString("CSV(\"\t\")\n") << query) {}
 | 
						|
};
 | 
						|
 | 
						|
class TIP_clienti_textset : public TIP_textset
 | 
						|
{
 | 
						|
	public:
 | 
						|
		TIP_clienti_textset(const char* query = "");
 | 
						|
};
 | 
						|
 | 
						|
class TIP_fornitori_textset : public TIP_textset
 | 
						|
{
 | 
						|
	public:
 | 
						|
		TIP_fornitori_textset(const char* query = "");
 | 
						|
};
 | 
						|
 | 
						|
class TIP_movimenti_textset : public TIP_textset
 | 
						|
{
 | 
						|
	public:
 | 
						|
		TIP_movimenti_textset(const char* query = "");
 | 
						|
};
 | 
						|
 | 
						|
class TIP_scadenze_textset : public TIP_textset
 | 
						|
{
 | 
						|
	public:
 | 
						|
		TIP_scadenze_textset(const char* query = "");
 | 
						|
};
 | 
						|
 | 
						|
class TIP_cespiti_textset : public TIP_textset
 | 
						|
{
 | 
						|
	public:
 | 
						|
		TIP_cespiti_textset(const char* query = "");
 | 
						|
};
 | 
						|
 | 
						|
class TIP_categorie_textset : public TIP_textset
 | 
						|
{
 | 
						|
	public:
 | 
						|
		TIP_categorie_textset(const char* query = "");
 | 
						|
};
 | 
						|
 | 
						|
class TIP_intra_textset : public TIP_textset
 | 
						|
{
 | 
						|
	public:
 | 
						|
		TIP_intra_textset(const char* query = "");
 | 
						|
};
 | 
						|
 | 
						|
class TIP_sender : public TSkeleton_application
 | 
						|
{
 | 
						|
	TIP_mask * _mask;
 | 
						|
	TAssoc_array _caus_regolarizzazione;
 | 
						|
	TIPRiclassifica_cache* _tabelle;
 | 
						|
	TCausali_cache * _causali;
 | 
						|
	TAssoc_array	 _riclassifica;
 | 
						|
  bool _errors_logged;
 | 
						|
  bool _errors;
 | 
						|
  TLog_report*	 _log;
 | 
						|
	TReport_book * _book;
 | 
						|
	TRecord_cache * _part;
 | 
						|
	long _ultscadid;
 | 
						|
 | 
						|
	bool test_swap(const TRecordset& mov);
 | 
						|
	bool mov_regolarizzazione(const TRecordset& mov);
 | 
						|
	bool mov_intra(const TRecordset& mov);
 | 
						|
	bool mov_reverse_charge(const TRecordset& mov);
 | 
						|
	const TString & scod2ricl(const char* tab, const TString& cod);
 | 
						|
	const TString & scod2ricl(const char* tab, const TVariant& cod);
 | 
						|
	const long cod2ricl(const char* tab, const TString& cod);
 | 
						|
  const long cod2ricl(const char* tab, const TVariant& cod);
 | 
						|
	const long bill2ricl(char t, int gr, int co, long so);
 | 
						|
 | 
						|
	const TString & pag2tipo(const TVariant & codpag);
 | 
						|
	const TString & row2cauriga(TISAM_recordset& rmov, const TCausale & caus);
 | 
						|
	void get_pref(const TVariant & pref, TVariant & pint, TVariant & pnaz);
 | 
						|
	const real ind2perc(const TVariant & tipodet);
 | 
						|
	void add_cli(TISAM_recordset & cli, TIP_clienti_textset & ipcli);
 | 
						|
	void add_forn(TISAM_recordset & forn, TIP_fornitori_textset & ipforn);
 | 
						|
	void add_mov_cg(TISAM_recordset & mov, TIP_movimenti_textset & ipmov, const TVariant & reg_regol, const TVariant & prot_regol, const char tipo = ' ');
 | 
						|
	void add_mov_iva(TISAM_recordset & mov, TIP_movimenti_textset & ipmov, const TVariant & reg_regol, const TVariant & prot_regol);
 | 
						|
	void add_mov(TISAM_recordset & mov, TIP_movimenti_textset & ipmov);
 | 
						|
	void add_scad(TISAM_recordset & mov, TIP_scadenze_textset & ipscad);
 | 
						|
	void add_intra(TISAM_recordset & mov, TIP_intra_textset & ipintra);
 | 
						|
	void transfer_cli(const char * path);
 | 
						|
	void transfer_forn(const char * path);
 | 
						|
	void transfer_mov(const char * path);
 | 
						|
	void transfer_scad(const char * path);
 | 
						|
	void transfer_cesp(const char * path);
 | 
						|
	void transfer_cat(const char * path);
 | 
						|
	void transfer_intra(const char * path);
 | 
						|
 | 
						|
protected:
 | 
						|
	virtual bool find_regolarizzazione(TRecordset& mov);
 | 
						|
	virtual TMask & get_mask();
 | 
						|
 | 
						|
public:
 | 
						|
	virtual bool multi_activity() const { return true; }
 | 
						|
	TAssoc_array & riclassifica() {return _riclassifica;}
 | 
						|
	
 | 
						|
	virtual void postprocess_movs(TRecordset & mov);
 | 
						|
	virtual void set_parameters();
 | 
						|
 | 
						|
// qui
 | 
						|
  void log(int sev, const char* msg);
 | 
						|
 | 
						|
	virtual bool create();
 | 
						|
  virtual void main_loop();
 | 
						|
	virtual bool destroy();
 | 
						|
 | 
						|
  TIP_sender() : _tabelle(NULL) {}
 | 
						|
};
 |