Tax problem: prices are inclusive tax

Posts: 7
Joined: 02/20/2008

Dear all,

We have a problem with the Ubercart. Our client is entering his prices inclusive tax into Ubercart. At the checkout we have to exclude the tax from the product price and separate product price and taxes.

After a lot of searching, downloading, trying, ... we still don't have a good solution.

Is there anyone that can help us?

Thx

Dieter
Coworks BVBA
Belgium

Posts: 26
Joined: 02/05/2008

I have the same problem. For germany it is only useful to show product prices including tax and at checkout the total amount of taxes included. I tryed to solve this with the 'add tax to product price' contribution (http://www.ubercart.org/contrib/1532) which should be generally the right solution but this code is not working with ubercard beta5. You get a blank screen when adding a product to the cart.
Anybode a solution?

best regards
Jürgen

--

.......
brocke.de integral communication
Cologne/Germany

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

My suggestion has only sense if it goes into core, but I think there it belongs.

Targets:
- display product prices incl. VAT
- configuration in uc_store.module to turn it on/off
- uc_currency_prec: added support for .50 and .05 precision (off topic, but needed for some currencies)

These changes go into uc_store.module (beta5):

Configuration:

old (around line 1548):

<?php
  $form
['currency']['uc_currency_prec'] = array(
   
'#type' => 'select',
   
'#title' => t('Number of decimal places'),
   
'#options' => drupal_map_assoc(array(0, 1, 2)),
   
'#default_value' => variable_get('uc_currency_prec', 2),
  );
?>

new:

<?php
  $prec
= array(
   
'0' => t('No Decimals'),
   
'1' => t('One Decimal'),
   
'2' => t('Two Decimals'),
   
'.5' => t('Half Currencies'),
   
'.05' => '0.05',
  );
 
$form['currency']['uc_currency_prec'] = array(
   
'#type' => 'select',
   
'#title' => t('Number of decimal places/rounding of prices'),
   
'#options' => $prec,
   
'#default_value' => variable_get('uc_currency_prec', 2),
  );
 
$display_tax = array(
   
'0' => t('Don\'t display VAT'),
   
'1' => t('Display VAT always'),
  );
 
$form['currency']['uc_display_tax'] = array(
   
'#type' => 'select',
   
'#title' => t('Mode how to display tax'),
   
'#options' => $display_tax,
   
'#default_value' => variable_get('uc_display_tax', 2),
  );

?>

next three little functions I needed.
- uc_round(): because of this .50 Kč issue.
- uc_add_tax() is the thing we need ATM - it is simply an extract of uc_taxes.module
- uc_substr_tax() is the reverted version. I use it in a CCK field and computed field combo to add prices incl. VAT as a workaround. Could be used in core if price insert could be configured to "add prices with tax".

<?php
/**
* Round the displayed price according to the configuration.
* Supported are ATM 2 & 1 decimal, no decimal, half values
* and round on 0.05 currency units.
*/
function uc_round($value) {
 
$currency_prec = variable_get('uc_currency_prec', 2);
    switch (
$currency_prec) {
    case
'2': case '1': case '0': $round = round($value, $currency_prec);
      return
$round;
      break;
    default:
     
$prec_round = round(($value/$currency_prec), 0)*$currency_prec;
      return
$prec_round;
      break;
  }
}
/**
* As this function is just useful for inserting prices incl. tax
* the variable should be something like uc_insert_price_incl_tax
*/
function uc_substr_tax($value) {
  if (
variable_get('uc_display_tax', '0') == '1') {
   
$taxes = uc_taxes_get_rates();
    foreach (
$taxes as $tax){
     
$tax_rate += $tax->rate;
    }
   
$tax_rate++;
   
$value = $value/$tax_rate;
  }
  return
$value;
}

function
uc_add_tax($value) {
  if (
variable_get('uc_display_tax', '0') == '1') {
   
$taxes = uc_taxes_get_rates();
    foreach (
$taxes as $tax){
     
$tax_value += $value * $tax->rate;
    }
   
$value += $tax_value;
  }
 
// to avoid rounding issues with totals it is necessary already here to round.
 
$rounded_value = uc_round($value);
  return
$rounded_value;
}
?>

The $decimals thing to get a value 0, 1 or 2 in uc_currency_format() could be written different, but I would prefer that the program replaces 5.00 $ by 5,- $ and 5.5$ by 5[uc_currency_dec]50$.

In beta5 it is line 1963,
replace

<?php
  $format
.= number_format($value, variable_get('uc_currency_prec', 2), !is_null($dec) ? $dec : variable_get('uc_currency_dec', '.'), $thou ? variable_get('uc_currency_thou', ',') : '');

?>

with

<?php
  $val
= uc_round($value);
 
$test_val = (int)$val;
  if (
$val == $test_val) {
   
$decimals = '0';
  }
  else {
   
$decimals = '2';
  }

 
$format .= number_format(uc_round($value), $decimals, !is_null($dec) ? $dec : variable_get('uc_currency_dec', '.'), $thou ? variable_get('uc_currency_thou', ',') : '');
  if (
$decimals == '0') {
   
$format .= ',-';
  }
?>

This are all changes necessary to uc_store.module. The rest is to replace a couple of

uc_currency_format($value);

by
uc_currency_format(uc_add_tax($value));

By totals or subtotals I added the tax before to the items to prevent rounding issues.

Based on beta5 I found 13 places to add uc_add_tax() in 4 files:
uc_cart.module is affected 4 times:

- line 357 from
               . '<td class="cart-block-item-price">'. uc_currency_format($item->price) .'</td></tr>';
to
               . '<td class="cart-block-item-price">'. uc_currency_format(uc_add_tax($item->price)) .'</td></tr>';

- line 363 from
      $total += ($item->price) * $item->qty;
to
      $total += (uc_add_tax($item->price)) * $item->qty;

- line 1229 from     (tax can't be applied to subtotal at the end as it would produce rounding issues)
        $subtotal += $form['items'][$i]['#total'];
to
        $subtotal += uc_add_tax($form['items'][$i]['#total']);

- line 1237 from     (same as above)
        $data['total'][] = array('data' => uc_currency_format($form['items'][$i]['#total']), 'nowrap' => 'nowrap', 'class' => 'price');
to
        $data['total'][] = array('data' => uc_currency_format(uc_add_tax($form['items'][$i]['#total'])), 'nowrap' => 'nowrap', 'class' => 'price');

uc_cart_checkout_pane.inc one change:

- line 37 from
                  .'</td><td nowrap="nowrap">'. uc_currency_format($item->price * $item->qty) .'</td></tr>';

to
                  .'</td><td nowrap="nowrap">'. uc_currency_format(uc_add_tax($item->price) * $item->qty) .'</td></tr>';

uc_catalog.module one change:

- line 1138 from
          $product_table .= '<span class="catalog_grid_sell_price">'. uc_currency_format($product->sell_price) .'</span>';
to
          $product_table .= '<span class="catalog_grid_sell_price">'. uc_currency_format(uc_add_tax($product->sell_price)) .'</span>';

and finally uc_product.module 7 changes:

- line 1158 from
  return uc_currency_format($value);
to
  return uc_currency_format(uc_add_tax($value));

- line 2259 from
      $output .= t('List Price: !price', array('!price' => uc_currency_format($price)));
to
      $output .= t('List Price: !price', array('!price' => uc_currency_format(uc_add_tax($price))));

- line 2262 from
      $output .= t('Cost: !price', array('!price' => uc_currency_format($price)));
to
      $output .= t('Cost: !price', array('!price' => uc_currency_format(uc_add_tax($price))));

- line 2266 from
      $output .= t('Price: !price', array('!price' => uc_currency_format($price)));
to
      $output .= t('Price: !price', array('!price' => uc_currency_format(uc_add_tax($price))));

- line 2285 from
    $output .= uc_currency_format($price);
to
    $output .= uc_currency_format(uc_add_tax($price));

- line 2290 from
    $output .= t('Price: !price', array('!price' => uc_currency_format($price)));
to
    $output .= t('Price: !price', array('!price' => uc_currency_format(uc_add_tax($price))));

- line 2360 from
  $output .= uc_currency_format($price);
to
  $output .= uc_currency_format(uc_add_tax($price));

Sorry for the long post, but I think it is needed in more countries and as I think any site selling to end-users.

Posts: 1
Joined: 02/20/2008

"Sorry for the long post, but I think it is needed in more countries and as I think any site selling to end-users."

Thanks for your effort, I really think these or similar modifications should go into core, since we need them in most european countries.

Posts: 26
Joined: 02/05/2008

Thanks a lot!
This sounds really like the right solution because YES, this function is required by european shops.
I will try to modify my files, but: do you have your version already patched for download ?

Best regards and thx
Jürgen

--

.......
brocke.de integral communication
Cologne/Germany

Posts: 37
Joined: 01/31/2008

Please make that Core!!! all European users will

"Say thank YOU !!! and praise you ...."

Spuky

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

Thanks a lot for your support Smiling

@Jürgen: I was busy all day and need to clean up my uc_store.module a little. Will post the 5 files as soon as it is done,

Al

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

So here are the 5 patched files based on beta5 just containing the changes mentioned above.

There is one changed behavior also without configuration: 5.00€ are converted to 5,-€, which I would like to get, but this is just a suggestion.

You have to configure one or two values:
- Go to admin/store/settings/store/edit/format
- open Currency format
"Number of decimal places" has 2 additional options (e.g. Czech Republic needs half currency units)

Below is "Mode how to display tax:"
- Don't display VAT (default)
- Display VAT always

so with the second you change the display behavior for product teasers, products, cart block and cart.
Please provide me feedback if I missed other places where to display VAT, if we figure out the details our chances to bring this into core are raising!

Best regards,
Al

AttachmentSize
display_tax_beta5.zip77.61 KB
Posts: 67
Joined: 08/08/2007
Early adopter... addicted to alphas.Getting busy with the Ubercode.

This sounds like just what I've been wanting to look at for awhile. I'm in Australia and we have GST, which is probably sort of like VAT, but not as complicated. GST is supposed to be included in the price, and then on the invoice, show the amount of GST included in the price. My problem has come when thinking about discounts. The discount needs to be applied BEFORE GST is applied. I haven't had time to take a look at your solution above, I will try it out when I get the chance, but will that work with any coupons or discounts as well?

Thanks a lot for all the work on this, it has definitely been a difficult point. I tried to create a module, but there are points where I just get stuck because there are just changes I can't make through a module to get it to work.

Cheers,
Steph

Posts: 7
Joined: 02/20/2008

Wow ! This looks cool Smiling I didn't had the time to implement the code, but I'm very pleased to see a solution.

I hope to have the time to implement it today or this weekend. I'll keep you informed.

Thx a lot !

Greetz

Dieter
Coworks

Posts: 37
Joined: 01/31/2008

I am going to check that out today...

gonna report back..

Spuky

Posts: 37
Joined: 01/31/2008

It is working pretty well...
the only place where I saw the picees without VAT was on the checkout page when the cart contents are shown at the top.

Since the actual tax ammount is displayed far down in the payment part it is a little irretating..

Nice work!!! I just have to repeat my wish to get that into core as soon as Possible...

Is there any reason you put that into the currency format settings.. we might want to find a more Inuitive place for the setting maybe in the tax settings.

Spuky

Posts: 37
Joined: 01/31/2008

ssherriff wrote:
The discount needs to be applied BEFORE GST is applied. I haven't had time to take a look at your solution above, I will try it out when I get the chance, but will that work with any coupons or discounts as well?

This is a good question VAT in Germany is the same so the discount question is Important for germany too.

Spuky

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

@spuky: Thank you for your report!
About the top of the checkout page you are right, there the patch also needs to be applied.

Quote:
Is there any reason you put that into the currency format settings..

No - I needed a configuration value, so I dropped it for the moment just where I have been... The place to put it should be up to Lyle or Ryan

About coupons or discounts: This is a different topic. This little function uc_add_tax() (as I used it) doesn't change anything on the Übercart logic. It is just a configurable option if to display the taxes in certain places or not.

The input in the edit form still expects values without VAT!

For this topic (add prices incl. VAT/display prices incl. VAT on edit - but save prices without VAT) I hope to find this weekend time to write a small contribution.

@Lyle: As a module IMO this would be a big thing what could be solved in core with a few lines. You could make all Europe & Australia happy if you tell me what I have to do/change that this can go into core Eye-wink

Posts: 37
Joined: 01/31/2008

I found another Issue with your Patch that needs to be taken care of:

under the tax setings there are "Taxed Product Types" If you introduce Product Types to do diffrent tax settings for example in Germany Books are sold with 7% VAT but CD's are sold with 19%.

Your function is just adding all taxes onto the price so I end up with 26% tax added to the displayed price..

I realy wan't this to go into core but It should work as expected... so we have to figure that out really well.

Spuky

Posts: 37
Joined: 01/31/2008

after having to solve my 2 taxrates problem I investigated th module:

http://www.ubercart.org/contrib/1532 (v1.2.1

again and it is working well for me... I investigated the code and realized that is realy checkin for Product Types... and if the tax should be added to them... but in the hook_nodapi() hook
Is just checking for the node type products so I modified line: 18

if ($node->type != 'product' && $node->type != 'bucher') {

to read like this and now it is adding 7 percent on my bucher type and 19 on my products types.

does anybody know how that could be changed so that the hook_nodapi would get all the nodes that are product nodes (since omparing type is not working...)

that would make this contrib module far more usable... so maybe lyle or ryan could coment on that

Thomas

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

The way product types have been checked for a long time is

<?php
 
if (in_array($node->type, array_keys(uc_product_node_info()))){

  }
?>

However, I added a new hook to Übercart last week so you don't have to rely on that function from uc_product. (Somehow it was being called before the module was enabled, which breaks things.) The new way to do things, pending the next release, goes like this
<?php
 
if (in_array($node->type, module_invoke_all('product_types'))){

  }
?>

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

Hi,

I'm on ubercart beta 5 with my "add tax to product price" module and it works perfectly.

I forget to include the .info file, and maybe made another stupid error when I zip my file, so I did it again (oops) ^^. Let's try the last 1.2.1 version I posted and give me feedback.

Posts: 67
Joined: 08/08/2007
Early adopter... addicted to alphas.Getting busy with the Ubercode.

I'm not sure if this was just a problem I ran into with the 'add tax to product price' module or what, but I found that once you then went to the checkout screen, the tax was once again not in the price. So although it worked on the other screens, once it got to the checkout screen it showed the products without tax, and then added in the tax below. Is this still the case, or did I just have an earlier version?

Cheers,
Steph

Posts: 37
Joined: 01/31/2008

zmove wrote:
Hi,

I'm on ubercart beta 5 with my "add tax to product price" module and it works perfectly.

I forget to include the .info file, and maybe made another stupid error when I zip my file, so I did it again (oops) ^^. Let's try the last 1.2.1 version I posted and give me feedback.

Hi zmove It is working great just not if you introduce Product clases but this is just one line of code..

in the the function how uc_taxes_price_nodeapi only change from

if ($node->type != 'product') {
   return;
}

to
        if (!in_array($node->type, module_invoke_all('product_types'))){
return;
  }

since übercart has the possibility of product types with difrent tax and you module would just catch the native product ones...

but this code will only work with beta 6 or higher since see lyle's post above...

Spuky

Posts: 37
Joined: 01/31/2008

ssherriff wrote:
So although it worked on the other screens, once it got to the checkout screen it showed the products without tax, and then added in the tax below. Is this still the case, or did I just have an earlier version?

This is still the case and would be my only whish beside my above change that I have to the module right now. beside hooking the cart also hook the checkount pane...

beside that I can say your module version 1.2.1 is also working well on beta6 so far...

Spuky

Posts: 67
Joined: 08/08/2007
Early adopter... addicted to alphas.Getting busy with the Ubercode.

I think the unfortunate part is the reason why it wouldn't be working on the checkout screen is because without modifying core, it can't be done. I tried to take elements of this module and create a specialized GST module, and that is where I ran into the problem as well. I could not get it to show the product with the tax included, and just show the amount of tax included, without re-adding in the tax. I don't think there is a way to switch a line item from being calculated to being display only. Maybe I'm wrong and someone can clear this up?

This whole tax thing has really been the most difficult part for me using Ubercart. I think it is a great shopping cart but just getting it to work for Australia has been difficult. I originally wrote the GST module for very simple needs, and then tried to update it to work with the current tax system, but it just breaks at the checkout screen and I can't seem to find any way to make it work. I can't say that I know Ubercart inside and out though, so maybe there is a way to do this without modifying core, but I certainly can't figure it out. At the moment I don't have a client asking for it, so I can't pay the guys to work on it, but when I get a client in needing that functionality, I'd be willing to donate some money to the cause to finally working this issue out.

Cheers,
Steph

Posts: 26
Joined: 02/05/2008

Hi All,

I was on holiday just for one week and I'm impressed about this thread grows. Many Thanks for your answers and help. I see that this tax issue is a general problem for many unsers.

For me the version from Al (display_tax_beta5.zip) works perfect, just at the checkout-page at top the wrong price without VAT is displayed within cart-are. This may could be fixed easy.
The contribution (http://www.ubercart.org/contrib/1532) of zmove don't works in my environment. In beta5 and beta6, when I'm not logged in as an admin I only see a white screen at all on every page of my drupal. Don't know how to figure out what's wrong.

This solution of Al is really nice! Is it possible that this one goes into core? PLEASE PLEASE... Well you see, this tax-problem is a big issue for many countrys and should be included into core function as soon as possible!
I still have other bugs which are fixed in beta6 but if I want to use beta6 together with the modification from Al, I have to implement this by hand again. I don't want to use an incompatible hacked version. So anybody can give an Information if this configuration of displaying prices including VAT is going to core ? When ? It is really important and I will recommend this solution from Al because it is configurable.

Thank's and best regards from cologne/germany
Jürgen

--

.......
brocke.de integral communication
Cologne/Germany

Posts: 26
Joined: 02/05/2008

I've found another general bug in tax calculation. Currently Ubercart calculates the Total amount with the formula [Total = (Productprice1 + Productprices2 + ... ) + Tax]. This is wrong and should be [Total = (Productprice1 + Tax1) + (Productprice2 + Tax2) + ....]. Because of this error, the total amount of ordering x products is not always x * Productprice becaus of rounding errors. See this thread for details:
http://www.ubercart.org/issue/3020/tax_wrong_calculation_when_shipping_c...

best regards
Jürgen

--

.......
brocke.de integral communication
Cologne/Germany

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

So the real problem is that there is more than one time to round the tax amount. Übercart is actually calculating the tax per product, but it doesn't round the total amount until the end.

I'm reluctant to change anything yet. If working on Übercart has taught me anything, it's that everybody does taxes differently.

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

Yes, full agreement with what Jürgen tells, the European way is to calculate taxes per product. And if you try to support currencies like the Czech koruna, which is counted in half units, the difference is nearly on every order a couple of full currency units.

In my little wild shot in the dark more up in this post I still had no idea about how workflow-ng and uc_taxes are working now. Now I already understand what I still don't understand. I think I can figure it out, just time is a little rare ATM... But I am willing to help to solve this topic.

@Lyle: Could you point me into a direction what would help you? This topic is really serious for us in Europe.

Posts: 26
Joined: 02/05/2008

Lyle wrote:
So the real problem is that there is more than one time to round the tax amount. Übercart is actually calculating the tax per product, but it doesn't round the total amount until the end.

Yes thanks Lyle - That's the problem! But this is an general issue for every country. With current tax calc, a customer totally will pay different invoice amounts if he buy a product in an amount of 2 in one order or if he buy a product twice in two orders!!
That should be fixed as soon as possible. Taxes have to be rounded per product always!
The other part, how to display taxed product prices, can be done with the solution described by AL e.g.

--

.......
brocke.de integral communication
Cologne/Germany

Posts: 8
Joined: 02/11/2008

I have the patched Al display tax from beta5 to beta6. Please see enclosed file.
I also patch the checkout so it display the tax as well. Please test if there is missing anything else.

AttachmentSize
display_tax_beta6.zip77.55 KB
Posts: 924
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

In the US, the proper way to calculate tax is to apply the rate to the order total (as is currently done), NOT to each item individually. If there are different requirements in Europe, perhaps the best thing to do is modify uc_taxes to offer a menu option on the form at admin/store/settings/taxes/edit to select how the tax is applied.

--

<tr>.

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

This will be part of display_tax_beta7 as both ways are needed.

I am not a professional coder, so on another point I would need some support:

workflow_ng_invoke_event('calculate_tax_'. $tax->id, $order, $tax, $account, array());

Could somebody please list me just the required steps to turn this from $order base to $node?
The condition to get me started would be to compare variable 'uc_store_country' with the tax country condition.

Yes, I was reading the handbook pages up and down, tried to create events, conditions and whatever I founded in ubercode and yes, I don't understand it.

But it seams possible, as even if I just manipulate $order it is working - except ignoring the conditions - so all taxes are applied and even checkout is not messed up.

Whoever takes the time to give me a direction - a biiiig thank you in advance!

Posts: 26
Joined: 02/05/2008

Al wrote:
This will be part of display_tax_beta7 as both ways are needed.

I am not a professional coder, so on another point I would need some support:

workflow_ng_invoke_event('calculate_tax_'. $tax->id, $order, $tax, $account, array());

Could somebody please list me just the required steps to turn this from $order base to $node?
The condition to get me started would be to compare variable 'uc_store_country' with the tax country condition.

Yes, I was reading the handbook pages up and down, tried to create events, conditions and whatever I founded in ubercode and yes, I don't understand it.

But it seams possible, as even if I just manipulate $order it is working - except ignoring the conditions - so all taxes are applied and even checkout is not messed up.

Whoever takes the time to give me a direction - a biiiig thank you in advance!

Same same Smiling Yes, that what I need! I would be very thankful if anybody can tell me how to change calculation of taxes by $node. (taxes should be calculated for every tax-rate by node first and than added to total tax).
I think in uc_taxes.module around line 420 in

function uc_taxes_calculate($order)
...
  foreach ($taxes as $tax){
    // Gotta pass a fake line_item entity for the data to be saved to $_SESSION.
    workflow_ng_invoke_event('calculate_tax_'. $tax->id, $order, $tax, $account, array());
    //$order->line_items[] = array('type' => 'tax', 'amount' => $_SESSION['taxes'][$tax->id]['amount']);
  }

there should be changed the calculation of order by an iteration over all nodes within that order.

But I'm also not a coder...

thank you in advance!
Jürgen

--

.......
brocke.de integral communication
Cologne/Germany

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

So at least I am still not conpletely alone Smiling

We first should get the prices display right as this is the issue which brings us in conflict with laws. There are more places to change for tax calculation, but this is solvable.
Today I give "Add tax to product price" another try to spice it up with product types, tax conditions and - deciding - if I am now finally able to address all required places what I didn't manage on my first try. Hope to solve this topic this week.

Best regards
Al

P.S.: Some helping hand with workflow_ng_invoke_event() would be still greatly appreciated Smiling

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

Just one thing that popped up in my brain this morning...

Maybe it is possible to add a tax integration with workflow on viewing product event.

and the administrator would choose to add the tax to the product price, and add custom conditions as to check the user role or watever...

Posts: 10
Joined: 03/25/2008

Dear people,

Thank you all for your work on this.
I really love the synergy between Drupal and Ubercart!

I am a new user of Ubercart and this VAT (BTW) issue is the only reason I haven't activited my Dutch shop yet.

As I am new to this, please don't kick me too hard when I ask stupid questions.

I use ubercart-5.x-1.0-beta7 and I need two things:

- Be able to choose a tax rate per product (19%, 6% and 0%).
- Show prices including the right VAT amount.

Can you please let me know the right combination of files I need (to download or edit)? Or will there be a complete 'patchfile' or something?

Thank you for helping me out on this one!

Posts: 37
Joined: 01/31/2008

using the contrib of zmove

and changing the folowing:

in the the function how uc_taxes_price_nodeapi only change from

if ($node->type != 'product') {
   return;
}

to
        if (!in_array($node->type, module_invoke_all('product_types'))){
return;
  }

since übercart has the possibility of product types with difrent tax and you module would just catch the native product ones...

- now define 3 Product types...
- under the tax settings create 3 tax rates and asign them to the product types..

now you should be mostly done the only thing missing is that the cart view on the checkout page is not updated..

but others report that it is returning white pages (most times sign of low mem...)

that is my solution which works on my server...(still not online german shop)

Posts: 10
Joined: 03/25/2008

I did install this version:

Add tax to product price zmove Module Work in progress
Products | Orders | Invoices | Display 03/11/08

The tax rates I found on this page:
admin/store/settings/taxes
I filled them with hopefully the approriate values.
19% BTW 19% product, product_kit shipping 0
6% BTW 6% product, product_kit shipping 0

The I have to go to:
admin/build/workflow-ng
The only values I filled in:
19% BTW Calculate 19% BTW uc_taxes
6% BTW Calculate 6% BTW uc_taxes

I can't figure out how to set the Product Types and asign the tax to them.

I feel real stupid that I cannot find this... sorry..

Posts: 37
Joined: 01/31/2008

admin/store/products/classes

here ad a new class / produkt type...

now when you edit your tax rates under :

admin/store/settings/taxes

you can define taxed Product classes..

yes it is not easy to figure that out..

be aware that you can't move Products between classes (at least not in the interface of course it is possible in the DB) which is a bummer when the only difference is the tax rate and you already have them in your shop ....

Posts: 10
Joined: 03/25/2008

Thanks for the Classes, found it and now I know it, this part seems pretty obvious.

Just for the people who start looking for a file uc_taxes_price_nodeapi (just like I did in the beginning).

The small change I have to made to: uc_taxes_price_nodeapi can be found in the module uc_taxes_price.
Look for the file uc_taxes_price.module . In this file search for uc_taxes_price_nodeapi.

The next step would be to add a new product. You should see the new product types (in my case 19%, 6%, and 0%).

Just my small piece of help for the people who want to use this important change for Europe.

Posts: 3
Joined: 04/02/2008

Hello to all,

Being an European, I'm having the above problems regarding VAT and foreign countries which I'm trying desperately to solve. This forum has helped me to shed some light over this matter and to realise that I’m not the only one with this problem.

I’m using Drupal 5.3 and Übercart 5.x-1.0-beta7.

So far I’ve downloaded and installed display_tax_beta6.zip.

To finish the patching I need to change the function “uc_taxes_price_nodeapi” in “uc_taxes_price.module”. Well, I’ve searched the entire distribution for this file but it’s nowhere to be found…

Can anyone help me with this?

Thanks!

Sbit

--

Sbit

Posts: 84
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

Hello Sbit,

first: display_tax_beta6.zip was a couple of changed files of Übercart 5.x-1.0-beta6 and it was not meant to work together with the contribution "Add tax to product price", so probably it will break things with beta7. This solution like I told would have been only the way if it would have gone to core.

So upload Übercart 5.x-1.0-beta7 once more ore wait a few days, as I think rc1 is nearly out of the door.

The discussion about "uc_taxes_price_nodeapi" is about the above mentioned contribution: http://www.ubercart.org/contrib/1532 Version 1.2.1 is quite old and has a couple of known bugs, but it is a starting point with the hack above. Also the attached files of http://www.ubercart.org/contrib/1532#comment-15562 contain some improvements.

All of these solutions still don't address the issue of European per product tax calculation! (A rounding issue) Just that you know about.

Another possibility is in a few days available as I will publish my module how to get things working for Europe.

Best regards,

Al

Posts: 28
Joined: 10/17/2007

Why price inclusive?
Would you mind sharing a bit more about the situation?
LIke are you saying:
- He enters 100 for the price
- At checkout you need to show 90 for the price, and 10 in taxes
Or something like that?

Posts: 3
Joined: 04/02/2008

Hello Al,

Thanks for your prompt reply.
I'm in love with Drupal and Übercart, the whole thing feels "right"! You know? Smiling
I can't compare it with anything else and I sense that this project will soon become one of the major Internet projects of our days. It surely has that much potential.

I'll be waiting for that rc1 version of Übercart like a child waits for Xmas!

Once again, thank you for your support.

--

Sbit

Posts: 10
Joined: 03/25/2008

Over here I still am not 100% complete with the tax thing for Europe Smiling.

I would also love to see Santa bringing some presents early Sticking out tongue

I am sure the Drupal Ubercart combination has incredible more potential than most other Online Shop script.

Thank you all for making this work in near future!

Posts: 10
Joined: 03/25/2008

This would be a great for all European E-shops.

Is there any news on this?
A lot of buyers in Europe want to see prices including VAT / TAX / BTW. It would be great to be able to switch this on... Smiling.

Please keep us updated!

Posts: 13
Joined: 04/13/2008

I really butchered the e-commerce module to get this feature - so much so that I'm unable to upgrade the site from 4.6 and thanks to my less-than-capable coding, the cart has inconsistent billing!

Really hoping that this can be rolled out soon as I want to rework the site using Ubercart!

Posts: 9
Joined: 04/18/2008

Of course, to get the attributes showing correct tax, there are three lines in uc_attribute.module with the function uc_currency_format() where the uc_add_tax() function has to be inserted.

Line 725
'#value' => $option ? ($option->name .' ('. uc_currency_format(uc_add_tax($option->price)) .')' ) : t('n/a'),

Line 1473
$display_price = ', '. uc_currency_format(uc_add_tax($node->sell_price + $option->price) * $qty);

line 1478
$display_price = ($option->price != 0 ? ', '. ($option->price > 0 ? '+' : '') . uc_currency_format(uc_add_tax($option->price) * $qty) : '');

EDIT:
For those who want the ubercart_rc2 versions try this:

AttachmentSize
display_tax_rc2.zip85.09 KB
Posts: 22
Joined: 08/20/2007

Maybe I looked over, but is there any solution for 'entering the prices inclusive tax'. In most countries I think shops give round prices, like €20 or €19,90. Then it ´s very handy.

And I ´m also interested in the following:
The prices are already added, until now I don´t need to pay taxes. But in the future I need to pay taxes.
From then I want to display the same prices, I already submitted. But then inclusive taxes.

Somebody know how I can solve this...

Thanks.

Posts: 7
Joined: 05/29/2008

The minimum order subtotal for checkout is not considered if you add a VAT tax, it still considers the real value and not the "apparent value"