From 9e8c6eb0a107da911083bdce8f25b68da4e5fc0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Dec 2020 15:05:17 +0100 Subject: [PATCH 1/5] FIX #15849 --- htdocs/core/tpl/objectline_create.tpl.php | 4 ++-- htdocs/product/fournisseurs.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f028c00d704..1c526f225aa 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -386,10 +386,10 @@ if ($nolinesbefore) { product->enabled) || !empty($conf->service->enabled)) { ?> - + - "> + "> global->DISPLAY_MARGIN_RATES)) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index cf5e4fa5b53..2aadd4b3813 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -490,9 +490,9 @@ if ($id > 0 || $ref) if ($rowid) { print ''; - print ''; + print ''; } else { - print ''; + print ''; } print ''; print ''; From c5b419ecb5200c74d8cf24585ca49235f90b17bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Dec 2020 15:45:59 +0100 Subject: [PATCH 2/5] Removed useless file --- build.xml | 102 ------------------------------------------------------ 1 file changed, 102 deletions(-) delete mode 100644 build.xml diff --git a/build.xml b/build.xml deleted file mode 100644 index c6995ce95f3..00000000000 --- a/build.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 37437901601df5e4ba2d08ba883b3ea8be6c0747 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Dec 2020 15:49:25 +0100 Subject: [PATCH 3/5] Fix warning --- htdocs/webservices/server_order.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 7f2f2ebd43f..8c278768990 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -364,6 +364,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') $objectresp = array(); $errorcode = ''; $errorlabel = ''; $error = 0; + $socid = 0; $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel); @@ -387,7 +388,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') if ($result > 0) { // Security for external user - if ($socid && (empty($order->socid) || $socid != $order->socid)) + if ($socid && $socid != $order->socid) { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; From d834f6023dcce665043983e61cf0694d270da258 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Dec 2020 16:06:54 +0100 Subject: [PATCH 4/5] Fix rounding --- htdocs/core/class/html.form.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 492a4899376..4ed39694720 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2652,14 +2652,14 @@ class Form if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { if (!empty($user->rights->stock->lire)) { - $opt .= ' - '.$langs->trans("Stock").':'.$objp->stock; + $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); if ($objp->stock > 0) { $outval .= ' - '; } elseif ($objp->stock <= 0) { $outval .= ' - '; } - $outval .= $langs->transnoentities("Stock").':'.$objp->stock; + $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); $outval .= ''; if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) // Warning, this option may slow down combo list generation { @@ -2989,14 +2989,14 @@ class Form $novirtualstock = ($showstockinlist == 2); if (!empty($user->rights->stock->lire)) { - $outvallabel .= ' - '.$langs->trans("Stock").':'.$objp->stock; + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); if ($objp->stock > 0) { $optlabel .= ' - '; } elseif ($objp->stock <= 0) { $optlabel .= ' - '; } - $optlabel .= $langs->transnoentities("Stock").':'.$objp->stock; + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); $optlabel .= ''; if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) // Warning, this option may slow down combo list generation { From d2345ea96c977077d757951545c41ba7aafd63c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Dec 2020 16:55:29 +0100 Subject: [PATCH 5/5] Fix warning --- htdocs/webservices/server_thirdparty.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 12b2d3315c8..cd930f47ad3 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -468,12 +468,12 @@ function createThirdParty($authentication, $thirdparty) $newobject->capital = $thirdparty['capital']; - $newobject->barcode = $thirdparty['barcode']; - $newobject->tva_assuj = $thirdparty['vat_used']; - $newobject->tva_intra = $thirdparty['vat_number']; + $newobject->barcode = empty($thirdparty['barcode']) ? '' : $thirdparty['barcode']; + $newobject->tva_assuj = empty($thirdparty['vat_used']) ? 0 : $thirdparty['vat_used']; + $newobject->tva_intra = empty($thirdparty['vat_number']) ? '' : $thirdparty['vat_number']; - $newobject->canvas = $thirdparty['canvas']; - $newobject->particulier = $thirdparty['individual']; + $newobject->canvas = empty($thirdparty['canvas']) ? '' : $thirdparty['canvas']; + $newobject->particulier = empty($thirdparty['individual']) ? 0 : $thirdparty['individual']; $elementtype = 'societe';