Patch level : 4.0
Files correlati : Ricompilazione Demo : [ ] Commento : Versione con filtro su data e parametrizzaiozne file da importare git-svn-id: svn://10.65.10.50/trunk@14584 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b8f5142863
commit
817f9582b4
@ -490,7 +490,7 @@ void TTrasferimentoGalileo_mask::trasferisci()
|
|||||||
TGalileo_log* log = new TGalileo_log;
|
TGalileo_log* log = new TGalileo_log;
|
||||||
rep.set_recordset(log);
|
rep.set_recordset(log);
|
||||||
|
|
||||||
TDate data = get(F_DATA);
|
const TDate data = get(F_DATA);
|
||||||
|
|
||||||
bool rep_to_print = false;
|
bool rep_to_print = false;
|
||||||
bool go_on = true;
|
bool go_on = true;
|
||||||
@ -500,8 +500,10 @@ void TTrasferimentoGalileo_mask::trasferisci()
|
|||||||
TString80 dsn = get(F_DSN1);
|
TString80 dsn = get(F_DSN1);
|
||||||
if (dsn.empty())
|
if (dsn.empty())
|
||||||
{
|
{
|
||||||
|
TFilename path = get(F_PATH);
|
||||||
|
path << "clifo.txt";
|
||||||
TSystemisamfile clifo(LF_CLIFO);
|
TSystemisamfile clifo(LF_CLIFO);
|
||||||
clifo.overwrite("clifo.txt");
|
clifo.overwrite(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -509,6 +511,7 @@ void TTrasferimentoGalileo_mask::trasferisci()
|
|||||||
query_header << "ODBC(" << get(F_DSN1) << ',' << get(F_USR1) << ',' << get(F_PWD1) << ")\n";
|
query_header << "ODBC(" << get(F_DSN1) << ',' << get(F_USR1) << ',' << get(F_PWD1) << ")\n";
|
||||||
TGalileo_clifo pc;
|
TGalileo_clifo pc;
|
||||||
pc.set_data_limite(get_date(F_DATA));
|
pc.set_data_limite(get_date(F_DATA));
|
||||||
|
pc.set_path(get(F_PATH));
|
||||||
pc.init(TR("Clienti/Fornitori"), query_header, log);
|
pc.init(TR("Clienti/Fornitori"), query_header, log);
|
||||||
go_on = pc.trasferisci();
|
go_on = pc.trasferisci();
|
||||||
book.add(rep);
|
book.add(rep);
|
||||||
@ -522,10 +525,14 @@ void TTrasferimentoGalileo_mask::trasferisci()
|
|||||||
TString80 dsn = get(F_DSN2);
|
TString80 dsn = get(F_DSN2);
|
||||||
if (dsn.empty())
|
if (dsn.empty())
|
||||||
{
|
{
|
||||||
|
TFilename path = get(F_PATH);
|
||||||
|
path << "anamag.txt";
|
||||||
TSystemisamfile anamag(LF_ANAMAG);
|
TSystemisamfile anamag(LF_ANAMAG);
|
||||||
anamag.overwrite("anamag.txt");
|
anamag.overwrite(path);
|
||||||
TSystemisamfile umart(LF_UMART);
|
TSystemisamfile umart(LF_UMART);
|
||||||
umart.overwrite("umart.txt");
|
path = get(F_PATH);
|
||||||
|
path << "umart.txt";
|
||||||
|
umart.overwrite(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -533,6 +540,8 @@ void TTrasferimentoGalileo_mask::trasferisci()
|
|||||||
query_header << "ODBC(" << get(F_DSN2) << ',' << get(F_USR2) << ',' << get(F_PWD2) << ")\n";
|
query_header << "ODBC(" << get(F_DSN2) << ',' << get(F_USR2) << ',' << get(F_PWD2) << ")\n";
|
||||||
TGalileo_articoli pc;
|
TGalileo_articoli pc;
|
||||||
pc.init(TR("Articoli"), query_header, log);
|
pc.init(TR("Articoli"), query_header, log);
|
||||||
|
pc.set_data_limite(get_date(F_DATA));
|
||||||
|
pc.set_path(get(F_PATH));
|
||||||
go_on = pc.trasferisci();
|
go_on = pc.trasferisci();
|
||||||
book.add(rep);
|
book.add(rep);
|
||||||
if (go_on)
|
if (go_on)
|
||||||
|
@ -121,6 +121,7 @@ class TGalileo_clifo : public TGalileo_transfer
|
|||||||
{
|
{
|
||||||
|
|
||||||
TDate _data;
|
TDate _data;
|
||||||
|
TString _path;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int cancella_clifo(TLocalisamfile& clifo) const;
|
int cancella_clifo(TLocalisamfile& clifo) const;
|
||||||
@ -132,6 +133,7 @@ public:
|
|||||||
virtual bool trasferisci();
|
virtual bool trasferisci();
|
||||||
virtual bool dump();
|
virtual bool dump();
|
||||||
void set_data_limite(const TDate& data) { _data = data; }
|
void set_data_limite(const TDate& data) { _data = data; }
|
||||||
|
void set_path(const TString& path) { _path = path; }
|
||||||
TGalileo_clifo();
|
TGalileo_clifo();
|
||||||
~TGalileo_clifo();
|
~TGalileo_clifo();
|
||||||
};
|
};
|
||||||
@ -140,6 +142,7 @@ class TGalileo_articoli : public TGalileo_transfer
|
|||||||
{
|
{
|
||||||
|
|
||||||
TDate _data;
|
TDate _data;
|
||||||
|
TString _path;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int cancella_articolo(TLocalisamfile& clifo) const;
|
int cancella_articolo(TLocalisamfile& clifo) const;
|
||||||
@ -149,6 +152,7 @@ public:
|
|||||||
virtual bool trasferisci();
|
virtual bool trasferisci();
|
||||||
virtual bool dump();
|
virtual bool dump();
|
||||||
void set_data_limite(const TDate& data) { _data = data; }
|
void set_data_limite(const TDate& data) { _data = data; }
|
||||||
|
void set_path(const TString& path) { _path = path; }
|
||||||
TGalileo_articoli();
|
TGalileo_articoli();
|
||||||
~TGalileo_articoli();
|
~TGalileo_articoli();
|
||||||
};
|
};
|
||||||
|
@ -15,4 +15,6 @@
|
|||||||
#define F_USR2 205
|
#define F_USR2 205
|
||||||
#define F_PWD2 206
|
#define F_PWD2 206
|
||||||
|
|
||||||
|
#define F_PATH 207
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -104,6 +104,11 @@ BEGIN
|
|||||||
FLAGS "*"
|
FLAGS "*"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING F_PATH 100 35
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 12 "Percorso file da importare/esportare "
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
@ -75,8 +75,10 @@ bool TGalileo_clifo::dump()
|
|||||||
if (!campo_orig.blank())
|
if (!campo_orig.blank())
|
||||||
lista_dump.add(campo_dest);
|
lista_dump.add(campo_dest);
|
||||||
}
|
}
|
||||||
|
TFilename path = _path;
|
||||||
|
path << "clifo.txt";
|
||||||
TSystemisamfile clifo(LF_CLIFO);
|
TSystemisamfile clifo(LF_CLIFO);
|
||||||
return (clifo.dump("clifo.txt", lista_dump) == NOERR);
|
return (clifo.dump(path, lista_dump) == NOERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TGalileo_clifo::trasferisci()
|
bool TGalileo_clifo::trasferisci()
|
||||||
@ -87,8 +89,8 @@ bool TGalileo_clifo::trasferisci()
|
|||||||
"FROM CGANA01J \n";
|
"FROM CGANA01J \n";
|
||||||
if (!_data.empty())
|
if (!_data.empty())
|
||||||
{
|
{
|
||||||
query << "WHERE DTMNCA >= '";
|
query << "WHERE DTMNCA >= ";
|
||||||
query << _data.string() << "'";
|
query << _data.date2ansi();
|
||||||
}
|
}
|
||||||
|
|
||||||
TRecordset& recset = create_recordset(query);
|
TRecordset& recset = create_recordset(query);
|
||||||
@ -223,11 +225,17 @@ bool TGalileo_articoli::dump()
|
|||||||
if (!campo_orig.blank())
|
if (!campo_orig.blank())
|
||||||
lista_dump.add(campo_dest);
|
lista_dump.add(campo_dest);
|
||||||
}
|
}
|
||||||
|
TFilename path = _path;
|
||||||
|
path << "umart.txt";
|
||||||
TSystemisamfile anamag(LF_ANAMAG);
|
TSystemisamfile anamag(LF_ANAMAG);
|
||||||
TSystemisamfile umart(LF_UMART);
|
TSystemisamfile umart(LF_UMART);
|
||||||
int err = umart.dump("umart.txt");
|
int err = umart.dump(path);
|
||||||
if (err == NOERR)
|
if (err == NOERR)
|
||||||
err = anamag.dump("anamag.txt", lista_dump);
|
{
|
||||||
|
path = _path;
|
||||||
|
path << "anamag.txt";
|
||||||
|
err = anamag.dump(path, lista_dump);
|
||||||
|
}
|
||||||
return (err == NOERR);
|
return (err == NOERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,6 +245,11 @@ bool TGalileo_articoli::trasferisci()
|
|||||||
"SELECT RICOD, RDES1, RDES2, RDES3, RSUMS, RITIP \n"
|
"SELECT RICOD, RDES1, RDES2, RDES3, RSUMS, RITIP \n"
|
||||||
"FROM BRISO00F, BTABE00F \n"
|
"FROM BRISO00F, BTABE00F \n"
|
||||||
"WHERE (MID(TBDAT,9,1)=RITIP) AND (TBTIP='COD') AND (TBELE='RIS')";
|
"WHERE (MID(TBDAT,9,1)=RITIP) AND (TBTIP='COD') AND (TBELE='RIS')";
|
||||||
|
if (!_data.empty())
|
||||||
|
{
|
||||||
|
query << "WHERE RIDTX >= ";
|
||||||
|
query << _data.date2ansi();
|
||||||
|
}
|
||||||
|
|
||||||
TRecordset& recset = create_recordset(query);
|
TRecordset& recset = create_recordset(query);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user