diff --git a/include/class/acc_ledger_purchase.class.php b/include/class/acc_ledger_purchase.class.php index 6d9c5c62e..a3e74c015 100644 --- a/include/class/acc_ledger_purchase.class.php +++ b/include/class/acc_ledger_purchase.class.php @@ -669,6 +669,10 @@ class Acc_Ledger_Purchase extends Acc_Ledger } // insert into quant_purchase //----- + if (empty( ${'e_march' . $i . '_price'} ) ) ${'e_march' . $i . '_price'} = 0; + if (empty( ${'e_march' . $i } ) ) ${'e_march' . $i } = 0; + if (empty( ${'e_quant' . $i } ) ) ${'e_quant' . $i } = 0; + if ( $g_parameter->MY_TVA_USE=='Y') { diff --git a/include/class/acc_ledger_sold.class.php b/include/class/acc_ledger_sold.class.php index fd6244708..17ad2acb0 100644 --- a/include/class/acc_ledger_sold.class.php +++ b/include/class/acc_ledger_sold.class.php @@ -374,6 +374,9 @@ class Acc_Ledger_Sold extends Acc_Ledger { $op->oa_description = sql_string($e_comm); $op->save_form_plan($_POST, $i, $j_id); } + if (empty( ${'e_march' . $i . '_price'} ) ) ${'e_march' . $i . '_price'} = 0; + if (empty( ${'e_march' . $i } ) ) ${'e_march' . $i } = 0; + if (empty( ${'e_quant' . $i } ) ) ${'e_quant' . $i } = 0; if ($g_parameter->MY_TVA_USE == 'Y') { /* save into quant_sold */ $r = $this->db->exec_sql("select insert_quant_sold ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)", array(null, /* 1 */ @@ -609,7 +612,7 @@ class Acc_Ledger_Sold extends Acc_Ledger { 'Erreur dans l\'enregistrement ' . __FILE__ . ':' . __LINE__ . ' ' . $e->getMessage(); - echo $e->getTrace(); + echo $e->getTraceAsString(); $this->db->rollback(); throw new Exception ($e); diff --git a/include/lib/inum.class.php b/include/lib/inum.class.php index f2755c499..6cc9f4e1c 100644 --- a/include/lib/inum.class.php +++ b/include/lib/inum.class.php @@ -82,7 +82,7 @@ class INum extends IText $this->javascript='onchange="format_number(this,'.$this->prec.');"'; } $this->name=($p_name==null)?$this->name:$p_name; - $this->value=($p_value==null)?$this->value:$p_value; + $this->value=($p_value===null)?$this->value:$p_value; $this->id=($this->id=="")?$this->name:$this->id; if ($this->readOnly==true)