Adobe Commerce 2.4.0 B2B: wrong purchase order logic when discount expired

This article provides a patch for the known issue of a purchase order (PO) discount not being applied in Adobe Commerce 2.4.0 B2B. If the PO was placed with a discount code that expired while the PO was in the approval process, the approved order does not reflect the discount.

Affected products and versions

  • Adobe Commerce on cloud infrastructure 2.4.0
  • Adobe Commerce on-premises 2.4.0


Prerequisites: a discount coupon is created, and approval rules preventing POs from being processed automatically exist.

Steps to reproduce:

  1. Place a PO with a discount applied.
  2. Deactivate the discount coupon.
  3. Approve PO as a manager.
  4. Check the order created as a result.

Expected result:

Order is created with a discounted total.

Actual result:

Order is created for the full amount.


Apply the patch provided in this article.


The patch is attached to this article. To download it, scroll down to the end of the article and click the file name, or click the following link:


The patch is also available for download in both, .git and .composer , formats on Adobe Commerce Downloads page, under Patches in the left column navigation. Search for XXX patch.

How to apply the patch

See How to apply a composer patch provided by Adobe in our support knowledge base for instructions.