Merge branch '12.0' of github.com:Dolibarr/dolibarr into 12.0

This commit is contained in:
Florian HENRY 2021-01-18 09:12:29 +01:00
commit 1cd0f71c09
5 changed files with 7 additions and 5 deletions

View File

@ -66,6 +66,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
if ($action != 'updateedit' && !$error) if ($action != 'updateedit' && !$error)
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }

View File

@ -256,6 +256,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
if (!$error) if (!$error)
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
$db->commit(); $db->commit();
} }
else else

View File

@ -57,6 +57,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
if ($action != 'updateedit' && !$error) if ($action != 'updateedit' && !$error)
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }

View File

@ -4725,7 +4725,7 @@ function price2num($amount, $rounding = '', $option = 0)
if ($option != 1) { // If not a PHP number or unknown, we change or clean format if ($option != 1) { // If not a PHP number or unknown, we change or clean format
//print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'<br>'; //print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'<br>';
if (!is_numeric($amount)) { if (!is_numeric($amount)) {
$amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>]/', '', $amount); $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\_]/', '', $amount);
} }
if ($option == 2 && $thousand == '.' && preg_match('/\.(\d\d\d)$/', (string) $amount)) { // It means the . is used as a thousand separator and string come frominput data, so 1.123 is 1123 if ($option == 2 && $thousand == '.' && preg_match('/\.(\d\d\d)$/', (string) $amount)) { // It means the . is used as a thousand separator and string come frominput data, so 1.123 is 1123

View File

@ -16,7 +16,7 @@
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr> * Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2020 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2019-2020 Thibault FOUCART <support@ptibogxiv.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -1297,11 +1297,10 @@ else
// Accountancy_code_buy // Accountancy_code_buy
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>'; print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
print '<td>'; print '<td>';
if ($type == 0) if ($type == 0) {
{
$accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT); $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
} else { } else {
$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
} }
print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, ''); print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, '');
print '</td></tr>'; print '</td></tr>';