Closed
Description
There are a lot of preconditions. I don't know which is the one that eventually causes the rounding difference, so bear with me.
Preconditions
- Magento CE develop branch
- Create a product with a price of 5.99
- Set the shipping cost of flat rate to 5.95 per order
- Assign shipping costs to the tax group 'taxable goods'
- Set the tax amount to 21%
- Create a cart rule that gives 1.50 discount per item
- Set the following tax config settings:
INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`)
VALUES
(88, 'default', 0, 'tax/classes/shipping_tax_class', '2'),
(89, 'default', 0, 'tax/calculation/cross_border_trade_enabled', '0'),
(90, 'default', 0, 'tax/defaults/postcode', NULL),
(91, 'default', 0, 'tax/calculation/algorithm', 'TOTAL_BASE_CALCULATION'),
(92, 'default', 0, 'tax/calculation/based_on', 'origin'),
(93, 'default', 0, 'tax/notification/ignore_discount', '0'),
(94, 'default', 0, 'tax/notification/ignore_price_display', '0'),
(95, 'default', 0, 'tax/notification/ignore_apply_discount', '0'),
(96, 'default', 0, 'tax/calculation/price_includes_tax', '1'),
(97, 'default', 0, 'tax/calculation/shipping_includes_tax', '1'),
(98, 'default', 0, 'tax/calculation/apply_after_discount', '1'),
(99, 'default', 0, 'tax/calculation/discount_tax', '1'),
(100, 'default', 0, 'tax/calculation/apply_tax_on', '0'),
(101, 'default', 0, 'tax/defaults/country', 'NL'),
(102, 'default', 0, 'tax/defaults/region', '0'),
(103, 'default', 0, 'tax/display/type', '2'),
(104, 'default', 0, 'tax/display/shipping', '2'),
(105, 'default', 0, 'tax/cart_display/price', '2'),
(106, 'default', 0, 'tax/cart_display/subtotal', '2'),
(107, 'default', 0, 'tax/cart_display/shipping', '2'),
(108, 'default', 0, 'tax/cart_display/grandtotal', '0'),
(109, 'default', 0, 'tax/cart_display/full_summary', '0'),
(110, 'default', 0, 'tax/cart_display/zero_tax', '1'),
(111, 'default', 0, 'tax/sales_display/price', '2'),
(112, 'default', 0, 'tax/sales_display/subtotal', '2'),
(113, 'default', 0, 'tax/sales_display/shipping', '2'),
(114, 'default', 0, 'tax/sales_display/grandtotal', '0'),
(115, 'default', 0, 'tax/sales_display/full_summary', '0'),
(116, 'default', 0, 'tax/sales_display/zero_tax', '1');
INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`)
VALUES
(117, 'default', 0, 'shipping/origin/country_id', 'NL'),
(118, 'default', 0, 'shipping/origin/region_id', NULL),
(119, 'default', 0, 'shipping/origin/postcode', NULL),
(120, 'default', 0, 'shipping/origin/city', NULL),
(121, 'default', 0, 'shipping/origin/street_line1', NULL),
(122, 'default', 0, 'shipping/origin/street_line2', NULL);
INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`)
VALUES
(8, 'default', 0, 'currency/options/base', 'EUR'),
(9, 'default', 0, 'currency/options/default', 'EUR'),
(10, 'default', 0, 'currency/options/allow', 'EUR');
Steps to reproduce
- Buy the product of 5.99 with a quantity of 10
- Go to the cart. Verify that the subtotal is €59.90, the discount is -€15.00
- Click 'estimate shipping and tax' in the cart summary
- Pick the shipping method of €5.95. I had to select Netherlands as country.
- Verify that the shipping total is €5.95 and the tax total is €8.65
- Verify that the order total is €49.85
- Place the order
- Create an invoice
SELECT order_id, grand_total, base_grand_total from sales_invoice WHERE order_id=5;
Expected result
- This outcome:
order_id | grand_total | base_grand_total |
---|---|---|
5 | 50.8500 | 50.8500 |
Actual result
- This outcome
order_id | grand_total | base_grand_total |
---|---|---|
5 | 50.8500 | 50.8600 |
The base_grand_total is one cent too high.