gongchunyi
2026-06-23 2f46221d32e25045a1f4d9eff852d9a612e47dbc
fix: 出入库金额查询产品明细表
已修改3个文件
16 ■■■■ 文件已修改
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/InvoiceLedgerMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
@@ -206,8 +206,8 @@
        LEFT JOIN (
            SELECT
                pl.supplier_id,
                SUM(IFNULL(slp.stocked_quantity, 0) * IFNULL(slp.tax_inclusive_unit_price, 0)) AS paymentAmount,
                SUM((IFNULL(slp.quantity, 0) - IFNULL(slp.stocked_quantity, 0)) * IFNULL(slp.tax_inclusive_unit_price, 0)) AS payableAmount
                SUM(IFNULL(slp.stocked_quantity, 0) * IF(IFNULL(slp.quantity, 0) > 0, slp.tax_inclusive_total_price / slp.quantity, 0)) AS paymentAmount,
                SUM((IFNULL(slp.quantity, 0) - IFNULL(slp.stocked_quantity, 0)) * IF(IFNULL(slp.quantity, 0) > 0, slp.tax_inclusive_total_price / slp.quantity, 0)) AS payableAmount
            FROM purchase_ledger pl
            JOIN sales_ledger_product slp ON pl.id = slp.sales_ledger_id AND slp.type = 2
            GROUP BY pl.supplier_id
@@ -226,8 +226,8 @@
        LEFT JOIN (
            SELECT
                sales_ledger_id,
                SUM(IFNULL(stocked_quantity, 0) * IFNULL(tax_inclusive_unit_price, 0)) AS paymentAmount,
                SUM((IFNULL(quantity, 0) - IFNULL(stocked_quantity, 0)) * IFNULL(tax_inclusive_unit_price, 0)) AS payableAmount
                SUM(IFNULL(stocked_quantity, 0) * IF(IFNULL(quantity, 0) > 0, tax_inclusive_total_price / quantity, 0)) AS paymentAmount,
                SUM((IFNULL(quantity, 0) - IFNULL(stocked_quantity, 0)) * IF(IFNULL(quantity, 0) > 0, tax_inclusive_total_price / quantity, 0)) AS payableAmount
            FROM sales_ledger_product
            WHERE type = 2
            GROUP BY sales_ledger_id
src/main/resources/mapper/sales/InvoiceLedgerMapper.xml
@@ -127,8 +127,8 @@
        LEFT JOIN (
            SELECT
                sl.customer_id,
                SUM(IFNULL(slp.shipped_quantity, 0) * IFNULL(slp.tax_inclusive_unit_price, 0)) AS receipt_payment_amount,
                SUM((IFNULL(slp.stocked_quantity, 0) - IFNULL(slp.shipped_quantity, 0)) * IFNULL(slp.tax_inclusive_unit_price, 0)) AS unReceipt_payment_amount
                SUM(IFNULL(slp.shipped_quantity, 0) * IF(IFNULL(slp.quantity, 0) > 0, slp.tax_inclusive_total_price / slp.quantity, 0)) AS receipt_payment_amount,
                SUM((IFNULL(slp.stocked_quantity, 0) - IFNULL(slp.shipped_quantity, 0)) * IF(IFNULL(slp.quantity, 0) > 0, slp.tax_inclusive_total_price / slp.quantity, 0)) AS unReceipt_payment_amount
            FROM sales_ledger sl
            JOIN sales_ledger_product slp ON sl.id = slp.sales_ledger_id AND slp.type = 1
            GROUP BY sl.customer_id
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml
@@ -445,8 +445,8 @@
        LEFT JOIN (
            SELECT
                sales_ledger_id,
                SUM(IFNULL(shipped_quantity, 0) * IFNULL(tax_inclusive_unit_price, 0)) AS receipt_payment_amount,
                SUM((IFNULL(stocked_quantity, 0) - IFNULL(shipped_quantity, 0)) * IFNULL(tax_inclusive_unit_price, 0)) AS unReceipt_payment_amount
                SUM(IFNULL(shipped_quantity, 0) * IF(IFNULL(quantity, 0) > 0, tax_inclusive_total_price / quantity, 0)) AS receipt_payment_amount,
                SUM((IFNULL(stocked_quantity, 0) - IFNULL(shipped_quantity, 0)) * IF(IFNULL(quantity, 0) > 0, tax_inclusive_total_price / quantity, 0)) AS unReceipt_payment_amount
            FROM sales_ledger_product
            WHERE type = 1
            GROUP BY sales_ledger_id