From fe8ced58c8c1262ab51c81a8a878108cdec20392 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Jul 2019 21:19:33 +0200 Subject: [PATCH] Update interface_20_modWorkflow_WorkflowManager.class.php --- .../interface_20_modWorkflow_WorkflowManager.class.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 5c13e372640..2c7ee724d2f 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -316,7 +316,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers * invoices linked to $object * @param float $object_total_ht The total amount (excl VAT) of the object * (an order, a proposal, a bill, etc.) - * @return bool True if the amounts are equal (arithmetic errors within tolerance margin) + * @return bool True if the amounts are equal (rounded on total amount) * True if the module is configured to skip the amount equality check * False otherwise. */ @@ -326,10 +326,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (!empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) { return true; } - // if the rounded amount difference is zero, allow classification, else deny - return 0 == round( - $totalonlinkedelements - $object_total_ht, - $conf->global->MAIN_MAX_DECIMALS_UNIT - ); + // if the amount are same, allow classification, else deny + return (price2num($totalonlinkedelements, 'MT') == price2num($object_total_ht, 'MT')); } }