|
|
@ -81,7 +81,7 @@ namespace ICSSoft.DataProject |
|
|
|
|
|
|
|
string ERPupdate = @"update ICSDeliveryNotice set DNCode='{0}',Sequence='{1}',DNID='{2}',DNDetailID='{3}'
|
|
|
|
where PODetailID='{4}' AND DNType='1' AND DNCode='{5}' and Sequence='{6}'";
|
|
|
|
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["PODetailID"],DNCode, det["Sequence"].ToString().Substring(0, det["Sequence"].ToString().Length - 1)); |
|
|
|
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["PODetailID"],DNCode, det["WMSSequence"]); |
|
|
|
|
|
|
|
if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd)) |
|
|
|
{ |
|
|
@ -189,7 +189,7 @@ INTO #NewTempERP |
|
|
|
from ICSWareHouseLotInfoLog |
|
|
|
WHERE Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' |
|
|
|
|
|
|
|
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,CASE WHEN(LEN(f.DNDetailID)=36) THEN '' ELSE f.DNCode END AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence, |
|
|
|
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,f.DNID AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence, |
|
|
|
a.InvCode,SUM(a.Quantity) AS Quantity,CASE inv.AmountEnable WHEN '1' THEN SUM(a.Quantity*(lot.Amount/lot.Quantity)) ELSE '0' END AS Amount,isnull((c.UnitPrice),0) as UnitPrice,c.Currency,c.PODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,case when ConErp.enable=1 then f.DNDetailID else '' end AS DNDetailID,conWhCode.Enable AS ErpWhCode |
|
|
|
,a.WorkPoint,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END AS BatchCode,ISNULL(ext.Version, '') AS Version,ISNULL(ext.Brand, '') AS Brand, |
|
|
|
ISNULL(ext.cFree1, '') AS cFree1,ISNULL(ext.cFree2, '') AS cFree2,ISNULL(ext.cFree3, '') AS cFree3,ISNULL(ext.cFree4, '') AS cFree4,ISNULL(ext.cFree5, '') AS cFree5,ISNULL(ext.cFree6, '') AS cFree6,ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFree9, '') AS cFree9,ISNULL(ext.cFree10, '') AS cFree10 |
|
|
@ -213,7 +213,7 @@ LEFT JOIN ICSConfiguration conWhCode ON conWhCode.Code='ERPWHCode' AND a.WorkPoi |
|
|
|
where ISNULL(extd.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(extd.BatchCode, '') ELSE '' END+'~'+ISNULL(extd.Version, '')+'~'+ISNULL(extd.Brand, '')+'~'+ |
|
|
|
ISNULL(extd.cFree1, '')+'~'+ISNULL(extd.cFree2, '')+'~'+ISNULL(extd.cFree3, '')+'~'+ISNULL(extd.cFree4, '')+'~'+ISNULL(extd.cFree5, '')+'~'+ISNULL(extd.cFree6, '')+'~'+ISNULL(extd.cFree7, '')+'~'+ISNULL(extd.cFree8, '')+'~'+ISNULL(extd.cFree9, '')+'~'+ISNULL(extd.cFree10, '')=ISNULL(ext.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END+'~'+ISNULL(ext.Version, '')+'~'+ISNULL(ext.Brand, '')+'~'+ |
|
|
|
ISNULL(ext.cFree1, '')+'~'+ISNULL(ext.cFree2, '')+'~'+ISNULL(ext.cFree3, '')+'~'+ISNULL(ext.cFree4, '')+'~'+ISNULL(ext.cFree5, '')+'~'+ISNULL(ext.cFree6, '')+'~'+ISNULL(ext.cFree7, '')+'~'+ISNULL(ext.cFree8, '')+'~'+ISNULL(ext.cFree9, '')+'~'+ISNULL(ext.cFree10, '') |
|
|
|
GROUP BY conWhCode.Enable,ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.Enable |
|
|
|
GROUP BY conWhCode.Enable,ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.Enable |
|
|
|
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), |
|
|
|
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, ''),f.DNCode |
|
|
|
|
|
|
@ -221,25 +221,22 @@ where ISNULL(extd.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND |
|
|
|
SELECT Costre, Costre2,Sequence,DNSequence,CASE WHEN isnull(ErpWhCode,0)='1' then WarehouseCode ELSE '' END AS WHCode,InvCode,Quantity,Amount,PODetailID,DNDetailID,Currency,UnitPrice,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10 |
|
|
|
FROM #TempERP |
|
|
|
|
|
|
|
SELECT a.LotNo,SUM(a.Quantity) AS Quantity,te.Costre2,a.Identification |
|
|
|
FROM ICSWareHouseLotInfoLog a |
|
|
|
INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint |
|
|
|
INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint |
|
|
|
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.ToWarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint |
|
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint |
|
|
|
INNER JOIN ICSASNDetail g ON a.LotNo=g.LotNo AND a.WorkPoint=g.WorkPoint |
|
|
|
INNER JOIN ICSDeliveryNotice f ON g.ASNCode=f.ASNCode AND g.WorkPoint=f.WorkPoint AND lot.ExtensionID=f.ExtensionID |
|
|
|
INNER JOIN ICSPurchaseOrder c ON b.TransCode=c.POCode AND b.TransSequence=c.Sequence AND f.PODetailID=c.PODetailID AND b.WorkPoint=c.WorkPoint |
|
|
|
INNER JOIN #TempERP te ON te.TransSequence=a.TransSequence |
|
|
|
WHERE a.Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' |
|
|
|
GROUP BY a.LotNo,a.Identification,a.TransCode,a.TransSequence,c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode,te.Sequence,te.Costre2 |
|
|
|
SELECT a.LotNo,SUM(a.Quantity) AS Quantity,te.Costre2,a.Identification |
|
|
|
FROM ICSWareHouseLotInfoLog a |
|
|
|
INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint |
|
|
|
INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint |
|
|
|
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.ToWarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint |
|
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint |
|
|
|
INNER JOIN ICSASNDetail g ON a.LotNo=g.LotNo AND a.WorkPoint=g.WorkPoint |
|
|
|
INNER JOIN ICSDeliveryNotice f ON g.ASNCode=f.ASNCode AND g.WorkPoint=f.WorkPoint AND lot.ExtensionID=f.ExtensionID |
|
|
|
INNER JOIN ICSPurchaseOrder c ON b.TransCode=c.POCode AND b.TransSequence=c.Sequence AND f.PODetailID=c.PODetailID AND b.WorkPoint=c.WorkPoint |
|
|
|
INNER JOIN #TempERP te ON te.TransSequence=a.TransSequence |
|
|
|
WHERE a.Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' |
|
|
|
GROUP BY a.LotNo,a.Identification,a.TransCode,a.TransSequence,c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode,te.Sequence,te.Costre2 |
|
|
|
|
|
|
|
SELECT DISTINCT HasDN FROM #TempERP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE #TempERP |
|
|
|
DROP TABLE #NewTempERP |
|
|
|
";
|
|
|
@ -251,7 +248,7 @@ INTO #NewTempERP |
|
|
|
from ICSWareHouseLotInfoLog |
|
|
|
WHERE Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' |
|
|
|
|
|
|
|
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,CASE WHEN(LEN(f.DNDetailID)=36) THEN '' ELSE f.DNCode END AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence, |
|
|
|
SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END AS Costre,a.TransCode+a.TransSequence+CONVERT(VARCHAR,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode)) AS Costre2,c.VenCode,a.ToWarehouseCode AS WarehouseCode,c.POCode,f.DNID AS DNCode,CASE WHEN((LEN(f.DNDetailID)<>36)) THEN '1' ELSE '0' END AS HasDN,a.MUSER,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END AS DNSequence,ROW_NUMBER() OVER (ORDER BY c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode) AS Sequence,a.TransSequence, |
|
|
|
a.InvCode,SUM(a.Quantity) AS Quantity,CASE inv.AmountEnable WHEN '1' THEN SUM(a.Quantity*(lot.Amount/lot.Quantity)) ELSE '0' END AS Amount,isnull((c.UnitPrice),0) as UnitPrice,c.Currency,c.PODetailID,con.Enable AS UpdateTodoQuantity,conn.Enable,conStock.Enable AS UpdateStock,conStocknew.Enable AS IsFillClose,case when ConErp.enable=1 then f.DNDetailID else '' end AS DNDetailID |
|
|
|
,a.WorkPoint,ISNULL(ext.ProjectCode, '') AS ProjectCode,CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END AS BatchCode,ISNULL(ext.Version, '') AS Version,ISNULL(ext.Brand, '') AS Brand, |
|
|
|
ISNULL(ext.cFree1, '') AS cFree1,ISNULL(ext.cFree2, '') AS cFree2,ISNULL(ext.cFree3, '') AS cFree3,ISNULL(ext.cFree4, '') AS cFree4,ISNULL(ext.cFree5, '') AS cFree5,ISNULL(ext.cFree6, '') AS cFree6,ISNULL(ext.cFree7, '') AS cFree7,ISNULL(ext.cFree8, '') AS cFree8,ISNULL(ext.cFree9, '') AS cFree9,ISNULL(ext.cFree10, '') AS cFree10 |
|
|
@ -270,7 +267,7 @@ SELECT Identification,c.VenCode+a.ToWarehouseCode+c.POCode+a.MUSER+CASE WHEN(LEN |
|
|
|
INNER JOIN ICSConfiguration ConErp ON a.WorkPoint=ConErp.WorkPoint AND ConErp.Code='UploadERP001' |
|
|
|
INNER JOIN ICSConfiguration conStock ON a.WorkPoint=conStock.WorkPoint AND conStock.Code='UpdateStock001' |
|
|
|
INNER JOIN ICSConfiguration conStocknew ON a.WorkPoint=conStocknew.WorkPoint AND conStocknew.Code='FillClose003' |
|
|
|
GROUP BY ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.DNCode END,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.Enable |
|
|
|
GROUP BY ConErp.Enable,a.TransCode,a.Identification,a.TransSequence,inv.AmountEnable,c.VenCode,a.ToWarehouseCode,c.POCode,f.DNDetailID,f.DNID,a.MUSER,a.InvCode,CASE WHEN(LEN(f.DNID)>=20) THEN '' ELSE f.Sequence END,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable,conStock.Enable,conStocknew.Enable |
|
|
|
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''), |
|
|
|
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, ''),f.DNCode |
|
|
|
|
|
|
@ -278,25 +275,22 @@ INNER JOIN ICSConfiguration conStocknew ON a.WorkPoint=conStocknew.WorkPoint AN |
|
|
|
SELECT Costre, Costre2,Sequence,DNSequence,InvCode,Quantity,Amount,PODetailID,DNDetailID,Currency,UnitPrice,ProjectCode,BatchCode,Version,Brand,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,WarehouseCode AS WHCode |
|
|
|
FROM #TempERP |
|
|
|
|
|
|
|
SELECT a.LotNo,SUM(a.Quantity) AS Quantity,te.Costre2,a.Identification |
|
|
|
FROM ICSWareHouseLotInfoLog a |
|
|
|
INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint |
|
|
|
INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint |
|
|
|
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.ToWarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint |
|
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint |
|
|
|
INNER JOIN ICSASNDetail g ON a.LotNo=g.LotNo AND a.WorkPoint=g.WorkPoint |
|
|
|
INNER JOIN ICSDeliveryNotice f ON g.ASNCode=f.ASNCode AND g.WorkPoint=f.WorkPoint AND lot.ExtensionID=f.ExtensionID |
|
|
|
INNER JOIN ICSPurchaseOrder c ON b.TransCode=c.POCode AND b.TransSequence=c.Sequence AND f.PODetailID=c.PODetailID AND b.WorkPoint=c.WorkPoint |
|
|
|
INNER JOIN #TempERP te ON te.TransSequence=a.TransSequence |
|
|
|
WHERE a.Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' |
|
|
|
GROUP BY a.LotNo,a.Identification,a.TransCode,a.TransSequence,c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode,te.Sequence,te.Costre2 |
|
|
|
SELECT a.LotNo,SUM(a.Quantity) AS Quantity,te.Costre2,a.Identification |
|
|
|
FROM ICSWareHouseLotInfoLog a |
|
|
|
INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint |
|
|
|
INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint |
|
|
|
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.ToWarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint |
|
|
|
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint |
|
|
|
INNER JOIN ICSASNDetail g ON a.LotNo=g.LotNo AND a.WorkPoint=g.WorkPoint |
|
|
|
INNER JOIN ICSDeliveryNotice f ON g.ASNCode=f.ASNCode AND g.WorkPoint=f.WorkPoint AND lot.ExtensionID=f.ExtensionID |
|
|
|
INNER JOIN ICSPurchaseOrder c ON b.TransCode=c.POCode AND b.TransSequence=c.Sequence AND f.PODetailID=c.PODetailID AND b.WorkPoint=c.WorkPoint |
|
|
|
INNER JOIN #TempERP te ON te.TransSequence=a.TransSequence |
|
|
|
WHERE a.Identification='{0}' AND ERPUpload='0' AND BusinessCode='{1}' |
|
|
|
GROUP BY a.LotNo,a.Identification,a.TransCode,a.TransSequence,c.VenCode,a.ToWarehouseCode,c.POCode,c.PODetailID,a.InvCode,te.Sequence,te.Costre2 |
|
|
|
|
|
|
|
SELECT DISTINCT HasDN FROM #TempERP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE #TempERP |
|
|
|
DROP TABLE #NewTempERP |
|
|
|
";
|
|
|
@ -2133,7 +2127,7 @@ IF EXISTS(SELECT b.id FROM ICSPurchaseReceive b where rcvcode in |
|
|
|
|
|
|
|
string ERPupdate = @"update ICSDeliveryNotice set DNCode='{0}',Sequence='{1}',DNID='{2}',DNDetailID='{3}'
|
|
|
|
where PODetailID='{4}' AND DNType='1' AND DNCode='{5}' and Sequence='{6}'";
|
|
|
|
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["ID"], det["DetailID"], det["PODetailID"], DNCode, det["WMSSequence"]); |
|
|
|
ERPupdate = string.Format(ERPupdate, jo["DNCode"], det["Sequence"], jo["id"], det["DetailID"], det["PODetailID"], DNCode, det["WMSSequence"]); |
|
|
|
|
|
|
|
if (!DBHelper.ExecuteNonQuery(ERPupdate, cmd)) |
|
|
|
{ |
|
|
|