108 lines
2.6 KiB
C
108 lines
2.6 KiB
C
|
#ifndef __RIGHEDOC_H
|
||
|
#define __RIGHEDOC_H
|
||
|
// Numero di colonne presenti sullo sheet totale
|
||
|
#define MAX_COLUMNS 27
|
||
|
|
||
|
#ifndef __ASSOC_H
|
||
|
#include "assoc.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __REAL_H
|
||
|
#include "real.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __ISAM_H
|
||
|
#include "isam.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __EXPR_H
|
||
|
#include "expr.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __TABUTIL_H
|
||
|
#include "tabutil.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __CONFIG_H
|
||
|
#include "config.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __MSKSHEET_H
|
||
|
#include "msksheet.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef __VEUML2_H
|
||
|
#include "veuml2.h"
|
||
|
#endif
|
||
|
|
||
|
|
||
|
class TPiede_documento : public TAssoc_array
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
TToken_string& string( );
|
||
|
void load( TToken_string& s );
|
||
|
void somma( TPiede_documento& tosum, bool add = TRUE );
|
||
|
void sottrai( TPiede_documento& tosum ){ somma( tosum, FALSE ); };
|
||
|
void somma( TString16& piede, const real& importo );
|
||
|
void sottrai( TString16& piede, const real& importo ){ somma( piede, -importo ); };
|
||
|
real& get( TString16& piede );
|
||
|
};
|
||
|
|
||
|
class TRiga : public TObject
|
||
|
{
|
||
|
private:
|
||
|
|
||
|
// Record che contiene i dati sulla riga
|
||
|
TRectype _data;
|
||
|
|
||
|
// Profilo di riga
|
||
|
TConfig* _pro;
|
||
|
|
||
|
// Maschera per la riga
|
||
|
TMask* _mask;
|
||
|
|
||
|
TPiede_documento _piede;
|
||
|
|
||
|
protected:
|
||
|
|
||
|
// Carca il profilo di riga: da migliorare mettendo una cache o precaricando
|
||
|
// tutti i profili per un documento
|
||
|
void carica_profilo( );
|
||
|
|
||
|
public:
|
||
|
|
||
|
// Setta il numero della riga
|
||
|
void set_numero( int r ) { _data.put( "NRIGA", r ); }
|
||
|
int numero( ) { return _data.get_int( "NRIGA" ); }
|
||
|
const TString& profilo( ) { return _data.get( "PROFRIGA" ); }
|
||
|
// Carica la riga dalla riga dello sheet
|
||
|
void load( TToken_string& row );
|
||
|
// Registra la riga sullo sheet
|
||
|
void save( TToken_string& row );
|
||
|
// Legge la riga dal record
|
||
|
void load( const TRectype& rec );
|
||
|
// Scrive la riga sul record
|
||
|
void save( TRectype& rec );
|
||
|
// Disabilita le colonne dello sheet come da profilo riga
|
||
|
void configura_sheet( TSheet_field& f, int numriga );
|
||
|
// Somma la riga su di un piede documento
|
||
|
void somma( TPiede_documento& piede );
|
||
|
// Sottrae la riga da un piede documento
|
||
|
void sottrai( TPiede_documento& piede );
|
||
|
// Gestisce la modifica/cancellazione della riga sul piede
|
||
|
// documento indicato. Va chiamata negli handler degli sheet
|
||
|
void edit_keys( const KEY key, TPiede_documento& nuovo );
|
||
|
// Ritorna la maschera della riga per la editazione
|
||
|
TMask& getmask( );
|
||
|
|
||
|
void carica_maschera( );
|
||
|
|
||
|
// Costruttorino standard
|
||
|
TRiga( ) : _data( LF_RIGHEDOC ), _pro( NULL ), _mask( NULL ) { }
|
||
|
|
||
|
virtual ~TRiga( );
|
||
|
};
|
||
|
|
||
|
#endif
|