update
This commit is contained in:
@ -16,392 +16,398 @@ class DevicesController extends Controller
|
||||
{
|
||||
public function view_devices(Request $req)
|
||||
{
|
||||
$vhcs = Vehicles::listVehicles($req->auth);
|
||||
$data = [
|
||||
'vhcs' => $vhcs,
|
||||
];
|
||||
return view('menu_v1.configs.devices', $data);
|
||||
$vhcs = Vehicles::listVehicles($req->auth);
|
||||
$data = [
|
||||
"vhcs" => $vhcs,
|
||||
];
|
||||
return view("menu_v1.configs.devices", $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* API
|
||||
*/
|
||||
* API
|
||||
*/
|
||||
|
||||
public function api_list_devices(Request $req)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
$input = [];
|
||||
$rulesInput = [];
|
||||
public function api_list_devices(Request $req)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
$input = [];
|
||||
$rulesInput = [];
|
||||
|
||||
// validasi input
|
||||
// $isValidInput = Validator::make($input, $rulesInput);
|
||||
// if (!$isValidInput->passes()) {
|
||||
// $apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
// return new Response($apiResp, $apiResp['meta']['code']);
|
||||
// }
|
||||
// validasi input
|
||||
// $isValidInput = Validator::make($input, $rulesInput);
|
||||
// if (!$isValidInput->passes()) {
|
||||
// $apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
// return new Response($apiResp, $apiResp['meta']['code']);
|
||||
// }
|
||||
|
||||
$list = Devices::listDevices();
|
||||
foreach ($list as $key => $row) {
|
||||
$list[$key]->DT_RowIndex = $key + 1;
|
||||
$list[$key]->action = '-';
|
||||
if ($row->vhc_id == null) {
|
||||
$list[$key]->is_idle = 'yes';
|
||||
} else {
|
||||
$list[$key]->is_idle = 'no';
|
||||
}
|
||||
}
|
||||
$list = Devices::listDevices();
|
||||
foreach ($list as $key => $row) {
|
||||
$list[$key]->DT_RowIndex = $key + 1;
|
||||
$list[$key]->action = "-";
|
||||
if ($row->vhc_id == null) {
|
||||
$list[$key]->is_idle = "yes";
|
||||
} else {
|
||||
$list[$key]->is_idle = "no";
|
||||
}
|
||||
}
|
||||
|
||||
$apiResp = Responses::success('success list devices');
|
||||
$apiResp['count'] = count($list);
|
||||
$apiResp['data'] = $list;
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
} catch (\Exception $e) {
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
$apiResp = Responses::success("success list devices");
|
||||
$apiResp["count"] = count($list);
|
||||
$apiResp["data"] = $list;
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
} catch (\Exception $e) {
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function api_show_device(Request $req, $id)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
public function api_show_device(Request $req, $id)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
|
||||
$input = [
|
||||
'id' => $id,
|
||||
];
|
||||
$rulesInput = [
|
||||
'id' => 'required|integer|not_in:0',
|
||||
];
|
||||
$input = [
|
||||
"id" => $id,
|
||||
];
|
||||
$rulesInput = [
|
||||
"id" => "required|integer|not_in:0",
|
||||
];
|
||||
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp['meta']['code']);
|
||||
}
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
$device = Devices::showDeviceById($id);
|
||||
if (count($device) < 1) {
|
||||
$apiResp = Responses::not_found('device not found');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
|
||||
$apiResp = Responses::success('success get detail device');
|
||||
$apiResp['data'] = $device[0];
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
} catch (\Exception $e) {
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
$device = Devices::showDeviceById($id);
|
||||
if (count($device) < 1) {
|
||||
$apiResp = Responses::not_found("device not found");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
public function api_add_device(Request $req)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
$apiResp = Responses::success("success get detail device");
|
||||
$apiResp["data"] = $device[0];
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
} catch (\Exception $e) {
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
|
||||
$input = [
|
||||
'device_id' => $req->device_id,
|
||||
'name' => $req->name,
|
||||
'simcard' => $req->simcard,
|
||||
'type' => $req->type,
|
||||
'status' => $req->status,
|
||||
'assigned' => $req->assigned,
|
||||
'vid' => $req->vid,
|
||||
'available' => $req->available,
|
||||
];
|
||||
$rulesInput = [
|
||||
'device_id' => 'required|numeric',
|
||||
'name' => 'required|string',
|
||||
'simcard' => 'required|numeric',
|
||||
'type' => 'required|integer|not_in:0',
|
||||
'status' => 'required|numeric|min:0',
|
||||
'assigned' => 'required|numeric',
|
||||
'vid' => 'nullable|numeric',
|
||||
'available' => 'required|numeric',
|
||||
];
|
||||
public function api_add_device(Request $req)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp['meta']['code']);
|
||||
}
|
||||
$input = [
|
||||
"device_id" => $req->device_id,
|
||||
"name" => $req->name,
|
||||
"simcard" => $req->simcard,
|
||||
"type" => $req->type,
|
||||
"status" => $req->status,
|
||||
"assigned" => $req->assigned,
|
||||
"vid" => $req->vid,
|
||||
"available" => $req->available,
|
||||
];
|
||||
$rulesInput = [
|
||||
"device_id" => "required|numeric",
|
||||
"name" => "required|string",
|
||||
"simcard" => "required|numeric",
|
||||
"type" => "required|integer|not_in:0",
|
||||
"status" => "required|numeric|min:0",
|
||||
"assigned" => "required|numeric",
|
||||
"vid" => "nullable|numeric",
|
||||
"available" => "required|numeric",
|
||||
];
|
||||
|
||||
$device_id = str_pad($req->device_id, Devices::MAX_DEVICE_ID, '0', STR_PAD_LEFT);
|
||||
if (strlen($device_id) > 16) {
|
||||
$apiResp = Responses::bad_request('device id maksimal 16 digit');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
if (strlen($req->simcard) > 14) {
|
||||
$apiResp = Responses::bad_request('simcard maksimal 14 digit');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
$uniqDeviceId = Devices::getDeviceByDeviceId($device_id);
|
||||
if (count($uniqDeviceId) > 0) {
|
||||
$apiResp = Responses::bad_request('device id has been used');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$uniqSimcard = Devices::getDeviceBySimcard($req->simcard);
|
||||
if (count($uniqSimcard) > 0) {
|
||||
$apiResp = Responses::bad_request('simcard has been used');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$device_id = str_pad($req->device_id, Devices::MAX_DEVICE_ID, "0", STR_PAD_LEFT);
|
||||
if (strlen($device_id) > 16) {
|
||||
$apiResp = Responses::bad_request("Device ID must be a maximum of 16 digits");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
if (strlen($req->simcard) > 14) {
|
||||
$apiResp = Responses::bad_request("SIM card number must be a maximum of 14 digits");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
$uniqDeviceId = Devices::getDeviceByDeviceId($device_id);
|
||||
if (count($uniqDeviceId) > 0) {
|
||||
$apiResp = Responses::bad_request("device id has been used");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
$uniqSimcard = Devices::getDeviceBySimcard($req->simcard);
|
||||
if (count($uniqSimcard) > 0) {
|
||||
$apiResp = Responses::bad_request("simcard has been used");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
$insDevice = [
|
||||
'device_id' => $device_id,
|
||||
'name' => $req->name,
|
||||
'simcard' => (int)$req->simcard,
|
||||
'type' => $req->type,
|
||||
'is_active' => $req->status,
|
||||
'is_assigned' => $req->assigned,
|
||||
'is_available' => $req->available,
|
||||
'crt' => $now,
|
||||
'crt_by' => $req->auth->uid,
|
||||
'updt' => $now,
|
||||
'updt_by' => $req->auth->uid,
|
||||
];
|
||||
$id = Devices::addDevice($insDevice);
|
||||
DB::beginTransaction();
|
||||
|
||||
if ($req->assigned == Devices::IS_ASSIGNED) {
|
||||
if ($req->vid == null || $req->vid == "") {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request('kendaraan belum dipilih');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$vhc = Vehicles::getVehicleByDeviceId($device_id);
|
||||
if (count($vhc) > 0) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request('kendaraan sudah dipasang oleh device id ' . $vhc[0]->device_id);
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$vhc = Vehicles::getVehicleById($req->vid);
|
||||
if (count($vhc) > 0 && $vhc[0]->dvc_id !== 0 && $vhc[0]->device_id !== $device_id) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request('kendaraan sudah dipasang oleh device id ' . $vhc[0]->device_id);
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$vid = $req->vid;
|
||||
Vehicles::updateVehicle($vid, [
|
||||
'dvc_id' => $id,
|
||||
'device_id' => $device_id,
|
||||
'simcard' => (int)$req->simcard,
|
||||
]);
|
||||
} else {
|
||||
$vid = 0;
|
||||
}
|
||||
$insDevice = [
|
||||
"device_id" => $device_id,
|
||||
"name" => $req->name,
|
||||
"simcard" => (int) $req->simcard,
|
||||
"type" => $req->type,
|
||||
"is_active" => $req->status,
|
||||
"is_assigned" => $req->assigned,
|
||||
"is_available" => $req->available,
|
||||
"crt" => $now,
|
||||
"crt_by" => $req->auth->uid,
|
||||
"updt" => $now,
|
||||
"updt_by" => $req->auth->uid,
|
||||
];
|
||||
$id = Devices::addDevice($insDevice);
|
||||
|
||||
$apiResp = Responses::created('success add new device');
|
||||
if ($req->assigned == Devices::IS_ASSIGNED) {
|
||||
if ($req->vid == null || $req->vid == "") {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request("Vehicle has not been selected");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
$vhc = Vehicles::getVehicleByDeviceId($device_id);
|
||||
if (count($vhc) > 0) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request(
|
||||
"The vehicle is already assigned to device ID " . $vhc[0]->device_id
|
||||
);
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
$vhc = Vehicles::getVehicleById($req->vid);
|
||||
if (count($vhc) > 0 && $vhc[0]->dvc_id !== 0 && $vhc[0]->device_id !== $device_id) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request(
|
||||
"The vehicle is already assigned to device ID " . $vhc[0]->device_id
|
||||
);
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
$vid = $req->vid;
|
||||
Vehicles::updateVehicle($vid, [
|
||||
"dvc_id" => $id,
|
||||
"device_id" => $device_id,
|
||||
"simcard" => (int) $req->simcard,
|
||||
]);
|
||||
} else {
|
||||
$vid = 0;
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
$apiResp = Responses::created("success add new device");
|
||||
|
||||
public function api_updt_device(Request $req, $id)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
DB::commit();
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
|
||||
$input = [
|
||||
'id' => $id,
|
||||
'device_id' => $req->device_id,
|
||||
'name' => $req->name,
|
||||
'simcard' => $req->simcard,
|
||||
'type' => $req->type,
|
||||
'status' => $req->status,
|
||||
'assigned' => $req->assigned,
|
||||
'vid' => $req->vid,
|
||||
'available' => $req->available,
|
||||
];
|
||||
$rulesInput = [
|
||||
'id' => 'required|integer|not_in:0',
|
||||
'device_id' => 'required|numeric',
|
||||
'name' => 'required|string',
|
||||
'simcard' => 'required|numeric',
|
||||
'type' => 'required|integer|not_in:0',
|
||||
'status' => 'required|numeric',
|
||||
'assigned' => 'required|numeric',
|
||||
'vid' => 'nullable|numeric',
|
||||
'available' => 'required|numeric',
|
||||
];
|
||||
public function api_updt_device(Request $req, $id)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp['meta']['code']);
|
||||
}
|
||||
$input = [
|
||||
"id" => $id,
|
||||
"device_id" => $req->device_id,
|
||||
"name" => $req->name,
|
||||
"simcard" => $req->simcard,
|
||||
"type" => $req->type,
|
||||
"status" => $req->status,
|
||||
"assigned" => $req->assigned,
|
||||
"vid" => $req->vid,
|
||||
"available" => $req->available,
|
||||
];
|
||||
$rulesInput = [
|
||||
"id" => "required|integer|not_in:0",
|
||||
"device_id" => "required|numeric",
|
||||
"name" => "required|string",
|
||||
"simcard" => "required|numeric",
|
||||
"type" => "required|integer|not_in:0",
|
||||
"status" => "required|numeric",
|
||||
"assigned" => "required|numeric",
|
||||
"vid" => "nullable|numeric",
|
||||
"available" => "required|numeric",
|
||||
];
|
||||
|
||||
$device = Devices::showDeviceById($id);
|
||||
if (count($device) < 1) {
|
||||
$apiResp = Responses::not_found('device not found');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
$device_id = str_pad($req->device_id, Devices::MAX_DEVICE_ID, '0', STR_PAD_LEFT);
|
||||
if (strlen($device_id) > 16) {
|
||||
$apiResp = Responses::bad_request('device id maksimal 16 digit');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
if (strlen($req->simcard) > 14) {
|
||||
$apiResp = Responses::bad_request('simcard maksimal 14 digit');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$device = Devices::showDeviceById($id);
|
||||
if (count($device) < 1) {
|
||||
$apiResp = Responses::not_found("device not found");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
$uniqDeviceId = Devices::getDeviceByDeviceId($device_id);
|
||||
if (count($uniqDeviceId) > 0) {
|
||||
$notSameUser = 1;
|
||||
foreach ($uniqDeviceId as $key => $row) {
|
||||
if ($row->id == $id) {
|
||||
$notSameUser = 0;
|
||||
}
|
||||
}
|
||||
if ($notSameUser) {
|
||||
$apiResp = Responses::bad_request('device id has been used');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
$uniqSimcard = Devices::getDeviceBySimcard($req->simcard);
|
||||
if (count($uniqSimcard) > 0) {
|
||||
$notSameUser = 1;
|
||||
foreach ($uniqSimcard as $key => $row) {
|
||||
if ($row->id == $id) {
|
||||
$notSameUser = 0;
|
||||
}
|
||||
}
|
||||
if ($notSameUser) {
|
||||
$apiResp = Responses::bad_request('simcard has been used');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
$device_id = str_pad($req->device_id, Devices::MAX_DEVICE_ID, "0", STR_PAD_LEFT);
|
||||
if (strlen($device_id) > 16) {
|
||||
$apiResp = Responses::bad_request("Device ID must be a maximum of 16 digits");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
if (strlen($req->simcard) > 14) {
|
||||
$apiResp = Responses::bad_request("SIM card number must be a maximum of 14 digits");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
if ($req->status == Devices::IS_INACTIVE) {
|
||||
$isUsed = Vehicles::getVehicleByDeviceId($device_id);
|
||||
if (count($isUsed) > 0) {
|
||||
$apiResp = Responses::bad_request('tidak dapat mengubah menjadi nonaktif, device sedang digunakan');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
$uniqDeviceId = Devices::getDeviceByDeviceId($device_id);
|
||||
if (count($uniqDeviceId) > 0) {
|
||||
$notSameUser = 1;
|
||||
foreach ($uniqDeviceId as $key => $row) {
|
||||
if ($row->id == $id) {
|
||||
$notSameUser = 0;
|
||||
}
|
||||
}
|
||||
if ($notSameUser) {
|
||||
$apiResp = Responses::bad_request("device id has been used");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
$uniqSimcard = Devices::getDeviceBySimcard($req->simcard);
|
||||
if (count($uniqSimcard) > 0) {
|
||||
$notSameUser = 1;
|
||||
foreach ($uniqSimcard as $key => $row) {
|
||||
if ($row->id == $id) {
|
||||
$notSameUser = 0;
|
||||
}
|
||||
}
|
||||
if ($notSameUser) {
|
||||
$apiResp = Responses::bad_request("simcard has been used");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
if ($req->status == Devices::IS_INACTIVE) {
|
||||
$isUsed = Vehicles::getVehicleByDeviceId($device_id);
|
||||
if (count($isUsed) > 0) {
|
||||
$apiResp = Responses::bad_request("Cannot deactivate, the device is currently in use.");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($device[0]->vhc_id) {
|
||||
Vehicles::updateVehicle($device[0]->vhc_id, [
|
||||
'dvc_id' => 0,
|
||||
'device_id' => str_pad(0, Devices::MAX_DEVICE_ID, '0', STR_PAD_LEFT),
|
||||
'simcard' => 0,
|
||||
]);
|
||||
}
|
||||
DB::beginTransaction();
|
||||
|
||||
if ($req->assigned == Devices::IS_ASSIGNED) {
|
||||
if ($req->vid == null || $req->vid == "") {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request('kendaraan belum dipilih');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$vhc = Vehicles::getVehicleById($req->vid);
|
||||
if (count($vhc) > 0 && $vhc[0]->dvc_id !== 0 && $vhc[0]->device_id !== $device_id) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request('kendaraan sudah dipasang dengan device id ' . $vhc[0]->device_id);
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$vid = $req->vid;
|
||||
Vehicles::updateVehicle($vid, [
|
||||
'dvc_id' => $id,
|
||||
'device_id' => $device_id,
|
||||
'simcard' => (int)$req->simcard,
|
||||
]);
|
||||
} else {
|
||||
$vhc = Vehicles::getVehicleByDeviceId($device_id);
|
||||
if (count($vhc) > 0) {
|
||||
$vid = $vhc[0]->id;
|
||||
Vehicles::updateVehicle($vid, [
|
||||
'dvc_id' => 0,
|
||||
'device_id' => str_pad(0, Devices::MAX_DEVICE_ID, '0', STR_PAD_LEFT),
|
||||
'simcard' => 0,
|
||||
]);
|
||||
}
|
||||
}
|
||||
if ($device[0]->vhc_id) {
|
||||
Vehicles::updateVehicle($device[0]->vhc_id, [
|
||||
"dvc_id" => 0,
|
||||
"device_id" => str_pad(0, Devices::MAX_DEVICE_ID, "0", STR_PAD_LEFT),
|
||||
"simcard" => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
$updtDevice = [
|
||||
'device_id' => $req->device_id,
|
||||
'name' => $req->name,
|
||||
'simcard' => (int)$req->simcard,
|
||||
'type' => $req->type,
|
||||
'is_active' => $req->status,
|
||||
'is_assigned' => $req->assigned,
|
||||
'is_available' => $req->available,
|
||||
'updt' => $now,
|
||||
'updt_by' => $req->auth->uid,
|
||||
];
|
||||
Devices::updateDevice($id, $updtDevice);
|
||||
if ($req->assigned == Devices::IS_ASSIGNED) {
|
||||
if ($req->vid == null || $req->vid == "") {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request("Vehicle has not been selected");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
$vhc = Vehicles::getVehicleById($req->vid);
|
||||
if (count($vhc) > 0 && $vhc[0]->dvc_id !== 0 && $vhc[0]->device_id !== $device_id) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::bad_request(
|
||||
"This vehicle is already linked to a device " . $vhc[0]->device_id
|
||||
);
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
$vid = $req->vid;
|
||||
Vehicles::updateVehicle($vid, [
|
||||
"dvc_id" => $id,
|
||||
"device_id" => $device_id,
|
||||
"simcard" => (int) $req->simcard,
|
||||
]);
|
||||
} else {
|
||||
$vhc = Vehicles::getVehicleByDeviceId($device_id);
|
||||
if (count($vhc) > 0) {
|
||||
$vid = $vhc[0]->id;
|
||||
Vehicles::updateVehicle($vid, [
|
||||
"dvc_id" => 0,
|
||||
"device_id" => str_pad(0, Devices::MAX_DEVICE_ID, "0", STR_PAD_LEFT),
|
||||
"simcard" => 0,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$apiResp = Responses::created('success update device');
|
||||
$updtDevice = [
|
||||
"device_id" => $req->device_id,
|
||||
"name" => $req->name,
|
||||
"simcard" => (int) $req->simcard,
|
||||
"type" => $req->type,
|
||||
"is_active" => $req->status,
|
||||
"is_assigned" => $req->assigned,
|
||||
"is_available" => $req->available,
|
||||
"updt" => $now,
|
||||
"updt_by" => $req->auth->uid,
|
||||
];
|
||||
Devices::updateDevice($id, $updtDevice);
|
||||
|
||||
DB::commit();
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
$apiResp = Responses::created("success update device");
|
||||
|
||||
public function api_del_device(Request $req, $id)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
DB::commit();
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
|
||||
$input = [
|
||||
'id' => $id,
|
||||
];
|
||||
$rulesInput = [
|
||||
'id' => 'required|integer|not_in:0',
|
||||
];
|
||||
public function api_del_device(Request $req, $id)
|
||||
{
|
||||
try {
|
||||
$now = time();
|
||||
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp['meta']['code']);
|
||||
}
|
||||
$input = [
|
||||
"id" => $id,
|
||||
];
|
||||
$rulesInput = [
|
||||
"id" => "required|integer|not_in:0",
|
||||
];
|
||||
|
||||
$device = Devices::showDeviceById($id);
|
||||
if (count($device) < 1) {
|
||||
$apiResp = Responses::not_found('device not found');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
// validasi input
|
||||
$isValidInput = Validator::make($input, $rulesInput);
|
||||
if (!$isValidInput->passes()) {
|
||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
$isUsed = Vehicles::getVehicleByDeviceId($device[0]->device_id);
|
||||
if (count($isUsed) > 0) {
|
||||
$apiResp = Responses::bad_request('tidak dapat menghapus, device sedang digunakan');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
$device = Devices::showDeviceById($id);
|
||||
if (count($device) < 1) {
|
||||
$apiResp = Responses::not_found("Device not found");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
$isUsed = Vehicles::getVehicleByDeviceId($device[0]->device_id);
|
||||
if (count($isUsed) > 0) {
|
||||
$apiResp = Responses::bad_request("Cannot delete, the device is currently in use");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
|
||||
Devices::updateDevice($id, [
|
||||
'dlt' => $now,
|
||||
'dlt_by' => $req->auth->uid,
|
||||
]);
|
||||
DB::beginTransaction();
|
||||
|
||||
DB::commit();
|
||||
|
||||
$apiResp = Responses::success('success delete device');
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return (new Response($apiResp, $apiResp['meta']['code']));
|
||||
}
|
||||
}
|
||||
Devices::updateDevice($id, [
|
||||
"dlt" => $now,
|
||||
"dlt_by" => $req->auth->uid,
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
|
||||
$apiResp = Responses::success("success delete device");
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
$apiResp = Responses::error($e->getMessage());
|
||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
Lakukan pembayaran dengan jumlah diatas</li>
|
||||
<li
|
||||
style="font-size: 14px;color: #212B36;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
|
||||
Setelah transaksi berhasil, Anda akan menerima bukti pembayaran. Simpan
|
||||
Setelah transaksi berhasil, Anda akan menerima bukti pembayaran. Save
|
||||
bukti pembayaran.</li>
|
||||
</ol>
|
||||
<h4
|
||||
|
||||
@ -369,7 +369,7 @@
|
||||
},
|
||||
passData: function(data) {
|
||||
$('#filter-company').html(`
|
||||
<option value="all" data-cptid="0" data-cptname="Semua Perusahaan">Semua Perusahaan</option>
|
||||
<option value="all" data-cptid="0" data-cptname="Semua Perusahaan">All Company</option>
|
||||
`);
|
||||
for (let iData in data) {
|
||||
$('#filter-company').append(`
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
|
||||
<button class="btn btn-warning btn-block btn-sm" type="submit">Simpan</button>
|
||||
<button class="btn btn-warning btn-block btn-sm" type="submit">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1226,9 +1226,9 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelItem_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitUpdtItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Save</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitUpdtItem">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1246,7 +1246,7 @@
|
||||
<embed id="imgViewProofImg" src="https://i.pinimg.com/736x/a5/0e/5e/a50e5e839949d2f19271d83c12bd0abc.jpg" style="width:100%;height:100%;" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1270,7 +1270,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelItem" type="button" class="btn btn-sm btn-secondary">Ya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -977,9 +977,9 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelItem_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitUpdtItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Save</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitUpdtItem">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -998,7 +998,7 @@
|
||||
class="img-fluid mb-3" alt="" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1022,7 +1022,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelItem" type="button" class="btn btn-sm btn-secondary">Ya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -1869,7 +1869,7 @@
|
||||
action += `
|
||||
<p class="mb-0 text-muted small">Pengajuan ditolak oleh ${row.urjct_name} pada tanggal ${moment.unix(row.rjct_at).format('DD MMM YYYY HH:mm:ss')}</p>
|
||||
`;
|
||||
return action;
|
||||
return action;
|
||||
}
|
||||
if (State.ddln_pay_type.ord_finish == row.ddln_pay_type) {
|
||||
if (row.drop_chk_at != 0) {
|
||||
@ -1993,7 +1993,7 @@
|
||||
text += `
|
||||
<p class="mb-0 text-muted text-nowrap small">Ditolak</p>
|
||||
`;
|
||||
return text;
|
||||
return text;
|
||||
}
|
||||
return `
|
||||
<p class="mb-0 text-danger text-nowrap small">Belum Dibayar</p>
|
||||
@ -2077,7 +2077,7 @@
|
||||
OrdAItem.toggleGroupPayPurpose('show');
|
||||
OrdAItem.toggleGroupSubmissionProof('show');
|
||||
OrdAItem.toggleGroupFillDdln('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#invcToClient').on('change', function() {
|
||||
$('#add-invc_item_price').val('');
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button id="" type="submit" class="btn btn-sm btn-danger">Simpan</button>
|
||||
<button id="" type="submit" class="btn btn-sm btn-danger">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
@section('customcss')
|
||||
<style>
|
||||
/* .select2-container {
|
||||
z-index: 99999;
|
||||
} */
|
||||
z-index: 99999;
|
||||
} */
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@ -227,8 +227,8 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelDevice_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" id="btnDelDevice_updt" class="btn btn-sm btn-warning">Delete ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitUpdtDevices" type="button" class="btn btn-sm btn-danger">Ubah data</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -245,7 +245,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="d-flex justify-content-center">
|
||||
<p class="mb-0">
|
||||
Kamu yakin ingin menghapus device
|
||||
Kamu yakin ingin mengDelete device
|
||||
<a href="#" class="text-danger">
|
||||
<span id="del-device_id"></span>
|
||||
</a>
|
||||
@ -254,8 +254,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button id="btnSubmitDelDevice" type="button" class="btn btn-sm btn-secondary">Iya, hapus</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelDevice" type="button" class="btn btn-sm btn-secondary">Yes, Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -7,9 +7,8 @@
|
||||
@section('customcss')
|
||||
<style>
|
||||
/* .select2-container {
|
||||
z-index: 99999;
|
||||
} */
|
||||
|
||||
z-index: 99999;
|
||||
} */
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@ -55,8 +54,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlNewInsurance"
|
||||
aria-labelledby="mdlNewInsuranceLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlNewInsurance" aria-labelledby="mdlNewInsuranceLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog modal-dialog-centered modal-dialog-scrollable modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -72,23 +70,19 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<label for="add-name" class="col-form-label">Nama Premi<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="add-name" class="col-form-label">Nama Premi<span class="text-danger">*</span></label>
|
||||
<input type="text" name="add-name" id="add-name" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label for="add-price" class="col-form-label">Harga Premi<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="add-price" class="col-form-label">Harga Premi<span class="text-danger">*</span></label>
|
||||
<input type="text" name="add-price" id="add-price" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label for="add-min_price" class="col-form-label">Jumlah Minimal Pertangguhan<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="add-min_price" class="col-form-label">Jumlah Minimal Pertangguhan<span class="text-danger">*</span></label>
|
||||
<input type="text" name="add-min_price" id="add-min_price" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label for="add-max_price" class="col-form-label">Jumlah Maksimal Pertangguhan<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="add-max_price" class="col-form-label">Jumlah Maksimal Pertangguhan<span class="text-danger">*</span></label>
|
||||
<input type="text" name="add-max_price" id="add-max_price" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
@ -104,12 +98,10 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<label for="add-status" class="form-label">Status<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="add-status" class="form-label">Status<span class="text-danger">*</span></label>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="add-status">
|
||||
<label class="form-check-label" for="add-status"><span class="text-dark"
|
||||
id="add-txtStatus">Inactive</span></label>
|
||||
<label class="form-check-label" for="add-status"><span class="text-dark" id="add-txtStatus">Inactive</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -124,8 +116,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlEdtInsurances"
|
||||
aria-labelledby="mdlEdtInsurancesLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlEdtInsurances" aria-labelledby="mdlEdtInsurancesLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog modal-dialog-centered modal-dialog-scrollable modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -141,23 +132,19 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<label for="updt-name" class="col-form-label">Nama Premi<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-name" class="col-form-label">Nama Premi<span class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-name" id="updt-name" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label for="updt-price" class="col-form-label">Harga Premi<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-price" class="col-form-label">Harga Premi<span class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-price" id="updt-price" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label for="updt-min_price" class="col-form-label">Jumlah Minimal Pertangguhan<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-min_price" class="col-form-label">Jumlah Minimal Pertangguhan<span class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-min_price" id="updt-min_price" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label for="updt-max_price" class="col-form-label">Jumlah Maksimal Pertangguhan<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-max_price" class="col-form-label">Jumlah Maksimal Pertangguhan<span class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-max_price" id="updt-max_price" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
@ -173,12 +160,10 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<label for="updt-status" class="form-label">Status<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-status" class="form-label">Status<span class="text-danger">*</span></label>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="updt-status">
|
||||
<label class="form-check-label" for="updt-status"><span class="text-dark"
|
||||
id="updt-txtStatus">Inactive</span></label>
|
||||
<label class="form-check-label" for="updt-status"><span class="text-dark" id="updt-txtStatus">Inactive</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -187,15 +172,14 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelInsurance_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitEdtInsurances" type="button" class="btn btn-sm btn-danger">Ubah data</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDelInsurance"
|
||||
aria-labelledby="mdlDelInsuranceLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDelInsurance" aria-labelledby="mdlDelInsuranceLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -214,7 +198,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelInsurance" type="button" class="btn btn-sm btn-secondary">Iya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,8 +44,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlEdtInsurances"
|
||||
aria-labelledby="mdlEdtInsurancesLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlEdtInsurances" aria-labelledby="mdlEdtInsurancesLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog modal-dialog-centered modal-dialog-scrollable modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -60,16 +59,15 @@
|
||||
<h6>Data Premi</h6>
|
||||
</div> --}}
|
||||
<div class="row">
|
||||
{{-- <div class="col-sm-12">
|
||||
{{-- <div class="col-sm-12">
|
||||
<label for="updt-desc" class="col-form-label">Deskripsi</label>
|
||||
<textarea name="updt-desc" id="updt-desc" class="form-control"></textarea>
|
||||
</div> --}}
|
||||
<div class="col-sm-12">
|
||||
<label for="updt-amt_percent" class="col-form-label">Percent dari nilai pertangguhan<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-amt_percent" class="col-form-label">Percent dari nilai pertangguhan<span class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-amt_percent" id="updt-amt_percent" class="form-control">
|
||||
</div>
|
||||
{{-- <div class="col-sm-12">
|
||||
{{-- <div class="col-sm-12">
|
||||
<label for="updt-amt_flat" class="col-form-label">Percent<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-amt_flat" id="updt-amt_flat" class="form-control">
|
||||
@ -97,7 +95,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{-- <button type="button" id="btnDelInsurance_updt" class="btn btn-sm btn-warning">Hapus ?</button> --}}
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitEdtInsurances" type="button" class="btn btn-sm btn-danger">Ubah data</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -200,7 +198,7 @@
|
||||
$(td).attr('data-desc', rowData.desc);
|
||||
$(td).attr('data-amt_percent', rowData.amt_percent);
|
||||
},
|
||||
render: function(data, type, row, meta) {
|
||||
render: function(data, type, row, meta) {
|
||||
if (!data) return '-';
|
||||
return data;
|
||||
},
|
||||
@ -211,11 +209,11 @@
|
||||
visible: true,
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
render: function(data, type, row, meta) {
|
||||
render: function(data, type, row, meta) {
|
||||
return data + '%';
|
||||
},
|
||||
},
|
||||
// {
|
||||
// {
|
||||
// data: 'amt_flat',
|
||||
// className: 'text-end text-nowrap',
|
||||
// visible: true,
|
||||
@ -265,8 +263,8 @@
|
||||
// button
|
||||
$('#btnSubmitEdtInsurances').on('click', function() {
|
||||
let data = AUpdt.getData();
|
||||
let isValid = AUpdt.checkData(data);
|
||||
if (!isValid) return false;
|
||||
let isValid = AUpdt.checkData(data);
|
||||
if (!isValid) return false;
|
||||
AUpdt.submitData(data);
|
||||
});
|
||||
},
|
||||
@ -311,7 +309,7 @@
|
||||
passDataToView: async function(data) {
|
||||
// $('#updt-desc').val(data.desc);
|
||||
|
||||
$('#updt-amt_percent').val(data.amt_percent);
|
||||
$('#updt-amt_percent').val(data.amt_percent);
|
||||
// $('#updt-amt_flat').val((new Intl.NumberFormat('id-ID').format(data.amt_flat)));
|
||||
|
||||
// if (data.is_active == State.stts_isact.active) {
|
||||
@ -329,7 +327,7 @@
|
||||
|
||||
data.amt_percent = Number($('#updt-amt_percent').val());
|
||||
// data.desc = $('#updt-desc').val();
|
||||
data.desc = data.amt_percent + '% dari nilai pertangguhan';
|
||||
data.desc = data.amt_percent + '% dari nilai pertangguhan';
|
||||
// data.amt_flat = $('#updt-amt_flat').val().split('.').join('');
|
||||
|
||||
// if ($('#updt-status').prop('checked')) {
|
||||
@ -340,7 +338,7 @@
|
||||
|
||||
return data;
|
||||
},
|
||||
checkData: function(data, isAlert = true) {
|
||||
checkData: function(data, isAlert = true) {
|
||||
if (data.amt_percent < 1 || isNaN(data.amt_percent)) {
|
||||
if (isAlert) Helper.toast('Warning', 'just now', 'Percent tidak valid');
|
||||
return false;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
@extends('app.app')
|
||||
|
||||
@php
|
||||
$no_permission = App\Models\UsersMenuPermissions::IS_NOPERMISSION;
|
||||
$no_permission_text = 'Ditolak';
|
||||
$is_permission = App\Models\UsersMenuPermissions::IS_PERMISSION;
|
||||
$is_permission_text = 'Diizinkan';
|
||||
$no_permission = App\Models\UsersMenuPermissions::IS_NOPERMISSION;
|
||||
$no_permission_text = 'Ditolak';
|
||||
$is_permission = App\Models\UsersMenuPermissions::IS_PERMISSION;
|
||||
$is_permission_text = 'Diizinkan';
|
||||
@endphp
|
||||
|
||||
@section('title')
|
||||
@ -12,11 +12,11 @@ $is_permission_text = 'Diizinkan';
|
||||
@endsection
|
||||
|
||||
@section('customcss')
|
||||
<style>
|
||||
th {
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
th {
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@ -80,8 +80,7 @@ $is_permission_text = 'Diizinkan';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlNewPermission"
|
||||
aria-labelledby="mdlNewPermissionLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlNewPermission" aria-labelledby="mdlNewPermissionLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -110,87 +109,87 @@ $is_permission_text = 'Diizinkan';
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_trx" class="col-form-label">Menu Transaksi<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_trx" id="add-menu_trx" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_trx" id="add-menu_trx" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_company" class="col-form-label">Menu Perusahaan<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_company" id="add-menu_company" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_company" id="add-menu_company" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_zone" class="col-form-label">Menu Zona<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_zone" id="add-menu_zone" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_zone" id="add-menu_zone" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_users" class="col-form-label">Menu Pengguna<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_users" id="add-menu_users" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_users" id="add-menu_users" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_conf_rates" class="col-form-label">Menu Konfigurasi Harga<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_conf_rates" id="add-menu_conf_rates" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_conf_rates" id="add-menu_conf_rates" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_conf_insurance" class="col-form-label">Menu Konfigurasi Asuransi<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_conf_insurance" id="add-menu_conf_insurance" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_conf_insurance" id="add-menu_conf_insurance" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_conf_truck_type" class="col-form-label">Menu Konfigurasi Tipe Kendaraan<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_conf_truck_type" id="add-menu_conf_truck_type" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_conf_truck_type" id="add-menu_conf_truck_type" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_devices" class="col-form-label">Menu Konfigurasi Master Devices<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_devices" id="add-menu_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_devices" id="add-menu_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_logs_devices" class="col-form-label">Menu Konfigurasi Daftar GPS<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_logs_devices" id="add-menu_logs_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_logs_devices" id="add-menu_logs_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_conf_adt_items" class="col-form-label">Menu Konfigurasi Additional Items<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_conf_adt_items" id="add-menu_conf_adt_items" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_conf_adt_items" id="add-menu_conf_adt_items" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_drivers" class="col-form-label">Menu Pengemudi<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_drivers" id="add-menu_drivers" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_drivers" id="add-menu_drivers" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="add-menu_vehicles" class="col-form-label">Menu Kendaraan<span class="text-danger">*</span></label>
|
||||
<select name="add-menu_vehicles" id="add-menu_vehicles" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="add-menu_vehicles" id="add-menu_vehicles" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -255,8 +254,7 @@ $is_permission_text = 'Diizinkan';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlUpdtPermission"
|
||||
aria-labelledby="mdlUpdtPermissionLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlUpdtPermission" aria-labelledby="mdlUpdtPermissionLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -285,87 +283,87 @@ $is_permission_text = 'Diizinkan';
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_trx" class="col-form-label">Menu Transaksi<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_trx" id="updt-menu_trx" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_trx" id="updt-menu_trx" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_company" class="col-form-label">Menu Perusahaan<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_company" id="updt-menu_company" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_company" id="updt-menu_company" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_zone" class="col-form-label">Menu Zona<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_zone" id="updt-menu_zone" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_zone" id="updt-menu_zone" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_users" class="col-form-label">Menu Pengguna<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_users" id="updt-menu_users" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_users" id="updt-menu_users" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_conf_rates" class="col-form-label">Menu Konfigurasi Harga<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_conf_rates" id="updt-menu_conf_rates" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_conf_rates" id="updt-menu_conf_rates" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_conf_insurance" class="col-form-label">Menu Konfigurasi Asuransi<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_conf_insurance" id="updt-menu_conf_insurance" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_conf_insurance" id="updt-menu_conf_insurance" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_conf_truck_type" class="col-form-label">Menu Konfigurasi Tipe Kendaraan<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_conf_truck_type" id="updt-menu_conf_truck_type" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_conf_truck_type" id="updt-menu_conf_truck_type" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_devices" class="col-form-label">Menu Konfigurasi Master Devices<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_devices" id="updt-menu_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_devices" id="updt-menu_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_logs_devices" class="col-form-label">Menu Konfigurasi Daftar GPS<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_logs_devices" id="updt-menu_logs_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_logs_devices" id="updt-menu_logs_devices" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_conf_adt_items" class="col-form-label">Menu Konfigurasi Additional Items<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_conf_adt_items" id="updt-menu_conf_adt_items" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_conf_adt_items" id="updt-menu_conf_adt_items" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_drivers" class="col-form-label">Menu Pengemudi<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_drivers" id="updt-menu_drivers" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_drivers" id="updt-menu_drivers" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<label for="updt-menu_vehicles" class="col-form-label">Menu Kendaraan<span class="text-danger">*</span></label>
|
||||
<select name="updt-menu_vehicles" id="updt-menu_vehicles" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
<select name="updt-menu_vehicles" id="updt-menu_vehicles" class="form-control" style="width:100%;">
|
||||
<option value="{{ $no_permission }}">{{ $no_permission_text }}</option>
|
||||
<option value="{{ $is_permission }}">{{ $is_permission_text }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -424,15 +422,14 @@ $is_permission_text = 'Diizinkan';
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelPer_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitUpdtPer" type="button" class="btn btn-sm btn-danger">Ubah data</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDelPer"
|
||||
aria-labelledby="mdlDelPerLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDelPer" aria-labelledby="mdlDelPerLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -451,7 +448,7 @@ $is_permission_text = 'Diizinkan';
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelPer" type="button" class="btn btn-sm btn-secondary">Iya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -500,11 +497,11 @@ $is_permission_text = 'Diizinkan';
|
||||
else
|
||||
$('#updt-txtStatus').html('Inactive')
|
||||
});
|
||||
// fix modal select2
|
||||
$('#add-type').select2({
|
||||
// fix modal select2
|
||||
$('#add-type').select2({
|
||||
dropdownParent: $('#mdlNewPermission'),
|
||||
});
|
||||
$('#updt-type').select2({
|
||||
$('#updt-type').select2({
|
||||
dropdownParent: $('#mdlUpdtPermission'),
|
||||
});
|
||||
},
|
||||
@ -571,7 +568,7 @@ $is_permission_text = 'Diizinkan';
|
||||
$(td).attr('data-name', rowData.name);
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
data: 'is_trx',
|
||||
className: 'text-nowrap',
|
||||
visible: true,
|
||||
@ -816,7 +813,7 @@ $is_permission_text = 'Diizinkan';
|
||||
getData: function() {
|
||||
let data = {};
|
||||
|
||||
$.map($('#formNewPermission').serializeArray(), function(n, i){
|
||||
$.map($('#formNewPermission').serializeArray(), function(n, i) {
|
||||
let key = n['name'].replace('add-', '');
|
||||
data[key] = n['value'];
|
||||
});
|
||||
@ -976,7 +973,7 @@ $is_permission_text = 'Diizinkan';
|
||||
let data = {};
|
||||
data.id = $('#mdlUpdtPermission').data('id');
|
||||
|
||||
$.map($('#formUpdtPermission').serializeArray(), function(n, i){
|
||||
$.map($('#formUpdtPermission').serializeArray(), function(n, i) {
|
||||
let key = n['name'].replace('updt-', '');
|
||||
data[key] = n['value'];
|
||||
});
|
||||
@ -1056,7 +1053,7 @@ $is_permission_text = 'Diizinkan';
|
||||
let name = row.find('td[data-name]').data('name');
|
||||
PerDel.passDataToView({
|
||||
id,
|
||||
name,
|
||||
name,
|
||||
});
|
||||
$('#mdlDelPer').data('id', id);
|
||||
$('#mdlDelPer').modal('show');
|
||||
@ -1069,7 +1066,10 @@ $is_permission_text = 'Diizinkan';
|
||||
});
|
||||
// on modal update
|
||||
$('#btnDelPer_updt').on('click', function(e) {
|
||||
const { id, name } = PerUpdt.getData();
|
||||
const {
|
||||
id,
|
||||
name
|
||||
} = PerUpdt.getData();
|
||||
PerDel.passDataToView({
|
||||
id,
|
||||
name,
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -154,7 +154,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitMergeItem" type="button" class="btn btn-sm btn-warning">Ya, merge</button>
|
||||
<div id="btnSubmitMergeItem-loader" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
|
||||
@ -11,18 +11,18 @@
|
||||
@section('customcss')
|
||||
<style>
|
||||
/* .select2-container {
|
||||
z-index: 99999;
|
||||
} */
|
||||
z-index: 99999;
|
||||
} */
|
||||
|
||||
/* .landscape-photo {
|
||||
max-height: max(21vh, 210px);
|
||||
} */
|
||||
max-height: max(21vh, 210px);
|
||||
} */
|
||||
|
||||
/* .thumb-img-table {
|
||||
width: max(4vw, 75px);
|
||||
height: max(4vh, 55px);
|
||||
object-fit: cover;
|
||||
} */
|
||||
width: max(4vw, 75px);
|
||||
height: max(4vh, 55px);
|
||||
object-fit: cover;
|
||||
} */
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@ -1523,8 +1523,8 @@
|
||||
let fileSize = window.atob(pureDataURL).length // in Byte
|
||||
// (fileSize/1000) + ' Kb'
|
||||
$('#add-group_' + x + '_spinner').addClass('d-none');
|
||||
$('#add-' + x + '-status').html('Compressed')
|
||||
$('#add-' + x + '-filesize').html('<samp>(' + fileSize / 1000 + ' Kb)</samp>')
|
||||
// $('#add-' + x + '-status').html('Compressed')
|
||||
// $('#add-' + x + '-filesize').html('<samp>(' + fileSize / 1000 + ' Kb)</samp>')
|
||||
$('#add-' + x + '-img').attr('src', res.data)
|
||||
$('#add-' + x + '-img').removeClass('d-none');
|
||||
$('#add-' + x + '-base64').val(res.data)
|
||||
@ -1597,7 +1597,7 @@
|
||||
DUploadAdd.readFile(reader, newFile);
|
||||
|
||||
$('#add-' + x + '-filesize').html('')
|
||||
$('#add-' + x + '-status').html('Loading on compressing...')
|
||||
// $('#add-' + x + '-status').html('Loading on compressing...')
|
||||
// $('#add-' + x + '-img').attr('src', '')
|
||||
$('#add-' + x + '-base64').val('')
|
||||
} else {
|
||||
@ -1751,8 +1751,8 @@
|
||||
let fileSize = window.atob(pureDataURL).length // in Byte
|
||||
// (fileSize/1000) + ' Kb'
|
||||
$('#edt-group_' + x + '_spinner').addClass('d-none');
|
||||
$('#edt-' + x + '-status').html('Compressed')
|
||||
$('#edt-' + x + '-filesize').html('<samp>(' + fileSize / 1000 + ' Kb)</samp>')
|
||||
// $('#edt-' + x + '-status').html('Compressed')
|
||||
// $('#edt-' + x + '-filesize').html('<samp>(' + fileSize / 1000 + ' Kb)</samp>')
|
||||
$('#edt-' + x + '-img').attr('src', res.data)
|
||||
$('#edt-' + x + '-img').removeClass('d-none');
|
||||
$('#edt-' + x + '-base64').val(res.data)
|
||||
@ -1825,7 +1825,7 @@
|
||||
DUploadEdt.readFile(reader, newFile);
|
||||
|
||||
$('#edt-' + x + '-filesize').html('')
|
||||
$('#edt-' + x + '-status').html('Loading on compressing...')
|
||||
// $('#edt-' + x + '-status').html('Loading on compressing...')
|
||||
// $('#edt-' + x + '-img').attr('src', '')
|
||||
$('#edt-' + x + '-base64').val('')
|
||||
} else {
|
||||
|
||||
@ -838,7 +838,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -927,7 +927,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" id="btnSubmitAccident" class="btn btn-sm btn-primary">Kirim</button>
|
||||
<div id="btnSubmitAccidentSpinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
@ -1100,7 +1100,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" id="btnSubmitPck" class="btn btn-sm btn-primary">Kirim</button>
|
||||
<div id="btnSubmitPckSpinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
@ -1208,7 +1208,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" id="btnSubmitDrop" class="btn btn-sm btn-primary">Kirim</button>
|
||||
<div id="btnSubmitDropSpinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
@ -1247,7 +1247,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" id="btnSubmitAprvPck" class="btn btn-sm btn-primary" disabled>Setujui</button>
|
||||
<div id="btnSubmitAprvPckSpinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
|
||||
@ -7,54 +7,54 @@
|
||||
<div class="container-fluid">
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<p class="text-dark text-bold mb-2">Konfigurasi Dana</p>
|
||||
<p class="mb-2 border-bottom"></p>
|
||||
<form id="formDanaUpdt">
|
||||
<div class="form-group mb-3 d-none">
|
||||
<label for="dana_id" class="form-label">Saldo Dana <span class="text-danger">*</span></label>
|
||||
<input type="number" id="dana_id" name="dana_id" class="form-control" value="{{ $dana->id }}" required />
|
||||
</div>
|
||||
<div class="form-group mb-3">
|
||||
<label for="amt" class="form-label">Saldo Dana <span class="text-danger">*</span></label>
|
||||
<input type="text" id="amt" name="amt" class="form-control" value="{{ $dana->amt }}" required />
|
||||
</div>
|
||||
<div class="form-group mb-3 text-end">
|
||||
<button type="button" id="btnUpdtDana" class="btn btn-sm btn-primary">Simpan</button>
|
||||
<div id="btnUpdtDanaSpinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<p class="text-dark text-bold mb-2">Konfigurasi Dana</p>
|
||||
<p class="mb-2 border-bottom"></p>
|
||||
<form id="formDanaUpdt">
|
||||
<div class="form-group mb-3 d-none">
|
||||
<label for="dana_id" class="form-label">Saldo Dana <span class="text-danger">*</span></label>
|
||||
<input type="number" id="dana_id" name="dana_id" class="form-control" value="{{ $dana->id }}" required />
|
||||
</div>
|
||||
<div class="form-group mb-3">
|
||||
<label for="amt" class="form-label">Saldo Dana <span class="text-danger">*</span></label>
|
||||
<input type="text" id="amt" name="amt" class="form-control" value="{{ $dana->amt }}" required />
|
||||
</div>
|
||||
<div class="form-group mb-3 text-end">
|
||||
<button type="button" id="btnUpdtDana" class="btn btn-sm btn-primary">Save</button>
|
||||
<div id="btnUpdtDanaSpinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('customjs')
|
||||
<script>
|
||||
'use strict'
|
||||
<script>
|
||||
'use strict'
|
||||
|
||||
const State = {
|
||||
delay_type_number: 1000,
|
||||
storage_lara: "{{ asset('storage') }}/",
|
||||
file_jimp_worker: "{{ asset('assets/js/worker/jimp.js') }}",
|
||||
};
|
||||
const State = {
|
||||
delay_type_number: 1000,
|
||||
storage_lara: "{{ asset('storage') }}/",
|
||||
file_jimp_worker: "{{ asset('assets/js/worker/jimp.js') }}",
|
||||
};
|
||||
|
||||
const Wrapper = {
|
||||
activate: function() {
|
||||
DanaUpdt.activate();
|
||||
},
|
||||
};
|
||||
const Wrapper = {
|
||||
activate: function() {
|
||||
DanaUpdt.activate();
|
||||
},
|
||||
};
|
||||
|
||||
const DanaUpdt = {
|
||||
const DanaUpdt = {
|
||||
activate: function() {
|
||||
DanaUpdt.event();
|
||||
},
|
||||
@ -62,10 +62,10 @@
|
||||
$('#btnUpdtDana').on('click', async function(e) {
|
||||
e.preventDefault();
|
||||
const data = DanaUpdt.getData();
|
||||
if (!DanaUpdt.checkData(data, true)) return false;
|
||||
DanaUpdt.submitData(data);
|
||||
if (!DanaUpdt.checkData(data, true)) return false;
|
||||
DanaUpdt.submitData(data);
|
||||
});
|
||||
// input
|
||||
// input
|
||||
$('#amt').on('keyup', function() {
|
||||
let price = $('#amt').val().split('.').join('');
|
||||
$('#amt').val((new Intl.NumberFormat('id-ID')).format(price));
|
||||
@ -73,7 +73,7 @@
|
||||
},
|
||||
getData: function(props) {
|
||||
const data = Helper.objectifyForm($('#formDanaUpdt').serializeArray());
|
||||
data.amt = $('#amt').val().split('.').join('');
|
||||
data.amt = $('#amt').val().split('.').join('');
|
||||
|
||||
return data;
|
||||
},
|
||||
@ -93,7 +93,7 @@
|
||||
return false;
|
||||
}
|
||||
$('#btnUpdtDana').attr('disabed', true);
|
||||
$('#btnUpdtDanaSpinner').removeClass('d-none');
|
||||
$('#btnUpdtDanaSpinner').removeClass('d-none');
|
||||
$.ajax({
|
||||
url: "{{ route('api_edit_dana', '') }}/" + data.dana_id,
|
||||
method: 'PUT',
|
||||
@ -106,7 +106,7 @@
|
||||
data,
|
||||
success: (data, textStatus, jqXHR) => {
|
||||
$('#btnUpdtDana').removeAttr('disabed');
|
||||
$('#btnUpdtDanaSpinner').addClass('d-none');
|
||||
$('#btnUpdtDanaSpinner').addClass('d-none');
|
||||
if (data.meta.type != 'success') {
|
||||
resolve({
|
||||
type: 'fail'
|
||||
@ -117,11 +117,11 @@
|
||||
resolve({
|
||||
type: 'success'
|
||||
});
|
||||
Helper.toast('Success', 'sukses update saldo', data.meta.message);
|
||||
Helper.toast('Success', 'sukses update saldo', data.meta.message);
|
||||
},
|
||||
error: (jqXHR, textStatus, error) => {
|
||||
$('#btnUpdtDana').removeAttr('disabed');
|
||||
$('#btnUpdtDanaSpinner').addClass('d-none');
|
||||
$('#btnUpdtDanaSpinner').addClass('d-none');
|
||||
if (jqXHR.status >= 500) {
|
||||
Helper.toast('Error', 'just now', 'Please try again');
|
||||
} else {
|
||||
@ -137,6 +137,6 @@
|
||||
},
|
||||
}
|
||||
|
||||
Wrapper.activate();
|
||||
</script>
|
||||
@endsection
|
||||
Wrapper.activate();
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@ -656,8 +656,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveDisc">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveDisc">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -746,8 +746,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -772,7 +772,7 @@
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" name="isCheckConfirmInvc" type="checkbox" value="yes" id="isCheckConfirmInvc">
|
||||
<label class="form-check-label text-dark" for="isCheckConfirmInvc">
|
||||
Setelah konfirmasi pembayaran maka data penagihan yang dikonfirmasi akan ditutup dan tidak bisa dirubah
|
||||
Setelah konfirmasi pembayaran maka data penagihan yang dikonfirmasi akan diClose dan tidak bisa dirubah
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@ -803,7 +803,7 @@
|
||||
</div> --}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnConfirmInvc" disabled>Konfirmasi</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -837,8 +837,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveTax">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveTax">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -861,7 +861,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelItem" type="button" class="btn btn-sm btn-secondary">Ya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -350,8 +350,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveDisc">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveDisc">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -408,8 +408,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -849,7 +849,7 @@
|
||||
},
|
||||
getData: function() {
|
||||
const data = {};
|
||||
|
||||
|
||||
data.ord_id = State.ord_id;
|
||||
data.ord_code = State.ord_code;
|
||||
data.termin_id = $('#subTotal').data('terminid');
|
||||
|
||||
@ -4,12 +4,12 @@
|
||||
@endsection
|
||||
|
||||
@section('customcss')
|
||||
<style>
|
||||
.tepiBottom {
|
||||
border-bottom: 1.5px groove #000;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.tepiBottom {
|
||||
border-bottom: 1.5px groove #000;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@ -30,8 +30,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-secondary btn-sm"
|
||||
onclick="location.href='{{ route('view_keuangan_payment') }}'">Kembali</button>
|
||||
<button class="btn btn-secondary btn-sm" onclick="location.href='{{ route('view_keuangan_payment') }}'">Kembali</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -218,9 +217,7 @@
|
||||
</a>
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<a href="https://api.whatsapp.com/send/?phone=62{{ $order->drv_phone_val }}&text=Halo&app_absent=0"
|
||||
class="" target="_blank"><i
|
||||
class="text-success ion-social-whatsapp"></i>
|
||||
<a href="https://api.whatsapp.com/send/?phone=62{{ $order->drv_phone_val }}&text=Halo&app_absent=0" class="" target="_blank"><i class="text-success ion-social-whatsapp"></i>
|
||||
{{ implode(' ', str_split('0' . $order->drv_phone_val, 4)) }}</a>
|
||||
</p>
|
||||
@else
|
||||
@ -241,9 +238,7 @@
|
||||
</a>
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<a href="https://api.whatsapp.com/send/?phone=62{{ $order->drv_phone2_val }}&text=Halo&app_absent=0"
|
||||
class="" target="_blank"><i
|
||||
class="text-success ion-social-whatsapp"></i>
|
||||
<a href="https://api.whatsapp.com/send/?phone=62{{ $order->drv_phone2_val }}&text=Halo&app_absent=0" class="" target="_blank"><i class="text-success ion-social-whatsapp"></i>
|
||||
{{ implode(' ', str_split('0' . $order->drv_phone2_val, 4)) }}</a>
|
||||
</p>
|
||||
@else
|
||||
@ -298,7 +293,7 @@
|
||||
<div class="col-sm-12 mb-3">
|
||||
<label for="" class="form-label">Catatan Finance</label>
|
||||
<textarea name="" id="" cols="30" rows="4" class="form-control radius"></textarea>
|
||||
<button class="btn btn-sm btn-primary mt-3">Simpan</button>
|
||||
<button class="btn btn-sm btn-primary mt-3">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -364,14 +359,11 @@
|
||||
<div class="accordion mb-3">
|
||||
<div class="accordion-item border-0 radius-8">
|
||||
<h2 class="accordion-header" id="panelsStayOpen-headingFive">
|
||||
<button class="accordion-button radius-8 collapsed" type="button"
|
||||
data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseFive"
|
||||
aria-expanded="false" aria-controls="panelsStayOpen-collapseFive">
|
||||
<button class="accordion-button radius-8 collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseFive" aria-expanded="false" aria-controls="panelsStayOpen-collapseFive">
|
||||
Berkas Driver
|
||||
</button>
|
||||
</h2>
|
||||
<div id="panelsStayOpen-collapseFive" class="accordion-collapse collapse"
|
||||
aria-labelledby="panelsStayOpen-headingFive">
|
||||
<div id="panelsStayOpen-collapseFive" class="accordion-collapse collapse" aria-labelledby="panelsStayOpen-headingFive">
|
||||
<div class="accordion-body pb-0">
|
||||
<div class="row">
|
||||
@php
|
||||
@ -386,8 +378,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -399,8 +390,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -412,14 +402,13 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@elseif ($drvUp->stts === \App\Models\OrdersDriversUploads::STTS_UP_TRAVEL_DOCUMENT)
|
||||
@php
|
||||
$afterTravelDoc = 1;
|
||||
$afterTravelDoc = 1;
|
||||
@endphp
|
||||
<div class="col-12 mb-3 tepiBottom">
|
||||
<div class="d-flex justify-content-between">
|
||||
@ -428,8 +417,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -441,8 +429,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -454,8 +441,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -467,8 +453,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -480,8 +465,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -493,8 +477,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -506,8 +489,7 @@
|
||||
</div>
|
||||
<div class="card bg-light border mb-0">
|
||||
<div class="card-body p-0">
|
||||
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
|
||||
alt="" class="img-fluid img-report">
|
||||
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -557,9 +539,7 @@
|
||||
<tr class="">
|
||||
<td class="text-center small">1</td>
|
||||
<td class="text-center" id="tblColAction">
|
||||
<a href="javascript:void(0)"
|
||||
class="btn btn-primary btn-sm text-nowrap small w-100"
|
||||
data-bs-toggle="modal" data-bs-target="#mdlpayAdd">Bayar</a>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm text-nowrap small w-100" data-bs-toggle="modal" data-bs-target="#mdlpayAdd">Bayar</a>
|
||||
</td>
|
||||
<td class="small">Biaya inap kendaraan</td>
|
||||
<td class="text-nowrap small text-end">Rp350.000</td>
|
||||
@ -576,8 +556,7 @@
|
||||
<tr class="">
|
||||
<td class="text-center small">2</td>
|
||||
<td class="text-center small">
|
||||
<a href="javascript:void(0)" class="text-nowrap text-success"
|
||||
data-bs-toggle="modal" data-bs-target="#mdlViewAdd">Lihat Bukti</a>
|
||||
<a href="javascript:void(0)" class="text-nowrap text-success" data-bs-toggle="modal" data-bs-target="#mdlViewAdd">Lihat Bukti</a>
|
||||
</td>
|
||||
<td class="small">Biaya pengemudi tambahan</td>
|
||||
<td class="text-nowrap small text-end">Rp530.000</td>
|
||||
@ -623,9 +602,7 @@
|
||||
<tr class="">
|
||||
<td class="text-center small">1</td>
|
||||
<td class="text-center" id="tblColAction">
|
||||
<a href="javascript:void(0)"
|
||||
class="btn btn-primary btn-sm text-nowrap small w-100"
|
||||
data-bs-toggle="modal" data-bs-target="#mdlpayAdd">Bayar</a>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm text-nowrap small w-100" data-bs-toggle="modal" data-bs-target="#mdlpayAdd">Bayar</a>
|
||||
</td>
|
||||
<td class="small">Biaya inap kendaraan</td>
|
||||
<td class="text-nowrap small text-end">Rp350.000</td>
|
||||
@ -642,8 +619,7 @@
|
||||
<tr class="">
|
||||
<td class="text-center small">2</td>
|
||||
<td class="text-center small">
|
||||
<a href="javascript:void(0)" class="text-nowrap text-success"
|
||||
data-bs-toggle="modal" data-bs-target="#mdlViewAdd">Lihat Bukti</a>
|
||||
<a href="javascript:void(0)" class="text-nowrap text-success" data-bs-toggle="modal" data-bs-target="#mdlViewAdd">Lihat Bukti</a>
|
||||
</td>
|
||||
<td class="small">Biaya pengemudi tambahan</td>
|
||||
<td class="text-nowrap small text-end">Rp530.000</td>
|
||||
@ -678,7 +654,7 @@
|
||||
{{-- <label for="fnnc-note{{ $iOrd }}" class="form-label">Catatan Finance</label> --}}
|
||||
<p class="text-danger text-bold mb-0">Catatan Finance #{{ $order->ord_code }}</p>
|
||||
<textarea name="fnnc-note{{ $iOrd }}" id="fnnc-note{{ $iOrd }}" data-ord_id="{{ $order->ord_id }}" cols="30" rows="2" class="form-control radius">{{ $order->fnnc_note }}</textarea>
|
||||
<button id="btnSaveFnncNote{{ $iOrd }}" class="btn btn-sm btn-primary mt-3">Simpan</button>
|
||||
<button id="btnSaveFnncNote{{ $iOrd }}" class="btn btn-sm btn-primary mt-3">Save</button>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@ -690,8 +666,7 @@
|
||||
</div>
|
||||
|
||||
{{-- Modal Term 1 --}}
|
||||
<div class="modal" id="mdlTerm1" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false"
|
||||
aria-labelledby="mdlTerm1Label" aria-hidden="true">
|
||||
<div class="modal" id="mdlTerm1" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="mdlTerm1Label" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -705,15 +680,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveTerm1">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveTerm1">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="mdlpayAdd" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false"
|
||||
aria-labelledby="mdlpayAddLabel" aria-hidden="true">
|
||||
<div class="modal" id="mdlpayAdd" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="mdlpayAddLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -729,8 +703,7 @@
|
||||
<div class="mb-3">
|
||||
<label for="up_paid_proof" class="col-form-label">Unggah Bukti Pembayaran <span class="text-danger">*</span></label>
|
||||
<br>
|
||||
<img id="inpt-up_paid_proof-img" class="img-fluid d-none" src="#"
|
||||
alt="inpt-up_paid_proof-img">
|
||||
<img id="inpt-up_paid_proof-img" class="img-fluid d-none" src="#" alt="inpt-up_paid_proof-img">
|
||||
<div id="inpt-group_up_paid_proof_spinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
@ -741,27 +714,22 @@
|
||||
<span id="inpt-up_paid_proof-filesize" class="d-none"></span>
|
||||
</div>
|
||||
<div id="inpt-group_rotate_up_paid_proof" class="pt-2 d-flex justify-content-start d-none">
|
||||
<button type="button" class="btnRotateLeft btn btn-sm btn-outline-primary ml-1"
|
||||
style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i
|
||||
class="icon ion-arrow-return-left"></i></button>
|
||||
<button type="button" class="btnRotateRight btn btn-sm btn-outline-primary ml-1"
|
||||
style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i
|
||||
class="icon ion-arrow-return-right"></i></button>
|
||||
<button type="button" class="btnRotateLeft btn btn-sm btn-outline-primary ml-1" style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i class="icon ion-arrow-return-left"></i></button>
|
||||
<button type="button" class="btnRotateRight btn btn-sm btn-outline-primary ml-1" style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i class="icon ion-arrow-return-right"></i></button>
|
||||
</div>
|
||||
<input type="file" id="inpt-up_paid_proof-file" class="form-control form-control-sm">
|
||||
<input type="text" id="inpt-up_paid_proof-base64" class="form-control" hidden>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnPayAdd">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnPayAdd">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="mdlViewAdd" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false"
|
||||
aria-labelledby="mdlViewAddLabel" aria-hidden="true">
|
||||
<div class="modal" id="mdlViewAdd" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="mdlViewAddLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -785,7 +753,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -801,7 +769,7 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="addSlcTrxCode" class="mb-3 {{ (count($orders) > 1 ? '' : 'd-none') }}">
|
||||
<div id="addSlcTrxCode" class="mb-3 {{ count($orders) > 1 ? '' : 'd-none' }}">
|
||||
<label for="slcTrxCode" class="form-label w-100">Masukkan ke transaksi <span class="text-danger">*</span></label>
|
||||
<select name="slcTrxCode" id="slcTrxCode" class="select2 form-control" style="width: 100% !important">
|
||||
@foreach ($orders as $order)
|
||||
@ -894,16 +862,16 @@
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||
<select name="ddln_pay_time_hour" id="ddln_pay_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-sm-6 col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||
<select name="ddln_pay_time_minute" id="ddln_pay_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>
|
||||
@ -914,8 +882,7 @@
|
||||
<div class="mb-3">
|
||||
<label for="submission_proof" class="col-form-label">Unggah Bukti Pengajuan <span class="text-danger">*</span></label>
|
||||
<br>
|
||||
<img id="inpt-submission_proof-img" class="img-fluid d-none" src="#"
|
||||
alt="inpt-submission_proof-img">
|
||||
<img id="inpt-submission_proof-img" class="img-fluid d-none" src="#" alt="inpt-submission_proof-img">
|
||||
<div id="inpt-group_submission_proof_spinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
@ -926,12 +893,8 @@
|
||||
<span id="inpt-submission_proof-filesize" class="d-none"></span>
|
||||
</div>
|
||||
<div id="inpt-group_rotate_submission_proof" class="pt-2 d-flex justify-content-start d-none">
|
||||
<button type="button" class="btnRotateLeft btn btn-sm btn-outline-primary ml-1"
|
||||
style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i
|
||||
class="icon ion-arrow-return-left"></i></button>
|
||||
<button type="button" class="btnRotateRight btn btn-sm btn-outline-primary ml-1"
|
||||
style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i
|
||||
class="icon ion-arrow-return-right"></i></button>
|
||||
<button type="button" class="btnRotateLeft btn btn-sm btn-outline-primary ml-1" style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i class="icon ion-arrow-return-left"></i></button>
|
||||
<button type="button" class="btnRotateRight btn btn-sm btn-outline-primary ml-1" style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i class="icon ion-arrow-return-right"></i></button>
|
||||
</div>
|
||||
<input type="file" id="inpt-submission_proof-file" class="form-control form-control-sm">
|
||||
<input type="text" id="inpt-submission_proof-base64" class="form-control" hidden>
|
||||
@ -956,13 +919,11 @@
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bank_acc_number" class="form-label">Nomor Rekening <span class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control form-control-sm" name="bank_acc_number"
|
||||
id="bank_acc_number">
|
||||
<input type="number" class="form-control form-control-sm" name="bank_acc_number" id="bank_acc_number">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bank_acc_name" class="form-label">Pemilik Rekening <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control form-control-sm" name="bank_acc_name"
|
||||
id="bank_acc_name">
|
||||
<input type="text" class="form-control form-control-sm" name="bank_acc_name" id="bank_acc_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
@ -970,8 +931,7 @@
|
||||
<label for="is_paid" class="form-label">Status Pembayaran</label>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="is_paid">
|
||||
<label class="form-check-label" for="is_paid"><span class="text-dark"
|
||||
id="txtIsPaid">Belum dibayar</span></label>
|
||||
<label class="form-check-label" for="is_paid"><span class="text-dark" id="txtIsPaid">Belum dibayar</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="groupIsPaid" class="form-group d-none">
|
||||
@ -983,8 +943,7 @@
|
||||
<div class="mb-3">
|
||||
<label for="is_paid_proof" class="col-form-label">Unggah Bukti Pembayaran <span class="text-danger">*</span></label>
|
||||
<br>
|
||||
<img id="inpt-is_paid_proof-img" class="img-fluid d-none" src="#"
|
||||
alt="inpt-is_paid_proof-img">
|
||||
<img id="inpt-is_paid_proof-img" class="img-fluid d-none" src="#" alt="inpt-is_paid_proof-img">
|
||||
<div id="inpt-group_is_paid_proof_spinner" class="d-none">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
@ -995,12 +954,8 @@
|
||||
<span id="inpt-is_paid_proof-filesize" class="d-none"></span>
|
||||
</div>
|
||||
<div id="inpt-group_rotate_is_paid_proof" class="pt-2 d-flex justify-content-start d-none">
|
||||
<button type="button" class="btnRotateLeft btn btn-sm btn-outline-primary ml-1"
|
||||
style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i
|
||||
class="icon ion-arrow-return-left"></i></button>
|
||||
<button type="button" class="btnRotateRight btn btn-sm btn-outline-primary ml-1"
|
||||
style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i
|
||||
class="icon ion-arrow-return-right"></i></button>
|
||||
<button type="button" class="btnRotateLeft btn btn-sm btn-outline-primary ml-1" style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i class="icon ion-arrow-return-left"></i></button>
|
||||
<button type="button" class="btnRotateRight btn btn-sm btn-outline-primary ml-1" style="padding:0.25rem 0.5rem;border-radius:0.25rem;"><i class="icon ion-arrow-return-right"></i></button>
|
||||
</div>
|
||||
<input type="file" id="inpt-is_paid_proof-file" class="form-control form-control-sm">
|
||||
<input type="text" id="inpt-is_paid_proof-base64" class="form-control" hidden>
|
||||
@ -1015,7 +970,7 @@
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||
<select name="is_paid_time_hour" id="is_paid_time_hour" class="form-control">
|
||||
<option value="" selected disabled hidden>--</option>
|
||||
@for ($i=0; $i<24; $i++)
|
||||
@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>
|
||||
@ -1023,7 +978,7 @@
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||
<select name="is_paid_time_minute" id="is_paid_time_minute" class="form-control">
|
||||
<option value="" selected disabled hidden>--</option>
|
||||
@for ($i=0; $i<60; $i++)
|
||||
@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>
|
||||
@ -1043,8 +998,7 @@
|
||||
<div id="groupPriceToClient" class="d-none">
|
||||
<div class="mb-3">
|
||||
<label for="add-invc_item_price" class="form-label">Harga Satuan yang Ditagihkan <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control form-control-sm" name="add-invc_item_price"
|
||||
id="add-invc_item_price">
|
||||
<input type="text" class="form-control form-control-sm" name="add-invc_item_price" id="add-invc_item_price">
|
||||
</div>
|
||||
<div class="mb-3 d-none">
|
||||
<label for="add-item_bill_tax_type" class="form-label">Perpajakan <span class="text-danger">*</span></label>
|
||||
@ -1082,8 +1036,8 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelItem_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1107,7 +1061,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelItem" type="button" class="btn btn-sm btn-secondary">Ya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -1148,7 +1102,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitRejectItem" type="button" class="btn btn-sm btn-secondary">Ya, tolak</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -1174,7 +1128,7 @@
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
Status pembayaran
|
||||
<div id="mrg-stts_pay"></div>
|
||||
<div id="mrg-stts_pay"></div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -1197,7 +1151,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitMergeItem" type="button" class="btn btn-sm btn-warning">Ya, merge</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -1239,12 +1193,12 @@
|
||||
|
||||
// $('#btnPayAdd').on('click', function() {
|
||||
// let a = `
|
||||
// <a href="javascript:void(0)" class="text-nowrap text-success" data-bs-toggle="modal" data-bs-target="#mdlViewAdd">Lihat Bukti</a>
|
||||
// `
|
||||
// <a href="javascript:void(0)" class="text-nowrap text-success" data-bs-toggle="modal" data-bs-target="#mdlViewAdd">Lihat Bukti</a>
|
||||
// `
|
||||
// let b = `
|
||||
// <p class="mb-0 text-success text-nowrap small">Lunas</p>
|
||||
// <p class="mb-0 text-nowrap small text-muted">23 Apr 2022 06:00</p>
|
||||
// `
|
||||
// <p class="mb-0 text-success text-nowrap small">Lunas</p>
|
||||
// <p class="mb-0 text-nowrap small text-muted">23 Apr 2022 06:00</p>
|
||||
// `
|
||||
// $('#tblColAction').html(a)
|
||||
// $('#tblColStatus').html(b)
|
||||
// $('#mdlpayAdd').modal('hide');
|
||||
@ -1341,7 +1295,9 @@
|
||||
ArcvTable.activate();
|
||||
},
|
||||
event: function() {
|
||||
const { orders } = State;
|
||||
const {
|
||||
orders
|
||||
} = State;
|
||||
for (const iOrd in orders) {
|
||||
$(`#view${iOrd}-pickup_at`).text(moment.unix(orders[iOrd].set_pck_at).format('DD MMM YYYY HH:mm:ss'));
|
||||
$(`#view${iOrd}-pickup_date_at`).text(moment.unix(orders[iOrd].set_pck_at).format('DD MMM YYYY'));
|
||||
@ -1463,7 +1419,9 @@
|
||||
}
|
||||
},
|
||||
initDateAdtPoints: function() {
|
||||
const { orders } = State;
|
||||
const {
|
||||
orders
|
||||
} = State;
|
||||
for (let iOrd in orders) {
|
||||
iOrd = Number(iOrd);
|
||||
for (let iAdtPoint in orders[iOrd].adtPoints) {
|
||||
@ -1502,7 +1460,9 @@
|
||||
let ids = $('#mdlpayAdd').data('ord_a_item_id').split(',');
|
||||
let lastPaid = null;
|
||||
for (let id of ids) {
|
||||
let data = OrdPaidItem.getData({ ord_a_item_id: Number(id) });
|
||||
let data = OrdPaidItem.getData({
|
||||
ord_a_item_id: Number(id)
|
||||
});
|
||||
let isValid = OrdPaidItem.checkData(data, true);
|
||||
if (!isValid) return false;
|
||||
lastPaid = await OrdPaidItem.submitData(data);
|
||||
@ -1690,7 +1650,7 @@
|
||||
// event checklist
|
||||
$('#add-item_isAdmPrice').on('change', function() {
|
||||
$('#invcToClient').prop('checked', false).trigger('change');
|
||||
if($('#add-item_isAdmPrice').prop('checked')) {
|
||||
if ($('#add-item_isAdmPrice').prop('checked')) {
|
||||
OrdAItem.toggleGroupPayPurpose('hide');
|
||||
OrdAItem.toggleGroupSubmissionProof('hide');
|
||||
OrdAItem.toggleGroupFillDdln('hide');
|
||||
@ -1698,7 +1658,7 @@
|
||||
OrdAItem.toggleGroupPayPurpose('show');
|
||||
OrdAItem.toggleGroupSubmissionProof('show');
|
||||
OrdAItem.toggleGroupFillDdln('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#invcToClient').on('change', function() {
|
||||
$('#add-invc_item_price').val('');
|
||||
@ -1763,15 +1723,23 @@
|
||||
},
|
||||
eventTax: function() {
|
||||
// vendor
|
||||
$('#add-item_tax_type').on('change', function () {
|
||||
$('#add-item_tax_type').on('change', function() {
|
||||
const val = $('#add-item_tax_type').val();
|
||||
if (val == State.tax_type.include) {
|
||||
$('.groupTax').removeClass('d-none');
|
||||
if (State.vdr_pkp.is_pkp == State.vdr_pkp.pkp) { $('#add-item_tax_ppn_percent').val(State.tax_type.ppn_percent); } else { $('#add-item_tax_ppn_percent').val(0); }
|
||||
if (State.vdr_pkp.is_pkp == State.vdr_pkp.pkp) {
|
||||
$('#add-item_tax_ppn_percent').val(State.tax_type.ppn_percent);
|
||||
} else {
|
||||
$('#add-item_tax_ppn_percent').val(0);
|
||||
}
|
||||
$('#add-item_tax_pph_percent').val(State.tax_type.pph_percent);
|
||||
} else if (val == State.tax_type.exclude) {
|
||||
$('.groupTax').removeClass('d-none');
|
||||
if (State.vdr_pkp.is_pkp == State.vdr_pkp.pkp) { $('#add-item_tax_ppn_percent').val(State.tax_type.ppn_percent); } else { $('#add-item_tax_ppn_percent').val(0); }
|
||||
if (State.vdr_pkp.is_pkp == State.vdr_pkp.pkp) {
|
||||
$('#add-item_tax_ppn_percent').val(State.tax_type.ppn_percent);
|
||||
} else {
|
||||
$('#add-item_tax_ppn_percent').val(0);
|
||||
}
|
||||
$('#add-item_tax_pph_percent').val(State.tax_type.pph_percent);
|
||||
} else { // without
|
||||
$('.groupTax').addClass('d-none');
|
||||
@ -1784,7 +1752,11 @@
|
||||
$('#add-item_tax_pph_flat').val((new Intl.NumberFormat('id-ID')).format(calcTax.pph_flat));
|
||||
$('#add-item_tax_total_flat').val((new Intl.NumberFormat('id-ID')).format(calcTax.total_tax));
|
||||
|
||||
if (State.vdr_pkp.is_pkp == State.vdr_pkp.pkp) { $('.groupPpn').removeClass('d-none'); } else { $('.groupPpn').addClass('d-none'); }
|
||||
if (State.vdr_pkp.is_pkp == State.vdr_pkp.pkp) {
|
||||
$('.groupPpn').removeClass('d-none');
|
||||
} else {
|
||||
$('.groupPpn').addClass('d-none');
|
||||
}
|
||||
});
|
||||
$('#add-item_tax_type').trigger('change');
|
||||
let ppnPercentTimeout = null;
|
||||
@ -1830,7 +1802,7 @@
|
||||
});
|
||||
|
||||
// client
|
||||
$('#add-item_bill_tax_type').on('change', function () {
|
||||
$('#add-item_bill_tax_type').on('change', function() {
|
||||
const val = $('#add-item_bill_tax_type').val();
|
||||
if (val == State.tax_type.include) {
|
||||
$('.groupTaxBill').removeClass('d-none');
|
||||
@ -1898,10 +1870,9 @@
|
||||
vdr_pkp: State.vdr_pkp.is_pkp,
|
||||
};
|
||||
let slcType = $('#slcItem option:selected');
|
||||
if (slcType.val() === 'new') {
|
||||
if (slcType.val() === 'new') {
|
||||
calc.price = Number($('#add-item_price').val().split('.').join(''));
|
||||
} else if (slcType.val() === '') {
|
||||
} else {
|
||||
} else if (slcType.val() === '') {} else {
|
||||
calc.price = Number(slcType.data('price'));
|
||||
}
|
||||
|
||||
@ -1976,18 +1947,17 @@
|
||||
const data = {};
|
||||
|
||||
let slcType = $('#slcItem option:selected');
|
||||
if (slcType.val() === 'new') {
|
||||
if (slcType.val() === 'new') {
|
||||
data.a_id = '00';
|
||||
data.a_name = $('#add-item_name').val();
|
||||
data.a_type = $('#add-item_type').val();
|
||||
data.a_price = $('#add-item_price').val().split('.').join('');
|
||||
if($('#add-item_isAdmPrice').prop('checked')) {
|
||||
if ($('#add-item_isAdmPrice').prop('checked')) {
|
||||
data.is_adm_price = State.is_adm_price.yes
|
||||
} else {
|
||||
data.is_adm_price = State.is_adm_price.no
|
||||
}
|
||||
} else if (slcType.val() === '') {
|
||||
} else {
|
||||
} else if (slcType.val() === '') {} else {
|
||||
data.a_id = slcType.val(); // id
|
||||
data.a_name = slcType.data('name');
|
||||
data.a_type = slcType.data('type');
|
||||
@ -2534,7 +2504,9 @@
|
||||
// $('#tblAdditional').DataTable();
|
||||
// if (Driver.Table.firstInitDataTable == 1) { loadTableSkeletonLoading() } else { Driver.Table.firstInitDataTable = 1; }
|
||||
let ord_ids = '';
|
||||
const { orders } = State;
|
||||
const {
|
||||
orders
|
||||
} = State;
|
||||
for (let iOrd in orders) {
|
||||
ord_ids += `${orders[iOrd].ord_id},`;
|
||||
}
|
||||
@ -2639,9 +2611,9 @@
|
||||
// if (State.a_item_type.second == row.a_item_type) {
|
||||
// if (row.is_merge_to == State.is_merge.yes || row.is_merge_from == State.is_merge.yes) {} else {
|
||||
// action += `
|
||||
// <br>
|
||||
// <a href="javascript:void(0)" class="btn btn-warning btn-sm text-nowrap small mt-2 w-100 btnMergeItem">Merge</a>
|
||||
// `;
|
||||
// <br>
|
||||
// <a href="javascript:void(0)" class="btn btn-warning btn-sm text-nowrap small mt-2 w-100 btnMergeItem">Merge</a>
|
||||
// `;
|
||||
// }
|
||||
// }
|
||||
return action;
|
||||
@ -2691,8 +2663,11 @@
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
render: function(data, type, row, meta) {
|
||||
let totalTax = 0, totalBase = 0;
|
||||
let textTax = '', textBase = '', taxType = '';
|
||||
let totalTax = 0,
|
||||
totalBase = 0;
|
||||
let textTax = '',
|
||||
textBase = '',
|
||||
taxType = '';
|
||||
|
||||
if (row.amt_tax_type == State.tax_type.include) {
|
||||
taxType = 'Perpajakan: Sudah Termasuk Pajak<br>';
|
||||
@ -2725,7 +2700,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let text = '';
|
||||
if (row.amt_tax_type == State.tax_type.include) {
|
||||
text += taxType + textBase + (new Intl.NumberFormat('id-ID')).format(totalBase) + '<br>' + textTax + (new Intl.NumberFormat('id-ID')).format(totalTax) + '<br>';
|
||||
@ -2818,7 +2793,9 @@
|
||||
// $('#tblAdditionalArchv').DataTable();
|
||||
// if (Driver.Table.firstInitDataTable == 1) { loadTableSkeletonLoading() } else { Driver.Table.firstInitDataTable = 1; }
|
||||
let ord_ids = '';
|
||||
const { orders } = State;
|
||||
const {
|
||||
orders
|
||||
} = State;
|
||||
for (let iOrd in orders) {
|
||||
ord_ids += `${orders[iOrd].ord_id},`;
|
||||
}
|
||||
@ -2973,7 +2950,9 @@
|
||||
OrdNoteFnnc.event();
|
||||
},
|
||||
event: function() {
|
||||
const { orders } = State;
|
||||
const {
|
||||
orders
|
||||
} = State;
|
||||
for (let iOrd in orders) {
|
||||
$(`#btnSaveFnncNote${iOrd}`).on('click', function(e) {
|
||||
e.preventDefault();
|
||||
@ -3222,7 +3201,7 @@
|
||||
// reader.readAsArrayBuffer(file);
|
||||
reader.readAsDataURL(file);
|
||||
},
|
||||
clearFile: function (x) {
|
||||
clearFile: function(x) {
|
||||
$('#inpt-' + x + '-img').addClass('d-none')
|
||||
$('#inpt-' + x + '-filesize').html('');
|
||||
$('#inpt-' + x + '-base64').val('');
|
||||
|
||||
@ -287,7 +287,7 @@
|
||||
<div class="col-sm-12 mb-3" id="bankAcc">
|
||||
<label for="" class="form-label">Catatan Finance</label>
|
||||
<textarea name="" id="" cols="30" rows="4" class="form-control radius"></textarea>
|
||||
<button class="btn btn-sm btn-primary mt-3">Simpan</button>
|
||||
<button class="btn btn-sm btn-primary mt-3">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -492,7 +492,7 @@
|
||||
<div class="col-sm-12 col-md-12 col-lg-12" id="bankAcc">
|
||||
<label for="fnnc-note" class="form-label">Catatan Finance</label>
|
||||
<textarea name="fnnc-note" id="fnnc-note" cols="30" rows="2" class="form-control radius">{{ $order->fnnc_note }}</textarea>
|
||||
<button id="btnSaveFnncNote" class="btn btn-sm btn-primary mt-3">Simpan</button>
|
||||
<button id="btnSaveFnncNote" class="btn btn-sm btn-primary mt-3">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -518,8 +518,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveTerm1">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSaveTerm1">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -566,8 +566,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnPayAdd">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnPayAdd">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -598,7 +598,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -823,8 +823,8 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelItem_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Simpan</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnSubmitAddItem">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -848,7 +848,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelItem" type="button" class="btn btn-sm btn-secondary">Ya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -889,7 +889,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitRejectItem" type="button" class="btn btn-sm btn-secondary">Ya, tolak</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -938,7 +938,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitMergeItem" type="button" class="btn btn-sm btn-warning">Ya, merge</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -1363,7 +1363,7 @@
|
||||
OrdAItem.toggleGroupPayPurpose('show');
|
||||
OrdAItem.toggleGroupSubmissionProof('show');
|
||||
OrdAItem.toggleGroupFillDdln('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#invcToClient').on('change', function() {
|
||||
$('#add-invc_item_price').val('');
|
||||
@ -2213,7 +2213,7 @@
|
||||
action += `
|
||||
<p class="mb-0 text-muted small">Pengajuan ditolak oleh ${row.urjct_name} pada tanggal ${moment.unix(row.rjct_at).format('DD MMM YYYY HH:mm:ss')}</p>
|
||||
`;
|
||||
return action;
|
||||
return action;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
|
||||
@ -7,9 +7,8 @@
|
||||
@section('customcss')
|
||||
<style>
|
||||
/* .select2-container {
|
||||
z-index: 99999;
|
||||
} */
|
||||
|
||||
z-index: 99999;
|
||||
} */
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@ -54,8 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlNewItem"
|
||||
aria-labelledby="mdlNewItemLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlNewItem" aria-labelledby="mdlNewItemLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -71,23 +69,20 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<label for="add-name" class="col-form-label">Nama<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="add-name" class="col-form-label">Nama<span class="text-danger">*</span></label>
|
||||
<input type="text" name="add-name" id="add-name" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="add-type" class="col-form-label">Satuan<span
|
||||
class="text-danger">*</span></label>
|
||||
<select name="add-type" id="add-type" class="form-control" style="width:100%;">
|
||||
<option value="" selected disabled>Belum dipilih</option>
|
||||
@foreach ($unitTypes as $type)
|
||||
<label for="add-type" class="col-form-label">Satuan<span class="text-danger">*</span></label>
|
||||
<select name="add-type" id="add-type" class="form-control" style="width:100%;">
|
||||
<option value="" selected disabled>Belum dipilih</option>
|
||||
@foreach ($unitTypes as $type)
|
||||
<option value="{{ $type->id }}">{{ $type->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="add-price" class="col-form-label">Harga Satuan<span
|
||||
class="text-danger">*</span></label>
|
||||
<div class="col-sm-12">
|
||||
<label for="add-price" class="col-form-label">Harga Satuan<span class="text-danger">*</span></label>
|
||||
<input type="text" name="add-price" id="add-price" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@ -99,12 +94,10 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<label for="add-status" class="form-label">Status<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="add-status" class="form-label">Status<span class="text-danger">*</span></label>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="add-status">
|
||||
<label class="form-check-label" for="add-status"><span class="text-dark"
|
||||
id="add-txtStatus">Inactive</span></label>
|
||||
<label class="form-check-label" for="add-status"><span class="text-dark" id="add-txtStatus">Inactive</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -129,8 +122,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlUpdtItem"
|
||||
aria-labelledby="mdlUpdtItemLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlUpdtItem" aria-labelledby="mdlUpdtItemLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -146,23 +138,20 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<label for="updt-name" class="col-form-label">Nama<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-name" class="col-form-label">Nama<span class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-name" id="updt-name" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="updt-type" class="col-form-label">Satuan<span
|
||||
class="text-danger">*</span></label>
|
||||
<select name="updt-type" id="updt-type" class="form-control" style="width:100%;">
|
||||
<option value="" selected disabled>Belum dipilih</option>
|
||||
@foreach ($unitTypes as $type)
|
||||
<label for="updt-type" class="col-form-label">Satuan<span class="text-danger">*</span></label>
|
||||
<select name="updt-type" id="updt-type" class="form-control" style="width:100%;">
|
||||
<option value="" selected disabled>Belum dipilih</option>
|
||||
@foreach ($unitTypes as $type)
|
||||
<option value="{{ $type->id }}">{{ $type->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="updt-price" class="col-form-label">Harga Satuan<span
|
||||
class="text-danger">*</span></label>
|
||||
<div class="col-sm-12">
|
||||
<label for="updt-price" class="col-form-label">Harga Satuan<span class="text-danger">*</span></label>
|
||||
<input type="text" name="updt-price" id="updt-price" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@ -174,12 +163,10 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<label for="updt-status" class="form-label">Status<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="updt-status" class="form-label">Status<span class="text-danger">*</span></label>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="updt-status">
|
||||
<label class="form-check-label" for="updt-status"><span class="text-dark"
|
||||
id="updt-txtStatus">Inactive</span></label>
|
||||
<label class="form-check-label" for="updt-status"><span class="text-dark" id="updt-txtStatus">Inactive</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -198,15 +185,14 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnDelItem_updt" class="btn btn-sm btn-warning">Hapus ?</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitUpdtItems" type="button" class="btn btn-sm btn-danger">Ubah data</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDelItem"
|
||||
aria-labelledby="mdlDelItemLabel" aria-hidden="true">
|
||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDelItem" aria-labelledby="mdlDelItemLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -225,7 +211,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Close</button>
|
||||
<button id="btnSubmitDelItem" type="button" class="btn btn-sm btn-secondary">Iya, hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -272,11 +258,11 @@
|
||||
else
|
||||
$('#updt-txtStatus').html('Inactive')
|
||||
});
|
||||
// fix modal select2
|
||||
$('#add-type').select2({
|
||||
// fix modal select2
|
||||
$('#add-type').select2({
|
||||
dropdownParent: $('#mdlNewItem'),
|
||||
});
|
||||
$('#updt-type').select2({
|
||||
$('#updt-type').select2({
|
||||
dropdownParent: $('#mdlUpdtItem'),
|
||||
});
|
||||
},
|
||||
@ -344,7 +330,7 @@
|
||||
$(td).attr('data-price', rowData.price);
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
data: 'type_name',
|
||||
className: 'text-end text-nowrap',
|
||||
visible: true,
|
||||
@ -357,7 +343,7 @@
|
||||
visible: true,
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
render: function(data, type, row, meta) {
|
||||
render: function(data, type, row, meta) {
|
||||
return (new Intl.NumberFormat('id-ID')).format(data);
|
||||
},
|
||||
},
|
||||
@ -412,7 +398,7 @@
|
||||
data.status = State.stts_isact.inactive;
|
||||
}
|
||||
|
||||
if($('#add-isAdmPrice').prop('checked')) {
|
||||
if ($('#add-isAdmPrice').prop('checked')) {
|
||||
data.is_adm_price = State.is_adm_price.yes
|
||||
} else {
|
||||
data.is_adm_price = State.is_adm_price.no
|
||||
@ -552,7 +538,7 @@
|
||||
$('#updt-status').prop('checked', false).trigger('change');
|
||||
}
|
||||
|
||||
if(data.is_adm_price == State.is_adm_price.yes) {
|
||||
if (data.is_adm_price == State.is_adm_price.yes) {
|
||||
$('#updt-isAdmPrice').prop('checked', true).trigger('change');
|
||||
} else {
|
||||
$('#updt-isAdmPrice').prop('checked', false).trigger('change');
|
||||
@ -575,7 +561,7 @@
|
||||
data.status = State.stts_isact.inactive;
|
||||
}
|
||||
|
||||
if($('#updt-isAdmPrice').prop('checked')) {
|
||||
if ($('#updt-isAdmPrice').prop('checked')) {
|
||||
data.is_adm_price = State.is_adm_price.yes
|
||||
} else {
|
||||
data.is_adm_price = State.is_adm_price.no
|
||||
@ -648,8 +634,8 @@
|
||||
let price = row.find('td[data-price]').data('price');
|
||||
ADel.passDataToView({
|
||||
id,
|
||||
name,
|
||||
price,
|
||||
name,
|
||||
price,
|
||||
});
|
||||
$('#mdlDelItem').data('id', id);
|
||||
$('#mdlDelItem').modal('show');
|
||||
@ -662,11 +648,15 @@
|
||||
});
|
||||
// on modal update
|
||||
$('#btnDelItem_updt').on('click', function(e) {
|
||||
const { id, name, price } = AUpdt.getData();
|
||||
const {
|
||||
id,
|
||||
name,
|
||||
price
|
||||
} = AUpdt.getData();
|
||||
ADel.passDataToView({
|
||||
id,
|
||||
name,
|
||||
price,
|
||||
price,
|
||||
});
|
||||
$('#mdlDelItem').data('id', id);
|
||||
$('#mdlDelItem').modal('show');
|
||||
|
||||
Reference in New Issue
Block a user