Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program based Customer Requisitions #3128

Closed
10 of 11 tasks
josh-griffin opened this issue Sep 16, 2020 · 20 comments
Closed
10 of 11 tasks

Program based Customer Requisitions #3128

josh-griffin opened this issue Sep 16, 2020 · 20 comments
Labels
Epic A discussion and/or parent issue for module/feature design Type: Feature From a new button to whole new systems

Comments

@josh-griffin
Copy link
Contributor

josh-griffin commented Sep 16, 2020

Is your feature request related to a problem? Please describe.

JSI Require program-based customer requisitions. Problem is, they're not implemented, yet.

Describe the solution you'd like

Main tasks overview:

  • Add name_tag_join/name_tag to schema/incoming sync
  • Change Supplier Requisition to use name_tag
  • Change "By Program Modal" for Customer Requisitions
  • Add New Requisition button to Customer Requisitions Page
  • Add "Program" column to Customer Requisitions Page Didn't discuss
  • Add Program-based Customer Requisition column changes (All described in tests)
  • Add Program-based Customer Requisition page info changes (All described in tests)
  • Change usage formula to use 365/12 instead of 30

Google sheet for columns spec: https://docs.google.com/spreadsheets/d/1sEiR9BTVQJ52kLPoVjMGOi8EghRRSTHkDlYkkNUDV20/edit#gid=0

Implementation issues:

@josh-griffin josh-griffin added the Type: Feature From a new button to whole new systems label Sep 16, 2020
@josh-griffin

This comment has been minimized.

@craigdrown

This comment has been minimized.

@craigdrown

This comment has been minimized.

@josh-griffin

This comment has been minimized.

@craigdrown

This comment has been minimized.

@andreievg

This comment has been minimized.

@josh-griffin

This comment has been minimized.

@josh-griffin

This comment has been minimized.

@josh-griffin
Copy link
Contributor Author

josh-griffin commented Sep 21, 2020

@andreievg @craigdrown @Chris-Petty

Trying to conclude/summaries meetings/discussions/specs/requirements/whatever:

  • Have updated the customer requisitions /customer requisition testing templates (below) to reflect the changes to be made.
  • I will use this as the 'spec'/'requirements' moving forward.
  • I know it's a lot to look through, but if you could give it a read and if you see anything that you are not happy with or would like to change, please let me know.

Main task list:

  • Add name_tag to schema/incoming sync
  • Add name_tag_join to schema/incoming sync
  • Change Supplier Requisition to use name_tag
  • Create Customer Requisition "By Program Modal"
  • Add New Requisition button to Customer Requisitions Page
  • Add "Program" column to Customer Requisitions Page Didn't discuss
  • Add Program-based Customer Requisition page changes (All described in tests)
  • Change usage formula to use 365/12 instead of 30

Customer Requisitions Page [List of all customer requisitions]

CHANGES:

Button

  • New Requisition
    • Clicking on this button opens a "By Program Modal" (More detail below)

Table

Additional Column:

  • Program
    • Header Name: Program
    • Sortable (And sorts correctly)
    • NOT Editable
    • Displays the name of the program for the requisition

By Program Modal

  • Must select steps in order: customer, program, period, order type
  • Customer Step - Can choose any customer name who is not a patient
  • Customer Step - There is a warning when selecting a customer who is also a store.
  • Program Step - Can choose any program where there exists a name_tag_join record for the chosen name and name_tag and the program is visible in the mobile store.
  • Period - Can choose any period that is related to the periodSchedule, defined in the masterList.programSettings.storeTag which matches the name_tag from the selected customer [The first arbitrary storeTag/name_tag matching is used]
  • Period step - Periods, when being selected show the correct details (number of requisitions etc.)
  • Order type step - Can choose any order type defined in the masterList.programSettings.storeTag where the number of orders in the period is less than the max number of orders for the order type.
  • Order types step - when being selected show the correct details (MOS etc.)
  • Can back pedal steps, where the progress is adjusted correctly
  • there is no ability to create a 'general' requisition
  • OK is enabled when all steps are complete
  • closing the modal, closes the modal
  • programs items are added to the created requisition

Customer Requisition Page

NAVIGATION

  • Can navigate to this page through the customer requisitions page (clicking on a row)
  • Top left displays '"Requisition X"' where X is the serial number for this requisition
  • Can navigate to this page through creating a NEW REQUISITION

