Product Tax for single California location

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
xarga
Posts: 43
Joined: 16 Dec 2019, 22:54

Product Tax for single California location

Post by xarga » 09 Apr 2020, 01:10

Aimeos V 2019.10 and PHP 7.2 Linux (Dev environment Aimeos V 2019.10 and PHP 7.2 Windows 10 / Xampp)

Some products in my location are taxable, others are not - but typically they are never "included" in the retail price.
Items need to be shown in the basket without tax followed by a Subtotal, then tax (the cumulative tax amount) and then tax + subtotal as the final TOTAL.

After adding tax percentages for some taxable products and then adding them to the basket, my basket currently shows - for example:

Code: Select all

3 articles	Total	$ 53.00
Incl. 7.75% VAT	         $ 3.81
The cumulative tax amount for all products in the basket needs to be shown as separate line item after the products and product Subtotal and before the final total. Like so:

Code: Select all

3 articles  Subtotal         $53.00
Tax                          $ 3.81
Total	                    $ 56.81
I have tried playing around with the config settings

Code: Select all

'mshop' => [
        'price' => [
                'taxflag' => 0,
            ],
	],
but there is no difference whether I set 'taxflag' to 0 or 1

I ended up hardcoding the value in ext/myshop/client/html/templates/common/sumary/detail-standard.php

Code: Select all

<?php //MOD RMP - Hard Coded Tax Flag (Not working from shop.php)
        $priceTaxflag = false;
        if( $priceTaxflag === true ) : ?>
			<tr class="total">
				<td colspan="3"></td>
				<td class="quantity"><?= $enc->html( sprintf( $this->translate( 'client', '%1$d article', '%1$d articles', $totalQuantity ), $totalQuantity ) ); ?></td>
				<td><?= $enc->html( $this->translate( 'client', 'Total' ) ); ?></td>
				<td class="price"><?= $enc->html( sprintf( $priceFormat, $this->number( $this->summaryBasket->getPrice()->getValue() + $this->summaryBasket->getPrice()->getCosts(), $precision ), $priceCurrency ) ); ?></td>
				<?php if( $modify ) : ?>
					<td class="action"></td>
				<?php endif; ?>
			</tr>
		<?php endif; ?>
(I thought that had been fixed in the 2016 release?)
Am I missing something here?

User avatar
aimeos
Administrator
Posts: 7924
Joined: 01 Jan 1970, 00:00

Re: Product Tax for single California location

Post by aimeos » 09 Apr 2020, 15:42

This is correct because then, all prices you've added in the backend are treated as net prices:

Code: Select all

'mshop' => [
        'price' => [
                'taxflag' => 0,
            ],
	],
]
The difference is in the way the tax is then displayed in the basket, during the checkout process and in the order (incl. tax vs. +tax). Maybe your template isn't up to date with the official one regarding how to show taxes:
- https://github.com/aimeos/ai-client-htm ... #L123-L134
- https://github.com/aimeos/ai-client-htm ... #L361-L407

BTW: There's also a basket plugin in the 2020.x release where you can set tax rates depending on the country and state:
https://github.com/aimeos/aimeos-core/b ... xrates.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply