|
@@ -1079,6 +1079,7 @@
|
|
|
sc.dict_label AS ffeeunitidName,/*计价单位中文名*/
|
|
|
td.fqty AS fqty,/*数量*/
|
|
|
td.famount AS famount,/*金额*/
|
|
|
+ tr.f_name AS fsbuName,/*开票公司*/
|
|
|
round(td.price,2) AS price/*单价*/
|
|
|
<if test="groupDate != null and groupDate == 0">
|
|
|
,td.fBsdate AS fBsdate/*入库日期*/
|
|
@@ -1092,6 +1093,7 @@
|
|
|
tc.fcurrency,
|
|
|
tc.ffeeunitid,
|
|
|
tc.fBsdate,
|
|
|
+ tc.fSbu,
|
|
|
IFNULL( SUM( tc.fqty ), 0 ) fqty,
|
|
|
IFNULL( SUM( tc.famount ), 0 ) famount,
|
|
|
IFNULL( SUM( tc.famount )/ SUM( tc.fqty ), 0 ) price
|
|
@@ -1111,6 +1113,7 @@
|
|
|
tw.f_qty fqty,
|
|
|
/*实际数量*/
|
|
|
tw.f_amount famount, /*金额*/
|
|
|
+ tb.f_sbu fSbu,/*开票公司*/
|
|
|
tw.f_bsdate fBsdate/*出库日期*/
|
|
|
FROM
|
|
|
t_warehousebillsfees tw
|
|
@@ -1133,17 +1136,21 @@
|
|
|
<if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
|
|
|
and tb.f_bsdate <= #{cLoadDate[1]}
|
|
|
</if>
|
|
|
+ <if test="fSbu != null ">and tb.f_sbu = #{fSbu}</if>
|
|
|
) tc
|
|
|
GROUP BY
|
|
|
tc.fgoodsid,
|
|
|
tc.ffeetype,
|
|
|
tc.fname,
|
|
|
tc.fcurrency,
|
|
|
- tc.ffeeunitid
|
|
|
- <if test="groupDate != null and groupDate == 0">,tc.fBsdate</if>
|
|
|
-
|
|
|
+ tc.ffeeunitid,
|
|
|
+ tc.fSbu
|
|
|
+ <if test="groupDate != null and groupDate == 0">
|
|
|
+ ,tc.fBsdate
|
|
|
+ </if>
|
|
|
) td
|
|
|
LEFT JOIN t_project tp ON td.fgoodsid = tp.f_id
|
|
|
+ LEFT JOIN t_corps tr ON tr.f_id = td.fSbu
|
|
|
LEFT JOIN sys_dict_data sc ON sc.dict_value = td.ffeeunitid AND sc.dict_type = 'data_unitfees'
|
|
|
LEFT JOIN sys_dict_data si ON si.dict_value = td.ffeetype AND si.dict_type = 'data_cost_attribute'
|
|
|
ORDER BY
|