2008-08-12 15:11:26 +00:00
|
|
|
#ifndef __LVLIB_H
|
|
|
|
#define __LVLIB_H
|
|
|
|
|
2008-10-28 20:07:09 +00:00
|
|
|
#ifndef __RECSET_H
|
|
|
|
#include <recset.h>
|
|
|
|
#endif
|
|
|
|
|
2008-11-18 08:50:07 +00:00
|
|
|
#ifndef __MGLIB_H
|
2008-10-28 20:07:09 +00:00
|
|
|
#include "../mg/mglib.h"
|
2008-11-18 08:50:07 +00:00
|
|
|
#endif
|
2008-10-28 20:07:09 +00:00
|
|
|
|
2008-08-12 15:11:26 +00:00
|
|
|
void lv_set_creation_info(TRectype& rec);
|
|
|
|
void lv_set_update_info(TRectype& rec);
|
2008-11-14 14:34:29 +00:00
|
|
|
long lv_find_contract(const long codcf, const long indsped, const TDate& data);
|
2008-12-09 10:51:18 +00:00
|
|
|
bool lv_is_holiday(const TDate& data);
|
2008-08-12 15:11:26 +00:00
|
|
|
|
2008-11-18 08:50:07 +00:00
|
|
|
class TLaundry_contract : public TRectype
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
const TRectype& row(const char* codart) const;
|
|
|
|
virtual bool ok() const;
|
|
|
|
|
|
|
|
bool read(const long codcf, const long codcont);
|
|
|
|
bool read(const long codcf, const long indsped, const TDate& data);
|
2008-12-10 11:57:25 +00:00
|
|
|
bool can_be_deleted() const;
|
2008-10-28 20:07:09 +00:00
|
|
|
|
2008-11-18 08:50:07 +00:00
|
|
|
TLaundry_contract();
|
2008-12-10 11:57:25 +00:00
|
|
|
TLaundry_contract(const TRectype & rec);
|
2008-11-18 08:50:07 +00:00
|
|
|
TLaundry_contract(const long codcf, const long codcont);
|
|
|
|
TLaundry_contract(const long codcf, const long indsped, const TDate& data);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TRecmag_lavanderie : public TVariable_rectype
|
2008-10-28 20:07:09 +00:00
|
|
|
{
|
2008-11-18 14:08:37 +00:00
|
|
|
real _consmese;
|
2008-10-28 20:07:09 +00:00
|
|
|
long _update_time;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual const TString & get_str(const char* fieldname) const ;
|
|
|
|
virtual void put_str(const char* fieldname, const char* val) { return TRectype::put_str(fieldname, val);}
|
|
|
|
void update();
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int name2index(const char* fieldname) const;
|
|
|
|
virtual TFieldtypes type(const char* fieldname) const;
|
|
|
|
virtual int length(const char* fieldname) const;
|
|
|
|
virtual int ndec(const char* fieldname) const;
|
|
|
|
virtual bool exist(const char* fieldname) const;
|
|
|
|
virtual TObject* dup() const;
|
|
|
|
TRecmag_lavanderie();
|
|
|
|
TRecmag_lavanderie(const TRecmag_lavanderie & rec) : TVariable_rectype(rec), _update_time(0L) {}
|
2009-03-27 14:21:11 +00:00
|
|
|
TRecmag_lavanderie(const TRectype & rec) : TVariable_rectype(rec), _update_time(0L) {}
|
2008-10-28 20:07:09 +00:00
|
|
|
virtual ~TRecmag_lavanderie() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
class TArticolo_lavanderie : public TArticolo_giacenza_data
|
|
|
|
{
|
2008-11-18 08:50:07 +00:00
|
|
|
int _anno_lav;
|
|
|
|
char _tipocf;
|
|
|
|
long _codcf;
|
|
|
|
int _indsped;
|
2008-10-28 20:07:09 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// la get_str supporta anche la sintassi:
|
|
|
|
// #LF->fieldname
|
|
|
|
// #LF_par1->fieldname
|
|
|
|
// #LF_par1_par2->fieldname
|
|
|
|
// #LF_par1_par2_par3->fieldname
|
|
|
|
// dove:
|
|
|
|
// LF = numero logico del sottofile collegato (LF_UMART, LF_DESLIN, LF_CODCORR
|
|
|
|
// par1, par2, par3 = varie parti della chiave dell'indice del file collegato
|
|
|
|
// il numero di queste parti ed il loro valore dipende dal file collegato
|
|
|
|
// se parX comincia per # rappresenta il numero progressivo nell'indice
|
|
|
|
// fieldname = nome del campo nel file collegato
|
|
|
|
virtual const TString & get_str(const char* fieldname) const ;
|
|
|
|
virtual void set_body_key(TRectype & rowrec);
|
|
|
|
void set_anno_lav (int anno = 0);
|
|
|
|
void set_anno_lav (const char * anno) { set_anno_mag(atoi(anno)); }
|
|
|
|
virtual TRectype * new_body_record(int logicnum = 0);
|
|
|
|
public:
|
|
|
|
virtual TObject* dup() const { return new TArticolo_lavanderie(codice(), _tipocf, _codcf, _indsped); }
|
|
|
|
|
|
|
|
int find_clifomag(TRecord_array& rclifomag, const char * livello = NULL, int from = 0) const ;
|
|
|
|
int find_clifomag(int annoes, const char * livello = NULL, int from = 0) const ;
|
|
|
|
int find_clifomag(const char * annoes, const char * livello = NULL, int from = 0) const { return find_clifomag(atoi(annoes), livello, from); }
|
|
|
|
|
|
|
|
TRecord_array & clifomag(int annoes) const;
|
|
|
|
TRecord_array & clifomag(const char * annoes) const { return clifomag(atoi(annoes));}
|
|
|
|
|
|
|
|
void set_tipocf(char tipocf) { _tipocf = tipocf;}
|
|
|
|
void set_codcf(long codcf) { _codcf = codcf;}
|
|
|
|
void set_indsped(int indsped) { _indsped = indsped;}
|
2009-05-21 15:00:06 +00:00
|
|
|
|
|
|
|
const TRecmag_lavanderie & find_rec(int annoes) const { return (const TRecmag_lavanderie &) clifomag(annoes).row(find_clifomag(annoes)); }
|
|
|
|
const TRecmag_lavanderie & find_rec(const char * annoes) const { return find_rec(atoi(annoes)); }
|
2008-10-28 20:07:09 +00:00
|
|
|
|
|
|
|
TArticolo_lavanderie(const char* codice = NULL, const char tipocf = ' ', const long codcf = 0L, const int indsped = 0);
|
|
|
|
TArticolo_lavanderie(const TRectype& rec, const char tipocf = ' ', const long codcf = 0L, const int indsped = 0);
|
|
|
|
virtual ~TArticolo_lavanderie() {}
|
|
|
|
};
|
|
|
|
|
2008-11-18 08:50:07 +00:00
|
|
|
TArticolo_lavanderie& cached_article_laundry(const char * codart, const char tipocf, const long codcf, const int indsped);
|
2008-10-28 20:07:09 +00:00
|
|
|
|
2008-11-01 18:09:05 +00:00
|
|
|
class TLavanderie_calendar : public TObject
|
|
|
|
{
|
|
|
|
int _year;
|
|
|
|
TBit_array _days;
|
|
|
|
|
|
|
|
public:
|
|
|
|
int read(int year = 0);
|
|
|
|
int write() const;
|
|
|
|
int rewrite() const { return write(); }
|
|
|
|
int remove() const;
|
|
|
|
|
|
|
|
void set_holiday(const TDate& date, bool holiday = true);
|
|
|
|
void reset_holiday(const TDate& date) { set_holiday(date, false);}
|
|
|
|
bool is_holiday(const TDate& date) const;
|
|
|
|
|
|
|
|
|
|
|
|
TLavanderie_calendar(int year);
|
|
|
|
virtual ~TLavanderie_calendar() { }
|
|
|
|
};
|
|
|
|
|
2008-08-12 15:11:26 +00:00
|
|
|
#endif
|