Browse Source

提交

master
zhaoxinyu 3 months ago
parent
commit
ba142fa7d9
  1. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -1567,7 +1567,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
",SUM(SE_SA_CAN_QTY) SE_SA_CAN_QTY\n" +
",SUM(SE_SA_NOT_QTY) SE_SA_NOT_QTY\n" +
",SUM(ONLY_SE_QTY) ONLY_SE_QTY\n" +
",SUM(ONLY_SA_QTY) ONLY_SA_QTY\n" +
",-SUM(ONLY_SA_QTY) ONLY_SA_QTY\n" +
",SUM(INVQty) INVQty\n" +
"FROM (\n" +
"select temp1.*,isnull(temp3.PartCode,temp2.partCode) partCode,case WHEN ISNULL(TEMP2.InvbillNum,'')<>'' THEN isnull(temp2.Qty,0) ELSE 0 END invQty from (\n" +
@ -1579,19 +1579,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
"isnull([200],0) CANQty,\n" +
"isnull([800],0) NOTQty,\n" +
"case when ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)=0 then ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)\n" +
"when ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) - ISNULL([200], 0) = ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) then 0\n"+
"when ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) - ISNULL([200], 0) = ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) then 0\n" +
"ELSE 0 END SE_SA_CAN_QTY,\n" +
"case when ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([800],0)=0 then ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)\n" +
"when ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) - ISNULL([800], 0) = ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) then 0\n"+
"when ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) - ISNULL([800], 0) = ISNULL([10], 0) + isnull([20], 0) + isnull([100], 0) + ISNULL([150], 0) then 0\n" +
"ELSE 0 END SE_SA_NOT_QTY,\n" +
"case when ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)-ISNULL([800],0)>0 then ISNULL([100],0)\n" +
"ElSE 0 END SE_SA_DIFF_QTY,\n" +
"case when ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)-ISNULL([800],0)=ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0) then \n" +
"ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)\n" +
"ElSE 0 END ONLY_SE_QTY,\n" +
"case when ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)-ISNULL([800],0)=-ISNULL([200],0)-ISNULL([800],0) then \n" +
"ISNULL([200],0)+ISNULL([800],0) \n" +
"ElSE 0 END ONLY_SA_QTY \n" +
"case when ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)-ISNULL([800],0)>0 THEN\n" +
"ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)-ISNULL([800],0)\n" +
"ELSE 0\n" +
"END ONLY_SE_QTY,\n" +
"case when ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)-ISNULL([800],0)<0 THEN\n" +
"ISNULL([10],0)+isnull([20],0)+isnull([100],0)+ISNULL([150],0)-ISNULL([200],0)-ISNULL([800],0)\n" +
"ELSE 0\n" +
"END ONLY_SA_QTY\n" +
"from (\n" +
"SELECT LU,PN,BusinessType,Qty,10 Type \n" +
$"from {setablename} A WITH(NOLOCK) where BusinessType={(int)p_businessType} AND Qty>0 AND WmsBillNum='0' \n";

Loading…
Cancel
Save