@adempiere/grpc-api
Advanced tools
Comparing version 4.3.9 to 4.4.0
{ | ||
"name": "@adempiere/grpc-api", | ||
"version": "4.3.9", | ||
"version": "4.4.0", | ||
"description": "ADempiere Web write in Javascript for a node service", | ||
@@ -5,0 +5,0 @@ "author": "Yamel Senih", |
@@ -18,3 +18,3 @@ /************************************************************************************************ | ||
const { getMetadata } = require('@adempiere/grpc-api/src/utils/metadata.js'); | ||
const { getValidId, getTimestamp, convertStringToBoolean } = require('@adempiere/grpc-api/src/utils/valueUtils.js'); | ||
const { getValidId, getTimestamp, convertStringToBoolean, getTypeOfValue } = require('@adempiere/grpc-api/src/utils/valueUtils.js'); | ||
@@ -274,3 +274,4 @@ class MatchPORReceiptInvoice | ||
dateto, | ||
isSameQuantity | ||
isSameQuantity, | ||
matchFromSelectedId | ||
}, callback) { | ||
@@ -285,6 +286,10 @@ const { ListMatchedToRequest } = this.stubFile; | ||
request.setMatchToType(matchToType); | ||
request.setVendorId(vendorId); | ||
request.setProductId(productId); | ||
const vendorIdConverted = parseInt(vendorId); | ||
request.setVendorId(vendorIdConverted); | ||
const productIdConverted = parseInt(productId); | ||
request.setProductId(productIdConverted); | ||
request.setDateFrom(dateFrom); | ||
request.setDateTo(dateto); | ||
const matchFromSelectedIdConverted = parseInt(matchFromSelectedId) | ||
request.setMatchFromSelectedId(matchFromSelectedIdConverted); | ||
const isSameQuantityConverted = convertStringToBoolean(isSameQuantity) | ||
@@ -306,7 +311,4 @@ request.setIsSameQuantity(isSameQuantityConverted); | ||
*/ | ||
Process({ | ||
token, | ||
pageSize, | ||
pageToken, | ||
matchMode, | ||
@@ -316,9 +318,7 @@ matchFromType, | ||
matchFromSelectedId, | ||
matchedToSelections, | ||
matchedToSelectionsList = [], | ||
quantity | ||
}, callback) { | ||
const { ProcessRequest } = this.stubFile; | ||
const { ProcessRequest, Matched } = this.stubFile; | ||
const request = new ProcessRequest(); | ||
request.setPageSize(pageSize); | ||
request.setPageToken(pageToken); | ||
request.setMatchMode(matchMode); | ||
@@ -328,4 +328,31 @@ request.setMatchFromType(matchFromType); | ||
request.setMatchFromSelectedId(matchFromSelectedId); | ||
request.setMatchedToSelections(matchedToSelections); | ||
request.setQuantity(quantity); | ||
const { getDecimalToGRPC } = require('@adempiere/grpc-api/src/utils/baseDataTypeToGRPC.js'); | ||
request.setQuantity( | ||
getDecimalToGRPC(quantity) | ||
); | ||
if (getTypeOfValue(matchedToSelectionsList) === 'String') { | ||
matchedToSelectionsList = JSON.parse(matchedToSelectionsList); | ||
} | ||
// payment selections list | ||
matchedToSelectionsList.forEach(matchSelection => { | ||
let parsedMatchSelection = matchSelection; | ||
if (getTypeOfValue(matchSelection) === 'String') { | ||
parsedMatchSelection = JSON.parse(matchSelection); | ||
} | ||
const matchedInstance = new Matched(); | ||
matchedInstance.setId(matchSelection.id); | ||
matchedInstance.setUuid(matchSelection.uuid); | ||
matchedInstance.setQuantity( | ||
getDecimalToGRPC(matchSelection.quantity) | ||
); | ||
matchedInstance.getMatchedQuantity( | ||
getDecimalToGRPC(matchSelection.matchedQuantity) | ||
); | ||
request.addMatchedToSelections(matchedInstance); | ||
}); | ||
const metadata = getMetadata({ | ||
@@ -332,0 +359,0 @@ token |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6542628
185648