phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.boinvoice.inc.php inc/class....


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.boinvoice.inc.php inc/class....
Date: Fri, 12 May 2006 11:06:18 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/05/12 11:06:18

Modified files:
        inc            : class.boinvoice.inc.php class.soinvoice.inc.php 
                         class.uiinvoice.inc.php 
        templates/base : invoice.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boinvoice.inc.php.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soinvoice.inc.php.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiinvoice.inc.php.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/invoice.xsl.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: property/inc/class.boinvoice.inc.php
diff -u property/inc/class.boinvoice.inc.php:1.19 
property/inc/class.boinvoice.inc.php:1.20
--- property/inc/class.boinvoice.inc.php:1.19   Wed May 10 11:10:20 2006
+++ property/inc/class.boinvoice.inc.php        Fri May 12 11:06:18 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.boinvoice.inc.php,v 1.19 2006/05/10 11:10:20 
sigurdne Exp $
+       * @version $Id: class.boinvoice.inc.php,v 1.20 2006/05/12 11:06:18 
sigurdne Exp $
        */
 
        /**
@@ -43,6 +43,8 @@
                        $user_lid               = 
get_var('user_lid',array('POST','GET'));
                        $allrows                = 
get_var('allrows',array('POST','GET'));
                        $b_account_class        = 
get_var('b_account_class',array('POST','GET'));
+                       $district_id            = 
get_var('district_id',array('POST','GET'));
+                       
                        
                        if ($start)
                        {
@@ -53,6 +55,11 @@
                                $this->start=0;
                        }
 
+                       if(isset($district_id))
+                       {
+                               $this->district_id = $district_id;
+                       }
+
                        if(isset($b_account_class))
                        {
                                $this->b_account_class = $b_account_class;
@@ -113,6 +120,9 @@
                        $this->user_lid         = $data['user_lid'];
                        $this->sub                      = $data['sub'];
                        $this->allrows          = $data['allrows'];
+                       $this->b_account_class  = $data['b_account_class'];
+                       $this->district_id      = $data['district_id'];         
+
                }
 
                function 
read_invoice($paid='',$start_date='',$end_date='',$vendor_id='',$loc1='',$workorder_id='',$voucher_id='')
@@ -121,7 +131,8 @@
                                                                                
        'user_lid' => $this->user_lid,'cat_id' => $this->cat_id, 'paid' => 
$paid,
                                                                                
        'start_date'=>$start_date,'end_date'=>$end_date,'vendor_id'=>$vendor_id,
                                                                                
        'loc1'=>$loc1,'workorder_id'=>$workorder_id,'allrows'=>$this->allrows,
-                                                                               
        'voucher_id'=>$voucher_id,'b_account_class' =>$this->b_account_class));
+                                                                               
        'voucher_id'=>$voucher_id,'b_account_class' =>$this->b_account_class,
+                                                                               
        'district_id' => $this->district_id));
 
                        $this->total_records = $this->so->total_records;
                        $this->end_time = $this->so->end_time;
Index: property/inc/class.soinvoice.inc.php
diff -u property/inc/class.soinvoice.inc.php:1.24 
property/inc/class.soinvoice.inc.php:1.25
--- property/inc/class.soinvoice.inc.php:1.24   Wed May 10 11:55:33 2006
+++ property/inc/class.soinvoice.inc.php        Fri May 12 11:06:18 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.soinvoice.inc.php,v 1.24 2006/05/10 11:55:33 
sigurdne Exp $
+       * @version $Id: class.soinvoice.inc.php,v 1.25 2006/05/12 11:06:18 
sigurdne Exp $
        */
 
        /**
@@ -60,6 +60,7 @@
                                $allrows                = 
(isset($data['allrows'])?$data['allrows']:'');
                                $voucher_id             = 
(isset($data['voucher_id'])?$data['voucher_id']:'');
                                $b_account_class        = 
(isset($data['b_account_class'])?$data['b_account_class']:'');
+                               $district_id            = 
(isset($data['district_id'])?$data['district_id']:'');                        
                        }
 
 //_debug_array($data);
@@ -95,6 +96,8 @@
                        if ($district_id > 0)
                        {
                                $filtermethod .= " $where  
district_id='$district_id' ";
+                               $join_tables = " $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)";
                                $where= 'AND';
                        }
 
@@ -130,7 +133,7 @@
                                {
                                        $filtermethod .= " $where  
fm_b_account.category ='$b_account_class' ";
                                        $where= 'AND';
-                                       $join_account = " $this->join 
fm_b_account ON fm_ecobilagoverf.spbudact_code = fm_b_account.id";
+                                       $join_tables .= " $this->join 
fm_b_account ON fm_ecobilagoverf.spbudact_code = fm_b_account.id";
                                }
 
                                if (!$workorder_id && !$voucher_id)
@@ -153,20 +156,28 @@
                                        $emonth = $dateparts[$m];
                                        $eyear = $dateparts[$y];
 
+                                       $start_date = 
date($this->bocommon->dateformat,mktime(2,0,0,$smonth,$sday,$syear));           
                  
+                                       if ($syear == $eyear)
+                                       {
+                                               $end_date = 
date($this->bocommon->dateformat,mktime(2,0,0,12,31,$eyear));
+                                               $filtermethod .= " $where 
(fakturadato >'$start_date' AND fakturadato < '$end_date'"
+                                                               . " AND periode 
>" . ($smonth -1) . " AND periode <" . ($emonth+1) . ')';                       
                        
+                                       }
+
                                        $end_date = 
date($this->bocommon->dateformat,mktime(2,0,0,$emonth,$eday,$eyear));
 
-                                       $start_date = 
date($this->bocommon->dateformat,mktime(2,0,0,$smonth,$sday,$syear));           
                  
-                                       
-                                       $filtermethod .= " $where (fakturadato 
>'$start_date' AND fakturadato < '$end_date'";
+
+               /*                      $filtermethod .= " $where (fakturadato 
>'$start_date' AND fakturadato < '$end_date'";
                
                                        if($smonth < 3)
                                        {
-                                               $filtermethod .= " AND periode 
< 3)";
+                                               $filtermethod .= " AND periode 
= 1)";
                                        }
                                        else
                                        {
                                                $filtermethod .= ")";
-                                       }       
+                                       }
+               */      
                                }
                        }
                        else
