1997-02-18 15:10:08 +00:00
|
|
|
#ifndef __EF0101_H
|
|
|
|
#define __EF0101_H
|
|
|
|
|
1997-02-17 11:14:01 +00:00
|
|
|
#ifndef __RECARRAY_H
|
|
|
|
#include <recarray.h>
|
2001-05-02 13:40:49 +00:00
|
|
|
#endif
|
1999-10-22 10:00:18 +00:00
|
|
|
|
1997-02-12 09:15:50 +00:00
|
|
|
#include <effetti.h>
|
|
|
|
#include <reffetti.h>
|
|
|
|
#include <cession.h>
|
1996-12-17 12:06:03 +00:00
|
|
|
|
1997-02-18 15:10:08 +00:00
|
|
|
////////////////////////////////////////////////////////////
|
1997-06-02 09:16:17 +00:00
|
|
|
// Definizione dell'oggetto Effetto con la classe TEffetto//
|
1997-02-18 15:10:08 +00:00
|
|
|
////////////////////////////////////////////////////////////
|
1996-11-05 14:24:56 +00:00
|
|
|
class TEffetto:public TRectype
|
|
|
|
{
|
1997-06-02 09:16:17 +00:00
|
|
|
TRecord_array _righe;// righe dell'effetto
|
1997-02-17 11:14:01 +00:00
|
|
|
TRecord_array _cess;// cessionari dell'effetto
|
1999-10-22 10:00:18 +00:00
|
|
|
|
1997-06-02 09:16:17 +00:00
|
|
|
protected:
|
|
|
|
// ritorna la prossima chiave
|
|
|
|
long get_next_key(const long codcf) const;
|
|
|
|
// permette di leggere il record passato nel file passato
|
1997-05-31 13:25:48 +00:00
|
|
|
int leggi(TLocalisamfile& f, const TRectype& rec, word lockop = _nolock);
|
1997-06-02 09:16:17 +00:00
|
|
|
public:
|
1997-02-22 11:36:38 +00:00
|
|
|
// Duplica l'effetto
|
|
|
|
virtual TObject* dup() const;
|
1996-11-22 17:17:26 +00:00
|
|
|
// rinumera la chiave 1
|
1997-06-02 09:16:17 +00:00
|
|
|
long renum(long numeff = 0);
|
|
|
|
// ritorna un riferimento alla testata dell'effetto
|
|
|
|
const TRectype& head() const { return *this; }
|
1996-11-22 17:17:26 +00:00
|
|
|
// ritorna un riferimento alla testata dell'effetto
|
1997-06-02 09:16:17 +00:00
|
|
|
TRectype& head() { return *this; }
|
|
|
|
// ritorna un riferimento alle righe dell'effetto
|
|
|
|
TRecord_array& righe() {return _righe;}
|
1996-11-22 17:17:26 +00:00
|
|
|
// ritorna un riferimento ai cessionari dell'effetto
|
1996-11-14 17:36:49 +00:00
|
|
|
TRecord_array& cess() {return _cess;}
|
|
|
|
// ritorna la riga i_esima dei cessionari
|
1997-06-02 09:16:17 +00:00
|
|
|
TRectype& row_c(int i, bool create=FALSE) { return _cess.row(i,create); }
|
1996-11-14 17:36:49 +00:00
|
|
|
// ritorna la riga i delle righe
|
1997-06-02 09:16:17 +00:00
|
|
|
TRectype& row_r(int i, bool create=FALSE) { return _righe.row(i,create); }
|
1999-04-06 15:34:39 +00:00
|
|
|
// ritorna la riga i delle righe
|
|
|
|
const TRectype& row_r(int i) const { return _righe.row(i); }
|
1996-11-14 17:36:49 +00:00
|
|
|
// ritorna il numero delle righe presenti nelle righe effetto
|
1997-06-02 09:16:17 +00:00
|
|
|
int rows_r() const { return _righe.rows(); }
|
1996-11-14 17:36:49 +00:00
|
|
|
// ritorna il numero delle righe presenti nei cessionari
|
1997-06-02 09:16:17 +00:00
|
|
|
int rows_c() const { return _cess.rows(); }
|
|
|
|
// elimina l'elemento riga nella posizione n nelle righe effetto
|
|
|
|
bool destroy_row_r(int n, bool pack = FALSE) { return _righe.destroy_row(n, pack); }
|
1996-11-14 17:36:49 +00:00
|
|
|
// elimina tutti gli elementi riga nelle righe effetto
|
1997-06-02 09:16:17 +00:00
|
|
|
void destroy_rows_r() { _righe.destroy_rows(); }
|
1996-11-14 17:36:49 +00:00
|
|
|
// elimina l'elemento riga nella posizione n nei cessionari
|
1997-06-02 09:16:17 +00:00
|
|
|
bool destroy_row_c(int n, bool pack = FALSE) { return _cess.destroy_row(n, pack); }
|
|
|
|
// elimina tutti gli elementi riga nei cessionari
|
|
|
|
void destroy_rows_c() { _cess.destroy_rows(); }
|
1996-11-22 17:17:26 +00:00
|
|
|
// restituisce il prossimo effetto
|
1997-06-02 09:16:17 +00:00
|
|
|
int next(TBaseisamfile& f);
|
|
|
|
// legge il record passato, con chiave 1
|
|
|
|
int read(TLocalisamfile& f, const TRectype& rec, word lockop = _nolock);
|
1996-11-22 17:17:26 +00:00
|
|
|
// legge il record passato, con chiave 4
|
1997-06-14 07:39:40 +00:00
|
|
|
int read(TLocalisamfile& f, char tipodist, long ndist, int nrigadist, word lockop = _nolock);
|
1996-11-22 17:17:26 +00:00
|
|
|
// scrive l'effetto, sempre usando la chiave 1
|
|
|
|
int write(TLocalisamfile& f, bool force = FALSE);
|
|
|
|
// riscrive l'effetto
|
|
|
|
int rewrite(TLocalisamfile& f) { return write(f, TRUE); }
|
|
|
|
// rimuove l'effetto
|
1997-06-02 09:16:17 +00:00
|
|
|
int remove(TLocalisamfile& f)const;
|
1996-11-22 17:17:26 +00:00
|
|
|
// restituisce il numero progressivo dell'effetto estraendolo dal record
|
1997-02-12 09:15:50 +00:00
|
|
|
long numero() const { return get_long(EFF_NPROGTR); }
|
1997-06-02 09:16:17 +00:00
|
|
|
// restituisce il codice del cliente intestatario dell'effetto estraendolo dal record
|
1997-02-12 09:15:50 +00:00
|
|
|
long codicec() const { return get_long(EFF_CODCF); }
|
1996-11-22 17:17:26 +00:00
|
|
|
// restituisce la data di scadenza dell'effetto estraendola dal record
|
1997-06-02 09:16:17 +00:00
|
|
|
TDate datasc() const { return get_date(EFF_DATASCAD); }
|
1996-11-22 17:17:26 +00:00
|
|
|
// restituisce il tipo di distinta a cui appartiene l'effetto estraendolo dal record
|
1997-02-12 09:15:50 +00:00
|
|
|
char tipodist() const { return get_char(EFF_TIPODIST); }
|
1997-06-02 09:16:17 +00:00
|
|
|
// restituisce il numero della distinta a cui appartiene l'effetto estraendolo dal record
|
1997-02-12 09:15:50 +00:00
|
|
|
long ndist() const { return get_long(EFF_NDIST); }
|
1997-06-02 09:16:17 +00:00
|
|
|
// restituisce il numero della riga distinta a cui appartiene l'effetto estraendolo dal record
|
|
|
|
int nrgdist() const { return get_int(EFF_NRIGADIST); }
|
1996-12-06 15:50:15 +00:00
|
|
|
// restituisce l'importo dell'effetto
|
1998-01-09 16:33:25 +00:00
|
|
|
real importo(const bool valuta = FALSE) const { return get_real(valuta ? EFF_IMPORTOVAL : EFF_IMPORTO); }
|
1999-10-22 10:00:18 +00:00
|
|
|
const bool in_valuta() const;
|
1999-04-06 15:34:39 +00:00
|
|
|
const char get_tipo() const ;
|
1997-06-02 09:16:17 +00:00
|
|
|
// setta i campi per la quarta chiave del file
|
|
|
|
void put_key(TRectype& rec,char tipodist, long ndist, int nrigadist = 0);
|
1997-02-10 11:22:42 +00:00
|
|
|
// setta i campi per la prima chiave del file
|
1996-11-14 17:36:49 +00:00
|
|
|
void put_key(TRectype& rec,long numeff) const;
|
1997-02-10 11:22:42 +00:00
|
|
|
// restituisce true se l'effetto si riferisce ad una sola fattura
|
1997-06-02 09:16:17 +00:00
|
|
|
bool fatt(long num);
|
1997-02-10 11:22:42 +00:00
|
|
|
// restituisce i dati relativi alle fatture a cui si riferisce l'effetto
|
2001-05-02 13:40:49 +00:00
|
|
|
TToken_string& dati_fatt(long num, const bool valuta, TToken_string& dati);
|
2000-10-03 13:45:12 +00:00
|
|
|
// restituisce i dati codnum, ndoc, anno relativi alle fatture a cui si riferisce l'effetto
|
2001-05-02 13:40:49 +00:00
|
|
|
TToken_string& altridati_fatt(long num, TToken_string& dati);
|
1996-11-22 17:17:26 +00:00
|
|
|
// costruttore di default
|
1997-06-02 09:16:17 +00:00
|
|
|
TEffetto();
|
1996-11-22 17:17:26 +00:00
|
|
|
// costuisce l'effetto con il record passato
|
1997-06-02 09:16:17 +00:00
|
|
|
TEffetto(TRectype& rec);
|
1997-02-22 11:36:38 +00:00
|
|
|
// costuttore di copia
|
1997-06-02 09:16:17 +00:00
|
|
|
TEffetto(const TEffetto& eff);
|
1996-11-22 17:17:26 +00:00
|
|
|
// distruttore di default
|
1996-11-05 14:24:56 +00:00
|
|
|
virtual ~TEffetto() {}
|
1997-02-10 11:22:42 +00:00
|
|
|
};
|
1997-02-18 15:10:08 +00:00
|
|
|
|
1997-06-02 09:16:17 +00:00
|
|
|
#endif//__EF0101_H
|