Patch level : 12.0 656
Files correlati : fp, agalib Commento : - Corretta gestione prezzo in valuta straniera - Aggiunta scrittura errori in fp_err.log - Sistemata scrittura sede - Aggiunta funzione stringa_eng in real uguale a stringa ma che non fa eng2ita
This commit is contained in:
parent
ec72a396cc
commit
02502cfdf5
@ -734,6 +734,8 @@ void TDoc_fp::log(int severity, const char* msg)
|
|||||||
if (_log == nullptr)
|
if (_log == nullptr)
|
||||||
{
|
{
|
||||||
_log = new TLog_report;
|
_log = new TLog_report;
|
||||||
|
// Tento l'eliminazione del file
|
||||||
|
std::remove("fp_err.log");
|
||||||
}
|
}
|
||||||
if (severity < 0)
|
if (severity < 0)
|
||||||
{
|
{
|
||||||
@ -741,14 +743,23 @@ void TDoc_fp::log(int severity, const char* msg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
static TString txt;
|
||||||
|
txt.cut(0);
|
||||||
if (_logpaf.full())
|
if (_logpaf.full())
|
||||||
{
|
{
|
||||||
TString txt;
|
|
||||||
txt << _logpaf << ": " << msg;
|
txt << _logpaf << ": " << msg;
|
||||||
_log->log(severity, txt);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_log->log(severity, msg);
|
txt << msg;
|
||||||
|
|
||||||
|
_log->log(severity, txt);
|
||||||
|
|
||||||
|
// Scrivo anche su file
|
||||||
|
std::filebuf fb;
|
||||||
|
fb.open("fp_err.log", std::ios::out|std::ios::app);
|
||||||
|
std::ostream os(&fb);
|
||||||
|
os << txt << std::endl;
|
||||||
|
fb.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -840,11 +851,11 @@ const TString& TDoc_fp::converti_prezzo(const real& prezzo) const
|
|||||||
TString& ret = get_tmp_string();
|
TString& ret = get_tmp_string();
|
||||||
ret.cut(0);
|
ret.cut(0);
|
||||||
|
|
||||||
if (_is_valuta_estera)
|
if (_doc_cambio._is_valuta_estera)
|
||||||
{
|
{
|
||||||
TCurrency ret(prezzo);
|
TCurrency app(prezzo, _doc_cambio._cod_val, _doc_cambio._cambio, true);
|
||||||
ret.change_to_euro_val();
|
app.change_to_euro_val();
|
||||||
return ret.string(true);
|
ret << app.get_num().stringa_eng(0,8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret << prezzo;
|
ret << prezzo;
|
||||||
@ -893,7 +904,10 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
const char* const paese = "IT";
|
const char* const paese = "IT";
|
||||||
TCausale caus = TCausale(doc.tipo().causale(), doc.anno());
|
TCausale caus = TCausale(doc.tipo().causale(), doc.anno());
|
||||||
|
|
||||||
_is_valuta_estera = !is_euro_value(doc.valuta());
|
// Valorizzo la gestione del cambio
|
||||||
|
_doc_cambio._cod_val = doc.valuta();
|
||||||
|
_doc_cambio._is_valuta_estera = !is_euro_value(doc.valuta());
|
||||||
|
_doc_cambio._cambio = doc.cambio();
|
||||||
|
|
||||||
// <DatiTrassmissione>
|
// <DatiTrassmissione>
|
||||||
TPaf_record paf0100f("PAF0100F");
|
TPaf_record paf0100f("PAF0100F");
|
||||||
@ -1031,15 +1045,17 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
|
|
||||||
// DatiSede
|
// DatiSede
|
||||||
|
|
||||||
if (cliente.italiano())
|
|
||||||
{
|
|
||||||
paf0400f.set("P4_SEDEIND", cliente.via_residenza());
|
paf0400f.set("P4_SEDEIND", cliente.via_residenza());
|
||||||
paf0400f.set("P4_SEDENRCIVICO", cliente.civico_residenza());
|
paf0400f.set("P4_SEDENRCIVICO", cliente.civico_residenza());
|
||||||
paf0400f.set("P4_SEDECAP", cliente.CAP_residenza());
|
paf0400f.set("P4_SEDECAP", cliente.CAP_residenza());
|
||||||
paf0400f.set("P4_SEDECOMUNE", cliente.comune_residenza());
|
paf0400f.set("P4_SEDECOMUNE", cliente.comune_residenza());
|
||||||
paf0400f.set("P4_SEDEPROV", cliente.provincia_residenza());
|
|
||||||
paf0400f.set("P4_SEDENAZ", cliente.stato_residenza_ISO());
|
paf0400f.set("P4_SEDENAZ", cliente.stato_residenza_ISO());
|
||||||
}
|
if (cliente.italiano())
|
||||||
|
{
|
||||||
|
paf0400f.set("P4_SEDECAP", "00000");
|
||||||
|
paf0400f.set("P4_SEDEPROV", cliente.provincia_residenza());
|
||||||
|
}
|
||||||
|
|
||||||
paf0400f.set("P4_GESTIONE", "D");
|
paf0400f.set("P4_GESTIONE", "D");
|
||||||
ok &= insert(paf0400f);
|
ok &= insert(paf0400f);
|
||||||
|
@ -92,7 +92,13 @@ private:
|
|||||||
vector<TString> _query;
|
vector<TString> _query;
|
||||||
TString8 _hfatt; // Codice univoco di 6 caratteri dell'ufficio P.A. o di 7 caratteri per un privato
|
TString8 _hfatt; // Codice univoco di 6 caratteri dell'ufficio P.A. o di 7 caratteri per un privato
|
||||||
TString20 _bfatt; // Codice univoco di 20 caratteri del documento
|
TString20 _bfatt; // Codice univoco di 20 caratteri del documento
|
||||||
bool _is_valuta_estera; // Se il documento è in valuta estera
|
struct
|
||||||
|
{
|
||||||
|
bool _is_valuta_estera; // Se il documento è in valuta estera
|
||||||
|
TString4 _cod_val;
|
||||||
|
real _cambio;
|
||||||
|
} _doc_cambio;
|
||||||
|
|
||||||
|
|
||||||
int parse_line(const TString& line, TString& var, TString& val) const;
|
int parse_line(const TString& line, TString& var, TString& val) const;
|
||||||
bool create_table(TScanner& paf, const TString& table);
|
bool create_table(TScanner& paf, const TString& table);
|
||||||
|
@ -1285,6 +1285,13 @@ const char* real::stringa (int len, int dec, char pad) const
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Certified 99%
|
||||||
|
const char* real::stringa_eng(int len, int dec, char pad) const
|
||||||
|
{
|
||||||
|
char* str = const_cast<char*>(string(len, dec, pad));
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
// Certified 99%
|
// Certified 99%
|
||||||
const char* real::stringe(int len, int dec, char pad) const
|
const char* real::stringe(int len, int dec, char pad) const
|
||||||
{
|
{
|
||||||
|
@ -115,6 +115,9 @@ public:
|
|||||||
// @cmember Trasforma un reale in stringa (chiama <mf real::string>), ma
|
// @cmember Trasforma un reale in stringa (chiama <mf real::string>), ma
|
||||||
// ritorna il formato italiano
|
// ritorna il formato italiano
|
||||||
const char* stringa(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
|
const char* stringa(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
|
||||||
|
// @cmember Trasforma un reale in stringa (chiama <mf real::string>), ma
|
||||||
|
// ritorna il formato inglese
|
||||||
|
const char* stringa_eng(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
|
||||||
// @cmember Trasforma un reale in stringa (chiama <mf real::string>),
|
// @cmember Trasforma un reale in stringa (chiama <mf real::string>),
|
||||||
//ma ritorna il formato atteso da Excel
|
//ma ritorna il formato atteso da Excel
|
||||||
const char* stringe(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
|
const char* stringe(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user