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
This commit is contained in:
		
							parent
							
								
									a6722a454d
								
							
						
					
					
						commit
						78395f3bca
					
				@ -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);
 | 
					      const TSaldanal& sa = ca_saldo(bill, _da_data, _a_data, _tipimov);
 | 
				
			||||||
      if (!sa._fin.is_zero())
 | 
					      if (!sa._fin.is_zero())
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        TImporto zero;
 | 
					        const TImporto zero;
 | 
				
			||||||
        TArray& a = conti(indbil);
 | 
					        TArray& a = conti(indbil);
 | 
				
			||||||
        add_conto(b, sa._fin, zero, zero, a);
 | 
					        add_conto(b, sa._fin, zero, zero, a);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
				
			|||||||
@ -183,8 +183,17 @@ bool TPconana_recordset::valid_record(const TRelation& rel) const
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    const TBill b(rel.curr());
 | 
					    const TBill b(rel.curr());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ((b.sottoconto() <= 0)) //|| !b.is_analitico())
 | 
							if ((b.sottoconto() <= 0))
 | 
				
			||||||
      return false;
 | 
					      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);
 | 
					    conto = b.string(0x8);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else
 | 
					  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 << "&&";
 | 
					    if (select.not_empty()) select << "&&";
 | 
				
			||||||
    select << "(FASE=='" << b.fase() << "')";
 | 
					    select << "(FASE=='" << b.fase() << "')";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if (b.conto().not_empty()) // && da_anno != ad_anno)
 | 
					  if (b.conto().not_empty())
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    if (select.not_empty()) select << "&&";
 | 
					    if (select.not_empty()) select << "&&";
 | 
				
			||||||
    select << "(CONTO[1," << b.conto().len() << "]=='" << b.conto() << "')";
 | 
					    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)
 | 
					  if (da_anno > 0)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    query << "\nFROM ANNO=" << da_anno;
 | 
					    query << "\nFROM ANNO=" << da_anno;
 | 
				
			||||||
 | 
					    if (b.conto().not_empty())
 | 
				
			||||||
 | 
					      query << " CONTO=" << b.conto();
 | 
				
			||||||
    query << '\n';
 | 
					    query << '\n';
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  query << "\nTO ANNO=" << ad_anno;
 | 
					  query << "\nTO ANNO=" << ad_anno;
 | 
				
			||||||
 | 
					  if (b.conto().not_empty())
 | 
				
			||||||
 | 
					    query << " CONTO=" << b.conto();
 | 
				
			||||||
  query << '\n';
 | 
					  query << '\n';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TISAM_recordset saldini(query);
 | 
					  TISAM_recordset saldini(query);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user