Exemple #1
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->saleproduct->find($id);
     /*==========  Sesuaikan  ==========*/
     $db->saleid = Input::get('saleid');
     $db->product_id = Input::get('product_id');
     $qty = Input::get('qty');
     $price = Input::get('price');
     $db->qty = $qty;
     $db->price = $price;
     $db->desc = Input::get('desc');
     $subtotal = ($qty > 0 and $price > 0) ? $qty * $price : 0;
     $db->subtotal = $subtotal;
     // $db->name = Input::get('name');
     // $db->info = Input::get('info');
     //		$db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #2
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->settingprogram->find($id);
     /*==========  Sesuaikan  ==========*/
     $db->name = Input::get('name');
     $db->address = Input::get('address');
     $db->city_id = Input::get('city_id');
     $db->telp = Input::get('telp');
     $db->fax = Input::get('fax');
     $db->npwp = Input::get('npwp');
     $db->lastupdateby_id = Input::get('lastupdateby_id');
     $db->updated_at = new \DateTime();
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #3
0
 public function update($id)
 {
     $uid = is_null(\Auth::getUser()) ? 1 : \Auth::getUser()->id;
     $db = $this->buyers->find($id);
     $db->address = Input::get("address");
     $db->codepos = Input::get("codepos");
     $db->email = Input::get("email");
     $db->fax = Input::get("fax");
     $db->kredit = Input::get("kredit");
     $db->name = Input::get("name");
     $db->npwp = Input::get("npwp");
     $db->phone = Input::get("phone");
     $db->plafon = Input::get("plafon");
     $db->rt = Input::get("rt");
     $db->rw = Input::get("rw");
     $status = !($status = Input::get('status_id')) ? 2 : 1;
     $db->status_id = $status;
     $db->tipe_id = Input::get("tipe_id");
     $db->typeprod_id = Input::get("typeprod_id");
     $db->province_id = Input::get("province_id");
     $db->legality_id = Input::get("legality_id");
     $db->note = Input::get("note");
     /** @noinspection PhpUndefinedFieldInspection */
     $db->city_id = Input::get("city_id");
     $db->country_id = Input::get("country_id");
     $db->lastupdateby_id = $uid;
     $db->updated_at = new Carbon();
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #4
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->product->find($id);
     /*==========  Sesuaikan  ==========*/
     $db->name = Input::get('name');
     $catId = Input::get('cat_id', 1);
     $uid = Auth::user()->id;
     $db->cat_id = $catId;
     $db->contruction = Input::get('contruction');
     $db->nodesign = Input::get('nodesign');
     $db->type_id = Input::get('type_id');
     $db->weight = Input::get('weight');
     $db->parent_id = $catId;
     $db->unitweight_id = Input::get('unitweight_id');
     $db->width = Input::get('width');
     $db->unitwidth_id = Input::get('unitwidth_id');
     $db->codeinternal = uniqid('Prd_');
     $db->uuid = uniqid('Prd_');
     $db->lastupdateby_id = $uid;
     $db->updated_at = new Carbon();
     $db->uuid = uniqid('Update_');
     $detail = $db->detail;
     if (Input::has('unit_id')) {
         $detail->unit_id = Input::get('unit_id');
     }
     if (Input::has('color_id')) {
         $detail->color_id = Input::get('color_id');
     }
     if (Input::has('grade_id')) {
         $detail->grade_id = Input::get('grade_id');
     }
     $detail->save();
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
 /**
  * Menampilkan Resource
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $db = $this->warehousecategory->find($id);
     return !$db ? \Icsoutput::msgError(array('reason' => 'Cannot Found')) : \Icsoutput::msgError($db->toArray());
 }
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     if (Input::has('tmp')) {
         if (!Input::has('tmptrxid')) {
             throw new \Exception('Butuh Transaction ID');
         }
         $id = Input::get('id');
         $record = $this->transorderdetails->getTmp()->findOrFail($id);
         $record->qty = Input::get('qty');
         return $record->save() ? \Response::json(['success' => true, 'results' => $record->toArray()]) : \Response::json(['success' => false, 'error' => true, 'results' => $record->toArray()]);
     }
     $db = $this->transorderdetails->find($id);
     /*==========  Sesuaikan  ==========*/
     // $db->name = Input::get('name');
     $db->qty = Input::get('qty');
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #7
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $this->checkAuth();
     $db = $this->phones->find($id);
     $uid = Auth::user()->id;
     $db->type = $this->setupType(Input::get('type'));
     $db->number = Input::get('number');
     $db->info = Input::get('info');
     $db->lastupdateby_id = $uid;
     $db->updated_at = new Carbon();
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #8
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->currencies->find($id);
     /*==========  Sesuaikan  ==========*/
     $db->name = Input::get('name');
     //        $country_id = (Input::get('negara_id') == 0) ? 1 : Input::get('negara_id');
     //         $db->country_id = $country_id;
     $db->country_id = Input::get('country_id');
     $db->shortname = Input::get('shortname');
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #9
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->suppliers->findOrFail($id);
     /*==========  Sesuaikan  ==========*/
     $db->address = Input::get("address");
     $db->city_id = Input::get("city_id");
     $db->codepos = Input::get("codepos");
     $db->country_id = Input::get("country_id");
     $db->email = Input::get("email");
     $db->fax = Input::get("fax");
     $db->kredit = Input::get("kredit");
     $db->legality_id = Input::get("legality_id");
     $db->name = Input::get("name");
     $db->note = Input::get("note");
     $db->npwp = Input::get("npwp");
     $db->phone = Input::get("phone");
     $db->plafon = Input::get("plafon");
     $db->province_id = Input::get("province_id");
     $db->rt = Input::get("rt");
     $db->rw = Input::get("rw");
     $db->status_id = Input::get("status_id");
     $db->tipe_id = Input::get("tipe_id");
     $db->typeprod_id = Input::get("typeprod_id");
     $db->createby_id = Input::get("createby_id");
     $db->lastupdateby_id = Input::get("lastupdateby_id");
     $db->codeinternal = uniqid('New_');
     $db->note = Input::get("note");
     $uid = Auth::user() ? Auth::user()->id : 1;
     $db->uuid = uniqid('Update_');
     $db->lastupdateby_id = $uid;
     $db->updated_at = new Carbon();
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #10
0
 /**
  * Update Resource Tertentu dari Storage
  *
  * @param  int $id
  *
  * @return Response
  */
 public function update($id)
 {
     $db = $this->bank->findOrFail($id);
     $db->name = trim(Input::get('name'));
     $db->shortname = Input::get('shortname');
     $db->notelp = trim(Input::get('notelp'));
     $db->address = trim(Input::get('address'));
     $saved = $db->save();
     return $saved ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #11
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->productdetails->find($id);
     /*==========  Sesuaikan  ==========*/
     $db->color_id = Input::get("color_id");
     $db->currsp_id = Input::get("currsp_id");
     $db->currspm_id = Input::get("currspm_id");
     $db->grade_id = Input::get("grade_id");
     $db->lastupdateby_id = Auth::user()->id;
     //	    $db->parent_id = Input::get("parent_id");
     //	    $db->parent_type = Input::get("parent_type");
     $db->product_id = Input::get("product_id");
     $db->salesprice = Input::get("salesprice");
     $db->salespricemin = Input::get("salespricemin");
     $db->unit_id = Input::get("unit_id");
     $db->updated_at = Carbon::create();
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #12
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->contactperson->find($id);
     /*==========  Sesuaikan  ==========*/
     $uid = Auth::user()->id;
     $db->name = Input::get("name");
     $db->info = Input::get("info");
     $db->pos_id = Input::get("pos_id");
     $db->dept_id = Input::get("dept_id");
     $db->phone = Input::get("phone");
     $db->email = Input::get("email");
     $db->fax = Input::get("fax");
     $db->lastupdateby_id = $uid;
     $db->updated_at = new Carbon();
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $name = Input::get('name');
     $this->checkName($name, true);
     $db = $this->typesuppliersbuyers->find($id);
     //		$db->name = Input::get('name');
     $db->info = Input::get('info');
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #14
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->bankaccounttype->findOrFail($id);
     $uid = null === \Auth::getUser() ? 1 : \Auth::getUser()->id;
     $db->name = Input::get('name');
     $db->info = Input::get('info');
     $db->lastupdateby_id = $uid;
     $db->updated_at = Carbon::create();
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #15
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->transsale->find($id);
     /*==========  Sesuaikan  ==========*/
     $db->buyer_id = Input::get('buyer_id');
     $db->saledate = Input::get('saledate');
     $db->totalitem = Input::get('totalitem', 0);
     $db->totalprice = Input::get('totalprice', 0);
     $db->updated_at = Carbon::create();
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #16
0
 /**
  * Menampilkan Resource
  *
  * @param  int $id
  *
  * @return Response
  */
 public function show($id)
 {
     $db = $this->stockproducts->where('id', $id);
     if (!$db) {
         return \Icsoutput::msgError(array('reason' => 'Cannot Found'));
     }
     $db = $db->with('product', 'categorywarehouse', 'createby', 'warehouse', 'updateby')->get();
     return \Icsoutput::msgSuccess($db->toArray());
 }
Exemple #17
0
 /**
  * Menghapus
  *
  * @param $id
  *
  * @return mixed
  *
  */
 public function delete($id)
 {
     if ($this->hasAccess()) {
         $deleted = $this->receive->find($id)->delete();
         return \Icsoutput::toJson(array('results' => $deleted), $deleted);
     } else {
         return \Icsoutput::toJson(array('results' => false, 'reason' => 'Dont Have Access to Delete '), false);
     }
 }
Exemple #18
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     /**
      * test
      */
     $db = $this->locations->find($id);
     /*==========  Sesuaikan  ==========*/
     //		$db->name      = Input::get('name');
     $db->info = Input::get('info');
     //		$db->parent_id = Input::get('parent_id');
     $db->uuid = uniqid('Update_');
     $saved = $db->save();
     return $saved ? Response::json(array_merge($db->toArray(), array('success' => $saved))) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #19
0
 /**
  * Update Informasi [[cName]]
  *
  * @param $id
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->fabrictype->find($id);
     /*==========  Sesuaikan  ==========*/
     $db->name = Input::get('name');
     $db->info = Input::get('info');
     $db->uuid = uniqid('Update_');
     return $db->save() ? \Icsoutput::msgSuccess($db->toArray()) : \Icsoutput::msgError(array('reason' => 'Cannot Update'));
 }
Exemple #20
0
     ChromePhp::log($obj);
     Icslogchrome::log($obj);
     //->info($obj);
     Icslogchrome::log($obj, 'table');
     //->info($obj);
     // $obj = serialize($obj);
     // Icslogchrome::log()->info($obj);
     // ChromePhp::log('Hello console!'.time());
     // return Icslogchrome::info('hi....');
     return time();
     $arr = array('mantap');
     s(Icsmessage::getConfig());
     $channel = Icsmessage::getConfig()['channel'];
     s($channel);
     s(Icsoutput::json(array('mantap')));
     $json = Icsoutput::json($arr);
     if (is_array($json)) {
         Icsmessage::send($json);
     } else {
         s('tidak kirim karena bukan array');
     }
     // s(Icsmessage::about());
     return Icsview::make('test');
 });
 Route::get('config', function () {
     // return View::make('ics::home.index');
 });
 Route::get('excel', function () {
     // return View::make('ics::home.index');
     // IcsExcel::load();
     $obj = new StdClass();