phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.boinvoice.inc.php,1.3,1.4 cla


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.boinvoice.inc.php,1.3,1.4 class.soinvoice.inc.php,1.3,1.4 class.soXport.inc.php,1.9,1.10 class.uiinvoice.inc.php,1.1,1.2
Date: Mon, 06 Jan 2003 03:30:01 -0500

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv2746/inc

Modified Files:
        class.boinvoice.inc.php class.soinvoice.inc.php 
        class.soXport.inc.php class.uiinvoice.inc.php 
Log Message:
no message

Index: class.boinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boinvoice.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.boinvoice.inc.php     2 Jan 2003 22:03:57 -0000       1.3
--- class.boinvoice.inc.php     6 Jan 2003 08:29:56 -0000       1.4
***************
*** 117,120 ****
--- 117,311 ----
  
  
+               function update_invoice($values)
+               {
+                       $errorcount = 0;
+ 
+                       while (is_array($values) && list(,$entry) = 
each($values))
+                       {
+                               $local_error='';
+ 
+ //_debug_array($entry);
+ 
+                               if($entry['invoice_id'])
+                               {
+ 
+                                       $invoice_id=$entry['invoice_id'];
+ 
+                                       $check_count = 
$this->so->check_count($invoice_id);
+ 
+ 
+                                       if (!($check_count['dima_count'] == 
$entry['invoice_count']))
+                                       {
+                                               $error[$errorcount++] = 
array('msg'=>lang('Dima is missing from sub invoice in:'). " 
".$entry['invoice_id']);
+                                               $local_error= true;
+                                       }
+ 
+ 
+ 
+                                       if 
(!($check_count['spbudact_code_count'] == $entry['invoice_count']))
+                                       {
+                                               $error[$errorcount++] = 
array('msg'=>lang('Budget code is missing from sub invoice in :'). " 
".$entry['invoice_id']);
+                                               $local_error= true;
+                                       }
+ 
+ 
+ 
+                                       $blank_date = '';
+                                       $sign_field='';
+                                       $sign_id='';
+                                       $sign_date_field='';
+                                       $sign_date='';
+                                       $kommma='';
+                                       $wait_for_kreditnota='';
+                                       $user_lid       
=strtoupper($GLOBALS['phpgw_info']['user']['account_lid']);
+ 
+                                       if (($entry['sign']=='sign_none') && 
($entry['sign_orig']=='janitor')):
+                                               $blank_date = 'oppsynsigndato= 
NULL';
+                                               $sign_field='';
+                                               $sign_id='';
+                                               $sign_date_field='';
+                                               $sign_date='';
+                                               $kommma='';
+                                       elseif (($entry['sign']=='sign_none') 
&& ($entry['sign_orig']=='supervisor')):
+                                               $blank_date = 'saksigndato= 
NULL';
+                                               $sign_field='';
+                                               $sign_id='';
+                                               $sign_date_field='';
+                                               $sign_date='';
+                                               $kommma='';
+                                       elseif (($entry['sign']=='sign_none') 
&& ($entry['sign_orig']=='budget_responsible')):
+                                               $blank_date = 
'budsjettsigndato= NULL';
+                                               $sign_field='';
+                                               $sign_id='';
+                                               $sign_date_field='';
+                                               $sign_date='';
+                                               $kommma='';
+                                       elseif ($entry['sign']=='sign_janitor' 
&& !$entry['sign_orig']):
+                                               $blank_date = '';
+                                               $sign_field = 'oppsynsmannid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'oppsynsigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif ($entry['sign']=='sign_janitor' 
&& $entry['sign_orig']=='supervisor'):
+                                               $blank_date = 'saksigndato= 
NULL';
+                                               $sign_field = 'oppsynsmannid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'oppsynsigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif ($entry['sign']=='sign_janitor' 
&& $entry['sign_orig']=='budget_responsible'):
+                                               $blank_date = 
'budsjettsigndato= NULL';
+                                               $sign_field = 'oppsynsmannid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'oppsynsigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif 
($entry['sign']=='sign_supervisor' && !$entry['sign_orig']):
+                                               $blank_date = '';
+                                               $sign_field = 
'saksbehandlerid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'saksigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif 
($entry['sign']=='sign_supervisor' && $entry['sign_orig']=='janitor'):
+                                               $blank_date = 'oppsynsigndato= 
NULL';
+                                               $sign_field = 
'saksbehandlerid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'saksigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif 
($entry['sign']=='sign_supervisor' && 
$entry['sign_orig']=='budget_responsible'):
+                                               $blank_date = 
'budsjettsigndato= NULL';
+                                               $sign_field = 
'saksbehandlerid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'saksigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif 
($entry['sign']=='sign_budget_responsible' && $entry['sign_orig']=='janitor'):
+                                               $blank_date = 'oppsynsigndato= 
NULL';
+                                               $sign_field = 
'budsjettansvarligid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'budsjettsigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif 
($entry['sign']=='sign_budget_responsible' && 
$entry['sign_orig']=='supervisor'):
+                                               $blank_date = 'saksigndato= 
NULL';
+                                               $sign_field = 
'budsjettansvarligid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'budsjettsigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       elseif 
($entry['sign']=='sign_budget_responsible' && !$entry['sign_orig']):
+                                               $blank_date = '';
+                                               $sign_field = 
'budsjettansvarligid=';
+                                               $sign_id = "'$user_lid'";
+                                               $sign_date_field = 
'budsjettsigndato=';
+                                               $sign_date="'" . date("Y-m-d 
G:i:s") . "'";
+                                               $kommma=",";
+                                       endif;
+ 
+ 
+                                       if($blank_date )
+                                       {
+                                               $kommma_blank=",";
+                                       }
+                                       else
+                                       {
+                                               $kommma_blank='';
+                                       }
+ 
+                                       $transfer_sign_field='utbetalingid=';
+                                       
$transfer_date_field='utbetalingsigndato=';
+ 
+                                       if 
(!($entry['num_days_orig']==$entry['num_days']))
+                                       {
+                                               $payment_date = 
date("Y-m-d",$entry['timestamp_invoice_date']+(24*3600*$entry['num_days']));
+                                               
$GLOBALS['phpgw']->db->query("update t_ecobilag set forfallsdato= 
'$payment_date' where bilagsnr='$invoice_id'");
+                                       }
+ 
+                                       if ($entry['transfer'])
+                                       {
+ 
+                                               $transfer_id="'$user_lid',";
+                                               $transfer_date="'" . 
date("Y-m-d G:i:s") . "'";
+                                       }
+                                       else
+                                       {
+                                               $transfer_id="Null".",";
+                                               $transfer_date="Null";
+                                       }
+ 
+                                       if ($entry['kreditnota'])
+                                       {
+                                               $wait_for_kreditnota=1;
+                                               $transfer_date="Null";
+                                       }
+ 
+                                       if (! $local_error)
+                                       {
+ 
+                                               $sql= "update t_ecobilag set 
$blank_date $kommma_blank $sign_field $sign_id $kommma $sign_date_field 
$sign_date $kommma $transfer_sign_field $transfer_id $transfer_date_field 
$transfer_date ,kreditnota='$wait_for_kreditnota'  where 
bilagsnr='$invoice_id'";
+                                               
$GLOBALS['phpgw']->db->query($sql);
+ //                                    echo $sql.'<br>';
+ 
+                                               
$message[$invoice_id]=array('msg'       => lang('Invoice is updated: ') . 
$invoice_id);
+                                       }
+ 
+ 
+                               }
+ 
+ 
+                       }
+ 
+ //_debug_array($error);
+ 
+                       return $receipt=array(
+                               'error'         => $error,
+                               'message'       => $message,
+                               );
+ 
+               }
+ 
  
                function get_list_role($role='',$selected='')

Index: class.soinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soinvoice.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.soinvoice.inc.php     2 Jan 2003 22:03:57 -0000       1.3
--- class.soinvoice.inc.php     6 Jan 2003 08:29:57 -0000       1.4
***************
*** 55,59 ****
                                $order = 
(isset($data['order'])?$data['order']:'');
                                $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
!                               $district_id = 
(isset($data['district_id'])?$data['district_id']:0);
                        }
  
--- 55,59 ----
                                $order = 
(isset($data['order'])?$data['order']:'');
                                $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
!                               $user_lid = 
(isset($data['user_lid'])?$data['user_lid']:0);
                        }
  
***************
*** 68,106 ****
                        }
  
!                       if ($filter == 'none')
!                       {
!                               $filtermethod = ' ( fm_equipment.owner=' . 
$this->account;
!                               if (is_array($this->grants))
!                               {
!                                       $grants = $this->grants;
!                                       while (list($user) = each($grants))
!                                       {
!                                               $public_user_list[] = $user;
!                                       }
!                                       reset($public_user_list);
!                                       $filtermethod .= " OR 
(fm_equipment.access='public' OR fm_equipment.owner IN(" . 
implode(',',$public_user_list) . ")))";
!                               }
!                               else
!                               {
!                                       $filtermethod .= ' )';
!                               }
!                       }
!                       elseif ($filter == 'yours')
!                       {
!                               $filtermethod = " fm_equipment.owner='" . 
$this->account . "'";
!                       }
!                       else
                        {
!                               $filtermethod = " fm_equipment.owner='" . 
$this->account . "' AND fm_equipment.access='private'";
                        }
  
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " AND fm_equipment. 
equipment_type_id='$cat_id' ";
                        }
  
                        if ($district_id > 0)
                        {
!                               $filtermethod .= " AND  
omraade_id='$district_id' ";
                        }
                        if($query)
--- 68,89 ----
                        }
  
!                       $where= 'WHERE';
! 
!                       if ($user_lid)
                        {
!                               $filtermethod = " WHERE ( oppsynsmannid= 
'$user_lid' or saksbehandlerid= '$user_lid' or budsjettansvarligid= 
'$user_lid')";
!                               $where= 'AND';
                        }
  
                        if ($cat_id > 0)
                        {
!                               $filtermethod .= " $where typeid='$cat_id' ";
!                               $where= 'AND';
                        }
  
                        if ($district_id > 0)
                        {
!                               $filtermethod .= " $where  
omraade_id='$district_id' ";
!                               $where= 'AND';
                        }
                        if($query)
