Patch level : 2.2

Files correlati     : ve1
Ricompilazione Demo : [ ]
Commento            :

Stampatore universle report vendite


git-svn-id: svn://10.65.10.50/trunk@13146 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2005-05-24 11:56:47 +00:00
parent 7fc6f05e7f
commit 00d73704f8

View File

@ -138,32 +138,36 @@ public:
virtual ~TDocument_recordset() { } virtual ~TDocument_recordset() { }
}; };
const TVariant& TDocument_recordset::get(int logic, const char* field) const const TVariant& TDocument_recordset::get(int num, const char* field) const
{ {
const int idx = relation()->log2ind(logic); const int idx = relation()->log2ind(num);
if (idx < 0) if (idx < 0)
return NULL_VARIANT; return NULL_VARIANT;
const TRectype& rec = relation()->file(idx).curr(); const TRectype& rec = relation()->file(idx).curr();
logic = rec.num(); const int logic = rec.num();
if (logic == LF_DOC || logic == LF_RIGHEDOC)
if ((logic == LF_DOC || logic == LF_RIGHEDOC) && rec.type(field) == _nullfld)
{ {
TDocumento& doc = ((TDocument_cache&)_cache).doc(rec); // 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(); TVariant& var = get_tmp_var();
const TFieldref ref(field, logic);
if (logic == LF_DOC) if (logic == LF_DOC)
{ {
var = doc.get(field); var = ref.read(doc);
} }
else else
{ {
const int nriga = rec.get_int(RDOC_NRIGA); const int nriga = rec.get_int(RDOC_NRIGA);
const TRiga_documento& rdoc = doc[nriga]; const TRiga_documento& rdoc = doc[nriga];
var = rdoc.get(field); var = ref.read(rdoc);
} }
return var; return var;
} }
return TISAM_recordset::get(logic, field); }
return TISAM_recordset::get(num, field);
} }