Patch level : 2.2
Files correlati : Ricompilazione Demo : [ ] Commento : Corretta stampa mastrini analitici in modo da inizializzare le date vuote con date sensate, in modo che funzioni sempre la setregion Eliminato uso del metodo is_analitico durante la costruzione dei filtri sui cursori git-svn-id: svn://10.65.10.50/trunk@13337 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
52f895e24a
commit
2aaf0db4cf
@ -387,6 +387,25 @@ void TPrint_mastrini_ca_alternative_recordset::set_filter(const TPrint_mastrini_
|
||||
|
||||
_dadata = msk.get_date(F_DATAINI);
|
||||
_adata = msk.get_date(F_DATAFIN);
|
||||
// Riempie le date con valori sensati
|
||||
if (!_dadata.ok() || !_adata.ok())
|
||||
{
|
||||
TEsercizi_contabili esc;
|
||||
const int codes = msk.get_int(F_ANNO);
|
||||
if (esc.exist(codes))
|
||||
{
|
||||
const TEsercizio& esercizio = esc[codes];
|
||||
if (!_dadata.ok())
|
||||
_dadata = esercizio.inizio();
|
||||
if (!_adata.ok())
|
||||
_adata = esercizio.fine();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_adata.ok())
|
||||
_adata = TDate(31, 12, 9999);
|
||||
}
|
||||
}
|
||||
|
||||
_tipimov = 0;
|
||||
switch (msk.get(F_TIPIMOV)[0])
|
||||
|
@ -182,17 +182,22 @@ bool TPconana_recordset::valid_record(const TRelation& rel) const
|
||||
TString80 conto;
|
||||
if (_tipo == 'C')
|
||||
{
|
||||
const TBill b(rel.curr());
|
||||
const TRectype& curr = rel.curr();
|
||||
const TBill b(curr);
|
||||
|
||||
if ((b.sottoconto() <= 0))
|
||||
int level = 0;
|
||||
if (b.conto() != 0)
|
||||
level++;
|
||||
if (b.sottoconto() != 0)
|
||||
level++;
|
||||
|
||||
(bool&)(_is_anal[level]) = curr.get_bool(PCN_ANALITICA);
|
||||
|
||||
if (level < 2) // Ignora gruppi e conti
|
||||
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)
|
||||
// Ignora i sottoconti non analitici nemmeno a livello di conto o gruppo
|
||||
if (!(_is_anal[2] || _is_anal[1] || _is_anal[0]))
|
||||
return false;
|
||||
|
||||
conto = b.string(0x8);
|
||||
@ -227,13 +232,20 @@ void TPconana_recordset::set_custom_filter(TCursor& cursor) const
|
||||
{
|
||||
TRectype darec(LF_PCON), arec(LF_PCON);
|
||||
|
||||
darec.put(PCN_GRUPPO, _da_conto.mid(0,3));
|
||||
darec.put(PCN_CONTO, _da_conto.mid(3,3));
|
||||
darec.put(PCN_SOTTOCONTO, _da_conto.mid(6,6));
|
||||
arec.put(PCN_GRUPPO, _a_conto.mid(0,3));
|
||||
arec.put(PCN_CONTO, _a_conto.mid(3,3));
|
||||
arec.put(PCN_SOTTOCONTO, _a_conto.mid(6,6));
|
||||
if (_da_conto.not_empty())
|
||||
{
|
||||
darec.put(PCN_GRUPPO, _da_conto.mid(0,3));
|
||||
darec.put(PCN_CONTO, _da_conto.mid(3,3));
|
||||
darec.put(PCN_SOTTOCONTO, _da_conto.mid(6,6));
|
||||
}
|
||||
if (_a_conto.not_empty())
|
||||
{
|
||||
arec.put(PCN_GRUPPO, _a_conto.mid(0,3));
|
||||
arec.put(PCN_CONTO, _a_conto.mid(3,3));
|
||||
arec.put(PCN_SOTTOCONTO, _a_conto.mid(6,6));
|
||||
}
|
||||
cursor.setregion(darec, arec);
|
||||
memset((void*)_is_anal, 0, sizeof(_is_anal)); // Azzera flags di conti analitici
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -354,13 +366,11 @@ void TAnal_report::msg_format_fase (TVariant_stack& stack)
|
||||
void TAnal_report::msg_format_conto (TVariant_stack& stack)
|
||||
{
|
||||
// Cerca di determinare se si usa il piano contabile o analitico
|
||||
const TFixed_string gruppo(PCN_GRUPPO);
|
||||
TVariant var;
|
||||
get_record_field(gruppo, var);
|
||||
if (var.is_null())
|
||||
msg_format(LF_PCONANA, stack);
|
||||
else
|
||||
const TString& conto = curr_field()->get().as_string();
|
||||
if (conto.len() == 12)
|
||||
msg_format(LF_PCON, stack);
|
||||
else
|
||||
msg_format(LF_PCONANA, stack);
|
||||
}
|
||||
|
||||
void TAnal_report::msg_format_commessa_costo(TVariant_stack& stack)
|
||||
|
@ -87,6 +87,9 @@ class TPconana_recordset : public TISAM_recordset
|
||||
TDate _dal, _al;
|
||||
bool _movimentati, _nonnulli;
|
||||
|
||||
// Variabili per verifica conti contabili col flag di analitica
|
||||
bool _is_anal[3];
|
||||
|
||||
protected:
|
||||
bool valid_record(const TRelation& rel) const;
|
||||
static bool pianoconti_filter(const TRelation* rel);
|
||||
|
Loading…
x
Reference in New Issue
Block a user