From 78395f3bcabe852c30fb3422ddb572ea7c2d2844 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 6 Sep 2005 17:35:31 +0000 Subject: [PATCH] Patch level : 2.2 Files correlati : Ricompilazione Demo : [ ] Commento : Corretta costruzione recordset dei conti "normali" usati come analitici git-svn-id: svn://10.65.10.50/trunk@13333 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ca/ca3300.cpp | 2 +- ca/calib02.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ca/ca3300.cpp b/ca/ca3300.cpp index cfde87dc4..e14e4848d 100755 --- a/ca/ca3300.cpp +++ b/ca/ca3300.cpp @@ -563,7 +563,7 @@ void TRecordset_sezioni_contrapposte::add_conto(int indbil, const TString& b) const TSaldanal& sa = ca_saldo(bill, _da_data, _a_data, _tipimov); if (!sa._fin.is_zero()) { - TImporto zero; + const TImporto zero; TArray& a = conti(indbil); add_conto(b, sa._fin, zero, zero, a); } diff --git a/ca/calib02.cpp b/ca/calib02.cpp index 2d5ab9f8b..92aa7b2e6 100755 --- a/ca/calib02.cpp +++ b/ca/calib02.cpp @@ -183,8 +183,17 @@ bool TPconana_recordset::valid_record(const TRelation& rel) const { const TBill b(rel.curr()); - if ((b.sottoconto() <= 0)) //|| !b.is_analitico()) + if ((b.sottoconto() <= 0)) return false; + + // Memorizzo la posizione del file principale perche' is_analitico lo sposta + TLocalisamfile& file = rel.file(0); + const TRecnotype recno = file.recno(); + const bool isanal = b.is_analitico(); + file.readat(recno); + if (!isanal) + return false; + conto = b.string(0x8); } else @@ -612,7 +621,7 @@ bool TSaldi_cache::int_saldo_annuale(const TAnal_bill& b, int da_anno, int ad_an if (select.not_empty()) select << "&&"; select << "(FASE=='" << b.fase() << "')"; } - if (b.conto().not_empty()) // && da_anno != ad_anno) + if (b.conto().not_empty()) { if (select.not_empty()) select << "&&"; select << "(CONTO[1," << b.conto().len() << "]=='" << b.conto() << "')"; @@ -624,10 +633,14 @@ bool TSaldi_cache::int_saldo_annuale(const TAnal_bill& b, int da_anno, int ad_an if (da_anno > 0) { query << "\nFROM ANNO=" << da_anno; + if (b.conto().not_empty()) + query << " CONTO=" << b.conto(); query << '\n'; } query << "\nTO ANNO=" << ad_anno; + if (b.conto().not_empty()) + query << " CONTO=" << b.conto(); query << '\n'; TISAM_recordset saldini(query);