Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is possible to add negative Amount for Order Payment from the Back Office #16582

Closed
tdavidsonas88 opened this issue Nov 28, 2019 · 8 comments
Assignees
Labels
1.7.5.2 Affects versions 1.7.6.1 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Order Component: Which BO section is concerned
Milestone

Comments

@tdavidsonas88
Copy link
Contributor

tdavidsonas88 commented Nov 28, 2019

Describe the bug
It is possible to add negative Amount for Order Payment from the Back Office. Then message is thrown: An unexpected error occurred. [PrestaShopException code 0]. The actual exception is: Property Order->total_paid_real is not valid.

According to as I understand negative payments should not be saved to the database or at least total sum of payments from the db should not be negative.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Front Office and create new order.
  2. Go to Back Office and go into that order page
  3. Scroll down to Payment section and add new payment with negative amount: -5.548
  4. See error: An unexpected error occurred. [PrestaShopException code 0]

Screenshots
If applicable, add screenshots or screenrecords to help explain your problem.
Screenshot from 2019-11-28 12-51-45
Screenshot from 2019-11-28 12-52-21

Additional information
Have Behat integration 2 failing tests written in file /Order/add_payment.feature on the Github Pull request: #16525

@khouloudbelguith
Copy link
Contributor

Hi @tdavidsonas88,

I manage to reproduce the issue with PS1.7.5.2 & PS1.7.6.1 & PS1.7.6.2build2 & the develop branch.
image
Ping @matks, @marionf, @colinegin, this issue could be fixed during the migration of the order page?
Related to #13809
Thanks!

@khouloudbelguith khouloudbelguith added 1.7.5.2 Affects versions 1.7.6.1 Affects versions BO Category: Back Office Bug Type: Bug Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Order Component: Which BO section is concerned Ready Status: Issue is ready to be worked on Taxes and Prices Component: Which BO section is concerned labels Nov 28, 2019
@marionf marionf removed the Taxes and Prices Component: Which BO section is concerned label Nov 28, 2019
@tdavidsonas88
Copy link
Contributor Author

@rokaszygmantas - would like some advice how we can contribute

@colinegin colinegin added this to Backlog in PrestaShop 1.7.7.3 via automation Dec 4, 2019
@colinegin colinegin moved this from Backlog to To be tested in PrestaShop 1.7.7.3 Dec 4, 2019
@colinegin colinegin moved this from To be tested to To be reviewed in PrestaShop 1.7.7.3 Dec 4, 2019
@colinegin colinegin moved this from To be reviewed to In progress in PrestaShop 1.7.7.3 Dec 16, 2019
matks added a commit to tdavidsonas88/PrestaShop that referenced this issue Jan 2, 2020
@MatShir MatShir moved this from In progress to To do in PrestaShop 1.7.7.3 Jan 15, 2020
@atomiix atomiix self-assigned this Jan 16, 2020
@MatShir
Copy link
Contributor

MatShir commented Jan 17, 2020

You can't add negative value to the payment method. To balance an overdue by the clients, it is recommended to make a credit slip.

@atomiix atomiix moved this from To do to To be reviewed in PrestaShop 1.7.7.3 Jan 20, 2020
@jolelievre jolelievre moved this from To be reviewed to To be tested in PrestaShop 1.7.7.3 Jan 21, 2020
@jolelievre jolelievre moved this from To be tested to In progress in PrestaShop 1.7.7.3 Jan 21, 2020
@atomiix atomiix moved this from In progress to To be reviewed in PrestaShop 1.7.7.3 Jan 22, 2020
@matthieu-rolland matthieu-rolland moved this from To be reviewed to To be tested in PrestaShop 1.7.7.3 Jan 27, 2020
@sarahdib sarahdib moved this from To be tested to In progress in PrestaShop 1.7.7.3 Jan 28, 2020
@jolelievre jolelievre moved this from In progress to To be tested in PrestaShop 1.7.7.3 Jan 29, 2020
@atomiix atomiix moved this from To be tested to To be reviewed in PrestaShop 1.7.7.3 Jan 29, 2020
@atomiix atomiix moved this from To be reviewed to To be tested in PrestaShop 1.7.7.3 Jan 29, 2020
@sarahdib sarahdib moved this from To be tested to To be merged in PrestaShop 1.7.7.3 Feb 3, 2020
@sarahdib sarahdib added this to the 1.7.7.0 milestone Feb 3, 2020
@Progi1984
Copy link
Contributor

Fixed in #17241

PrestaShop 1.7.7.3 automation moved this from To be merged to Done Feb 3, 2020
@marionf marionf added Fixed Resolution: issue closed because fixed and removed Ready Status: Issue is ready to be worked on labels Feb 10, 2020
@radioeventos
Copy link

A payment can be positive or negative. Another thing is that the Total cannot be negative, but partial refunds must be allowed and that these are recorded.
It is a very serious problem for the accounting of a store that the exact accounting balance of a customer cannot be known.

@matks
Copy link
Contributor

matks commented Aug 31, 2021

A payment can be positive or negative.

You wish it to happen but it's PrestaShop @PrestaShop/product-team that decides what happens or not in the project.

I understand you find it very useful to have positive or negative payments but there is more than "is it easy or not to use" when it comes to payments.

AFAIK Product team is actually in the process of getting some law compliance people so that they can tell us what can be done or what cannot be done in order to comply with the law.

@VipinNethues
Copy link

I am getting issue related to it.

PS 1.7.8.0

Error:
Property Order->total_paid is not valid
at line 1046 in file classes/ObjectModel.php

How to reproduce it:

  1. Create a voucher of amount 20$ (in any currency) -
  2. add products in you cart on front shop less then voucher amount, in our case let it be 18$ (cart total must be less then voucher ammount)
  3. Apply that voucher now you will see -> Total (tax incl.)-₹0.01 on cart summery.
  4. choose address and payment option and proceed.
    Now you will get that error, check attached image.

Property-Order-total_paid-is-not-valid

Looking for solution, if its already fixed please provide PR link for that fix.
Thanks

@MatShir
Copy link
Contributor

MatShir commented Apr 7, 2022

@VipinNethues please create a dedicated issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.5.2 Affects versions 1.7.6.1 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Order Component: Which BO section is concerned
Projects
No open projects
Development

No branches or pull requests

10 participants