diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index 7c3cc2cf0e2..aa1abde5fa5 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -214,7 +214,7 @@ if ($action == 'validatehistory') {
$facture_static->ref = $objp->ref;
$facture_static->id = $objp->facid;
$facture_static->type = $objp->ftype;
- $facture_static->datef = $objp->datef;
+ $facture_static->date = $objp->datef;
$facture_static_det->id = $objp->rowid;
$facture_static_det->total_ht = $objp->total_ht;
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 9a942bc3eaa..97a885f97b9 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -559,7 +559,7 @@ if ($result) {
$facture_static->ref = $objp->ref;
$facture_static->id = $objp->facid;
$facture_static->type = $objp->ftype;
- $facture_static->datef = $objp->datef;
+ $facture_static->date = $objp->datef;
$facture_static_det->id = $objp->rowid;
$facture_static_det->total_ht = $objp->total_ht;
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index d5c135279bf..e7c361322bc 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -728,8 +728,6 @@ class Categorie extends CommonObject
}
}
-
-
// Call trigger
$this->context = array('linkto'=>$obj); // Save object we want to link category to into category instance to provide information to trigger
$result = $this->call_trigger('CATEGORY_LINK', $user);
@@ -755,6 +753,8 @@ class Categorie extends CommonObject
}
return -1;
}
+
+ return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -810,6 +810,8 @@ class Categorie extends CommonObject
$this->error = $this->db->lasterror();
return -1;
}
+
+ return 0;
}
/**
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 8ebb9f43b1e..7ccd80eb4bd 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -770,7 +770,7 @@ if ($type == Categorie::TYPE_CONTACT) {
print '
'."\n";
print '| '.$langs->trans("Ref").' |
'."\n";
- if (count($contacts) > 0) {
+ if (is_array($contacts) && count($contacts) > 0) {
$i = 0;
foreach ($contacts as $key => $contact) {
$i++;
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 8aef94d2a7c..5b818f7abce 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1494,13 +1494,13 @@ if ($action == 'create' && $usercancreate) {
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); // TODO maybe add default value option
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
$fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
- $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0));
+ $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : 0);
$shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0));
$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
$demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0));
$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
- $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : '';
+ $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ? -1 : '';
$date_delivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '');
if (empty($date_delivery)) {
@@ -1526,7 +1526,7 @@ if ($action == 'create' && $usercancreate) {
$cond_reglement_id = $soc->cond_reglement_id;
$mode_reglement_id = $soc->mode_reglement_id;
$fk_account = $soc->fk_account;
- $availability_id = $soc->availability_id;
+ $availability_id = 0;
$shipping_method_id = $soc->shipping_method_id;
$warehouse_id = $soc->warehouse_id;
$demand_reason_id = $soc->demand_reason_id;
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 852cd2865bb..b589607ac37 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -303,8 +303,8 @@ class FactureRec extends CommonInvoice
$sql .= ", ".((int) $facsrc->socid);
$sql .= ", ".((int) $conf->entity);
$sql .= ", '".$this->db->idate($now)."'";
- $sql .= ", ".(!empty($facsrc->amount) ? ((float) $facsrc->amount) : '0');
- $sql .= ", ".(!empty($facsrc->remise) ? ((float) $this->remise) : '0');
+ $sql .= ", ".(!empty($facsrc->total_ttc) ? ((float) $facsrc->total_ttc) : '0');
+ $sql .= ", ".(!empty($facsrc->remise_absolue) ? ((float) $this->remise_absolue) : '0');
$sql .= ", ".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL");
$sql .= ", ".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL");
$sql .= ", ".(!empty($this->model_pdf) ? ("'".$this->db->escape($this->model_pdf)."'") : "NULL");
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index c9740951fc9..6bf0285a2fb 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6488,7 +6488,7 @@ abstract class CommonObject
$out = '';
$type = '';
- $isDependList=0;
+ $isDependList = 0;
$param = array();
$param['options'] = array();
$reg = array();
@@ -6796,7 +6796,7 @@ abstract class CommonObject
if (!empty($InfoFieldList[3]) && $parentField) {
$parent = $parentName.':'.$obj->{$parentField};
- $isDependList=1;
+ $isDependList = 1;
}
$out .= '