Schema and backend improvements for Physical Inventory

Description

There appears to be some incomplete and confusing parts to stock management in the schema and in the backend Java code. Notably:

  • physical_inventory_line_item_reasons is not actually a table of reasons (that is stock_card_line_item_reasons), but is actually a table of adjustments to a physical inventory line item. Therefore, a better name would be physical_inventory_line_item_adjustments. The Java code has the name StockAdjustment, which would be better named PhysicalInventoryLineItemAdjustment.

  • physical_inventory_line_item_reasons should have id as primary key

  • physical_inventory_line_item_reasons should have foreign keys for all attributes that make sense (reasonid, physicalinventorylineitemid, stockcardlineitemid, stockeventlineitemid)

  • The quantity field for StockAdjustment is a bit confusing, since there is a quantity field in the PhysicalInventoryLineItem; it would be better named something like quantityOfDifference or adjustmentQuantity (in both the backend code and schema); if the class is better named, I might be open to leaving this, as long as it's clear the quantity is the quantity of adjustment, not the quantity of the line item

Acceptance Criteria

  • Make schema and code changes recommended above

  • Make sure there are no regressions with these changes

Activity

Show:
Paweł Gesek
November 13, 2017 at 8:48 AM

for testing this I suggest executing some pre-existing test cases related to the physical inventory (make sure to add adjustments). Try also to approve a requisition with adjustments and make sure that didn't break. Finally, make sure print-outs in stock are still working.

Brandon Bowersox-Johnson
November 10, 2017 at 4:14 PM

Thanks for the comment! I struck out that last bullet.

Paweł Gesek
November 10, 2017 at 3:35 PM
(edited)

I'd prefer to not change the quantity field name in stock management, I don't think its that confusing after the rename. It's also consistent with the requisition service. We can change it, but for reference, this will have to change:

1) Field name in the db and class
2) Stockmanagement-ui, since the adjustment object is actually a field of the Dto (we send the domain to the UI)
3) Field name in ui-components, since from what I can see our reusable adjustment component uses this field name
4) The name of the quantity field of the StockAdjustment class in the requisition service, since it reuses the component from 3
5) The requisition ui, since we just changed the field name in the requisition backend
6) Jasper reports

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Story Points

Original estimate

Time tracking

3h 30m logged30m remaining

Sprint

None

Fix versions

Priority

Time Assistant

Created August 28, 2017 at 8:10 PM
Updated November 21, 2020 at 1:17 PM
Resolved November 13, 2017 at 3:25 PM