const searchInventoryBalance = () => {
try {
const inventoryBalanceSearch = search.create({
type: search.Type.INVENTORY_BALANCE,
filters: [],
columns: [
{
name: 'internalid',
join: 'item',
},
{
name: 'itemid',
join: 'item',
},
{
name: 'displayname',
join: 'item',
},
{ name: 'location' },
{ name: 'binnumber' },
{ name: 'inventorynumber' },
{ name: 'onhand' },
{ name: 'available' },
],
});
const inventoryBalanceCount = inventoryBalanceSearch.runPaged().count;
if (inventoryBalanceCount) {
const pagedData = inventoryBalanceSearch.runPaged({ 'pageSize': 1000 });
for (let i = 0; i < pagedData.pageRanges.length; i += 1) {
const currentPage = pagedData.fetch(i);
// eslint-disable-next-line no-loop-func,array-callback-return,consistent-return
currentPage.data.some((result) => {
const internalId = result.getValue({
name: 'internalid',
join: 'item',
});
const itemCode = result.getValue({
name: 'itemid',
join: 'item',
});
const itemName = result.getValue({
name: 'displayname',
join: 'item',
});
const locationId = result.getValue({ name: 'location' });
const locationName = result.getText({ name: 'location' });
const binNumberId = result.getValue({ name: 'binnumber' });
const binNumberName = result.getText({ name: 'binnumber' });
const inventoryNumberId = result.getValue({ name: 'inventorynumber' });
const inventoryNumberName = result.getText({ name: 'inventorynumber' });
const onHand = result.getValue({ name: 'onhand' });
const available = result.getValue({ name: 'available' });
queryResult.data.push({
internalId,
itemCode,
itemName,
locationId,
locationName,
binNumberId,
binNumberName,
inventoryNumberId,
inventoryNumberName,
onHand,
available,
});
});
}
}
} catch (e) {
}
};
NETSUITE:INVENTORY_BALANCE 查询当前库存余额情况
最新推荐文章于 2024-09-11 15:33:18 发布