Пример #1
0
 public function storeCustomRecord($parameters)
 {
     if ($this->request->hasFile('attachment')) {
         $filename = Miscellaneous::uploadFiles('attachment', public_path() . '/packages/syscover/octopus/storage/attachment/order');
     } elseif ($this->request->has('attachment')) {
         File::copy(public_path() . '/packages/syscover/octopus/storage/attachment/request/' . $this->request->input('attachment'), public_path() . '/packages/syscover/octopus/storage/attachment/order/' . $this->request->input('attachment'));
         $filename = $this->request->input('attachment');
     }
     $laboratory = Laboratory::builder()->where('favorite_073', true)->get()->first();
     $order = Order::create(['request_id_079' => $this->request->input('request'), 'supervisor_id_079' => $this->request->input('supervisor'), 'customer_id_079' => $this->request->input('customer'), 'shop_id_079' => $this->request->input('shopId'), 'company_id_079' => $this->request->input('company'), 'family_id_079' => $this->request->input('family'), 'brand_id_079' => $this->request->input('brand'), 'product_id_079' => $this->request->input('product'), 'laboratory_id_079' => $laboratory->id_073, 'address_id_079' => $this->request->has('aliasId') ? $this->request->input('aliasId') : null, 'company_name_079' => $this->request->has('companyName') ? $this->request->input('companyName') : null, 'name_079' => $this->request->has('name') ? $this->request->input('name') : null, 'surname_079' => $this->request->has('surname') ? $this->request->input('surname') : null, 'country_id_079' => $this->request->input('country'), 'territorial_area_1_id_079' => $this->request->has('territorialArea1') ? $this->request->input('territorialArea1') : null, 'territorial_area_2_id_079' => $this->request->has('territorialArea2') ? $this->request->input('territorialArea2') : null, 'territorial_area_3_id_079' => $this->request->has('territorialArea3') ? $this->request->input('territorialArea3') : null, 'cp_079' => $this->request->has('cp') ? $this->request->input('cp') : null, 'locality_079' => $this->request->has('locality') ? $this->request->input('locality') : null, 'address_079' => $this->request->has('address') ? $this->request->input('address') : null, 'phone_079' => $this->request->has('phone') ? $this->request->input('phone') : null, 'email_079' => $this->request->has('email') ? $this->request->input('email') : null, 'observations_079' => $this->request->has('observations') ? $this->request->input('observations') : null, 'date_079' => \DateTime::createFromFormat(config('pulsar.datePattern'), $this->request->input('date'))->getTimestamp(), 'date_text_079' => $this->request->input('date'), 'view_width_079' => $this->request->input('viewWidth'), 'view_height_079' => $this->request->input('viewHeight'), 'total_width_079' => $this->request->has('totalWidth') ? $this->request->input('totalWidth') : null, 'total_height_079' => $this->request->has('totalHeight') ? $this->request->input('totalHeight') : null, 'units_079' => $this->request->input('units'), 'expiration_079' => $this->request->has('expiration') ? \DateTime::createFromFormat(config('pulsar.datePattern'), $this->request->input('expiration'))->getTimestamp() : null, 'expiration_text_079' => $this->request->has('expiration') ? $this->request->input('expiration') : null, 'attachment_079' => isset($filename) ? $filename : null, 'comments_079' => $this->request->has('comments') ? $this->request->input('comments') : null]);
     RequestModel::where('id_078', $this->request->input('request'))->update(['order_id_078' => $order->id_079]);
     $this->sendOrderEmail($order->id_079, 'store');
 }
Пример #2
0
 public function ajaxDeleteFile()
 {
     File::delete(public_path() . '/packages/syscover/octopus/storage/attachment/request/' . $this->request->input('file'));
     OctopusRequest::where('id_078', $this->request->input('id'))->update(['attachment_078' => null]);
     return response()->json(['status' => 'success', 'file' => $this->request->input('file'), 'id' => $this->request->input('id')]);
 }