@@ -184,10 +195,10 @@
                        }
 
 
-                       $sql = "SELECT DISTINCT bilagsnr, count(bilagsnr) as 
invoice_count, sum(belop) as belop,spvend_code,fakturadato FROM  $table 
$join_account $filtermethod $querymethod group by 
bilagsnr,spvend_code,fakturadato ";
-                       $sql2 = "SELECT DISTINCT bilagsnr FROM  $table 
$join_account $filtermethod $querymethod";
+                       $sql = "SELECT bilagsnr, count(bilagsnr) as 
invoice_count, sum(belop) as belop,spvend_code,fakturadato FROM  $table 
$join_tables $filtermethod $querymethod group by 
bilagsnr,spvend_code,fakturadato ";
+                       $sql2 = "SELECT DISTINCT bilagsnr FROM  $table 
$join_tables $filtermethod $querymethod";
 
-//echo $sql2;
+//echo $sql;
                        $this->db2->query($sql2,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
 
Index: property/inc/class.uiinvoice.inc.php
diff -u property/inc/class.uiinvoice.inc.php:1.26 
property/inc/class.uiinvoice.inc.php:1.27
--- property/inc/class.uiinvoice.inc.php:1.26   Wed May 10 11:10:20 2006
+++ property/inc/class.uiinvoice.inc.php        Fri May 12 11:06:18 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.uiinvoice.inc.php,v 1.26 2006/05/10 11:10:20 
sigurdne Exp $
+       * @version $Id: class.uiinvoice.inc.php,v 1.27 2006/05/12 11:06:18 
sigurdne Exp $
        */
 
        /**
@@ -62,7 +62,8 @@
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->user_lid                         = 
$this->bo->user_lid;
                        $this->allrows                          = 
$this->bo->allrows;
-
+                       $this->district_id                      = 
$this->bo->district_id;
+                       
                        $this->acl2                             = 
CreateObject($this->currentapp.'.acl2');
                        $this->acl2_location            = '.invoice';
                        $this->acl_read                         = 
$this->acl2->check('.invoice',1);
@@ -85,7 +86,8 @@
                                'filter'                => $this->filter,
                                'cat_id'                => $this->cat_id,
                                'user_lid'              => $this->user_lid,
-                               'allrows'               => $this->allrows
+                               'allrows'               => $this->allrows,
+                               'district_id'           => $this->district_id
                        );
                        $this->bo->save_sessiondata($data);
                }
@@ -175,7 +177,7 @@
                                {
 
                                        $sum                                    
= $sum + $extra['amount'];
-                                       $content[$i]['amount']          = 
number_format($extra['amount'], 2, ',', '');
+                                       $content[$i]['amount']          = 
number_format($extra['amount'], 2, ',', ' ');
                                        $content[$i]['lang_payment_date']       
= lang('Payment Date');
                                        $content[$i]['link_sub']                
= 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.list_sub&user_lid='.$this->user_lid
 . '&query=' . $this->query);
                                        $content[$i]['lang_sub']                
= lang('Voucher ID');
@@ -208,7 +210,11 @@
                                                                                
                                                                'paid'          
        => $paid,
                                                                                
                                                                'vendor_id'     
        => $vendor_id,
                                                                                
                                                                'user_lid'      
        => $this->user_lid,
-                                                                               
                                                                
'b_account_class'       => $b_account_class)
+                                                                               
                                                                
'b_account_class'       => $b_account_class,
+                                                                               
                                                                'district_id'   
        => $this->district_id,
+                                                                               
                                                                'start_date'    
        => $start_date,
+                                                                               
                                                                'end_date'      
        => $end_date
+                                                                               
                                                                )
                                                                                
                )),
                                'lang_voucher'                          => 
lang('voucher'),
                                'sort_voucher_date'                             
=> $this->nextmatchs->show_sort_order(array
@@ -222,7 +228,11 @@
                                                                                
                                                                'paid'          
        => $paid,
                                                                                
                                                                'vendor_id'     
        => $vendor_id,
                                                                                
                                                                'user_lid'      
        => $this->user_lid,
-                                                                               
                                                                
'b_account_class'       => $b_account_class)
+                                                                               
                                                                
'b_account_class'       => $b_account_class,
+                                                                               
                                                                'district_id'   
        => $this->district_id,
+                                                                               
                                                                'start_date'    
        => $start_date,
+                                                                               
                                                                'end_date'      
        => $end_date
+                                                                               
                                                                )
                                                                                
                )),
                                'lang_voucher_date'                     => 
lang('Voucher Date'),
                                'lang_days'                                     
=> lang('Days'),
@@ -238,7 +248,11 @@
                                                                                
                                                                'paid'          
        => $paid,
                                                                                
                                                                'vendor_id'     
        => $vendor_id,
                                                                                
                                                                'user_lid'      
        => $this->user_lid,
-                                                                               
                                                                
'b_account_class'       => $b_account_class)
+                                                                               
                                                                
'b_account_class'       => $b_account_class,
+                                                                               
                                                                'district_id'   
        => $this->district_id,
+                                                                               
                                                                'start_date'    
        => $start_date,
+                                                                               
                                                                'end_date'      
        => $end_date
+                                                                               
                                                                )
                                                                                
                )),
                                'lang_vendor_id'                => 
lang('Vendor'),
                                'lang_num_sub_invoice'          => 
lang('Count'),
@@ -275,7 +289,8 @@
                                'start_date'            => $start_date,
                                'end_date'              => $end_date,
                                'filter'                => $this->filter,
-                               'b_account_class'       => $b_account_class
+                               'b_account_class'       => $b_account_class,
+                               'district_id'           => $this->district_id
                        );
 
                        if($this->acl_add)
@@ -317,7 +332,8 @@
                                'end_date'      => $end_date,
                                'filter'        => $this->filter,
                                'allrows'       => $this->allrows,
-                               'b_account_class'       => $b_account_class
+                               'b_account_class'       => $b_account_class,
+                               'district_id'           => $this->district_id
                        );
 
                        $data['lang_excel']                             = 
'excel';
Index: property/templates/base/invoice.xsl
diff -u property/templates/base/invoice.xsl:1.12 
property/templates/base/invoice.xsl:1.13
--- property/templates/base/invoice.xsl:1.12    Wed May 10 11:10:21 2006
+++ property/templates/base/invoice.xsl Fri May 12 11:06:18 2006
@@ -1,4 +1,4 @@
-<!-- $Id: invoice.xsl,v 1.12 2006/05/10 11:10:21 sigurdne Exp $ -->
+<!-- $Id: invoice.xsl,v 1.13 2006/05/12 11:06:18 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -758,6 +758,9 @@
                                <td class="th_text" width="5%" align="right">
                                        <xsl:value-of select="lang_type"/>
                                </td>
+                               <td class="th_text" width="3%" align="right">
+                                       <xsl:value-of select="lang_period"/>
+                               </td>
                                <td class="th_text" width="5%" align="right">
                                        <xsl:value-of select="lang_janitor"/>
                                </td>
@@ -831,6 +834,9 @@
                                        <xsl:value-of select="type"/>
                                </td>
                                <td align="center">
+                                       <xsl:value-of select="period"/>
+                               </td>
+                               <td align="center">
                                        <xsl:value-of select="jan_date"/> - 
<xsl:value-of select="janitor"/>
                                </td>
                                <td align="center">




reply via email to

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