1156: RequisitionLineCalculationService initiate beginning balance gets wrong previous period

Test Case #:1156

Test Case Name: RequisitionLineCalculationService initiate beginning balance gets wrong previous period

System: OpenLMIS

Subsystem: blue

Test case designed by: Anna Czyrko

Design Date: 09.11.2016

Short description

The initateBeginningBalance method in this service gets a list of periods earlier than the requisition's period start date (previous periods), takes the first one in the list, and assumes it is the most recent previous period. This assumption seems to be incorrect, as the external call orders the previous periods by start date ascending. So the first one in the list would be least recent previous period.

Acceptance criteria:

  • Refactor the code that gets the previous requisition to use the most recent previous period to determine the previous requisition

Test

  • Create two previous periods with different balances and check requisition uses the correct previous period to initiate a beginning balance

                                                                                                                                                   

Pre – conditions:

Demo data should be updated to have two previous periods with line items for same products with different amounts of stock on hand.

Step


Action

Expected system response

Comment

1

Log into application. Click Requisition > Create/Authorize.

             


2

From Initiate Report and Requisition screen select:
Facility type: My facility,
Facility name: HC01-Comfort Health Clinic
Program: Family planing
Type: Regular 


3Click Proceed button.


4Enter all required data in Report and Requisition for Family Planing (Health Center). Click Submit button.


5Click Authorize button.



6Enter data in Approved Quantity column and Remarks column. Click Approve button.

After clicking Approve button appears:

7Click Requisition > Create/Authorize. From Initiate Report and Requisition screen select:
Facility type: My facility,
Facility name: HC01-Comfort Health Clinic
Program: Family planing
Type: Regular 


8Click Proceed button.

9Check if begining balance has proper value.

Begining balance is calculated from this formula: Beginning Balance = previous period's Stock On Hand + previous period's Approved Quantity

OpenLMIS: the global initiative for powerful LMIS software