1995-09-15 13:49:07 +00:00
|
|
|
|
#ifndef __SCONTI_H
|
|
|
|
|
#define __SCONTI_H
|
|
|
|
|
|
|
|
|
|
#ifndef __REAL_H
|
|
|
|
|
#include <real.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
1995-12-04 17:41:06 +00:00
|
|
|
|
#ifndef __TCLIFOR_H
|
|
|
|
|
#include "tclifor.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef __MASK_H
|
|
|
|
|
#include <mask.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef __CONFIG_H
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
1995-09-15 13:49:07 +00:00
|
|
|
|
#define CHKVALID CHECK( _valid, "Tentativo di usare uno sconto non valido!" )
|
|
|
|
|
|
|
|
|
|
class TSconto : public TObject
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
TString _exp;
|
|
|
|
|
bool _valid;
|
|
|
|
|
int _errorpos;
|
|
|
|
|
real _part;
|
|
|
|
|
static const real cento;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
TString& get( void ){ CHKVALID; return _exp; }
|
|
|
|
|
void set( const TString& exp, bool signal = FALSE );
|
|
|
|
|
bool is_valid( ){ return _valid; }
|
|
|
|
|
real sconto( );
|
|
|
|
|
char * scontostr( int len = 0, int dec = UNDEFINED, char pad = ' ' ){ CHKVALID; real p(sconto()); return p.stringa( len, dec, pad ); }
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#undef CHKVALID
|
1995-12-04 17:41:06 +00:00
|
|
|
|
|
|
|
|
|
class TSconto_riga : public TSconto
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
TCliFor* _clifo;
|
|
|
|
|
// TRelation _condv;
|
|
|
|
|
// Invece che la relazione uso i due files, poich<63> mi interessa sempre
|
|
|
|
|
// solo una delle righe
|
|
|
|
|
TLocalisamfile _condv;
|
|
|
|
|
TLocalisamfile _rcondv;
|
|
|
|
|
TLocalisamfile _anamag;
|
|
|
|
|
TLocalisamfile _sconti;
|
|
|
|
|
TConfig _ditta;
|
|
|
|
|
TMask* _testa;
|
|
|
|
|
TMask* _riga;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
TSconto_riga( TCliFor& clifo, TMask * testa = NULL, TMask * riga = NULL );
|
|
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
bool cerca_condv( int tiporicerca );
|
|
|
|
|
void calcola( );
|
|
|
|
|
};
|
|
|
|
|
|
1995-09-15 13:49:07 +00:00
|
|
|
|
#endif
|