Incorrect packs to ship value when remainder quantity is the same as packRoundingThreshold

Description

For an orderable, if the remainder quantity in a requisition line item is exactly the pack rounding threshold, the packs to ship value should round up to the next pack. However, it does not; it only rounds up if the remainder quantity is greater than the pack rounding threshold.

Steps to recreate

  • Log in to a test OpenLMIS server as administrator

  • Go to Administration -> Requisition Templates

  • Configure the template for Family Planning

  • Enable the Display checkbox for Packs to ship (V), and Save

  • Log out and log in as srmanager2

  • Go to Requisition -> Create/Authorize

  • Select My Facility and program Family Planning

  • Initiate a new requisition (if one is already initiated, delete it and initiate a new one)

  • For product Levora, the net content value is 84 (meaning one pack has 84 dispensing units), and the pack rounding threshold is 42 (the number of dispensing units when we round up to the next pack)

  • Enter 126 as the requested quantity for Levora (exactly the amount to round up to the next pack)

  • The packs to ship value is 1

Expected: the packs to ship value should be 2 (rounding up to the next pack)

Environment

None

Assignee

Unassigned

Reporter

Chongsun Ahn

Labels

None

Components

Fix versions

Affects versions

Priority

Critical
Configure