Пример #3
0
 public function storeCustomRecord($parameters)
 {
     if ($this->request->hasFile('attachment')) {
         $filename = Miscellaneous::uploadFiles('attachment', public_path() . '/packages/syscover/octopus/storage/attachment/stock');
     } elseif ($this->request->has('attachment')) {
         File::copy(public_path() . '/packages/syscover/octopus/storage/attachment/order/' . $this->request->input('attachment'), public_path() . '/packages/syscover/octopus/storage/attachment/stock/' . $this->request->input('attachment'));
         $filename = $this->request->input('attachment');
     }
     $stock = Stock::create(['request_id_080' => $this->request->input('request'), 'order_id_080' => $this->request->input('order'), 'supervisor_id_080' => $this->request->input('supervisor'), 'customer_id_080' => $this->request->input('customer'), 'shop_id_080' => $this->request->input('shopId'), 'company_id_080' => $this->request->input('company'), 'family_id_080' => $this->request->input('family'), 'brand_id_080' => $this->request->input('brand'), 'product_id_080' => $this->request->input('product'), 'laboratory_id_080' => $this->request->input('laboratory'), 'address_id_080' => $this->request->has('aliasId') ? $this->request->input('aliasId') : null, 'company_name_080' => $this->request->has('companyName') ? $this->request->input('companyName') : null, 'name_080' => $this->request->has('name') ? $this->request->input('name') : null, 'surname_080' => $this->request->has('surname') ? $this->request->input('surname') : null, 'country_id_080' => $this->request->input('country'), 'territorial_area_1_id_080' => $this->request->has('territorialArea1') ? $this->request->input('territorialArea1') : null, 'territorial_area_2_id_080' => $this->request->has('territorialArea2') ? $this->request->input('territorialArea2') : null, 'territorial_area_3_id_080' => $this->request->has('territorialArea3') ? $this->request->input('territorialArea3') : null, 'cp_080' => $this->request->has('cp') ? $this->request->input('cp') : null, 'locality_080' => $this->request->has('locality') ? $this->request->input('locality') : null, 'address_080' => $this->request->has('address') ? $this->request->input('address') : null, 'phone_080' => $this->request->has('phone') ? $this->request->input('phone') : null, 'email_080' => $this->request->has('email') ? $this->request->input('email') : null, 'observations_080' => $this->request->has('observations') ? $this->request->input('observations') : null, 'date_080' => \DateTime::createFromFormat(config('pulsar.datePattern'), $this->request->input('date'))->getTimestamp(), 'date_text_080' => $this->request->input('date'), 'view_height_080' => $this->request->input('viewHeight'), 'view_width_080' => $this->request->input('viewWidth'), 'total_height_080' => $this->request->has('totalWidth') ? $this->request->input('totalWidth') : null, 'total_width_080' => $this->request->has('totalHeight') ? $this->request->input('totalHeight') : null, 'units_080' => $this->request->input('units'), 'expiration_080' => $this->request->has('expiration') ? \DateTime::createFromFormat(config('pulsar.datePattern'), $this->request->input('expiration'))->getTimestamp() : null, 'expiration_text_080' => $this->request->has('expiration') ? $this->request->input('expiration') : null, 'attachment_080' => isset($filename) ? $filename : null, 'comments_080' => $this->request->has('comments') ? $this->request->input('comments') : null]);
     RequestModel::where('id_078', $this->request->input('request'))->update(['stock_id_078' => $stock->id_080]);
     Order::where('id_079', $this->request->input('order'))->update(['stock_id_079' => $stock->id_080]);
     $actions = $this->request->route()->getAction();
     if ($actions['resource'] === 'octopus-laboratory-stock') {
         // redirect to orders
         return redirect()->route('octopusLaboratoryOrder')->with(['msg' => 1, 'txtMsg' => trans('pulsar::pulsar.message_create_record_successful', ['name' => $stock->id_080])]);
     }
 }