Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
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

11

Action

Expected system response

Comment

1

Log into application. Click Requisition > Create/Authorize.

             

                                                 

2

345678910


2

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

Image Added


3Click Proceed button.

Image Added


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

Image Added


5Click Authorize button.

Image Added



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

Image Added

After clicking Approve button appears:

Image Added

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 

Image Added


8Click Proceed button.

9Check if begining balance has proper value.

Image Added

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