#ifndef __SCONTI_H #define __SCONTI_H #ifndef __REAL_H #include #endif #ifndef __TCLIFOR_H #include "tclifor.h" #endif #ifndef __MASK_H #include #endif #ifndef __CONFIG_H #include #endif class TCond_vendita : public TObject { TString _sconto; real _prezzo; bool _valid; int _errorpos; real _part; TCliFor* _clifo; // TRelation _condv; // Invece che la relazione uso i due files, poichè mi interessa sempre // solo una delle righe TLocalisamfile _condv; TLocalisamfile _rcondv; TLocalisamfile _anamag; TLocalisamfile _sconti; TConfig _ditta; TMask* _testa; TMask* _riga; bool cerca( int tiporicerca ); public: TString& get_sconto( void ) { return _sconto; } void set_sconto( const char * exp, bool signal = FALSE ); real get_prezzo() { return _prezzo; } void set_prezzo(const real & prezzo) { _prezzo = prezzo; } bool is_valid( ){ return _valid; } real sconto_val( ); const char * sconto_str( int len = 0, int dec = UNDEFINED, char pad = ' ' ){ real p(sconto_val()); return p.stringa( len, dec, pad ); } TCliFor& clifo( ){ return *_clifo; } void set_testa( TMask& testa ){ _testa = &testa; } TMask& testa( ){ return *_testa; } void set_riga( TMask& riga ){ _riga = &riga; } TMask& riga( ){ return *_riga; } void calcola( ); bool gestum() { return _condv.get_bool("GESTUM"); } TCond_vendita( TCliFor& clifo, TMask * testa = NULL, TMask * riga = NULL ); ~TCond_vendita() {} }; #endif