98 lines
2.5 KiB
C++
Executable File
98 lines
2.5 KiB
C++
Executable File
#ifndef __RIGHEDOC_H
|
|
#define __RIGHEDOC_H
|
|
// Numero di colonne presenti sullo sheet totale
|
|
#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
|
|
|
|
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
|
|
|
|
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 & tipo( ) const { return _data.get( "TIPORIGA" ); }
|
|
// Carica la riga dalla riga dello sheet
|
|
void load( TSheet_field& f, TToken_string& row , TRectype * r = NULL);
|
|
// Registra la riga sullo sheet
|
|
void save( TSheet_field& f, 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 );
|
|
// Costruisce e Ritorna la maschera della riga per la editazione
|
|
TMask * getmask();
|
|
|
|
// Costruttorino standard
|
|
TRiga( ) : _data( LF_RIGHEDOC ), _pro( NULL ) { }
|
|
|
|
virtual ~TRiga( );
|
|
};
|
|
|
|
#endif
|