|
|
@ -38,7 +38,7 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
export function getBalanceByManagementPrecision(label, locationCode, callback) { |
|
|
|
export function getBalanceByManagementPrecision(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
list: [], |
|
|
|
success: true, |
|
|
@ -53,25 +53,25 @@ export function getBalanceByManagementPrecision(label, locationCode, callback) { |
|
|
|
let managementPrecision = res.data[0].ManagementPrecision; |
|
|
|
switch (managementPrecision) { |
|
|
|
case 'BY_PACKAGING': |
|
|
|
byPacking(label, locationCode, res => { |
|
|
|
byPacking(label, locationCode,fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_BATCH': |
|
|
|
byBatch(label, locationCode, res => { |
|
|
|
byBatch(label, locationCode,fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_QUANTITY': |
|
|
|
byQuantity(label, locationCode, res => { |
|
|
|
byQuantity(label, locationCode,fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_UNIQUEID': |
|
|
|
byUniqueId(label, res => { |
|
|
|
byUniqueId(label,fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
@ -90,7 +90,7 @@ export function getBalanceByManagementPrecision(label, locationCode, callback) { |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byPacking(label, locationCode, callback) { |
|
|
|
export function byPacking(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
success: true, |
|
|
|
message: '', |
|
|
@ -98,12 +98,12 @@ export function byPacking(label, locationCode, callback) { |
|
|
|
}; |
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "packing_number", |
|
|
|
column: "packingNumber", |
|
|
|
action: "==", |
|
|
|
value: label.packingNumber |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "item_code", |
|
|
|
column: "itemCode", |
|
|
|
action: "==", |
|
|
|
value: label.itemCode |
|
|
|
}) |
|
|
@ -113,10 +113,18 @@ export function byPacking(label, locationCode, callback) { |
|
|
|
value: label.batch |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "location_code", |
|
|
|
column: "locationCode", |
|
|
|
action: "==", |
|
|
|
value: locationCode |
|
|
|
}) |
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
|
value: fromInventoryStatuses |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
@ -149,10 +157,10 @@ export function byPacking(label, locationCode, callback) { |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byBatch(label, locationCode, callback) { |
|
|
|
export function byBatch(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "item_code", |
|
|
|
column: "itemCode", |
|
|
|
action: "==", |
|
|
|
value: label.itemCode |
|
|
|
}) |
|
|
@ -162,11 +170,19 @@ export function byBatch(label, locationCode, callback) { |
|
|
|
value: label.batch |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "location_code", |
|
|
|
column: "locationCode", |
|
|
|
action: "==", |
|
|
|
value: locationCode |
|
|
|
}) |
|
|
|
|
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
|
value: fromInventoryStatuses |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
@ -202,7 +218,7 @@ export function byBatch(label, locationCode, callback) { |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byQuantity(label, locationCode, callback) { |
|
|
|
export function byQuantity(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
success: true, |
|
|
|
message: '', |
|
|
@ -211,16 +227,24 @@ export function byQuantity(label, locationCode, callback) { |
|
|
|
|
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "item_code", |
|
|
|
column: "itemCode", |
|
|
|
action: "==", |
|
|
|
value: label.itemCode |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "location_code", |
|
|
|
column: "locationCode", |
|
|
|
action: "==", |
|
|
|
value: locationCode |
|
|
|
}) |
|
|
|
|
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
|
value: fromInventoryStatuses |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
@ -250,7 +274,7 @@ export function byQuantity(label, locationCode, callback) { |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byUniqueId(label, locationCode, callback) { |
|
|
|
export function byUniqueId(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
let param = { |
|
|
|
packingNumber: label.packingNumber |
|
|
|
}; |
|
|
@ -262,11 +286,19 @@ export function byUniqueId(label, locationCode, callback) { |
|
|
|
|
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "packing_number", |
|
|
|
column: "packingNumber", |
|
|
|
action: "==", |
|
|
|
value: label.packingNumber |
|
|
|
}) |
|
|
|
|
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
|
value: fromInventoryStatuses |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
@ -305,7 +337,7 @@ export function balanceByLocation(locationCode, callback) { |
|
|
|
|
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "location_code", |
|
|
|
column: "locationCode", |
|
|
|
action: "==", |
|
|
|
value: locationCode |
|
|
|
}) |
|
|
|