FIles fnormati
git-svn-id: svn://10.65.10.50/trunk@4171 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
831763f4fb
commit
5861624bfc
@ -1,3 +1,3 @@
|
|||||||
109
|
109
|
||||||
0
|
0
|
||||||
$mag|0|0|477|32|Giacenze di magazzino|||
|
$mag|0|0|477|32|Giacenze di magazzino|||
|
||||||
|
78
mg/f109.trr
78
mg/f109.trr
@ -1,39 +1,39 @@
|
|||||||
109
|
109
|
||||||
34
|
34
|
||||||
CODMAG|1|5|0|Codice magazzino e deposito
|
CODMAG|1|5|0|Codice magazzino e deposito
|
||||||
CODART|1|20|0|Codice articolo
|
CODART|1|20|0|Codice articolo
|
||||||
LIVELLO|1|15|0|Livello di magazzino
|
LIVELLO|1|15|0|Livello di magazzino
|
||||||
NRIGA|2|3|0|-numero riga per sheet anagrafica-
|
NRIGA|2|3|0|-numero riga per sheet anagrafica-
|
||||||
ANNOES|2|4|0|Codice esercizio
|
ANNOES|2|4|0|Codice esercizio
|
||||||
DATARIF|5|8|0|Data di riferimento
|
DATARIF|5|8|0|Data di riferimento
|
||||||
UBICAZ|1|12|0|Codice ubicazione
|
UBICAZ|1|12|0|Codice ubicazione
|
||||||
RIM|4|15|5|Rimanenze iniziali
|
RIM|4|15|5|Rimanenze iniziali
|
||||||
VALRIM|4|18|3|Valore rimanenze iniziali
|
VALRIM|4|18|3|Valore rimanenze iniziali
|
||||||
ACQ|4|15|5|Acquistato
|
ACQ|4|15|5|Acquistato
|
||||||
VALACQ|4|18|3|Valore acquistato
|
VALACQ|4|18|3|Valore acquistato
|
||||||
ENT|4|15|5|Entrato
|
ENT|4|15|5|Entrato
|
||||||
VALENT|4|18|3|Valore entrato
|
VALENT|4|18|3|Valore entrato
|
||||||
VEN|4|15|5|Venduto
|
VEN|4|15|5|Venduto
|
||||||
VALVEN|4|18|3|Valore venduto
|
VALVEN|4|18|3|Valore venduto
|
||||||
USC|4|15|5|Uscito
|
USC|4|15|5|Uscito
|
||||||
VALUSC|4|18|3|Valore uscito
|
VALUSC|4|18|3|Valore uscito
|
||||||
GIAC|4|15|5|Giacenza
|
GIAC|4|15|5|Giacenza
|
||||||
ORDF|4|15|5|Ordinato fornitori
|
ORDF|4|15|5|Ordinato fornitori
|
||||||
VALORDF|4|18|3|Valore ordinato fornitori
|
VALORDF|4|18|3|Valore ordinato fornitori
|
||||||
ORDC|4|15|5|Ordinato clienti
|
ORDC|4|15|5|Ordinato clienti
|
||||||
VALORDC|4|18|3|Valore ordinato clienti
|
VALORDC|4|18|3|Valore ordinato clienti
|
||||||
INCL|4|15|5|In conto lavorazione
|
INCL|4|15|5|In conto lavorazione
|
||||||
ACL|4|15|5|A conto lavorazione
|
ACL|4|15|5|A conto lavorazione
|
||||||
PRODCOMP|4|15|5|Componenti in produzione
|
PRODCOMP|4|15|5|Componenti in produzione
|
||||||
PRODFIN|4|15|5|Assemblati in produzione
|
PRODFIN|4|15|5|Assemblati in produzione
|
||||||
NLABEL|4|10|0|Numero etichette da stampare
|
NLABEL|4|10|0|Numero etichette da stampare
|
||||||
NDIST|4|15|5|Distinte da scaricare
|
NDIST|4|15|5|Distinte da scaricare
|
||||||
SCARTI|4|15|5|Scarti
|
SCARTI|4|15|5|Scarti
|
||||||
VALSCARTI|4|15|5|Valore scarti
|
VALSCARTI|4|15|5|Valore scarti
|
||||||
LIVRIOR|4|15|3|Livello di riordino
|
LIVRIOR|4|15|3|Livello di riordino
|
||||||
LOTTORIOR|4|15|3|Lotto minimo di riordino
|
LOTTORIOR|4|15|3|Lotto minimo di riordino
|
||||||
GIORNIRIOR|1|3|0|Numero di giorni di riordino
|
GIORNIRIOR|1|3|0|Numero di giorni di riordino
|
||||||
SCORTAMIN|4|15|5|Scorta minima
|
SCORTAMIN|4|15|5|Scorta minima
|
||||||
2
|
2
|
||||||
ANNOES+CODART+NRIGA|
|
ANNOES+CODART+NRIGA|
|
||||||
ANNOES+CODMAG+CODART+LIVELLO|X
|
ANNOES+CODMAG+CODART+LIVELLO|X
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
110
|
110
|
||||||
0
|
0
|
||||||
$movmag|0|0|125|32|Movimenti di magazzino (?)|||
|
$movmag|0|0|125|32|Movimenti di magazzino (?)|||
|
||||||
|
46
mg/f110.trr
46
mg/f110.trr
@ -1,23 +1,23 @@
|
|||||||
110
|
110
|
||||||
16
|
16
|
||||||
NUMREG|3|7|0|Numero di registrazione
|
NUMREG|3|7|0|Numero di registrazione
|
||||||
ANNOES|2|4|0|Codice esercizio
|
ANNOES|2|4|0|Codice esercizio
|
||||||
DATAREG|5|8|0|Data registrazione
|
DATAREG|5|8|0|Data registrazione
|
||||||
DATACOMP|5|8|0|Data competenza
|
DATACOMP|5|8|0|Data competenza
|
||||||
DOCPROVV|1|1|0|Flag numeraz. provvisiora sul documento
|
DOCPROVV|1|1|0|Flag numeraz. provvisiora sul documento
|
||||||
ANNODOC|5|8|0|Anno documento
|
ANNODOC|5|8|0|Anno documento
|
||||||
CODNUM|1|4|0|Codice numerazione documento
|
CODNUM|1|4|0|Codice numerazione documento
|
||||||
NUMDOC|1|7|0|Numero documento
|
NUMDOC|1|7|0|Numero documento
|
||||||
CODLIST|1|3|0|Codice listino
|
CODLIST|1|3|0|Codice listino
|
||||||
CODCONT|1|3|0|Codice contratto
|
CODCONT|1|3|0|Codice contratto
|
||||||
CODCAMP|1|3|0|Codcie campagna
|
CODCAMP|1|3|0|Codcie campagna
|
||||||
CODCAUS|1|4|0|Codice causale di magazzino
|
CODCAUS|1|4|0|Codice causale di magazzino
|
||||||
DESCR|1|50|0|Descrizione
|
DESCR|1|50|0|Descrizione
|
||||||
TIPOCF|1|1|0|Tipo <C>liente / <F>ornitore
|
TIPOCF|1|1|0|Tipo <C>liente / <F>ornitore
|
||||||
CODCF|3|6|0|Codice cliente /fornitore
|
CODCF|3|6|0|Codice cliente /fornitore
|
||||||
NUMREGST|3|7|0|Numero di registrazione sul giornale
|
NUMREGST|3|7|0|Numero di registrazione sul giornale
|
||||||
4
|
4
|
||||||
NUMREG|
|
NUMREG|
|
||||||
ANNOES+NUMREG|
|
ANNOES+NUMREG|
|
||||||
DATAREG+NUMREG|
|
DATAREG+NUMREG|
|
||||||
DATACOMP+NUMREG|
|
DATACOMP+NUMREG|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
111
|
111
|
||||||
0
|
0
|
||||||
$rmovmag|0|0|87|32|Righe movimenti di magazzino|||
|
$rmovmag|0|0|87|32|Righe movimenti di magazzino|||
|
||||||
|
26
mg/f111.trr
26
mg/f111.trr
@ -1,13 +1,13 @@
|
|||||||
111
|
111
|
||||||
8
|
8
|
||||||
NUMREG|3|7|0|Numero di registrazione
|
NUMREG|3|7|0|Numero di registrazione
|
||||||
NRIG|2|4|0|Numero di riga
|
NRIG|2|4|0|Numero di riga
|
||||||
CODMAG|1|5|0|Codice magazzino e deposito
|
CODMAG|1|5|0|Codice magazzino e deposito
|
||||||
CODART|1|20|0|Codice articolo
|
CODART|1|20|0|Codice articolo
|
||||||
LIVGIAC|1|15|0|Livello di giacenza
|
LIVGIAC|1|15|0|Livello di giacenza
|
||||||
UM|1|2|0|Unita' di misura
|
UM|1|2|0|Unita' di misura
|
||||||
QUANT|4|15|5|Quantita'
|
QUANT|4|15|5|Quantita'
|
||||||
PREZZO|4|18|3|Prezzo
|
PREZZO|4|18|3|Prezzo
|
||||||
2
|
2
|
||||||
NUMREG+NRIG|
|
NUMREG+NRIG|
|
||||||
CODMAG+CODART+NUMREG|X
|
CODMAG+CODART+NUMREG|X
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
114
|
114
|
||||||
0
|
0
|
||||||
$stomag|0|0|64|32|Storico di magazzino|||
|
$stomag|0|0|64|32|Storico di magazzino|||
|
||||||
|
20
mg/f114.trr
20
mg/f114.trr
@ -1,10 +1,10 @@
|
|||||||
114
|
114
|
||||||
6
|
6
|
||||||
ANNOESRIF|2|4|0|Anno esercizio di riferimento
|
ANNOESRIF|2|4|0|Anno esercizio di riferimento
|
||||||
CODART|1|20|0|Codice Articolo
|
CODART|1|20|0|Codice Articolo
|
||||||
ANNOES|2|4|0|Anno di esercizio
|
ANNOES|2|4|0|Anno di esercizio
|
||||||
UM|1|2|0|Unita' di misura
|
UM|1|2|0|Unita' di misura
|
||||||
QUANT|4|15|5|Quantita'
|
QUANT|4|15|5|Quantita'
|
||||||
VALORE|4|18|3|Valore
|
VALORE|4|18|3|Valore
|
||||||
1
|
1
|
||||||
ANNOESRIF+CODART+ANNOES|
|
ANNOESRIF+CODART+ANNOES|
|
||||||
|
44
mg/mg0.cpp
44
mg/mg0.cpp
@ -1,22 +1,22 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
|
||||||
#include "mg0.h"
|
#include "mg0.h"
|
||||||
|
|
||||||
#define usage "Error - usage : %s -{0|1|2|3|4|5|6|7|8|9}"
|
#define usage "Error - usage : %s -{0|1|2|3|4|5|6|7|8|9}"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int rt = -1;
|
int rt = -1;
|
||||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||||
|
|
||||||
switch (r)
|
switch (r)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
rt = mg0100(argc,argv) ; break;
|
rt = mg0100(argc,argv) ; break;
|
||||||
default:
|
default:
|
||||||
error_box(usage, argv[0]) ; break;
|
error_box(usage, argv[0]) ; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rt ;
|
return rt ;
|
||||||
}
|
}
|
||||||
|
12
mg/mg0.h
12
mg/mg0.h
@ -1,6 +1,6 @@
|
|||||||
#ifndef __MG0_H
|
#ifndef __MG0_H
|
||||||
#define __MG0_H
|
#define __MG0_H
|
||||||
|
|
||||||
int mg0100(int argc, char* argv[]);
|
int mg0100(int argc, char* argv[]);
|
||||||
|
|
||||||
#endif // __MG0_H
|
#endif // __MG0_H
|
||||||
|
622
mg/mg0100.cpp
622
mg/mg0100.cpp
@ -1,311 +1,311 @@
|
|||||||
// gestione tabelle di magazzino
|
// gestione tabelle di magazzino
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <tabapp.h>
|
#include <tabapp.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include "batbcau.h"
|
#include "batbcau.h"
|
||||||
#include "batbfca.h"
|
#include "batbfca.h"
|
||||||
|
|
||||||
#include "../cg/cglib03.h"
|
#include "../cg/cglib03.h"
|
||||||
#include "mglib01.h"
|
#include "mglib01.h"
|
||||||
|
|
||||||
|
|
||||||
#define MAXMETACH 20
|
#define MAXMETACH 20
|
||||||
// maschere delle tabelle di magazzino
|
// maschere delle tabelle di magazzino
|
||||||
class TMask_tabmag : public TMask
|
class TMask_tabmag : public TMask
|
||||||
{
|
{
|
||||||
TTable *aux_tabf;
|
TTable *aux_tabf;
|
||||||
TFile_cache *tab_cache;
|
TFile_cache *tab_cache;
|
||||||
TMetachar * metac[MAXMETACH];
|
TMetachar * metac[MAXMETACH];
|
||||||
|
|
||||||
static bool sumsign_handler(TMask_field &, KEY); // handler
|
static bool sumsign_handler(TMask_field &, KEY); // handler
|
||||||
static bool format_handler(TMask_field &, KEY); // handler dei metacaratteri
|
static bool format_handler(TMask_field &, KEY); // handler dei metacaratteri
|
||||||
static bool codliv_handler(TMask_field &, KEY); // handler del numero formato
|
static bool codliv_handler(TMask_field &, KEY); // handler del numero formato
|
||||||
static bool numform_handler(TMask_field &, KEY); // handler del numero formato
|
static bool numform_handler(TMask_field &, KEY); // handler del numero formato
|
||||||
static bool codlivgca_handler(TMask_field &, KEY); // handler del numero formato
|
static bool codlivgca_handler(TMask_field &, KEY); // handler del numero formato
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TMask_tabmag(const char * ,const TString16 &);
|
TMask_tabmag(const char * ,const TString16 &);
|
||||||
virtual ~TMask_tabmag();
|
virtual ~TMask_tabmag();
|
||||||
};
|
};
|
||||||
|
|
||||||
// costruttore della maschera
|
// costruttore della maschera
|
||||||
TMask_tabmag::TMask_tabmag(const char * _maskname,const TString16 &tabname):
|
TMask_tabmag::TMask_tabmag(const char * _maskname,const TString16 &tabname):
|
||||||
TMask(_maskname)
|
TMask(_maskname)
|
||||||
{
|
{
|
||||||
aux_tabf=NULL;
|
aux_tabf=NULL;
|
||||||
for (int i=0;i<MAXMETACH;i++)
|
for (int i=0;i<MAXMETACH;i++)
|
||||||
metac[i]=NULL;
|
metac[i]=NULL;
|
||||||
if (tabname == "CAU")
|
if (tabname == "CAU")
|
||||||
{
|
{
|
||||||
set_handler(F_SGNGIAC, sumsign_handler);
|
set_handler(F_SGNGIAC, sumsign_handler);
|
||||||
}
|
}
|
||||||
if (tabname == "FCA") // FORMATO CODICE ARTICOLI
|
if (tabname == "FCA") // FORMATO CODICE ARTICOLI
|
||||||
{
|
{
|
||||||
metac[0]=new TMetachar;
|
metac[0]=new TMetachar;
|
||||||
aux_tabf = new TTable("FCA");
|
aux_tabf = new TTable("FCA");
|
||||||
set_handler(F_FORMLIV, format_handler);
|
set_handler(F_FORMLIV, format_handler);
|
||||||
set_handler(F_CODLIV, codliv_handler);
|
set_handler(F_CODLIV, codliv_handler);
|
||||||
}
|
}
|
||||||
if (tabname == "GCA") // GRUPPI CODICE ARTICOLI
|
if (tabname == "GCA") // GRUPPI CODICE ARTICOLI
|
||||||
{
|
{
|
||||||
tab_cache = new TDecoder("FCA","S1");
|
tab_cache = new TDecoder("FCA","S1");
|
||||||
tab_cache->fill();
|
tab_cache->fill();
|
||||||
// crea i riconoscitori del formato
|
// crea i riconoscitori del formato
|
||||||
for (int i=1; ((TDecoder *)tab_cache)->decode(i)!="";i++)
|
for (int i=1; ((TDecoder *)tab_cache)->decode(i)!="";i++)
|
||||||
{
|
{
|
||||||
metac[i-1]=new TMetachar(((TDecoder *)tab_cache)->decode(i));
|
metac[i-1]=new TMetachar(((TDecoder *)tab_cache)->decode(i));
|
||||||
}
|
}
|
||||||
set_handler(F_CODLIV, codlivgca_handler);
|
set_handler(F_CODLIV, codlivgca_handler);
|
||||||
set_handler(F_CODGROUP, numform_handler);
|
set_handler(F_CODGROUP, numform_handler);
|
||||||
}
|
}
|
||||||
if (tabname == "FCG") // FORMATO CODICE GIACENZE
|
if (tabname == "FCG") // FORMATO CODICE GIACENZE
|
||||||
{
|
{
|
||||||
metac[0]=new TMetachar;
|
metac[0]=new TMetachar;
|
||||||
aux_tabf = new TTable("FCG");
|
aux_tabf = new TTable("FCG");
|
||||||
set_handler(F_FORMLIV, format_handler);
|
set_handler(F_FORMLIV, format_handler);
|
||||||
set_handler(F_CODLIV, codliv_handler);
|
set_handler(F_CODLIV, codliv_handler);
|
||||||
}
|
}
|
||||||
if (tabname == "GCG") // GRUPPI CODICE GIACENZE
|
if (tabname == "GCG") // GRUPPI CODICE GIACENZE
|
||||||
{
|
{
|
||||||
tab_cache = new TDecoder("FCG","S1");
|
tab_cache = new TDecoder("FCG","S1");
|
||||||
tab_cache->fill();
|
tab_cache->fill();
|
||||||
for (int i=1; ((TDecoder *)tab_cache)->decode(i)!="";i++)
|
for (int i=1; ((TDecoder *)tab_cache)->decode(i)!="";i++)
|
||||||
{
|
{
|
||||||
metac[i-1]=new TMetachar(((TDecoder *)tab_cache)->decode(i));
|
metac[i-1]=new TMetachar(((TDecoder *)tab_cache)->decode(i));
|
||||||
}
|
}
|
||||||
set_handler(F_CODGROUP, numform_handler);
|
set_handler(F_CODGROUP, numform_handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TMask_tabmag::~TMask_tabmag()
|
TMask_tabmag::~TMask_tabmag()
|
||||||
{
|
{
|
||||||
if (aux_tabf!=NULL)
|
if (aux_tabf!=NULL)
|
||||||
delete aux_tabf;
|
delete aux_tabf;
|
||||||
for (int i=0;i<MAXMETACH;i++) {
|
for (int i=0;i<MAXMETACH;i++) {
|
||||||
if (metac[i]!=NULL)
|
if (metac[i]!=NULL)
|
||||||
delete metac[i];
|
delete metac[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// tabella causali: handler della somma segni
|
// tabella causali: handler della somma segni
|
||||||
bool TMask_tabmag::sumsign_handler(TMask_field& f, KEY k)
|
bool TMask_tabmag::sumsign_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
if (f.mask().get_int(F_SUMSIGN)!=0)
|
if (f.mask().get_int(F_SUMSIGN)!=0)
|
||||||
{
|
{
|
||||||
f.error_box("La somma dei segni ((GIAC-RIM)-(ACQ+ENTR)+(VEN+USC)+(ACL-INCL)+(PRODF-PRODC)) deve essere uguale a zero");
|
f.error_box("La somma dei segni ((GIAC-RIM)-(ACQ+ENTR)+(VEN+USC)+(ACL-INCL)+(PRODF-PRODC)) deve essere uguale a zero");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HANDLER DEL FORMATO DEL LIVELLO
|
// HANDLER DEL FORMATO DEL LIVELLO
|
||||||
bool TMask_tabmag::format_handler(TMask_field& f, KEY k)
|
bool TMask_tabmag::format_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_TAB && f.focusdirty())
|
if (k == K_TAB && f.focusdirty())
|
||||||
{
|
{
|
||||||
TString s(f.get());
|
TString s(f.get());
|
||||||
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
||||||
TTable * aux_tabf=mymask.aux_tabf;
|
TTable * aux_tabf=mymask.aux_tabf;
|
||||||
|
|
||||||
s.strip_spaces();
|
s.strip_spaces();
|
||||||
f.set(s);
|
f.set(s);
|
||||||
|
|
||||||
aux_tabf->zero();
|
aux_tabf->zero();
|
||||||
aux_tabf->put("CODTAB",mymask.get_int(F_CODLIV)+1);
|
aux_tabf->put("CODTAB",mymask.get_int(F_CODLIV)+1);
|
||||||
if (aux_tabf->read()==NOERR)
|
if (aux_tabf->read()==NOERR)
|
||||||
{
|
{
|
||||||
// esiste il seguente:solo caratteri obbligatori
|
// esiste il seguente:solo caratteri obbligatori
|
||||||
if (mymask.metac[0]->has_opzchars(s))
|
if (mymask.metac[0]->has_opzchars(s))
|
||||||
{
|
{
|
||||||
f.error_box("I caratteri di formato opzionali ('%s') sono consentiti solo per l'ultimo livello",mymask.metac[0]->opz_chars());
|
f.error_box("I caratteri di formato opzionali ('%s') sono consentiti solo per l'ultimo livello",mymask.metac[0]->opz_chars());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// ultimo livello: almeno un carattere obbligatorio
|
// ultimo livello: almeno un carattere obbligatorio
|
||||||
if (!mymask.metac[0]->has_mandchars(s))
|
if (!mymask.metac[0]->has_mandchars(s))
|
||||||
{
|
{
|
||||||
f.error_box("Il codice dell'ultimo livello deve includere almeno un carattere obbligatorio (letterali o '%s') ",mymask.metac[0]->mand_chars());
|
f.error_box("Il codice dell'ultimo livello deve includere almeno un carattere obbligatorio (letterali o '%s') ",mymask.metac[0]->mand_chars());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// setta il campo con la lunghezza massima della stringa di formato
|
// setta il campo con la lunghezza massima della stringa di formato
|
||||||
mymask.field(F_LENFORM).set(mymask.metac[0]->maxstrlen(f.get()));
|
mymask.field(F_LENFORM).set(mymask.metac[0]->maxstrlen(f.get()));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HANDLER DEL CODICE LIVELLO
|
// HANDLER DEL CODICE LIVELLO
|
||||||
bool TMask_tabmag::codliv_handler(TMask_field& f, KEY k)
|
bool TMask_tabmag::codliv_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_TAB && f.focusdirty())
|
if (k == K_TAB && f.focusdirty())
|
||||||
{
|
{
|
||||||
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
||||||
TTable * aux_tabf=mymask.aux_tabf;
|
TTable * aux_tabf=mymask.aux_tabf;
|
||||||
int codliv=atoi((const char *)f.get());
|
int codliv=atoi((const char *)f.get());
|
||||||
|
|
||||||
if (codliv>1)
|
if (codliv>1)
|
||||||
// Non è il primo codice
|
// Non è il primo codice
|
||||||
{
|
{
|
||||||
aux_tabf->zero();
|
aux_tabf->zero();
|
||||||
aux_tabf->put("CODTAB",codliv-1);
|
aux_tabf->put("CODTAB",codliv-1);
|
||||||
if (aux_tabf->read()==NOERR)
|
if (aux_tabf->read()==NOERR)
|
||||||
// esiste un precedente
|
// esiste un precedente
|
||||||
{
|
{
|
||||||
TString prevformat(aux_tabf->get("S1"));
|
TString prevformat(aux_tabf->get("S1"));
|
||||||
aux_tabf->zero();
|
aux_tabf->zero();
|
||||||
aux_tabf->put("CODTAB",codliv+1);
|
aux_tabf->put("CODTAB",codliv+1);
|
||||||
if (aux_tabf->read()!=NOERR && mymask.metac[0]->has_opzchars(prevformat))
|
if (aux_tabf->read()!=NOERR && mymask.metac[0]->has_opzchars(prevformat))
|
||||||
{
|
{
|
||||||
f.error_box("Il livello precedente include caratteri opzionali nel formato");
|
f.error_box("Il livello precedente include caratteri opzionali nel formato");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
f.error_box("Non si possono inserire salti nel livello del codice");
|
f.error_box("Non si possono inserire salti nel livello del codice");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// gestisce l'introduzione del codice del livello articoli
|
// gestisce l'introduzione del codice del livello articoli
|
||||||
bool TMask_tabmag::codlivgca_handler(TMask_field& f, KEY k)
|
bool TMask_tabmag::codlivgca_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if ((k == K_TAB && f.focusdirty())||k == K_ENTER )
|
if ((k == K_TAB && f.focusdirty())||k == K_ENTER )
|
||||||
{
|
{
|
||||||
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
||||||
|
|
||||||
if (((TDecoder *)mymask.tab_cache)->decode(atoi((const char *)f.get())+1)=="")
|
if (((TDecoder *)mymask.tab_cache)->decode(atoi((const char *)f.get())+1)=="")
|
||||||
// non esiste un seguente
|
// non esiste un seguente
|
||||||
{
|
{
|
||||||
f.error_box("Non è possibile definire gruppi per l'ultimo livello di codice");
|
f.error_box("Non è possibile definire gruppi per l'ultimo livello di codice");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// HANDLER DEL CODICE LIVELLO giacenza
|
// HANDLER DEL CODICE LIVELLO giacenza
|
||||||
// HANDLER DEL CODICE LIVELLO anagrafica
|
// HANDLER DEL CODICE LIVELLO anagrafica
|
||||||
bool TMask_tabmag::numform_handler(TMask_field& f, KEY k)
|
bool TMask_tabmag::numform_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if ((k == K_TAB && f.focusdirty())||k == K_ENTER )
|
if ((k == K_TAB && f.focusdirty())||k == K_ENTER )
|
||||||
{
|
{
|
||||||
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
TMask_tabmag & mymask=((TMask_tabmag &)f.mask());
|
||||||
|
|
||||||
if (!(mymask.metac[mymask.get_int(F_CODLIV)-1])->recognized(f.get()))
|
if (!(mymask.metac[mymask.get_int(F_CODLIV)-1])->recognized(f.get()))
|
||||||
{
|
{
|
||||||
f.error_box("Codice non corrispondente al formato previsto");
|
f.error_box("Codice non corrispondente al formato previsto");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// applicazione per la gestione delle tabelle di magazzino
|
// applicazione per la gestione delle tabelle di magazzino
|
||||||
class Tab_app_mag : public Tab_application
|
class Tab_app_mag : public Tab_application
|
||||||
{
|
{
|
||||||
|
|
||||||
protected: // TRelation_application
|
protected: // TRelation_application
|
||||||
virtual bool user_destroy() ;
|
virtual bool user_destroy() ;
|
||||||
virtual bool user_create() ;
|
virtual bool user_create() ;
|
||||||
virtual bool protected_record(TRectype& rec) ;
|
virtual bool protected_record(TRectype& rec) ;
|
||||||
virtual int rewrite(const TMask& m);
|
virtual int rewrite(const TMask& m);
|
||||||
|
|
||||||
virtual TMask * set_mask(TMask * _m=NULL);
|
virtual TMask * set_mask(TMask * _m=NULL);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Tab_app_mag();
|
Tab_app_mag();
|
||||||
virtual ~Tab_app_mag() {}
|
virtual ~Tab_app_mag() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
HIDDEN inline Tab_app_mag& app() { return (Tab_app_mag&)main_app(); }
|
HIDDEN inline Tab_app_mag& app() { return (Tab_app_mag&)main_app(); }
|
||||||
// costruttore
|
// costruttore
|
||||||
Tab_app_mag::Tab_app_mag() {}
|
Tab_app_mag::Tab_app_mag() {}
|
||||||
|
|
||||||
|
|
||||||
bool Tab_app_mag::protected_record(TRectype& rec)
|
bool Tab_app_mag::protected_record(TRectype& rec)
|
||||||
{
|
{
|
||||||
bool prot = rec.get_bool(FPC);
|
bool prot = rec.get_bool(FPC);
|
||||||
|
|
||||||
if (!prot)
|
if (!prot)
|
||||||
{
|
{
|
||||||
if (get_tabname()=="FCA" ||get_tabname()=="FCG" )
|
if (get_tabname()=="FCA" ||get_tabname()=="FCG" )
|
||||||
{
|
{
|
||||||
// non si possono cancellare i livelli intermedi:se non è l'ultimo livello, proteggilo
|
// non si possono cancellare i livelli intermedi:se non è l'ultimo livello, proteggilo
|
||||||
TTable aux_tabf(get_tabname());
|
TTable aux_tabf(get_tabname());
|
||||||
aux_tabf.put("CODTAB",rec.get_int("CODTAB")+1);
|
aux_tabf.put("CODTAB",rec.get_int("CODTAB")+1);
|
||||||
if (aux_tabf.read()==NOERR)
|
if (aux_tabf.read()==NOERR)
|
||||||
prot=TRUE;
|
prot=TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return prot;
|
return prot;
|
||||||
}
|
}
|
||||||
|
|
||||||
// alloca/cambia la maschera dell'applicazione
|
// alloca/cambia la maschera dell'applicazione
|
||||||
TMask * Tab_app_mag::set_mask(TMask * _m)
|
TMask * Tab_app_mag::set_mask(TMask * _m)
|
||||||
{
|
{
|
||||||
if (_m != NULL)
|
if (_m != NULL)
|
||||||
return Tab_application::set_mask(_m);
|
return Tab_application::set_mask(_m);
|
||||||
else
|
else
|
||||||
return Tab_application::set_mask(new TMask_tabmag((const char *)mask_name(),get_tabname()));
|
return Tab_application::set_mask(new TMask_tabmag((const char *)mask_name(),get_tabname()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Tab_app_mag::user_create()
|
bool Tab_app_mag::user_create()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
la Tab_application::user_create() apre la maschera TMask in modo automatico
|
la Tab_application::user_create() apre la maschera TMask in modo automatico
|
||||||
basandosi sul parametro passato sulla linea di comando e sulla convenzione
|
basandosi sul parametro passato sulla linea di comando e sulla convenzione
|
||||||
nome = "BATB"+parametro;
|
nome = "BATB"+parametro;
|
||||||
ORA:
|
ORA:
|
||||||
- questa convenzione cambierà per separare i programmi (e le maschere)
|
- questa convenzione cambierà per separare i programmi (e le maschere)
|
||||||
dei vari pacchetti
|
dei vari pacchetti
|
||||||
In tal caso ridefinire il metodo virtual mask_name()
|
In tal caso ridefinire il metodo virtual mask_name()
|
||||||
- secondo il nuovo stile, gli handler vanno posti in maschere derivate
|
- secondo il nuovo stile, gli handler vanno posti in maschere derivate
|
||||||
dalla TMask (TMask_tabmag, TMask_tabcau, ecc), pertanto occorre che
|
dalla TMask (TMask_tabmag, TMask_tabcau, ecc), pertanto occorre che
|
||||||
la maschera aperta sia del tipo corretto
|
la maschera aperta sia del tipo corretto
|
||||||
per questo motivo la maschera viene creata dalla user_create()
|
per questo motivo la maschera viene creata dalla user_create()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool ok = Tab_application::user_create();
|
bool ok = Tab_application::user_create();
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
//TMask& mask = *set_mask();
|
//TMask& mask = *set_mask();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Tab_app_mag::user_destroy()
|
bool Tab_app_mag::user_destroy()
|
||||||
{
|
{
|
||||||
return Tab_application::user_destroy();
|
return Tab_application::user_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Tab_app_mag::rewrite(const TMask& m)
|
int Tab_app_mag::rewrite(const TMask& m)
|
||||||
{
|
{
|
||||||
return Tab_application::rewrite(m);
|
return Tab_application::rewrite(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int mg0100(int argc, char* argv[])
|
int mg0100(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
Tab_app_mag a;
|
Tab_app_mag a;
|
||||||
a.run(argc, argv, "Tabella");
|
a.run(argc, argv, "Tabella");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
44
mg/mg1.cpp
44
mg/mg1.cpp
@ -1,22 +1,22 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
|
||||||
#include "mg1.h"
|
#include "mg1.h"
|
||||||
|
|
||||||
#define usage "Error - usage : %s -{0|1|2|3|4|5|6|7|8|9}"
|
#define usage "Error - usage : %s -{0|1|2|3|4|5|6|7|8|9}"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int rt = -1;
|
int rt = -1;
|
||||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||||
|
|
||||||
switch (r)
|
switch (r)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
rt = mg1100(argc,argv) ; break; // gestione manuale movimenti
|
rt = mg1100(argc,argv) ; break; // gestione manuale movimenti
|
||||||
default:
|
default:
|
||||||
error_box(usage, argv[0]) ; break;
|
error_box(usage, argv[0]) ; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rt ;
|
return rt ;
|
||||||
}
|
}
|
||||||
|
12
mg/mg1.h
12
mg/mg1.h
@ -1,6 +1,6 @@
|
|||||||
#ifndef __MG1_H
|
#ifndef __MG1_H
|
||||||
#define __MG1_H
|
#define __MG1_H
|
||||||
|
|
||||||
int mg1100(int argc, char* argv[]);
|
int mg1100(int argc, char* argv[]);
|
||||||
|
|
||||||
#endif // __MG1_H
|
#endif // __MG1_H
|
||||||
|
1020
mg/mg1100.cpp
1020
mg/mg1100.cpp
File diff suppressed because it is too large
Load Diff
1204
mg/mglib01.cpp
1204
mg/mglib01.cpp
File diff suppressed because it is too large
Load Diff
232
mg/mglib01.h
232
mg/mglib01.h
@ -1,116 +1,116 @@
|
|||||||
// *******************************
|
// *******************************
|
||||||
// *******************************
|
// *******************************
|
||||||
#define MANY_MAG_LEV 10
|
#define MANY_MAG_LEV 10
|
||||||
class TMag_livelli {
|
class TMag_livelli {
|
||||||
bool _enabled[MANY_MAG_LEV];
|
bool _enabled[MANY_MAG_LEV];
|
||||||
int _code_lenght[MANY_MAG_LEV];
|
int _code_lenght[MANY_MAG_LEV];
|
||||||
TString _name[MANY_MAG_LEV];
|
TString _name[MANY_MAG_LEV];
|
||||||
TString _picture[MANY_MAG_LEV];
|
TString _picture[MANY_MAG_LEV];
|
||||||
int _last_level;
|
int _last_level;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int last_level() const {return _last_level;}; // Ritorna il numero di livelli abilitati
|
int last_level() const {return _last_level;}; // Ritorna il numero di livelli abilitati
|
||||||
const bool enabled(int levnum=1); // Ritorna se il livello è abilitato
|
const bool enabled(int levnum=1); // Ritorna se il livello è abilitato
|
||||||
const TString & name(int levnum); // Ritorna il nome (descrizione) di quel livello
|
const TString & name(int levnum); // Ritorna il nome (descrizione) di quel livello
|
||||||
const TString & picture(int levnum);// Ritorna la stringa di picture per i codici gruppo di quel livello
|
const TString & picture(int levnum);// Ritorna la stringa di picture per i codici gruppo di quel livello
|
||||||
const int code_lenght(int levnum); // Ritorna la lunghezza dei codici gruppo di quel livello
|
const int code_lenght(int levnum); // Ritorna la lunghezza dei codici gruppo di quel livello
|
||||||
|
|
||||||
void pack_grpcode(TString & pc, const TString &codlev, const int levnum); // Inserisce il codice del gruppo del livello levnum in pc
|
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); // Estrae il codice del gruppo del livello levnum da pc
|
TString unpack_grpcode(const TString & pc, const int levnum); // Estrae il codice del gruppo del livello levnum da pc
|
||||||
|
|
||||||
TMag_livelli(const char *tabname); // costruttore
|
TMag_livelli(const char *tabname); // costruttore
|
||||||
~TMag_livelli() {}; // distruttore
|
~TMag_livelli() {}; // distruttore
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
// *******************************
|
// *******************************
|
||||||
#define MAXSIMBOLS 256
|
#define MAXSIMBOLS 256
|
||||||
#define MAXSTATES 25
|
#define MAXSTATES 25
|
||||||
class TStateset {
|
class TStateset {
|
||||||
unsigned char _container[MAXSTATES];
|
unsigned char _container[MAXSTATES];
|
||||||
int _current;
|
int _current;
|
||||||
public:
|
public:
|
||||||
TStateset & empty();
|
TStateset & empty();
|
||||||
TStateset & enclose(int e);
|
TStateset & enclose(int e);
|
||||||
TStateset & singleton(int e);
|
TStateset & singleton(int e);
|
||||||
TStateset & cap(TStateset & s);
|
TStateset & cap(TStateset & s);
|
||||||
int get_first() ;
|
int get_first() ;
|
||||||
int get_next() ;
|
int get_next() ;
|
||||||
bool is_empty() const;
|
bool is_empty() const;
|
||||||
bool is_member(int e) const;
|
bool is_member(int e) const;
|
||||||
TStateset();
|
TStateset();
|
||||||
~TStateset() {};
|
~TStateset() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TAutoma_state {
|
struct TAutoma_state {
|
||||||
short _transaction[MAXSIMBOLS];
|
short _transaction[MAXSIMBOLS];
|
||||||
TString16 * _label;
|
TString16 * _label;
|
||||||
bool _final;
|
bool _final;
|
||||||
};
|
};
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
// *******************************
|
// *******************************
|
||||||
// automa per il riconoscimento di metacaratteri
|
// automa per il riconoscimento di metacaratteri
|
||||||
class TR_automa {
|
class TR_automa {
|
||||||
TAutoma_state st[MAXSTATES];
|
TAutoma_state st[MAXSTATES];
|
||||||
short _maxstate;
|
short _maxstate;
|
||||||
protected:
|
protected:
|
||||||
TStateset union_of_closures(TStateset &s);
|
TStateset union_of_closures(TStateset &s);
|
||||||
|
|
||||||
bool is_final(int statenum) const;
|
bool is_final(int statenum) const;
|
||||||
bool is_final(TStateset states) const;
|
bool is_final(TStateset states) const;
|
||||||
|
|
||||||
TR_automa & set_label(int statenum, const char *label);
|
TR_automa & set_label(int statenum, const char *label);
|
||||||
bool is_state(int statenum);
|
bool is_state(int statenum);
|
||||||
const char *label(int statenum);
|
const char *label(int statenum);
|
||||||
int label2state(const char * label);
|
int label2state(const char * label);
|
||||||
|
|
||||||
void del_trans(int statenum,unsigned char symbol);
|
void del_trans(int statenum,unsigned char symbol);
|
||||||
int trans_to(int statenum,unsigned char symbol);
|
int trans_to(int statenum,unsigned char symbol);
|
||||||
bool _isdeterministic;
|
bool _isdeterministic;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TR_automa & reset_state(int statenum=-1);
|
TR_automa & reset_state(int statenum=-1);
|
||||||
|
|
||||||
void add_tran(int statenum,unsigned char symbol,int next);// aggiunge una transizione
|
void add_tran(int statenum,unsigned char symbol,int next);// aggiunge una transizione
|
||||||
int add_state(const char * label);// aggiunge uno stato
|
int add_state(const char * label);// aggiunge uno stato
|
||||||
TR_automa & set_final(int statenum,bool v=TRUE); // pone lo stato come finale
|
TR_automa & set_final(int statenum,bool v=TRUE); // pone lo stato come finale
|
||||||
|
|
||||||
bool is_deterministic() {return _isdeterministic;}; //
|
bool is_deterministic() {return _isdeterministic;}; //
|
||||||
bool recognized(const char * s); // tenta di riconoscere la stringa passata
|
bool recognized(const char * s); // tenta di riconoscere la stringa passata
|
||||||
|
|
||||||
TR_automa(TR_automa *a=NULL,bool makedet=FALSE); // duplica un automa (e lo rende deterministico)
|
TR_automa(TR_automa *a=NULL,bool makedet=FALSE); // duplica un automa (e lo rende deterministico)
|
||||||
~TR_automa();
|
~TR_automa();
|
||||||
static void set2label(const TStateset ss,TString16 & label);
|
static void set2label(const TStateset ss,TString16 & label);
|
||||||
static void label2set(const TString16 & label,TStateset & ss);
|
static void label2set(const TString16 & label,TStateset & ss);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
// *******************************
|
// *******************************
|
||||||
// riconoscimento di metacaratteri
|
// riconoscimento di metacaratteri
|
||||||
class TMetachar {
|
class TMetachar {
|
||||||
TR_automa * _au;
|
TR_automa * _au;
|
||||||
TString _language;
|
TString _language;
|
||||||
char _metach_mand[10];
|
char _metach_mand[10];
|
||||||
char _metach_opz[10];
|
char _metach_opz[10];
|
||||||
|
|
||||||
void set_language(const char * language); // setta l'automa che ricosce il linguaggio passato
|
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
|
void add_tran(int statenum,unsigned char symbol,int next);// aggiunge le transizioni all'automa
|
||||||
public:
|
public:
|
||||||
const char * language() const; // restituisce la stringa di metacaratteri del linguaggio riconosciuto
|
const char * language() const; // restituisce la stringa di metacaratteri del linguaggio riconosciuto
|
||||||
bool recognized(const char * pattern);
|
bool recognized(const char * pattern);
|
||||||
|
|
||||||
bool has_opzchars(const char * pattern);
|
bool has_opzchars(const char * pattern);
|
||||||
bool has_mandchars(const char * pattern);
|
bool has_mandchars(const char * pattern);
|
||||||
|
|
||||||
int maxstrlen(const char * pattern) const;
|
int maxstrlen(const char * pattern) const;
|
||||||
const char *mand_chars() {return _metach_mand;};
|
const char *mand_chars() {return _metach_mand;};
|
||||||
const char *opz_chars() {return _metach_opz;};
|
const char *opz_chars() {return _metach_opz;};
|
||||||
TMetachar(const char * str);
|
TMetachar(const char * str);
|
||||||
TMetachar();
|
TMetachar();
|
||||||
~TMetachar();
|
~TMetachar();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user