|
|
@@ -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();
|