magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.47k stars 9.28k forks source link

[Issue] Fix: The Credit Memo Items' base_weee_tax_applied_row_amnt Value is Incorrect #38765

Open m2-assistant[bot] opened 3 months ago

m2-assistant[bot] commented 3 months ago

This issue is automatically created based on existing pull request: magento/magento2#38760: Fix: The Credit Memo Items' base_weee_tax_applied_row_amnt Value is Incorrect


The setBaseWeeeTaxAppliedRowAmnt() function should be used instead of setBaseWeeeTaxAppliedRowAmount, as the database table field name is base_weee_tax_applied_row_amnt. Due to this error, the value of the sales_creditmemo_item.base_weee_tax_applied_row_amnt database column is always set to the order item value, which is incorrect.

Manual testing scenarios (*)

  1. Backend: Create a product with a $50 Fixed Product Tax (FPT).
  2. Frontend: add 5 quantities of this product to your cart.
  3. Frontend: Make sure that the FPT are applied and place the order.
  4. Backend: Create a credit memo for only a single quantity.

Expected Result: Since only a single quantity was credited, the values saved in both the sales_creditmemo_item.base_weee_tax_applied_amount and sales_creditmemo_item.base_weee_tax_applied_row_amnt columns should be 50.

Actual Result: The values saved in the sales_creditmemo_item.base_weee_tax_applied_amount is 50 and sales_creditmemo_item.base_weee_tax_applied_row_amnt columns is 250 (5x 50).

Questions or comments

A developer must look at the base_weee_tax_applied_row_amnt column of the sales_creditmemo_item database table in order to confirm the result.

Contribution checklist (*)

m2-assistant[bot] commented 3 months ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Delta commented 3 months ago

Hi @nicolasddev ,

Verified the issue on 2.4-develop, it is reproducible.

Hence, Confirming the issue.

Preconditions:-

1.Enable Fixed Product Tax in Magento Admin 2.Create FPT Product Attribute 3.Add FPT Tax Attribute to Attribute Set 4.Configure FPT Tax per Product 5.In Admin > Stores > Configuration > Sales > Tax > Shopping Cart Display Settings > Display Full Tax Summary = Yes and in the other section "Orders, Invoices, Credit Memos Display Settings"

Steps to reproduce:-

1.Backend: Create a product with a $50 Fixed Product Tax (FPT). 2.Frontend: add 5 quantities of this product to your cart. 3.Frontend: Make sure that the FPT are applied and place the order. 4.Backend: Create a credit memo for only a single quantity.

**Actual Result:

The values saved in the sales_creditmemo_item.base_weee_tax_applied_amount is 50 and sales_creditmemo_item.base_weee_tax_applied_row_amnt columns is 250 (5x 50).**

product created

Screenshot 2024-05-30 at 4 11 58 PM

FPT added

Screenshot 2024-05-30 at 4 12 08 PM

5 quantities added to cart

Screenshot 2024-05-30 at 4 16 45 PM

cart

Screenshot 2024-05-30 at 4 27 24 PM Screenshot 2024-05-30 at 4 30 47 PM

placed order

Screenshot 2024-05-30 at 4 31 07 PM

order on admin

Screenshot 2024-05-30 at 4 32 28 PM

credit memo created

Screenshot 2024-05-30 at 4 36 20 PM

credit memo details

Screenshot 2024-05-30 at 4 36 32 PM

memo saved

Screenshot 2024-05-30 at 4 37 02 PM

Database: on sales_creditmemo_item tabel value for base_weee_tax_applied_row_amnt columns is 250 (5x 50).

Screenshot 2024-05-30 at 5 02 19 PM
github-jira-sync-bot commented 3 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12049 is successfully created for this GitHub issue.

m2-assistant[bot] commented 3 months ago

:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.