You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The property order.taxSummary throws an error when order.lines isn't loaded. However, when you access order.taxSummary when the surcharges relation is not loaded, it will return an incomplete tax summary, where taxes of surcharges are not included, but the surcharges are included in the order totals.
To Reproduce
Steps to reproduce the behavior:
Create an order with a surcharge.
Find an order using const order = await orderService.findOneByCode(ctx, "some-code", ["lines"]);
Print the tax Summary with console.log(JSON.stringify(order?.taxSummary, null, 2));
See that the tax summary only has the taxes of order lines, not of the surcharges. This means the totals of the summary do not add up to the order total.
Looking at the code, it seems the same happens when shippingLines is missing.
Expected behavior
I would expect this to throw an error: Surcharges relation is not joined, instead of returning an incomplete tax Summary.
Environment (please complete the following information):
@vendure/core version: 3.1.3
Nodejs version 18
Database (mysql/postgres etc): mysql
The text was updated successfully, but these errors were encountered:
Describe the bug
The property
order.taxSummary
throws an error whenorder.lines
isn't loaded. However, when you accessorder.taxSummary
when thesurcharges
relation is not loaded, it will return an incomplete tax summary, where taxes of surcharges are not included, but the surcharges are included in the order totals.To Reproduce
Steps to reproduce the behavior:
const order = await orderService.findOneByCode(ctx, "some-code", ["lines"]);
console.log(JSON.stringify(order?.taxSummary, null, 2));
Looking at the code, it seems the same happens when
shippingLines
is missing.Expected behavior
I would expect this to throw an error:
Surcharges relation is not joined
, instead of returning an incomplete tax Summary.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: