phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: inv/inc class.boinventory.inc.php,1.3,1.4 class.


From: Bettina gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: inv/inc class.boinventory.inc.php,1.3,1.4 class.uiinventory.inc.php,1.3,1.4
Date: Tue, 15 Jan 2002 21:14:19 -0500

Update of /cvsroot/phpgroupware/inv/inc
In directory subversions:/tmp/cvs-serv4849/inc

Modified Files:
        class.boinventory.inc.php class.uiinventory.inc.php 
Log Message:
update

Index: class.boinventory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/inc/class.boinventory.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.boinventory.inc.php   16 Jan 2002 01:32:05 -0000      1.3
--- class.boinventory.inc.php   16 Jan 2002 02:14:16 -0000      1.4
***************
*** 443,446 ****
--- 443,452 ----
                }
  
+               function get_retail($cat_id,$price)
+               {
+                       $taxpercent = $this->select_tax($cat_id);
+                       return round($price*(1+$taxpercent),2);                 
+               }
+ 
                function save_product($values)
                {
***************
*** 460,465 ****
                        }
  
!                       $taxpercent = $this->select_tax($values['cat_id']);
!                       $values['retail'] = 
round($values['price']*(1+$taxpercent),2);
  
                        if ($values['product_id'] && $values['product_id'] != 0)
--- 466,470 ----
                        }
  
!                       $values['retail'] = 
$this->get_retail($values['cat_id'],$values['price']);
  
                        if ($values['product_id'] && $values['product_id'] != 0)
***************
*** 471,474 ****
--- 476,480 ----
                                $this->soinv->add_product($values);
                        }
+                       return $values['retail'];
                }
        }

Index: class.uiinventory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/inc/class.uiinventory.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uiinventory.inc.php   16 Jan 2002 01:32:05 -0000      1.3
--- class.uiinventory.inc.php   16 Jan 2002 02:14:16 -0000      1.4
***************
*** 39,58 ****
                function uiinventory() 
                {
!                       $this->boinv                                    = 
CreateObject('inv.boinventory',True);
!                       $this->nextmatchs                               = 
CreateObject('phpgwapi.nextmatchs');
!                       $this->sbox                                             
= CreateObject('phpgwapi.sbox');
!                       $this->account                                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       $this->t                                                
= $GLOBALS['phpgw']->template;
!                       $this->grants                                   = 
$GLOBALS['phpgw']->acl->get_grants('inv');
!                       $this->grants[$this->account]   = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
! 
!                       $this->start                                    = 
$this->boinv->start;
!                       $this->query                                    = 
$this->boinv->query;
!                       $this->filter                                   = 
$this->boinv->filter;
!                       $this->order                                    = 
$this->boinv->order;
!                       $this->sort                                             
= $this->boinv->sort;
!                       $this->cat_id                                   = 
$this->boinv->cat_id;
!                       $this->action                                   = 
$this->boinv->action;
!                       $this->product_id                               = 
$this->boinv->product_id;
                }
  
--- 39,57 ----
                function uiinventory() 
                {
!                       $this->boinv                                            
        = CreateObject('inv.boinventory',True);
!                       $this->nextmatchs                                       
        = CreateObject('phpgwapi.nextmatchs');
!                       $this->sbox                                             
                = CreateObject('phpgwapi.sbox');
!                       $this->t                                                
                = $GLOBALS['phpgw']->template;
!                       $this->grants                                           
        = $GLOBALS['phpgw']->acl->get_grants('inv');
!                       $this->grants[$this->boinv->account]    = 
PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
! 
!                       $this->start                                            
        = $this->boinv->start;
!                       $this->query                                            
        = $this->boinv->query;
!                       $this->filter                                           
        = $this->boinv->filter;
!                       $this->order                                            
        = $this->boinv->order;
!                       $this->sort                                             
                = $this->boinv->sort;
!                       $this->cat_id                                           
        = $this->boinv->cat_id;
!                       $this->action                                           
        = $this->boinv->action;
!                       $this->product_id                                       
        = $this->boinv->product_id;
                }
  
***************
*** 243,248 ****
  // -------------------------------- end declaration 
-----------------------------------------
  
-                       $taxpercent = $this->boinv->select_tax($cat_id);
- 
                        for ($i=0;$i<count($products);$i++)
                        {
--- 242,245 ----
***************
*** 254,260 ****
                                if (! $name) $name = '&nbsp;';
  
-                               $num = 
$GLOBALS['phpgw']->strip_html($products[$i]['num']);
                                $abid = $products[$i]['dist'];
- 
                                if (!$abid) { $dist = '&nbsp;'; }
                                else
--- 251,255 ----
***************
*** 263,270 ****
                                }
  
-                               $cost = $products[$i]['cost'];
-                               $price = $products[$i]['price'];
-                               $retail = round(($price)*(1+$taxpercent),2);
- 
                                if ($products[$i]['mstock'] == 
$products[$i]['stock']) { $stock = '<b>' . $products[$i]['stock'] . '</b>'; }
                                if ($products[$i]['mstock'] < 
$products[$i]['stock']) { $stock = $products[$i]['stock']; }
--- 258,261 ----
***************
*** 273,288 ****
  //---------------------------------- list records 
