php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67195 [FR] Calcul de TVA faux
Submitted: 2014-05-03 18:21 UTC Modified: 2014-12-28 17:23 UTC
From: kylekatarnls at gmail dot com Assigned:
Status: Not a bug Package: Translation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kylekatarnls at gmail dot com
New email:
PHP Version: OS:

 

 [2014-05-03 18:21 UTC] kylekatarnls at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/functions.anonymous
---

Le calcul suivant est faux :
$total += ($pricePerItem * $quantity) * ($tax + 1.0);

HC => TTC
10000 * (1+0.055) => 10550
TTC => HT
10550 * (1-0.055) => 9969,75 (faux devrait faire 10000)


Pour ajouter la TVA se calcul, il faut faire :
$total += ($pricePerItem * $quantity) / (1.0 - $tax);

HC => TTC
10000 / (1-0.055) => 10582,011
TTC => HT
10582,011 * (1-0.055) => 10000


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-08 14:21 UTC] sobak@php.net
-Summary: Calcul de TVA faux +Summary: [FR] Calcul de TVA faux
 [2014-12-28 17:22 UTC] jeanseb@php.net
Faux, le calcul est bon.

Le calcul TTC => HT s'effectue via la formule suivante :

TTC * (100/(TVA+100)) = HT

Soit pour notre exemple (10550 avec une TVA à 5.5) 
10550 * (100/(5.5+100)) = 10000

Source : http://vosdroits.service-public.fr/professionnels-entreprises/F24271.xhtml
 [2014-12-28 17:23 UTC] jeanseb@php.net
-Status: Open +Status: Not a bug
 [2014-12-28 17:23 UTC] jeanseb@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 20:01:32 2024 UTC