|
|
@@ -191,6 +191,9 @@
|
|
|
<if test="saleDetailDto.storageId !=null and saleDetailDto.storageId != ''">
|
|
|
and po.storage_id=#{saleDetailDto.storageId}
|
|
|
</if>
|
|
|
+ <if test="saleDetailDto.businessSource !=null and saleDetailDto.businessSource != ''">
|
|
|
+ and po.business_source=#{saleDetailDto.businessSource}
|
|
|
+ </if>
|
|
|
<if test="saleDetailDto.customerName !=null and saleDetailDto.customerName != ''">
|
|
|
and po.customer_name like concat('%', #{saleDetailDto.customerName}, '%')
|
|
|
</if>
|
|
|
@@ -271,7 +274,6 @@
|
|
|
END AS actualPaymentStatus,
|
|
|
poi.brand_name AS brandName,
|
|
|
poi.goods_name AS goodsName,
|
|
|
- poi.goods_id AS goodsId,
|
|
|
poi.property_name AS propertyName,
|
|
|
poi.pattern AS pattern,
|
|
|
CASE
|
|
|
@@ -299,10 +301,10 @@
|
|
|
IF
|
|
|
( poi.goods_num, poi.goods_num, 0 )
|
|
|
WHEN 'TKXS' THEN
|
|
|
- IF
|
|
|
+ 0 -IF
|
|
|
( poi.returns_number, poi.returns_number, 0 )
|
|
|
WHEN 'TKCG' THEN
|
|
|
- IF
|
|
|
+ 0 -IF
|
|
|
( poi.returns_number, poi.returns_number, 0 ) ELSE 0
|
|
|
END AS goodsNum,
|
|
|
IF
|
|
|
@@ -319,10 +321,10 @@
|
|
|
IF
|
|
|
( poi.sub_total_money, poi.sub_total_money, 0 )
|
|
|
WHEN 'TKXS' THEN
|
|
|
- IF
|
|
|
+ 0 - IF
|
|
|
( poi.returns_amount, poi.returns_amount, 0 )
|
|
|
WHEN 'TKCG' THEN
|
|
|
- IF
|
|
|
+ 0 - IF
|
|
|
( poi.returns_amount, poi.returns_amount, 0 ) ELSE 0
|
|
|
END AS subTotalMoney,
|
|
|
CASE
|
|
|
@@ -337,9 +339,11 @@
|
|
|
IF
|
|
|
( poi.costprie, poi.costprie, 0 )
|
|
|
WHEN 'TKXS' THEN
|
|
|
+ 0 -
|
|
|
IF
|
|
|
( poi.costprie, poi.costprie, 0 )
|
|
|
WHEN 'TKCG' THEN
|
|
|
+ 0 -
|
|
|
IF
|
|
|
( poi.costprie, poi.costprie, 0 ) ELSE 0
|
|
|
END AS costprie,
|
|
|
@@ -361,13 +365,13 @@
|
|
|
IF
|
|
|
( poi.costprie, poi.costprie, 0 )
|
|
|
WHEN 'TKXS' THEN
|
|
|
- (
|
|
|
+ 0 - (
|
|
|
IF
|
|
|
( poi.returns_amount, poi.returns_amount, 0 ) -
|
|
|
IF
|
|
|
( poi.costprie, poi.costprie, 0 ))
|
|
|
WHEN 'TKCG' THEN
|
|
|
- (
|
|
|
+ 0 - (
|
|
|
IF
|
|
|
( poi.returns_amount, poi.returns_amount, 0 ) -
|
|
|
IF
|
|
|
@@ -395,6 +399,9 @@
|
|
|
<if test="customerName !=null and customerName != ''">
|
|
|
and po.customer_name like concat('%', #{customerName}, '%')
|
|
|
</if>
|
|
|
+ <if test="businessSource !=null and businessSource != ''">
|
|
|
+ and po.business_source=#{businessSource}
|
|
|
+ </if>
|
|
|
<if test="code !=null and code != ''">
|
|
|
and poi.goods_no like concat('%', #{code}, '%')
|
|
|
</if>
|