Exemplo n.º 1
0
 public function banktobankregister(Request $request)
 {
     $v = new Voucher();
     $v->vnno = $request->input('vnno');
     $v->vdate = CommonController::date_format($request->input('vdate'));
     $v->status = 3;
     $v->type = 5;
     $v->amount = $request->input('amount');
     $v->userid = $request->input('userid');
     $v->save();
     $LastInsertId = $v->id;
     //echo $LastInsertId;
     if ($LastInsertId != NULL) {
         $b = new Vouchercontra();
         $b->vid = $LastInsertId;
         $b->baccid = $request->input('baccid');
         $b->cashid = $request->input('cashid');
         $b->checkno = $request->input('checkno');
         $b->userid = $request->input('userid');
         $b->save();
         $b = new Bankbook();
         $b->vid = $LastInsertId;
         $b->baccid = $request->input('baccid');
         $b->dc = 1;
         $b->amount = $request->input('amount');
         //$b->sid = $request->input('sid');
         $b->checkno = $request->input('checkno');
         $b->userid = $request->input('userid');
         $b->save();
         $b1 = new Bankbook();
         $b1->vid = $LastInsertId;
         $b1->baccid = $request->input('cashid');
         $b1->dc = 0;
         $b1->amount = $request->input('amount');
         //$b->sid = $request->input('sid');
         $b1->checkno = $request->input('checkno');
         $b1->userid = $request->input('userid');
         $b1->save();
     }
     return redirect('contravoucher');
 }
Exemplo n.º 2
0
 public function registercontra(Request $request)
 {
     $v = new Voucher();
     $v->vnno = $request->input('vnno');
     $v->vdate = CommonController::date_format($request->input('vdate'));
     $v->amount = $request->input('amount');
     $v->amount = $request->input('bamount');
     $v->status = 3;
     $v->type = 5;
     $v->userid = $request->input('userid');
     $v->save();
     $LastInsertId = $v->id;
     if ($LastInsertId != NULL) {
         $m = new Vouchercontra();
         $m->vid = $LastInsertId;
         $m->baccid = $request->input('baccid');
         //$m->cid = $request->input('cid');
         $m->checkno = $request->input('checkno');
         $m->userid = $request->input('userid');
         $m->save();
     }
     return redirect('voucher');
 }