update
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
@php
|
||||
if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
$route_list_trx = route('view_transactions');
|
||||
} else {
|
||||
$route_list_trx = route('view_user_client_transaction');
|
||||
}
|
||||
if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
$route_list_trx = route('view_transactions');
|
||||
} else {
|
||||
$route_list_trx = route('view_user_client_transaction');
|
||||
}
|
||||
@endphp
|
||||
|
||||
@extends('app.app')
|
||||
@ -20,28 +20,23 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
{{-- Form Order --}}
|
||||
<div class="col-sm-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{-- <div class="card-header">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col">
|
||||
<p class="card-title text-bold mb-0">Tambah Pengiriman Baru</p>
|
||||
<p class="card-title text-bold mb-0">Add new job</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
</div> --}}
|
||||
<div class="card-body pb-0">
|
||||
@if (Auth::user()->role == \App\Models\Users::ROLE_ADMIN)
|
||||
<div class="row mb-3 d-flex align-items-center">
|
||||
<div class="col-12 mb-3">
|
||||
<p class="text-danger text-bold mb-0">Pengiriman Untuk Client</p>
|
||||
{{-- <small>Masukkan tanggal, jam, lokasi penjemputan, dan lokasi pengantaran yang ada pada daftar zona yang telah didaftarkan</small> --}}
|
||||
</div>
|
||||
<div class="row mb-3 d-flex align-items-center d-none">
|
||||
<div class="col-sm-5 col-5 mb-3">
|
||||
<label for="add-client" class="form-label text-nowrap">Pilih Client</label>
|
||||
<label for="add-client" class="form-label text-nowrap">Company</label>
|
||||
<select name="add-client" id="add-client" class="select2 form-control">
|
||||
<option value="" selected disabled>Belum ada Client yang dipilih</option>
|
||||
|
||||
@foreach ($uclients as $uclient)
|
||||
<option value="{{ $uclient->id }}" data-uid="{{ $uclient->id }}"
|
||||
data-cptid="{{ $uclient->client_group_id }}">
|
||||
{{ $uclient->first_name." ($uclient->client_group_name)" }}</option>
|
||||
<option value="{{ $uclient->id }}" data-uid="{{ $uclient->id }}" data-cptid="{{ $uclient->client_group_id }}">
|
||||
{{ $uclient->client_group_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@ -49,34 +44,33 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
@endif
|
||||
<div class="row mb-3 d-flex align-items-center">
|
||||
<div class="col-12 mb-3">
|
||||
<p class="text-danger text-bold mb-0">Penjemputan dan Pengantaran</p>
|
||||
<p class="text-danger text-bold mb-0">Orign & Destination</p>
|
||||
{{-- <small>select time, pickup and drop zone from your zone list. Can't find your zone? <a href="{{ route('view_zone') }}">Add new zone</a></small> --}}
|
||||
<small>Masukkan tanggal, jam, lokasi penjemputan, dan lokasi pengantaran yang ada pada
|
||||
daftar zona yang telah didaftarkan</small>
|
||||
<small>Enter the date, time, origin location, and destination location from<br>the list of registered zones.</small>
|
||||
</div>
|
||||
<div class="col-sm-5 col-5 mb-3">
|
||||
<label for="add-pickup_date" class="form-label text-nowrap">Tanggal Penjemputan</label>
|
||||
<label for="add-pickup_date" class="form-label text-nowrap">Date</label>
|
||||
<input type="date" name="add-pickup_date" id="add-pickup_date" class="form-control">
|
||||
</div>
|
||||
<div class="col-2"></div>
|
||||
<div class="col-sm-5 col-5 mb-3">
|
||||
<label for="add-pickup_time" class="form-label text-nowrap">Waktu Penjemputan</label>
|
||||
<label for="add-pickup_time" class="form-label text-nowrap">Time</label>
|
||||
{{-- <input type="time" name="add-pickup_time" id="add-pickup_time" class="form-control"
|
||||
min="23:30"> --}}
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||
<select name="add-pickup_time_hour" id="add-pickup_time_hour" class="form-control">
|
||||
<option value="" selected disabled hidden>--</option>
|
||||
@for ($i=0; $i<24; $i++)
|
||||
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
||||
@for ($i = 0; $i < 24; $i++)
|
||||
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||
<select name="add-pickup_time_minute" id="add-pickup_time_minute" class="form-control">
|
||||
<option value="" selected disabled hidden>--</option>
|
||||
@for ($i=0; $i<60; $i++)
|
||||
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
||||
@for ($i = 0; $i < 60; $i++)
|
||||
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
@ -85,13 +79,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
</div>
|
||||
<div class="row mb-3 d-flex align-items-center">
|
||||
<div class="col-5 mb-3">
|
||||
<label for="add-pickup_zone" class="form-label">Lokasi Penjemputan</label>
|
||||
<label for="add-pickup_zone" class="form-label">Origin</label>
|
||||
<select name="add-pickup_zone" id="add-pickup_zone" class="select2 form-control">
|
||||
<option value="" selected disabled>Belum ada lokasi yang dipilih</option>
|
||||
<option value="" selected disabled>No origin location selected</option>
|
||||
@if (Auth::user()->role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
||||
@foreach ($pickups as $pickup)
|
||||
<option value="{{ $pickup->id }}" data-id="{{ $pickup->id }}"
|
||||
data-title="{{ $pickup->name }}" data-addr="{{ $pickup->fulladdress }}">
|
||||
<option value="{{ $pickup->id }}" data-id="{{ $pickup->id }}" data-title="{{ $pickup->name }}" data-addr="{{ $pickup->fulladdress }}">
|
||||
{{ $pickup->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@ -103,20 +96,19 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
||||
</div>
|
||||
<div class="col-5 mb-3">
|
||||
<label for="add-drop_zone" class="form-label">Lokasi Pengantaran</label>
|
||||
<label for="add-drop_zone" class="form-label">Destination</label>
|
||||
<select name="add-drop_zone" id="add-drop_zone" class="select2 form-control">
|
||||
<option value="" selected disabled>Belum ada lokasi yang dipilih</option>
|
||||
<option value="" selected disabled>No destination location selected</option>
|
||||
@if (Auth::user()->role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
||||
@foreach ($drops as $drop)
|
||||
<option value="{{ $drop->id }}" data-id="{{ $drop->id }}"
|
||||
data-title="{{ $drop->name }}" data-addr="{{ $drop->fulladdress }}">
|
||||
<option value="{{ $drop->id }}" data-id="{{ $drop->id }}" data-title="{{ $drop->name }}" data-addr="{{ $drop->fulladdress }}">
|
||||
{{ $drop->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex align-items-center mb-3">
|
||||
<div class="row d-flex align-items-center justify-content-between">
|
||||
<div class="col-12 mb-3">
|
||||
<p class="text-danger text-bold mb-0">Informasi Kendaraan</p>
|
||||
{{-- <small>You must fill in at least 1 of the package information.</small> --}}
|
||||
@ -138,21 +130,37 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<div class="col-5 mb-3 d-flex align-items-center">
|
||||
<input type="number" name="add-koli" id="add-koli" class="form-control w-75 me-2">pcs
|
||||
</div> --}}
|
||||
<div class="col-5 mb-3">
|
||||
{{-- <div class="col-5 mb-3">
|
||||
<label for="add-truck_type" class="form-label">Jenis Kendaraan</label>
|
||||
<select name="add-truck_type" id="add-truck_type" class="select2 form-control">
|
||||
{{-- <option value="" data-name="Let system choose automatically" selected>Let system
|
||||
choose automatically
|
||||
</option> --}}
|
||||
<option value="" selected disabled>Pilih kendaraan</option>
|
||||
@foreach ($truck_types as $tt)
|
||||
<option value="{{ $tt->type_id }}" data-id="{{ $tt->id }}" data-type_id="{{ $tt->type_id }}"
|
||||
data-name="{{ $tt->type_name }}" data-weight="{{ $tt->max_kg }}"
|
||||
data-cbm="{{ $tt->max_cbm }}" data-koli="{{ $tt->max_koli }}">
|
||||
<option value="{{ $tt->type_id }}" data-id="{{ $tt->id }}" data-type_id="{{ $tt->type_id }}" data-name="{{ $tt->type_name }}" data-weight="{{ $tt->max_kg }}" data-cbm="{{ $tt->max_cbm }}" data-koli="{{ $tt->max_koli }}">
|
||||
{{ $tt->type_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div> --}}
|
||||
<div class="col-5 mb-3">
|
||||
<label for="add-truck_type" class="form-label">Select Vehicle</label>
|
||||
<select name="add-truck_type" id="add-truck_type" class="select2 form-control">
|
||||
<option value="" selected disabled>Select Vehicle</option>
|
||||
@foreach ($vehicle as $_vehicle)
|
||||
<option value="{{ $_vehicle->vid }}" data-id="{{ $_vehicle->vid }}" data-type_id="{{ $_vehicle->vid }}" data-name="{{ $_vehicle->name }}">
|
||||
{{ $_vehicle->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-5 mb-3">
|
||||
<label for="add-driver" class="form-label">Driver</label>
|
||||
<select name="add-driver" id="add-driver" class="select2 form-control">
|
||||
<option value="" selected disabled>Select Driver</option>
|
||||
@foreach ($driver as $_driver)
|
||||
<option value="{{ $_driver->id }}" data-id="{{ $_driver->id }}" data-driver_id="{{ $_driver->id }}" data-name="{{ $_driver->fullname }}">
|
||||
{{ $_driver->fullname }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{-- <div class="row d-flex align-items-center">
|
||||
<div class="col-12 mb-3">
|
||||
@ -172,7 +180,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class="row d-flex align-items-center mb-3">
|
||||
<div class="row d-flex align-items-center mb-3 d-none">
|
||||
<div class="col-12 mb-3">
|
||||
<p class="text-danger text-bold mb-0">Asuransi</p>
|
||||
<small>Apakah Anda ingin menambahkan Asuransi untuk pengiriman ini?</small>
|
||||
@ -198,12 +206,11 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-8">
|
||||
<p class="mb-0">
|
||||
Sudahkah Anda mengisi semua kolom yang ada?
|
||||
Have you filled in all the required fields?
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
<button class="btn btn-warning btn-block btn-sm" id="btnCalculate">Kalkulasi
|
||||
Sekarang</button>
|
||||
<button class="btn btn-warning btn-block btn-sm" id="btnCalculate"> Next </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -211,6 +218,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
</div>
|
||||
{{-- Checkout --}}
|
||||
<div class="col-sm-6 d-none" id="checkOutView">
|
||||
{{-- <div class="col-sm-6"> --}}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row d-flex align-items-center">
|
||||
@ -231,10 +239,10 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<div class="card-body pb-0 checkoutBody">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-12 mb-3">
|
||||
<p class="text-danger text-bold mb-0">Penjemputan dan Pengantaran</p>
|
||||
<p class="text-danger text-bold mb-0">Orign & Destination</p>
|
||||
</div>
|
||||
<div class="col-sm-5 mb-3">
|
||||
<label for="" class="form-label">Tanggal Penjemputan</label>
|
||||
<label for="" class="form-label">Date</label>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body">
|
||||
<p id="checkout-pickup_at" class="mb-0">Feb 22, 2022 23:59:00</p>
|
||||
@ -243,17 +251,18 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
</div>
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-5 mb-3">
|
||||
<label for="" class="form-label">Jenis Kendaraan</label>
|
||||
<label for="" class="form-label">Vehicle</label>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body">
|
||||
<p id="checkout-truck_type" class="mb-0">CDD Long</p>
|
||||
<p id="checkout-driver" class="mb-0">CDD Long</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-5 mb-3">
|
||||
<label for="" class="form-label">Lokasi Penjemputan</label>
|
||||
<label for="" class="form-label">Origin</label>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body">
|
||||
<p id="checkout-pickup_zone_title" class="text-bold mb-2">Gudang Pluit SiCepat
|
||||
@ -270,7 +279,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
||||
</div>
|
||||
<div class="col-5 mb-3">
|
||||
<label for="" class="form-label">Lokasi Pengantaran</label>
|
||||
<label for="" class="form-label">Destination</label>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body">
|
||||
<p id="checkout-drop_zone_title" class="text-bold mb-2">Kantor Pusat SiCepat
|
||||
@ -318,12 +327,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class="row">
|
||||
<div class="row d-none">
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="row d-flex align-items-center d-none">
|
||||
<div class="col-12 mb-3 mt-3">
|
||||
<p class="text-danger text-bold mb-0">Pilih Layanan</p>
|
||||
<small>Berikut layanan yang tersedia untuk pesanan Anda</small>
|
||||
@ -378,11 +387,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<div class="row mb-3 d-flex align-items-center">
|
||||
<div class="col-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="chooseFleet"
|
||||
data-lead_time_id="${opt.lead_time_id}"
|
||||
data-lead_time="${opt.lead_time}" data-price="${opt.price}"
|
||||
data-real_price="${opt.real_price}"
|
||||
data-disc_price="${opt.disc_price}">
|
||||
<input class="form-check-input" type="radio" name="chooseFleet" data-lead_time_id="${opt.lead_time_id}" data-lead_time="${opt.lead_time}" data-price="${opt.price}" data-real_price="${opt.real_price}" data-disc_price="${opt.disc_price}">
|
||||
<label class="form-check-label text-success">
|
||||
1 Hari <span class="badge bg-success ms-2">Best services</span>
|
||||
</label>
|
||||
@ -397,11 +402,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<div class="row mb-3 d-flex align-items-center">
|
||||
<div class="col-6">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="chooseFleet"
|
||||
data-lead_time_id="${opt.lead_time_id}"
|
||||
data-lead_time="${opt.lead_time}" data-price="${opt.price}"
|
||||
data-real_price="${opt.real_price}"
|
||||
data-disc_price="${opt.disc_price}">
|
||||
<input class="form-check-input" type="radio" name="chooseFleet" data-lead_time_id="${opt.lead_time_id}" data-lead_time="${opt.lead_time}" data-price="${opt.price}" data-real_price="${opt.real_price}" data-disc_price="${opt.disc_price}">
|
||||
<label class="form-check-label text-dark">
|
||||
2 Hari
|
||||
</label>
|
||||
@ -427,15 +428,13 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
<div class="card-footer checkoutBody">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-8">
|
||||
<p class="text-danger mb-0">Harga layanan yang tercantum adalah harga perkiraan, bukan
|
||||
harga Final.</p>
|
||||
<p class="mb-0">
|
||||
Sudahkah Anda memeriksa ulang informasi pesanan?
|
||||
Have you reviewed the job information?
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
<button class="btn btn-danger btn-block btn-sm" id="btnOrder" {{-- onclick="location.href='{{ route('view_user_client_transaction') }}'" --}}
|
||||
disabled>Pesan Sekarang</button>
|
||||
{{-- <button class="btn btn-danger btn-block btn-sm" id="btnOrder" disabled>Pesan Sekarang</button> --}}
|
||||
<button class="btn btn-danger btn-block btn-sm" id="btnOrder">Submit</button>
|
||||
<div id="btnOrderSpinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
@ -452,9 +451,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
@endsection
|
||||
|
||||
@section('customjs')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.2/xlsx.full.min.js"
|
||||
integrity="sha512-oCjkwxjURabnte5K4Zeoc+hZ/G5pQE7GI4DYl+0wl6WaJIkBjb9FvUIaMU3lOPoBMSRZZ7QrczpGQoBFAKKB1Q=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.2/xlsx.full.min.js" integrity="sha512-oCjkwxjURabnte5K4Zeoc+hZ/G5pQE7GI4DYl+0wl6WaJIkBjb9FvUIaMU3lOPoBMSRZZ7QrczpGQoBFAKKB1Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script>
|
||||
$("#insuranceCheck").change(function() {
|
||||
$("#insurancePrice").toggleClass("d-none")
|
||||
@ -464,6 +461,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
$("#insuranceInput").prop('required', true);
|
||||
}
|
||||
})
|
||||
|
||||
$(document).ready(function() {
|
||||
setTimeout(function() {
|
||||
$('select[name=add-client]').val('1').change();
|
||||
}, 100);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
'use strict';
|
||||
@ -495,14 +498,13 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
TrxNew.activate();
|
||||
},
|
||||
event: function() {
|
||||
$('#checkout-group_pricing').on('click', 'input[name=chooseFleet]', function() {
|
||||
$('#btnOrder').prop("disabled", false);
|
||||
});
|
||||
// $('#checkout-group_pricing').on('click', 'input[name=chooseFleet]', function() {
|
||||
// $('#btnOrder').prop("disabled", false);
|
||||
// });
|
||||
// min date is today
|
||||
let TimeISOString = moment().toISOString().split('T');
|
||||
let time = TimeISOString[1].split('.')[0].split(':');
|
||||
$('#add-pickup_date').attr('min', TimeISOString[0]);
|
||||
// $('#add-pickup_time').attr('min', time[0] + ':' + time[1]);
|
||||
},
|
||||
};
|
||||
|
||||
@ -745,8 +747,8 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
TrxNew.hideCheckout();
|
||||
let selected = $('#add-client :selected');
|
||||
|
||||
$('#add-pickup_zone').html('<option value="" selected disabled>Belum ada lokasi yang dipilih</option>');
|
||||
$('#add-drop_zone').html('<option value="" selected disabled>Belum ada lokasi yang dipilih</option>');
|
||||
$('#add-pickup_zone').html('<option value="" selected disabled>No location has been selected.</option>');
|
||||
$('#add-drop_zone').html('<option value="" selected disabled>No location has been selected.</option>');
|
||||
|
||||
const listPickupZones = await Req.list_client_zone({
|
||||
cptid: selected.data('cptid'),
|
||||
@ -844,8 +846,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
// data.koli = Number($('#add-koli').val() || 'n');
|
||||
|
||||
let truck_type = $('#add-truck_type :selected');
|
||||
data.truck_type_id = truck_type.data('type_id');
|
||||
data.truck_type_name = truck_type.data('name')?.trim();
|
||||
data.vehicle_id = truck_type.data('type_id');
|
||||
data.vehicle_name = truck_type.data('name')?.trim();
|
||||
|
||||
let driver = $('#add-driver :selected');
|
||||
data.driver_id = driver.data('driver_id');
|
||||
data.driver_name = driver.data('name')?.trim();
|
||||
// data.truck_type_weight = truck_type.data('weight');
|
||||
// data.truck_type_cbm = truck_type.data('cbm');
|
||||
// data.truck_type_koli = truck_type.data('koli');
|
||||
@ -872,25 +878,26 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
},
|
||||
checkData: function(data, isAlert = false) {
|
||||
if (data.pickup_at < 1 || isNaN(data.pickup_at)) {
|
||||
if (isAlert) Helper.toast('Warning', 'just now', 'Pickup date / time not valid');
|
||||
if (isAlert) Helper.toast('Warning', 'just now', 'Date / time not valid');
|
||||
return false;
|
||||
}
|
||||
if (data.pickup_at < moment().unix()) {
|
||||
if (isAlert) Helper.toast('Warning', 'just now',
|
||||
'Pickup date / time is less than the current date / time');
|
||||
'Date / time is less than the current date / time');
|
||||
return false;
|
||||
}
|
||||
if (data.pickup_at < moment().add(3, 'hours').unix()) {
|
||||
// if (data.pickup_at < moment().add(3, 'hours').unix()) {
|
||||
if (data.pickup_at < moment().add(5, 'minutes').unix()) {
|
||||
if (isAlert) Helper.toast('Warning', 'just now',
|
||||
'Pickup time minimum 3 hours from now');
|
||||
'The selected time is too soon. Minimum is 5 minutes from now.');
|
||||
return false;
|
||||
}
|
||||
if (typeof data.pickup_zone_id == 'undefined') {
|
||||
if (isAlert) Helper.toast('Warning', 'just now', 'Pickup zone not valid');
|
||||
if (isAlert) Helper.toast('Warning', 'just now', 'Origin zone not valid');
|
||||
return false;
|
||||
}
|
||||
if (typeof data.drop_zone_id == 'undefined') {
|
||||
if (isAlert) Helper.toast('Warning', 'just now', 'Drop zone not valid');
|
||||
if (isAlert) Helper.toast('Warning', 'just now', 'Destination zone not valid');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -900,23 +907,23 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
// 'weight / volume / koli must be provided at least 1 of them');
|
||||
// return false;
|
||||
// }
|
||||
// if (typeof data.truck_type_id != 'undefined') {
|
||||
// if (typeof data.vehicle_id != 'undefined') {
|
||||
// if (!isNaN(data.weight) && data.truck_type_weight != 0 && data.weight > data
|
||||
// .truck_type_weight) {
|
||||
// if (isAlert) Helper.toast('Warning', 'just now',
|
||||
// `maximum weight for type truck ${data.truck_type_name} is ${data.truck_type_weight} Kg`
|
||||
// `maximum weight for type truck ${data.vehicle_name} is ${data.truck_type_weight} Kg`
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
// if (!isNaN(data.cbm) && data.truck_type_cbm != 0 && data.cbm > data.truck_type_cbm) {
|
||||
// if (isAlert) Helper.toast('Warning', 'just now',
|
||||
// `maximum volume for type truck ${data.truck_type_name} is ${data.truck_type_cbm} m³`
|
||||
// `maximum volume for type truck ${data.vehicle_name} is ${data.truck_type_cbm} m³`
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
// if (!isNaN(data.koli) && data.truck_type_koli != 0 && data.koli > data.truck_type_koli) {
|
||||
// if (isAlert) Helper.toast('Warning', 'just now',
|
||||
// `maximum koli for type truck ${data.truck_type_name} is ${data.truck_type_koli} Pcs`
|
||||
// `maximum koli for type truck ${data.vehicle_name} is ${data.truck_type_koli} Pcs`
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
@ -959,39 +966,39 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
// $('#checkout-unit').html('');
|
||||
// if (!isNaN(data.weight)) {
|
||||
// $('#checkout-unit').append(`
|
||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||
// <label for="" class="form-label">Berat</label>
|
||||
// <div class="card bg-light border mb-0 w-100">
|
||||
// <div class="card-body">
|
||||
// <p class="mb-0">${data.weight} Kg</p>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `);
|
||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||
// <label for="" class="form-label">Berat</label>
|
||||
// <div class="card bg-light border mb-0 w-100">
|
||||
// <div class="card-body">
|
||||
// <p class="mb-0">${data.weight} Kg</p>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `);
|
||||
// }
|
||||
// if (!isNaN(data.cbm)) {
|
||||
// $('#checkout-unit').append(`
|
||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||
// <label for="" class="form-label">Volume</label>
|
||||
// <div class="card bg-light border mb-0 w-100">
|
||||
// <div class="card-body">
|
||||
// <p class="mb-0">${data.cbm} m³</p>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `);
|
||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||
// <label for="" class="form-label">Volume</label>
|
||||
// <div class="card bg-light border mb-0 w-100">
|
||||
// <div class="card-body">
|
||||
// <p class="mb-0">${data.cbm} m³</p>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `);
|
||||
// }
|
||||
// if (!isNaN(data.koli)) {
|
||||
// $('#checkout-unit').append(`
|
||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||
// <label for="" class="form-label">Koli</label>
|
||||
// <div class="card bg-light border mb-0 w-100">
|
||||
// <div class="card-body">
|
||||
// <p class="mb-0">${data.koli} Pcs</p>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `);
|
||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||
// <label for="" class="form-label">Koli</label>
|
||||
// <div class="card bg-light border mb-0 w-100">
|
||||
// <div class="card-body">
|
||||
// <p class="mb-0">${data.koli} Pcs</p>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `);
|
||||
// }
|
||||
// // end packing list data
|
||||
|
||||
@ -1048,7 +1055,9 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
`);
|
||||
}
|
||||
|
||||
$('#checkout-truck_type').text(data.truck_type_name);
|
||||
$('#checkout-truck_type').text(data.vehicle_name);
|
||||
console.log("driver:", data.driver_name);
|
||||
$('#checkout-driver').text(data.driver_name);
|
||||
|
||||
$('#checkOutView').removeClass('d-none');
|
||||
$('#checkOutView').addClass('d-block');
|
||||
@ -1056,7 +1065,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||
hideCheckout: function() {
|
||||
$('#checkOutView').addClass('d-none');
|
||||
$('#checkOutView').removeClass('d-block');
|
||||
$('#btnOrder').attr('disabled', true);
|
||||
$('#btnOrder').attr('disabled', false);
|
||||
},
|
||||
downloadTemplatePackingList: function() {
|
||||
const fileName = 'template_packing_list.xlsx';
|
||||
|
||||
Reference in New Issue
Block a user