gongchunyi
7 天以前 60f203c15fc1c7a35f1e742259e165391ede032a
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -30,7 +30,7 @@
        pm.model as specification_model,
        pm.unit as unit,
        CASE
        WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >0 THEN 1
        WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >= (IFNULL(T1.quantity, 0) - IFNULL(t3.shipped_quantity, 0)) THEN 1
        ELSE 0
        END as has_sufficient_stock,
        (IFNULL(T1.quantity, 0) - IFNULL(t3.shipped_quantity, 0)) as no_quantity,
@@ -74,8 +74,6 @@
                    (sir.batch_no IS NOT NULL AND sir.batch_no LIKE CONCAT('%-', slp.id))
                    OR (sir.batch_no IS NULL AND sir.product_model_id = slp.product_model_id)
                )
            WHERE sir.approval_status = 1
            UNION ALL
            SELECT slp.id AS sales_ledger_product_id,
@@ -88,7 +86,6 @@
                ON slp.type = 2
                AND slp.sales_ledger_id = qi.purchase_ledger_id
                AND slp.product_model_id = qi.product_model_id
            WHERE sir.approval_status = 1
        ) rel
        GROUP BY rel.sales_ledger_product_id
        ) t4 ON t4.sales_ledger_product_id = T1.id