Patch level :2.2 179

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :correzioni sui riporti


git-svn-id: svn://10.65.10.50/trunk@13354 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2005-09-19 17:17:27 +00:00
parent fe390490c2
commit 685edcf499
4 changed files with 8 additions and 137 deletions

View File

@ -86,134 +86,6 @@ bool rep2app(const char* name, TString& app, TString& desc)
return true;
}
///////////////////////////////////////////////////////////
// TDocument_cache
///////////////////////////////////////////////////////////
class TDocument_cache : TCache
{
protected:
virtual TObject* key2obj(const char* key);
public:
TDocumento& doc(const TRectype& rec);
TDocument_cache() : TCache(23) { }
virtual ~TDocument_cache() { }
};
TObject* TDocument_cache::key2obj(const char* key)
{
TToken_string k(key);
const char provv = *k.get(0);
const int anno = k.get_int();
const TString4 codnum= k.get();
const long ndoc = k.get_long();
return new TDocumento(provv, anno, codnum, ndoc);
}
TDocumento& TDocument_cache::doc(const TRectype& rec)
{
TToken_string key;
key = rec.get(DOC_PROVV);
key.add(rec.get(DOC_ANNO));
key.add(rec.get(DOC_CODNUM));
key.add(rec.get(DOC_NDOC));
TDocumento& d = *(TDocumento*)objptr(key);
return d;
}
///////////////////////////////////////////////////////////
// TDocument_recordset
///////////////////////////////////////////////////////////
class TDocument_recordset : public TISAM_recordset
{
TDocument_cache _cache;
protected:
virtual const TVariant& get(int logic, const char* field) const;
public:
TDocument_recordset(const char* use) : TISAM_recordset(use) { }
virtual ~TDocument_recordset() { }
};
const TVariant& TDocument_recordset::get(int num, const char* field) const
{
const int idx = relation()->log2ind(num);
if (idx < 0)
return NULL_VARIANT;
const TRectype& rec = relation()->file(idx).curr();
const int logic = rec.num();
if (logic == LF_DOC || logic == LF_RIGHEDOC)
{
// Se non e' un campo standard, ma e' calcolato da una formula...
if (rec.type(field) == _nullfld)
{
const TDocumento& doc = ((TDocument_cache&)_cache).doc(rec);
TVariant& var = get_tmp_var();
const TFieldref ref(field, logic);
if (logic == LF_DOC)
{
var = ref.read(doc);
}
else
{
const int nriga = rec.get_int(RDOC_NRIGA);
const TRiga_documento& rdoc = doc[nriga];
var = ref.read(rdoc);
}
return var;
}
}
return TISAM_recordset::get(num, field);
}
///////////////////////////////////////////////////////////
// TDocument_report
///////////////////////////////////////////////////////////
class TDocument_report : public TReport
{
protected:
virtual bool set_recordset(const TString& query);
public:
bool load(const char* name);
};
bool TDocument_report::set_recordset(const TString& query)
{
return TReport::set_recordset(new TDocument_recordset(query));
}
bool TDocument_report::load(const char* name)
{
const bool ok = TReport::load(name);
if (ok)
{
// Purtroppo il recordset delle sottosezioni deve essere reimpostato a mano
for (int i = 11; i <= 999; i++)
{
TReport_section* sec = find_section('B', i);
if (sec != NULL)
{
TRecordset* recset = sec->recordset();
if (recset != NULL)
{
const TString use = recset->query_text();
recset = new TDocument_recordset(use);
sec->set_recordset(recset);
}
}
}
}
return ok;
}
///////////////////////////////////////////////////////////
// TKlarkKent_mask
///////////////////////////////////////////////////////////

View File

@ -643,10 +643,10 @@ error_type TIVA_array::add(const TRiga_documento& r, const TBill& conto, const i
}
else
{
const int gr = rs.get_int("I0");
const int co = rs.get_int("I1");
const long so = rs.get_int("I2");
const char tipo = rs.get_char("S6");
const int gr = rs->get_int("I0");
const int co = rs->get_int("I1");
const long so = rs->get_int("I2");
const char tipo = rs->get_char("S6");
c.set(gr, co, so, tipo);
}
@ -2168,7 +2168,6 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
_righe_iva->destroy(); // resetta l'assoc_array delle righe di iva
_totali_lordi.destroy();// resetta l'assoc_array dei totali lordi
const int rows = doc.rows();
for (int i=1; good() && i<=rows; i++) // browse all this fucked document rows
{
TRiga_documento& r = doc[i];
@ -3481,7 +3480,7 @@ error_type TContabilizzazione::write_anal(TDocumento& doc, const TMovimentoPN& m
if (!_caus->link_analitica())
return _error;
TConfig_anal cfg;
TConfig& cfg = ca_config();
const TDate data_att = cfg.get("DtAttCa");
if (data_att.ok())
{

View File

@ -563,7 +563,7 @@ bool TContabilizzazione_analitica::elabora(TLista_documenti& doc_in, TLista_docu
void TContabilizzazione_analitica::init()
{
TConfig_anal cfg;
TConfig& cfg = ca_config();
_usepdcc = cfg.get_bool("UsePdcc");
}

View File

@ -364,7 +364,7 @@ void TDocumento_mask::insert_anal_page()
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
const bool use_fsc = fasinfo.levels() > 0;
TConfig_anal ini;
TConfig& ini = ca_config();
const bool fsc_req = use_fsc && ini.get_bool("FscRequired");
int y = 7;
@ -1129,7 +1129,7 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga)
{
const int page = m->win2page(m->fld(m->fields()-1).parent()); // Calcolo bastardo dell'ultima pagina
TConfig_anal ini;
TConfig& ini = ca_config();
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
const bool use_fsc = fasinfo.levels() > 0;