Skip to content

Commit

Permalink
Update interface_20_modWorkflow_WorkflowManager.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 30, 2019
1 parent 858e8a8 commit fe8ced5
Showing 1 changed file with 3 additions and 6 deletions.
Expand Up @@ -316,7 +316,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
* 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.
*/
Expand All @@ -326,10 +326,7 @@ private function shouldClassify($conf, $totalonlinkedelements, $object_total_ht)
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'));
}
}

0 comments on commit fe8ced5

Please sign in to comment.