mollie / mollie-api-php

Mollie API client for PHP
http://www.mollie.com
BSD 2-Clause "Simplified" License
552 stars 191 forks source link

Inconsistency in rounding of Settlement costs in Invoice PDF #221

Closed holtkamp closed 6 years ago

holtkamp commented 6 years ago

Specifications

Describe the issue

Is there any documentation available about the way Mollie applies "rounding of values"?

The reason that I am asking is an inconsistency I noticed when processing Settlements in a (Moneybird) Administration.

Situation For a certain Settlement X, these are the costs as returned by the API:

"costs"] => array(1) {
    [0] => object(stdClass)#18432 (5) {
      ["description"] => string(5) "iDEAL"
      ["method"] => string(5) "ideal"
      ["count"] => int(17)
      ["rate"] => object(stdClass)#18453 (2) {
        ["fixed"] => string(6) "0.2900"
        ["percentage"] => NULL
      }
      ["amount"] => object(stdClass)#18141 (3) {
        ["net"] => string(6) "4.9300"
        ["vat"] => string(6) "1.0353"
        ["gross"] => string(6) "5.9653"
      }
    }
}

Note that the gross amount has a value 5.9653.

PDF Version of Invoice When looking at the PDF version of Invoice Y that covers this Settlement, the gross costs of Settlement X are indicated in the list of Settlements as "deductions" of €5.96

So 5.9653 gets rounded to €5.96, where I would expect €5.97

The strange thing is, a value like 6.3162 is rounded to €6.32, as expected...

Administration => Settlements When looking at the Settlement X in the dashboard, the "deductions" column indicates €0.00, while the "costs" column indicates €5.97, so this is different Settlement entry in the PDF Invoice... strange!

Is this caused by rounding compensations? This particular Settlement is at the beginning of the month / last of an Invoice. The "revenue" minus "deductions" does match the amount that is "paid out", so I suspect some rounding mechanism to be at work. Is this documented somewhere?

willemstuursma commented 6 years ago

Hi @holtkamp, can you send me an email on which settlement this issue is with, I'll have a look at it: willem@mollie.com.

holtkamp commented 6 years ago

did you guys find anything? I come to the conclusion that the "sum of all Settlements" (which might be on a daily basis) might not be exactly the same as the the amount that is processed in the monthly Invoice. This makes the financial accounting part of the Settlements difficult...

willemstuursma commented 6 years ago

Sorry @holtkamp I didn't have time to look into it yet. Spend most of last week in London on the OWASP AppSec conference.

holtkamp commented 6 years ago

Monthly bump on this, encountered this again on the new Invoice 🤓

willemstuursma commented 6 years ago

@holtkamp it's not forgotten, I'll let you know if there are any updates.

willemstuursma commented 6 years ago

@holtkamp This issue has been resolved. The problem was a rounding error on the PDF invoice.