|
@@ -866,14 +866,14 @@
|
|
and company_id = #{companyId}
|
|
and company_id = #{companyId}
|
|
</if>) t4
|
|
</if>) t4
|
|
join (
|
|
join (
|
|
- select round(sum(t2.price * t2.qty), 2) as 'purchaseCost'
|
|
|
|
|
|
+ select round(sum(t2.price * t2.in_qty), 2) as 'purchaseCost'
|
|
from kwaixiaodian_jst_purchase t1
|
|
from kwaixiaodian_jst_purchase t1
|
|
left join kwaixiaodian_jst_purchase_items t2
|
|
left join kwaixiaodian_jst_purchase_items t2
|
|
on t1.po_id = t2.po_id
|
|
on t1.po_id = t2.po_id
|
|
where t1.po_date >= concat(date_format(#{start}, '%Y-%m-%d'), '00:00:01')
|
|
where t1.po_date >= concat(date_format(#{start}, '%Y-%m-%d'), '00:00:01')
|
|
and t1.po_date <= concat(date_format(#{end}, '%Y-%m-%d'), '23:59:59')
|
|
and t1.po_date <= concat(date_format(#{end}, '%Y-%m-%d'), '23:59:59')
|
|
and t1.status in ('Confirmed', 'Finished')) t5
|
|
and t1.status in ('Confirmed', 'Finished')) t5
|
|
- join (select round(sum(t2.price * t2.qty), 2) as 'purchaseCost'
|
|
|
|
|
|
+ join (select round(sum(t2.price * t2.in_qty), 2) as 'purchaseCost'
|
|
from kwaixiaodian_jst_purchase t1
|
|
from kwaixiaodian_jst_purchase t1
|
|
left join kwaixiaodian_jst_purchase_items t2
|
|
left join kwaixiaodian_jst_purchase_items t2
|
|
on t1.po_id = t2.po_id
|
|
on t1.po_id = t2.po_id
|