Ricompilazione Demo : [ ] Commento : Riportata la versione 3.1 patch 848 git-svn-id: svn://10.65.10.50/trunk@14993 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			205 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			205 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #ifndef __TP0100_H
 | |
| #define __TP0100_H
 | |
| 
 | |
| #ifndef __CONFIG_H
 | |
| #include <config.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __DICTION_H
 | |
| #include <diction.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __ISAM_H
 | |
| #include <isam.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __ODBCRECSET_H
 | |
| #include <odbcrset.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __PROGIND_H
 | |
| class TProgind;
 | |
| #endif
 | |
| 
 | |
| class TPack_log;
 | |
| class TCache_tp;
 | |
| 
 | |
| class TPack_transfer : public TObject
 | |
| {
 | |
|   TString _query_header;
 | |
|   TPack_log* _log;
 | |
|   TConfig _config;
 | |
|   
 | |
|   TRecordset* _recset;
 | |
|   bool _write_enabled;
 | |
|   TODBC_recordset* _outset;
 | |
|   TCache_tp* _tab;
 | |
| 
 | |
| protected:
 | |
|   const TString& build_insert_query(const char* table, const char* f, const char* v) const;
 | |
| 
 | |
|   TRecordset& create_recordset(const char* query);
 | |
|   long odbc_exec(const char* command);
 | |
| 
 | |
|   const TString& decode_value(const char* tab, const TString& field_value);
 | |
|   const TString& decode_field(const char* tab, const char* recset_field);
 | |
| 
 | |
|   TPack_transfer();
 | |
|   virtual bool trasferisci() pure;
 | |
| 
 | |
| public:
 | |
|   void init(const char* rh, const char* qh, TPack_log& log);
 | |
|   const TString& title() const;
 | |
|   TConfig& config() { return _config; }
 | |
|   const TString& query_header() const { return _query_header; }
 | |
| 
 | |
|   void log(const char* msg, int sev = 0) const;
 | |
|   bool log_error(const char* msg);
 | |
|   bool log_cancelled();
 | |
|   const TRecordset& recordset() const;
 | |
|   TRecordset& recordset();
 | |
| 
 | |
|   const TString& get_str(const char* campo) const;       // Get string from current recordset
 | |
|   const TString& get_real_str(const char* campo) const;  // Get eventually empty string from numeric field
 | |
|   long get_long(const char* campo) const; 
 | |
| 
 | |
|   bool write_enabled() const { return _write_enabled; }
 | |
|   
 | |
|   bool test_write(TLocalisamfile& file, bool re = false);
 | |
|   bool test_rewrite(TLocalisamfile& file) { return test_write(file, true); }
 | |
| 
 | |
|   virtual ~TPack_transfer();
 | |
| };
 | |
| 
 | |
| // Classe candidata alla libreria
 | |
| class TPack_iterator
 | |
| {
 | |
|   TPack_transfer* _pt;
 | |
|   TProgind* _pi;
 | |
|   TRecnotype _rec;
 | |
| 
 | |
| public:
 | |
|   bool ok() const;
 | |
|   bool cancelled() const;
 | |
|   TPack_iterator& operator=(TRecnotype n);
 | |
|   TPack_iterator& operator++();
 | |
|   operator int() const { return ok(); }
 | |
| 
 | |
|   TPack_iterator(TPack_transfer* pt);
 | |
|   ~TPack_iterator();
 | |
| };
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // Cache generica per il trasferimento DDT di Pack
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TCache_tp : public TCache
 | |
| {
 | |
|   TPack_transfer* _pt;
 | |
| 
 | |
| protected:
 | |
|   void log(const char* msg, int sev) const { _pt->log(msg, sev); }
 | |
|   bool test_write(TLocalisamfile& file) const { return _pt->test_write(file); }
 | |
|   const TRecordset& recordset() const { return _pt->recordset(); }
 | |
|   TConfig& config() const { return _pt->config(); }
 | |
|   const TString& query_header() const { return _pt->query_header(); }
 | |
| 
 | |
| public:
 | |
|   const TString& get_str(const char* campo) const { return _pt->get_str(campo); }
 | |
|   const TString& get_real_str(const char* campo) const { return _pt->get_real_str(campo); }
 | |
|   long get_long(const char* campo) const { return _pt->get_long(campo); }
 | |
|   virtual const TString& decode(const TToken_string& tokens) pure;
 | |
| 
 | |
|   TCache_tp(TPack_transfer* pt) : _pt(pt) {}
 | |
| };
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // Trasferimenti veri e propri
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TPack_conti : public TPack_transfer
 | |
