/** * Display a listing of the resource. * GET /sttb * * @return Response */ public function index() { $query = DB::table('STTB')->select('no_STTB')->orderBy('no_STTB', 'desc')->first(); $inisial = 'STB'; if (!isset($query)) { $kd = $inisial . '001'; } else { $kode = substr($query->no_STTB, 3); $kode = $kode + 1; if ($kode > 0) { $kd = $inisial . '00' . $kode; if ($kode > 9) { $kd = $inisial . '0' . $kode; if ($kode > 99) { $kd = $inisial . $kode; } } } } $data = array('supplier' => Supplier::lists('nm_supp', 'id_supp'), 'noSTTB' => $kd); return View::make('transaksi.STTB', $data); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { $commodities = Commodity::lists('name', 'id'); $suppliers = Supplier::lists('name', 'id'); return View::make('receipt.create')->with('commodities', $commodities)->with('suppliers', $suppliers); }
public function newOrder() { // $products = DB::table('tblInventory') // ->join('tblProducts', function($join) // { // $join->on('tblInventory.strProdID','=','tblProducts.strProdID'); // })->get(); $products = DB::table('tblProducts')->get(); $suppliers = Supplier::lists('strSuppCompanyName', 'strSuppID'); $data = array('suppliers' => $suppliers); $ids = DB::table('tblOrders')->select('strOrdersID')->orderBy('updated_at', 'desc')->orderBy('strOrdersID', 'desc')->take(1)->get(); $ID = $ids["0"]->strOrdersID; $newID = $this->smart($ID); Session::put('orderqueue', $newID); $ordProd = OrderProduct::all(); return View::make('neworder')->with('products', $products)->with('data', $data)->with('newID', $newID)->with('ordProd', $ordProd); }
/** * Show the form for creating a new resource. * GET /stocks/create * * @return Response */ public function create() { //show the form $suppliers = Supplier::lists('name', 'id'); return View::make('stocks.new')->with('title', 'New Stock')->with('suppliers', compact('suppliers')); }