|
@@ -1198,10 +1198,10 @@ class CommandeFournisseur extends CommonOrder
|
|
|
* @param int $date_start Date start of service
|
|
|
* @param int $date_end Date end of service
|
|
|
* @param array $array_options extrafields array
|
|
|
- * @param int $fk_unit Id of the unit to use. Null to use the default one
|
|
|
+ * @param string $fk_unit Code of the unit to use. Null to use the default one
|
|
|
* @return int <=0 if KO, >0 if OK
|
|
|
*/
|
|
|
- function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit = null)
|
|
|
+ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null)
|
|
|
{
|
|
|
global $langs,$mysoc;
|
|
|
|
|
@@ -1327,7 +1327,7 @@ class CommandeFournisseur extends CommonOrder
|
|
|
$sql.= "'".price2num($total_localtax1)."',";
|
|
|
$sql.= "'".price2num($total_localtax2)."',";
|
|
|
$sql.= "'".price2num($total_ttc)."',";
|
|
|
- $sql.= (!$fk_unit ? 'NULL' : $fk_unit);
|
|
|
+ $sql.= ($fk_unit ? "'".$this->db->escape($fk_unit)."'":"null");
|
|
|
$sql.= ")";
|
|
|
|
|
|
dol_syslog(get_class($this)."::addline", LOG_DEBUG);
|
|
@@ -1992,11 +1992,11 @@ class CommandeFournisseur extends CommonOrder
|
|
|
* @param int $notrigger Disable triggers
|
|
|
* @param timestamp $date_start Date start of service
|
|
|
* @param timestamp $date_end Date end of service
|
|
|
- * @param array $array_options extrafields array
|
|
|
- * @param int $fk_unit Id of the unit to use. Null to use the default one
|
|
|
+ * @param array $array_options Extrafields array
|
|
|
+ * @param string $fk_unit Code of the unit to use. Null to use the default one
|
|
|
* @return int < 0 if error, > 0 if ok
|
|
|
*/
|
|
|
- function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit = null)
|
|
|
+ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit=null)
|
|
|
{
|
|
|
global $mysoc;
|
|
|
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit");
|
|
@@ -2066,7 +2066,7 @@ class CommandeFournisseur extends CommonOrder
|
|
|
$sql.= ",total_localtax2='".price2num($total_localtax2)."'";
|
|
|
$sql.= ",total_ttc='".price2num($total_ttc)."'";
|
|
|
$sql.= ",product_type=".$type;
|
|
|
- $sql.= ",fk_unit=".(!$fk_unit ? 'NULL' : $fk_unit);
|
|
|
+ $sql.= ($fk_unit ? "'".$this->db->escape($fk_unit)."'":"null");
|
|
|
$sql.= " WHERE rowid = ".$rowid;
|
|
|
|
|
|
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|