|
|
@ -1818,6 +1818,24 @@ a.ExtensionID |
|
|
|
|
|
|
|
tableName = @"ICSDeliveryNotice a "; |
|
|
|
|
|
|
|
where = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3' AND a.Status='1' AND a.Quantity>ISNULL(a.RCVQuantity, 0)"; |
|
|
|
|
|
|
|
singleWhere = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3'"; |
|
|
|
|
|
|
|
completeWhere = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.Quantity>ISNULL(a.RCVQuantity,0)"; |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
#region 采购拒收-退回
|
|
|
|
else if (TransType == TransTypeEnum.PurchaseRejectReturnDoc.GetDescription()) |
|
|
|
{ |
|
|
|
columns = @"a.DNCode AS TransCode,
|
|
|
|
a.DNDetailID AS DetailID, |
|
|
|
a.Sequence AS TransSequence, |
|
|
|
a.EATTRIBUTE1 AS Barcode, |
|
|
|
ISNULL(a.RCVQuantity,0) AS IssueQuantity,";
|
|
|
|
|
|
|
|
tableName = @"ICSDeliveryNotice a "; |
|
|
|
|
|
|
|
where = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3' AND a.Status='2' AND a.Quantity>ISNULL(a.RCVQuantity, 0)"; |
|
|
|
|
|
|
|
singleWhere = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3'"; |
|
|
@ -6117,6 +6135,30 @@ LEFT JOIN (SELECT SUM(Quantity) AS sumQty,SUM(InQuantity) AS sumIsQty,WorkPoint, |
|
|
|
orderby = @" a.MTIME DESC"; |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
#region 采购拒收
|
|
|
|
else if (TransType == TransTypeEnum.PurchaseRejectDoc.GetDescription()) |
|
|
|
{ |
|
|
|
columns = @" DISTINCT a.DNCode AS TransCode,a.MTIME"; |
|
|
|
|
|
|
|
tableName = @"ICSDeliveryNotice a "; |
|
|
|
|
|
|
|
where = @" a.Status='1' AND a.DNType='3' AND a.WorkPoint='{1}' and a.Quantity>ISNULL(a.RCVQuantity, 0)"; |
|
|
|
|
|
|
|
orderby = @" a.MTIME DESC"; |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
#region 采购拒收-退回
|
|
|
|
else if (TransType == TransTypeEnum.PurchaseRejectReturnDoc.GetDescription()) |
|
|
|
{ |
|
|
|
columns = @" DISTINCT a.DNCode AS TransCode,a.MTIME"; |
|
|
|
|
|
|
|
tableName = @"ICSDeliveryNotice a "; |
|
|
|
|
|
|
|
where = @" a.Status='2' AND a.DNType='3' AND a.WorkPoint='{1}' and a.Quantity>ISNULL(a.RCVQuantity, 0)"; |
|
|
|
|
|
|
|
orderby = @" a.MTIME DESC"; |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
else |
|
|
@ -13507,7 +13549,7 @@ INNER JOIN ICSExtension extt ON ISNULL(ext.ProjectCode, '')+'~'+CASE WHEN (invBa |
|
|
|
case when isnull(config.enable,0)=0 then '2' else '1' end, |
|
|
|
e.F_Account, SYSDATETIME(), |
|
|
|
a.DNID,a.DNDetailID, '0', '0', a.ExtensionID, |
|
|
|
e.F_Account,e.F_RealName, SYSDATETIME(), a.WorkPoint, d.LOTNO,'' |
|
|
|
e.F_Account,e.F_RealName, '{12}', a.WorkPoint, d.LOTNO,'' |
|
|
|
FROM ICSDeliveryNotice a |
|
|
|
INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoint |
|
|
|
INNER JOIN ICSASNDetail b ON a.ASNCode=b.ASNCode AND a.WorkPoint=b.WorkPoint |
|
|
@ -13522,7 +13564,7 @@ INNER JOIN ICSExtension extd ON d.ExtensionID=extd.ID AND d.WorkPoint=extd.WorkP |
|
|
|
INNER JOIN ICSPurchaseOrder n ON m.TransCode =n.POCode AND m.TransSequence=n.Sequence AND a.PODetailID=n.PODetailID AND m.WorkPoint=n.WorkPoint |
|
|
|
INNER JOIN ICSInspection h ON h.LotNo=d.LotNo AND h.WorkPoint=a.WorkPoint and h.enable = 1 |
|
|
|
INNER JOIN Sys_SRM_User e ON e.F_Account='{3}' AND e.F_Location='{2}' |
|
|
|
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001' |
|
|
|
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001' AND config.WorkPoint=a.WorkPoint |
|
|
|
WHERE a.DNCode='{0}' and d.LOTNO='{1}' AND a.WorkPoint='{2}'and |
|
|
|
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, '') = 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, '')+'~'+ |
|
|
@ -13553,7 +13595,7 @@ INNER JOIN ICSExtension extd ON d.ExtensionID=extd.ID AND d.WorkPoint=extd.WorkP |
|
|
|
case when isnull(config.enable,0)=0 then '2' else '1' end, |
|
|
|
e.F_Account, SYSDATETIME(), |
|
|
|
a.DNID,a.DNDetailID, '0', '0', a.ExtensionID, |
|
|
|
e.F_Account,e.F_RealName, SYSDATETIME(), a.WorkPoint, d.LOTNO,'' |
|
|
|
e.F_Account,e.F_RealName, '{12}', a.WorkPoint, d.LOTNO,'' |
|
|
|
FROM ICSDeliveryNotice a |
|
|
|
INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoint |
|
|
|
INNER JOIN ICSASNDetail b ON a.ASNCode=b.ASNCode AND a.WorkPoint=b.WorkPoint |
|
|
@ -13567,11 +13609,11 @@ INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoin |
|
|
|
INNER JOIN ICSPurchaseOrder n ON m.TransCode =n.POCode AND m.TransSequence=n.Sequence AND a.PODetailID=n.PODetailID AND m.WorkPoint=n.WorkPoint |
|
|
|
INNER JOIN ICSInspection h ON h.LotNo=d.LotNo AND h.WorkPoint=a.WorkPoint and h.enable = 1 |
|
|
|
INNER JOIN Sys_SRM_User e ON e.F_Account='{3}' AND e.F_Location='{2}' |
|
|
|
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001' |
|
|
|
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001' AND config.WorkPoint=a.WorkPoint |
|
|
|
WHERE a.DNCode='{0}' and d.LOTNO='{1}' AND a.WorkPoint='{2}'";
|
|
|
|
} |
|
|
|
|
|
|
|
sql = string.Format(sql, item.DNCode, itemInfo.LotNo, item.WorkPoint, item.User, Code, item.VenCode, item.DepCode, itemInfo.Quantity, itemInfo.Amount, itemInfo.UnitPrice, itemInfo.Currency, itemInfo.Sequence); |
|
|
|
sql = string.Format(sql, item.DNCode, itemInfo.LotNo, item.WorkPoint, item.User, Code, item.VenCode, item.DepCode, itemInfo.Quantity, itemInfo.Amount, itemInfo.UnitPrice, itemInfo.Currency, itemInfo.Sequence, item.MTime); |
|
|
|
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd)) |
|
|
|
{ |
|
|
@ -13580,13 +13622,13 @@ INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoin |
|
|
|
lots += "'" + itemInfo.LotNo + item.WorkPoint + "',"; |
|
|
|
} |
|
|
|
//增加了webconfig 判断不是U9,调用U8接口
|
|
|
|
string sqlCheckSign = @"select * from ICSConfiguration where code = 'UploadERP003' and enable = '1'"; |
|
|
|
DataTable flag = DBHelper.SQlReturnData(sqlCheckSign, cmd); |
|
|
|
if (flag != null && flag.Rows.Count > 0) |
|
|
|
{ |
|
|
|
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]) && !DBHelper.IsU9()) |
|
|
|
ICSPurchaseService.PurchaseRejectDocInNewERP(item.DNCode, Code, item.WorkPoint, cmd, language); |
|
|
|
} |
|
|
|
//string sqlCheckSign = @"select * from ICSConfiguration where code = 'UploadERP003' and enable = '1'";
|
|
|
|
//DataTable flag = DBHelper.SQlReturnData(sqlCheckSign, cmd);
|
|
|
|
//if (flag != null && flag.Rows.Count > 0)
|
|
|
|
//{
|
|
|
|
// if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]) && !DBHelper.IsU9())
|
|
|
|
// ICSPurchaseService.PurchaseRejectDocInNewERP(item.DNCode, Code, item.WorkPoint, cmd, language);
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -33406,9 +33448,9 @@ END as NEWLotNo |
|
|
|
'','','','{8}' ,(select Top 1 f.F_RealName FROM ICSInventoryLot a INNER JOIN Sys_SRM_User f ON f.F_Account='{8}' AND a.WorkPoint=f.F_Location) , |
|
|
|
SYSDATETIME() ,'{3}' ,'' |
|
|
|
FROM ICSDeliveryNotice a |
|
|
|
INNER JOIN ICSInventoryLotDetail b ON b.TransCode=a.DNCode AND b.TransSequnce=a.Sequence AND b.WorkPoint=a.WorkPoint |
|
|
|
INNER JOIN ICSInventoryLot c WHERE c.LotNo=a.b.LotNo AND c.WorkPoint=b.WorkPoint |
|
|
|
WHERE a.DNCode='{1}' AND a.Sequence='{2}' AND a.DNType='3' AND a.Status='2' AND a.WorkPoint='{3}' |
|
|
|
INNER JOIN ICSInventoryLot c ON c.LotNo=a.EATTRIBUTE1 AND c.WorkPoint=a.WorkPoint |
|
|
|
WHERE a.DNCode='{1}' AND a.Sequence='{2}' AND a.DNType='3' AND a.Status='1' AND a.WorkPoint='{3}' |
|
|
|
UPDATE ICSDeliveryNotice SET Status='2' WHERE DNCode='{1}' AND Sequence='{2}' AND DNType='3' AND Status='1' AND WorkPoint='{3}' |
|
|
|
";
|
|
|
|
detailSql = string.Format(detailSql, itemInfo.LotNo, item.TransCode, itemInfo.Sequence, item.WorkPoint, itemInfo.locationCode, item.Quantity, Identification, TransTypeEnum.PurchaseRejectDoc.GetDescription<DBValue>(), item.User); |
|
|
|
sql += detailSql; |
|
|
@ -33537,10 +33579,9 @@ END as NEWLotNo |
|
|
|
'','','','{8}' ,(select Top 1 f.F_RealName FROM ICSInventoryLot a INNER JOIN Sys_SRM_User f ON f.F_Account='{8}' AND a.WorkPoint=f.F_Location) , |
|
|
|
SYSDATETIME() ,'{3}' ,'' |
|
|
|
FROM ICSDeliveryNotice a |
|
|
|
INNER JOIN ICSInventoryLotDetail b ON b.TransCode=a.DNCode AND b.TransSequnce=a.Sequence AND b.WorkPoint=a.WorkPoint |
|
|
|
INNER JOIN ICSInventoryLot c WHERE c.LotNo=a.b.LotNo AND c.WorkPoint=b.WorkPoint |
|
|
|
INNER JOIN ICSInventoryLot c ON c.LotNo=a.EATTRIBUTE1 AND c.WorkPoint=a.WorkPoint |
|
|
|
WHERE a.DNCode='{1}' AND a.Sequence='{2}' AND a.DNType='3' AND a.Status='2' AND a.WorkPoint='{3}' |
|
|
|
UPDATE ICSDeliveryNotice SET RCVQuantity={5} WHERE DNCode='{1}' AND Sequence='{2}' AND DNType='3' AND Status='2' AND WorkPoint='{3}' |
|
|
|
UPDATE ICSDeliveryNotice SET RCVQuantity={5},Status='3' WHERE DNCode='{1}' AND Sequence='{2}' AND DNType='3' AND Status='2' AND WorkPoint='{3}' |
|
|
|
";
|
|
|
|
detailSql = string.Format(detailSql, itemInfo.LotNo, item.TransCode, itemInfo.Sequence, item.WorkPoint, "", item.Quantity, Identification, TransTypeEnum.PurchaseRejectDoc.GetDescription<DBValue>(), item.User); |
|
|
|
sql += detailSql; |
|
|
|