I have a problem with the flexicharge module:
I use it to show the included tax in a order (=> the shown tax is not added to the subtotal or total sum). Because of that I marked "Display this amount as 'included', but don't add it to the subtotal."
This works fine in the shopping cart. For example:
1 Product A 5,95€ 5,95€ Change
Subtotal 5,95€
included tax 0,95€
Total 5,95€

But it does not work in the "My Account" -> "View your order history" – section:
1 Product A 5,95€
included tax 0,95€
Total 6,90€

There the included tax is added to the total, and it should NOT!

What can I do to solve that problem?

Comments

superstar’s picture

Bump - I have the exact same issue!

brmassa’s picture

Status: Active » Fixed

Guys,

it has been fixed on eC4.

regards,

massa

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

kingandy’s picture

Version: 5.x-3.4 » 5.x-3.6
Status: Closed (fixed) » Needs review

This seems to have been an oversight in the database schema. There's code in store_transaction_calc_gross() to check whether each misc line is "already added", but it looks like the "already_added" field was never actually incorporated into the database tables.

To add this field by hand on a mysql/mysqli/pgsql database you can paste the following into a PHP code area (use the Devel module, or create a new page with the PHP filter type):

  $ret = array();
  switch($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {ec_transaction_misc} ADD already_added tinyint unsigned NOT NULL default '0'");
      break;
    case 'pgsql':
      db_add_column($ret, 'ec_transaction_misc', 'already_added', 'SMALLINT', array('not null' => true, 'default' => '0'));
      break;
  }

BUT THAT'S NOT ALL - you need to modify the function store_transaction_misc_fields() to include the field as well, as otherwise it will ignore any values provided regardless of actual database structure:

function store_transaction_misc_fields() {
  return array('txnid', 'type', 'vid', 'description', 'invisible', 'price', 'qty', 'weight', 'already_added');
}

This function is in the store.module file, around line 778 in 5.x-3.6.

I realise general policy is to ignore bugs in EC3 that have been address in EC4, but the project page lists 5.x as "supported". Until that text is changed or 5.x-4.x gets a stable release (which seems unlikely as it hasn't been updated since 2008) we can't just dismiss support requests.

I'd knock up a patch, but Drupal 7 came out today so people still on 5.x (like me) need to be encouraged to upgrade...

webengr’s picture

yep, and as of today... drupal 5 is no longer supported :(