[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4105 - phpcompta/trunk/include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4105 - phpcompta/trunk/include |
Date: |
Mon, 16 May 2011 18:02:25 +0200 (CEST) |
Author: danydb
Date: 2011-05-16 18:02:25 +0200 (Mon, 16 May 2011)
New Revision: 4105
Modified:
phpcompta/trunk/include/class_anc_table.php
Log:
Fix bug date
Modified: phpcompta/trunk/include/class_anc_table.php
===================================================================
--- phpcompta/trunk/include/class_anc_table.php 2011-05-16 13:42:27 UTC (rev
4104)
+++ phpcompta/trunk/include/class_anc_table.php 2011-05-16 16:02:25 UTC (rev
4105)
@@ -57,18 +57,21 @@
*/
function load_poste()
{
- $date=$this->set_sql_filter();
- $date=($date != '')?" $date":'';
$sql_from_poste=($this->from_poste!='')?" and po.po_name >=
upper('".Database::escape_string($this->from_poste)."')":'';
$sql_to_poste=($this->to_poste!='')?" and po.po_name <=
upper('".Database::escape_string($this->to_poste)."')":'';
+ $this->db->exec_sql('create temporary table table_analytic as select *
from comptaproc.table_analytic_account(\''.$this->from.'\',\''.$this->to.'\')');
- $header="select distinct po_id,po_name from v_table_analytic_account where
- pa_id=$1 ".$date.$sql_from_poste.$sql_to_poste." order by
po_name";
+ $header="select distinct po_id,po_name from table_analytic
+ where
+ pa_id=$1 ".$sql_from_poste.$sql_to_poste." order by po_name";
$this->aheader=$this->db->get_array($header,array($this->pa_id));
- $this->arow=$this->db->get_array("select distinct j_poste,name from
v_table_analytic_account where
- pa_id=$1 ".$date.$sql_from_poste.$sql_to_poste." order by
j_poste",array($this->pa_id));
- $this->sql='select sum_amount from v_table_analytic_account where
j_poste=$1 and po_id=$2 and pa_id='.$this->pa_id.'
'.$date.$sql_from_poste.$sql_to_poste;
+ $this->arow=$this->db->get_array("select distinct card_account,name
+ from table_analytic
+ where
+ pa_id=$1 ".$sql_from_poste.$sql_to_poste." order by
card_account",array($this->pa_id));
+
+ $this->sql='select sum_amount from table_analytic where card_account=$1
and po_id=$2 and pa_id='.$this->pa_id.' '.$sql_from_poste.$sql_to_poste;
}
/**
@@ -77,18 +80,19 @@
*/
function load_card()
{
- $date=$this->set_sql_filter();
- $date=($date != '')?" $date":'';
$sql_from_poste=($this->from_poste!='')?" and po.po_name >=
upper('".Database::escape_string($this->from_poste)."')":'';
$sql_to_poste=($this->to_poste!='')?" and po.po_name <=
upper('".Database::escape_string($this->to_poste)."')":'';
+ $this->db->exec_sql('create temporary table table_analytic as select *
from comptaproc.table_analytic_card(\''.$this->from.'\',\''.$this->to.'\')');
- $header="select distinct po_id,po_name from v_table_analytic_card where
- pa_id=$1 ".$date.$sql_from_poste.$sql_to_poste." order by
po_name";
+ $header="select distinct po_id,po_name from table_analytic
+ where
+ pa_id=$1 ".$sql_from_poste.$sql_to_poste." order by po_name";
$this->aheader=$this->db->get_array($header,array($this->pa_id));
- $this->arow=$this->db->get_array("select distinct f_id,j_qcode,name from
v_table_analytic_card where
- pa_id=$1 ".$date.$sql_from_poste.$sql_to_poste." order by
name",array($this->pa_id));
- $this->sql='select sum_amount from v_table_analytic_card where f_id=$1 and
po_id=$2 and pa_id='.$this->pa_id.' '.$date.$sql_from_poste.$sql_to_poste;
+ $this->arow=$this->db->get_array("select distinct f_id,card_account,name
from table_analytic
+ where
+ pa_id=$1 ".$sql_from_poste.$sql_to_poste." order by
name",array($this->pa_id));
+ $this->sql='select sum_amount from table_analytic where f_id=$1 and
po_id=$2 and pa_id='.$this->pa_id.' '.$sql_from_poste.$sql_to_poste;
}
/**
address@hidden display the button export CSV
@@ -141,7 +145,7 @@
for ($i=0;$i<count($this->arow);$i++)
{
echo '<tr>';
- echo
td(HtmlInput::history_card($this->arow[$i]['f_id'],$this->arow[$i]['j_qcode'].'
'.$this->arow[$i]['name']));
+ echo
td(HtmlInput::history_card($this->arow[$i]['f_id'],$this->arow[$i]['card_account'].'
'.$this->arow[$i]['name']));
$tot_row=0;
for ($x=0;$x<count($this->aheader);$x++)
{
@@ -194,11 +198,11 @@
for ($i=0;$i<count($this->arow);$i++)
{
echo '<tr>';
- echo
td(HtmlInput::history_account($this->arow[$i]['j_poste'],$this->arow[$i]['j_poste'].'
'.$this->arow[$i]['name']));
+ echo
td(HtmlInput::history_account($this->arow[$i]['card_account'],$this->arow[$i]['card_account'].'
'.$this->arow[$i]['name']));
$tot_row=0;
for ($x=0;$x<count($this->aheader);$x++)
{
-
$amount=$this->db->get_value($this->sql,array($this->arow[$i]['j_poste'],$this->aheader[$x]['po_id']));
+
$amount=$this->db->get_value($this->sql,array($this->arow[$i]['card_account'],$this->aheader[$x]['po_id']));
if ($amount==null)$amount=0;
if ( isset($tot_col[$x]))
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4105 - phpcompta/trunk/include,
phpcompta-dev <=