Add a subtotal without tax before adding the tax

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi there,

I'm coming with my new 2$ ideas but today,

When you enable the tax module, it should be good to show the subtotal without tax before adding a tax. In addition, it should be good to show the rate of the tax near his name.

I believe that showing the subtotal before adding tax is required in europe (not sure) but, in all case, it's a good feature to implement to provide to customer an easy to understand order payment.

zmove

Posts: 144
Joined: 08/14/2007
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer

You're absolutely right zmove Smiling Showing the subtotal before adding tax is required on most of the european countries.

I think this would be a good (and fairly easy) improvement Smiling

______________
Best regards,
Thomas Kulvik
Ny Media AS
www.nymedia.no

Posts: 2271
Joined: 08/07/2007
AdministratoreLiTe!

I like this idea. I think there should be a way for any line_item type module to put a Subtotal line before it's own. Ryan may have some ideas about how to do that.

Posts: 329
Joined: 08/28/2007
Early adopter... addicted to alphas.Not KulvikTheminator

If this hasn't already been done +1 for it.

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

I didn't see the modification in alpha 7e... It is planed for the beta version ?

thanks

zmove

Posts: 5378
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Added to my feature requests list, but I can't promise I'll be able to get to it.

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

I'm poping up the thread because no more news about this feature Eye-wink

It is still planed ?

Posts: 5378
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I still have it in my "feature requests" folder, but unfortunately it's non-essential for me at the moment. I will be moving onto the line items API before too long. Smiling

Posts: 108
Joined: 10/31/2007
Getting busy with the Ubercode.

I would like to add more preasure to this question Cool

This questions are essential for european users (at least on euro area) which I would say is a pretty big market Eye-wink for something that is relatively small Smiling

Posts: 6
Joined: 12/08/2007

We are trying to spread UC but without this it's pretty hard.

Thanks in advance for your help & time

Posts: 5378
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Can someone do a mock-up to help me understand? In my test sites, the subtotal is usually the only line before tax anyways, so it seems like it's always the "subtotal before tax." I'm guessing you're looking for something w/ discounted items, but I thought you still had to pay tax on the pre-discounted price. Maybe not? Puzzled

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

This is the current Ubercart behavior about line item :

Subtotal : 45$
Discount : -10$
Shipping : 5$
Taxe : 8.43$
Total : 48.43$

This is non correct for european shop, because before adding the Tax, you need to specify the amount that serve to calculate it, so it should be like this.

Subtotal : 45$
Discount : -10$
Shipping : 5$
Subtotal excluding tax : 40$
Taxe : 8.43$
Total : 48.43$

So we need to specify the amount that serve to calculate the tax, it's easy to find it just by make simple calculation, but this is the law, this line have to be mentionned before tax. In invoice too

Posts: 5378
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

My perspective, then, is that this would have to be included in the tax module and should be made optional for stores that don't require it. (For example, stores that have no shipping, no discount, or simply don't want the subtotal there.)

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Yes, I think it should be a configurable option of the tax module too.

Posts: 6
Joined: 11/19/2007

with the last working version of the discounts contrib given by detour here
http://www.ubercart.org/contrib/143#comment-8611

Not only it isn't clear but incorrect too :

it shows this in cart checkout :

Subtotal: 115,70€
Discount: -20,50€
VAT : 24,30€ // it's a tax rule named "VAT" (21%, Belgium)
Total : 119,50€

which is very wrong because the 21% VAT has to be calculated on the discounted price, like this :

Subtotal: 115,70€
Discount: -20,50€
(Subtotal : 95,20€)
VAT : 19,99€ // which is the good 21% of 95,20 and not 115,70
Total : 115,19€

How can i tweak the discount module (as provided by detour)
to apply discounts and add line item BEFORE the tax module does his job in the checkout.

Lyle talked about the fact that the discount module was not doing its main things in the good op case of its checkout_pane hook ( it does things in 'review' , maybe it should do in 'process' )
It's maybe a clue. I really don't know and I'm stuck with this incorrect behaviour.

The discount module does a uc_order_line_item_add() in uc_discounts_order() but I believe i's too late because the uc_taxes module cannot take it into account then .

Any help GREATLY appreciated. thanks.

drupal 5.5, ubercart alpha8, discounts 20071210.

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Yes the discount module is not compatible with the tax module. I see this problem some month ago, and, as I had no time to maintain the discount module, I abandonned the idea.

If it was coded with the ubercart way, you should have a discount checkbox in your tax module to condiser discount when applying a tax. Maybe it's the case with all module improvement made in the module reply.

If not, you need to make some PHP to make it compatible Smiling but it's not a tax or a subtotal display problem, the problem come from the discount module.

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

As my client ask me to add this feature very quickly on his store, I tried on the hack of core tax module to implement this function.

in uc_taxes_javascript(), I added some lines :

<?php
  $taxes
= uc_taxes_calculate($order);
   
$total = uc_order_get_total($order);
     
$taxes[] = array(
       
'id' => 'taxes_subtotal',
   
'name' => t('Taxes subtotal'),
   
'amount' => $total,
   
'weight' => 8,
      );
?>

My goal ATM is to test where to implement in this subtotal in the code, I will take care admin options later. My problem is that this code works, the line item is successfully added to the line item, but the subtotal take care of this line.

So I'm asking about some opinions : what is the best way to don't take care of this subtotal ? DO I have to hack the order module to say to total calculation function to don't add the 'taxes_subtotal' line item or is there a better solution ?

Posts: 2271
Joined: 08/07/2007
AdministratoreLiTe!

Got to looking at this problem and ended up fixing a couple others as well.

The tax module now adds a subtotal line before the taxes, but only if there are taxes and other line items. I had to modify the payment module so it wouldn't add this subtotal into the order total on the checkout preview.

All these changes are available in the bazaar repository.