-------------------------------------
  
!                               $this->t->set_var(array('num' => $num,
                                                                                
'name' => $name,
                                                                                
'dist' => $dist,
                                                                                
'status' => lang($this->boinv->return_value($products[$i]['status'])),
!                                                                               
'cost' => $cost,
!                                                                               
'price' => $price,
!                                                                               
'retail' => sprintf("%01.2f",$retail),
!                                                                               
'stock' => $stock,
                                                                                
'serial' => $serial));
  
                                $link_data['product_id'] = $products[$i]['con'];
!                               if 
($this->boinv->check_perms($grants[$category[0]['owner']],PHPGW_ACL_EDIT) || 
$category[0]['owner'] == $this->account)
                                {
                                        $link_data['menuaction'] = 
'inv.uiinventory.edit_product';
--- 264,279 ----
  //---------------------------------- list records 
-------------------------------------
  
!                               $this->t->set_var(array('num' => 
$GLOBALS['phpgw']->strip_html($products[$i]['num']),
                                                                                
'name' => $name,
                                                                                
'dist' => $dist,
                                                                                
'status' => lang($this->boinv->return_value($products[$i]['status'])),
!                                                                               
'cost' => $products[$i]['cost'],
!                                                                               
'price' => $products[$i]['price'],
!                                                                               
'retail' => 
sprintf("%01.2f",$this->boinv->get_retail($cat_id,$products[$i]['price'])),
!                                                                               
'stock' => $products[$i]['stock'],
                                                                                
'serial' => $serial));
  
                                $link_data['product_id'] = $products[$i]['con'];
!                               if 
($this->boinv->check_perms($grants[$category[0]['owner']],PHPGW_ACL_EDIT) || 
$category[0]['owner'] == $this->boinv->account)
                                {
                                        $link_data['menuaction'] = 
'inv.uiinventory.edit_product';
***************
*** 297,301 ****
                        }
  
!                       if 
($this->boinv->check_perms($grants[$category[0]['owner']],PHPGW_ACL_ADD) || 
$category[0]['owner'] == $this->account)
                        {
                                $link_data['menuaction'] = 
'inv.uiinventory.edit_product';
--- 288,292 ----
                        }
  
!                       if 
($this->boinv->check_perms($grants[$category[0]['owner']],PHPGW_ACL_ADD) || 
$category[0]['owner'] == $this->boinv->account)
                        {
                                $link_data['menuaction'] = 
'inv.uiinventory.edit_product';
***************
*** 335,338 ****
--- 326,330 ----
                                $values = $this->boinv->read_single_product();
                                $cat_id = $values['cat_id'];
+                               $retail = 
$this->boinv->get_retail($values['cat_id'],$values['price']);
                        }
                        else
***************
*** 361,365 ****
                                else
                                {
!                                       $this->boinv->save_product($values);
                                        
$this->t->set_var('message',lang('Product x x has been added !', 
$values['num'],$values['name']));
                                }
--- 353,357 ----
                                else
                                {
!                                       $retail = 
$this->boinv->save_product($values);
                                        
$this->t->set_var('message',lang('Product x x has been added !', 
$values['num'],$values['name']));
                                }
***************
*** 408,412 ****
                        $this->t->set_var('cost',$values['cost']);
                        $this->t->set_var('price',$values['price']);
!                       $this->t->set_var('retail',$values['retail']);
                        $this->t->set_var('stock',$values['stock']);
                        $this->t->set_var('mstock',$values['mstock']);
--- 400,406 ----
                        $this->t->set_var('cost',$values['cost']);
                        $this->t->set_var('price',$values['price']);
! 
!                       $this->t->set_var('retail',sprintf("%01.2f",$retail));
! 
                        $this->t->set_var('stock',$values['stock']);
                        $this->t->set_var('mstock',$values['mstock']);
***************
*** 464,471 ****
                        if ($this->product_id)
                        {
!                               if 
($this->boinv->check_perms($grants[$owner],PHPGW_ACL_DELETE) || $owner == 
$this->account)
                                {
                                        $link_data['menuaction'] = 
'inv.uiinventory.delete';
!                                       $t->set_var('delete','<form 
method="POST" action="' . $phpgw->link('/index.php',$link_data)
                                                                                
. '"><input type="submit" value="' . lang('Delete') .'"></form>');
                                }
--- 458,465 ----
                        if ($this->product_id)
                        {
!                               if 
($this->boinv->check_perms($grants[$owner],PHPGW_ACL_DELETE) || $owner == 
$this->boinv->account)
                                {
                                        $link_data['menuaction'] = 
'inv.uiinventory.delete';
!                                       $this->t->set_var('delete','<form 
method="POST" action="' . $GLOBALS['phpgw']->link('/index.php',$link_data)
                                                                                
. '"><input type="submit" value="' . lang('Delete') .'"></form>');
                                }




reply via email to

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