Aggiunta gestione TImporti per calcolo saldi
git-svn-id: svn://10.65.10.50/trunk@1094 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									e1e0ee534a
								
							
						
					
					
						commit
						eea7ed64e9
					
				
							
								
								
									
										37
									
								
								cg/conto.h
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								cg/conto.h
									
									
									
									
									
								
							@ -17,6 +17,7 @@ class TBill : public TSortable
 | 
				
			|||||||
  TString80 _descrizione;  // Vuota fino alla chiamata di describe
 | 
					  TString80 _descrizione;  // Vuota fino alla chiamata di describe
 | 
				
			||||||
  int _tipo_cr;            // Tipo costo/ricavo
 | 
					  int _tipo_cr;            // Tipo costo/ricavo
 | 
				
			||||||
  bool _sospeso;
 | 
					  bool _sospeso;
 | 
				
			||||||
 | 
					  char _sezione;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
protected:           
 | 
					protected:           
 | 
				
			||||||
  virtual int compare(const TSortable& s) const;
 | 
					  virtual int compare(const TSortable& s) const;
 | 
				
			||||||
@ -26,7 +27,8 @@ protected:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
  TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL, int r = -1)
 | 
					  TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL, int r = -1)
 | 
				
			||||||
    : _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d), _tipo_cr(r) { set(g,c,s,t,d,r);}
 | 
					    : _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d), _sezione(' ')
 | 
				
			||||||
 | 
					    { set(g,c,s,t,d,r);}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TBill(TToken_string& tgcsd, int from, int mode = 0);
 | 
					  TBill(TToken_string& tgcsd, int from, int mode = 0);
 | 
				
			||||||
  TBill(const TBill& b) { copy(b); }
 | 
					  TBill(const TBill& b) { copy(b); }
 | 
				
			||||||
@ -52,17 +54,45 @@ public:
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
  int tipo_att();
 | 
					  int tipo_att();
 | 
				
			||||||
  bool read(TRectype& r);
 | 
					  bool read(TRectype& r);
 | 
				
			||||||
  bool sospeso() const { return _sospeso;}  // _sospeso e' letto nella read()
 | 
					  bool sospeso() const { return _sospeso; }  // _sospeso e' letto nella read()
 | 
				
			||||||
 | 
					  char sezione() const { return _sezione; }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  const char* string(int mode = 0);
 | 
					  const char* string(int mode = 0);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TImporto : public TObject
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  char _sezione;
 | 
				
			||||||
 | 
					  real _valore;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
					  char sezione() const { return _sezione; }
 | 
				
			||||||
 | 
					  const real& valore() const { return _valore; }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  bool is_zero() const { return _valore.is_zero(); }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  const TImporto& operator=(const TImporto& i) { return set(i.sezione(), i.valore()); }
 | 
				
			||||||
 | 
					  const TImporto& operator=(TToken_string& sv);
 | 
				
			||||||
 | 
					  const TImporto& operator+=(const TImporto& i);
 | 
				
			||||||
 | 
					  const TImporto& operator-=(const TImporto& i);
 | 
				
			||||||
 | 
					  const TImporto& normalize();
 | 
				
			||||||
 | 
					  const TImporto& swap_section();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const TImporto& set(char s, const real& v);
 | 
				
			||||||
 | 
					  const TImporto& add_to(TToken_string& s) const;
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  TImporto(char s = 'D', const real& v = ZERO) { set(s, v); }
 | 
				
			||||||
 | 
					  TImporto(const TImporto& i) : _sezione(i._sezione), _valore(i._valore) {}
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
 | 
					enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TConto : public TBill
 | 
					class TConto : public TBill
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  real _dare, _avere, _darepro, _averepro, _saldo;
 | 
					  real _dare, _avere, _darepro, _averepro, _saldo;
 | 
				
			||||||
 | 
					  TImporto _saldo_finale;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
  TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
 | 
					  TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
 | 
				
			||||||
@ -84,6 +114,9 @@ public:
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
  real& saldo() { return _saldo; }
 | 
					  real& saldo() { return _saldo; }
 | 
				
			||||||
  const real& saldo() const { return _saldo; }
 | 
					  const real& saldo() const { return _saldo; }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  TImporto& saldo_finale() { return _saldo_finale; }
 | 
				
			||||||
 | 
					  const TImporto& saldo_finale() const { return _saldo_finale; }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user