Files correlati : pd63422.exe Ricompilazione Demo : [ ] Commento : Saldi per commessa e conto Haiblliita git-svn-id: svn://10.65.10.50/branches/R_10_00@21100 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			180 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			180 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #ifndef __CALIB02_H
 | |
| #define __CALIB02_H
 | |
| 
 | |
| #ifndef __AUTOMASK_H
 | |
| #include <automask.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __REPORT_H
 | |
| #include <report.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __CGLIB01_H
 | |
| #include "../cg/cglib01.h"
 | |
| #endif
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // TAnal_bill
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| // Classe simile al TBill, che contiene un conto piu' o meno completo di analitica
 | |
| class TAnal_bill : public TSortable
 | |
| {
 | |
|   TString _conto, _costo, _commessa, _fase;
 | |
| 
 | |
| protected:
 | |
|   void copy(const TAnal_bill& bill);
 | |
| 
 | |
| public:
 | |
|   virtual int compare(const TSortable& s) const;
 | |
|   bool match(const TAnal_bill& b) const;
 | |
| 
 | |
| public:
 | |
|   void set_conto(const char* c);
 | |
|   void set_costo(const char* c);
 | |
|   void set_commessa(const char* c);
 | |
|   void set_fase(const char* c);
 | |
| 
 | |
|   const TString& conto() const;
 | |
|   const TString& costo() const;
 | |
|   const TString& commessa() const;
 | |
|   const TString& fase() const;
 | |
| 
 | |
| 	TIndbil indicatore_bilancio() const;
 | |
| 	const TString& testata() const;
 | |
|   bool get(const TRectype& rec);
 | |
|   void reset();
 | |
| 
 | |
|   const TAnal_bill& operator=(const TAnal_bill& bill);
 | |
| 
 | |
|   TAnal_bill();
 | |
|   TAnal_bill(const TAnal_bill& bill);
 | |
|   TAnal_bill(const char* conto, const char* costo = "", const char* commessa = "", const char* fase = "");
 | |
|   TAnal_bill(const TRectype& rec);
 | |
| };
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // TAnal_balance
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| #define _saldanal_consuntivo 0x1
 | |
| #define _saldanal_preventivo 0x2
 | |
| #define _saldanal_variazione 0x4
 | |
| #define _saldanal_preventivi 0x6
 | |
| #define _saldanal_qualsiasi  0x7
 | |
| #define _saldanal_ultima_imm 0x8
 | |
| #define _saldanal_consuntivo_indiretto 0x10
 | |
| #define _saldanal_preventivo_indiretto 0x20
 | |
| #define _saldanal_variazione_indiretto 0x40
 | |
| #define _saldanal_preventivi_indiretto 0x60
 | |
| #define _saldanal_qualsiasi_indiretto  0x70
 | |
| #define _saldanal_riclassify 0x100
 | |
| 
 | |
| struct TSaldanal : public TObject
 | |
| {
 | |
|   TImporto _ini, _dare, _avere, _fin;
 | |
|   TImporto _iniind, _dareind, _avereind, _finind;
 | |
|   bool _movimentato;
 | |
| 
 | |
| protected:
 | |
|   void copy(const TSaldanal& sa);
 | |
| 
 | |
| public:
 | |
|   TObject* dup() const { return new TSaldanal(*this); }
 | |
|   const TSaldanal& operator=(const TSaldanal& sa) { copy(sa); return *this; }
 | |
|   
 | |
|   TSaldanal() : _movimentato(false) { }
 | |
|   TSaldanal(const TSaldanal& sa) { copy(sa); }
 | |
| };
 | |
| 
 | |
| 
 | |
| ///////////////////////////////////////////////////////
 | |
| //  Metodi sciolti ma decisivi
 | |
| ///////////////////////////////////////////////////////
 | |
| const TSaldanal& ca_saldo(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipi = _saldanal_consuntivo);
 | |
| 
 | |
| TImporto ca_get_imp(const TRecordset& rs, const char* sez, const char* imp);
 | |
| 
 | |
| ////////////////////////////////////////////////////////
 | |
| // TPconana_recordset
 | |
| ////////////////////////////////////////////////////////
 | |
| 
 | |
| class TPconana_recordset : public TISAM_recordset
 | |
| {
 | |
|   char _tipo;
 | |
|   word _tipimov;
 | |
|   TString _da_conto, _a_conto;
 | |
|   int _conto_minlen;
 | |
|   TAnal_bill _bill;
 | |
|   TDate _dal, _al;
 | |
|   bool _movimentati, _nonnulli;
 | |
| 
 | |
|   // Variabili per verifica conti contabili col flag di analitica
 | |
|   bool _is_anal[3];
 | |
| 
 | |
| protected:
 | |
|   bool valid_record(const TRelation& rel) const; 
 | |
|   static bool pianoconti_filter(const TRelation* rel);
 | |
|   
 | |
|   virtual void set_custom_filter(TCursor& cursor) const;
 | |
| 
 | |
| public:
 | |
|   virtual const TVariant& get(const char* column_name) const;
 | |
| 
 | |
|   void set_tipo(char tipo);
 | |
|   void set_filter(char tipo, const char* da_conto, const char* a_conto,
 | |
|                   const char* costo, const char* commessa, const char* fase,
 | |
|                   const TDate& dal, const TDate& al,
 | |
|                   word tipimov, bool movimentati, bool nonnulli);
 | |
|   TPconana_recordset(char tipo = ' ');
 | |
| };
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // TAnal_rapport
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TAnal_report : public TReport   
 | |
| {
 | |
|   unsigned int _first_msg;
 | |
| 
 | |
| protected:  // protected is safer
 | |
|   virtual size_t get_usr_words(TString_array& words) const;
 | |
|   virtual bool execute_usr_word(unsigned int opcode, TVariant_stack& stack);
 | |
|   virtual bool use_mask() { return false; }
 | |
| 
 | |
|   char determina_tipo_pdc(TVariant_stack& stack) const; // usata dalle msg_format_conto*
 | |
| 
 | |
|   virtual void msg_format(int logicnum,  TVariant_stack& stack);
 | |
|   virtual void msg_format_costo         (TVariant_stack& stack);
 | |
|   virtual void msg_format_commessa      (TVariant_stack& stack);
 | |
|   virtual void msg_format_fase          (TVariant_stack& stack);
 | |
|   virtual void msg_format_conto         (TVariant_stack& stack);
 | |
|   virtual void msg_format_commessa_costo(TVariant_stack& stack);
 | |
|   virtual void msg_format_conto_descr   (TVariant_stack& stack);
 | |
| 
 | |
| public:   // meglio pubic?
 | |
| };
 | |
| 
 | |
| 
 | |
| ///////////////////////////////////////////////////////////
 | |
| // TAnal_rapport_mask
 | |
| ///////////////////////////////////////////////////////////
 | |
| 
 | |
| class TAnal_report_mask : public TAutomask  
 | |
| {
 | |
| protected:
 | |
| 	void create_sheet(short sheet_id);
 | |
| 	int create_sheet_fields(short sheet_id, int lf, int& y, short& dlg);
 | |
| 
 | |
| 	virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
 | |
| 
 | |
| public:
 | |
|   int get_row_bill(TSheet_field& sf, int r, TAnal_bill& bill);
 | |
|   int set_row_bill(TSheet_field& sf, int r, const TAnal_bill& bill);
 | |
| 	bool esistono_riclassificazioni() const;
 | |
| 	
 | |
|   TAnal_report_mask(const char* name) : TAutomask(name) {}
 | |
| };
 | |
| 
 | |
| #endif
 |