diff --git a/ChangeLog b/ChangeLog
index 2d957f1dbb2..3f5fad835f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@ For users:
---------------
NEW: Online proposal signature
+NEW: Can define some max limit on expense report (per period, per type or expense, ...)
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
NEW: #18326 Workflow: Close order on shipment closing.
NEW: #18401 Add __NEWREF__ subtitute to get new object reference.
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/admin/hrm.php b/htdocs/admin/hrm.php
index 2bcd4977716..8eb2f93c13c 100644
--- a/htdocs/admin/hrm.php
+++ b/htdocs/admin/hrm.php
@@ -20,7 +20,7 @@
*/
/**
- * \file hrm/admin/setup.php
+ * \file htdocs/admin/hrm.php
* \ingroup hrm
* \brief HrmTest setup page.
*/
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index d5c135279bf..6691823ab6f 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -626,12 +626,18 @@ class Categorie extends CommonObject
}
$arraydelete = array(
- 'categorie_societe' => 'fk_categorie',
- 'categorie_fournisseur' => 'fk_categorie',
'categorie_product' => 'fk_categorie',
+ 'categorie_fournisseur' => 'fk_categorie',
+ 'categorie_societe' => 'fk_categorie',
'categorie_member' => 'fk_categorie',
'categorie_contact' => 'fk_categorie',
+ 'categorie_user' => 'fk_categorie',
+ 'categorie_project' => 'fk_categorie',
'categorie_account' => 'fk_categorie',
+ 'categorie_website_page' => 'fk_categorie',
+ 'categorie_warehouse' => 'fk_categorie',
+ 'categorie_actioncomm' => 'fk_categorie',
+ 'categorie_ticket' => 'fk_categorie',
'bank_class' => 'fk_categ',
'categorie_lang' => 'fk_category',
'categorie' => 'rowid',
@@ -728,8 +734,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 +759,8 @@ class Categorie extends CommonObject
}
return -1;
}
+
+ return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -810,6 +816,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/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php
index 21a6c56689e..b46ff9433e3 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_list.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_list.php
@@ -223,7 +223,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
- $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : '');
+ $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
}
}
// Add fields from hooks
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/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php
index a4bf2d6990f..ce8d7ab0078 100644
--- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php
+++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php
@@ -2,7 +2,7 @@
/* Module descriptor for ticket system
* Copyright (C) 2013-2016 Jean-François FERRY
* 2016 Christophe Battarel
- * Copyright (C) 2019 Frédéric France
+ * Copyright (C) 2019-2021 Frédéric France
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
*/
/**
- * \file core/boxes/box_nb_ticket_last_x_days.php
+ * \file htdocs/core/boxes/box_graph_new_vs_close_ticket.php
* \ingroup ticket
* \brief This box shows the number of new daily tickets the last X days
*/
diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php
index 13cd0c40c86..5e69a49e88e 100644
--- a/htdocs/core/boxes/box_graph_ticket_by_severity.php
+++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php
@@ -2,7 +2,7 @@
/* Module descriptor for ticket system
* Copyright (C) 2013-2016 Jean-François FERRY
* 2016 Christophe Battarel
- * Copyright (C) 2019 Frédéric France
+ * Copyright (C) 2019-2021 Frédéric France
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
*/
/**
- * \file core/boxes/box_ticket_by_severity.php
+ * \file htdocs/core/boxes/box_graph_ticket_by_severity.php
* \ingroup ticket
* \brief This box shows open tickets by severity
*/
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 .= '