chenlu
2025-08-19 eeb0d39b6e2152b16813b25d2e2a0c5333d0f928
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -452,13 +452,13 @@
                    )  as minQuantity -- 修改最小数
            </if>
            <if test="nextProcess == null or nextProcess == ''">  -- 最后一道工序
#               c.received_quantity, -- 已入库数量
#               c.inventory_quantity, --   库存数量
               c.received_quantity, -- 已入库数量
               c.inventory_quantity, --   库存数量
              if(ifnull(inventory_quantity,0)
                 -ifnull(c.received_quantity,0)
                 &gt;= a.completed_quantity,0,
                (a.completed_quantity-(ifnull(c.inventory_quantity,0)
                    -ifnull(c.received_quantity,0)))
                 &gt;= a.completed_quantity,a.completed_quantity,
                (ifnull(c.inventory_quantity,0)
                -ifnull(c.received_quantity,0))
                )
                as minQuantity -- 修改最小数
            </if>