Skip to content

Error updating prices when Fee = 100%, Net Price = $0, Sale Price = $1 #3492

Description

@rbarreca

Describe the bug
If you try to set product price with custom Fee % and net price = $0 (say it's a supplier freebie or something but buyer still pays) you'll get an app error

To Reproduce
Steps to reproduce the behavior:

  1. Log in as market manager
  2. Go to Prices tab for a product
  3. Click Edit
  4. Set Fee % to Product and value = 100
  5. Set Net Price = 0
  6. Set Sale Price = 1
  7. Click Save
  8. See error like PG::NumericValueOutOfRange: ERROR: numeric field overflow DETAIL: A field with precision 5, scale 3 must round to an absolute value less than 10^2. : UPDATE "prices" SET "net_price" = $1, "product_fee_pct" = $2, "sale_price" = $3, "updated_at" = $4 WHERE "prices"."id" = 200782

Expected behavior
This would save and work in the system correctly or at least provide a valid error message in short-term (if a $0.00 net price product is too high of effort to do at this time).

Screenshots
screen shot 2018-11-04 at 3 28 37 pm
screen shot 2018-11-04 at 3 29 10 pm

Rollbar instances

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions