Patch level : 4.0
Files correlati : ve7.exe ve7700a.msk ve7701a.ini Ricompilazione Demo : [ ] Commento : Corretto dump di articoli ed unita' di misura git-svn-id: svn://10.65.10.50/trunk@14838 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
520a3a529d
commit
5d7a8be2ba
@ -515,8 +515,7 @@ void TTrasferimentoGalileo_mask::trasferisci()
|
||||
pc.init(TR("Clienti/Fornitori"), query_header, log);
|
||||
go_on = pc.trasferisci();
|
||||
book.add(rep);
|
||||
if (go_on)
|
||||
pc.dump();
|
||||
pc.dump();
|
||||
rep_to_print = true;
|
||||
}
|
||||
}
|
||||
@ -544,8 +543,7 @@ void TTrasferimentoGalileo_mask::trasferisci()
|
||||
pc.set_path(get(F_PATH));
|
||||
go_on = pc.trasferisci();
|
||||
book.add(rep);
|
||||
if (go_on)
|
||||
pc.dump();
|
||||
pc.dump();
|
||||
rep_to_print = true;
|
||||
}
|
||||
}
|
||||
|
@ -119,9 +119,8 @@ public:
|
||||
|
||||
class TGalileo_clifo : public TGalileo_transfer
|
||||
{
|
||||
|
||||
TDate _data;
|
||||
TString _path;
|
||||
TFilename _path;
|
||||
TAssoc_array _keys;
|
||||
|
||||
protected:
|
||||
@ -142,9 +141,8 @@ public:
|
||||
|
||||
class TGalileo_articoli : public TGalileo_transfer
|
||||
{
|
||||
|
||||
TDate _data;
|
||||
TString _path;
|
||||
TFilename _path;
|
||||
TAssoc_array _keys_articoli;
|
||||
TAssoc_array _keys_umart;
|
||||
|
||||
|
@ -104,7 +104,7 @@ BEGIN
|
||||
FLAGS "*"
|
||||
END
|
||||
|
||||
STRING F_PATH 100 35
|
||||
STRING F_PATH 256 35
|
||||
BEGIN
|
||||
PROMPT 2 12 "Percorso file da importare/esportare "
|
||||
END
|
||||
|
@ -18,7 +18,7 @@
|
||||
bool select_clifo(const TRectype & rec, TObject * myself)
|
||||
{
|
||||
TGalileo_clifo * c = (TGalileo_clifo *) myself;
|
||||
const TString key(rec.build_key());
|
||||
const TString80 key = rec.build_key();
|
||||
return c->keys().objptr(key) != NULL;
|
||||
}
|
||||
|
||||
@ -67,6 +67,9 @@ long TGalileo_clifo::get_codcf(const char tipocf, const char* ricalt) const
|
||||
|
||||
bool TGalileo_clifo::dump()
|
||||
{
|
||||
if (!_path.exist())
|
||||
return true;
|
||||
|
||||
TConfig& ini = config();
|
||||
TString_array lista_clifo;
|
||||
ini.list_variables(lista_clifo, true, "CLIFO", true);
|
||||
@ -79,13 +82,16 @@ bool TGalileo_clifo::dump()
|
||||
{
|
||||
row->get(0, campo_dest);
|
||||
row->get(1, campo_orig);
|
||||
if (!campo_orig.blank())
|
||||
if (campo_orig.full())
|
||||
lista_dump.add(campo_dest);
|
||||
}
|
||||
TFilename path = _path;
|
||||
path << "clifo.txt";
|
||||
TFilename path = _path; path.add("clifo.txt");
|
||||
TSystemisamfile clifo(LF_CLIFO);
|
||||
return (clifo.dump(path, lista_dump, 1, '|', '\0', '\10', true, false, NULL, select_clifo, this) == NOERR);
|
||||
|
||||
int err = clifo.dump(path, lista_dump, 1, '|', '\0', '\10', true, false, NULL, select_clifo, this);
|
||||
if (err == NOERR)
|
||||
log("Errore di scrittura del file clifo.txt", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TGalileo_clifo::trasferisci()
|
||||
@ -178,7 +184,7 @@ bool TGalileo_clifo::aggiorna_record(TLocalisamfile& file, const TString_array&
|
||||
{
|
||||
row->get(0, campo_dest);
|
||||
row->get(1, campo_orig);
|
||||
if (!campo_orig.blank())
|
||||
if (campo_orig.full())
|
||||
{
|
||||
if (campo_orig[0] == '_')
|
||||
{
|
||||
@ -218,14 +224,14 @@ TGalileo_clifo::~TGalileo_clifo()
|
||||
bool select_umart(const TRectype & rec, TObject * myself)
|
||||
{
|
||||
TGalileo_articoli * c = (TGalileo_articoli *) myself;
|
||||
const TString key(rec.build_key());
|
||||
const TString80 key(rec.build_key());
|
||||
return c->keys_umart().objptr(key) != NULL;
|
||||
}
|
||||
|
||||
bool select_articoli(const TRectype & rec, TObject * myself)
|
||||
{
|
||||
TGalileo_articoli * c = (TGalileo_articoli *) myself;
|
||||
const TString key(rec.build_key());
|
||||
const TString80 key(rec.build_key());
|
||||
return c->keys_articoli().objptr(key) != NULL;
|
||||
}
|
||||
|
||||
@ -236,6 +242,9 @@ int TGalileo_articoli::cancella_articolo(TLocalisamfile& anamag) const
|
||||
|
||||
bool TGalileo_articoli::dump()
|
||||
{
|
||||
if (!_path.exist())
|
||||
return true;
|
||||
|
||||
TConfig& ini = config();
|
||||
TString_array lista_anamag;
|
||||
ini.list_variables(lista_anamag, true, "ANAMAG", true);
|
||||
@ -246,22 +255,25 @@ bool TGalileo_articoli::dump()
|
||||
{
|
||||
row->get(0, campo_dest);
|
||||
row->get(1, campo_orig);
|
||||
if (!campo_orig.blank())
|
||||
if (campo_orig.full())
|
||||
lista_dump.add(campo_dest);
|
||||
}
|
||||
TFilename path = _path;
|
||||
path << "umart.txt";
|
||||
path.add("umart.txt");
|
||||
TSystemisamfile anamag(LF_ANAMAG);
|
||||
TSystemisamfile umart(LF_UMART);
|
||||
TToken_string cazzo;
|
||||
int err = umart.dump(path, cazzo, 1, '|', '\0', '\10', true, false, NULL, select_umart, this) == NOERR;
|
||||
if (err == NOERR)
|
||||
{
|
||||
path = _path;
|
||||
path << "anamag.txt";
|
||||
err = anamag.dump(path, lista_dump, 1, '|', '\0', '\10', true, false, NULL, select_articoli, this) == NOERR;
|
||||
}
|
||||
return (err == NOERR);
|
||||
TToken_string cazzo; // Programma interessante, ma per pochi!
|
||||
int err = umart.dump(path, cazzo, 1, '|', '\0', '\10', true, false,
|
||||
NULL, select_umart, this);
|
||||
if (err != NOERR)
|
||||
log("Errore di scrittura umart.txt", 2);
|
||||
path = _path; path.add("anamag.txt");
|
||||
err = anamag.dump(path, lista_dump, 1, '|', '\0', '\10', true, false,
|
||||
NULL, select_articoli, this);
|
||||
if (err != NOERR)
|
||||
log("Errore di scrittura anamag.txt", 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TGalileo_articoli::trasferisci()
|
||||
@ -345,7 +357,7 @@ bool TGalileo_articoli::aggiorna_record(TLocalisamfile& file, const TString_arra
|
||||
{
|
||||
row->get(0, campo_dest);
|
||||
row->get(1, campo_orig);
|
||||
if (!campo_orig.blank())
|
||||
if (campo_orig.full())
|
||||
{
|
||||
if (campo_orig[0] == '_')
|
||||
{
|
||||
@ -361,6 +373,12 @@ bool TGalileo_articoli::aggiorna_record(TLocalisamfile& file, const TString_arra
|
||||
}
|
||||
else if (str == "FISSO")
|
||||
valore = elabora.get(); // valore fisso indicato in configurazione
|
||||
} else
|
||||
if (campo_orig[0] == '"' || campo_orig[0] == '\'')
|
||||
{
|
||||
valore = campo_orig;
|
||||
valore.ltrim(1);
|
||||
valore.rtrim(1);
|
||||
}
|
||||
else
|
||||
valore = get_str(campo_orig);
|
||||
|
@ -56,6 +56,7 @@ CODART =
|
||||
DESCR = RDES1
|
||||
DESCRAGG = RDES2
|
||||
CODARTALT = RISIG
|
||||
CODIVA = _FISSO,20
|
||||
|
||||
[UMART]
|
||||
CODART =
|
||||
|
Loading…
x
Reference in New Issue
Block a user