#ifndef __SCONTI_H #define __SCONTI_H #ifndef __REAL_H #include #endif #ifndef __TCLIFOR_H #include "clifor.h" #endif #ifndef __VELIB_H #include "velib.h" #endif #ifndef __CONFIG_H #include #endif class TCond_vendita : public TObject { TString80 _sconto; TString16 _codiva; bool _ivarid; real _prezzo; real _provv; real _molt_sconto; TCli_for * _clifo; TLocalisamfile _condv; TLocalisamfile _rcondv; TLocalisamfile * _anamag; TLocalisamfile _sconti; TLocalisamfile * _umart; TConfig * _config_ditta; TDocumento_mask * _testa; TMask * _riga; bool _load_mask; bool cerca(int tiporicerca); real normalize_valuta(const real & val, const char * val_rif = ""); protected: void set_prezzo(const real & prezzo, const char * val_rif = ""); void set_provv(const real & provv); void set_iva(const TString & codiva); void update_omaggi(bool full); TConfig & config_ditta() const { CHECK(_config_ditta, "Configurazione ditta non inizializzata"); return * _config_ditta; } TDocumento_mask & 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: TCli_for & clifo() const { CHECK(_clifo, "Cliente/fornitore non inizializzato"); return * _clifo; } 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_clifo( TCli_for * clifo) { _clifo = clifo; } void set_config( TConfig * ditta) { _config_ditta = ditta; } void set_testa( TDocumento_mask * 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 load_um_only = FALSE, bool load_scagl_only = FALSE); bool gestum() const { return _condv.get_bool("GESTUM"); } TCond_vendita(TCli_for * clifo = NULL, TConfig * _ditta = NULL, TDocumento_mask * testa = NULL, TMask * riga = NULL, TLocalisamfile * anamag = NULL, TLocalisamfile * umart = NULL); ~TCond_vendita() {} }; #endif