|
|
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
|
|
use App\Batch;
|
|
|
use App\Components\AsyncResponse;
|
|
|
use App\Order;
|
|
|
+use App\OrderBin;
|
|
|
use App\Services\WaveService;
|
|
|
use Exception;
|
|
|
use Illuminate\Http\Request;
|
|
|
@@ -112,6 +113,17 @@ class WaveController extends Controller
|
|
|
Order::query()->whereIn("code",$ordernos)->update([
|
|
|
"batch_id"=>$wave->id
|
|
|
]);
|
|
|
+ Order::query()->with(["batch","bin"])->whereIn("code",$ordernos)->get()->each(function ($order){
|
|
|
+ if (!$order->bin){
|
|
|
+ $bin = DB::connection("oracle")->selectOne(DB::raw("select seqno from DOC_WAVE_DETAILS where waveno = ? and orderno = ?"),[$order->batch->code,$order->code]);
|
|
|
+ if ($bin){
|
|
|
+ OrderBin::query()->create([
|
|
|
+ 'order_id' => $order->id,
|
|
|
+ 'number' => $bin->seqno,
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
$this->success($error);
|
|
|
}
|