0

我面临的问题是 NetSuite 序列号/批号可以重复如下图所示

在此处输入图像描述

我想通过设置/开发或退一步,一份报告/ SuiteQL 来监控重复的批号,以防止出现重复的批号。

提前感谢您的任何提示!

4

1 回答 1

0

我想我已经克服了监控重复批号的问题,就像下面的截图一样。 在此处输入图像描述

感谢SuiteQL 查询工具的支持 你可能会得到下面的 SQL。

--2022/3/4 Query Lot/Serial Number Duplicate Purchase Order
SELECT
    B.tran_id,
    A.inventory_number
FROM
(
SELECT
    inventoryNumber.inventorynumber AS inventory_number
FROM
    transaction INNER JOIN
        transactionLine ON transaction.id = transactionLine.transaction
    INNER JOIN
        inventoryAssignment ON (transactionLine.id = inventoryAssignment.transactionline
        AND
        transactionLine.transaction = inventoryAssignment.transaction )
    INNER JOIN
        inventoryNumber ON inventoryAssignment.inventorynumber = inventoryNumber.id
WHERE
    UPPER(transaction.type) IN ('PURCHORD')
GROUP BY
    inventoryNumber.inventorynumber
HAVING COUNT(inventoryNumber.inventorynumber) > 1
) AS A
JOIN
(
    SELECT
    transaction.tranid AS tran_id,
    inventoryNumber.inventorynumber AS lot_number
FROM
    transaction FULL JOIN
        transactionLine ON transaction.id = transactionLine.transaction
    INNER JOIN
        inventoryAssignment ON (transactionLine.id = inventoryAssignment.transactionline
        AND
        transactionLine.transaction = inventoryAssignment.transaction )
    INNER JOIN
        inventoryNumber ON inventoryAssignment.inventorynumber = inventoryNumber.id
WHERE
    UPPER(transaction.type) IN ('PURCHORD')
) AS B
    ON A.inventory_number = B.lot_number
于 2022-03-04T09:57:38.880 回答