Performing subtraction operation from web api data in angularjs
stock = acceptqty - issuedqty - issueqty
= 1020-510-510
= 0
Therefore, stock must be zero.
The subtracted value must change in stock.
$http.get(apiUrl + "/api/Warehouse/GetDetails?invoiceno=" + $scope.selectedInvoice.originalObject.InvoiceNo + "")
.then(function (response) {
$scope.mydata = JSON.parse(response.data);
$scope.calc = function (index) {
$scope.mydata[index].mul = parseFloat($scope.mydata[index].PalletCapacity) * parseFloat($scope.mydata[index].num);
$scope.$apply();
$scope.mydata[index].diff = $scope.mydata[index].Numbers - $scope.mydata[index].IssuedQty - $scope.mydata[index].mul;
}
});