diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index 7e852846d5c..d50813cbea4 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -213,7 +213,7 @@ if ($object->id > 0)
$head = facture_prepare_head($object);
}
- print dol_get_fiche_head($head, 'standingorders', $title, -1, 'bill');
+ print dol_get_fiche_head($head, 'standingorders', $title, -1, ($type == 'bank-transfer' ? 'supplier_invoice' : 'bill'));
// Invoice content
if ($type == 'bank-transfer') {
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 09f2b0a44ae..a1800e03980 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -52,9 +52,11 @@ class Conf
public $disable_compute;
//! Used to store current currency (ISO code like 'USD', 'EUR', ...)
public $currency;
+
//! Used to store current css (from theme)
public $theme; // Contains current theme ("eldy", "auguria", ...)
public $css; // Contains full path of css page ("/theme/eldy/style.css.php", ...)
+
//! Used to store current menu handler
public $standard_menu;
// List of activated modules
@@ -98,6 +100,8 @@ class Conf
public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone
public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url
+ public $liste_limit;
+
/**
* Constructor
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 92114b7c094..dd80c660e71 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4877,7 +4877,7 @@ function price2num($amount, $rounding = '', $option = 0)
elseif ($rounding == 'CR') $nbofdectoround = 8;
elseif (is_numeric($rounding)) $nbofdectoround = $rounding;
//print "RR".$amount.' - '.$nbofdectoround.'
';
- if (dol_strlen($nbofdectoround)) $amount = round($amount, $nbofdectoround); // $nbofdectoround can be 0.
+ if (dol_strlen($nbofdectoround)) $amount = round(is_string($amount) ? (float) $amount : $amount, $nbofdectoround); // $nbofdectoround can be 0.
else return 'ErrorBadParameterProvidedToFunction';
//print 'SS'.$amount.' - '.$nbofdec.' - '.$dec.' - '.$thousand.' - '.$nbofdectoround.'
';
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index b439e5cad45..c615817e36f 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -115,6 +115,8 @@ $permissiondellink = $usercancreate; // Used by the include of actions_dellink.i
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$error = 0;
+
/*
* Actions
@@ -183,8 +185,7 @@ if (empty($reshook))
}
// Check parameters
- if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
- {
+ if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
$langs->load("stocks");
if (!$idwarehouse || $idwarehouse == -1)
{
@@ -194,11 +195,9 @@ if (empty($reshook))
}
}
- if (!$error)
- {
+ if (!$error) {
$result = $object->validate($user, '', $idwarehouse);
- if ($result < 0)
- {
+ if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
// Define output language
@@ -220,8 +219,7 @@ if (empty($reshook))
}
}
}
- } elseif ($action == 'confirm_delete' && $confirm == 'yes')
- {
+ } elseif ($action == 'confirm_delete' && $confirm == 'yes') {
$object->fetch($id);
$object->fetch_thirdparty();
@@ -280,15 +278,13 @@ if (empty($reshook))
} elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercancreate) {
$object->fetch($id);
$result = $object->set_paid($user);
- if ($result < 0)
- {
+ if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Set supplier ref
- if ($action == 'setref_supplier' && $usercancreate)
- {
+ if ($action == 'setref_supplier' && $usercancreate) {
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
if ($object->update($user) < 0) {
@@ -315,8 +311,7 @@ if (empty($reshook))
}
// payments conditions
- if ($action == 'setconditions' && $usercancreate)
- {
+ if ($action == 'setconditions' && $usercancreate) {
$object->fetch($id);
$object->cond_reglement_code = 0; // To clean property
$object->cond_reglement_id = 0; // To clean property
@@ -1680,20 +1675,17 @@ if ($action == 'create')
$currency_code = $conf->currency;
$societe = '';
- if (GETPOST('socid') > 0)
- {
+ if (GETPOST('socid') > 0) {
$societe = new Societe($db);
$societe->fetch(GETPOST('socid', 'int'));
if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) $currency_code = $societe->multicurrency_code;
}
- if (!empty($origin) && !empty($originid))
- {
+ if (!empty($origin) && !empty($originid)) {
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
- if ($element == 'project')
- {
+ if ($element == 'project') {
$projectid = $originid;
$element = 'projet';
}
@@ -2204,8 +2196,7 @@ if ($action == 'create')
// Show origin lines
- if (is_object($objectsrc))
- {
+ if (is_object($objectsrc)) {
print '
';
$title = $langs->trans('ProductsAndServices');
@@ -2218,8 +2209,7 @@ if ($action == 'create')
print '';
}
} else {
- if ($id > 0 || !empty($ref))
- {
+ if ($id > 0 || !empty($ref)) {
/* *************************************************************************** */
/* */
/* Fiche en mode visu ou edition */
@@ -2275,7 +2265,7 @@ if ($action == 'create')
$head = facturefourn_prepare_head($object);
$titre = $langs->trans('SupplierInvoice');
- print dol_get_fiche_head($head, 'card', $titre, -1, 'bill');
+ print dol_get_fiche_head($head, 'card', $titre, -1, 'supplier_invoice');
$formconfirm = '';
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index 99010c977dc..357abd029fa 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -134,7 +134,7 @@ if ($id > 0 || !empty($ref))
$head = facturefourn_prepare_head($object);
- print dol_get_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), -1, 'bill');
+ print dol_get_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), -1, 'supplier_invoice');
$linkback = ''.$langs->trans("BackToList").'';
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index d57abc67644..36f5a45b25e 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -90,7 +90,7 @@ llxHeader('', $title, $helpurl);
if ($object->id > 0)
{
$head = facturefourn_prepare_head($object);
- print dol_get_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), -1, 'bill');
+ print dol_get_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), -1, 'supplier_invoice');
$totalpaye = $object->getSommePaiement();
diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php
index 494f5d2aa03..131b34bbe39 100644
--- a/htdocs/fourn/facture/index.php
+++ b/htdocs/fourn/facture/index.php
@@ -51,7 +51,7 @@ $maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->globa
llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
-print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'bill');
+print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invoice');
print '