| {
 | |
| public:
 | |
|   virtual bool trasferisci();
 | |
| };
 | |
| 
 | |
| class TPack_pag : public TPack_transfer
 | |
| {
 | |
| public:
 | |
|   virtual bool trasferisci();
 | |
| };
 | |
| 
 | |
| class TPack_clifo : public TPack_transfer
 | |
| {
 | |
|   TCache_tp* _agenti;
 | |
|   TCache_tp* _banche;
 | |
| 	bool _only_agenti;
 | |
| 
 | |
| protected:
 | |
|   int cancella_clifo(TLocalisamfile& clifo) const;
 | |
|   long get_next_key(const char tipocf) const;
 | |
|   void update_statusflag_codcontab(const TString& custsuppcode, const int statusflag, const TString& codcontab);
 | |
|   bool aggiorna_record(TLocalisamfile& file, const TString_array& lista_campi);
 | |
|   void aggiorna_banca();
 | |
|   void trasferisci_conai(TRectype& rec);
 | |
|   const TString& decode_agente(const long codforn);
 | |
| 	const TString& get_agente();
 | |
| 
 | |
| public:
 | |
|   virtual bool trasferisci();
 | |
|   TPack_clifo(bool only_agenti);
 | |
|   ~TPack_clifo();
 | |
| };
 | |
| 
 | |
| class TPack_indsped : public TPack_clifo
 | |
| {
 | |
| protected:
 | |
|   bool get_clifo(char& tipocf, long& codcf);
 | |
|   int get_next_key(const char tipocf, const long codcf) const;
 | |
| 
 | |
| public:
 | |
|   virtual bool trasferisci();
 | |
| 	TPack_indsped():TPack_clifo(false) {}
 | |
| };
 | |
| 
 | |
| class TCache_art;
 | |
| class TCache_umart;
 | |
| class TDocumento;
 | |
| 
 | |
| class TPack_ddt : public TPack_transfer
 | |
| {
 | |
|   TCache_art* _art;
 | |
|   TCache_umart* _umart;
 | |
|   bool _cust_ref, _paper_info, _ref_info, _cust_code, _cms_ref;
 | |
|   TDate _data_limite;
 | |
|   TAssoc_array _iva; // Codici IVA PACK
 | |
| 
 | |
| protected:
 | |
|   bool signal_row_error(const char* msg);
 | |
| 
 | |
|   bool get_tipodoc(TString& codnum, TString& tipodoc);
 | |
|   bool get_um_qta(TString& um, real& qta);
 | |
|   bool get_clifo(char& tipocf, long& codcf);
 | |
|   const TString& get_indsped() const;
 | |
|   const TRectype& get_articolo(TString& um, real& qta, TString& custcode);
 | |
|   const TString& get_codice_iva();
 | |
|   const TString& get_customer_reference() const;
 | |
| 
 | |
|   bool save_doc(TDocumento* &doc, const int doc_code);
 | |
| 
 | |
| public:
 | |
|   virtual bool trasferisci();
 | |
| 
 | |
|   void activate_custref(bool on)          { _cust_ref = on; }
 | |
|   void activate_paper_info(bool on)       { _paper_info = on; }
 | |
|   void activate_ref_info(bool on)         { _ref_info = on; }
 | |
|   void activate_cmsref(bool on)           { _cms_ref = on; }
 | |
|   void set_data_limite(const TDate& data) { _data_limite = data; }
 | |
|   void activate_customer_code(bool on);
 | |
|   
 | |
|   TPack_ddt();
 | |
|   ~TPack_ddt();
 | |
| };
 | |
| 
 | |
| #endif
 |