phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4996 - phpcompta/trunk/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4996 - phpcompta/trunk/include
Date: Sun, 24 Jun 2012 20:36:44 +0200 (CEST)

Author: danydb
Date: 2012-06-24 20:36:44 +0200 (Sun, 24 Jun 2012)
New Revision: 4996

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_stock_goods.php
Log:
Bug dans les stock : insert_stock

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_purchase.php       2012-06-24 
18:11:51 UTC (rev 4995)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php       2012-06-24 
18:36:44 UTC (rev 4996)
@@ -473,7 +473,7 @@
                 // always save quantity but in withStock we can find
                 // what card need a stock management
                 if ( $g_parameter->MY_STOCK='Y'&& isset ($repo))
-                    
Stock_Goods::insert_goods(array('db'=>$this->db,'j_id'=>$j_id,'goods'=>${'e_march'.$i},'quant'=>$nNeg*${'e_quant'.$i},'dir'=>'d','repo'=>$repo))
 ;
+                    
Stock_Goods::insert_goods($this->db,array('j_id'=>$j_id,'goods'=>${'e_march'.$i},'quant'=>$nNeg*${'e_quant'.$i},'dir'=>'d','repo'=>$repo))
 ;
 
                 if ( $g_parameter->MY_ANALYTIC != "nu" )
                 {

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_sold.php   2012-06-24 18:11:51 UTC 
(rev 4995)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php   2012-06-24 18:36:44 UTC 
(rev 4996)
@@ -39,6 +39,7 @@
 require_once('class_own.php');
 require_once('class_itva_popup.php');
 require_once('class_acc_ledger_fin.php');
+require_once 'class_stock_goods.php';
 
 /*!\brief Handle the ledger of sold,
  *
@@ -354,7 +355,7 @@
                 // always save quantity but in withStock we can find
                 // what card need a stock management
                 if ( $g_parameter->MY_STOCK='Y' && isset ($repo))
-                    
Stock_Goods::insert_goods(array('db'=>$this->db,'j_id'=>$j_id,'goods'=>${'e_march'.$i},'quant'=>$nNeg*${'e_quant'.$i},'dir'=>'c','repo'=>$repo))
 ;
+                    
Stock_Goods::insert_goods($this->db,array('j_id'=>$j_id,'goods'=>${'e_march'.$i},'quant'=>$nNeg*${'e_quant'.$i},'dir'=>'c','repo'=>$repo))
 ;
 
 
                 if ( $g_parameter->MY_ANALYTIC != "nu" )

Modified: phpcompta/trunk/include/class_stock_goods.php
===================================================================
--- phpcompta/trunk/include/class_stock_goods.php       2012-06-24 18:11:51 UTC 
(rev 4995)
+++ phpcompta/trunk/include/class_stock_goods.php       2012-06-24 18:36:44 UTC 
(rev 4996)
@@ -75,7 +75,7 @@
                        $sg_code[$e]->setReadOnly($p_readonly);
                        $sg_quantity[$e]->setReadOnly($p_readonly);
                }
-//             require_once 'template/stock_inv.php';
+               require_once 'template/stock_inv.php';
        }
 
        function save($p_array)
@@ -123,19 +123,20 @@
        }
         /**
          * Insert into stock_goods from ACH and VEN
-         * @param type $p_array KEY : db => database conx, j_id => 
jrnx.j_id,goods=> f_id of the goods 
+         * @param type $p_array KEY : db => database conx, j_id => 
jrnx.j_id,goods=> f_id of the goods
          * 'quant' => quantity ,'dir'=> d or c (c for sales OUT and d for 
purchase IN),'repo'=>r_id of the
          * repository (stock_repository.r_id
          */
         static function insert_goods(&$p_cn,$p_array)
         {
             global $g_user;
-            if ($g_user->can_write_repo($p_depot) == false)
+                       extract ($p_array);
+            if ($g_user->can_write_repo($repo) == false)
                 return false;
 
             // Retrieve the good account for stock
             $code = new Fiche($p_cn);
-            $code->get_by_qcode($p_good);
+            $code->get_by_qcode($goods);
             $code_marchandise = $code->strAttribut(ATTR_DEF_STOCK);
             if ($code_marchandise == NOTFOUND || $code_marchandise=='')
                 return false;



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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