***************
*** 109,125 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND ( fm_equipment.descr LIKE 
'%$query%' OR street LIKE '%$query%' OR fm_equipment.location_code LIKE 
'%$query%' OR equipment_id LIKE '%$query%' )";
                        }
  
  
! /*                    $sql = "SELECT equipment_id,fm_equipment.descr 
,fm_equipment.objekt_id,bygg_id,seksjons_id,etasje,leie_id,street, 
fm_equipment_type.num as category"
!                       . "     FROM fm_equipment $this->join"
!                       . " boei_objekt ON fm_equipment.objekt_id = 
boei_objekt.objekt_id $this->join"
!                       . " boei_bydel ON boei_objekt.bydel_id = 
boei_bydel.bydel_id $this->join"
!                       . " fm_equipment_type ON fm_equipment.equipment_type_id 
= fm_equipment_type.id "
!                       . " WHERE  $filtermethod $querymethod  ";
! 
! */
!                       $sql = "SELECT DISTINCT bilagsnr, count(bilagsnr) as 
invoice_count, sum(belop) as belop FROM  t_ecobilag group by bilagsnr";//where 
$filtermethod $querymethod ";
  
  //echo $sql;
--- 92,100 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " $where ( spvend_code LIKE 
'%$query%' OR bilagsnr LIKE '%$query%' )";
                        }
  
  
