diff --git a/ps/ps0330100a.uml b/ps/ps0330100a.uml index 3c618d571..6dbb2ec8d 100755 --- a/ps/ps0330100a.uml +++ b/ps/ps0330100a.uml @@ -83,13 +83,7 @@ ENDPAGE TOOLBAR "" 0 0 0 2 -BUTTON DLG_OK 10 2 -BEGIN - PROMPT 1 1 "~Mmmuuu!" - PICTURE TOOL_PACK2MAG -END - -#include +#include ENDPAGE diff --git a/ps/ps0330200.cpp b/ps/ps0330200.cpp index 811655fd6..803c4f0ad 100755 --- a/ps/ps0330200.cpp +++ b/ps/ps0330200.cpp @@ -95,22 +95,40 @@ void TDisp_by_ftp::elabora() file_txt.ext(".txt"); ofstream file_output(file_txt); + TString query; + //se è stato selezionato un listino (ovvero il programma funziona come richiesto dalla ModelAssistance).. + const TString4 codlis = _mask->get(F_CODLIS); + const bool usa_listino = codlis.full(); + if (usa_listino) + { + query << "USE RCONDV"; + query << "\nJOIN 109 INTO ANNOES=#ANNO CODART==CODRIGA"; + query << "\nJOIN ANAMAG INTO CODART==CODRIGA"; + query << "\nJOIN UMART INTO CODART==CODRIGA NRIGA=1"; + query << "\nFROM TIPO=L COD=#CODLIS TIPORIGA=A"; + query << "\nTO TIPO=L COD=#CODLIS TIPORIGA=A"; + } + else + { //crea il recordset da esportare //esporta dati dalle giacenze di magazzino, l'anagrafica articolo, l'unità di misura - TString query; - query << "USE 109"; - query << "\nBY ANAMAG.CODART"; - query << "\nJOIN ANAMAG INTO CODART==CODART"; - query << "\nJOIN UMART INTO CODART=CODART NRIGA=1"; - query << "\nFROM ANNOES=#ANNO"; - query << "\nTO ANNOES=#ANNO"; + query << "USE 109"; + query << "\nBY ANAMAG.CODART"; + query << "\nJOIN ANAMAG INTO CODART==CODART"; + query << "\nJOIN UMART INTO CODART=CODART NRIGA=1"; + query << "\nFROM ANNOES=#ANNO"; + query << "\nTO ANNOES=#ANNO"; + } TISAM_recordset recset(query); const TDate today(TODAY); - const long anno = 2009; //today.year(); + const long anno = today.year(); recset.set_var("#ANNO", anno); + if (usa_listino) + recset.set_var("#CODLIS", codlis); + const long items = recset.items(); TProgind pi(items, "Elaborazione in corso...", true, true); @@ -134,7 +152,7 @@ void TDisp_by_ftp::elabora() record.add(""); //co. prodotto produttore - const real giac = recset.get("GIAC").as_real(); + const real giac = recset.get("109.GIAC").as_real(); const long int_giac = giac.integer(); record.add(int_giac); //quantita' disponibile @@ -176,7 +194,8 @@ void TDisp_by_ftp::elabora() //spostamento del file locale nella directory di destinazione TFilename dst_file = _mask->get(F_FTP_PATH); dst_file.add(file_txt.name()); - const int err = xvt_fsys_fcopy(file_txt, dst_file); + if (!xvt_fsys_fcopy(file_txt, dst_file)) + warning_box("Impossibile spostare il file nella cartella ftp indicata"); } diff --git a/ps/ps0330200a.h b/ps/ps0330200a.h index c4791d4cd..667ec832c 100755 --- a/ps/ps0330200a.h +++ b/ps/ps0330200a.h @@ -1,4 +1,6 @@ -#define F_FILENAME 201 -#define F_FTP_PATH 202 +#define F_CODLIS 201 +#define F_DESLIS 202 +#define F_FILENAME 203 +#define F_FTP_PATH 204 diff --git a/ps/ps0330200a.uml b/ps/ps0330200a.uml index c495587ca..8a4003b23 100755 --- a/ps/ps0330200a.uml +++ b/ps/ps0330200a.uml @@ -1,26 +1,55 @@ #include "ps0330200a.h" -PAGE "Esportazione disponibilita' via FTP" -1 -1 78 6 +PAGE "Esportazione disponibilita' via FTP" -1 -1 78 8 + +STRING F_CODLIS 3 +BEGIN + PROMPT 1 1 "Listino " + USE CONDV + INPUT TIPO "L" + INPUT COD F_CODLIS + DISPLAY "Codice" COD + DISPLAY "Descrizione@50" DESCR + DISPLAY "Inizio validita'" VALIN + DISPLAY "Fine validità" VALFIN + OUTPUT F_CODLIS COD + OUTPUT F_DESLIS DESCR + CHECKTYPE NORMAL +END + +STRING F_DESLIS 50 +BEGIN + PROMPT 22 1 "" + USE CONDV KEY 2 + INPUT TIPO "L" + INPUT DESCR F_DESLIS + DISPLAY "Descrizione@50" DESCR + DISPLAY "Codice" COD + DISPLAY "Inizio validita'" VALIN + DISPLAY "Fine validità" VALFIN + COPY OUTPUT F_CODLIS + CHECKTYPE NORMAL +END TEXT DLG_NULL BEGIN - PROMPT 1 0 "Nome del file txt da esportare (SENZA estensione '.txt' !)" + PROMPT 1 3 "Nome del file txt da esportare (SENZA estensione '.txt' !)" END STRING F_FILENAME 32 BEGIN - PROMPT 1 1 "" + PROMPT 1 4 "" CHECKTYPE REQUIRED END TEXT DLG_NULL BEGIN - PROMPT 1 3 "Indirizzo ftp di destinazione (scritto come ftp://utente:password@sito)" + PROMPT 1 5 "Indirizzo ftp di destinazione (scritto come ftp://utente:password@sito)" END STRING F_FTP_PATH 255 75 BEGIN - PROMPT 1 4 "" + PROMPT 1 6 "" FLAGS "M" CHECKTYPE REQUIRED END @@ -35,13 +64,7 @@ ENDPAGE TOOLBAR "" 0 0 0 2 -BUTTON DLG_OK 10 2 -BEGIN - PROMPT 1 1 "~Mmmuuu!" - PICTURE TOOL_PACK2MAG -END - -#include +#include ENDPAGE