Fix error phpunit
This commit is contained in:
parent
678e23b13a
commit
02f8ac4cbc
@ -166,11 +166,11 @@ class Delivery extends CommonObject
|
|||||||
$sql .= ", fk_incoterms, location_incoterms";
|
$sql .= ", fk_incoterms, location_incoterms";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= "'(PROV)'";
|
$sql .= "'(PROV)'";
|
||||||
$sql .= ", ".$conf->entity;
|
$sql .= ", ".((int) $conf->entity);
|
||||||
$sql .= ", ".$this->socid;
|
$sql .= ", ".((int) $this->socid);
|
||||||
$sql .= ", '".$this->db->escape($this->ref_customer)."'";
|
$sql .= ", '".$this->db->escape($this->ref_customer)."'";
|
||||||
$sql .= ", '".$this->db->idate($now)."'";
|
$sql .= ", '".$this->db->idate($now)."'";
|
||||||
$sql .= ", ".$user->id;
|
$sql .= ", ".((int) $user->id);
|
||||||
$sql .= ", ".($this->date_delivery ? "'".$this->db->idate($this->date_delivery)."'" : "null");
|
$sql .= ", ".($this->date_delivery ? "'".$this->db->idate($this->date_delivery)."'" : "null");
|
||||||
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
|
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
|
||||||
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
|
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
|
||||||
@ -189,7 +189,7 @@ class Delivery extends CommonObject
|
|||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."delivery ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."delivery ";
|
||||||
$sql .= "SET ref = '".$this->db->escape($numref)."'";
|
$sql .= "SET ref = '".$this->db->escape($numref)."'";
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog("Delivery::create", LOG_DEBUG);
|
dol_syslog("Delivery::create", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -262,9 +262,10 @@ class Delivery extends CommonObject
|
|||||||
* @param string $qty Quantity
|
* @param string $qty Quantity
|
||||||
* @param string $fk_product Id of predefined product
|
* @param string $fk_product Id of predefined product
|
||||||
* @param string $description Description
|
* @param string $description Description
|
||||||
|
* @param array $array_options Array options
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function create_line($origin_id, $qty, $fk_product, $description, $array_options = 0)
|
public function create_line($origin_id, $qty, $fk_product, $description, $array_options = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -436,7 +437,7 @@ class Delivery extends CommonObject
|
|||||||
$sql .= ", fk_statut = 1";
|
$sql .= ", fk_statut = 1";
|
||||||
$sql .= ", date_valid = '".$this->db->idate($now)."'";
|
$sql .= ", date_valid = '".$this->db->idate($now)."'";
|
||||||
$sql .= ", fk_user_valid = ".$user->id;
|
$sql .= ", fk_user_valid = ".$user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
$sql .= " AND fk_statut = 0";
|
$sql .= " AND fk_statut = 0";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -602,9 +603,10 @@ class Delivery extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param int $origin_id Origin id
|
* @param int $origin_id Origin id
|
||||||
* @param int $qty Qty
|
* @param int $qty Qty
|
||||||
|
* @param array $array_options Array options
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addline($origin_id, $qty, $array_options = 0)
|
public function addline($origin_id, $qty, $array_options = null)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -666,7 +668,7 @@ class Delivery extends CommonObject
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."delivery";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."delivery";
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
if ($this->db->query($sql)) {
|
if ($this->db->query($sql)) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
@ -861,12 +863,12 @@ class Delivery extends CommonObject
|
|||||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||||
global $langs;
|
global $langs;
|
||||||
//$langs->load("mymodule");
|
//$langs->load("mymodule");
|
||||||
$this->labelStatus[-1] = $langs->trans('StatusDeliveryCanceled');
|
$this->labelStatus[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled');
|
||||||
$this->labelStatus[0] = $langs->trans('StatusDeliveryDraft');
|
$this->labelStatus[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft');
|
||||||
$this->labelStatus[1] = $langs->trans('StatusDeliveryValidated');
|
$this->labelStatus[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated');
|
||||||
$this->labelStatusShort[-1] = $langs->trans('StatusDeliveryCanceled');
|
$this->labelStatusShort[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled');
|
||||||
$this->labelStatusShort[0] = $langs->trans('StatusDeliveryDraft');
|
$this->labelStatusShort[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft');
|
||||||
$this->labelStatusShort[1] = $langs->trans('StatusDeliveryValidated');
|
$this->labelStatusShort[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated');
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status0';
|
$statusType = 'status0';
|
||||||
@ -1016,7 +1018,7 @@ class Delivery extends CommonObject
|
|||||||
if ($user->rights->expedition->creer) {
|
if ($user->rights->expedition->creer) {
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."delivery";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."delivery";
|
||||||
$sql .= " SET date_delivery = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null');
|
$sql .= " SET date_delivery = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null');
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::setDeliveryDate", LOG_DEBUG);
|
dol_syslog(get_class($this)."::setDeliveryDate", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user