Patch level : 10.0
Files correlati : ve1 Ricompilazione Demo : [ ] Commento : Uniformato uso cache su tipi documento git-svn-id: svn://10.65.10.50/trunk@17404 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4221dcaea1
commit
159544e698
@ -168,8 +168,6 @@ void TDocumento_form::set_doc_ext(TRectype* doc)
|
|||||||
relation()->update();
|
relation()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
static TTipi_documento_cache __tipi;
|
|
||||||
|
|
||||||
TDocumento_form::TDocumento_form(TRectype& doc, TRelation& rel, bool definitiva, bool interattivo, bool aggiuntivo)
|
TDocumento_form::TDocumento_form(TRectype& doc, TRelation& rel, bool definitiva, bool interattivo, bool aggiuntivo)
|
||||||
: _firmrel(rel), _sorted_cur(NULL), _docfile(NULL), _rdocfile(NULL), _doc(NULL), _valid(false)
|
: _firmrel(rel), _sorted_cur(NULL), _docfile(NULL), _rdocfile(NULL), _doc(NULL), _valid(false)
|
||||||
{
|
{
|
||||||
@ -178,7 +176,7 @@ TDocumento_form::TDocumento_form(TRectype& doc, TRelation& rel, bool definitiva,
|
|||||||
const TString4 tipodoc(doc.get(DOC_TIPODOC));
|
const TString4 tipodoc(doc.get(DOC_TIPODOC));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
TFilename nomeform;
|
TFilename nomeform;
|
||||||
const TTipo_documento & tipo = __tipi.tipo(tipodoc);
|
const TTipo_documento & tipo = cached_tipodoc(tipodoc);
|
||||||
|
|
||||||
if (tipo.empty())
|
if (tipo.empty())
|
||||||
{
|
{
|
||||||
|
@ -79,8 +79,8 @@ bool TScoperto_msk::fill_sheet()
|
|||||||
const TCodice_numerazione codnum(num.curr());
|
const TCodice_numerazione codnum(num.curr());
|
||||||
for (int t = codnum.ntipi_doc()-1; t >= 0; t--)
|
for (int t = codnum.ntipi_doc()-1; t >= 0; t--)
|
||||||
{
|
{
|
||||||
const TString8 td = codnum.tipo_doc(t);
|
const TString4 td = codnum.tipo_doc(t);
|
||||||
const TTipo_documento& tpd = TDocumento::tipo(td);
|
const TTipo_documento& tpd = cached_tipodoc(td);
|
||||||
TFilename prof; tpd.profile_name(prof);
|
TFilename prof; tpd.profile_name(prof);
|
||||||
TConfig ini(prof, "MAIN");
|
TConfig ini(prof, "MAIN");
|
||||||
if (ini.get("TIPOCF") == "F")
|
if (ini.get("TIPOCF") == "F")
|
||||||
|
@ -834,7 +834,6 @@ TObject* TReports_cache::key2obj(const char* key)
|
|||||||
class TReport_doc_app : public TSkeleton_application
|
class TReport_doc_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
TReport_doc_mask* _msk;
|
TReport_doc_mask* _msk;
|
||||||
TTipi_documento_cache _tipi_cache;
|
|
||||||
|
|
||||||
int _anno;
|
int _anno;
|
||||||
TString16 _codnum; // codice numerazione / profilo
|
TString16 _codnum; // codice numerazione / profilo
|
||||||
@ -996,7 +995,7 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
|
|||||||
doc.get(DOC_CODCF).as_int());
|
doc.get(DOC_CODCF).as_int());
|
||||||
|
|
||||||
const TString& tipodoc = doc.get(DOC_TIPODOC).as_string();
|
const TString& tipodoc = doc.get(DOC_TIPODOC).as_string();
|
||||||
const TTipo_documento& tipo = _tipi_cache.tipo(tipodoc);
|
const TTipo_documento& tipo = cached_tipodoc(tipodoc);
|
||||||
TFilename profilo;
|
TFilename profilo;
|
||||||
tipo.main_print_profile(profilo);
|
tipo.main_print_profile(profilo);
|
||||||
const bool send_mail = send_by_mail && get_mail_address().full();
|
const bool send_mail = send_by_mail && get_mail_address().full();
|
||||||
@ -1017,9 +1016,9 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
|
|||||||
mail_book = new TDoc_book;
|
mail_book = new TDoc_book;
|
||||||
if (!report.print(doc, *mail_book, is_definitive, 1, true, arc))
|
if (!report.print(doc, *mail_book, is_definitive, 1, true, arc))
|
||||||
break;
|
break;
|
||||||
TString mesg(TDocumento::tipo(doc.get(DOC_TIPODOC).as_string()).descrizione());
|
TString mesg;
|
||||||
|
mesg << tipo.descrizione() << " n. " << doc.get(DOC_NDOC).as_int()
|
||||||
mesg << " n. " << doc.get(DOC_NDOC).as_int() << " a " << get_mail_address();
|
<< TR(" a ") << get_mail_address();
|
||||||
log.log(0, mesg);
|
log.log(0, mesg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -120,8 +120,8 @@ void TStampa_contab_docs::cerca_numerazioni_valide(const int anno)
|
|||||||
//giro sui tipidoc collegati
|
//giro sui tipidoc collegati
|
||||||
for (int t = codnum.ntipi_doc()-1; t >= 0; t--)
|
for (int t = codnum.ntipi_doc()-1; t >= 0; t--)
|
||||||
{
|
{
|
||||||
const TString8 td = codnum.tipo_doc(t);
|
const TString4 td = codnum.tipo_doc(t);
|
||||||
const TTipo_documento& tpd = TDocumento::tipo(td);
|
const TTipo_documento& tpd = cached_tipodoc(td);
|
||||||
//causale collegata al tipo doc
|
//causale collegata al tipo doc
|
||||||
const TString& codcaus = tpd.causale();
|
const TString& codcaus = tpd.causale();
|
||||||
//se la causale non è vuota, la numerazione va considerata
|
//se la causale non è vuota, la numerazione va considerata
|
||||||
|
@ -330,7 +330,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TTipo_documento & cached_tipodoc(const char * tipodoc);
|
const TTipo_documento& cached_tipodoc(const char* tipodoc);
|
||||||
|
|
||||||
class TCodice_numerazione : public TRectype
|
class TCodice_numerazione : public TRectype
|
||||||
{
|
{
|
||||||
|
@ -35,8 +35,8 @@ public:
|
|||||||
TTipo_documento_cache::TTipo_documento_cache()
|
TTipo_documento_cache::TTipo_documento_cache()
|
||||||
: TRecord_cache("%TIP", 1)
|
: TRecord_cache("%TIP", 1)
|
||||||
{
|
{
|
||||||
test_file_changes(); // Tieni d'occhio le modifiche sul file
|
test_file_changes(); // Tieni d'occhio le modifiche sul file
|
||||||
set_items_limit(64); // Standard
|
set_items_limit(59); // Standard
|
||||||
}
|
}
|
||||||
|
|
||||||
TObject* TTipo_documento_cache::rec2obj(const TRectype& curr) const
|
TObject* TTipo_documento_cache::rec2obj(const TRectype& curr) const
|
||||||
@ -47,16 +47,14 @@ TObject* TTipo_documento_cache::rec2obj(const TRectype& curr) const
|
|||||||
TTipo_documento & TTipo_documento_cache::tipo(const char* key)
|
TTipo_documento & TTipo_documento_cache::tipo(const char* key)
|
||||||
{
|
{
|
||||||
TString8 k;
|
TString8 k;
|
||||||
|
|
||||||
k << "TIP|" << key;
|
k << "TIP|" << key;
|
||||||
TTipo_documento & tipo = (TTipo_documento &) query(k);
|
TTipo_documento & tipo = (TTipo_documento &) query(k);
|
||||||
return tipo;
|
return tipo;
|
||||||
}
|
}
|
||||||
|
|
||||||
TTipo_documento & cached_tipodoc(const char * tipodoc)
|
const TTipo_documento & cached_tipodoc(const char * tipodoc)
|
||||||
{
|
{
|
||||||
HIDDEN TTipo_documento_cache __cache_tipi_documento;
|
HIDDEN TTipo_documento_cache __cache_tipi_documento;
|
||||||
|
|
||||||
return __cache_tipi_documento.tipo(tipodoc);
|
return __cache_tipi_documento.tipo(tipodoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3146,7 +3146,7 @@ error_type TContabilizzazione::write_pagamento_anticipo(TDocumento& doc)
|
|||||||
if (res > ipp || i == nrate) // sull'ultima rata mette tutto il resto...
|
if (res > ipp || i == nrate) // sull'ultima rata mette tutto il resto...
|
||||||
{
|
{
|
||||||
res = ipp;
|
res = ipp;
|
||||||
imp = 0.0;
|
imp.set_num(ZERO);
|
||||||
if (!is_saldo_doc)
|
if (!is_saldo_doc)
|
||||||
s_a = 'A';
|
s_a = 'A';
|
||||||
}
|
}
|
||||||
@ -3157,8 +3157,6 @@ error_type TContabilizzazione::write_pagamento_anticipo(TDocumento& doc)
|
|||||||
|
|
||||||
if (valuta)
|
if (valuta)
|
||||||
{
|
{
|
||||||
// Guy was here
|
|
||||||
// riga_pagamento.put(PAGSCA_IMPORTO, ((real)(res*cambio)).round());
|
|
||||||
TCurrency_documento impval(res);
|
TCurrency_documento impval(res);
|
||||||
impval.change_to_firm_val();
|
impval.change_to_firm_val();
|
||||||
riga_pagamento.put(PAGSCA_IMPORTO, impval.get_num());
|
riga_pagamento.put(PAGSCA_IMPORTO, impval.get_num());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user