!                       $sql = "SELECT DISTINCT bilagsnr, count(bilagsnr) as 
invoice_count, sum(belop) as belop FROM  t_ecobilag  $filtermethod $querymethod 
group by bilagsnr";
  
  //echo $sql;
***************
*** 192,195 ****
--- 167,185 ----
                                        $invoice[$i]['amount']                  
                = $invoice_temp[$i]['amount'];
                                        $invoice[$i]['num_days']                
                = 
intval(($timestamp_payment_date-$timestamp_invoice_date)/(24*3600));
+                                       $invoice[$i]['timestamp_invoice_date']  
= $timestamp_invoice_date;
+ 
+                                       
if($invoice[$i]['current_user']==$invoice[$i]['janitor'] && 
$invoice[$i]['jan_date']):
+                                       {
+                                               
$invoice[$i]['sign_orig']='janitor';
+                                       }
+                                       
elseif($invoice[$i]['current_user']==$invoice[$i]['supervisor'] && 
$invoice[$i]['super_date']):
+                                       {
+                                               
$invoice[$i]['sign_orig']='supervisor';
+                                       }
+                                       
elseif($invoice[$i]['current_user']==$invoice[$i]['budget_responsible'] && 
$invoice[$i]['budget_date']):
+                                       {
+                                               
$invoice[$i]['sign_orig']='budget_responsible';
+                                       }
+                                       endif;
  
                                        $i++;
