fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [11627] property: paid report


From: Sigurd Nes
Subject: [Fmsystem-commits] [11627] property: paid report
Date: Thu, 23 Jan 2014 19:26:30 +0000

Revision: 11627
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11627
Author:   sigurdne
Date:     2014-01-23 19:26:29 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
property: paid report

Modified Paths:
--------------
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.uiinvoice.inc.php

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2014-01-23 18:16:58 UTC (rev 
11626)
+++ trunk/property/inc/class.soinvoice.inc.php  2014-01-23 19:26:29 UTC (rev 
11627)
@@ -717,11 +717,11 @@
                        $start_periode = date('Ym',$start_date);
                        $end_periode = date('Ym',$end_date);
 
-                       $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume $select_account_class "
-                               . " FROM  fm_ecobilagoverf $this->join 
fm_location1 ON (fm_ecobilagoverf.loc1 = fm_location1.loc1) "
-                               . " $this->join fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id) "
-                               . " $this->join fm_b_account ON 
(fm_ecobilagoverf.spbudact_code = fm_b_account.id) "
-                               . " WHERE (periode >='$start_periode' AND 
periode <= '$end_periode' $filtermethod )"
+                       $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume {$select_account_class}"
+                               . " FROM  fm_ecobilagoverf {$this->join} 
fm_location1 ON (fm_ecobilagoverf.loc1 = fm_location1.loc1) "
+                               . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id) "
+                               . " {$this->join} fm_b_account ON 
(fm_ecobilagoverf.spbudact_code = fm_b_account.id) "
+                               . " WHERE (periode >='{$start_periode}' AND 
periode <= '{$end_periode}' {$filtermethod})"
                                . " GROUP BY district_id,periode 
$group_account_class"
                                . " ORDER BY periode";
                        //echo $sql;
@@ -734,14 +734,40 @@
                        while ($this->db->next_record())
                        {
                                $consume[] = array
-                                       (
-                                               'consume'               => 
round($this->db->f('consume')),
-                                               'period'                => 
$this->db->f('periode'),
-                                               'district_id'   => 
$this->db->f('district_id'),
-                                               'account_class' => 
$b_account_class ? $b_account_class : $this->db->f('b_account_class')
-                                       );
+                               (
+                                       'consume'               => 
round($this->db->f('consume')),
+                                       'period'                => 
$this->db->f('periode'),
+                                       'district_id'   => 
$this->db->f('district_id'),
+                                       'account_class' => $b_account_class ? 
$b_account_class : $this->db->f('b_account_class'),
+                                       'paid'                  => 'x'
+                               );
                        }
 
+                       $filtermethod = ltrim($filtermethod, ' AND ');
+
+                       $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume {$select_account_class}"
+                               . " FROM  fm_ecobilag {$this->join} 
fm_location1 ON (fm_ecobilag.loc1 = fm_location1.loc1) "
+                               . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id) "
+                               . " {$this->join} fm_b_account ON 
(fm_ecobilag.spbudact_code = fm_b_account.id) "
+                               . " WHERE ({$filtermethod})"
+                               . " GROUP BY district_id,periode 
$group_account_class"
+                               . " ORDER BY periode";
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->total_records += $this->db->num_rows();
+
+                       while ($this->db->next_record())
+                       {
+                               $consume[] = array
+                               (
+                                       'consume'               => 
round($this->db->f('consume')),
+                                       'period'                => 
$this->db->f('periode'),
+                                       'district_id'   => 
$this->db->f('district_id'),
+                                       'account_class' => $b_account_class ? 
$b_account_class : $this->db->f('b_account_class'),
+                                       'paid'                  => ''
+                               );
+                       }
+
                        return $consume;
                }
 

Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php  2014-01-23 18:16:58 UTC (rev 
11626)
+++ trunk/property/inc/class.uiinvoice.inc.php  2014-01-23 19:26:29 UTC (rev 
11627)
@@ -2547,6 +2547,10 @@
                        $loc1                   = phpgw::get_var('loc1');
                        $district_id    = phpgw::get_var('district_id', 'int');
                        $b_account_class= phpgw::get_var('b_account_class', 
'int');
+                       $b_account= phpgw::get_var('b_account', 'int');
+
+                       $b_account_class = $b_account_class ? $b_account_class 
: substr($b_account,0,2);
+
                        $ecodimb                = phpgw::get_var('ecodimb');
 
                        //-- ubica focus del menu derecho
@@ -2909,13 +2913,13 @@
 
                        $uicols = array
                                (
-                                       'input_type'    =>      
array('varchar','varchar','varchar','link'),
-                                       'type'                  =>      
array('text'     ,'text'         ,'text'         ,'url' ),
-                                       'col_name'              =>      
array('district_id','period','account_class','consume'),
-                                       'name'                  =>      
array('district_id','period','account_class','consume'),
-                                       'formatter'             =>      
array('','','',''),
-                                       'descr'                 =>      
array(lang('District'),lang('Period'),lang('Budget account'),lang('Consume')),
-                                       'className'             =>      
array('centerClasss','centerClasss','centerClasss','rightClasss')
+                                       'input_type'    =>      
array('varchar','varchar','varchar','link', 'varchar'),
+                                       'type'                  =>      
array('text'     ,'text'         ,'text'         ,'url', 'text' ),
+                                       'col_name'              =>      
array('district_id','period','account_class','consume', 'paid'),
+                                       'name'                  =>      
array('district_id','period','account_class','consume', 'paid'),
+                                       'formatter'             =>      
array('','','','',''),
+                                       'descr'                 =>      
array(lang('District'),lang('Period'),lang('Budget 
account'),lang('Consume'),lang('paid')),
+                                       'className'             =>      
array('centerClasss','centerClasss','centerClasss','rightClasss','centerClasss')
                                );
 
                        $j=0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]