Page 1 of 1

Invoice amount differs from VM order?!

Posted: 07 Jul 2008, 19:40
by akerman
Hi,

I installed this useful addon with no problems whatsoever. Very nice instruction! Simple and direct.

However, I have a few questions/issues.

1. The invoice calculation differs from the amounts in the VM order. How come?

The tax is 6% book VAT in Sweden and 25 SEK for sending invoice.
The invoice fee should be included in tax calculation.
Other than the tax calculation, there should just be simple addition.
The VM order is correct. The sum should be 606,50 SEK, not 605 SEK

Question:
Is the 'Addon' doing some calculation somewhere? Where does this take place in that case?
Is this a problem with rounding off the figures? (Since the invoice is 1.50 SEK more expensive...)

If VM is calculating wrong (yes, I've seen loads of discussion about this...) can I change this addon
to do the same 'errors' as VM? Where do I do that exactly?

2. The invoice fee (25 SEK in my case) is shown with a minus sign in front.

Question
In the VM order this is a plus sign. Where do I change this into a plus sign?

Adding attachments for clarification.


3. Using the Swedish language and UTF-8 doesn't work that good. The Swedish Å,Ä,Ö special signs
becomes a mess.


Question:
Can I fix this, and where in that case? (Checked the addon files, they're all saved in UTF-8, OK)

---------------------------------------------------------------------------------------------------------------------------
Inserting the Swedish translation into another post, if anyone have use for it... :|


Thanx for a useful addon! :)


Regards
Akerman

Re: Invoice amount differs from VM order?!

Posted: 07 Jul 2008, 20:37
by Jan
3. see: viewtopic.php?p=7211#p7211

1. - 2. - I didn't make the calculations, I reworked this addon from Ingemar for Joomla! 1.5 and added new PDF printing. The main calculations are here:

pdf/delivery.pdf.php
row 189 +

The tax is calculated here (not before, not added into a database tables), so try to change the code here, e.g.:

Code: Select all

$without_tax['final_price'] = $without_tax['item_total'] - $coupon_discount - $order_discount + $order_fee;
	$tax_rate = abs($without_tax['item_total']/$with_tax['item_total']-1);
	$tax['final_price'] = ($with_tax['item_total'] - $order_discount - $coupon_discount + $order_fee) * $tax_rate;
	$tax['final_price'] += $tax['shipping'];
	$with_tax['final_price'] = $with_tax['item_total'] - $coupon_discount - $order_discount + $order_fee;
Please let me know, if you are successfull

Jan

Re: Invoice amount differs from VM order?!

Posted: 07 Jul 2008, 22:56
by akerman
Thanx, will work on this tomorrow...

Whatever the outcome, I'll report back to this thread.


Regards
Akerman

Re: Invoice amount differs from VM order?!

Posted: 08 Jul 2008, 21:01
by Jan
great

Re: Invoice amount differs from VM order?!

Posted: 08 Jul 2008, 21:54
by akerman
Been working the better part of the day on this... sigh..

Here's what I know right know.

In VM (Configuration/Global/Tax configuration) - the calculation of tax heavily depend upon what choice you make in the configuration. Choosing 'EU mode' (based on product tax) or tax based on 'buyers location', never gives you a chance to add or separate tax in shipping costs. Choosing these also makes the invoice fee tax calculation use the same tax rate that you have on the product. (6% on books in my case), whilst it should be (for me) 25% on the invoice fee (and shipping).

Choosing 'Vendor mode', all of the sudden changes everything. Now I can choose the tax rate (rates that I've entered) in the shipping module. BUT the invoice fee calculation still uses the same tax as the product does, instead of the shipping tax rate. And the cart layout and details changed drastically in the checkout. Customer (for better or worse, I haven't decide yet...), receives separate calculations for the different taxes and a more detailed order form.

From a calculation standpoint; choosing 'Vendor mode' gives a more accurate and correct order calculation, as far as I can see. Although the customer might not be interested to see the specific tax (with five decimals!) on the shipping... (Maybe it's better to just add the total amount on shipping w tax included...?)

The addon (Invoice & Receit) function did not change. It still calculate tax on invoice fee using the product tax rate. AND I figured out that when rounding of the figures, it just rips off the cents (or Swedish öre), from the calculated tax field. Instead of doing a proper calculation on the total net amount (before tax).
This renders it hard to nearly impossible for the customer to calculate the invoice by hand.

I will continue to work on the Invoice/Receipt file and post more info later. But it'll probably take some time since I'm not a programmer but only a 'poor' network consultant... :D

Goal is to mimic VM order layout to the last and bitter byte.


Regards
Akerman

Re: Invoice amount differs from VM order?!

Posted: 08 Jul 2008, 22:35
by Jan
:idea:

Re: Invoice amount differs from VM order?!

Posted: 05 Sep 2011, 12:18
by linda17
I'm in the same situation with this :x texas Hold Em Tex