|
@@ -6,16 +6,16 @@
|
|
|
de.cDepName,
|
|
|
cc.cCusAbbName as cVenAbbName,
|
|
|
convert(char(7),ssd.dPreDate,120) yearMonth,
|
|
|
- ssd.iNatUnitPrice,
|
|
|
+ ssd.iTaxUnitPrice*ss.iExchRate as iNatUnitPrice,
|
|
|
sum(ssd.iQuantity) as iQuantity,
|
|
|
- sum(ssd.iNatUnitPrice*ssd.iQuantity) as iNatMoney
|
|
|
+ sum(ssd.iTaxUnitPrice*ss.iExchRate*ssd.iQuantity) as iNatMoney
|
|
|
FROM
|
|
|
SO_SOMain ss
|
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
|
case when cSCloser is null then iQuantity else foutquantity end as iQuantity,
|
|
|
iNatMoney,
|
|
|
- iNatUnitPrice,
|
|
|
+ iTaxUnitPrice,
|
|
|
dPreDate,
|
|
|
ID
|
|
|
FROM
|
|
@@ -42,23 +42,23 @@
|
|
|
and cc.cCusAbbName = #{map.customer}
|
|
|
</if>
|
|
|
</where>
|
|
|
- GROUP BY de.cDepName,ss.cCusCode,convert(char(7),ssd.dPreDate,120),ssd.iNatUnitPrice,cc.cCusAbbName
|
|
|
+ GROUP BY de.cDepName,ss.cCusCode,convert(char(7),ssd.dPreDate,120),ssd.iTaxUnitPrice,cc.cCusAbbName
|
|
|
--ORDER BY
|
|
|
- --de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ssd.dPreDate, 120 ),ssd.iNatUnitPrice
|
|
|
+ --de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ssd.dPreDate, 120 ),ssd.iTaxUnitPrice
|
|
|
</select>
|
|
|
|
|
|
<select id="QuerySO_SOMainReportBydepartment" resultType="org.jeecg.modules.report.entity.SoSoDetails">
|
|
|
SELECT
|
|
|
cc.cCusAbbName as cCusName,
|
|
|
sum(ssd.iQuantity) as iQuantity,
|
|
|
- sum(ssd.iNatUnitPrice*ssd.iQuantity) as iNatMoney
|
|
|
+ sum(ssd.iTaxUnitPrice*ss.iExchRate*ssd.iQuantity) as iNatMoney
|
|
|
FROM
|
|
|
SO_SOMain ss
|
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
|
case when cSCloser is null then iQuantity else foutquantity end as iQuantity,
|
|
|
iNatMoney,
|
|
|
- iNatUnitPrice,
|
|
|
+ iTaxUnitPrice,
|
|
|
dPreDate,
|
|
|
ID
|
|
|
FROM
|
|
@@ -93,14 +93,14 @@
|
|
|
SELECT
|
|
|
de.cDepName,
|
|
|
sum(ssd.iQuantity) as iQuantity,
|
|
|
- sum(ssd.iNatUnitPrice*ssd.iQuantity) as iNatMoney
|
|
|
+ sum(ssd.iTaxUnitPrice*ss.iExchRate*ssd.iQuantity) as iNatMoney
|
|
|
FROM
|
|
|
SO_SOMain ss
|
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
|
case when cSCloser is null then iQuantity else foutquantity end as iQuantity,
|
|
|
iNatMoney,
|
|
|
- iNatUnitPrice,
|
|
|
+ iTaxUnitPrice,
|
|
|
dPreDate,
|
|
|
ID
|
|
|
FROM
|