Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($request->hasFile('sample_file')){
- $path = $request->file('sample_file')->getRealPath();
- $data = \Excel::load($path)->get();
- // dd($data);
- if($data->count()){
- $uuid = \Uuid::generate(4);
- // $gr = $this->create_header_gr();
- // dd($gr);
- foreach ($data as $key => $vl) {
- // dd($vl);
- try {
- // $kode_toko = explode('-', $vl->document_no);
- // $kode_toko = $kode_toko[0];
- // // dd($kode_toko);
- // \DB::connection('hosting')->table('sales_order_2018')->insert([
- // 'id'=>\Uuid::generate(4),
- // 'kode_toko'=>$kode_toko,
- // 'tanggal'=>date('Y-m-d',strtotime($vl->order_date))
- // ]);
- foreach ($data as $key => $vl) {
- // dd($vl->document_no);
- $header = $this->get_header_id($vl->document_no);
- // dd($header);
- foreach ($header->response->data as $hd) {
- $header_id = $hd->id;
- }
- $this->update_header($header_id);
- $lines = $this->get_line($header_id);
- // dd($lines);
- foreach ($lines->response->data as $ln) {
- $apus_line = $this->hapus_line($ln->id);
- // dd($apus_line);
- }
- $this->hapus_header($header_id);
- }
- // GM TO DRAFT
- // foreach ($data as $key => $vl) {
- // // dd($vl->document_no);
- // $header = $this->get_header_id($vl->document_no);
- // foreach ($header->response->data as $hd) {
- // $header_id = $hd->id;
- // }
- // $apus = $this->so_to_dr($header_id);
- // }
- } catch (Exception $e) {
- dd($e->getMessage());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement