phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4941 - phpcompta/trunk/include
Date: Tue, 19 Jun 2012 15:18:52 +0200 (CEST)

Author: danydb
Date: 2012-06-19 15:18:52 +0200 (Tue, 19 Jun 2012)
New Revision: 4941

Modified:
   phpcompta/trunk/include/user_common.php
Log:
fix potentiel bug

Modified: phpcompta/trunk/include/user_common.php
===================================================================
--- phpcompta/trunk/include/user_common.php     2012-06-19 13:17:18 UTC (rev 
4940)
+++ phpcompta/trunk/include/user_common.php     2012-06-19 13:18:52 UTC (rev 
4941)
@@ -33,64 +33,7 @@
  * \brief Common functions
  */
 
-
-
-
-
 /*!
- *\brief  Insert data into stock_goods,
- *
- * \param  $p_cn Database object
- * \param $p_j_id the j_id
- * \param $p_good the goods
- * \param $p_quant  quantity
- * \param $p_type c for SALE or d for PURCHASE
- *
- * \return $res of the insert or false if something gets wrong
- * \note Link to jrn gives the date
- */
-function InsertStockGoods($p_cn, $p_j_id, $p_good, $p_quant, $p_type,$p_depot)
-{
-       /**
-        address@hidden function insertStockGoods doit être déplacée dans 
class_stock
-        */
-    global $g_user;
-    if ( $g_user->can_write_repo($p_depot) == false )
-        return false;
-
-    // Retrieve the good account for stock
-    $code = new Fiche($p_cn);
-    $code->get_by_qcode($p_good);
-    $code_marchandise = $code->strAttribut(ATTR_DEF_STOCK);
-    if ( $code_marchandise == NOTFOUND )
-        return false;
-
-    $exercice = $g_user->get_exercice();
-
-    if ($exercice == 0)
-        throw new Exception('Annee invalide erreur');
-
-    $Res = $p_cn->exec_sql("insert into stock_goods (
-                         j_id,
-                         f_id,
-                         sg_code,
-                         sg_quantity,
-                         sg_type,sg_exercice,r_id ) values 
($1,$2,$3,$4,$5,$6,$7)",
-            array(
-                    $p_j_id,
-                    $code->id,
-                    $code_marchandise,
-                    $p_quant,
-                    $p_type,
-                    $exercice,
-                    $p_depot
-                )
-            );
-    return $Res;
-}
-
-
-/*!
  *\brief   test if a jrn op is valid
  *
  * \param $p_cn db
@@ -99,7 +42,7 @@
  *        - 1 is valid
  *        - 0 is not valid
  */
-function isValid ($p_cn,$p_grpt_id)
+function isValid_deprecrated ($p_cn,$p_grpt_id)
 {
     $Res=$p_cn->exec_sql("select jr_valid from jrn where 
jr_grpt_id=$p_grpt_id");
 
@@ -280,6 +223,7 @@
 {
     $p_num=trim($p_num);
     if ($p_num=='') return 0;
+    $p_num=str_replace("'",'',$p_num);
     $p_num=str_replace(',','.',$p_num);
     return $p_num;
 }



---
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]