From 817f9582b4d6b4b4c6be0a293dd3a87a020d9bd4 Mon Sep 17 00:00:00 2001 From: cris Date: Thu, 30 Nov 2006 14:13:28 +0000 Subject: [PATCH] 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 --- ve/ve7700.cpp | 17 +++++++++++++---- ve/ve7700.h | 4 ++++ ve/ve7700a.h | 2 ++ ve/ve7700a.uml | 5 +++++ ve/ve7701.cpp | 23 ++++++++++++++++++----- 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/ve/ve7700.cpp b/ve/ve7700.cpp index 16a6f09f7..f07d76933 100755 --- a/ve/ve7700.cpp +++ b/ve/ve7700.cpp @@ -490,7 +490,7 @@ void TTrasferimentoGalileo_mask::trasferisci() TGalileo_log* log = new TGalileo_log; rep.set_recordset(log); - TDate data = get(F_DATA); + const TDate data = get(F_DATA); bool rep_to_print = false; bool go_on = true; @@ -500,8 +500,10 @@ void TTrasferimentoGalileo_mask::trasferisci() TString80 dsn = get(F_DSN1); if (dsn.empty()) { + TFilename path = get(F_PATH); + path << "clifo.txt"; TSystemisamfile clifo(LF_CLIFO); - clifo.overwrite("clifo.txt"); + clifo.overwrite(path); } else { @@ -509,6 +511,7 @@ void TTrasferimentoGalileo_mask::trasferisci() query_header << "ODBC(" << get(F_DSN1) << ',' << get(F_USR1) << ',' << get(F_PWD1) << ")\n"; TGalileo_clifo pc; pc.set_data_limite(get_date(F_DATA)); + pc.set_path(get(F_PATH)); pc.init(TR("Clienti/Fornitori"), query_header, log); go_on = pc.trasferisci(); book.add(rep); @@ -522,10 +525,14 @@ void TTrasferimentoGalileo_mask::trasferisci() TString80 dsn = get(F_DSN2); if (dsn.empty()) { + TFilename path = get(F_PATH); + path << "anamag.txt"; TSystemisamfile anamag(LF_ANAMAG); - anamag.overwrite("anamag.txt"); + anamag.overwrite(path); TSystemisamfile umart(LF_UMART); - umart.overwrite("umart.txt"); + path = get(F_PATH); + path << "umart.txt"; + umart.overwrite(path); } else { @@ -533,6 +540,8 @@ void TTrasferimentoGalileo_mask::trasferisci() query_header << "ODBC(" << get(F_DSN2) << ',' << get(F_USR2) << ',' << get(F_PWD2) << ")\n"; TGalileo_articoli pc; 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(); book.add(rep); if (go_on) diff --git a/ve/ve7700.h b/ve/ve7700.h index e5d4a2111..18e5dfaec 100755 --- a/ve/ve7700.h +++ b/ve/ve7700.h @@ -121,6 +121,7 @@ class TGalileo_clifo : public TGalileo_transfer { TDate _data; + TString _path; protected: int cancella_clifo(TLocalisamfile& clifo) const; @@ -132,6 +133,7 @@ public: virtual bool trasferisci(); virtual bool dump(); void set_data_limite(const TDate& data) { _data = data; } + void set_path(const TString& path) { _path = path; } TGalileo_clifo(); ~TGalileo_clifo(); }; @@ -140,6 +142,7 @@ class TGalileo_articoli : public TGalileo_transfer { TDate _data; + TString _path; protected: int cancella_articolo(TLocalisamfile& clifo) const; @@ -149,6 +152,7 @@ public: virtual bool trasferisci(); virtual bool dump(); void set_data_limite(const TDate& data) { _data = data; } + void set_path(const TString& path) { _path = path; } TGalileo_articoli(); ~TGalileo_articoli(); }; diff --git a/ve/ve7700a.h b/ve/ve7700a.h index 555ece3b9..bfbaaccc7 100755 --- a/ve/ve7700a.h +++ b/ve/ve7700a.h @@ -15,4 +15,6 @@ #define F_USR2 205 #define F_PWD2 206 +#define F_PATH 207 + #endif diff --git a/ve/ve7700a.uml b/ve/ve7700a.uml index fca123f88..397c884c7 100755 --- a/ve/ve7700a.uml +++ b/ve/ve7700a.uml @@ -104,6 +104,11 @@ BEGIN FLAGS "*" END +STRING F_PATH 100 35 +BEGIN + PROMPT 2 12 "Percorso file da importare/esportare " +END + ENDPAGE ENDMASK diff --git a/ve/ve7701.cpp b/ve/ve7701.cpp index bf52bd014..79f5fc7c9 100755 --- a/ve/ve7701.cpp +++ b/ve/ve7701.cpp @@ -75,8 +75,10 @@ bool TGalileo_clifo::dump() if (!campo_orig.blank()) lista_dump.add(campo_dest); } + TFilename path = _path; + path << "clifo.txt"; TSystemisamfile clifo(LF_CLIFO); - return (clifo.dump("clifo.txt", lista_dump) == NOERR); + return (clifo.dump(path, lista_dump) == NOERR); } bool TGalileo_clifo::trasferisci() @@ -87,8 +89,8 @@ bool TGalileo_clifo::trasferisci() "FROM CGANA01J \n"; if (!_data.empty()) { - query << "WHERE DTMNCA >= '"; - query << _data.string() << "'"; + query << "WHERE DTMNCA >= "; + query << _data.date2ansi(); } TRecordset& recset = create_recordset(query); @@ -223,11 +225,17 @@ bool TGalileo_articoli::dump() if (!campo_orig.blank()) lista_dump.add(campo_dest); } + TFilename path = _path; + path << "umart.txt"; TSystemisamfile anamag(LF_ANAMAG); TSystemisamfile umart(LF_UMART); - int err = umart.dump("umart.txt"); + int err = umart.dump(path); if (err == NOERR) - err = anamag.dump("anamag.txt", lista_dump); + { + path = _path; + path << "anamag.txt"; + err = anamag.dump(path, lista_dump); + } return (err == NOERR); } @@ -237,6 +245,11 @@ bool TGalileo_articoli::trasferisci() "SELECT RICOD, RDES1, RDES2, RDES3, RSUMS, RITIP \n" "FROM BRISO00F, BTABE00F \n" "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);