9 replies [Last post]
thedecline's picture
Offline
Joined: 10/26/2008
Juice: 44
Was this information Helpful?

So far I have successfully implemented one site with Ubercart 1.6 - www.tonysheffield.com - It has been very successful with loads of great comments and it seems to be working just swell.

My main gripe was with the Tax system 1.6 used. Here in Australia we have the dreaded GST, a fairly simple tax that applies 10% to all purchases and services, final prices are always shown as "Including GST" with the GST amount listed at the bottom of receipts and invoices. Only people purchasing within Australia pay the tax.

So - I needed to be able to set the tax rate (that was easy), then set for which country people paid the tax (easy again), then set all prices to show as including the tax (this was impossible without the use of the gst/vat hack), and set the tax to show as a line item.

I'm wondering has this changed in Ubercart 2: Can I set prices to show including tax and can I hide the tax for people from certain locales?

Thanks.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: State of Tax in Ubercart 2

There's work to at least get a fix in so a hack is no longer required (like some sort of hook to alter price displays). What I'm not sure of at this point is how do your prices appear on invoices? For example, in an e-mailed invoice, would you display the product price as "Including GST"? Or on admin screens?

Also, you basically want the product prices to appear on the checkout form in the cart review table as including GST, but the line item for "Subtotal" should be the product price less the GST with a second line item for GST? If so, that argues strongly in favor of my idea of not altering the actual product price but having a display price field for product nodes...

thedecline's picture
Offline
Joined: 10/26/2008
Juice: 44
Thanks Ryan. I have here

Thanks Ryan.

I have here infront of me an invoice from Safeway/Woolworths. All items are listed with GST Included, subtotal and final total also have GST included. Just after the final total it says "Total Includes GST $1.50".

With Tony Sheffield's Invoices, each item is shown without GST and underneath subtotal we have a line item for GST bringing the total to the correct amount.

Either solution is fairly valid, although ideally the prices would be shown with gst on the invoice and all totals should include the GST, with a separate line item for "GST included"

Item prices should be the amount less the GST, so the system would add the GST automatically? Or should I add in something like the old GST module for ubercart 7b - All it did was add a line item that deduced 1/11th of the total cost and said it was GST. Simple solution, but there was no way of actually removing the tax for people that weren't liable to pay it (people from other countries...). If I could build this in with a feature that was location specific and somehow removed the 10% tax for people from overseas I could enter all prices with gst included.

Al
Al's picture
Offline
Bug FinderGetting busy with the Ubercode.Internationalizationizer
Joined: 02/14/2008
Juice: 249
Re: Thanks Ryan. I have here

The way to display all prices incl. VAT/GST is also for the EU the same.

I see several reasons to keep prices in the database w/o taxes:

  • closer to the US version (no two versions of code)
  • at least in EU afaik payment gateways want the same prices w/o taxes + taxes extra structure like in the US
  • VAT/GST support for orders can be done with a few lines of code and one field "tax_rate" per product/line-item
  • add/edit prices incl. VAT/GST can be quite easily done through hook_nodeapi and hook_form_alter

In the result I believe the product loader stuff is a major step ahead, but not for the display of taxes. A price display handler - basically what I developed in the VAT/GST thread - is far less fancy than we believed (me too).

Basically we have 4 cases in 2 groups:

  • Order: - product
  • Order: - line_items
  • "live": - product
  • "live": - line_items

Products should identify by:

  • $node->nid
  • Item price (= what we have at this point excl. taxes)
  • Qty.
  • $order_id/cart_id (optional. If available search for "tax_rate", else ask CA)

[Note why to separate Item Price and Qty.: EU taxes and afaik also Australian are calculated on a per item base. So the tax applies on the item price, then you multiply by Qty.]

Line Items by:

  • Type
  • $amount
  • $order_id (optional, see above)

