diff --git a/app/Classes/Service/BulkBookings.php b/app/Classes/Service/BulkBookings.php
new file mode 100644
index 00000000..8d0bed2d
--- /dev/null
+++ b/app/Classes/Service/BulkBookings.php
@@ -0,0 +1,123 @@
+date = $date;
+ $this->referenceNumber = $referenceNumber;
+ $this->customerDeposit = floatval($customerDeposit);
+ $this->marking = $marking;
+ $this->vendorDeposit = $vendorDeposit;
+ $this->bookingAmount = $bookingAmount;
+ }
+
+
+ public function execute(){
+ $booking = new Booking();
+ $booking->id = $this->referenceNumber;
+ $booking->term = 'x1_cash';
+ $booking->account_name = '';
+ $booking->account_num = '';
+ $booking->bank_name = '';
+ $booking->bank_branch = '';
+ $booking->rate_id = 1;
+ $booking->amount = $this->bookingAmount;
+ $booking->user_id = $this->userID();
+ $booking->bia = $this->customerDeposit;
+ $booking->rmb_book_amount = $this->bookingAmount;
+ $booking->verification_status = true;
+ $booking->rate = $this->customerRate();
+ $booking->status = 7;
+ $booking->admin_status = 7;
+ $booking->payment_for = 'Full Payment';
+ $booking->created_at = $this->date;
+ $booking->save();
+
+ $supplierBooking = new SupplierBooking();
+ $supplierBooking->rate = $this->vendorRate();
+ $supplierBooking->rebate = 0;
+ $supplierBooking->amountInRMB= $this->bookingAmount;
+ $supplierBooking->supplier_id= 2;
+ $supplierBooking->salestax_amount = 0;
+ $supplierBooking->booking_id= $this->referenceNumber;
+ $supplierBooking->amount_in_myr = $this->vendorDeposit;
+ $supplierBooking->tax_rate = 1;
+ $supplierBooking->amount_after_tax = $this->vendorDeposit;
+ $supplierBooking->save();
+
+ $bankSlip = new UserBankSlip();
+ $bankSlip->transfer_amount = $this->customerDeposit;
+ $bankSlip->booking_id = $this->referenceNumber;
+ $bankSlip->is_approve = true;
+ $bankSlip->save();
+
+ $chinaBankSlip = new ChinaBankSlip();
+ $chinaBankSlip->china_bank_slip_path = '';
+ $chinaBankSlip->actual_transfer_amount = $this->vendorDeposit;
+ $chinaBankSlip->booking_id = $this->referenceNumber;
+ $chinaBankSlip->save();
+
+ $invoice = new Invoice();
+ $invoice->invoice_path = '';
+ $invoice->amount = 0;
+ $invoice->booking_id = $this->referenceNumber;
+ $invoice->save();
+
+ }
+
+ private function userID(){
+ if($this->marking === "721PCV"){
+ $user = User::where('marking', 'SRW/CIEF/'.$this->marking)->first();
+ } else {
+ $user = User::where('marking', 'CIEF/'.$this->marking)->first();
+ }
+
+ return $user->id;
+ }
+
+ private function customerRate(){
+ return $this->currencyRate(($this->bookingAmount + (($this->bookingAmount / 100) * 2)) / $this->customerDeposit);
+ }
+
+ private function vendorRate(){
+ return $this->currencyRate($this->bookingAmount / $this->vendorDeposit);
+ }
+
+ private function currencyRate($rate){
+ return floor($rate * 1000) / 1000;
+ }
+}
\ No newline at end of file
diff --git a/app/Http/Controllers/BulkBookingController.php b/app/Http/Controllers/BulkBookingController.php
new file mode 100644
index 00000000..959d9192
--- /dev/null
+++ b/app/Http/Controllers/BulkBookingController.php
@@ -0,0 +1,22 @@
+file('xsl'));
+ foreach (array_slice($bookings[0],1) as $booking){
+ (new BulkBookings(Carbon::createFromTimestamp(($booking[0] - 25569) * 86400), $booking[1], $booking[2], $booking[3], $booking[4], $booking[5]))->execute();
+ }
+ return redirect()->route('booking.bulk.form');
+ }
+}
\ No newline at end of file
diff --git a/app/Imports/BookingImport.php b/app/Imports/BookingImport.php
new file mode 100644
index 00000000..5190da9b
--- /dev/null
+++ b/app/Imports/BookingImport.php
@@ -0,0 +1,22 @@
+
+ {{----}}
+ {{----}}
+ {{----}}
+ {{----}}
+ {{----}}
+
+
+
+@endsection
\ No newline at end of file
diff --git a/routes/web.php b/routes/web.php
index 7dc992f7..e2d5877b 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -13,8 +13,13 @@
Route::get('/', 'WelcomeController@index');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
+Route::group(['middleware' => ['role:admin']], function() {
+ Route::get('bulkBookings', function () {
+ return view('booking.bulkBooking');
+ })->name('booking.bulk.form');
+ Route::post('/bulkBookings', 'BulkBookingController@index')->name('booking.bulk');
+});
Route::get('{path}', 'WelcomeController@index')->where('path', '(.*)');
-
Auth::routes();
//Route::get('/home', 'WelcomeController@index')->name('home');