ソースを参照

星科源 大版本修改

cqp 1 日 前
コミット
ff134406fe
1 ファイル変更4 行追加1 行削除
  1. 4 1
      app/Service/U8ServerService.php

+ 4 - 1
app/Service/U8ServerService.php

@@ -1119,7 +1119,10 @@ class U8ServerService extends Service
                 DB::raw("ISNULL(i.cInvStd, '') as size"),
                 DB::raw("ISNULL(b.iQuantity, 0) as i_qty"),
                 DB::raw("ISNULL(b.iReceivedQTY, 0) as in_qty"),
-                DB::raw("(ISNULL(b.iReceivedQTY, 0)) as available_qty")
+                DB::raw($type == 0
+                    ? "(ISNULL(b.iQuantity, 0) - ISNULL(b.iReceivedQTY, 0)) as available_qty"
+                    : "ISNULL(b.iReceivedQTY, 0) as available_qty"
+                )
             )
             ->orderBy('b.ivouchrowno', 'asc')
             ->get();