Closed
Description
After upgrading from Magento 2.3.3 to 2.4.1, we are having random broken invoice pages. After further debugging, this seems to be core issue.
Preconditions (*)
- Magento 2.4-develop
Steps to reproduce (*)
- Install clear Magento!
- Set-up tax rule for
CA
region. - Go to
Store
->Configuration
->Sales
->Tax
->Orders, Invoices, Credit Memos Display Settings
and set
Include Tax In Order Total
->Yes
;
Display Full Tax Summary
->Yes
; - Create a simple product.
- Place order with this product chose
State/Province
->California
. - Place one more order and choose any
State/Province
except forCalifornia
(to avoid taxes). - Open the second order on the admin panel and create an invoice for it.
- Open the second order again, go to the
Invoices
tab, and open the invoice.
Expected result (*)
- Invoice page loaded successfully
Actual result (*)
Additional information
file
app/code/Magento/Tax/Model/ResourceModel/Sales/Order/Tax/Collection.php
In the image above order->getId()
is actually an instance of Magento\Sales\Model\Order\Creditmemo or Magento\Sales\Model\Order\Invoice therefore getId()
will return the invoice or credit memo id instead of the order id which will send the wrong information to the SQL below.
SELECT
`main_table`.*
FROM
`sales_order_tax` AS `main_table`
WHERE
(main_table.order_id = 1)
ORDER BY
`process` ASC
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.The issue has been reproduced on latest 2.4-develop branchAffects non-critical data or functionality and does not force users to employ a workaround.
Type
Projects
Status
Done