create print opname and mutations
This commit is contained in:
@@ -77,7 +77,8 @@ class OpnamesController extends Controller
|
||||
->addColumn('action', function ($row) use ($menu) {
|
||||
$btn = '<div class="d-flex">';
|
||||
|
||||
$btn .= '<a href="'.route('opnames.show', $row->id).'" class="btn btn-primary btn-sm">Detail</a>';
|
||||
$btn .= '<a href="'.route('opnames.show', $row->id).'" class="btn btn-primary btn-sm" style="margin-right: 8px;">Detail</a>';
|
||||
$btn .= '<a href="'.route('opnames.print', $row->id).'" class="btn btn-success btn-sm" target="_blank">Print</a>';
|
||||
|
||||
$btn .= '</div>';
|
||||
|
||||
@@ -477,5 +478,18 @@ class OpnamesController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function print($id)
|
||||
{
|
||||
try {
|
||||
$opname = Opname::with(['details.product.category', 'user', 'dealer'])
|
||||
->findOrFail($id);
|
||||
|
||||
return view('warehouse_management.opnames.print', compact('opname'));
|
||||
} catch (\Exception $e) {
|
||||
Log::error('Error printing opname: ' . $e->getMessage());
|
||||
return back()->with('error', 'Gagal membuka halaman print opname.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user