{"action":"created","issue":{"url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/5960","repository_url":"https://api.github.com/repos/Dolibarr/dolibarr","labels_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/5960/labels{/name}","comments_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/5960/comments","events_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/5960/events","html_url":"https://github.com/Dolibarr/dolibarr/issues/5960","id":187489133,"number":5960,"title":"Wrong results from function calcul_price_total","user":{"login":"SylvainLegrand","id":23272229,"avatar_url":"https://avatars.githubusercontent.com/u/23272229?v=3","gravatar_id":"","url":"https://api.github.com/users/SylvainLegrand","html_url":"https://github.com/SylvainLegrand","followers_url":"https://api.github.com/users/SylvainLegrand/followers","following_url":"https://api.github.com/users/SylvainLegrand/following{/other_user}","gists_url":"https://api.github.com/users/SylvainLegrand/gists{/gist_id}","starred_url":"https://api.github.com/users/SylvainLegrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SylvainLegrand/subscriptions","organizations_url":"https://api.github.com/users/SylvainLegrand/orgs","repos_url":"https://api.github.com/users/SylvainLegrand/repos","events_url":"https://api.github.com/users/SylvainLegrand/events{/privacy}","received_events_url":"https://api.github.com/users/SylvainLegrand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-05T10:30:13Z","updated_at":"2016-11-11T14:23:35Z","closed_at":null,"body":"# Bug\r\nIn some case the results from the function calcul_price_total was wrong : the function return the amount of VAT tax instead of total HT.\r\n\r\n## Environment\r\n- **Version**: 4.0.2\r\n- **OS**: Wamp server 3.0.6 on Windows 10 pro v. 1607\r\n- **Web server**: Apache 2.4.23\r\n- **PHP**: 5.6.27\r\n- **Database**:  innodb MySQL 5.7.16\r\n\r\n## Expected and actual behavior\r\nIn case of rounding price not using base 10 ; the function calcul_price_total[0] return wrong value.\r\nWe expect Total HT.\r\nWe have VAT tax amount. \r\n\r\n## Solution\r\nThis problem came from .../htdocs/core/lib/price.lib.php on line 325.\r\nThis line was : \"**$result[0]=price2num($result[2]-$result[0], 'MT');**\"\r\nIt should be : \"**$result[0]=price2num($result[2]-$result[1], 'MT');**\"\r\n\r\n## The corrected file\r\n[price.lib.php.zip](https://github.com/Dolibarr/dolibarr/files/573121/price.lib.php.zip)\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/comments/259967375","html_url":"https://github.com/Dolibarr/dolibarr/issues/5960#issuecomment-259967375","issue_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/5960","id":259967375,"user":{"login":"eldy","id":883887,"avatar_url":"https://avatars.githubusercontent.com/u/883887?v=3","gravatar_id":"","url":"https://api.github.com/users/eldy","html_url":"https://github.com/eldy","followers_url":"https://api.github.com/users/eldy/followers","following_url":"https://api.github.com/users/eldy/following{/other_user}","gists_url":"https://api.github.com/users/eldy/gists{/gist_id}","starred_url":"https://api.github.com/users/eldy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eldy/subscriptions","organizations_url":"https://api.github.com/users/eldy/orgs","repos_url":"https://api.github.com/users/eldy/repos","events_url":"https://api.github.com/users/eldy/events{/privacy}","received_events_url":"https://api.github.com/users/eldy/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T14:23:35Z","updated_at":"2016-11-11T14:23:35Z","body":"Can you provide value of setup \"rounding\" you use and then input value sent to function and result you get and result you expect to get ?"}}
{"actor":{"display_login":"eldy"}}