πŸ‡©πŸ‡ͺGermany @Greenhorn

Account created on 17 February 2018, over 6 years ago
#

Recent comments

πŸ‡©πŸ‡ͺGermany Greenhorn

Hello,
I would like to address this problem here again, even though it was a long time ago.
First of all, I would like to thank you, the developers, because anyone can complain but it is always difficult to provide constructive solutions. I would like to help find solutions, but I don't know where to start right now.

Nevertheless the problem still exists. If there is already a patch that I haven't considered, please let me know.

We created a shop with Drupal commerce 8.x-2.38.
The prices in the shop have all been set to include tax.
Now we have the problem that when ordering several products, the tax is not calculated correctly.
We have noticed that the tax is calculated per order item and then added up.
This is not a problem for smaller orders but for multiple items the tax becomes inaccurate.

Here is a simple example with a tax of 7%:
One item costs €4.20 including 7% tax
So the calculation of the tax is:
(4.20 / 107) * 7 = 0.2747... rounded = 0.27, is ok

but for 5 items with the price of 4.20 including tax of 7%
the correct calculation would be:
5 x 4.20 = 21.00
Tax:
(21.00 / 107) *7 = 1.3738... rounded = 1.37 is ok

Since you calculate the tax per order item and then add it up, you get the following tax:
(4.20 / 107) * 7 = 0.2747... rounded = 0.27

0.27 x 5 = 1.35 and that is not correct in a tax country like Germany ;)

Is it possible to create a new property that contains the following per order:
Total tax per tax rate (7%, 19%, .... depending on the settings) only based on the order items and depending on whether tax is included or not.
These values should also be saved in the order as total tax, if that is possible.

Thank you very much and we look forward to a constructive exchange

πŸ‡©πŸ‡ͺGermany Greenhorn

Can confirm that this patch is needed to fix a bug in combination with Drupal Commerce. I could not delete order items from order because of this error:

InvalidArgumentException: Field 0 is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (Zeile 587 in /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Patch #9 was really helpful and issue was resolved. thank you @dhirendra.mishra!

πŸ‡©πŸ‡ͺGermany Greenhorn

It works now. We think that having the SDC module now included in Core from Drupal 10.1, you have to follow another process.

we did following steps to make it work:

at first we have disabled following modules:
- sdc:^2.0@alpha
- sdc_examples
- cl_server:^2.0@beta

after that you also can remove entirely following module:
- sdc:^2.0@alpha

Then enable the Core SDC module and cl_server:^2.0@beta,

Now setting up the Storybook works well following these instructions:
https://git.drupalcode.org/project/cl_server/-/blob/2.x/docs/storybook.md

Please note that from Storybook 7 onwards in the ".storybook/main.js"
select only one format. This is also well described in the sdc_examples module in the Readme.md

stories : [
     "../web/themes/**/*.stories.@(json|yml)"
   ],

use

stories : [
     "../web/themes/**/*.stories.yml"
    ],

Many thanks to the developers!

Production build 0.69.0 2024