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

Cannot save numbers with commas in Purchase Price #204

Closed
5 tasks done
edward-shen opened this issue Sep 8, 2024 · 2 comments
Closed
5 tasks done

Cannot save numbers with commas in Purchase Price #204

edward-shen opened this issue Sep 8, 2024 · 2 comments
Labels
🕷️ bug Something isn't working 👷‍♂️ help wanted Extra attention is needed

Comments

@edward-shen
Copy link
Contributor

First Check

  • This is not a feature request
  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the documentation, with the integrated search.
  • I already read the docs and didn't find an answer.

Homebox Version

v0.14.1

What is the issue you are experiencing?

Attempting to save an asset with a purchase price with a comma, e.g. 1,416.11, results in an 500 Internal Server Error, failing to save the item.

Optimally, we would be able to enter numbers with commas.

How can the maintainer reproduce the issue?

  1. Create a new item.
  2. Edit it's fields.
  3. Enable advanced fields
  4. Enter 1,000 into the Purchase Price
  5. Attempt to save.

You should see a PUT request to /api/v1/items/<UUID> that returns a 500.

This PUT request contains the key-value "purchasePrice": "1,000".

On the server side, you'll see an error:

homebox  | 6:19AM ERR ../go/src/app/internal/web/mid/errors.go:31 > ERROR occurred error="body decoding error: json: cannot unmarshal number 1,416.11 into Go struct field ItemUpdate.purchasePrice of type float64" req_id=3b9ebf27d97f/ecrDg3bAEj-000443

Deployment

Docker (Linux)

Deployment Details

No response

@katosdev
Copy link
Contributor

that's peculiar, I'm sure I've managed this in the past but I can replicate this on our demo instance - Tagging the bug and will review. Thanks for the heads up!

@katosdev katosdev added the 🕷️ bug Something isn't working label Sep 13, 2024
@katosdev
Copy link
Contributor

Apologies - Turns out I was getting confused.
The asset is inputting the purchase price as a float which is incompatible with commas, but then when you save it, the purchase price is then formatted with one:
image

Bit strange, and probably could do with some validation or such to be honest. Will open this up for community input.

@katosdev katosdev assigned katosdev and unassigned katosdev Sep 13, 2024
@katosdev katosdev added the 👷‍♂️ help wanted Extra attention is needed label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕷️ bug Something isn't working 👷‍♂️ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants