Prestashop: Invoice - the Discounts block is missing in the first invoice created

Created on 20 Apr 2020  路  3Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

When this PR: https://github.com/PrestaShop/PrestaShop/pull/18544 is merged in the branch 1.7.7.x
We will have a different issue comparing 1.7.6 and 1.7.7.x, in fact when we add a new product to an old order with creating a new invoice and selecting free shipping, the Discounts block is missing in the first invoice created

Expected behavior

The Discounts block should be added to the first invoice.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create order from the FO with a carrier not free, for example in the FO => checkout page => Step3 => select My carrier as a shipping method
  2. In the BO => Orders Views page => Order status is payment accepted
  3. Add a new product with creating a new invoice with selecting Free shipping
  4. a new discount is created => ok
  5. if you check the first invoice created by changing the order status, the Shipping Costs became "Free shipping" => OK, but there is a block is missing, the Discounts block is missing in the first invoice.

Screenshots

1.7.7.x =>
image

1.7.6.4 =>
image

Additional information

  • PrestaShop version: 1.7.7.x
  • PHP version: 7.2
1.7.7.x BO Bug Discounts Fixed Invoices Minor Order Regression migration

All 3 comments

To be reproduced when https://github.com/PrestaShop/PrestaShop/pull/18544 is merged.
Ping @PrestaShop/prestashop-product-team this issue should be added to the Project 1.7.7 as it is regression, is it?

Thanks!

@khouloudbelguith @colinegin @PrestaShop/prestashop-product-team

While attempting to fix this, I found where it comes from in the code, but it doesn't look like a bug, it seems like it was done on purpose, here is what is written as a comment in the code removing this block:

We're not interested in displaying the shipping discount as it is already shown as "Free Shipping".

So, should I cancel this and display the discount block even if it's only a free shipping discount?

I can do that, I just wanted to warn you before doing it.

hi @khouloudbelguith and @matthieu-rolland ,

The 1.7.7 behaviour is the right one, we should not display a discount for free shipping and "free shipping" in the total at the same time. The customer won't understand where the discount is applied in the invoice's summary of the totals.

Was this page helpful?
0 / 5 - 0 ratings