The Price Display Handler's job with these data is:

  • US case: return uc_currency_format($item->price * $item->qty, ...);
    => no troubles for US stores
  • else: add the user ID
  • and if available the delivery country, defaults to the store location
  • send this to CA to modify the amount
  • for the EU comes now the real display stuff:
    prepare some kind of a suffix like "incl. 19% VAT" or the other (w/ or w/o tax) price
  • return uc_currency_format($modified_amount, ...) . $suffix
  • [Preview to the future: This would be imo the place where a true multi currency module could hook in.]

Finally we need just one line to patch in the taxes module which formula to use for the two tax modes "order based" and "item based".

thedecline's picture
Offline
Joined: 10/26/2008
Juice: 44
Re: Re: Thanks Ryan. I have here

Sounds like you really know what you are on about.

I guess because of all this it makes it really hard for AU and EU people to implement Ubercart.

Can we push for a module that would handle this, or does it really need to be implemented in the Ubercart core?

Al
Al's picture
Offline
Bug FinderGetting busy with the Ubercode.Internationalizationizer
Joined: 02/14/2008
Juice: 249
Re: Re: Re: Thanks Ryan. I have here

Dealing with tax regulations in 3 EU countries + looking around who else has the tax per item issue Eye-wink
We need a hook and more information at the level of uc_currency_format(), then it can work through a module.

thedecline's picture
Offline
Joined: 10/26/2008
Juice: 44
Extremely hacky solution

I needed GST to function in some way properly for a shop I'm launching this weekend. So I came up with this extremely hacky solution.

Basically your Sell price is the price excluding GST, and the List price is including GST. Set your theme to show list price instead of sell price and modify (dare I say it...) these ubercart core files.

uc_cart.module

// ADDS FIELD FOR LIST PRICES TO BE ACCESSED BY OTHER HACKS
line 1243
ADDED LINE:  $item->list_price = $product->list_price;

// SETS CART BLOCK TOTAL TO DISPLAY AS LIST PRICE
line 464
CHANGED FROM: $total += $item->price * $item->qty;
TO: $total += $item->list_price * $item->qty;

uc_product.module

// SETS PRICES IN CART AND CART BLOCK TO DISPLAY AS LIST PRICE
line 1096
CHANGED FROM: $element['#total'] = $item->price * $item->qty;
TO:   $element['#total'] = $item->list_price * $item->qty;

uc_cart_checkout_pane.inc

// SETS PRICES IN CHECKOUT SUMMARY TO DISPLAY AS LIST PRICE
line 562
CHANGED FROM: $total = ($item->qty) ? $item->qty * $item->price : $item->price;
TO: $total = ($item->qty) ? $item->qty * $item->list_price : $item->list_price;

That way all the cart/checkout fields except for the order preview display as list price, and the gst can be added like a normal tax and it'll show up as a line item and everything.

Although it's not quite right, traditionally in AUS we never show the price without gst, and simply put a "GST Included in Total" line item.

I guess an easier solution would be to add a module just like the GST module for 1.x that added the line item for us - but then that didn't work for multiple countries, and I don't know how to add line items, let alone ones that are there just for show...

Sorry about the hack, but perhaps we can get a proper solution for this at some stage or another...

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Extremely hacky solution

You guys should check the Issue Tracker for Ubercart more often Smiling

http://drupal.org/node/369286

--
Help directly fund development: Donate via PayPal!

thedecline's picture
Offline
Joined: 10/26/2008
Juice: 44
That's pretty cool. This

That's pretty cool.
This would allow us to build a module which calculated GST or VAT before the product was shown.

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: That's pretty cool. This

Yeah and it sounds like that would be the way to go, it'd abstract the whole bit out and allow other modules to be created for different scenarios, countries, etc. Tax can be pretty complex even just depending on the state where orders are placed in the U.S., and it seems even more complex with VAT and GST. So it looks like UC2 is on the right path. Smiling

--
Help directly fund development: Donate via PayPal!