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

(bug) Cash Payments shouldn't make an HTTP request if there are no cash items #772

Closed
jniles opened this issue Oct 4, 2016 · 1 comment
Assignees
Labels

Comments

@jniles
Copy link
Collaborator

jniles commented Oct 4, 2016

The Cash Payments page is fairly complex since it deals with both Cautions and Cash Payments against invoices. The current implementation does not block Cash Payment requests from submitting if there are no cash items (though the server rejects them). We can do better by blocking the submit before it even sends an HTTP request and create an error message that informs the user the need to add invoices to the bill.

Steps to Reproduce

  1. Load the cash payments page.
  2. Select a cashbox with any currency defined.
  3. Submit a payment without invoice items.

Expected Result
The module should error with a nice error message ('You have not added invoices to pay against. Please add them and resubmit')

Actual Result
An HTTP POST is sent to /cash and returned as a 400 error without a good error message.

@jniles jniles added the Bug label Oct 4, 2016
@jniles jniles added this to the Finance Implementation milestone Oct 4, 2016
@jniles jniles self-assigned this Nov 11, 2016
@jniles
Copy link
Collaborator Author

jniles commented Nov 11, 2016

I'm tackling this.

jniles pushed a commit to jniles/bhima that referenced this issue Nov 11, 2016
This commit introduces a check to verify that invoices are being paid
against when a user submits the cash form.  If there are no invoices, a
danger notification is emitted telling the user to add some invoices and
no HTTP request is sent.

Previous, this would be validated on the server - the client no longer
even needs to make the HTTP request.

Closes Third-Culture-Software#772.
jniles pushed a commit to jniles/bhima that referenced this issue Nov 25, 2016
This commit introduces a check to verify that invoices are being paid
against when a user submits the cash form.  If there are no invoices, a
danger notification is emitted telling the user to add some invoices and
no HTTP request is sent.

Previous, this would be validated on the server - the client no longer
even needs to make the HTTP request.

Closes Third-Culture-Software#772.
sfount pushed a commit that referenced this issue Nov 25, 2016
This commit introduces a check to verify that invoices are being paid
against when a user submits the cash form.  If there are no invoices, a
danger notification is emitted telling the user to add some invoices and
no HTTP request is sent.

Previous, this would be validated on the server - the client no longer
even needs to make the HTTP request.

Closes #772.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant