Nuova gestione PRIVAT per Esselunga
git-svn-id: svn://10.65.10.50/branches/R_10_00@22759 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7dbfa7b680
commit
b72bd2d1c9
@ -4,14 +4,11 @@
|
|||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
#include <reputils.h>
|
#include <reputils.h>
|
||||||
#include <textset.h>
|
#include <textset.h>
|
||||||
//#include <utility.h>
|
|
||||||
|
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
//#include <clifo.h>
|
|
||||||
//#include <doc.h>
|
|
||||||
//#include <rdoc.h>
|
|
||||||
#include "../mg/codcorr.h"
|
#include "../mg/codcorr.h"
|
||||||
#include "../cg/cglib01.h"
|
#include "../cg/cglib01.h"
|
||||||
#include "../ve/velib.h"
|
#include "../ve/velib.h"
|
||||||
@ -62,7 +59,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
bool set(const char* name, const TVariant& value);
|
bool set(const char* name, const TVariant& value);
|
||||||
virtual TRecnotype new_rec(const char* trc);
|
virtual TRecnotype new_rec(const char* trc);
|
||||||
TFatture_recordset();
|
TFatture_recordset(bool nuovo);
|
||||||
};
|
};
|
||||||
|
|
||||||
TRecnotype TFatture_recordset::new_rec(const char* trc)
|
TRecnotype TFatture_recordset::new_rec(const char* trc)
|
||||||
@ -141,7 +138,7 @@ void TFatture_recordset::add_field(const char* name, TFE_type type, int len, int
|
|||||||
CHECKS(ok, "Impossibile creare il campo ", (const char*)name);
|
CHECKS(ok, "Impossibile creare il campo ", (const char*)name);
|
||||||
}
|
}
|
||||||
|
|
||||||
TFatture_recordset::TFatture_recordset()
|
TFatture_recordset::TFatture_recordset(bool nuovo)
|
||||||
: TAS400_recordset("AS400(612,3,0)")
|
: TAS400_recordset("AS400(612,3,0)")
|
||||||
{
|
{
|
||||||
// dati di configurazione
|
// dati di configurazione
|
||||||
@ -151,7 +148,9 @@ TFatture_recordset::TFatture_recordset()
|
|||||||
const long codcli_esselunga = config.get_long("Esselunga_CodEsselunga");
|
const long codcli_esselunga = config.get_long("Esselunga_CodEsselunga");
|
||||||
const TString80 cod_hardy = config.get("Esselunga_CodHardy");
|
const TString80 cod_hardy = config.get("Esselunga_CodHardy");
|
||||||
TString16 piva_esselunga = config.get("Esselunga_PIvaEsselunga");
|
TString16 piva_esselunga = config.get("Esselunga_PIvaEsselunga");
|
||||||
piva_esselunga << "N"; // 27-09-2012
|
|
||||||
|
if (nuovo)
|
||||||
|
piva_esselunga << "N"; // 27-09-2012
|
||||||
|
|
||||||
// record cliente Esselunga
|
// record cliente Esselunga
|
||||||
TToken_string key;
|
TToken_string key;
|
||||||
@ -410,7 +409,7 @@ class THardy_esselunga_fat : public TSkeleton_application
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
long genera_recordset(const TMask& mask, TISAM_recordset& recset);
|
long genera_recordset(const TMask& mask, TISAM_recordset& recset);
|
||||||
void elabora(const TMask& mask);
|
void elabora(const TMask& mask, int mode);
|
||||||
void check_date(const TDate& datafine, TDate& dataini);
|
void check_date(const TDate& datafine, TDate& dataini);
|
||||||
TString4 check_cliente(const long codcf);
|
TString4 check_cliente(const long codcf);
|
||||||
|
|
||||||
@ -665,12 +664,14 @@ void THardy_esselunga_fat::segnala_documento(const TDocumento& doc, TLog_report&
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void THardy_esselunga_fat::elabora(const TMask& mask)
|
void THardy_esselunga_fat::elabora(const TMask& mask, int mode)
|
||||||
{
|
{
|
||||||
TLog_report log;
|
TLog_report log;
|
||||||
TConfig config(CONFIG_DITTA, "ha");
|
TConfig config(CONFIG_DITTA, "ha");
|
||||||
TFilename file_fatture = config.get("Esselunga_Path");
|
TFilename file_fatture = config.get("Esselunga_Path");
|
||||||
file_fatture.add("FATTURE");
|
file_fatture.add("FATTURE");
|
||||||
|
if ((mode & 2) != 0)
|
||||||
|
file_fatture << "_N";
|
||||||
file_fatture.ext("txt");
|
file_fatture.ext("txt");
|
||||||
TISAM_recordset recset("");
|
TISAM_recordset recset("");
|
||||||
const long items = genera_recordset(mask, recset);
|
const long items = genera_recordset(mask, recset);
|
||||||
@ -678,9 +679,9 @@ void THardy_esselunga_fat::elabora(const TMask& mask)
|
|||||||
log.log(1, "Non esistono documenti che soddisfino i parametri selezionati.");
|
log.log(1, "Non esistono documenti che soddisfino i parametri selezionati.");
|
||||||
// lettura dei documenti da recordset
|
// lettura dei documenti da recordset
|
||||||
TProgind pi(recset.items(), TR("Elaborazione documenti in corso..."));
|
TProgind pi(recset.items(), TR("Elaborazione documenti in corso..."));
|
||||||
TFatture_recordset fatture;
|
TFatture_recordset fatture((mode & 1) != 0);
|
||||||
TCodArtEsselunga_cache cache_ca;
|
TCodArtEsselunga_cache cache_ca;
|
||||||
const bool definitivo = mask.get_bool(F_DEFINITIVO);
|
const bool definitivo = (mode & 1) && mask.get_bool(F_DEFINITIVO);
|
||||||
const bool forzatura = mask.get_bool(F_FORZATURA);
|
const bool forzatura = mask.get_bool(F_FORZATURA);
|
||||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||||
{
|
{
|
||||||
@ -736,7 +737,16 @@ void THardy_esselunga_fat::main_loop()
|
|||||||
{
|
{
|
||||||
THardy_esselunga_fat_mask mask;
|
THardy_esselunga_fat_mask mask;
|
||||||
while (mask.run() == K_ENTER)
|
while (mask.run() == K_ENTER)
|
||||||
elabora(mask);
|
{
|
||||||
|
const bool enne = mask.get_bool(F_ENNE);
|
||||||
|
if (enne)
|
||||||
|
{
|
||||||
|
elabora(mask, 0);
|
||||||
|
elabora(mask, 3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
elabora(mask, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool THardy_esselunga_fat::create()
|
bool THardy_esselunga_fat::create()
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#define F_DEFINITIVO 205
|
#define F_DEFINITIVO 205
|
||||||
#define F_SHEETDOC 206
|
#define F_SHEETDOC 206
|
||||||
#define F_FORZATURA 207
|
#define F_FORZATURA 207
|
||||||
|
#define F_ENNE 208
|
||||||
// campi dello sheet
|
// campi dello sheet
|
||||||
#define F_S_CODNUM 101
|
#define F_S_CODNUM 101
|
||||||
#define F_S_DESNUM 102
|
#define F_S_DESNUM 102
|
||||||
|
@ -34,17 +34,22 @@ END
|
|||||||
|
|
||||||
BOOLEAN F_DEFINITIVO
|
BOOLEAN F_DEFINITIVO
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 35 0 "Trasferimento definitivo"
|
PROMPT 31 0 "Trasferimento definitivo"
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_FORZATURA
|
BOOLEAN F_FORZATURA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 35 1 "Includere documenti già trasferiti"
|
PROMPT 31 1 "Includere documenti già trasferiti"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_ENNE
|
||||||
|
BEGIN
|
||||||
|
PROMPT 31 2 "Genera vecchio (senza N) e nuovo formato (con N)"
|
||||||
END
|
END
|
||||||
|
|
||||||
SPREADSHEET F_SHEETDOC 78
|
SPREADSHEET F_SHEETDOC 78
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 2 "Scelta documenti"
|
PROMPT 1 3 "Scelta documenti"
|
||||||
ITEM "Cod. num."
|
ITEM "Cod. num."
|
||||||
ITEM "Descrizione num.@50"
|
ITEM "Descrizione num.@50"
|
||||||
END
|
END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user