SYNC

  • Changes made to this customer requisition are synced to desktop (to trigger, edit a comment and sync)

Table

  • Lists all items which are in the program selected for this requisition
  • Initial sort is by item name, in ascending order

Row Press

  • Pressing on a row has no effect (except for editable cells)

Filtering

  • items are filtered by item name or code
  • Filtering is cleared when the search term is cleared

Toggle

  • Can only view the toggle button when it is a program customer requisition
  • Toggling the table toggles between two different column sets (defined below)
  • Toggling between the column sets correctly displays values/rows (enter a quantity in a row for a column, then toggle the column set and toggle back - the value should still be set)
  • Column set A: [Item Name, Item Code, Our Stock, Their Stock (= Closing Stock), Monthly Usage, Suggested Quantity, Supply This Invoice]
  • Column set B: [Item Name, Item Code, Opening Stock, Adjustments, Receipts, Closing Stock, Consumption, Days out of Stock, Requested Quantity]

Columns

  • Item code
    • Header Name: Item Code
    • In Column set A and B
    • Sortable (and sorts correctly)
    • Items have the correct Item Code
    • Sorting icon updates correctly to indicate ascending/descending and no sorting
    • NOT editable.
    • Left aligned
  • Item Name
    • Header name: Item Name
    • In Column set A and B
    • Sortable (and sorts correctly)
    • Item names are correct
    • Sorting icon updates correctly to indicate ascending/descending and no sorting.
    • NOT editable
    • Text overflow handled (create an item name that is very long)
    • Left aligned
  • Current Stock
    • Header name: Our Stock
    • In Column set A
    • Sortable (and sorts correctly).
    • NOT Editable
    • Right aligned
    • Displays the current stock for that item (should match what is displayed in current stock page)
    • Is updated when adjustments are made and requisition is revisited (check current stock levels -> create a finalised SI -> give the store more stock for an item in the requisition)
  • Their Current Stock
    • Header Name: Their Stock (Closing)
    • In Column set A
    • Sortable (and sorts correctly)
    • EDITABLE unless finalised.
    • Right aligned
    • Initial default value: 0
  • Monthly usage
    • Header Name: Monthly Usage
    • In Column set A
    • Sortable (and sorts correctly).
    • NOT Editable
    • Right aligned
    • Displays the customer monthly usage for that item
    • Consumption / (Days in period / (365/12)) * (Days in Period / (Days in Period-Days out of Stock) )
  • Suggested Quantity
    • Header Name: Suggested Quantity
    • In Column set A
    • Sortable (and sorts correctly).
    • NOT Editable
    • Right aligned
    • Displays the suggested quantity for that item
    • Suggested quantity is correctly calculated: ceil(max(customers monthly usage * months to supply - their stock on Hand, 0))
  • Requested Quantity
    • Header Name: Requested Quantity
    • In Column set B
    • Sortable (and sorts correctly)
    • Right aligned
    • EDITABLE unless finalised.
    • Validation: 0 <= RQ <= 9999999
    • Default: empty
    • NOT required field
  • Supply this invoice
    • Column name: Supply this Invoice
    • In Column set B
    • Sortable (and sorts correctly).
    • Right aligned
    • EDITABLE unless finalised.
    • Default: 0
    • Validation: (SQ = Supplied Quantity): 0 <= SQ <= 9999999
    • Validation: Cannot enter a value greater than the current stock on hand for this store
  • Days out of stock [DOoS = Days Out of Stock]
    • Column name: Days out of Stock
    • In Column set B
    • Sortable (and sorts correctly).
    • Right aligned
    • EDITABLE unless finalised.
    • Default: 0
    • Validation: DOos Quantity): 0 <= SQ <= ???
  • Opening Stock
    • Column name: Opening Stock
    • In Column set B
    • Sortable (and sorts correctly).
    • Right aligned
    • EDITABLE unless finalised.
    • Default: Equal to the CLOSING stock of the LAST requisition entered for that customer
  • Closing Stock
    • Column name: Closing Stock [IS THIS THE SAME AS THEIR STOCK?]
    • In Column set B
    • Sortable (and sorts correctly).
    • Right aligned
    • EDITABLE unless finalised.
    • Default: 0
  • Adjustments
    • Column name: Adjustments
    • In Column set B
    • Sortable (and sorts correctly).
    • Right aligned
    • EDITABLE unless finalised.
    • Default: ??
  • Receipts
    • Column name: Receipts
    • In Column set B
    • Sortable (and sorts correctly).
    • Right aligned
    • EDITABLE unless finalised.
    • Default: Sum of all TransactionBatch.totalQuantity where TransactionBatch.transaction === 'customer_invoice and TransactionBatch.transaction.otherParty === the customer for this requisition for all TransactionBatch where TransactionBatch.transaction.confirmDate >= requisition.period.startDate and TransactionBatch.transaction.confirmDate <= requisition.period.endDate
  • Consumption
    • Column name: Consumption
    • In Column set B
    • Sortable (and sorts correctly).
    • Right aligned
    • EDITABLE unless finalised.
    • Default: ??

Buttons

  • "Use Suggested Quantity"
    • Button is displayed
    • On press, sets "Supply this invoice" to equal "Suggested Quantity" for all rows
  • "Use Required Quantity"
    • Button is displayed
    • On press, sets "Supply this invoice" to equal "Requested quantity" for all rows

Page Info

  • Program
    • Displays the NAME of the program this requisition is for.
  • Months Stock
    • Displays the number of months this requisition is for.
    • Is defined by the order type used to create the requisition [max MOS]
  • Entry Date
    • Shows the correct entry date for this requisition
  • Created Date
    • Enterable Date which CANNOT be less than Entry Date.
    • Clicking opens a date picker [See modals]
  • Customer
    • Shows the correct customer for this requisition
  • Comment
    • Displays the comment field for this requisition correctly
    • Clicking opens the comment modal (see modals)
    • Is disabled when finalised
  • Period
    • Displays the PERIOD field for this requisition correctly
    • NOT editable
    • Displays: {DD/MM/YYYY - DD/MM/YYYY} i.e 1/1/1970 - 21/9/2020
    • Is disabled when finalised
  • Order Type
    • Displays the NAME of the ORder Type selected when the requisition was created
    • NOT editable
    • Displays: {DD/MM/YYYY - DD/MM/YYYY} i.e 1/1/1970 - 21/9/2020
    • Is disabled when finalised

Modals

  • Comment
    • Title is "Edit the requisition comment"
    • If there is already a comment, it is entered already
    • Empty if no comment
    • Entering a comment and pressing OK saves the comment correctly
    • closing the modal closes the modal
  • Created Date
    • Shows a DATE PICKER, allowing a date to be selected no less than Entry Date

Finalizing

  • Pressing finalize opens a confirmation dialog warning about locking the invoice and that finalising this requisition will create a finalized customer invoice
  • Cancelling the confirmation cancels finalising the requisition
  • Confirming the confirmation dialog finalises the requisition, locking all edits (as listed above) - - [ ] Finalising the requisition creates a finalised customer invoice related to this requisition
  • Finalizing the requisition correctly sets the status of the requisition to finalised.
  • All items with a quantity of 0 ARE NOT pruned from the requisition
  • All items with a quantity of 0 ARE pruned from the customer invoice

Desktop Upgrade:

  • When upgrading, mobile adds a [message] record to the sync queue which syncs to desktop
  • Desktop, after receiving the [message] record, adds the following to the sync_out queue for the mobile store:
    • All [store] records
    • All [name_tag] records
    • All [name_tag_join] records
    • The [name]

NOTE: Will need to retest Supplier Requisitions Page, By program modal specifically to ensure behaviour is the same with the small refactors to using name_tag

@andreievg

This comment has been minimized.

@josh-griffin

This comment has been minimized.

@josh-griffin
Copy link
Contributor Author

Tried to make this easy to read.. I didn't know what platform to use. It's a lot of information, so it's hard. Might be easier to edit this comment -> copy + paste into VSCode - it seems more nicely formatted there or a pdf..: reqs.html.pdf .... or a google sheet: https://docs.google.com/spreadsheets/d/1sEiR9BTVQJ52kLPoVjMGOi8EghRRSTHkDlYkkNUDV20/edit#gid=0

🤷

Updated columns:

  • Column set A: [Item Name, Item Code, Our Stock, Their Stock (= Closing Stock), Monthly Usage, Suggested Quantity, Supply This Invoice]
  • Column set B: [Item Name, Item Code, Opening Stock, Adjustments, Receipts, Closing Stock, Consumption, Days out of Stock, Requested Quantity]

For saving values:

Column Column Set Header Editable Validation rule Default calculation aligned Mobile field Desktop field comment
Our Stock A Our Stock No N/A N/A Sum of all the underlying items item batch numberOfPacks * packSize right N/A N/A
Their Stock A Their stock No N/A N/A open + incoming + outgoing + adjustments right RequisitionItem.stockOnHand [requisition_line]stock_on_hand
Monthly Usage A Monthly Usage No N/A N/A Consumption / (Days in period / (365/12)) * (Days in Period / (Days in Period-Days out of Stock) ) right RequisitionItem.dailyUsage (Divided [requisition_line]daily_usage Multiply by 365/12 when displaying in the UI
Suggested Quantity A Suggested No N/A N/A Math.ceil(Math.max(this.dailyUsage*daysToSupply - this.stockOnHand, 0) right N/A [requisition_line]suggested_quantity This is calculated at sync time
Supplied Quantity A Supply This Invoice Yes - Not finalised - Positive integer - Cannot exceed the amount of available stock. 0 N/A right RequisitionItem.suppliedQuantity [requisition_line]actualQuan
Opening Stock B Opening Yes - Not Finalised - Positive Integer - Must be >= (incoming + outgoing + adjustments) Equal to the Closing Balance of the most recent requisition in the last* period N/A right NEW RequisitionItem.openingStock [requisition_line]previous_stock_on_hand Guessing the mSupply column.
Days out of Stock B Days out of Stock Yes - Not Finalised - Positive Integer - 0 >= DoS <= number of days withing period.endDate - period.startDate 0 N/A right NEW RequisitionItem.daysOutOfStock [requisition_line]DOSforAMCadjustment Is that camel case? hehe
Receipts B Incoming Yes - Not Finalised. - Postive Integer - Must be >= opening + outgoing + adjustments Sum of all TransactionBatch.totalQuantity where TransactionBatch.transaction === 'customer_invoice and TransactionBatch.transaction.otherParty === the customer for this requisition for all TransactionBatch where TransactionBatch.transaction.confirmDate >= requisition.period.startDate and TransactionBatch.transaction.confirmDate <= requisition.period.endDate N/A right NEW RequisitionItem.outgoing [requisition_line]Cust_stock_order Guessing!
Consumption B Outgoing Yes - Not Finalised. - Positive Integer. - Must be <= (opening + incoming + adjustments) 0 N/A right NEW RequisitionItem.consumption [requisition_line]adjusted_consumption Guessing!
Adjustments B Adjustments Yes - Not Finalised. - Positive/Negative Integer - Must be >= (opening + incoming + outgoing 0 N/A right NEW RequisitionItem.adjustments [requisition_line]Cust_loss_adjust Guessing.
Closing Stock B Closing No N/A open + incoming + outgoing + adjustments right RequisitionItem.stockOnHand [requisition_line]stock_on_hand Duplicate of Their Stock column
Requested Quantity B Requested Yes - Not Finalised - Positive Integer 0 N/A right RequisitionItem.requiredQuantity [requisition_line]Cust_stock_order

@josh-griffin

This comment has been minimized.

@josh-griffin

This comment has been minimized.

@josh-griffin josh-griffin added the Epic A discussion and/or parent issue for module/feature design label Sep 22, 2020
@andreievg
Copy link
Contributor

Was wondering if we need a way to distinguish between Requisitions entered vs received via sync

We don't for any other page. I think it's a good idea but a little out of scope for this feature?

The only reason was to make sure program requisitions that are coming from other stores, can't be edited (apart from the usual supply quantity). We did something like this originally fort supplier invoices (when they come through sync can't delete lines), not sure if it's there still.

Threshold MOS: Does this play a role with customer requisitions? Should it be saved to the thresholdMOS field and we introduce a toggle, or leave it out?

I think leave it out for now, not part of JSI requirements, but does introduce some inconsistency in how we do it in mobile/desktop and supplier/customer, maybe we can just make an issue to flag it as something to look at later. Same with months lead time.

Will look at the spreadsheet soonish

@andreievg

This comment has been minimized.

@andreievg

This comment has been minimized.

@josh-griffin

This comment has been minimized.

@josh-griffin

This comment has been minimized.

@andreievg

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic A discussion and/or parent issue for module/feature design Type: Feature From a new button to whole new systems
Projects
None yet
Development

No branches or pull requests

3 participants