***************
*** 219,222 ****
--- 209,228 ----
                        return $role;
  
+               }
+ 
+               function check_count($invoice_id)
+               {
+ 
+                       $user_id = $GLOBALS['phpgw_info']['user']['account_id'];
+ 
+                       $this->db->query("select count(dima) as dima_count , 
count(spbudact_code) as spbudact_code_count from t_ecobilag where bilagsnr 
='$invoice_id'");
+                       $this->db->next_record();
+ 
+                       $check_count=array(
+                               'dima_count'                            => 
$this->db->f('dima_count'),
+                               'spbudact_code_count'                   => 
$this->db->f('spbudact_code_count')
+                               );
+ 
+                       return $check_count;
                }
  

Index: class.soXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soXport.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.soXport.inc.php       24 Dec 2002 23:22:29 -0000      1.9
--- class.soXport.inc.php       6 Jan 2003 08:29:57 -0000       1.10
***************
*** 501,505 ****
                        $filnavn                        =       
$oRsOverfBilag['filnavn'];
                        $ordrebelop                     =       
$oRsOverfBilag['ordrebelop'];
!                       $overftid                       =       date("M d Y 
g:iA");
  
  
--- 501,505 ----
                        $filnavn                        =       
$oRsOverfBilag['filnavn'];
                        $ordrebelop                     =       
$oRsOverfBilag['ordrebelop'];
!                       $overftid                       =       date("Y-m-d 
G:i:s");
  
  

Index: class.uiinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiinvoice.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.uiinvoice.inc.php     2 Jan 2003 22:05:11 -0000       1.1
--- class.uiinvoice.inc.php     6 Jan 2003 08:29:57 -0000       1.2
***************
*** 79,84 ****
--- 79,113 ----
                        $links = $this->bocommon->menu($sub);
  
+                       $values         = get_var('values',array('POST','GET'));
+ 
+                       if($values[0]['save'])
+                       {
+                               $receipt=$this->bo->update_invoice($values);
+ 
+                       }
+ 
+ //_debug_array($receipt);
+ 
+ 
                        $content = $this->bo->read_invoice();
  
+                       $i=0;
+                       if(is_array($content))
+                       {
+                               while(each($content))
+                               {
+ 
+                                       $content[$i]['lang_payment_date']       
= lang('Payment Date');
+                                       $content[$i]['link_sub']                
        = $this->currentapp.'.uiinvoice.list_sub';
+                                       $content[$i]['lang_sub']                
        = lang('Invoice ID');
+                                       $content[$i]['lang_sub_help']           
= lang('Klick this link to enter the list of sub-invoices');
+                                       $content[$i]['link_period']             
= $this->currentapp.'.uiinvoice.edit_period';
+                                       $content[$i]['lang_period']             
= lang('Period');
+                                       $content[$i]['lang_period_help']        
= lang('Klick this link to edit the period');
+ 
+                                       $i++;
+                               }
+                       }
+ 
                        $table_header[] = array
                        (
***************
*** 94,102 ****
--- 123,152 ----
                                                                                
                )),
                                'lang_invoice'                          => 
lang('invoice'),
+                               'sort_invoice_date'                             
=> $this->nextmatchs->show_sort_order(array
+                                                                               
                (
+                                                                               
                        'sort'  => $this->sort,
+                                                                               
                        'var'   =>      'fakturadato',
+                                                                               
                        'order' =>      $this->order,
+                                                                               
                        'extra'         => array('menuaction'           => 
$this->currentapp.'.uiinvoice.index',
+                                                                               
                                                                'cat_id'        
        =>$this->cat_id,
+                                                                               
                                                                'sub'           
        =>$this->sub,
+                                                                               
                                                                'user_lid'      
        => $this->user_lid)
+                                                                               
                )),
                                'lang_invoice_date'                     => 
lang('Invoice Date'),
                                'lang_days'                                     
=> lang('Days'),
                                'lang_sum'                                      
=> lang('Sum'),
+                               'sort_vendor_id'                                
=> $this->nextmatchs->show_sort_order(array
+                                                                               
                (
+                                                                               
                        'sort'  => $this->sort,
+                                                                               
                        'var'   =>      'spvend_code',
+                                                                               
                        'order' =>      $this->order,
+                                                                               
                        'extra'         => array('menuaction'           => 
$this->currentapp.'.uiinvoice.index',
+                                                                               
                                                                'cat_id'        
        =>$this->cat_id,
+                                                                               
                                                                'sub'           
        =>$this->sub,
+                                                                               
                                                                'user_lid'      
        => $this->user_lid)
+                                                                               
                )),
                                'lang_vendor_id'                        => 
lang('Vendor'),
                                'lang_num_sub_invoice'          => 
lang('Count'),
+                               'lang_type'                                     
=> lang('Type'),
                                'lang_period'                           => 
lang('Period'),
                                'lang_kredit'                           => 
lang('KreditNota'),
***************
*** 128,131 ****
--- 178,184 ----
                        $data = array
                        (
+                               'message'                                       
        => $receipt['message'],
+                               'error'                                         
        => $receipt['error'],
+                               'overlib_source'                                
=> './'.$this->currentapp.'/inc/overlib.js',
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_save'                                     
        => lang('save'),
***************
*** 137,141 ****
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
!                               'num_records'                                   
=> count($invoice_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
--- 190,194 ----
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
!                               'num_records'                                   
=> count($content),
                                'all_records'                                   
=> $this->bo->total_records,
                                'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
***************
*** 149,153 ****
                                'user_list'                                     
        => $this->bo->get_invoice_user_list('filter',$this->user_lid),
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'lang_no_user'                                  
=> lang('no user'),
                                'lang_user_statustext'                  => 
lang('Select the user the selection belongs to. To do not use a user select NO 
USER'),
                                'select_user_name'                              
=> 'user_lid',
--- 202,206 ----
                                'user_list'                                     
        => $this->bo->get_invoice_user_list('filter',$this->user_lid),
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'lang_no_user'                                  
=> lang('All users'),
                                'lang_user_statustext'                  => 
lang('Select the user the selection belongs to. To do not use a user select NO 
USER'),
                                'select_user_name'                              
=> 'user_lid',





reply via email to

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