fix:订单配备货相关问题
parent
eb1f4fb7b3
commit
134ca89b9a
|
|
@ -934,23 +934,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
t3.type as product_type,
|
||||
t7.vendor_code,
|
||||
t7.vendor_name,
|
||||
t1.quantity as order_num,
|
||||
(select sum(quantity) from project_product_info as tt where tt.product_bom_code = t1.product_bom_code and tt.project_id = t1.project_id) as order_num,
|
||||
sum(ifnull(t5.bind_num, 0)) as ph_num,
|
||||
ifnull(t6.bh_num,0) as bh_num,
|
||||
(select count(1) from oms_inventory_info as tt where tt.order_code = t1.order_code and tt.product_code = t1.product_bom_code) as bh_num,
|
||||
sum(ifnull(t5.bind_num, 0) * t4.price) as sum_cost
|
||||
from project_product_info as t1
|
||||
inner join project_order_info as t2 on t1.project_id = t2.project_id
|
||||
from (
|
||||
select
|
||||
tt1.product_bom_code,
|
||||
sum(tt1.quantity) as quantity,
|
||||
tt1.project_id,
|
||||
tt2.id as order_id,
|
||||
tt2.order_code
|
||||
from project_product_info as tt1
|
||||
inner join project_order_info as tt2 on tt1.project_id = tt2.project_id
|
||||
where tt2.order_code = #{orderCode}
|
||||
group by tt1.product_bom_code
|
||||
)as t1
|
||||
inner join product_info as t3 on t1.product_bom_code = t3.product_code
|
||||
left join oms_purchase_order_item as t4 on t3.product_code = t4.product_code
|
||||
left join oms_purchase_order_map as t5 on t2.id = t5.order_id and t4.purchase_id = t5.purchase_id and t5.product_code = t4.product_code
|
||||
left join (
|
||||
select count(1) bh_num, product_code
|
||||
from oms_inventory_info
|
||||
where order_code = #{orderCode}
|
||||
group by product_code
|
||||
) t6 on t3.product_code = t6.product_code
|
||||
left join oms_purchase_order_map as t5 on t1.order_id = t5.order_id and t4.purchase_id = t5.purchase_id and t5.product_code = t4.product_code
|
||||
left join oms_vendor_info as t7 on t3.vendor_code = t7.vendor_code
|
||||
where t2.order_code = #{orderCode}
|
||||
group by t3.product_code, t3.model
|
||||
order by t3.type, t3.product_code
|
||||
</select>
|
||||
|
|
@ -1112,7 +1115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
t4.product_code,
|
||||
0 as price,
|
||||
0 as all_price,
|
||||
count(1) as quantity,
|
||||
sum(t3.quantity) as quantity,
|
||||
ifnull(t3.tax_rate,13) / 100 as tax_rate,
|
||||
cast(0 - 0 / (1 + ifnull(t3.tax_rate,13) / 100) as decimal(10,2)) as tax_total,
|
||||
t4.type,
|
||||
|
|
|
|||
Loading…
Reference in New Issue