phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.uiinvoice.inc.php,1.19


From: sigurdne
Subject: [Phpgroupware-cvs] property/inc class.uiinvoice.inc.php,1.19
Date: Wed, 17 Aug 2005 09:18:00 +0200

Update of property/inc

Modified Files:
     Branch: MAIN
            class.uiinvoice.inc.php lines: +69 -13

Log Message:
no message

====================================================
Index: property/inc/class.uiinvoice.inc.php
diff -u property/inc/class.uiinvoice.inc.php:1.18 
property/inc/class.uiinvoice.inc.php:1.19
--- property/inc/class.uiinvoice.inc.php:1.18   Mon Jun 27 09:40:04 2005
+++ property/inc/class.uiinvoice.inc.php        Wed Aug 17 07:18:50 2005
@@ -31,15 +31,16 @@

                var $public_functions = array
                (
-                       'index'                 => True,
+                       'index'         => True,
                        'edit_period'   => True,
-                       'list_sub'              => True,
-                       'consume'               => True,
-                       'remark'                => True,
-                       'delete'                => True,
-                       'add'                   => True,
-                       'debug'                 => True,
-                       'view_order'    => True
+                       'list_sub'      => True,
+                       'consume'       => True,
+                       'remark'        => True,
+                       'delete'        => True,
+                       'add'           => True,
+                       'debug'         => True,
+                       'view_order'    => True,
+                       'excel'         => True
                );

                function uiinvoice()
@@ -89,6 +90,38 @@
                        $this->bo->save_sessiondata($data);
                }

+
+               function excel()
+               {
+                       $paid           = get_var('paid',array('POST','GET'));
+                       $start_date     = 
get_var('start_date',array('POST','GET'));
+                       $end_date       = 
get_var('end_date',array('POST','GET'));
+                       $submit_search  = 
get_var('submit_search',array('POST','GET'));
+                       $vendor_id      = 
get_var('vendor_id',array('POST','GET'));
+                       $workorder_id   = 
get_var('workorder_id',array('POST','GET'));
+                       $loc1           = get_var('loc1',array('POST','GET'));
+
+                       $start_date=urldecode($start_date);
+                       $end_date=urldecode($end_date);
+
+                       if(!$end_date)
+                       {
+                               $end_date = 
$GLOBALS['phpgw']->common->show_date(mktime(0,0,0,date("m"),date("d"),date("Y")),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                               $start_date = $end_date;
+                       }
+
+                       $list = 
$this->bo->read_invoice($paid,$start_date,$end_date,$vendor_id,$loc1,$workorder_id);
+
+                       while (is_array($list[0]) && list($name_entry,) = 
each($list[0]))
+                       {
+                               $name[]=$name_entry;
+                       }
+
+                       $descr  = $name;
+
+                       $this->bocommon->excel($list,$name,$descr);
+               }
+
                function index()
                {
 //                     $start_time = explode(' ',microtime());
@@ -103,13 +136,13 @@
                                                                                
'nextmatchs',
                                                                                
'search_field'));

-                       $paid                   = 
get_var('paid',array('POST','GET'));
+                       $paid           = get_var('paid',array('POST','GET'));
                        $start_date     = 
get_var('start_date',array('POST','GET'));
-                       $end_date               = 
get_var('end_date',array('POST','GET'));
+                       $end_date       = 
get_var('end_date',array('POST','GET'));
                        $submit_search  = 
get_var('submit_search',array('POST','GET'));
-                       $vendor_id              = 
get_var('vendor_id',array('POST','GET'));
+                       $vendor_id      = 
get_var('vendor_id',array('POST','GET'));
                        $workorder_id   = 
get_var('workorder_id',array('POST','GET'));
-                       $loc1   = get_var('loc1',array('POST','GET'));
+                       $loc1           = get_var('loc1',array('POST','GET'));

                        $start_date=urldecode($start_date);
                        $end_date=urldecode($end_date);
@@ -259,6 +292,29 @@
                        }

                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $link_excel = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiinvoice.excel',
+                               'order'         => $this->order,
+                               'sort'          => $this->sort,
+                               'cat_id'        => $this->cat_id,
+                               'user_lid'      => $this->user_lid,
+                               'sub'           => $this->sub,
+                               'query'         => $this->query,
+                               'start'         => $this->start,
+                               'paid'          => $paid,
+                               'vendor_id'     => $vendor_id,
+                               'workorder_id'  => $workorder_id,
+                               'start_date'    => $start_date,
+                               'end_date'      => $end_date,
+                               'filter'        => $this->filter,
+                               'allrows'       => $this->allrows
+                       );
+
+                       $data['lang_excel']                             = 
'excel';
+                       $data['link_excel']                             = 
$GLOBALS['phpgw']->link('/index.php',$link_excel);
+                       $data['lang_excel_help']                        = 
lang('Download table to MS Excel');

                        $data['msgbox_data']                                    
= $GLOBALS['phpgw']->common->msgbox($msgbox_data);
                        $data['sum']                                            
        = number_format($sum, 2, ',', '');






reply via email to

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