Patch level : 10.0 870
Files correlati : lv4.exe Ricompilazione Demo : [ ] Commento : Aggiunto un log degli errori all' importazione fatture vecchgio COGECO git-svn-id: svn://10.65.10.50/branches/R_10_00@21383 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
04e114197f
commit
90c99670b8
@ -3,6 +3,7 @@
|
|||||||
#include <automask.h>
|
#include <automask.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
|
#include <reprint.h>
|
||||||
#include <reputils.h>
|
#include <reputils.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
@ -65,10 +66,12 @@ TLaundry_recordset::TLaundry_recordset(const int rec_lenght)
|
|||||||
//classe TConti_cache
|
//classe TConti_cache
|
||||||
class TConti_cache : public TCache
|
class TConti_cache : public TCache
|
||||||
{
|
{
|
||||||
|
TLog_report * _log;
|
||||||
protected:
|
protected:
|
||||||
virtual TObject* key2obj(const char* key);
|
virtual TObject* key2obj(const char* key);
|
||||||
public:
|
public:
|
||||||
const TBill& decodifica_conti(const long mastro, const long conto);
|
const TBill& decodifica_conti(const long mastro, const long conto);
|
||||||
|
TConti_cache(TLog_report * log) : _log(log) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//KEY2OBJ: ridefinisco il metodo virtuale key2obj in modo che mi restituisca quello di cui ho bisogno
|
//KEY2OBJ: ridefinisco il metodo virtuale key2obj in modo che mi restituisca quello di cui ho bisogno
|
||||||
@ -80,6 +83,11 @@ TObject* TConti_cache::key2obj(const char* key)
|
|||||||
riclpdc.put("CODICE", key);
|
riclpdc.put("CODICE", key);
|
||||||
if(riclpdc.read(_isgteq) == NOERR && riclpdc.get("CODICE") == key)
|
if(riclpdc.read(_isgteq) == NOERR && riclpdc.get("CODICE") == key)
|
||||||
return new TBill(riclpdc.get_int("GRUPPO"), riclpdc.get_int("CONTO"), riclpdc.get_long("SOTTOCONTO"));
|
return new TBill(riclpdc.get_int("GRUPPO"), riclpdc.get_int("CONTO"), riclpdc.get_long("SOTTOCONTO"));
|
||||||
|
TString mastro(key);
|
||||||
|
TString conto(mastro.mid(6));
|
||||||
|
|
||||||
|
mastro = mastro.left(6);
|
||||||
|
_log->log(2, format(FR("Mastro %6s Conto %6s assente"), (const char *) mastro, (const char *) conto));
|
||||||
return new TBill;
|
return new TBill;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +110,7 @@ class TDecodifica_codici : public TObject
|
|||||||
{
|
{
|
||||||
TAssoc_array _tab;
|
TAssoc_array _tab;
|
||||||
TConti_cache _conti;
|
TConti_cache _conti;
|
||||||
|
TLog_report * _log;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void riempi_array();
|
void riempi_array();
|
||||||
@ -115,7 +124,7 @@ public:
|
|||||||
const TString& decodifica_valute(const int val_cog);
|
const TString& decodifica_valute(const int val_cog);
|
||||||
const TBill& decodifica_conto(const long mastro, const long conto);
|
const TBill& decodifica_conto(const long mastro, const long conto);
|
||||||
|
|
||||||
TDecodifica_codici();
|
TDecodifica_codici(TLog_report * log);
|
||||||
};
|
};
|
||||||
|
|
||||||
//RIEMPI_ARRAY: riempe l'Assoc_array che contiene i dati per fare la decodifica
|
//RIEMPI_ARRAY: riempe l'Assoc_array che contiene i dati per fare la decodifica
|
||||||
@ -165,6 +174,7 @@ const TString& TDecodifica_codici::decodifica(const char* tabella, const int cod
|
|||||||
if(data != NULL)
|
if(data != NULL)
|
||||||
return *data;
|
return *data;
|
||||||
}
|
}
|
||||||
|
_log->log(2, format(FR("Tabella %s codice %ld assente"), tabella, codice));
|
||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +215,7 @@ const TBill& TDecodifica_codici::decodifica_conto(const long mastro, const long
|
|||||||
}
|
}
|
||||||
|
|
||||||
//costruttore
|
//costruttore
|
||||||
TDecodifica_codici::TDecodifica_codici()
|
TDecodifica_codici::TDecodifica_codici(TLog_report * log) : _log(log), _conti(log)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
@ -329,6 +339,7 @@ class TImporta_fat_app : public TSkeleton_application
|
|||||||
TDecodifica_codici* _codici;
|
TDecodifica_codici* _codici;
|
||||||
TArray _conti;
|
TArray _conti;
|
||||||
TArray _importi;
|
TArray _importi;
|
||||||
|
TLog_report * _log;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool search_gr_sp_ca(const int gruppo, const char* specie, const int categoria);
|
bool search_gr_sp_ca(const int gruppo, const char* specie, const int categoria);
|
||||||
@ -580,19 +591,26 @@ void TImporta_fat_app::transfer(const TFilename& file)
|
|||||||
if(configfile != NULL)
|
if(configfile != NULL)
|
||||||
delete configfile;
|
delete configfile;
|
||||||
|
|
||||||
|
TReport_book book;
|
||||||
|
|
||||||
|
book.add(*_log);
|
||||||
|
book.print_or_preview();
|
||||||
|
_log->reset();
|
||||||
elabora_file(tmpdir);
|
elabora_file(tmpdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TImporta_fat_app::create()
|
bool TImporta_fat_app::create()
|
||||||
{
|
{
|
||||||
_msk = new TImporta_fat_msk();
|
_msk = new TImporta_fat_msk();
|
||||||
_codici = new TDecodifica_codici();
|
_log = new TLog_report("Importazione fatture vecchio COGECO");
|
||||||
|
_codici = new TDecodifica_codici(_log);
|
||||||
return TSkeleton_application::create();
|
return TSkeleton_application::create();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TImporta_fat_app::destroy()
|
bool TImporta_fat_app::destroy()
|
||||||
{
|
{
|
||||||
delete _msk;
|
delete _msk;
|
||||||
|
delete _log;
|
||||||
return TApplication::destroy();
|
return TApplication::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user