EMfinanga
2 months ago
146
2
Laravel

Ask to print Invoice after create the data into DB

Posted 2 months ago by EMfinanga

hello, i want the concept after save the data i want to get the pop up asking me to print invoice.

this is what i done.

$data=$request->all();
        $lastid=Customer_cash::create($data)->id;
        if(count($request->item_id) > 0)
        {
            foreach($request->item_id as $key=>$v){
                $data2=([
                    'Cash_no'=>$fk,
                    'customer_cash_id'=>$lastid,
                    'item_id'=>$request->item_id [$key],
                    'store_id'=>$request->store_id [$key],
                    'quantity'=>$request->qty [$key],
                    'rate'=>$request->selling_price [$key],
                    'amount'=>$request->amount [$key],
                ]);

                CashSales::create($data2);
                 }
        return redirect()->back()->with('success', 'Successfully Stored');

        }

this code is working fine for save data, but i want to add an idea to print the docs

Please sign in or create an account to participate in this conversation.