human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

Disallow 0 on item quantity

Open cielf opened this issue 1 year ago • 2 comments

Summary

If you have a 0 in item quantity, the reports get a divide by 0 error. So perhaps we shouldn't allow this.

Why fix

Support cycles, bank confusion

Details

Item quantity can be blank, and, at this point, it should be allowed to be. (we have defaults for reporting in that case) But, if it's 0, we get a divide by zero error in the reports We could check for zero in the reports, but since 0 makes no sense anyway, let's disallow 0 in the item create/edit.

Criteria for completion

  • [ ] behaviour as described
  • [ ] tests that blank still allowed, but 0 isn't

cielf avatar Feb 18 '24 15:02 cielf

Hi,

Can you provide information on how to reproduce this bug? I would like to work on this

aisayo avatar Feb 26 '24 20:02 aisayo

Hi @aisayo. I just assigned this to you. Here's how to recreate it.

On your local copy of the app, 1/ sign in as the bank admin user ([email protected]). 2/ Click on Inventory, then "Items & Inventory". 3/ There will be a list of items. Click "Edit" on any one of them.
4/ Enter 0 in the "Quantity Per Individual".
5/ Save.

It allows you to enter 0, and it shouldn't.

cielf avatar Feb 26 '24 20:02 cielf

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

github-actions[bot] avatar Mar 28 '24 00:03 github-actions[bot]

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Apr 04 '24 00:04 github-actions[bot]

If this is available, can I try taking this on?

Also, does this also apply for the On hand minimum quantity and On hand recommended quantity fields?

pshong79 avatar Apr 06 '24 03:04 pshong79

Hey @pshong79 -- I don't think they are involved in any calculations, so it''s not an issue if they have a zero in them. And yes, you can try taking this on.

cielf avatar Apr 06 '24 14:04 cielf

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Apr 14 '24 00:04 github-actions[bot]