--حذف درخواست های خروج لاین های الارو و شون در حالت ثبت اولیه و به تاریخ ۲۰ شهریور - با ديتيل
UPDATE D
SET D.IsDeleted=1
FROM WM.IssueOrderDetails D
INNER JOIN WM.IssueOrder H ON H.IssueOrder_ID=D.IssueOrder_ID
INNER JOIN Product.BarcodeMain B ON B.BarcodeMain_ID = D.BarcodeMain_ID
INNER JOIN Product.ProductMain P ON P.ProductMain_ID = B.ProductMain_ID
INNER JOIN Product.CodingBrand Br ON Br.CodingBrand_ID = P.CodingBrand_ID
WHERE H.IsDeleted=0 AND D.IsDeleted=0 AND H.StateID=3 AND H.IODate='2022-09-11 00:00:00.000'
AND P.CodingBrand_ID IN (14007,140010)
UPDATE H
SET H.IsDeleted=1
FROM WM.IssueOrderDetails D
INNER JOIN WM.IssueOrder H ON H.IssueOrder_ID=D.IssueOrder_ID
INNER JOIN Product.BarcodeMain B ON B.BarcodeMain_ID = D.BarcodeMain_ID
INNER JOIN Product.ProductMain P ON P.ProductMain_ID = B.ProductMain_ID
INNER JOIN Product.CodingBrand Br ON Br.CodingBrand_ID = P.CodingBrand_ID
WHERE H.IsDeleted=0 AND H.StateID=3 AND H.IODate='2022-09-11 00:00:00.000'
AND P.CodingBrand_ID IN (14007,140010)
|