#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 { TString80 _sconto; TString16 _codiva; bool _ivarid; real _prezzo; real _provv; real _molt_sconto; TCliFor * _clifo; TLocalisamfile _condv; TLocalisamfile _rcondv; TLocalisamfile * _anamag; TLocalisamfile _sconti; TLocalisamfile * _umart; TConfig * _config_ditta; TMask * _testa; TMask * _riga; bool cerca(int tiporicerca); protected: void set_prezzo(const real & prezzo,const char * val_rif = ""); void set_provv(const real & provv); void set_iva(const TString & codiva); TCliFor & clifo() const { CHECK(_clifo, "Cliente/fornitore non inizializzato"); return * _clifo; } TConfig & config_ditta() const { CHECK(_clifo, "Configurazione ditta non inizializzata"); return * _config_ditta; } TMask & testa() const { CHECK(_testa, "Maschera testata non inizializzata"); return * _testa; } TMask & riga() const { CHECK(_testa, "Maschera testata non inizializzata"); return * _riga; } TLocalisamfile & anamag() const { CHECK(_anamag, "Anagrafica di magazzino non inizializzata") ; return *_anamag; } TLocalisamfile & umart() const { CHECK(_umart, "Anagrafica di unita' di misura magazzino non inizializzata") ; return *_umart; } public: bool set_sconto( const char * exp, bool signal = FALSE ); const TString& get_sconto() const { return _sconto; } real sconto_val() const { return _molt_sconto;} real get_prezzo() const { return _prezzo; } real get_provv() const { return _provv; } const TString & get_iva() const { return _codiva; } void set_config( TConfig * ditta){ _config_ditta = ditta; } void set_testa( TMask * testa ){ _testa = testa; } void set_riga( TMask * riga ){ _riga = riga; } void set_anamag(TLocalisamfile & anamag) { _anamag = &anamag; } void set_umart(TLocalisamfile & umart) { _umart = &umart; } void ricerca(bool full_load = TRUE); bool gestum() const { return _condv.get_bool("GESTUM"); } TCond_vendita(TCliFor & clifo, TConfig * _ditta = NULL, TMask * testa = NULL, TMask * riga = NULL, TLocalisamfile * anamag = NULL, TLocalisamfile * umart = NULL); ~TCond_vendita() {} }; #endif