1997-06-06 16:36:35 +00:00
|
|
|
|
// *******************************
|
|
|
|
|
// LIBRERIA di magazzino
|
|
|
|
|
// *******************************
|
|
|
|
|
#ifndef __MGLIB_H
|
|
|
|
|
#define __MGLIB_H
|
|
|
|
|
|
1997-08-21 07:21:00 +00:00
|
|
|
|
#ifndef __MULTIREC_H
|
|
|
|
|
#include <multirec.h>
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
1999-04-16 12:02:04 +00:00
|
|
|
|
#ifndef __MASK_H
|
|
|
|
|
#include <mask.h>
|
1997-07-07 10:37:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#ifndef __FORM_H
|
1997-08-21 07:21:00 +00:00
|
|
|
|
#include <form.h>
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#ifndef __ANAMAG_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/anamag.h"
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#ifndef __UMART_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/umart.h"
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#ifndef __CODCORR_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/codcorr.h"
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#ifndef __DESLIN_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/deslin.h"
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#ifndef __MAG_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/mag.h"
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#ifndef __STOMAG_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/stomag.h"
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1998-05-04 09:59:49 +00:00
|
|
|
|
#ifndef __MOVMAG_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/movmag.h"
|
1998-05-04 09:59:49 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1997-07-07 10:37:11 +00:00
|
|
|
|
#ifndef __RMOVMAG_H
|
2004-03-16 07:43:45 +00:00
|
|
|
|
#include "../mg/rmovmag.h"
|
1997-07-07 10:37:11 +00:00
|
|
|
|
#endif
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1998-06-10 16:38:58 +00:00
|
|
|
|
// campi comuni alla maschere di magazzino
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1997-06-18 15:13:48 +00:00
|
|
|
|
typedef enum {
|
1998-08-25 18:07:30 +00:00
|
|
|
|
riga_dadocumento='D', // derivata da documento
|
|
|
|
|
riga_automatica='A', // generata da causale collegata
|
|
|
|
|
riga_nongenerata=' ' // immissione direttta del mov.
|
1997-06-18 15:13:48 +00:00
|
|
|
|
} TTipo_rigamovmag;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
typedef enum {
|
1997-12-18 17:32:55 +00:00
|
|
|
|
valorizz_ultcos,
|
|
|
|
|
valorizz_mediacos,
|
|
|
|
|
valorizz_przlist,
|
|
|
|
|
valorizz_coststd,
|
1998-06-10 16:38:58 +00:00
|
|
|
|
valorizz_costmedio,
|
1998-08-25 18:07:30 +00:00
|
|
|
|
valorizz_costmediopond,
|
1997-12-18 17:32:55 +00:00
|
|
|
|
valorizz_FIFOa,
|
|
|
|
|
valorizz_LIFOa,
|
|
|
|
|
valorizz_FIFO,
|
|
|
|
|
valorizz_LIFO,
|
|
|
|
|
valorizz_FIFOr,
|
|
|
|
|
valorizz_LIFOr
|
1997-06-06 16:36:35 +00:00
|
|
|
|
} TTipo_valorizz;
|
|
|
|
|
|
2004-05-18 10:44:57 +00:00
|
|
|
|
extern const char* const nome_valorizz(TTipo_valorizz tipo);
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
class TArticolo : public TMultiple_rectype
|
|
|
|
|
{
|
|
|
|
|
protected:
|
1999-04-06 15:34:39 +00:00
|
|
|
|
TString _codice;
|
1998-06-10 16:38:58 +00:00
|
|
|
|
// la get_str supporta anche la sintassi:
|
|
|
|
|
// #LF->fieldname
|
|
|
|
|
// oppure:
|
|
|
|
|
// #LF_par1->fieldname
|
|
|
|
|
// dove:
|
|
|
|
|
// LF = numero logico del sottofile collegato (LF_UMART, LF_DESLIN, LF_CODCORR
|
|
|
|
|
// par1 = chiave dell'indice del file collegato
|
|
|
|
|
// se par1 comincia con '#', esso indica il numero progressivo nell'indice
|
|
|
|
|
// (es:#49_#1: prima unit<69> di misura)
|
|
|
|
|
// fieldname = nome del campo nel file collegato
|
1997-06-06 16:36:35 +00:00
|
|
|
|
virtual const TString & get_str(const char* fieldname) const ;
|
|
|
|
|
virtual void set_body_key(TRectype & rowrec);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual int read(const char * cod, word op = _isequal, word lockop = _nolock);
|
1997-06-18 15:13:48 +00:00
|
|
|
|
virtual int read(TRectype & rec, word op = _isequal, word lockop = _nolock);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
virtual TObject* dup() const { return new TArticolo(codice()); }
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
// restituisce il codice (e' un reference "sicuro" ad una stringa interna)
|
|
|
|
|
const TString& codice() const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
const TString& descrizione(const char * lingua = NULL) const;
|
|
|
|
|
|
1997-06-12 16:38:41 +00:00
|
|
|
|
bool unlock() ;
|
1999-04-06 15:34:39 +00:00
|
|
|
|
bool lock_and_prompt(const char * cod) ;
|
|
|
|
|
void update_ultcosti(const real& costo, const TDate& data, long numreg, int numrig);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
void set_prezzo_vendita(const real& prezzo, const char* um = NULL);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
2003-04-22 14:30:52 +00:00
|
|
|
|
int find_um(const char * um, int from = 0) const;
|
|
|
|
|
int find_deslin(const char * deslin, int from = 0) const;
|
|
|
|
|
int find_codcorr(const char * codcorr, int from = 0) const;
|
|
|
|
|
|
|
|
|
|
static void round_um(real& v, const char* to_um);
|
|
|
|
|
real convert_to_um(const real& v, const char* to_um, const char* from_um = NULL, bool arrotonda = true);
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TRecord_array & um() const { return body(LF_UMART); }
|
|
|
|
|
TRecord_array & deslin() const { return body(LF_DESLIN); }
|
|
|
|
|
TRecord_array & codcorr() const { return body(LF_CODCORR); }
|
|
|
|
|
|
|
|
|
|
TArticolo(const char* codice = NULL);
|
|
|
|
|
TArticolo(const TRectype& rec);
|
|
|
|
|
virtual ~TArticolo();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TArticolo_giacenza : public TArticolo
|
|
|
|
|
{
|
|
|
|
|
TString16 _anno_mag;
|
|
|
|
|
TString16 _anno_sto;
|
|
|
|
|
|
|
|
|
|
protected:
|
1998-06-10 16:38:58 +00:00
|
|
|
|
// 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
|
1997-06-06 16:36:35 +00:00
|
|
|
|
virtual const TString & get_str(const char* fieldname) const ;
|
|
|
|
|
virtual void set_body_key(TRectype & rowrec);
|
|
|
|
|
void set_anno_mag (const char * anno = NULL);
|
|
|
|
|
void set_anno_sto (const char * anno = NULL);
|
|
|
|
|
void reset_anno_mag () { set_anno_mag();}
|
|
|
|
|
void reset_anno_sto () { set_anno_sto();}
|
1998-11-04 18:04:26 +00:00
|
|
|
|
bool is_last_esercizio(const char* annoes) const;
|
2003-09-24 13:37:10 +00:00
|
|
|
|
bool is_deletable(const TRectype& mag) const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
2004-11-30 22:02:59 +00:00
|
|
|
|
void copia_storico(TRecord_array& nrstorico, const char * annoes,const char * codmag, const char * annoprec, real rim, real valrim);
|
1999-10-22 10:00:18 +00:00
|
|
|
|
void add_storico(TRecord_array& nrstorico, const char * annoes,const char * codmag, const real & qta, const real & prz);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
public:
|
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
virtual TObject* dup() const { return new TArticolo_giacenza(codice()); }
|
1997-06-06 16:36:35 +00:00
|
|
|
|
virtual void zero(char c = '\0');
|
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
int find_mag(TRecord_array& rmag, const char * codmag = NULL, const char * livello = NULL, int from = 0) const ;
|
|
|
|
|
int find_storico(TRecord_array& rsto, const char * codmag = NULL, int from = 0) const;
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
int find_mag(const char * annoes, const char * codmag = NULL, const char * livello = NULL, int from = 0) const ;
|
1999-10-22 10:00:18 +00:00
|
|
|
|
int find_storico(const char * annoesrif, const char * codmag = NULL, int from = 0) const;
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TRecord_array & mag(const char * annoes) const;
|
|
|
|
|
TRecord_array & storico(const char * annoesrif) const;
|
1997-12-18 17:32:55 +00:00
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
// calcola disponibilit<69> (anche complessiva su pi<70> depositi o magazzini)
|
|
|
|
|
// solo_giac indica di fare il calcolo della sola giacenza
|
|
|
|
|
real disponibilita(const char * annoes, const char * codmag, const char * livello, bool solo_giac=FALSE) const;
|
1997-12-18 17:32:55 +00:00
|
|
|
|
// La seguente funzione riporta le rimanenze finali dell'esercizio oldes come
|
|
|
|
|
// rimanenze iniziali dell'esercizio newes, valorizzando secondo il tipo passato
|
|
|
|
|
// Si suppone che i saldi siano coerenti con i movimenti (effettuare una rebuild_balances()
|
|
|
|
|
// di oldes.
|
1999-04-26 15:58:05 +00:00
|
|
|
|
bool riporta_saldi(const char * oldes, const char* newes, const TTipo_valorizz tipo,
|
|
|
|
|
const char * catven ,const char * codlist, bool save_to_disk = TRUE);
|
1998-08-25 18:07:30 +00:00
|
|
|
|
// La seguente funzione azzera tutti i saldi di mgazzino per l'esercizio cod_es
|
1999-04-26 15:58:05 +00:00
|
|
|
|
bool azzera_saldi(const char* cod_es, bool save_to_disk = TRUE);
|
1997-12-18 17:32:55 +00:00
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
// valorizzazioni
|
1997-06-06 16:36:35 +00:00
|
|
|
|
real ultimo_costo(const char * annoes) const;
|
|
|
|
|
real media_costi(const char * annoes) const;
|
|
|
|
|
real prezzo_listino(const char * annoes, const char * catven ,const char * codlist) const;
|
|
|
|
|
real costo_standard(const char * annoes) const;
|
|
|
|
|
real costo_medio(const char * annoes, const char * codmag, const char * livello) const;
|
1998-08-25 18:07:30 +00:00
|
|
|
|
real costo_mediopond(const char * annoes, const char * codmag, const char * livello) const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
real LIFO_annuale(const char * annoes, const char * codmag, const char * livello,
|
1999-04-06 15:34:39 +00:00
|
|
|
|
bool giacenza_effettiva = TRUE, bool valorizza_componenti = TRUE) const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
real FIFO_annuale(const char * annoes, const char * codmag, const char * livello,
|
1999-04-06 15:34:39 +00:00
|
|
|
|
bool giacenza_effettiva = TRUE, bool valorizza_componenti = TRUE) const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
real LIFO(const char * annoes, const char * codmag, const char * livello,
|
|
|
|
|
bool giacenza_effettiva = TRUE, bool valorizza_componenti = TRUE) const;
|
|
|
|
|
real FIFO(const char * annoes, const char * codmag, const char * livello,
|
|
|
|
|
bool giacenza_effettiva = TRUE, bool valorizza_componenti = TRUE) const;
|
|
|
|
|
real LIFO_ragionieristico(const char * annoes, const char * codmag, const char * livello,
|
|
|
|
|
bool giacenza_effettiva = TRUE, bool valorizza_componenti = TRUE) const;
|
|
|
|
|
real FIFO_ragionieristico(const char * annoes, const char * codmag, const char * livello,
|
|
|
|
|
bool giacenza_effettiva = TRUE, bool valorizza_componenti = TRUE) const;
|
1999-04-06 15:34:39 +00:00
|
|
|
|
void agg_storicoLIFO (const char * annoes, const char * codmag, bool giac_eff, bool valorizza_componenti) ;
|
|
|
|
|
void agg_storicoFIFO (const char * annoes, const char * codmag, bool giac_eff, bool valorizza_componenti) ;
|
1999-10-22 10:00:18 +00:00
|
|
|
|
void agg_storico(const char * annoes, const char * codmag, bool giac_eff, bool valorizza_componenti, const real& val) ;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1997-07-30 13:29:32 +00:00
|
|
|
|
real giacenza_corretta(const TRectype & rec ,bool giacenza_effettiva,bool valorizza_componenti) const ;
|
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
void put_ultimo_costo(const real& costo, const TDate& data);
|
|
|
|
|
void put_costo_standard(const real& costo);
|
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
real giacenza_anno(const char* codmag, const char* livello, int anno) const;
|
1999-10-22 10:00:18 +00:00
|
|
|
|
real scorta_minima(const char* codmag, const char* livello, int anno=0, bool liv_riordino=FALSE) const;
|
|
|
|
|
long lead_time(const char* codmag, const char* livello, int anno=0) const;
|
1998-11-04 18:04:26 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TArticolo_giacenza(const char* codice = NULL);
|
|
|
|
|
TArticolo_giacenza(const TRectype& rec);
|
|
|
|
|
virtual ~TArticolo_giacenza() {}
|
|
|
|
|
};
|
|
|
|
|
|
1999-04-26 15:58:05 +00:00
|
|
|
|
class TArticolo_giacenza_data : public TArticolo_giacenza
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
virtual int write(TBaseisamfile&) const;
|
|
|
|
|
virtual int rewrite(TBaseisamfile&) const;
|
|
|
|
|
virtual int remove(TBaseisamfile&) const;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void al(const TDate& data, const char* codmag = NULL, const char* livello = NULL,
|
|
|
|
|
TTipo_valorizz tipo = valorizz_costmedio, const char* catven = NULL, const char* codlis = NULL);
|
|
|
|
|
|
|
|
|
|
TArticolo_giacenza_data(const char* codice = NULL);
|
|
|
|
|
TArticolo_giacenza_data(const TRectype& rec);
|
|
|
|
|
};
|
|
|
|
|
|
1999-05-24 13:34:11 +00:00
|
|
|
|
class TArticolo_giacenza_loadable : public TArticolo_giacenza_data
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void load(TIsamtempfile& f);
|
|
|
|
|
TArticolo_giacenza_loadable(const char* codice = NULL);
|
|
|
|
|
TArticolo_giacenza_loadable(const TRectype& rec);
|
|
|
|
|
};
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// *******************************
|
|
|
|
|
// LIBRERIA DI utility del magazzino
|
|
|
|
|
// *******************************
|
1999-04-06 15:34:39 +00:00
|
|
|
|
#define MAX_COD_LEVELS 10
|
1997-06-12 16:38:41 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
class TR_automa;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
|
|
|
|
class TMetachar : public TObject
|
|
|
|
|
{
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TR_automa * _au;
|
|
|
|
|
TString _language;
|
|
|
|
|
char _metach_mand[10];
|
|
|
|
|
char _metach_opz[10];
|
|
|
|
|
|
|
|
|
|
void set_language(const char * language); // setta l'automa che ricosce il linguaggio passato
|
|
|
|
|
void add_tran(int statenum,unsigned char symbol,int next);// aggiunge le transizioni all'automa
|
|
|
|
|
public:
|
1997-07-24 14:50:37 +00:00
|
|
|
|
// @cmember restituisce la lunghezza massima della stringa che soddisfa il formato passato
|
|
|
|
|
static int maxstrlen(const char * format);
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
const char * language() const; // restituisce la stringa di metacaratteri del linguaggio riconosciuto
|
|
|
|
|
bool recognized(const char * pattern);
|
|
|
|
|
|
|
|
|
|
bool has_opzchars(const char * pattern);
|
|
|
|
|
bool has_mandchars(const char * pattern);
|
|
|
|
|
|
|
|
|
|
const char *mand_chars() {return _metach_mand;};
|
|
|
|
|
const char *opz_chars() {return _metach_opz;};
|
|
|
|
|
TMetachar(const char * str);
|
|
|
|
|
TMetachar();
|
1997-07-07 10:37:11 +00:00
|
|
|
|
virtual ~TMetachar();
|
1997-06-06 16:36:35 +00:00
|
|
|
|
};
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
|
|
|
|
class TCodice_livelli : public TObject
|
|
|
|
|
{
|
1997-08-26 13:48:11 +00:00
|
|
|
|
long _last_firm;
|
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
bool _autoinsert[MAX_COD_LEVELS];
|
|
|
|
|
bool _codiceadata[MAX_COD_LEVELS];
|
|
|
|
|
int _code_length[MAX_COD_LEVELS];
|
|
|
|
|
TString _name[MAX_COD_LEVELS];
|
|
|
|
|
TString _picture[MAX_COD_LEVELS];
|
1997-08-26 13:48:11 +00:00
|
|
|
|
int _last_level;
|
|
|
|
|
TDecoder *_gruppi;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
1997-08-26 13:48:11 +00:00
|
|
|
|
bool _lev_enabled;
|
|
|
|
|
TArray _metachars;
|
1997-07-24 14:50:37 +00:00
|
|
|
|
|
1997-08-01 14:52:36 +00:00
|
|
|
|
void load(bool e, const char *tabcod,const char *tabgrp);
|
1997-07-07 10:37:11 +00:00
|
|
|
|
void add_metachar(int lev);
|
1997-08-26 13:48:11 +00:00
|
|
|
|
|
|
|
|
|
void update_firm();
|
|
|
|
|
void test_firm();
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
|
|
|
|
public:
|
1999-04-06 15:34:39 +00:00
|
|
|
|
// Ritorna il numero massimo di livelli possibili
|
|
|
|
|
virtual inline int max_levels() const {return MAX_COD_LEVELS;}
|
1997-07-07 10:37:11 +00:00
|
|
|
|
// Ritorna il numero di livelli abilitati
|
1997-08-21 07:21:00 +00:00
|
|
|
|
int last_level() const { return enabled() ? _last_level : 0; }
|
1997-08-01 14:52:36 +00:00
|
|
|
|
// Abilita la gestione dei livelli
|
|
|
|
|
void enable(bool on=TRUE) ;
|
1997-07-24 14:50:37 +00:00
|
|
|
|
// Ritorna se la gestione dei livelli <20> abilitata
|
|
|
|
|
const bool enabled() const ;
|
|
|
|
|
// Ritorna se il livello specificato <20> abilitato
|
|
|
|
|
const bool enabled(int levnum) const ;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
// Ritorna il nome (descrizione) di quel livello
|
|
|
|
|
const TString & name(int levnum) const ;
|
|
|
|
|
// Ritorna la stringa di picture per i codici gruppo di quel livello
|
|
|
|
|
const TString & picture(int levnum) const;
|
|
|
|
|
// Ritorna la lunghezza dei codici gruppo di quel livello
|
1997-08-25 15:29:15 +00:00
|
|
|
|
const int code_length(int levnum) const ;
|
1997-08-19 13:10:58 +00:00
|
|
|
|
// Ritorna la posizione iniziale del codice gruppo di quel livello
|
|
|
|
|
const int code_start(int levnum) const ;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
// Ritorna la lunghezza del codice compatto fino a quel livello
|
1997-08-26 13:48:11 +00:00
|
|
|
|
const int packed_length(int levnum) const ;
|
1998-11-04 18:04:26 +00:00
|
|
|
|
// Restituisce se esiste il gruppo dato il codice (compatto e non)
|
|
|
|
|
const int group_search(const char * code, int levnum) const;
|
|
|
|
|
const int group_search_packed(const char * packed_code, int levnum) const;
|
|
|
|
|
// Restituisce la descrizione del gruppo dato il codice (compatto e non)
|
|
|
|
|
const TString & group_descr(const char * code, int levnum) const;
|
|
|
|
|
const TString & group_descr_packed(const char * packed_code, int levnum) const;
|
1998-08-25 18:07:30 +00:00
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
|
|
|
|
|
// Setta il prompt del campo sulla maschera
|
|
|
|
|
void set_mask_field(TMask &m,int field, int lev) const;
|
|
|
|
|
// Setta i prompt dei campi livelli di codice sulla maschera
|
|
|
|
|
void set_mask_fields(TMask &m,int firstfield) const;
|
1997-07-24 14:50:37 +00:00
|
|
|
|
// Setta la colonna del campo livello codice di uno sheet in base alle abilitazioni
|
|
|
|
|
void set_sheetcolumn(TSheet_field &fld_righe,int field, int lev) const;
|
1999-04-06 15:34:39 +00:00
|
|
|
|
// Setta le colonne dei campi livello codice di uno sheet in base alle abilitazioni
|
|
|
|
|
void set_sheet_columns(TSheet_field &sht, short dlg) const;
|
1998-11-04 18:04:26 +00:00
|
|
|
|
// costruisce il codice compatto e viceversa
|
|
|
|
|
void pack_maskgrpcodes(TString & pc, const TMask & m, int field, int level);
|
1997-07-07 10:37:11 +00:00
|
|
|
|
void pack_grpcode(TString & pc, const TString &codlev, const int levnum); // Inserisce il codice del gruppo del livello levnum in pc
|
|
|
|
|
TString unpack_grpcode(const TString & pc, const int levnum) const ; // Estrae il codice del gruppo del livello levnum da pc
|
1998-11-04 18:04:26 +00:00
|
|
|
|
// costruisce il codice della tabella di decodifica dei livelli
|
|
|
|
|
TString build_tabcode(const TString & code, const int levnum) const ;
|
|
|
|
|
TString build_tabcode_packed(const TString & pcode, const int levnum) const ;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
|
|
|
|
// Restituisce il formato previsto per il codice (default==ultimo livello)
|
1999-10-22 10:00:18 +00:00
|
|
|
|
const char* code_format(int levnum=-1) const ;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
// Restituisce se <p codepart> e' riconosciuto come codice articolo (default==ultimo livello)
|
1998-11-04 18:04:26 +00:00
|
|
|
|
bool fit_to_format(const char *codepart, int levnum=-1) const ;
|
1998-08-25 18:07:30 +00:00
|
|
|
|
// Ritorna se il livello <20> abilitato all'autoinserimento
|
|
|
|
|
const bool autoinsert (int levnum) const ;
|
1998-11-04 18:04:26 +00:00
|
|
|
|
// Tenta l'autoinserimento; Ritorna se l'operazione ha avuto successo
|
|
|
|
|
const bool autoinsert(int levnum, TString & newcode) const;
|
|
|
|
|
const bool autoinsert(int levnum, TMask_field & fld) const;
|
1998-08-25 18:07:30 +00:00
|
|
|
|
// Ritorna se il codice del livello rappresenta una data
|
|
|
|
|
const bool codiceadata(int levnum) const ;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
|
|
|
|
|
/* bool has_mandchars(const char * pattern);
|
|
|
|
|
bool has_opzchars(const char * pattern);
|
|
|
|
|
const char * opz_chars();
|
|
|
|
|
const char * mand_chars();*/
|
|
|
|
|
|
1997-08-26 13:48:11 +00:00
|
|
|
|
virtual void init() pure;
|
|
|
|
|
|
|
|
|
|
TCodice_livelli(); // costruttore
|
|
|
|
|
virtual ~TCodice_livelli(); // distruttore
|
1997-07-07 10:37:11 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TCodart_livelli : public TCodice_livelli
|
|
|
|
|
{
|
|
|
|
|
public:
|
1999-04-06 15:34:39 +00:00
|
|
|
|
virtual inline int max_levels() const {return 10;}
|
1997-08-26 13:48:11 +00:00
|
|
|
|
virtual void init();
|
|
|
|
|
|
1997-07-07 10:37:11 +00:00
|
|
|
|
TCodart_livelli(); // costruttore
|
|
|
|
|
virtual ~TCodart_livelli() ; // distruttore
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TCodgiac_livelli : public TCodice_livelli
|
|
|
|
|
{
|
|
|
|
|
public:
|
1999-04-06 15:34:39 +00:00
|
|
|
|
virtual inline int max_levels() const {return 4;}
|
1997-08-26 13:48:11 +00:00
|
|
|
|
virtual void init();
|
|
|
|
|
|
1997-07-07 10:37:11 +00:00
|
|
|
|
TCodgiac_livelli(); // costruttore
|
|
|
|
|
virtual ~TCodgiac_livelli() {}; // distruttore
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
1997-08-21 07:18:42 +00:00
|
|
|
|
// *********************
|
|
|
|
|
// classe che incapsula tutti i magazzini
|
|
|
|
|
class TMagazzini : public TRecord_cache
|
|
|
|
|
{
|
|
|
|
|
TString16 _stdmag;
|
|
|
|
|
TString16 _stddep;
|
1998-04-30 14:59:47 +00:00
|
|
|
|
TConfig *_mgconfig;
|
2004-03-16 07:43:45 +00:00
|
|
|
|
long _last_firm;
|
1998-04-30 14:59:47 +00:00
|
|
|
|
bool _gestmag ;
|
|
|
|
|
bool _gestdep ;
|
|
|
|
|
char _gestubi ;
|
|
|
|
|
bool _gestmultimag;
|
|
|
|
|
private:
|
|
|
|
|
void init();
|
|
|
|
|
void test_firm() const;
|
|
|
|
|
|
1997-08-21 07:18:42 +00:00
|
|
|
|
public:
|
1997-08-22 09:11:26 +00:00
|
|
|
|
const TString & standardmag() const
|
1998-04-30 14:59:47 +00:00
|
|
|
|
{test_firm() ; return _stdmag;}
|
1997-08-22 09:11:26 +00:00
|
|
|
|
const TString & standarddep() const
|
1998-04-30 14:59:47 +00:00
|
|
|
|
{test_firm() ; return _stddep;}
|
|
|
|
|
bool gestmag(bool verbose=FALSE) const ;
|
|
|
|
|
bool gestdep() const ;
|
|
|
|
|
bool gestubi_man() const ;
|
|
|
|
|
bool gestubi_tab() const ;
|
|
|
|
|
bool gestmultimag() const ;
|
1997-08-21 07:18:42 +00:00
|
|
|
|
|
|
|
|
|
TMagazzini();
|
1998-04-30 14:59:47 +00:00
|
|
|
|
virtual ~TMagazzini();
|
1997-08-21 07:18:42 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// *********************
|
|
|
|
|
// classe che incapsula le causali di magazzino (record della tabella CAU)
|
1997-07-07 10:37:11 +00:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
1997-06-06 16:36:35 +00:00
|
|
|
|
s_giac,
|
|
|
|
|
s_acq,s_ent,
|
|
|
|
|
s_ven,s_usc,
|
|
|
|
|
s_ordc,s_ordf,
|
|
|
|
|
s_acl,s_incl,
|
|
|
|
|
s_prodc,s_prodf,
|
|
|
|
|
s_rim,
|
|
|
|
|
s_scart,
|
1997-08-19 13:10:58 +00:00
|
|
|
|
s_label,
|
|
|
|
|
s_user1,
|
|
|
|
|
s_user2,
|
|
|
|
|
s_user3,
|
|
|
|
|
s_user4,
|
|
|
|
|
s_user5,
|
|
|
|
|
s_user6
|
1997-06-06 16:36:35 +00:00
|
|
|
|
} TTipo_saldomag;
|
|
|
|
|
|
1997-07-07 10:37:11 +00:00
|
|
|
|
class TCausale_magazzino : public TRectype
|
|
|
|
|
{
|
1997-06-06 16:36:35 +00:00
|
|
|
|
public:
|
1997-07-07 10:37:11 +00:00
|
|
|
|
const TString & codice() const {return get("CODTAB");}
|
|
|
|
|
const TString & descr() const {return get("S0");}
|
|
|
|
|
char tipoprz() const {return get_char("S6");}
|
|
|
|
|
char tipomov() const {return get_char("S7");}
|
1999-04-06 15:34:39 +00:00
|
|
|
|
const TString & raggfisc() const {return get("S8");}
|
|
|
|
|
const TString & caus_collegata() const {return get("S9");}
|
|
|
|
|
int sgn(TTipo_saldomag fieldname) const;
|
1998-08-25 18:07:30 +00:00
|
|
|
|
bool update_qta() const {return !get_bool("B1");}
|
|
|
|
|
bool update_val() const {return !get_bool("B0");}
|
|
|
|
|
bool update_ultcos() const {return get_bool("B2");}
|
|
|
|
|
bool esplodente() const {return get_bool("B3");}
|
2003-01-28 13:33:45 +00:00
|
|
|
|
bool scarica_artprod() const {return get_bool("B4");}
|
|
|
|
|
bool movimenta_sospesi() const {return get_bool("B5");}
|
1998-08-25 18:07:30 +00:00
|
|
|
|
const TString & default_magdep() const {return get("S10");}
|
1998-11-04 18:04:26 +00:00
|
|
|
|
const char *default_mag() const {return get("S10").mid(0,3);}
|
|
|
|
|
const char *default_dep() const {return get("S10").mid(3,2);}
|
|
|
|
|
bool has_default_mag() const {return *default_mag() > ' '; }
|
|
|
|
|
bool has_default_dep() const {return *default_dep() > ' '; }
|
1997-07-07 10:37:11 +00:00
|
|
|
|
bool is_fiscale();
|
1997-06-12 16:38:41 +00:00
|
|
|
|
TCausale_magazzino(const char * codice);
|
1999-06-18 15:35:05 +00:00
|
|
|
|
TCausale_magazzino(const TRectype &r);
|
1997-07-07 10:37:11 +00:00
|
|
|
|
virtual ~TCausale_magazzino() {}
|
1997-06-06 16:36:35 +00:00
|
|
|
|
};
|
|
|
|
|
|
1999-04-26 15:58:05 +00:00
|
|
|
|
class TLine_movmag;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
// classe per la definizione dei movimenti di magazzino
|
|
|
|
|
// ( un movimento (testata+righe) == un oggetto TMov_mag )
|
1997-07-07 10:37:11 +00:00
|
|
|
|
class TMov_mag : public TMultiple_rectype
|
|
|
|
|
{
|
1999-06-18 15:35:05 +00:00
|
|
|
|
static TCausale_magazzino *_causmag;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
//
|
1999-04-06 15:34:39 +00:00
|
|
|
|
TString16 _annoes; // codice esercizio del movimento
|
|
|
|
|
TDate _datacomp; // data di competenza
|
1997-06-06 16:36:35 +00:00
|
|
|
|
//
|
1997-06-18 15:13:48 +00:00
|
|
|
|
TArticolo_giacenza curr_art;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TAssoc_array lines_to_add;
|
|
|
|
|
TAssoc_array lines_to_subtract;
|
|
|
|
|
|
|
|
|
|
protected:
|
1998-11-04 18:04:26 +00:00
|
|
|
|
virtual void load_rows_file(int logicnum);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
virtual void set_body_key(TRectype & rowrec);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
virtual bool key_complete();
|
1997-06-06 16:36:35 +00:00
|
|
|
|
virtual bool renum(); // rinumerazione ;
|
|
|
|
|
|
|
|
|
|
// ************ gestione saldi
|
|
|
|
|
// @member: compone le parti chiave + dati a partire dalla riga dello sheet
|
|
|
|
|
void line2key_data(int numriga, TToken_string &key,TLine_movmag &rest) const;
|
|
|
|
|
// @member: compone la chiave a partire dalla riga dello sheet
|
1997-07-07 10:37:11 +00:00
|
|
|
|
TToken_string & line2key(int numriga) const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// @member: compone la dati a partire dalla riga dello sheet
|
1999-04-26 15:58:05 +00:00
|
|
|
|
TLine_movmag& line2data(int numriga) const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// @member: estrae dalla Tokenstring della chiave i valori corrispondenti ai campi del file
|
|
|
|
|
static TString key2field(TToken_string &key,const char * f);
|
|
|
|
|
// @member: memorizza la linea come "da togliere"
|
1997-07-07 10:37:11 +00:00
|
|
|
|
int line_deleted(TToken_string &key,TLine_movmag &rest);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// @member: memorizza la linea come "da aggiungere"
|
1997-07-07 10:37:11 +00:00
|
|
|
|
int line_inserted(TToken_string &key,TLine_movmag &rest);
|
1998-11-04 18:04:26 +00:00
|
|
|
|
// @member: memorizza le linee attuali: tutte da togliere e nessuna da aggiungere (o viceversa)
|
|
|
|
|
void mark_current_lines(const bool as_deleted=TRUE);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// @member: effettua l'aggiornamento dei saldi relativi alle giacenze interessate al movimento
|
1997-06-18 15:13:48 +00:00
|
|
|
|
int update_balances() ;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// @member: effettua l'aggiornamento dei saldi di una giacenza
|
1997-07-07 10:37:11 +00:00
|
|
|
|
int update_balances(TRectype & magrec, const TLine_movmag &l,int sign) ;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
// @member: effettua l'aggiornamento di un saldo di una giacenza
|
|
|
|
|
void update_balance(TRectype & magrec, const char * fieldname, real diff) const;
|
|
|
|
|
|
1997-06-12 16:38:41 +00:00
|
|
|
|
static void giac_putkey(TLocalisamfile & mag,TString16 annoes,TToken_string curr_key);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
static bool lock_anamag(const char *codart);
|
|
|
|
|
static bool unlock_anamag(const char *codart) ;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
virtual const char * codmag_rauto(int r) const { return NULL;}
|
|
|
|
|
virtual const char * prezzo_rauto(int r) const { return NULL;}
|
|
|
|
|
|
|
|
|
|
// @member: restituisce il codice del magazzino della riga automatica accoppiata a <par r>
|
1998-11-04 18:04:26 +00:00
|
|
|
|
//virtual const char * codmag_rauto(int r)
|
|
|
|
|
//{return NULL;}
|
1997-07-07 10:37:11 +00:00
|
|
|
|
// @member: restituisce il prezzo della riga automatica accoppiata a <par r>
|
1998-11-04 18:04:26 +00:00
|
|
|
|
//virtual const char * prezzo_rauto(int r)
|
|
|
|
|
//{return NULL;}
|
1998-08-25 18:07:30 +00:00
|
|
|
|
// aggiunge le righe automatiche e da esplosione
|
|
|
|
|
void add_extrarows() const;
|
|
|
|
|
// aggiunge le righe automatiche
|
|
|
|
|
bool add_autorows() const;
|
|
|
|
|
// aggiunge le righe da esplosione
|
|
|
|
|
bool add_explrows() const;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
public:
|
|
|
|
|
// IO ad alto livello
|
1999-04-06 15:34:39 +00:00
|
|
|
|
virtual const char *get_next_key() ;
|
1997-06-12 16:38:41 +00:00
|
|
|
|
virtual int remove(TBaseisamfile& f) const ;
|
1998-01-09 16:33:25 +00:00
|
|
|
|
virtual void zero(char c = '\0');// azzeramento ;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
virtual int write(TBaseisamfile& f) const ;
|
|
|
|
|
virtual int rewrite(TBaseisamfile& f) const ;
|
1997-06-12 16:38:41 +00:00
|
|
|
|
int force_update_bal();
|
1999-04-06 15:34:39 +00:00
|
|
|
|
const TCausale_magazzino& causale(const char* cod = NULL) const;
|
1997-06-12 16:38:41 +00:00
|
|
|
|
|
1999-04-26 15:58:05 +00:00
|
|
|
|
// @member: effettua l'aggiornamento dei saldi di una giacenza
|
|
|
|
|
int update_balances(TRectype& magrec, int numrig, int sign);
|
|
|
|
|
|
1997-06-12 16:38:41 +00:00
|
|
|
|
//
|
1999-04-06 15:34:39 +00:00
|
|
|
|
int codice_esercizio(const TDate &d);
|
1999-05-24 13:34:11 +00:00
|
|
|
|
|
1997-06-12 16:38:41 +00:00
|
|
|
|
// costruttori e distruttori
|
|
|
|
|
TMov_mag();
|
|
|
|
|
virtual ~TMov_mag();
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
bool rebuild_balances(const TString& annoes,
|
1998-08-25 18:07:30 +00:00
|
|
|
|
const TTipo_valorizz tipo=valorizz_costmediopond,
|
|
|
|
|
const char* catven=NULL,
|
|
|
|
|
const char* codlis=NULL);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
#define FORM_MAXGIACLEV 4 // numero di livelli giacenza nel form
|
|
|
|
|
#define FORM_MAXARTLEV 8 // numero di livelli codice nel form
|
|
|
|
|
#define UNKNOWN_NAME "-"
|
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
typedef enum {
|
1999-10-22 10:00:18 +00:00
|
|
|
|
mg_normale, // Codice o descrizione
|
|
|
|
|
mg_ragg_fisc, // Raggr. Fiscale + Codice Articolo
|
|
|
|
|
mg_cat_merc, // Cat. Merceologica[1..3] + Codice Articolo
|
|
|
|
|
mg_scat_merc // Cat. Merceologica[1..5] + Codice Articolo
|
1999-04-06 15:34:39 +00:00
|
|
|
|
} TTipo_ordinamento_mg;
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
class TForm_stampemg : public TForm
|
|
|
|
|
{
|
1997-06-12 16:38:41 +00:00
|
|
|
|
bool _permag;
|
|
|
|
|
int _fromlivgiac,_tolivgiac,_fromlivart,_tolivart;
|
1999-04-06 15:34:39 +00:00
|
|
|
|
TTipo_ordinamento_mg _ordering;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
//sostituire con le funzioni di TLivelli_... :
|
|
|
|
|
//TDecoder *_giacgrp,*_artgrp;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1998-11-04 18:04:26 +00:00
|
|
|
|
protected:
|
|
|
|
|
bool setdettaglio(bool show, int fromlivart,int livart,int fromlivgiac,int livgiac,bool dettgiac);
|
|
|
|
|
void add_giaclev(TString &levname,int from,int to);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
real ordinato(int flag) const; // Ordinato fornitori - clienti
|
|
|
|
|
|
1998-04-30 14:59:47 +00:00
|
|
|
|
public:
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
public:
|
1997-06-12 16:38:41 +00:00
|
|
|
|
void gruppogiac(TForm_item &cf, TToken_string &s);
|
|
|
|
|
void gruppoart(TForm_item &cf, TToken_string &s);
|
1998-06-10 16:38:58 +00:00
|
|
|
|
void codgruppogiac(TForm_item &cf, TToken_string &s);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
virtual bool validate(TForm_item &cf, TToken_string &s);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
void set_ordering(const TTipo_ordinamento_mg t);
|
|
|
|
|
TTipo_ordinamento_mg get_ordering() const { return _ordering; }
|
1998-06-10 16:38:58 +00:00
|
|
|
|
bool setdett_perart(bool totaliart, int fromlivart,int livart,bool totaligiac, int fromlivgiac,int livgiac,bool showmag, bool showdep);
|
|
|
|
|
bool setdett_permag(bool totaliart, int fromlivart,int livart,bool totaligiac, int fromlivgiac, int livgiac,bool showmag, bool showdep,bool showdett);
|
1997-06-12 16:38:41 +00:00
|
|
|
|
TForm_stampemg(const char *name,const char *code) ;
|
1997-07-07 10:37:11 +00:00
|
|
|
|
virtual ~TForm_stampemg();
|
1997-06-06 16:36:35 +00:00
|
|
|
|
};
|
|
|
|
|
|
1998-04-30 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
class TStampemg_mask: public TMask
|
|
|
|
|
{
|
|
|
|
|
TMagazzini _magazz_ini;
|
|
|
|
|
public:
|
1998-06-10 16:38:58 +00:00
|
|
|
|
void enable_livellicodice() ;
|
|
|
|
|
void set_livellicodice() ;
|
1998-04-30 14:59:47 +00:00
|
|
|
|
TMagazzini & magazz_ini() {return _magazz_ini;}
|
1998-06-10 16:38:58 +00:00
|
|
|
|
TStampemg_mask(const char * name) : TMask(name){;}
|
1998-04-30 14:59:47 +00:00
|
|
|
|
virtual ~TStampemg_mask(){}
|
|
|
|
|
};
|
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
TCodgiac_livelli &livelli_giacenza();
|
|
|
|
|
TCodart_livelli &livelli_articolo();
|
1998-04-30 14:59:47 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
class TCondizione_vendita : public TObject
|
|
|
|
|
{
|
|
|
|
|
TString80 _sconto;
|
|
|
|
|
TString16 _codiva;
|
|
|
|
|
real _prezzo;
|
|
|
|
|
real _provv;
|
|
|
|
|
real _molt_sconto;
|
|
|
|
|
TLocalisamfile _condv;
|
|
|
|
|
TLocalisamfile _rcondv;
|
|
|
|
|
TLocalisamfile _sconti;
|
|
|
|
|
TLocalisamfile * _anamag; // file passato e posizionato esternamente
|
1997-06-12 16:38:41 +00:00
|
|
|
|
TLocalisamfile * _umart; // file passato e posizionato esternamente
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TConfig * _config_ditta;
|
|
|
|
|
bool _load_mask;
|
2004-03-16 07:43:45 +00:00
|
|
|
|
bool _ivarid;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1999-10-22 10:00:18 +00:00
|
|
|
|
bool cerca(int tiporicerca,const char * cod, const real & qta, const char *um=NULL);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
TRectype & testa() const { return (_condv.curr()); }
|
|
|
|
|
TRectype & riga() const { return (_rcondv.curr()); }
|
|
|
|
|
TLocalisamfile & anamag() const { CHECK(_anamag, "Anagrafica di magazzino non inizializzata") ; return *_anamag; }
|
|
|
|
|
TLocalisamfile & umart() const { CHECK(_umart, "Anagrafica di unita' di misura magazzino non inizializzata") ; return *_umart; }
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
real get_prezzo() const { return _prezzo; }
|
|
|
|
|
|
|
|
|
|
TConfig &config_ditta() const { return *_config_ditta; }
|
|
|
|
|
void set_config( TConfig & ditta){ _config_ditta = &ditta; }
|
|
|
|
|
void set_anamag(TLocalisamfile & anamag) { _anamag = &anamag; }
|
|
|
|
|
void set_umart(TLocalisamfile & umart) { _umart = &umart; }
|
|
|
|
|
|
|
|
|
|
bool gestum() const { return _condv.get_bool("GESTUM"); }
|
|
|
|
|
|
1997-06-12 16:38:41 +00:00
|
|
|
|
// prepara la ricerca
|
|
|
|
|
void put_condv(const char *tipocv,const char * codcv,const char *catven,const char *tipocf,const char *codcf);
|
|
|
|
|
void put_listino(const char * codlist,const char *catven);
|
|
|
|
|
void put_contratto(const char * codcontr,const char *tipocf,const char *codcf);
|
|
|
|
|
void put_offerta(const char * codoff);
|
|
|
|
|
// ricerca il codice
|
1999-04-06 15:34:39 +00:00
|
|
|
|
bool ricerca(const char * cod, const real& qta = ZERO) ;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
TCondizione_vendita(TConfig * _ditta = NULL, TLocalisamfile * anamag = NULL, TLocalisamfile * umart = NULL);
|
1997-07-07 10:37:11 +00:00
|
|
|
|
virtual ~TCondizione_vendita() {}
|
1997-06-06 16:36:35 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TIPOREG_VEN 1
|
|
|
|
|
#define TIPOREG_ACQ 2
|
|
|
|
|
#define TIPOREG_IVA 3
|
|
|
|
|
#define TIPOREG_INCPAG 4
|
|
|
|
|
#define TIPOREG_GIO 5
|
|
|
|
|
#define TIPOREG_LIBSOC 6
|
|
|
|
|
#define TIPOREG_CESPIT 7
|
|
|
|
|
#define TIPOREG_INVENT 8
|
|
|
|
|
#define TIPOREG_GIOMAG 9
|
|
|
|
|
|
|
|
|
|
class TRegistro_std : public TRectype
|
|
|
|
|
{
|
1997-06-12 16:38:41 +00:00
|
|
|
|
TString80 _intest;
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
1997-06-12 16:38:41 +00:00
|
|
|
|
bool read(const char* cod, int year);
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
int year() const;
|
|
|
|
|
const TString& code() const ;
|
|
|
|
|
|
|
|
|
|
const TString & descr() const { return get("S0"); }
|
|
|
|
|
int tipo() const { return get_int("I0"); }
|
|
|
|
|
|
|
|
|
|
const TString & cod_intest() const { return get("S7"); }
|
|
|
|
|
const TString intest() const;
|
|
|
|
|
const TString & luogo_conserv() const { return get("S1"); }
|
1997-06-12 16:38:41 +00:00
|
|
|
|
int pag_stampate() const{ return get_int("I1"); }
|
|
|
|
|
int pag_numerate() const{ return get_int("I2"); }
|
|
|
|
|
TDate vidimazione() const { return get_date("D0"); }
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TDate scadenza() const { return get_date("D1"); }
|
|
|
|
|
TDate last_print() const { return get_date("D3"); }
|
1997-06-12 16:38:41 +00:00
|
|
|
|
bool stampa_intditta() const { return get_bool("B9"); }
|
|
|
|
|
|
|
|
|
|
void set_pag_stampate(int p) { put("I1",p); }
|
2004-03-16 07:43:45 +00:00
|
|
|
|
void set_last_print(const TDate d) { put("D3",d); }
|
1997-06-06 16:36:35 +00:00
|
|
|
|
|
1997-06-12 16:38:41 +00:00
|
|
|
|
bool write(bool re) const ;
|
|
|
|
|
bool rewrite() const {return write(TRUE);}
|
1997-10-15 14:44:29 +00:00
|
|
|
|
int lock();
|
|
|
|
|
int unlock();
|
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
TRegistro_std(const char* code = "", int year = 0);
|
|
|
|
|
virtual ~TRegistro_std() {}
|
|
|
|
|
};
|
|
|
|
|
|
1999-04-06 15:34:39 +00:00
|
|
|
|
const char * add_magcode(TString & codmagdep, const char * m);
|
|
|
|
|
const char * add_depcode(TString & codmagdep, const char * d);
|
2000-05-05 15:25:49 +00:00
|
|
|
|
const char * get_magcode(TString & codmagdep);
|
|
|
|
|
const char * get_depcode(TString & codmagdep);
|
|
|
|
|
bool riporta_ordinato();
|
2004-09-27 09:21:34 +00:00
|
|
|
|
const TArticolo & cached_articolo(const char * codsrt);
|
1999-04-06 15:34:39 +00:00
|
|
|
|
|
1997-06-06 16:36:35 +00:00
|
|
|
|
#endif //__MGLIB_H
|
1998-08-25 18:07:30 +00:00
|
|
|
|
|