-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SELV3-508: Add validation to check unaccounted quantity
- Loading branch information
1 parent
d3fbee8
commit 3154430
Showing
4 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"stockPhysicalInventoryDraft.unaccountedQuantityError": "Unnacounted quantity must be 0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
src/stock-physical-inventory-draft/physical-inventory-draft.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<h2> | ||
{{'stockPhysicalInventoryDraft.title' | message: {'facilityCode': vm.facility.code, 'facilityName': vm.facility.name, 'program': vm.program.name} }} | ||
</h2> | ||
|
||
<section class="openlmis-table-container"> | ||
<form ng-submit="vm.search()" openlmis-table-filter> | ||
<fieldset class="form-group"> | ||
<label for="searchFor">{{'stockPhysicalInventoryDraft.keyword' | message}}</label> | ||
<input id="searchFor" type="text" ng-model="vm.keyword" maxlength="50"/> | ||
<label for="includeInactive"> | ||
<input id="includeInactive" | ||
type="checkbox" | ||
name="includeInactive" | ||
ng-true-value="'true'" | ||
ng-false-value="'false'" | ||
ng-model="vm.includeInactive"/> | ||
|
||
{{'stockPhysicalInventoryDraft.includeInactiveItems' | message}} | ||
</label> | ||
<input type="submit" value="{{'stockPhysicalInventoryDraft.search' | message}}"/> | ||
</fieldset> | ||
</form> | ||
|
||
<openlmis-progressbar class="physical-inventory-draft-progress" | ||
value="vm.itemsWithQuantity.length" max="vm.displayLineItemsGroup.length" | ||
title="{{'stockPhysicalInventoryDraft.numberOfProductsComplete' | message: {'num': vm.itemsWithQuantity.length, 'total': vm.displayLineItemsGroup.length} }}"> | ||
</openlmis-progressbar> | ||
|
||
<button class="pull-right add" ng-click="vm.addProducts()"> | ||
{{'stockPhysicalInventoryDraft.addProduct' | message}} | ||
</button> | ||
|
||
<saving-indicator class="draft-indicator" object="vm.dataChanged"/> | ||
|
||
<table> | ||
<caption ng-if="!vm.displayLineItemsGroup.length && !vm.stateParams.keyword"> | ||
{{'stockPhysicalInventoryDraft.noLineItems' | message}} | ||
</caption> | ||
<caption ng-if="!vm.displayLineItemsGroup.length && vm.stateParams.keyword"> | ||
{{'stockPhysicalInventoryDraft.noSearchResults' | message}} | ||
</caption> | ||
<thead> | ||
<tr> | ||
<th>{{'stockPhysicalInventoryDraft.productCode' | message}}</th> | ||
<th>{{'stockPhysicalInventoryDraft.product' | message}}</th> | ||
<th>{{'stockPhysicalInventoryDraft.lotCode' | message}}</th> | ||
<th>{{'stockPhysicalInventoryDraft.expiryDate' | message}}</th> | ||
<th class="col-sticky sticky-right">{{'stockPhysicalInventoryDraft.soh' | message}}</th> | ||
<th class="col-sticky sticky-right">{{'stockPhysicalInventoryDraft.currentStock' | message}}</th> | ||
<th ng-if="vm.showVVMStatusColumn" class="col-sticky sticky-right">{{'stockPhysicalInventoryDraft.VVMStatus' | message}}</th> | ||
<th class="col-sticky sticky-right">{{'stockPhysicalInventoryDraft.reasons' | message}}</th> | ||
<th class="col-sticky sticky-right">{{'stockPhysicalInventoryDraft.unaccountedQuantity' | message}}</th> | ||
<th ng-if="vm.showHideButtonColumn" >{{'stockPhysicalInventoryDraft.actions' | message}}</th> | ||
</tr> | ||
</thead> | ||
<tbody ng-repeat="(category, groupedLineItems) in vm.groupedCategories" tbody-title="{{category}}"> | ||
<tr ng-if="lineItems.length > 1" ng-repeat-start="lineItems in groupedLineItems"> | ||
<td>{{lineItems[0].orderable.productCode}}</td> | ||
<td>{{lineItems[0].orderable | productName}}</td> | ||
<td></td> | ||
<td></td> | ||
<td align="right">{{vm.calculate(lineItems, 'stockOnHand')}}</td> | ||
<td align="right">{{vm.calculate(lineItems, 'quantity')}}</td> | ||
<td ng-if="vm.showVVMStatusColumn"></td> | ||
<td align="right"></td> | ||
<td align="right"></td> | ||
<td align="right" ng-if="vm.showHideButtonColumn"></td> | ||
</tr> | ||
<tr ng-repeat="lineItem in lineItems | orderBy:'lot?lot.lotCode:\'\''" ng-repeat-end> | ||
<td>{{lineItems.length > 1 ? '' : lineItem.orderable.productCode}}</td> | ||
<td>{{lineItems.length > 1 ? '' : (lineItem.orderable | productName)}}</td> | ||
<td ng-if="vm.canEditLot(lineItem)"> | ||
<button class="edit" ng-click="vm.editLot(lineItem)"> | ||
{{lineItem.displayLotMessage}} | ||
</button> | ||
</td> | ||
<td ng-if="!vm.canEditLot(lineItem)"> | ||
{{lineItem.displayLotMessage}} | ||
</td> | ||
<td>{{lineItem.lot.expirationDate | openlmisDate}}</td> | ||
<td align="right">{{lineItem.stockOnHand}}</td> | ||
<td class="digit-cell" > | ||
<input | ||
class="form-control" ng-blur="vm.validateQuantity(lineItem)" | ||
ng-change="vm.quantityChanged(lineItem)" | ||
ng-model="lineItem.quantity" | ||
openlmis-invalid="{{lineItem.quantityInvalid ? lineItem.quantityInvalid : ''}}" | ||
positive-integer/> | ||
</td> | ||
<td ng-if="vm.showVVMStatusColumn" class="digit-cell"> | ||
<select ng-if="lineItem.orderable.extraData.useVVM == 'true'" | ||
ng-model="lineItem.vvmStatus" | ||
ng-options="status as vm.getStatusDisplay(status) for status in vm.vvmStatuses" | ||
placeholder="{{'stockPhysicalInventoryDraft.selectStatus' | message}}" | ||
ng-change="vm.cacheDraft()"> | ||
</select> | ||
</td> | ||
<td class="reasons-cell" > | ||
<!-- SELV3-508: Add validation to check unaccounted quantity --> | ||
<stock-reasons | ||
ng-model="lineItem.stockAdjustments" | ||
line-item="lineItem" | ||
reasons="vm.reasons" | ||
ng-change="vm.checkUnaccountedStockAdjustments(lineItem); vm.validateUnaccountedQuantity(lineItem)" | ||
/> | ||
<td align="right" | ||
openlmis-invalid="{{lineItem.unaccountedQuantityInvalid | message}}">{{lineItem.unaccountedQuantity}}</td> | ||
</td> | ||
<!-- SELV3-508: ends here --> | ||
<td ng-if="vm.showHideButtonColumn"> | ||
<button type="button" class="danger" ng-if="lineItem.stockOnHand === 0 && lineItem.active && !lineItem.$isNewItem" ng-disabled="offlineService.isOffline()" | ||
ng-click="vm.hideLineItem(lineItem)">{{'stockPhysicalInventoryDraft.deactivate' | message}}</button> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<openlmis-pagination list="vm.displayLineItemsGroup" paged-list="vm.pagedLineItems" on-page-change="vm.saveOnPageChange"></openlmis-pagination> | ||
</section> | ||
|
||
<ng-include src="'stock-physical-inventory-draft/physical-inventory-draft-toolbar.html'"></ng-include> |