News:

Support the VirtueMart project and become a member

Main Menu

difference in payment discount

Started by melsonmarketing, March 10, 2014, 10:23:51 AM

Previous topic - Next topic

melsonmarketing

Hi!

I've been searching the forums, but didn't find a similar topic.

The Payment "Invoice" for example is configured to give 2% discount.

Thr correct calculation should be:

2 products at € 90 = € 180

+ 19% VAT = € 34,20

Total = € 214,20

VM does it right until that point.

Choosing the Invoice as Payment (-2%) VM calculates  -€ 4,20 giving a Paymentamount of € 210,00

The correct way should be: -2% = -€4,28  Payment = 209,92

Decimals are set to 2

Is there something I didn't see?!

jjk

#1
Quote from: melsonmarketing on March 10, 2014, 10:23:51 AM
Is there something I didn't see?!

The correct calculation is: 214.20 / 1,02 * 0.02 = 4.20          Update: Thinking about again... that calculation might be wrong in this case of a cash discount (Skonto) Will check again asap...
MwSt (VAT) is calculated like this too: 214,20 / 1,19 * 0,19 = 34,20
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

reinhold

#2
It all depends on the definition of the discount. Is it 2% of the final, billed amount? That's what VM appears to do according to your description.

In reality, though, most discounts are given as 2% of the subtotal  (i.e. on the 214.20). VM seems to apply the discount also to the discount, so effectively you get 1.96% discount on the subtotal with the current calculation.

It's similar with the tax, just that you have different basic values to start from. For the tax you start with 180 and calculate 19% from that. You arrive at 214.20 and then calculate 2% from that as the discount.

However, if you want to base all calculations on the subtotal including taxes, then you need to calculate the tax amount differently than the discount (because the 214.20 already include the tax, but NOT the discount yet).