Skip to content

[GraphQl 2.4.2] subtotal_with_discount_excluding_tax is calculated using discount including tax #33905

Closed
@Hexmage

Description

@Hexmage

Preconditions (*)

  1. Magento 2.4.2
  2. tax/calculation/price_includes_tax = including tax
  3. tax/calculation/apply_after_discount = after discount
  4. tax/calculation/discount_tax = including tax

Steps to reproduce (*)

  1. Create a cart and add a product that's worth 1000 (incl tax) with a tax% of 25%.
  2. Set a discount on the cart for 10.
  3. Do the following graphql request
query getCartDetails($cartId: String!) {
	cart(cart_id: $cartId) {
                 prices {
			applied_taxes {
				amount {
					value
				}
			}
			discount {
				amount {
					value
				}
			}
			subtotal_including_tax {
				value
			}
			subtotal_excluding_tax {
				value
			}
                        subtotal_with_discount_excluding_tax {
				value
			}
			grand_total {
				value			
                        }
		}
	}
}

Expected result (*)

{
    "data": {
        "cart": {
            "prices": {
                "applied_taxes": [
                    {
                        "amount": {
                            "value": 198
                        }
                    }
                ],
                "discount": {
                    "amount": {
                        "value": -10
                    }
                },
                "subtotal_including_tax": {
                    "value": 1000
                },
                "subtotal_excluding_tax": {
                    "value": 800
                },
                "subtotal_with_discount_excluding_tax": {
                    "value": 792
                },
                "grand_total": {
                    "value": 990
                }
            }
        }
    }
}

"subtotal_with_discount_excluding_tax" should be 1000 - 10 - 198 = 792
Which is same as 800 (Sub total) - 8 (Sub total discount) = 792

Actual result (*)

{
    "data": {
        "cart": {
            "prices": {
                "applied_taxes": [
                    {
                        "amount": {
                            "value": 198
                        }
                    }
                ],
                "discount": {
                    "amount": {
                        "value": -10
                    }
                },
                "subtotal_including_tax": {
                    "value": 1000
                },
                "subtotal_excluding_tax": {
                    "value": 800
                },
                "subtotal_with_discount_excluding_tax": {
                    "value": 790
                },
                "grand_total": {
                    "value": 990
                }
            }
        }
    }
}

UI Issue: Payment Breakup details sum is not matching with Grand Total.
800 - 10 + 198 = 988 but not 990

image


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

Area: Cart & CheckoutArea: PricingComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReported on 2.4.2Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions