Settle Storage Underapply Popup

Issue No: GRN-2933
Created 3/16/2022 9:12:03 AM
Type Feature
Priority Critical
Status Closed
Resolution Fixed
Fixed Version 20.1
Description *This issue relates to i21 Help Desk ticket:* [ HDTN-274152 - please start running automation on latest 20.1 build for MCP|https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-274152]   *Steps:* Follow Steps on [http://jira.irelyserver.com/secure/Tests.jspa#/testCase/MCP-T850] *Issue:* *This issue relates to i21 Help Desk ticket:* [ HDTN-271733 - settle storage under over apply pop up |https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-271733]   Setting to pop up if contract selected not fully applied, warning message, needs config   8 days   This should be covered by numeric precision and the contract team. the contract team could automatically short close the contact of less than .00xx bushels, or increase the quantity of the contract.   +Problem:+   For MCP, when trying to settle storage, contracts with decimal balances appear on the ‘Add Contracts’ screen (example below). A contract can be selected from the search screen but quantities cannot be applied.   *Contracts with decimal balances do not get 'Auto Completed' as a result*   !pastedImage_d181860_0.png|height=273,width=553!   This appears in the following scenarios when customers try to 'Settle All' storage:   1. When trying to 'Settle All' storage and apply to storage balance, there is a mismatch between the available balance (6 decimals) and units applied displayed in the UI (4 decimals). For example: the available balance value in the database is *1080.379773 units.* When this value is displayed in the 'Settle storage' screen it is rounded off to 4 decimal places, and the result is *1080.3798 units.* When trying to post the transaction, users see the following warning (in red below). This is because the rounded value is greater than the actual value in the database. After settling the storage, there is a micro balance left i   !pastedImage_d181860_1.png|height=220,width=553!     2. Right now, when MCP tries to 'Settle All' storage and apply it to a contract. Using the following example, they look at the the Units to be settled, ex: 577.2989 (4decimals in the UI).   * If a contract already exists they apply all units to the contract, or * They create a new contract with with 577.2989 units and settle all the units to the new contract   The contract is for 577.2989 units (based on the decimals seen in the UI). However, the units are are being settled have 6 decimals in the database , 577.298931   After 'Posting' the transaction, a micro balance of 0.000031 units is left in storage. Similarly there can be instances when there are micro balances left on the contract.   !pastedImage_d181860_2.png|height=408,width=553!     *Auto Contract completion:*   Scenarios: Ability to directly create vouchers, storage settlements, logistics etc. can affect balances on contracts and might affect contract completion.   *Impact of contract types?*   # ## Basis: We create a ticket, contract will still be open until priced. Basis & Units are declared. If they try to apply a basis during settlement, voucher is not created, payable is created ## Priced: Units already declared. Reduce when priced contract is used in settlement. ## HTA: Futures prices is declared. Units are declared. ## Unit : Not used on scale, for loads only (need to be clarified), not used for settlements. ## Cash: Use price on the contract. Units are declared ## DP : When contract is used for scale tickets (Type DP), Price used is 'Basis' & 'Settlement' price that is setup in Risk management. Becomes company owned storage. When user settles, the number of units on the DP reduces. For MCP, they only use one DP contract per vendor (all tickets for the storage should be applied to one DP contract mainly because of delivery sheets).   *Fix/Change required:*   *New Company Configuration:*   Contract management/Ticket management: Adding a *'Automatic Short closing'* configuration setting in contracts. If the value is set to ‘Yes’, once a contract has a decimal quantity balance, display a popup message informing the users that it is going to be short closed.   Impact of UOM: Determine when to short close contracts, 0.00x Bushels is different from 0.00x Tons   Anything that is at least this value or below needs to be taken care of by the fix/change (this is the threshold for decimal/micro balances)   *0.0001 Bushels - Short close it*   *0.000001 Tons - Short close it*   # Short closing the contract with decimal balances - When users try to settle all storage units on a contract, and there is a decimal balance of units left on the contract, we need a popup message to show up to inform the user that there is a *'Decimal balance quantity of 0.00031 units left on the contract. This contract will be automatically short closed'* . And the contract will be short closed automatically # Adding more quantity to a contract balance - For the scenario where units being settled are greater than contract balance by a decimal quantity ( *Ex: 0.00031 units* ), automatically add the decimal difference units to the contract ( *0.00031 units* ) so the difference does not have to be spotted and when posted, the contract will be completed, no units have to be spotted and the negative or zero value voucher scenario is avoided completely. For this scenario as well users will see the following popup informing them about the same -> *"A decimal balance (example: 0.000033) is being added/adjusted to the contract and the contract will be completed, this balance will not have to be spotted"* # *'Settle All'* storage: When users try to 'Settle All' units and apply the storage balance, and there is a difference between the Units and Available Units, there is a popup message to confirm if 'Users would like to settle all the units?'. If the users select 'Yes', settle all the units in the storage balance (6 decimals) and this will lead to no decimal balances in storage, the entire quantity will be settled.   Note: MCP sometimes try to settle storage micro balances on the contract, even if it doesn't generate a voucher     *Acceptance:*   # {color:#a31515}Prompt should be displyed before posting the settlement when {color}Settling of storage cannot continue because of the microbalance left in the Spot Units{color:#a31515}: " *A decimal balance of (units + UOM)* {color}{color:#3366ff} *will be added to Contract No. (contract#)* *and will be completed. This balance will not have to be spotted. Would you like to proceed?"* {color} # Show a popup message before posting the transaction when *Auto-short close contract in Settlement* in Company Configuration > Ticket Management is checked {color:#3366ff} *"Decimal balance quantity is left on the ff contract:* {color} {color:#3366ff} *Contract No.: Units + UOM* {color} {color:#3366ff} *This will be automatically short-closed."* {color}