You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The database schema permits stock types and price lookups to have negative prices.
Attempting to make use of a price lookup or stock type with a negative price creates a transaction line with a negative price, which fails because prices in transaction lines cannot be less than zero.
We can probably make this do something sensible by spotting negative prices in the register and creating a transaction line with a positive price and a negative number of items. Dealing with repeats will also need attention.
This could be useful to implement per-item discounts, for example a button for "cup re-use" at EMF.
We would also need a register hook prior to the creation or updating of a transaction line, to enable hook code to look at the whole transaction and decide whether to permit the update. (In the case of cup re-use it would need to prevent there being more re-use discounts than drinks served.)
The text was updated successfully, but these errors were encountered:
PLUs can have negative prices. Spot this, and sell a negative number of
items at a positive price instead.
Also, add a register hook to enable plugins to veto PLU sales.
Related issue: #281 on github.
Related issue: #281 on github.
We may want to support stock with a negative price in the future (for
example, where the "stock" is a limited number of discounts) but for now
let's just pop up an error when someone attempts to sell stock that has
a negative price.
The database schema permits stock types and price lookups to have negative prices.
Attempting to make use of a price lookup or stock type with a negative price creates a transaction line with a negative price, which fails because prices in transaction lines cannot be less than zero.
We can probably make this do something sensible by spotting negative prices in the register and creating a transaction line with a positive price and a negative number of items. Dealing with repeats will also need attention.
This could be useful to implement per-item discounts, for example a button for "cup re-use" at EMF.
We would also need a register hook prior to the creation or updating of a transaction line, to enable hook code to look at the whole transaction and decide whether to permit the update. (In the case of cup re-use it would need to prevent there being more re-use discounts than drinks served.)
The text was updated successfully, but these errors were encountered: