1995-09-15 13:49:07 +00:00
|
|
|
#ifndef __SCONTI_H
|
|
|
|
#define __SCONTI_H
|
|
|
|
|
1995-12-04 17:41:06 +00:00
|
|
|
#ifndef __TCLIFOR_H
|
1997-06-12 16:26:22 +00:00
|
|
|
#include "clifor.h"
|
1995-12-04 17:41:06 +00:00
|
|
|
#endif
|
|
|
|
|
1997-06-03 15:56:27 +00:00
|
|
|
#ifndef __VELIB_H
|
1998-05-04 09:54:49 +00:00
|
|
|
class TMask;
|
|
|
|
class TDocumento_mask;
|
1995-12-04 17:41:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __CONFIG_H
|
1998-05-04 09:54:49 +00:00
|
|
|
class TConfig;
|
1995-12-04 17:41:06 +00:00
|
|
|
#endif
|
|
|
|
|
1996-07-25 13:05:29 +00:00
|
|
|
class TCond_vendita : public TObject
|
1995-09-15 13:49:07 +00:00
|
|
|
{
|
1996-08-12 08:32:28 +00:00
|
|
|
TString80 _sconto;
|
|
|
|
TString16 _codiva;
|
|
|
|
bool _ivarid;
|
1996-07-25 13:05:29 +00:00
|
|
|
real _prezzo;
|
1996-08-12 08:32:28 +00:00
|
|
|
real _provv;
|
|
|
|
real _molt_sconto;
|
1997-06-12 16:26:22 +00:00
|
|
|
TCli_for * _clifo;
|
1996-07-25 13:05:29 +00:00
|
|
|
TLocalisamfile _condv;
|
|
|
|
TLocalisamfile _rcondv;
|
1996-08-12 08:32:28 +00:00
|
|
|
TLocalisamfile * _anamag;
|
1996-07-25 13:05:29 +00:00
|
|
|
TLocalisamfile _sconti;
|
1996-08-12 08:32:28 +00:00
|
|
|
TLocalisamfile * _umart;
|
|
|
|
TConfig * _config_ditta;
|
1997-02-03 15:28:53 +00:00
|
|
|
TDocumento_mask * _testa;
|
1996-09-26 15:37:19 +00:00
|
|
|
TMask * _riga;
|
|
|
|
bool _load_mask;
|
1996-07-25 13:05:29 +00:00
|
|
|
|
1996-08-12 08:32:28 +00:00
|
|
|
bool cerca(int tiporicerca);
|
1995-09-15 13:49:07 +00:00
|
|
|
|
1997-07-29 09:53:35 +00:00
|
|
|
real normalize_valuta(const real & val, const char * val_rif = "");
|
|
|
|
|
1996-08-12 08:32:28 +00:00
|
|
|
protected:
|
1997-07-29 09:53:35 +00:00
|
|
|
void set_prezzo(const real & prezzo, const char * val_rif = "");
|
1996-08-12 08:32:28 +00:00
|
|
|
void set_provv(const real & provv);
|
|
|
|
void set_iva(const TString & codiva);
|
1997-02-03 15:28:53 +00:00
|
|
|
void update_omaggi(bool full);
|
1996-08-12 08:32:28 +00:00
|
|
|
|
1996-09-26 15:37:19 +00:00
|
|
|
TConfig & config_ditta() const { CHECK(_config_ditta, "Configurazione ditta non inizializzata"); return * _config_ditta; }
|
1997-02-03 15:28:53 +00:00
|
|
|
TDocumento_mask & testa() const { CHECK(_testa, "Maschera testata non inizializzata"); return * _testa; }
|
1996-08-12 08:32:28 +00:00
|
|
|
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; }
|
1995-09-15 13:49:07 +00:00
|
|
|
|
1996-08-12 08:32:28 +00:00
|
|
|
public:
|
1997-06-12 16:26:22 +00:00
|
|
|
TCli_for & clifo() const { CHECK(_clifo, "Cliente/fornitore non inizializzato"); return * _clifo; }
|
1996-08-12 08:32:28 +00:00
|
|
|
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; }
|
1997-10-29 11:08:40 +00:00
|
|
|
real get_percprovv(char tipoprovv, const TString & codpr, TLocalisamfile & age) const;
|
1996-08-12 08:32:28 +00:00
|
|
|
const TString & get_iva() const { return _codiva; }
|
1995-09-15 13:49:07 +00:00
|
|
|
|
1997-06-12 16:26:22 +00:00
|
|
|
void set_clifo( TCli_for * clifo) { _clifo = clifo; }
|
|
|
|
void set_config( TConfig * ditta) { _config_ditta = ditta; }
|
1997-02-03 15:28:53 +00:00
|
|
|
void set_testa( TDocumento_mask * testa ){ _testa = testa; }
|
1996-08-12 08:32:28 +00:00
|
|
|
void set_riga( TMask * riga ){ _riga = riga; }
|
|
|
|
void set_anamag(TLocalisamfile & anamag) { _anamag = &anamag; }
|
|
|
|
void set_umart(TLocalisamfile & umart) { _umart = &umart; }
|
1996-09-26 15:37:19 +00:00
|
|
|
void ricerca(bool load_um_only = FALSE, bool load_scagl_only = FALSE);
|
1996-08-12 08:32:28 +00:00
|
|
|
bool gestum() const { return _condv.get_bool("GESTUM"); }
|
1995-12-04 17:41:06 +00:00
|
|
|
|
1997-06-12 16:26:22 +00:00
|
|
|
TCond_vendita(TCli_for * clifo = NULL, TConfig * _ditta = NULL, TDocumento_mask * testa = NULL, TMask * riga = NULL,
|
1996-08-12 08:32:28 +00:00
|
|
|
TLocalisamfile * anamag = NULL, TLocalisamfile * umart = NULL);
|
1998-05-04 09:54:49 +00:00
|
|
|
virtual ~TCond_vendita() {}
|
1995-12-04 17:41:06 +00:00
|
|
|
};
|
|
|
|
|
1996-07-25 13:05:29 +00:00
|
|
|
#endif
|