msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 14 forks source link

Group by item hides batch even if only one line present #4591

Closed Chris-Petty closed 3 weeks ago

Chris-Petty commented 2 months ago

Describe the bug

A. image image

We show most other columns with [multiple] if there are are several lines, or if there is just one line we typically show the value for the one line - except for batch, which appears to show nothing?

B. Pack sell-prices when grouped by item not matching correctly. see below

Environment

Local on develop, though testers have reported on their systems too.

To Reproduce

Steps to reproduce the behaviour:

A. Group by item hides batch even if only one line present

  1. Go to open an inbound shipment
  2. Add an invoice line that has a batch
  3. Toggle group by item on and off, notice that batch is hidden when on

B. Pack sell price value is not updated correctly when grouped by item

  1. In an Inbound, add multiple lines of same item with different pack-sell prices, sth like this:

    image
  2. Note the pack-sell prices there

  3. Group by item

  4. See error: the total sums up to 0; should either be total of all OR just [multiple]

    image

Expected behaviour

A. Should show batch if there is just one line and the UI is grouping by item. B. should either be total of all OR just [multiple]

Agreed Solution

TBD

Additional context

Thinking that if the columns aren't that useful showing [multiple] in group by item, should we remove the columns? Could show some aggregate columns instead? We already have unit quantity, perhaps swap the costs columns for total cost, total sell price? If wanting broad nitty gritty then don't group by item.

andreievg commented 2 months ago

Daily triage, not a hot fix candidate so leaving for weekly triage