|
@@ -21,7 +21,7 @@
|
|
|
SELECT
|
|
|
max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
|
|
|
max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department,
|
|
|
- max(cc.cCusAbbName) as customerShortame,v.cVenName as processUnit,min(rd.dDate) as outdata,
|
|
|
+ max(cc.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(rd.dDate) as outdata,
|
|
|
max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal,
|
|
|
sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity
|
|
|
FROM UFDATA_101_2021.dbo.SO_SODetails s
|
|
@@ -44,14 +44,14 @@
|
|
|
inner JOIN UFDATA_101_2021.dbo.Person pe ON ss.cPersonCode = pe.cPersonCode
|
|
|
inner JOIN UFDATA_101_2021.dbo.Department de ON ss.cDepCode = de.cDepCode
|
|
|
inner JOIN UFDATA_101_2021.dbo.Customer cc ON ss.cCusCode = cc.cCusCode
|
|
|
- WHERE c.cInvCcode like '19%' GROUP BY v.cVenName
|
|
|
+ WHERE c.cInvCcode like '19%' GROUP BY v.cVenAbbName
|
|
|
|
|
|
union all
|
|
|
|
|
|
SELECT
|
|
|
max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
|
|
|
max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department,
|
|
|
- max(cu.cCusAbbName) as customerShortame,v.cVenName as processUnit,min(rd.dDate) as outdata,
|
|
|
+ max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(rd.dDate) as outdata,
|
|
|
max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal,
|
|
|
sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity
|
|
|
FROM UFDATA_103_2021.dbo.SO_SODetails a
|
|
@@ -80,7 +80,7 @@
|
|
|
inner JOIN UFDATA_102_2021.dbo.rdrecord32 rd on rd.ID=rds.ID
|
|
|
inner join UFDATA_102_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode
|
|
|
inner JOIN UFDATA_102_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode
|
|
|
- WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenName
|
|
|
+ WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
|
|
|
|
|
|
|
|
|
union all
|
|
@@ -88,7 +88,7 @@
|
|
|
SELECT
|
|
|
max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
|
|
|
max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department,
|
|
|
- max(cu.cCusAbbName) as customerShortame,v.cVenName as processUnit,min(rd.dDate) as outdata,
|
|
|
+ max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(rd.dDate) as outdata,
|
|
|
max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal,
|
|
|
sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity
|
|
|
FROM UFDATA_103_2021.dbo.SO_SODetails a
|
|
@@ -117,6 +117,6 @@
|
|
|
inner JOIN UFDATA_101_2021.dbo.rdrecord32 rd on rd.ID=rds.ID
|
|
|
inner join UFDATA_101_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode
|
|
|
inner JOIN UFDATA_101_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode
|
|
|
- WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenName
|
|
|
+ WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
|
|
|
</select>
|
|
|
</mapper>
|