Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2453e768c9 | |||
| aaf2d9b70c |
|
|
@ -348,10 +348,6 @@ access_keys:
|
|||
label: Customer Source Report
|
||||
- id: report.hub.filter
|
||||
label: Hub Filter Report
|
||||
- id: report.warranty.raffle
|
||||
label: Warranty Raffle Report
|
||||
- id: report.jo.raffle
|
||||
label: JO Raffle Report
|
||||
|
||||
- id: service
|
||||
label: Other Services
|
||||
|
|
@ -586,17 +582,3 @@ access_keys:
|
|||
label: Update
|
||||
- id: ownership_type.delete
|
||||
label: Delete
|
||||
|
||||
- id: customer_location
|
||||
label: Customer Location Access
|
||||
acls:
|
||||
- id: cust_location.menu
|
||||
label: Menu
|
||||
- id: cust_location.list
|
||||
label: List
|
||||
- id: cust_location.add
|
||||
label: Add
|
||||
- id: cust_location.update
|
||||
label: Update
|
||||
- id: cust_location.delete
|
||||
label: Delete
|
||||
|
|
|
|||
|
|
@ -69,56 +69,3 @@ access_keys:
|
|||
acls:
|
||||
- id: dealer.list
|
||||
label: List
|
||||
- id: warrantyserial
|
||||
label: Warranty Serial
|
||||
acls:
|
||||
- id: warrantyserial.upload
|
||||
label: Upload
|
||||
|
||||
- id: tapi_vmanufacturer
|
||||
label: Third Party Vehicle Manufacturer Access
|
||||
acls:
|
||||
- id: tapi_vmanufacturer.list
|
||||
label: List Third Party Vehicle Manufacturers
|
||||
- id: tapi_vehicle
|
||||
label: Third Party Vehicle Make Access
|
||||
acls:
|
||||
- id: tapi_vehicle.list
|
||||
label: List Third Party Vehicles
|
||||
- id: tapi_promo
|
||||
label: Third Party Promo Access
|
||||
acls:
|
||||
- id: tapi_promo.list
|
||||
label: List Third Party Promos
|
||||
- id: tapi_battery
|
||||
label: Third Party Battery Access
|
||||
acls:
|
||||
- id: tapi_battery_compatible.list
|
||||
label: List Third Party Compatible Batteries
|
||||
- id: tapi_jo
|
||||
label: Third Party Job Order Access
|
||||
acls:
|
||||
- id: tapi_jo.request
|
||||
label: Third Party Request Job Order
|
||||
- id: tapi_jo.get.estimate
|
||||
label: Third Party Get Estimate
|
||||
- id: tapi_jo.get.ongoing
|
||||
label: Third Party Get Ongoing Job Order
|
||||
- id: tapi_jo.cancel
|
||||
label: Third Party Cancel Job Order
|
||||
- id: tapi_jo.get.invoice
|
||||
label: Third Party Get Job Order Invoice
|
||||
- id: tapi_jo.location.support
|
||||
label: Third Party Check Location Support
|
||||
- id: tapi_jo.nearest_hub.get
|
||||
label: Third Party Get Nearest Hub and Slots
|
||||
- id: tapi_jo.schedule_option.status
|
||||
label: Third Party Schedule Option Status
|
||||
- id: tapi_jo.get.info
|
||||
label: Third Party Get Job Order Info
|
||||
- id: tapi_service
|
||||
label: Third Party Service Access
|
||||
acls:
|
||||
- id: tapi_service.list
|
||||
label: List Third Party Services
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,3 @@ main_menu:
|
|||
acl: ownership_type.menu
|
||||
label: Ownership Types
|
||||
parent: database
|
||||
- id: customer_location_list
|
||||
acl: cust_location.menu
|
||||
label: Customer Locations
|
||||
parent: database
|
||||
|
|
|
|||
|
|
@ -43,10 +43,6 @@ security:
|
|||
pattern: ^\/rapi\/
|
||||
security: false
|
||||
|
||||
test_capi:
|
||||
pattern: ^\/test_capi\/
|
||||
security: false
|
||||
|
||||
warranty_api:
|
||||
pattern: ^\/capi\/
|
||||
stateless: true
|
||||
|
|
@ -63,14 +59,6 @@ security:
|
|||
provider: api_key_user_provider
|
||||
user_checker: Catalyst\AuthBundle\Service\UserChecker
|
||||
|
||||
third_party_api:
|
||||
pattern: ^\/tapi\/
|
||||
stateless: true
|
||||
simple_preauth:
|
||||
authenticator: Catalyst\APIBundle\Security\APIKeyAuthenticator
|
||||
provider: api_key_user_provider
|
||||
user_checker: Catalyst\AuthBundle\Service\UserChecker
|
||||
|
||||
main:
|
||||
provider: user_provider
|
||||
form_login:
|
||||
|
|
|
|||
|
|
@ -3,10 +3,6 @@ capi_test:
|
|||
path: /capi/test
|
||||
controller: App\Controller\CAPI\TestController::test
|
||||
|
||||
capi_test_warranty_serial:
|
||||
path: /test_capi/test/warranty_serial
|
||||
controller: App\Controller\CAPI\TestController::warrantySerial
|
||||
|
||||
|
||||
# battery api
|
||||
|
||||
|
|
@ -188,9 +184,3 @@ capi_dealer_list:
|
|||
path: /capi/dealers
|
||||
controller: App\Controller\CAPI\DealerController::getAll
|
||||
methods: [GET]
|
||||
|
||||
# warranty serial api
|
||||
capi_warranty_serial_upload:
|
||||
path: /capi/warranty_serial/upload
|
||||
controller: App\Controller\CAPI\WarrantySerialController::uploadWarrantySerialFile
|
||||
methods: [POST]
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
customer_location_list:
|
||||
path: /customer-locations
|
||||
controller: App\Controller\CustomerLocationController::index
|
||||
methods: [GET]
|
||||
|
||||
customer_location_rows:
|
||||
path: /customer-locations/rowdata
|
||||
controller: App\Controller\CustomerLocationController::datatableRows
|
||||
methods: [POST]
|
||||
|
||||
customer_location_add_form:
|
||||
path: /customer-locations/newform
|
||||
controller: App\Controller\CustomerLocationController::addForm
|
||||
methods: [GET]
|
||||
|
||||
customer_location_add_submit:
|
||||
path: /customer-locations
|
||||
controller: App\Controller\CustomerLocationController::addSubmit
|
||||
methods: [POST]
|
||||
|
||||
customer_location_update_form:
|
||||
path: /customer-locations/{id}
|
||||
controller: App\Controller\CustomerLocationController::updateForm
|
||||
methods: [GET]
|
||||
|
||||
customer_location_update_submit:
|
||||
path: /customer-locations/{id}
|
||||
controller: App\Controller\CustomerLocationController::updateSubmit
|
||||
methods: [POST]
|
||||
|
||||
customer_location_delete:
|
||||
path: /customer-locations/{id}
|
||||
controller: App\Controller\CustomerLocationController::deleteSubmit
|
||||
methods: [DELETE]
|
||||
|
||||
|
|
@ -147,23 +147,3 @@ rep_hub_filter_submit:
|
|||
path: /report/hub_filter_report
|
||||
controller: App\Controller\ReportController::hubFilterSubmit
|
||||
methods: [POST]
|
||||
|
||||
rep_warranty_raffle_form:
|
||||
path: /report/warranty_raffle_report
|
||||
controller: App\Controller\ReportController::warrantyRaffleForm
|
||||
methods: [GET]
|
||||
|
||||
rep_warranty_raffle_submit:
|
||||
path: /report/warranty_raffle_report
|
||||
controller: App\Controller\ReportController::warrantyRaffleSubmit
|
||||
methods: [POST]
|
||||
|
||||
rep_jo_raffle_form:
|
||||
path: /report/jo_raffle_report
|
||||
controller: App\Controller\ReportController::joRaffleForm
|
||||
methods: [GET]
|
||||
|
||||
rep_jo_raffle_submit:
|
||||
path: /report/jo_raffle_report
|
||||
controller: App\Controller\ReportController::joRaffleSubmit
|
||||
methods: [POST]
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
# third party api
|
||||
|
||||
# job order
|
||||
tapi_jo_request:
|
||||
path: /tapi/job_order
|
||||
controller: App\Controller\TAPI\JobOrderController::requestJobOrder
|
||||
methods: [POST]
|
||||
|
||||
tapi_estimate:
|
||||
path: /tapi/estimate
|
||||
controller: App\Controller\TAPI\JobOrderController::getEstimate
|
||||
methods: [POST]
|
||||
|
||||
tapi_jo_invoice:
|
||||
path: /tapi/job_order/invoice/{jo_id}
|
||||
controller: App\Controller\TAPI\JobOrderController:getJOInvoice
|
||||
methods: [GET]
|
||||
|
||||
tapi_jo_cancel:
|
||||
path: /tapi/job_order/cancel
|
||||
controller: App\Controller\TAPI\JobOrderController:cancelJobOrder
|
||||
methods: [POST]
|
||||
|
||||
tapi_jo_info:
|
||||
path: /tapi/job_order/{jo_id}/info
|
||||
controller: App\Controller\TAPI\JobOrderController::getJobOrderInfo
|
||||
methods: [GET]
|
||||
|
||||
tapi_location_support:
|
||||
path: /tapi/location_support
|
||||
controller: App\Controller\TAPI\JobOrderController:locationSupport
|
||||
methods: [POST]
|
||||
|
||||
tapi_nearest_hub_slots:
|
||||
path: /tapi/hub_slots
|
||||
controller: App\Controller\TAPI\JobOrderController::getNearestHubAndSlots
|
||||
methods: [POST]
|
||||
|
||||
# vehicle manufacturer and vehicle
|
||||
tapi_vehicle_mfg_list:
|
||||
path: /tapi/vehicle/mfgs
|
||||
controller: App\Controller\TAPI\VehicleController::listVehicleManufacturers
|
||||
methods: [GET]
|
||||
|
||||
tapi_vehicle_make_list:
|
||||
path: /tapi/vehicle/mfgs/{mfg_id}/makes
|
||||
controller: App\Controller\TAPI\VehicleController::listVehicleMakes
|
||||
methods: [GET]
|
||||
|
||||
# battery
|
||||
tapi_battery_list:
|
||||
path: /tapi/vehicles/{vid}/compatible_batteries
|
||||
controller: App\Controller\TAPI\BatteryController::getCompatibleBatteries
|
||||
methods: [GET]
|
||||
|
||||
# promos
|
||||
tapi_promo_list:
|
||||
path: /tapi/promos
|
||||
controller: App\Controller\TAPI\PromoController::listPromos
|
||||
methods: [GET]
|
||||
|
|
@ -111,10 +111,6 @@ services:
|
|||
$cvu_mfg_id: "%env(CVU_MFG_ID)%"
|
||||
$cvu_brand_id: "%env(CVU_BRAND_ID)%"
|
||||
|
||||
App\Command\LoadWarrantySerialCommand:
|
||||
arguments:
|
||||
$callback_url: "%env(WARRANTY_SERIAL_CALLBACK_URL)%"
|
||||
|
||||
# rider tracker service
|
||||
App\Service\RiderTracker:
|
||||
arguments:
|
||||
|
|
@ -277,14 +273,6 @@ services:
|
|||
arguments:
|
||||
$em: "@doctrine.orm.entity_manager"
|
||||
|
||||
# warranty logger for raffle
|
||||
App\Service\WarrantyRaffleLogger:
|
||||
arguments:
|
||||
$em: "@doctrine.orm.entity_manager"
|
||||
|
||||
# warranty raffle filter
|
||||
App\Service\WarrantyRaffleFilter: ~
|
||||
|
||||
# promo logger
|
||||
App\Service\PromoLogger:
|
||||
arguments:
|
||||
|
|
@ -318,13 +306,3 @@ services:
|
|||
App\Service\WarrantyBulkUploader:
|
||||
arguments:
|
||||
$em: "@doctrine.orm.entity_manager"
|
||||
|
||||
# warranty serial file logger
|
||||
App\Service\WarrantySerialUploadLogger:
|
||||
arguments:
|
||||
$em: "@doctrine.orm.entity_manager"
|
||||
|
||||
# warranty serial load logger
|
||||
App\Service\WarrantySerialLoadLogger:
|
||||
arguments:
|
||||
$em: "@doctrine.orm.entity_manager"
|
||||
|
|
|
|||
BIN
public/assets/favicon/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/assets/favicon/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/assets/favicon/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/assets/favicon/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/yokohama.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
public/yokohama_login.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
public/yokohama_logo.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use App\Entity\WarrantySerialQueue;
|
||||
|
||||
class CountTotalPendingWarrantySerialFilesCommand extends Command
|
||||
{
|
||||
protected $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('warrantyserial:count')
|
||||
->setDescription('Count number of pending warranty serial files.')
|
||||
->setHelp('Count number of pending warranty serial files.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$em = $this->em;
|
||||
|
||||
$status = 'pending';
|
||||
|
||||
$db = $em->getConnection();
|
||||
|
||||
$ws_query_sql = 'SELECT COUNT(*) AS total FROM warranty_serial_queue
|
||||
WHERE status = :status';
|
||||
|
||||
$ws_query_stmt = $db->prepare($ws_query_sql);
|
||||
$ws_query_stmt->bindValue('status', $status);
|
||||
|
||||
$ws_results = $ws_query_stmt->executeQuery();
|
||||
|
||||
$results = $ws_results->fetchAssociative();
|
||||
|
||||
$output->write($results['total']);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ class GenerateBatteryCompatibilityCommand extends Command
|
|||
$vehicles = $vm->getVehicles();
|
||||
foreach ($vehicles as $vehicle)
|
||||
{
|
||||
$batteries = $vehicle->getActiveBatteries();
|
||||
$batteries = $vehicle->getBatteries();
|
||||
$comp_batt = [];
|
||||
foreach ($batteries as $battery)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,469 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use App\Entity\WarrantySerial;
|
||||
use App\Entity\WarrantySerialQueue;
|
||||
use App\Entity\WarrantySerialUploadLog;
|
||||
use App\Entity\WarrantySerialLoadLog;
|
||||
|
||||
use App\Service\WarrantySerialUploadLogger;
|
||||
use App\Service\WarrantySerialLoadLogger;
|
||||
|
||||
use PDO;
|
||||
use DateTime;
|
||||
|
||||
class LoadWarrantySerialCommand extends Command
|
||||
{
|
||||
const FIELD_COUNT = 7;
|
||||
const SERIAL_LENGTH = 20;
|
||||
|
||||
protected $em;
|
||||
protected $upload_logger;
|
||||
protected $load_logger;
|
||||
protected $project_dir;
|
||||
protected $callback_url;
|
||||
protected $log_data;
|
||||
protected $filesystem;
|
||||
|
||||
public function __construct(EntityManagerInterface $em, WarrantySerialUploadLogger $upload_logger,
|
||||
WarrantySerialLoadLogger $load_logger, KernelInterface $kernel, $callback_url,
|
||||
FileSystem $filesystem)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->upload_logger = $upload_logger;
|
||||
$this->load_logger = $load_logger;
|
||||
$this->project_dir = $kernel->getProjectDir();
|
||||
$this->callback_url = $callback_url;
|
||||
$this->filesystem = $filesystem;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('warrantyserial:load')
|
||||
->setDescription('Load warranty serials from file.')
|
||||
->setHelp('Load warranty serials from file.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$em = $this->em;
|
||||
$this->log_data = [];
|
||||
|
||||
$status = 'pending';
|
||||
|
||||
// get the filenames from the queue table with status pending
|
||||
$db = $em->getConnection();
|
||||
|
||||
$ws_query_sql = 'SELECT id, file_serial, file_id, api_user, orig_file_serial FROM warranty_serial_queue
|
||||
WHERE status = :status ORDER BY id LIMIT 1';
|
||||
|
||||
$ws_query_stmt = $db->prepare($ws_query_sql);
|
||||
$ws_query_stmt->bindValue('status', $status);
|
||||
|
||||
$ws_results = $ws_query_stmt->executeQuery();
|
||||
|
||||
$output_info = [];
|
||||
while ($row = $ws_results->fetchAssociative())
|
||||
{
|
||||
$filename = $row['file_serial'];
|
||||
$user_id = $row['api_user'];
|
||||
$id = $row['id'];
|
||||
$file_id = $row['file_id'];
|
||||
$orig_filename = $row['orig_file_serial'];
|
||||
|
||||
$output_info[] = $this->processWarrantySerialFile($filename, $user_id, $file_id, $orig_filename);
|
||||
|
||||
// remove entry from queue table
|
||||
$this->updateWarrantySerialQueue($id);
|
||||
|
||||
// delete the uploaded csv file and directory
|
||||
$this->deleteDirectoryAndFile($file_id);
|
||||
}
|
||||
|
||||
if (count($output_info) > 0)
|
||||
{
|
||||
// error_log(print_r($this->log_data, true));
|
||||
// load log data into db
|
||||
$this->load_logger->logWarrantySerialLoadInfo($this->log_data);
|
||||
|
||||
// send results back to third party
|
||||
$this->sendResults($output_info);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected function processWarrantySerialFile($filename, $user_id, $file_id, $orig_filename)
|
||||
{
|
||||
$csv_file = $this->project_dir . '/public/warranty_serial_uploads/' . $filename;
|
||||
|
||||
$output_info = [];
|
||||
|
||||
// attempt to open file
|
||||
try
|
||||
{
|
||||
$fh = fopen($csv_file, "r");
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$error = 'The file ' . $csv_file . 'could not be read.';
|
||||
$log_data = [
|
||||
'user_id' => $user_id,
|
||||
'is_uploaded' => false,
|
||||
'error' => $error,
|
||||
];
|
||||
$this->upload_logger->logWarrantySerialUploadInfo($log_data);
|
||||
|
||||
$output_info = $this->setOutputInfo($filename, $file_id, true, $error, $data, $orig_filename);
|
||||
|
||||
return $output_info;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
while(($row = fgetcsv($fh)) !== false)
|
||||
{
|
||||
$validation_result = $this->validateRow($row, $user_id);
|
||||
if (!empty($validation_result))
|
||||
{
|
||||
$data[] = $validation_result;
|
||||
continue;
|
||||
}
|
||||
|
||||
// valid entry, we parse and insert
|
||||
$serial = trim(strtoupper($row[0]));
|
||||
|
||||
// error_log('Processing ' . $serial);
|
||||
|
||||
$sku = trim(strtoupper($row[1]));
|
||||
$dispatch_status = trim($row[2]);
|
||||
$str_date_create = trim($row[3]);
|
||||
$inventory_status = trim($row[4]);
|
||||
$cat_id = trim($row[5]);
|
||||
$cat_name = trim(strtoupper($row[6]));
|
||||
|
||||
// we are sure that this is a valid date at this point
|
||||
$created_date = $this->convertDateCreate($str_date_create);
|
||||
|
||||
$meta_info = [
|
||||
'dispatch_status' => $dispatch_status,
|
||||
'inventory_status' => $inventory_status,
|
||||
'category_id' => $cat_id,
|
||||
'category_name' => $cat_name,
|
||||
];
|
||||
|
||||
$info = json_encode($meta_info);
|
||||
|
||||
// prepare the data
|
||||
$source = 'motiv';
|
||||
if ($sku == 'N/A')
|
||||
$sku = null;
|
||||
|
||||
// prepared statement
|
||||
$db = $this->em->getConnection();
|
||||
$insert_stmt = $db->prepare('INSERT INTO warranty_serial (id, sku, date_create, source, meta_info)
|
||||
VALUES (:serial, :sku, :date_create, :source, :meta_info)');
|
||||
|
||||
$res = $insert_stmt->execute([
|
||||
':serial' => $serial,
|
||||
':sku' => $sku,
|
||||
':date_create' => $created_date,
|
||||
':source' => $source,
|
||||
':meta_info' => $info,
|
||||
]);
|
||||
|
||||
if (!$res)
|
||||
{
|
||||
// log the not successful insert
|
||||
$err = $insert_stmt->errorInfo();
|
||||
$error = $err[2];
|
||||
$this->logLoadInfo($user_id, false, $serial, $error);
|
||||
|
||||
$data[] = [
|
||||
'serial' => $serial,
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
// log the successful insert
|
||||
$this->logLoadInfo($user_id, true, $serial, '');
|
||||
|
||||
$data[] = [
|
||||
'serial' => $serial,
|
||||
'status' => 'success',
|
||||
'has_error' => false,
|
||||
'error_message' => '',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// form what we output
|
||||
$output_info = $this->setOutputInfo($filename, $file_id, false, '', $data, $orig_filename, $orig_filename);
|
||||
|
||||
return $output_info;
|
||||
}
|
||||
|
||||
protected function validateRow($row, $user_id)
|
||||
{
|
||||
$data = [];
|
||||
// possible lines:
|
||||
// (1) header in csv file - ignore
|
||||
// SerialNumber,Sku,DispatchStatus,CreatedDate,InventoryStatus,CategoryID,CategoryName
|
||||
// (2) No available data - ignore
|
||||
// (3) CH2000012071,WCHD23BL-CPN00-LX,0,2020-08-11 04:05:27.090,0,4,CHAMPION MF - valid
|
||||
// (4) MG2000313690,N/A,1,2021-05-14T23:47:30.6430000+08:00,0,10,GOLD - valid
|
||||
// (5) Empty line - ignore
|
||||
// (6) empty sku - log
|
||||
|
||||
// check if empty line
|
||||
if ($row == array(null))
|
||||
{
|
||||
// no need to log, but send back error
|
||||
$error = 'Empty line';
|
||||
$data = [
|
||||
'serial' => '',
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// check the number of fields
|
||||
if (count($row) != self::FIELD_COUNT)
|
||||
{
|
||||
$error = 'Invalid number of fields.';
|
||||
$data = [
|
||||
'serial' => '',
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// check if the line is a header
|
||||
if ($row[0] == 'SerialNumber')
|
||||
{
|
||||
// no need to log, but send back error
|
||||
$error = 'Invalid information.';
|
||||
$data = [
|
||||
'serial' => '',
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// check if empty serial
|
||||
if (empty($row[0]))
|
||||
{
|
||||
// this one, we log
|
||||
$error = 'Empty serial';
|
||||
$this->logLoadInfo($user_id, false, '', $error);
|
||||
|
||||
$data = [
|
||||
'serial' => '',
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// check length of serial
|
||||
$serial = trim($row[0]);
|
||||
if (strlen($serial) > SELF::SERIAL_LENGTH)
|
||||
{
|
||||
// log
|
||||
$error = 'Serial length too long';
|
||||
$this->logLoadInfo($user_id, false, $serial, $error);
|
||||
|
||||
$data = [
|
||||
'serial' => $serial,
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// validate the date created
|
||||
$str_date_create = trim($row[3]);
|
||||
|
||||
$date_create = $this->convertDateCreate($str_date_create);
|
||||
if ($date_create == null)
|
||||
{
|
||||
// log
|
||||
$error = 'Invalid date create.';
|
||||
$this->logLoadInfo($user_id, false, $serial, $error);
|
||||
|
||||
$data = [
|
||||
'serial' => $serial,
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// check if serial is a dupe
|
||||
$existing_serial = $this->em->getRepository(WarrantySerial::class)->find($serial);
|
||||
if ($existing_serial != null)
|
||||
{
|
||||
// log
|
||||
$error = 'Serial already exists.';
|
||||
$this->logLoadInfo($user_id, false, $serial, $error);
|
||||
|
||||
$data = [
|
||||
'serial' => $serial,
|
||||
'status' => 'error',
|
||||
'has_error' => true,
|
||||
'error_message' => $error,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// valid entry, return empty
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function convertDateCreate($str_date_create)
|
||||
{
|
||||
// since some people cannot follow simple instructions...
|
||||
// check the date format on the string
|
||||
// try 2021-05-15T08:35:46+08:00 format on str_date_create
|
||||
$date_create = DateTime::createFromFormat('Y-m-d\TH:i:sP', $str_date_create);
|
||||
|
||||
if ($date_create == false)
|
||||
{
|
||||
// try this format: 2021-05-15T08:47:20.3330000+08:00
|
||||
// get the date, time and timezone from str_date_create
|
||||
$str_date_time = substr($str_date_create, 0, 19);
|
||||
$str_timezone = substr($str_date_create, 27);
|
||||
$str_datetime_tz = $str_date_time . $str_timezone;
|
||||
|
||||
// create DateTime object
|
||||
// sample: 2021-05-15T12:16:06+08:00
|
||||
$date_create = DateTime::createFromFormat('Y-m-d\TH:i:sP', $str_datetime_tz);
|
||||
|
||||
// check if datetime object was created
|
||||
// if not, someone f*cked up and we have no date create
|
||||
if ($date_create == false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// if you reach this part, then date string is valid. Since we'll be using
|
||||
// sql to insert the entries, we return the string
|
||||
$created_date = $date_create->format('Y-m-d H:i:s');
|
||||
// $created_date = DateTime::createFromFormat('Y-m-d H:i:s', $str_created_date);
|
||||
|
||||
return $created_date;
|
||||
}
|
||||
|
||||
protected function logLoadInfo($user_id, $is_loaded, $serial, $error)
|
||||
{
|
||||
$date_create = new DateTime();
|
||||
$str_date_create = $date_create->format('Y-m-d H:i:s');
|
||||
|
||||
$this->log_data[] = [
|
||||
$str_date_create,
|
||||
$user_id,
|
||||
$serial,
|
||||
$is_loaded,
|
||||
$error,
|
||||
];
|
||||
}
|
||||
|
||||
protected function updateWarrantySerialQueue($id)
|
||||
{
|
||||
// prepared statement
|
||||
$db = $this->em->getConnection();
|
||||
|
||||
// lock the warranty serial queue table
|
||||
$db->exec('LOCK TABLES warranty_serial_queue WRITE;');
|
||||
|
||||
$delete_stmt = $db->prepare('DELETE FROM warranty_serial_queue
|
||||
WHERE id = :id');
|
||||
|
||||
$res = $delete_stmt->execute([
|
||||
':id' => $id,
|
||||
]);
|
||||
|
||||
$db->exec('UNLOCK TABLES;');
|
||||
}
|
||||
|
||||
protected function deleteDirectoryAndFile($filedir)
|
||||
{
|
||||
$csv_filedir = $this->project_dir . '/public/warranty_serial_uploads/' . $filedir;
|
||||
|
||||
$this->filesystem->remove($csv_filedir);
|
||||
}
|
||||
|
||||
protected function setOutputInfo($filename, $file_id, $has_error, $error_message, $entries, $orig_filename)
|
||||
{
|
||||
$info = [
|
||||
'id' => $file_id,
|
||||
'filename' => $orig_filename,
|
||||
'has_error' => $has_error,
|
||||
'error_message' => $error_message,
|
||||
'data' => $entries,
|
||||
];
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
protected function sendResults($output_info)
|
||||
{
|
||||
$body = json_encode($output_info);
|
||||
|
||||
// error_log(print_r($body, true));
|
||||
|
||||
// error_log('Sending json output to ' . $this->callback_url);
|
||||
|
||||
$curl = curl_init();
|
||||
|
||||
$options = [
|
||||
CURLOPT_URL => $this->callback_url,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POSTFIELDS => $body,
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Content-Type: application/json',
|
||||
],
|
||||
];
|
||||
|
||||
curl_setopt_array($curl, $options);
|
||||
$res = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
// check result
|
||||
error_log('Result ' . $res);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ class WarrantySMSCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this->setName('warranty:sms')
|
||||
->setDescription('Sends an SMS message to users whose warranty expired 45 days ago.')
|
||||
->setDescription('Sends an SMS message to users whose warranty expired one month ago.')
|
||||
->setHelp('Sends warranty SMS.')
|
||||
->addArgument('date', InputArgument::OPTIONAL, 'Date to use as basis of expiration. Defaults to current date.');
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ class WarrantySMSCommand extends Command
|
|||
$date = new DateTime();
|
||||
|
||||
// -1 month
|
||||
$date->modify('-45 day');
|
||||
$date->modify('-1 month');
|
||||
|
||||
$warrs = $this->em->getRepository(Warranty::class)->findBy(['date_expire' => $date]);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ use App\Service\RiderTracker;
|
|||
use App\Service\MapTools;
|
||||
use App\Service\InventoryManager;
|
||||
use App\Service\RiderAssignmentHandlerInterface;
|
||||
use App\Service\WarrantyRaffleLogger;
|
||||
use App\Service\WarrantyAPILogger;
|
||||
use App\Service\PromoLogger;
|
||||
use App\Service\HubSelector;
|
||||
|
|
@ -823,8 +822,7 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
// batteries
|
||||
$batt_list = [];
|
||||
// $batts = $vehicle->getBatteries();
|
||||
$batts = $vehicle->getActiveBatteries();
|
||||
$batts = $vehicle->getBatteries();
|
||||
foreach ($batts as $batt)
|
||||
{
|
||||
// TODO: Add warranty_tnv to battery information
|
||||
|
|
@ -3357,14 +3355,14 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
|
||||
// remove QR prefix if it exists
|
||||
// $prefix = substr($clean_serial, 0, 2);
|
||||
// if ($prefix == 'QR')
|
||||
// $clean_serial = substr($clean_serial, 2);
|
||||
$prefix = substr($clean_serial, 0, 2);
|
||||
if ($prefix == 'QR')
|
||||
$clean_serial = substr($clean_serial, 2);
|
||||
|
||||
return $clean_serial;
|
||||
}
|
||||
|
||||
public function warrantyCheck($serial, EntityManagerInterface $em, Request $req, WarrantyRaffleLogger $raffle_logger)
|
||||
public function warrantyCheck($serial, EntityManagerInterface $em, Request $req)
|
||||
{
|
||||
// check required parameters and api key
|
||||
$required_params = [];
|
||||
|
|
@ -3373,7 +3371,7 @@ class APIController extends Controller implements LoggedController
|
|||
return $res->getReturnResponse();
|
||||
|
||||
// check if warranty serial is there
|
||||
$serial = $this->cleanSerial($serial);
|
||||
$serial = $this->cleanSerial($serial);
|
||||
$warr_serial = $em->getRepository(WarrantySerial::class)->find($serial);
|
||||
$warr = $em->getRepository(Warranty::class)->findOneBy(['serial' => $serial]);
|
||||
$batt = null;
|
||||
|
|
@ -3388,24 +3386,6 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
$today = new DateTime();
|
||||
|
||||
$user_id = $req->query->get('api_key');
|
||||
$raffle_data = [
|
||||
'user_id' => $user_id,
|
||||
'serial' => $serial,
|
||||
'warranty_id' => null,
|
||||
'action' => '',
|
||||
'bmodel_name' => '',
|
||||
'bsize_name' => '',
|
||||
'first_name' => '',
|
||||
'last_name' => '',
|
||||
'plate_number' => '',
|
||||
'contact_num' => '',
|
||||
'email' => '',
|
||||
'address' => '',
|
||||
];
|
||||
|
||||
$data_sent = [];
|
||||
|
||||
// if we have a warranty entry for the serial already
|
||||
if ($warr != null)
|
||||
{
|
||||
|
|
@ -3465,16 +3445,6 @@ class APIController extends Controller implements LoggedController
|
|||
'dealer_address' => $warr->getDealerAddress() ?? '',
|
||||
'branch_code' => $warr->getDealerBranchCode() ?? '',
|
||||
];
|
||||
|
||||
// set customer info and action for raffle log
|
||||
$raffle_data['action'] = 'serial_check_customer';
|
||||
$raffle_data['first_name'] = $customer['first_name'];
|
||||
$raffle_data['last_name'] = $customer['last_name'];
|
||||
$raffle_data['plate_number'] = $customer['plate_number'];
|
||||
$raffle_data['email'] = $customer['email'];
|
||||
$raffle_data['contact_num'] = $customer['contact_num'];
|
||||
$raffle_data['address'] = $customer['address'];
|
||||
$raffle_data['warranty_id'] = $warr->getID();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -3497,9 +3467,6 @@ class APIController extends Controller implements LoggedController
|
|||
'dealer_address' => '',
|
||||
'branch_code' => '',
|
||||
];
|
||||
|
||||
// set action for raffle log
|
||||
$raffle_data['action'] = 'serial_check_not_customer';
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -3523,9 +3490,6 @@ class APIController extends Controller implements LoggedController
|
|||
'dealer_address' => '',
|
||||
'branch_code' => '',
|
||||
];
|
||||
|
||||
// set action for raffle log
|
||||
$raffle_data['action'] = 'serial_check_customer';
|
||||
}
|
||||
|
||||
$sku = $warr_serial->getSKU();
|
||||
|
|
@ -3580,13 +3544,6 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
$res->setData($data);
|
||||
|
||||
// set the rest of the raffle log entry
|
||||
$raffle_data['bmodel_name'] = $battery['brand'];
|
||||
$raffle_data['bsize_name'] = $battery['size'];
|
||||
|
||||
// log the raffle log
|
||||
$raffle_logger->logRaffleInfo($data_sent, $raffle_data);
|
||||
|
||||
return $res->getReturnResponse();
|
||||
}
|
||||
|
||||
|
|
@ -3621,7 +3578,7 @@ class APIController extends Controller implements LoggedController
|
|||
}
|
||||
|
||||
public function warrantyRegister($serial, EntityManagerInterface $em, Request $req, KernelInterface $kernel, RisingTideGateway $rt,
|
||||
TranslatorInterface $trans, WarrantyRaffleLogger $raffle_logger, WarrantyAPILogger $logger)
|
||||
TranslatorInterface $trans, WarrantyAPILogger $logger)
|
||||
{
|
||||
// check required parameters and api key
|
||||
$required_params = [
|
||||
|
|
@ -3636,7 +3593,7 @@ class APIController extends Controller implements LoggedController
|
|||
$warr_card = $req->files->get('warr_card');
|
||||
|
||||
// normalize serial
|
||||
$serial = $this->cleanSerial($serial);
|
||||
$serial = $this->cleanSerial($serial);
|
||||
// $serial = trim(strtoupper($serial));
|
||||
|
||||
// process picture uploads
|
||||
|
|
@ -3651,7 +3608,7 @@ class APIController extends Controller implements LoggedController
|
|||
'last_name' => $req->request->get('last_name'),
|
||||
'date_purchase' => $req->request->get('date_purchase'),
|
||||
];
|
||||
$action = 'create/update';
|
||||
$action = 'create';
|
||||
$source = WarrantySource::MOBILE;
|
||||
|
||||
$res = $this->checkParamsAndKey($req, $em, $required_params);
|
||||
|
|
@ -3666,7 +3623,7 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
// update warranty
|
||||
$res = $this->updateWarranty($res, $em, $rt, $trans, $req, $serial, $inv_filename, $wcard_filename,
|
||||
$logger, $log_data, $user_id, $action, $source, $raffle_logger);
|
||||
$logger, $log_data, $user_id, $action, $source);
|
||||
|
||||
$em->flush();
|
||||
|
||||
|
|
@ -3986,24 +3943,9 @@ class APIController extends Controller implements LoggedController
|
|||
}
|
||||
*/
|
||||
|
||||
protected function updateWarranty($res, $em, $rt, $trans, $req, $serial, $inv_filename = null, $wcard_filename = null, $logger, $log_data, $user_id, $action, $source, $raffle_logger)
|
||||
protected function updateWarranty($res, $em, $rt, $trans, $req, $serial, $inv_filename = null, $wcard_filename = null,
|
||||
$logger, $log_data, $user_id, $action, $source)
|
||||
{
|
||||
// prepare raffle log entry
|
||||
$raffle_data = [
|
||||
'user_id' => $user_id,
|
||||
'serial' => $serial,
|
||||
'warranty_id' => null,
|
||||
'action' => '',
|
||||
'bmodel_name' => '',
|
||||
'bsize_name' => '',
|
||||
'first_name' => '',
|
||||
'last_name' => '',
|
||||
'plate_number' => '',
|
||||
'contact_num' => '',
|
||||
'email' => '',
|
||||
'address' => '',
|
||||
];
|
||||
|
||||
// get serial
|
||||
$warr_serial = $em->getRepository(WarrantySerial::class)->find($serial);
|
||||
if ($warr_serial == null)
|
||||
|
|
@ -4036,16 +3978,11 @@ class APIController extends Controller implements LoggedController
|
|||
{
|
||||
$res->setError(true)
|
||||
->setErrorMessage('Warranty registered to a vehicle not in your list of vehicles.');
|
||||
// set action to update
|
||||
$action = 'update';
|
||||
$logger->logWarrantyInfo($log_data, $res->getErrorMessage(), $user_id, $action, $source);
|
||||
return $res;
|
||||
}
|
||||
|
||||
$sms_msg = $trans->trans('warranty_update_confirm');
|
||||
|
||||
// update raffle data action
|
||||
$raffle_data['action'] = 'warranty_update';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -4054,9 +3991,6 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
// set warranty source
|
||||
$warr->setCreateSource($source);
|
||||
|
||||
// update raffle data action
|
||||
$raffle_data['action'] = 'warranty_create';
|
||||
}
|
||||
|
||||
// get sap battery
|
||||
|
|
@ -4154,30 +4088,6 @@ class APIController extends Controller implements LoggedController
|
|||
// error_log('sending sms to - ' . $this->session->getPhoneNumber());
|
||||
$rt->sendSMS($this->session->getPhoneNumber(), $trans->trans('message.battery_brand_allcaps'), $sms_msg);
|
||||
|
||||
// prepare the rest of the raffle log entry
|
||||
$raffle_data['warranty_id'] = $warr->getID();
|
||||
$raffle_data['bmodel_name'] = $sap_bty->getBrand()->getName();
|
||||
$raffle_data['bsize_name'] = $sap_bty->getSize()->getName();
|
||||
$raffle_data['first_name'] = $req->request->get('first_name', '');
|
||||
$raffle_data['last_name'] = $req->request->get('last_name', '');
|
||||
$raffle_data['plate_number'] = $plate;
|
||||
$raffle_data['contact_num'] = $req->request->get('contact_num', '');
|
||||
$raffle_data['email'] = $req->request->get('email', '');
|
||||
$raffle_data['address'] = $req->request->get('cust_address', '');
|
||||
|
||||
$data_sent = [
|
||||
'plate_number' => $req->request->get('plate_number'),
|
||||
'first_name' => $req->request->get('first_name'),
|
||||
'last_name' => $req->request->get('last_name'),
|
||||
'date_purchase' => $req->request->get('date_purchase'),
|
||||
'address' => $req->request->get('cust_address', ''),
|
||||
'email' => $req->request->get('email', ''),
|
||||
'contact_num' => $req->request->get('contact_num', ''),
|
||||
];
|
||||
|
||||
// log raffle data
|
||||
$raffle_logger->logRaffleInfo($data_sent, $raffle_data);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,20 +155,18 @@ class APIUserController extends Controller
|
|||
// metadata
|
||||
$rider_id = $req->request->get('rider_id');
|
||||
$rider = $em->getRepository(Rider::class)->find($rider_id);
|
||||
if ($rider != null)
|
||||
{
|
||||
$meta = ['rider_id' => $rider_id];
|
||||
// TODO: check for null rider
|
||||
|
||||
// set api user in rider
|
||||
$rider->setAPIUser($obj);
|
||||
$meta = ['rider_id' => $rider_id];
|
||||
|
||||
$obj->setRider($rider)
|
||||
->setMetadata($meta);
|
||||
}
|
||||
// set api user in rider
|
||||
$rider->setAPIUser($obj);
|
||||
|
||||
// set and save values
|
||||
$obj->setName($req->request->get('name'))
|
||||
->setEnabled($req->request->get('enabled') ? true : false)
|
||||
->setMetadata($meta)
|
||||
->setRider($rider)
|
||||
->clearRoles();
|
||||
|
||||
// set roles
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@ class BatteryController extends Controller
|
|||
$row['height'] = $orow[0]->getHeight();
|
||||
$row['total_height'] = $orow[0]->getTotalHeight();
|
||||
$row['image_file'] = $orow[0]->getImageFile();
|
||||
$row['flag_active'] = $orow[0]->isActive();
|
||||
|
||||
// add row metadata
|
||||
$row['meta'] = [
|
||||
|
|
@ -183,8 +182,7 @@ class BatteryController extends Controller
|
|||
->setHeight($req->request->get('height'))
|
||||
->setTotalHeight($req->request->get('total_height'))
|
||||
->setSellingPrice($req->request->get('sell_price'))
|
||||
->setImageFile($req->request->get('image_file'))
|
||||
->setActive($req->request->get('flag_active', false));
|
||||
->setImageFile($req->request->get('image_file'));
|
||||
|
||||
// initialize error list
|
||||
$error_array = [];
|
||||
|
|
@ -310,7 +308,6 @@ class BatteryController extends Controller
|
|||
->setTotalHeight($req->request->get('total_height'))
|
||||
->setSellingPrice($req->request->get('sell_price'))
|
||||
->setImageFile($req->request->get('image_file'))
|
||||
->setActive($req->request->get('flag_active', false))
|
||||
->clearVehicles();
|
||||
|
||||
// initialize error list
|
||||
|
|
@ -427,7 +424,7 @@ class BatteryController extends Controller
|
|||
$bmodel_id = $req->query->get('model_id');
|
||||
$bsize_id = $req->query->get('size_id');
|
||||
|
||||
// find the battery using model and size and battery must be active
|
||||
// find the battery using model and size
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$query = $em->createQuery('SELECT b FROM App\Entity\Battery b
|
||||
JOIN b.model bm
|
||||
|
|
@ -435,8 +432,7 @@ class BatteryController extends Controller
|
|||
JOIN b.manufacturer bmfg
|
||||
WHERE bm.id = :bm_id
|
||||
AND bs.id = :bs_id
|
||||
AND bmfg.id = :bmfg_id
|
||||
AND b.flag_active = true')
|
||||
AND bmfg.id = :bmfg_id')
|
||||
->setParameter('bmfg_id', $bmfg_id)
|
||||
->setParameter('bm_id', $bmodel_id)
|
||||
->setParameter('bs_id', $bsize_id);
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ class BatteryManufacturerController extends Controller
|
|||
|
||||
// get row data
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$all_batts = $em->getRepository(Battery::class)->findBy(['flag_active' => true]);
|
||||
$all_batts = $em->getRepository(Battery::class)->findAll();
|
||||
|
||||
foreach ($all_batts as $battery)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -102,9 +102,9 @@ class CustomerWarrantyController extends APIController
|
|||
|
||||
|
||||
// remove QR prefix if it exists
|
||||
//$prefix = substr($clean_serial, 0, 2);
|
||||
//if ($prefix == 'QR')
|
||||
// $clean_serial = substr($clean_serial, 2);
|
||||
$prefix = substr($clean_serial, 0, 2);
|
||||
if ($prefix == 'QR')
|
||||
$clean_serial = substr($clean_serial, 2);
|
||||
|
||||
return $clean_serial;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1043,7 +1043,7 @@ class RiderAppController extends APIController
|
|||
if ($rider == null)
|
||||
return new APIResponse(false, 'No rider found.');
|
||||
|
||||
$batts = $em->getRepository(Battery::class)->findBy(['flag_active' => true]);
|
||||
$batts = $em->getRepository(Battery::class)->findAll();
|
||||
$models = $em->getRepository(BatteryModel::class)->findAll();
|
||||
$sizes = $em->getRepository(BatterySize::class)->findAll();
|
||||
|
||||
|
|
|
|||
|
|
@ -17,19 +17,4 @@ class TestController extends APIController
|
|||
];
|
||||
return new APIResponse(true, 'Test successful.', $data);
|
||||
}
|
||||
|
||||
public function warrantySerial(Request $req)
|
||||
{
|
||||
error_log('Got request');
|
||||
|
||||
$res = json_decode($req->getContent(), true);
|
||||
|
||||
// return $res;
|
||||
|
||||
$data = [
|
||||
'result' => $res,
|
||||
];
|
||||
return new APIResponse(true, 'Test successful.', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,182 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\CAPI;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
|
||||
use Catalyst\APIBundle\Controller\APIController;
|
||||
use Catalyst\APIBundle\Response\APIResponse;
|
||||
|
||||
use App\Entity\WarrantySerialQueue;
|
||||
|
||||
use App\Service\WarrantySerialUploadLogger;
|
||||
|
||||
use DateTime;
|
||||
|
||||
use Catalyst\APIBundle\Access\Generator as ACLGenerator;
|
||||
|
||||
// third party API
|
||||
class WarrantySerialController extends APIController
|
||||
{
|
||||
protected $acl_gen;
|
||||
protected $upload_logger;
|
||||
|
||||
public function __construct(ACLGenerator $acl_gen, WarrantySerialUploadLogger $upload_logger)
|
||||
{
|
||||
$this->acl_gen = $acl_gen;
|
||||
$this->upload_logger = $upload_logger;
|
||||
}
|
||||
|
||||
public function uploadWarrantySerialFile(Request $req, EntityManagerInterface $em, KernelInterface $kernel)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('warrantyserial.upload', null, 'No access.');
|
||||
|
||||
$required_params = [
|
||||
'serial_file',
|
||||
];
|
||||
|
||||
$user_id = $_SERVER['HTTP_X_CATA_API_KEY'];
|
||||
|
||||
$res = $this->checkRequiredParamsForFiles($req, $required_params, $user_id);
|
||||
|
||||
if ($res !== true)
|
||||
return $res;
|
||||
|
||||
// get the csv file
|
||||
$csv_file = $req->files->get('serial_file');
|
||||
|
||||
// process file upload
|
||||
$upload_dir = $kernel->getProjectDir() . '/public/warranty_serial_uploads';
|
||||
$serial_filename = $this->handleSerialFileUpload($csv_file, $upload_dir);
|
||||
|
||||
// insert to warranty serial queue
|
||||
$res = $this->registerWarrantySerialFile($em, $csv_file, $serial_filename, $user_id);
|
||||
|
||||
// flush to db
|
||||
$em->flush();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
protected function registerWarrantySerialFile($em, $file, $serial_filename, $user_id)
|
||||
{
|
||||
// parse the serial filename to get the file id
|
||||
$parts = explode('/', $serial_filename);
|
||||
$file_id = $parts[0];
|
||||
$orig_filename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME) . '.' . $file->getClientOriginalExtension();
|
||||
|
||||
$ws_file = new WarrantySerialQueue();
|
||||
|
||||
$ws_file->setFileSerial($serial_filename)
|
||||
->setStatus('pending')
|
||||
->setOrigFileSerial($orig_filename)
|
||||
->setFileID($file_id)
|
||||
->setApiUser($user_id);
|
||||
|
||||
$em->persist($ws_file);
|
||||
|
||||
// log upload
|
||||
$log_data = [
|
||||
'user_id' => $user_id,
|
||||
'is_uploaded' => true,
|
||||
'orig_file_serial' => $orig_filename,
|
||||
'uploaded_file_serial' => $serial_filename,
|
||||
];
|
||||
|
||||
$this->upload_logger->logWarrantySerialUploadInfo($log_data);
|
||||
|
||||
$data = [
|
||||
'id' => $file_id,
|
||||
];
|
||||
|
||||
return new APIResponse(true, 'Warranty serial file uploaded.', $data);
|
||||
}
|
||||
|
||||
protected function handleSerialFileUpload($file, $target_dir)
|
||||
{
|
||||
// create target dir if it doesn't exist
|
||||
if (!file_exists($target_dir))
|
||||
{
|
||||
if (!mkdir($target_dir, 0744, true))
|
||||
{
|
||||
$log_data = [
|
||||
'user_id' => $user_id,
|
||||
'is_uploaded' => false,
|
||||
'error' => 'Failed to create folder for warranty serial files.'
|
||||
];
|
||||
|
||||
$this->upload_logger->logWarrantySerialUploadInfo($log_data);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// get current date
|
||||
$curr_date = new DateTime();
|
||||
$str_curr_date = $curr_date->format('Ymd');
|
||||
$file_id = $str_curr_date . uniqid();
|
||||
|
||||
// move file
|
||||
$filename = 'warranty_serial' . '.' . $file->getClientOriginalExtension();
|
||||
$file->move($target_dir . '/' . $file_id, $filename);
|
||||
|
||||
return $file_id . '/' . $filename;
|
||||
}
|
||||
|
||||
protected function checkRequiredParamsForFiles(Request $req, $params, $user_id)
|
||||
{
|
||||
// check required parameters
|
||||
$missing = $this->checkMissingParametersForFiles($req, $params);
|
||||
if (count($missing) > 0)
|
||||
{
|
||||
// log the error
|
||||
$miss_string = implode(', ', $missing);
|
||||
$log_data = [
|
||||
'user_id' => $user_id,
|
||||
'is_uploaded' => false,
|
||||
'error' => 'Missing parameter(s): ' . $miss_string
|
||||
];
|
||||
|
||||
$this->upload_logger->logWarrantySerialUploadInfo($log_data);
|
||||
|
||||
return new APIResponse(false, 'Missing parameter(s): ' . $miss_string);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function checkMissingParametersForFiles(Request $req, $params = [])
|
||||
{
|
||||
$missing = [];
|
||||
|
||||
// check if parameters are there
|
||||
foreach ($params as $param)
|
||||
{
|
||||
if ($req->getMethod() == 'GET')
|
||||
{
|
||||
$check = $req->query->get($param);
|
||||
if (empty($check))
|
||||
$missing[] = $param;
|
||||
}
|
||||
else if ($req->getMethod() == 'POST')
|
||||
{
|
||||
// get files from request.
|
||||
$check = $req->files->get($param);
|
||||
if (empty($check))
|
||||
{
|
||||
$missing[] = $param;
|
||||
}
|
||||
}
|
||||
else
|
||||
return $params;
|
||||
}
|
||||
|
||||
return $missing;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,253 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\CustomerLocation;
|
||||
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
|
||||
use Catalyst\MenuBundle\Annotation\Menu;
|
||||
|
||||
class CustomerLocationController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Menu(selected="customer_location_list")
|
||||
* @IsGranted("cust_location.list")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return $this->render('customer-location/list.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("cust_location.list")
|
||||
*/
|
||||
public function datatableRows(Request $req)
|
||||
{
|
||||
// get query builder
|
||||
$qb = $this->getDoctrine()
|
||||
->getRepository(CustomerLocation::class)
|
||||
->createQueryBuilder('q');
|
||||
|
||||
// get datatable params
|
||||
$datatable = $req->request->get('datatable');
|
||||
|
||||
// count total records
|
||||
$tquery = $qb->select('COUNT(q)');
|
||||
$this->setQueryFilters($datatable, $tquery);
|
||||
$total = $tquery->getQuery()
|
||||
->getSingleScalarResult();
|
||||
|
||||
// get current page number
|
||||
$page = $datatable['pagination']['page'] ?? 1;
|
||||
|
||||
$perpage = $datatable['pagination']['perpage'];
|
||||
$offset = ($page - 1) * $perpage;
|
||||
|
||||
// add metadata
|
||||
$meta = [
|
||||
'page' => $page,
|
||||
'perpage' => $perpage,
|
||||
'pages' => ceil($total / $perpage),
|
||||
'total' => $total,
|
||||
'sort' => 'asc',
|
||||
'field' => 'id'
|
||||
];
|
||||
|
||||
// build query
|
||||
$query = $qb->select('q');
|
||||
$this->setQueryFilters($datatable, $query);
|
||||
|
||||
// check if sorting is present, otherwise use default
|
||||
if (isset($datatable['sort']['field']) && !empty($datatable['sort']['field'])) {
|
||||
$order = $datatable['sort']['sort'] ?? 'asc';
|
||||
$query->orderBy('q.' . $datatable['sort']['field'], $order);
|
||||
} else {
|
||||
$query->orderBy('q.id', 'asc');
|
||||
}
|
||||
|
||||
// get rows for this page
|
||||
$obj_rows = $query->setFirstResult($offset)
|
||||
->setMaxResults($perpage)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
// process rows
|
||||
$rows = [];
|
||||
foreach ($obj_rows as $orow) {
|
||||
// add row data
|
||||
$row['id'] = $orow->getID();
|
||||
$row['name'] = $orow->getName();
|
||||
|
||||
// add row metadata
|
||||
$row['meta'] = [
|
||||
'update_url' => '',
|
||||
'delete_url' => ''
|
||||
];
|
||||
|
||||
// add crud urls
|
||||
if ($this->isGranted('cust_location.update'))
|
||||
$row['meta']['update_url'] = $this->generateUrl('customer_location_update_form', ['id' => $row['id']]);
|
||||
if ($this->isGranted('cust_location.delete'))
|
||||
$row['meta']['delete_url'] = $this->generateUrl('customer_location_delete', ['id' => $row['id']]);
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
// response
|
||||
return $this->json([
|
||||
'meta' => $meta,
|
||||
'data' => $rows
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Menu(selected="customer_location.list")
|
||||
* @IsGranted("cust_location.add")
|
||||
*/
|
||||
public function addForm()
|
||||
{
|
||||
$cust_location = new CustomerLocation();
|
||||
$params = [
|
||||
'cust_location' => $cust_location,
|
||||
'mode' => 'create',
|
||||
];
|
||||
|
||||
// response
|
||||
return $this->render('customer-location/form.html.twig', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("cust_location.add")
|
||||
*/
|
||||
public function addSubmit(Request $req, EntityManagerInterface $em, ValidatorInterface $validator)
|
||||
{
|
||||
$cust_location = new CustomerLocation();
|
||||
|
||||
$this->setObject($cust_location, $req);
|
||||
|
||||
// validate
|
||||
$errors = $validator->validate($cust_location);
|
||||
|
||||
// initialize error list
|
||||
$error_array = [];
|
||||
|
||||
// add errors to list
|
||||
foreach ($errors as $error) {
|
||||
$error_array[$error->getPropertyPath()] = $error->getMessage();
|
||||
}
|
||||
|
||||
// check if any errors were found
|
||||
if (!empty($error_array)) {
|
||||
// return validation failure response
|
||||
return $this->json([
|
||||
'success' => false,
|
||||
'errors' => $error_array
|
||||
], 422);
|
||||
}
|
||||
|
||||
// validated! save the entity
|
||||
$em->persist($cust_location);
|
||||
$em->flush();
|
||||
|
||||
// return successful response
|
||||
return $this->json([
|
||||
'success' => 'Changes have been saved!'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @Menu(selected="customer_location_list")
|
||||
* @ParamConverter("cust_location", class="App\Entity\CustomerLocation")
|
||||
* @IsGranted("cust_location.update")
|
||||
*/
|
||||
public function updateForm($id, EntityManagerInterface $em, CustomerLocation $cust_location)
|
||||
{
|
||||
$params = [];
|
||||
$params['cust_location'] = $cust_location;
|
||||
$params['mode'] = 'update';
|
||||
|
||||
// response
|
||||
return $this->render('customer-location/form.html.twig', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ParamConverter("cust_location", class="App\Entity\CustomerLocation")
|
||||
* @IsGranted("cust_location.update")
|
||||
*/
|
||||
public function updateSubmit(Request $req, EntityManagerInterface $em, ValidatorInterface $validator, CustomerLocation $cust_location)
|
||||
{
|
||||
$this->setObject($cust_location, $req);
|
||||
|
||||
// validate
|
||||
$errors = $validator->validate($cust_location);
|
||||
|
||||
// initialize error list
|
||||
$error_array = [];
|
||||
|
||||
// add errors to list
|
||||
foreach ($errors as $error) {
|
||||
$error_array[$error->getPropertyPath()] = $error->getMessage();
|
||||
}
|
||||
|
||||
// check if any errors were found
|
||||
if (!empty($error_array)) {
|
||||
// return validation failure response
|
||||
return $this->json([
|
||||
'success' => false,
|
||||
'errors' => $error_array
|
||||
], 422);
|
||||
}
|
||||
|
||||
// validated! save the entity
|
||||
$em->flush();
|
||||
|
||||
// return successful response
|
||||
return $this->json([
|
||||
'success' => 'Changes have been saved!'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ParamConverter("cust_location", class="App\Entity\CustomerLocation")
|
||||
* @IsGranted("cust_location.update")
|
||||
*/
|
||||
public function deleteSubmit(EntityManagerInterface $em, CustomerLocation $cust_location)
|
||||
{
|
||||
// delete this object
|
||||
$em->remove($cust_location);
|
||||
$em->flush();
|
||||
|
||||
// response
|
||||
$response = new Response();
|
||||
$response->setStatusCode(Response::HTTP_OK);
|
||||
$response->send();
|
||||
}
|
||||
|
||||
|
||||
protected function setObject(CustomerLocation $obj, Request $req)
|
||||
{
|
||||
// set and save values
|
||||
$obj->setName($req->request->get('name'))
|
||||
->setCode($req->request->get('code'));
|
||||
}
|
||||
|
||||
protected function setQueryFilters($datatable, QueryBuilder $query)
|
||||
{
|
||||
if (isset($datatable['query']['data-rows-search']) && !empty($datatable['query']['data-rows-search'])) {
|
||||
$query->where('q.name LIKE :filter')
|
||||
->setParameter('filter', '%' . $datatable['query']['data-rows-search'] . '%');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -22,8 +22,6 @@ use App\Entity\BatterySize;
|
|||
use App\Entity\SMSMessage;
|
||||
use App\Entity\HubFilterLog;
|
||||
|
||||
use App\Service\WarrantyRaffleFilter;
|
||||
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
|
@ -1224,132 +1222,6 @@ class ReportController extends Controller
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @Menu(selected="outlet_list")
|
||||
*/
|
||||
public function warrantyRaffleForm()
|
||||
{
|
||||
$this->denyAccessUnlessGranted('report.warranty.raffle', null, 'No access.');
|
||||
|
||||
return $this->render('report/warranty-raffle/form.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Menu(selected="outlet_list")
|
||||
*/
|
||||
public function joRaffleForm()
|
||||
{
|
||||
$this->denyAccessUnlessGranted('report.jo.raffle', null, 'No access.');
|
||||
|
||||
return $this->render('report/jo-raffle/form.html.twig');
|
||||
}
|
||||
|
||||
public function warrantyRaffleSubmit(Request $req, EntityManagerInterface $em, WarrantyRaffleFilter $wr_filter)
|
||||
{
|
||||
// get dates
|
||||
$raw_date_start = $req->request->get('date_start');
|
||||
$raw_date_end = $req->request->get('date_end');
|
||||
|
||||
$date_start = DateTime::createFromFormat('m/d/Y', $raw_date_start);
|
||||
$date_end = DateTime::createFromFormat('m/d/Y', $raw_date_end);
|
||||
|
||||
$wr_data = $this->getWarrantyRaffleData($req, $em, $raw_date_start, $raw_date_end);
|
||||
|
||||
// filter the retrieved warranty raffle data
|
||||
$filtered_data = [];
|
||||
foreach ($wr_data as $wr_entry)
|
||||
{
|
||||
$valid = $wr_filter->isValidRaffleEntry($wr_entry);
|
||||
if ($valid)
|
||||
$filtered_data[] = $wr_entry;
|
||||
}
|
||||
|
||||
$resp = new StreamedResponse();
|
||||
$resp->setCallback(function() use ($filtered_data) {
|
||||
// csv output
|
||||
$csv_handle = fopen('php://output', 'w+');
|
||||
fputcsv($csv_handle, [
|
||||
'Raffle Number',
|
||||
'Serial Number',
|
||||
'Product Name',
|
||||
'Transaction Number', // Warranty Raffle Log ID
|
||||
'Date',
|
||||
'Outlet',
|
||||
'Plate Number',
|
||||
'Warranty Class',
|
||||
'First Name',
|
||||
'Last Name',
|
||||
'Contact Number',
|
||||
'Mobile Number', // number with mobile app
|
||||
'Address',
|
||||
'Email',
|
||||
'Action Taken',
|
||||
]);
|
||||
|
||||
foreach ($filtered_data as $row)
|
||||
{
|
||||
fputcsv($csv_handle, $row);
|
||||
}
|
||||
|
||||
fclose($csv_handle);
|
||||
});
|
||||
|
||||
$filename = 'warranty_raffle_' . $date_start->format('Ymd') . '_' . $date_end->format('Ymd') . '.csv';
|
||||
$resp->setStatusCode(200);
|
||||
$resp->headers->set('Content-Type', 'text/csv; charset=utf-8');
|
||||
$resp->headers->set('Content-Disposition', 'attachment; filename="' . $filename . '"');
|
||||
|
||||
return $resp;
|
||||
}
|
||||
|
||||
|
||||
public function joRaffleSubmit(Request $req, EntityManagerInterface $em)
|
||||
{
|
||||
// get dates
|
||||
$raw_date_start = $req->request->get('date_start');
|
||||
$raw_date_end = $req->request->get('date_end');
|
||||
|
||||
$date_start = DateTime::createFromFormat('m/d/Y', $raw_date_start);
|
||||
$date_end = DateTime::createFromFormat('m/d/Y', $raw_date_end);
|
||||
|
||||
$data = $this->getJORaffleData($req, $em, $raw_date_start, $raw_date_end);
|
||||
|
||||
$resp = new StreamedResponse();
|
||||
$resp->setCallback(function() use ($data) {
|
||||
// csv output
|
||||
$csv_handle = fopen('php://output', 'w+');
|
||||
fputcsv($csv_handle, [
|
||||
'Raffle Number',
|
||||
'Serial Number',
|
||||
'Product Name',
|
||||
'Transaction Number', // JO ID
|
||||
'Date',
|
||||
'Outlet', // Hub
|
||||
'Plate Number',
|
||||
'Warranty Class',
|
||||
'First Name',
|
||||
'Last Name',
|
||||
'Contact Number',
|
||||
'Address',
|
||||
'Email',
|
||||
]);
|
||||
|
||||
foreach ($data as $row)
|
||||
{
|
||||
fputcsv($csv_handle, $row);
|
||||
}
|
||||
|
||||
fclose($csv_handle);
|
||||
});
|
||||
|
||||
$filename = 'jo_raffle_' . $date_start->format('Ymd') . '_' . $date_end->format('Ymd') . '.csv';
|
||||
$resp->setStatusCode(200);
|
||||
$resp->headers->set('Content-Type', 'text/csv; charset=utf-8');
|
||||
$resp->headers->set('Content-Disposition', 'attachment; filename="' . $filename . '"');
|
||||
|
||||
return $resp;
|
||||
}
|
||||
|
||||
protected function processPopappFile(UploadedFile $csv_file, EntityManagerInterface $em)
|
||||
{
|
||||
// attempt to open file
|
||||
|
|
@ -2726,197 +2598,4 @@ class ReportController extends Controller
|
|||
return $cust_ids;
|
||||
}
|
||||
|
||||
protected function getWarrantyRaffleData($req, $em, $raw_date_start, $raw_date_end)
|
||||
{
|
||||
$date_start = DateTime::createFromFormat('m/d/Y', $raw_date_start);
|
||||
$date_end = DateTime::createFromFormat('m/d/Y', $raw_date_end);
|
||||
|
||||
// change to this format: Y-m-d H:i:s
|
||||
$new_date_start = $date_start->format('Y-m-d') . ' 00:00:00';
|
||||
$new_date_end = $date_end->format('Y-m-d') . ' 23:59:59';
|
||||
|
||||
$db = $em->getConnection();
|
||||
|
||||
// get the data from warranty_raffle_log
|
||||
$wrl_sql = 'SELECT wrl.id AS wrl_id, wrl.serial AS serial, wrl.warranty_id AS warranty_id,
|
||||
wrl.batt_model_name AS model_name, wrl.batt_size_name AS size_name,
|
||||
wrl.date_create AS date_create, wrl.plate_number AS plate_number,
|
||||
wrl.first_name AS first_name, wrl.last_name AS last_name,
|
||||
wrl.contact_num AS contact_num, wrl.address AS address, wrl.email AS email,
|
||||
wrl.action AS action, wrl.api_user AS api_user_id
|
||||
FROM warranty_raffle_log wrl
|
||||
WHERE wrl.date_create >= :date_start
|
||||
AND wrl.date_create <= :date_end';
|
||||
|
||||
$wrl_stmt = $db->prepare($wrl_sql);
|
||||
$wrl_stmt->bindValue('date_start', $new_date_start);
|
||||
$wrl_stmt->bindValue('date_end', $new_date_end);
|
||||
|
||||
$wrl_result = $wrl_stmt->executeQuery();
|
||||
|
||||
$wrl_data = [];
|
||||
// go through rows
|
||||
while($row = $wrl_result->fetchAssociative())
|
||||
{
|
||||
// check if entry has a warranty id
|
||||
$w_id = $row['warranty_id'];
|
||||
$warranty_id = '';
|
||||
$warranty_class = '';
|
||||
if ($w_id != null)
|
||||
{
|
||||
$warranty_id = $w_id;
|
||||
|
||||
// find the warranty to get the warranty class
|
||||
$w_sql = 'SELECT w.warranty_class AS warranty_class
|
||||
FROM warranty w
|
||||
WHERE w.id = :warranty_id';
|
||||
|
||||
$w_stmt = $db->prepare($w_sql);
|
||||
$w_stmt->bindValue('warranty_id' , $w_id);
|
||||
|
||||
$w_result = $w_stmt->executeQuery();
|
||||
|
||||
while ($w_row = $w_result->fetchAssociative())
|
||||
{
|
||||
$warranty_class = $w_row['warranty_class'];
|
||||
}
|
||||
}
|
||||
|
||||
// get the mobile number of the api user using api_user_id
|
||||
$api_user_id = $row['api_user_id'];
|
||||
$mobile_num = '';
|
||||
if ($api_user_id != null)
|
||||
{
|
||||
$api_sql = 'SELECT ms.phone_number AS mobile_number
|
||||
FROM mobile_session ms
|
||||
WHERE ms.id = :api_user_id';
|
||||
|
||||
$api_stmt = $db->prepare($api_sql);
|
||||
$api_stmt->bindValue('api_user_id', $api_user_id);
|
||||
|
||||
$api_result = $api_stmt->executeQuery();
|
||||
|
||||
while ($api_row = $api_result->fetchAssociative())
|
||||
{
|
||||
$mobile_num = $api_row['mobile_number'];
|
||||
}
|
||||
}
|
||||
|
||||
$raffle_number = '';
|
||||
$hub = '';
|
||||
$battery_name = $row['model_name'] . ' / ' . $row['size_name'];
|
||||
|
||||
// get the date from the date schedule
|
||||
$date_array = explode(' ' , $row['date_create']);
|
||||
$date_create = $date_array[0];
|
||||
|
||||
$wrl_data[] = [
|
||||
'raffle_num' => $raffle_number,
|
||||
'serial' => $row['serial'],
|
||||
'product_name' => $battery_name,
|
||||
'warranty_id' => $row['wrl_id'],
|
||||
'date' => $date_create,
|
||||
'hub' => $hub,
|
||||
'plate_number' => $row['plate_number'],
|
||||
'warranty_class' => $warranty_class,
|
||||
'first_name' => $row['first_name'],
|
||||
'last_name' => $row['last_name'],
|
||||
'contact_number' => $row['contact_num'],
|
||||
'mobile_number' => $mobile_num,
|
||||
'address' => $row['address'],
|
||||
'email' => $row['email'],
|
||||
'action' => $row['action'],
|
||||
];
|
||||
}
|
||||
|
||||
return $wrl_data;
|
||||
}
|
||||
|
||||
protected function getJORaffleData($req, $em, $raw_date_start, $raw_date_end)
|
||||
{
|
||||
$date_start = DateTime::createFromFormat('m/d/Y', $raw_date_start);
|
||||
$date_end = DateTime::createFromFormat('m/d/Y', $raw_date_end);
|
||||
|
||||
// change to this format: Y-m-d H:i:s
|
||||
$new_date_start = $date_start->format('Y-m-d') . ' 00:00:00';
|
||||
$new_date_end = $date_end->format('Y-m-d') . ' 23:59:59';
|
||||
|
||||
$db = $em->getConnection();
|
||||
|
||||
// get JOs that have been scheduled within the date range and are fulfilled
|
||||
// and service type is battery sales
|
||||
$jo_sql = 'SELECT jo.id AS jo_id, cv.warranty_code AS serial, jo.date_schedule AS date_schedule,
|
||||
h.name AS hub_name, cv.plate_number AS plate_number, jo.warranty_class AS warranty_class,
|
||||
c.first_name AS first_name, c.last_name AS last_name, c.phone_mobile AS mobile_number,
|
||||
c.email AS email
|
||||
FROM job_order jo, customer_vehicle cv, hub h, customer c
|
||||
WHERE jo.cvehicle_id = cv.id
|
||||
AND jo.customer_id = c.id
|
||||
AND jo.hub_id = h.id
|
||||
AND jo.status = :fulfilled
|
||||
AND jo.service_type = :battery_sales
|
||||
AND jo.date_schedule >= :date_start AND jo.date_schedule <= :date_end';
|
||||
$jo_stmt = $db->prepare($jo_sql);
|
||||
$jo_stmt->bindValue('fulfilled', JOStatus::FULFILLED);
|
||||
$jo_stmt->bindValue('battery_sales', ServiceType::BATTERY_REPLACEMENT_NEW);
|
||||
$jo_stmt->bindValue('date_start', $new_date_start);
|
||||
$jo_stmt->bindValue('date_end', $new_date_end);
|
||||
|
||||
$jo_result = $jo_stmt->executeQuery();
|
||||
|
||||
$jo_data = [];
|
||||
// go through rows
|
||||
while($row = $jo_result->fetchAssociative())
|
||||
{
|
||||
// need to get the battery ordered
|
||||
$jo_id = $row['jo_id'];
|
||||
|
||||
$b_sql = 'SELECT bmodel.name AS model_name, bsize.name AS size_name
|
||||
FROM battery_model bmodel, battery_size bsize, battery b,
|
||||
invoice i, invoice_item ii
|
||||
WHERE b.model_id = bmodel.id
|
||||
AND b.size_id = bsize.id
|
||||
AND ii.invoice_id = i.id
|
||||
AND ii.battery_id = b.id
|
||||
AND i.job_order_id = :jo_id';
|
||||
|
||||
$b_stmt = $db->prepare($b_sql);
|
||||
$b_stmt->bindValue('jo_id', $jo_id);
|
||||
|
||||
$b_result = $b_stmt->executeQuery();
|
||||
|
||||
$b_data = [];
|
||||
|
||||
$battery_name = '';
|
||||
while ($b_row = $b_result->fetchAssociative())
|
||||
{
|
||||
$battery_name = $b_row['model_name'] . ' / ' . $b_row['size_name'];
|
||||
}
|
||||
|
||||
// get the date from the date schedule
|
||||
$date_array = explode(' ' , $row['date_schedule']);
|
||||
$date_schedule = $date_array[0];
|
||||
|
||||
$raffle_number = '';
|
||||
$address = '';
|
||||
|
||||
$jo_data[] = [
|
||||
'raffle_num' => $raffle_number,
|
||||
'serial' => $row['serial'],
|
||||
'product_name' => $battery_name,
|
||||
'jo_id' => $jo_id,
|
||||
'date' => $date_schedule,
|
||||
'hub' => $row['hub_name'],
|
||||
'plate_number' => $row['plate_number'],
|
||||
'warranty_class' => $row['warranty_class'],
|
||||
'first_name' => $row['first_name'],
|
||||
'last_name' => $row['last_name'],
|
||||
'contact_number' => $row['mobile_number'],
|
||||
'address' => $address,
|
||||
'email' => $row['email']
|
||||
];
|
||||
}
|
||||
|
||||
return $jo_data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,94 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\TAPI;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use Catalyst\APIBundle\Controller\APIController;
|
||||
use Catalyst\APIBundle\Response\APIResponse;
|
||||
use App\Ramcar\APIResult;
|
||||
|
||||
use App\Entity\Vehicle;
|
||||
|
||||
use Catalyst\APIBundle\Access\Generator as ACLGenerator;
|
||||
|
||||
class BatteryController extends APIController
|
||||
{
|
||||
protected $acl_gen;
|
||||
|
||||
public function __construct(ACLGenerator $acl_gen)
|
||||
{
|
||||
$this->acl_gen = $acl_gen;
|
||||
}
|
||||
|
||||
public function getCompatibleBatteries(Request $req, $vid, EntityManagerInterface $em)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('tapi_battery_compatible.list', null, 'No access.');
|
||||
|
||||
// check required parameters and api key
|
||||
$required_params = [];
|
||||
$msg = $this->checkRequiredParameters($req, $required_params);
|
||||
if ($msg)
|
||||
return new APIResponse(false, $msg);
|
||||
|
||||
// get vehicle
|
||||
$vehicle = $em->getRepository(Vehicle::class)->find($vid);
|
||||
if ($vehicle == null)
|
||||
{
|
||||
$message = 'Invalid vehicle id.';
|
||||
return new APIResponse(false, $message);
|
||||
}
|
||||
|
||||
// batteries
|
||||
$batt_list = [];
|
||||
// $batts = $vehicle->getBatteries();
|
||||
$batts = $vehicle->getActiveBatteries();
|
||||
foreach ($batts as $batt)
|
||||
{
|
||||
// TODO: Add warranty_tnv to battery information
|
||||
$batt_list[] = [
|
||||
'id' => $batt->getID(),
|
||||
'mfg_id' => $batt->getManufacturer()->getID(),
|
||||
'mfg_name' => $batt->getManufacturer()->getName(),
|
||||
'model_id' => $batt->getModel()->getID(),
|
||||
'model_name' => $batt->getModel()->getName(),
|
||||
'size_id' => $batt->getSize()->getID(),
|
||||
'size_name' => $batt->getSize()->getName(),
|
||||
'price' => $batt->getSellingPrice(),
|
||||
'wty_private' => $batt->getWarrantyPrivate(),
|
||||
'wty_commercial' => $batt->getWarrantyCommercial(),
|
||||
'image_url' => $this->getBatteryImageURL($req, $batt),
|
||||
];
|
||||
}
|
||||
|
||||
// data
|
||||
$data = [
|
||||
'vehicle' => [
|
||||
'id' => $vehicle->getID(),
|
||||
'mfg_id' => $vehicle->getManufacturer()->getID(),
|
||||
'mfg_name' => $vehicle->getManufacturer()->getName(),
|
||||
'make' => $vehicle->getMake(),
|
||||
'model_year_from' => $vehicle->getModelYearFrom(),
|
||||
'model_year_to' => $vehicle->getModelYearTo(),
|
||||
],
|
||||
'batteries' => $batt_list,
|
||||
];
|
||||
|
||||
$message = 'Compatible batteries found.';
|
||||
return new APIResponse(true, $message, $data);
|
||||
}
|
||||
|
||||
// TODO: might have to put this in a common service since JobOrderController also calls this
|
||||
protected function getBatteryImageURL($req, $batt)
|
||||
{
|
||||
// TODO: workaround for now, we get static image of battery based on model name
|
||||
$filename = trim(strtolower($batt->getModel()->getName())) . '_mobile.jpg';
|
||||
$file_path = $req->getSchemeAndHttpHost() . $this->generateUrl('static_battery_image') . '/' . $filename;
|
||||
|
||||
return $file_path;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\TAPI;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use Catalyst\APIBundle\Controller\APIController;
|
||||
use Catalyst\APIBundle\Response\APIResponse;
|
||||
|
||||
use App\Entity\Promo;
|
||||
|
||||
use Catalyst\APIBundle\Access\Generator as ACLGenerator;
|
||||
|
||||
class PromoController extends APIController
|
||||
{
|
||||
protected $acl_gen;
|
||||
|
||||
public function __construct(ACLGenerator $acl_gen)
|
||||
{
|
||||
$this->acl_gen = $acl_gen;
|
||||
}
|
||||
|
||||
public function listPromos(Request $req, EntityManagerInterface $em)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('tapi_promo.list', null, 'No access.');
|
||||
|
||||
// check required parameters and api key
|
||||
$required_params = [];
|
||||
$msg = $this->checkRequiredParameters($req, $required_params);
|
||||
if ($msg)
|
||||
return new APIResponse(false, $msg);
|
||||
|
||||
$data = [];
|
||||
// TODO: add call to get promos here
|
||||
|
||||
$message = 'Promos found.';
|
||||
|
||||
return new APIResponse(true, $message, $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\TAPI;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use Catalyst\APIBundle\Controller\APIController;
|
||||
use Catalyst\APIBundle\Response\APIResponse;
|
||||
|
||||
use App\Entity\Service;
|
||||
|
||||
use Catalyst\APIBundle\Access\Generator as ACLGenerator;
|
||||
|
||||
class ServiceController extends APIController
|
||||
{
|
||||
protected $acl_gen;
|
||||
|
||||
public function __construct(ACLGenerator $acl_gen)
|
||||
{
|
||||
$this->acl_gen = $acl_gen;
|
||||
}
|
||||
|
||||
public function listServices(Request $req, EntityManagerInterface $em)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('tapi_service.list', null, 'No access.');
|
||||
|
||||
$required_params = [];
|
||||
$res = $this->checkParamsAndKey($req, $em, $required_params);
|
||||
if ($res->isError())
|
||||
return $res->getReturnResponse();
|
||||
|
||||
// services
|
||||
$results = $em->getRepository(Service::class)->findAll();
|
||||
if (empty($results))
|
||||
{
|
||||
$res->setError(true)
|
||||
->setErrorMessage('No services available.');
|
||||
return $res->getReturnResponse();
|
||||
}
|
||||
|
||||
$services = [];
|
||||
foreach ($results as $result)
|
||||
{
|
||||
/*
|
||||
// get partners
|
||||
$partners = [];
|
||||
$service_partners = $result->getPartners();
|
||||
foreach($service_partners as $sp)
|
||||
{
|
||||
$partners[] = [
|
||||
'id' => $sp->getID(),
|
||||
'name' => $sp->getName(),
|
||||
'branch' => $sp->getBranch(),
|
||||
'address' => $sp->getAddress(),
|
||||
'contact_nums' => $sp->getContactNumbers(),
|
||||
'time_open' => $sp->getTimeOpen()->format("g:i A"),
|
||||
'time_close' => $sp->getTimeClose()->format("g:i A"),
|
||||
];
|
||||
}
|
||||
*/
|
||||
|
||||
$services[] = [
|
||||
'id' => $result->getID(),
|
||||
'name' => $result->getName(),
|
||||
// 'partners' => $partners,
|
||||
];
|
||||
}
|
||||
|
||||
$data['services'] = $services;
|
||||
|
||||
$res->setData($data);
|
||||
|
||||
return $res->getReturnResponse();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\TAPI;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use Catalyst\APIBundle\Controller\APIController;
|
||||
use Catalyst\APIBundle\Response\APIResponse;
|
||||
|
||||
use App\Entity\VehicleManufacturer;
|
||||
use App\Entity\Vehicle;
|
||||
|
||||
use Catalyst\APIBundle\Access\Generator as ACLGenerator;
|
||||
|
||||
class VehicleController extends APIController
|
||||
{
|
||||
protected $acl_gen;
|
||||
|
||||
public function __construct(ACLGenerator $acl_gen)
|
||||
{
|
||||
$this->acl_gen = $acl_gen;
|
||||
}
|
||||
|
||||
public function listVehicleManufacturers(Request $req, EntityManagerInterface $em)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('tapi_vmanufacturer.list', null, 'No access.');
|
||||
|
||||
// check required parameters
|
||||
$required_params = [];
|
||||
$msg = $this->checkRequiredParameters($req, $required_params);
|
||||
if ($msg)
|
||||
return new APIResponse(false, $msg);
|
||||
|
||||
// get manufacturer list
|
||||
$mfgs = $em->getRepository(VehicleManufacturer::class)->findBy(['flag_mobile' => true], ['name' => 'asc']);
|
||||
$mfg_list = [];
|
||||
foreach ($mfgs as $mfg)
|
||||
{
|
||||
$mfg_list[] = [
|
||||
'id' => $mfg->getID(),
|
||||
'name' => $mfg->getName(),
|
||||
];
|
||||
}
|
||||
|
||||
$data = [
|
||||
'manufacturers' => $mfg_list
|
||||
];
|
||||
|
||||
$message = 'Vehicle manufacturers found.';
|
||||
|
||||
return new APIResponse(true, $message, $data);
|
||||
|
||||
}
|
||||
|
||||
public function listVehicleMakes(Request $req, $mfg_id, EntityManagerInterface $em)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('tapi_vehicle.list', null, 'No access.');
|
||||
|
||||
// check required parameters and api key
|
||||
$required_params = [];
|
||||
$msg = $this->checkRequiredParameters($req, $required_params);
|
||||
if ($msg)
|
||||
return new APIResponse(false, $msg);
|
||||
|
||||
// get manufacturer
|
||||
$mfg = $em->getRepository(VehicleManufacturer::class)->find($mfg_id);
|
||||
if ($mfg == null)
|
||||
{
|
||||
$message = 'Invalid vehicle manufacturer id.';
|
||||
return new APIResponse(false, $message);
|
||||
}
|
||||
|
||||
// get makes
|
||||
$vehicles = $em->getRepository(Vehicle::class)->findBy(
|
||||
[
|
||||
'flag_mobile' => true,
|
||||
'manufacturer' => $mfg_id,
|
||||
],
|
||||
['make' => 'asc']
|
||||
);
|
||||
|
||||
$vlist = [];
|
||||
foreach ($vehicles as $v)
|
||||
{
|
||||
$vlist[] = [
|
||||
'id' => $v->getID(),
|
||||
'make' => trim($v->getMake() . ' ' . $v->getModelYearFormatted(false)),
|
||||
];
|
||||
}
|
||||
|
||||
$data = [
|
||||
'manufacturer' => [
|
||||
'id' => $mfg->getID(),
|
||||
'name' => $mfg->getName(),
|
||||
],
|
||||
'makes' => $vlist,
|
||||
];
|
||||
|
||||
$message = 'Vehicle models found.';
|
||||
return new APIResponse(true, $message, $data);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -485,7 +485,7 @@ class VehicleController extends Controller
|
|||
// get row data
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$vobj = $em->getRepository(Vehicle::class)->find($req->request->get('vehicle_id'));
|
||||
$all_batts = $em->getRepository(Battery::class)->findBy(['flag_active' => true]);
|
||||
$all_batts = $em->getRepository(Battery::class)->findAll();
|
||||
|
||||
if (empty($vobj))
|
||||
throw $this->createNotFoundException('The item does not exist');
|
||||
|
|
@ -495,20 +495,19 @@ class VehicleController extends Controller
|
|||
$battery_index = [];
|
||||
|
||||
// get compatible batteries from selected manufacturer
|
||||
// foreach ($vobj->getBatteries() as $battery)
|
||||
foreach ($vobj->getActiveBatteries() as $battery)
|
||||
foreach ($vobj->getBatteries() as $battery)
|
||||
{
|
||||
$batteries[] = [
|
||||
'id' => $battery->getID(),
|
||||
'mfg_name' => $battery->getManufacturer()->getName(),
|
||||
'model_name' => $battery->getModel()->getName(),
|
||||
'size_name' => $battery->getSize()->getName(),
|
||||
'prod_code' => $battery->getProductCode(),
|
||||
'sell_price' => $battery->getSellingPrice(),
|
||||
'warr_private' => $battery->getWarrantyPrivate(),
|
||||
'warr_commercial' => $battery->getWarrantyCommercial(),
|
||||
];
|
||||
$battery_index[$battery->getID()] = 1;
|
||||
$batteries[] = [
|
||||
'id' => $battery->getID(),
|
||||
'mfg_name' => $battery->getManufacturer()->getName(),
|
||||
'model_name' => $battery->getModel()->getName(),
|
||||
'size_name' => $battery->getSize()->getName(),
|
||||
'prod_code' => $battery->getProductCode(),
|
||||
'sell_price' => $battery->getSellingPrice(),
|
||||
'warr_private' => $battery->getWarrantyPrivate(),
|
||||
'warr_commercial' => $battery->getWarrantyCommercial(),
|
||||
];
|
||||
$battery_index[$battery->getID()] = 1;
|
||||
}
|
||||
|
||||
// add all other batteries, because they want options
|
||||
|
|
|
|||
|
|
@ -170,9 +170,6 @@ class WarrantyController extends Controller
|
|||
else
|
||||
$obj->setSerial($req->request->get('serial'));
|
||||
|
||||
// get outlet info, sender info
|
||||
$req->request->get('outlet_name', '');
|
||||
|
||||
// set and save values
|
||||
$obj->setWarrantyClass($req->request->get('warranty_class'))
|
||||
->setFirstName($req->request->get('first_name'))
|
||||
|
|
@ -181,13 +178,7 @@ class WarrantyController extends Controller
|
|||
->setDatePurchase($date_purchase)
|
||||
->setClaimedFrom($req->request->get('claim_from'))
|
||||
->setStatus($req->request->get('status'))
|
||||
->setCreateSource(WarrantySource::ADMIN_PANEL)
|
||||
->setOutletName($req->request->get('outlet_name', ''))
|
||||
->setOutletContactNumber($req->request->get('outlet_contact_number', ''))
|
||||
->setSenderName($req->request->get('sender_name', ''))
|
||||
->setSenderContactNumber($req->request->get('sender_contact_number', ''))
|
||||
->setOutletAddress($req->request->get('outlet_address', ''))
|
||||
->setSalesInvoiceNumber($req->request->get('sales_invoice_number', ''));
|
||||
->setCreateSource(WarrantySource::ADMIN_PANEL);
|
||||
|
||||
if ($date_claim)
|
||||
{
|
||||
|
|
@ -289,12 +280,6 @@ class WarrantyController extends Controller
|
|||
'battery_size' => $req->request->get('battery_size'),
|
||||
'sap_battery' => $req->request->get('sap_battery'),
|
||||
'plate_number' => $req->request->get('plate_number'),
|
||||
'outlet_name' => $req->request->get('outlet_name', ''),
|
||||
'outlet_contact_number' => $req->request->get('outlet_contact_number', ''),
|
||||
'sender_name' => $req->request->get('sender_name', ''),
|
||||
'sender_contact_number' => $req->request->get('sender_contact_number', ''),
|
||||
'outlet_address' => $req->request->get('outlet_address', ''),
|
||||
'sales_invoice_number' => $req->request->get('sales_invoice_number', ''),
|
||||
];
|
||||
$logger->logWarrantyInfo($log_data, '', $user_id, $action, $source);
|
||||
|
||||
|
|
@ -360,13 +345,7 @@ class WarrantyController extends Controller
|
|||
->setMobileNumber($req->request->get('mobile_number'))
|
||||
->setDatePurchase($date_purchase)
|
||||
->setClaimedFrom($req->request->get('claim_from'))
|
||||
->setStatus($req->request->get('status'))
|
||||
->setOutletName($req->request->get('outlet_name', ''))
|
||||
->setOutletContactNumber($req->request->get('outlet_contact_number', ''))
|
||||
->setSenderName($req->request->get('sender_name', ''))
|
||||
->setSenderContactNumber($req->request->get('sender_contact_number', ''))
|
||||
->setOutletAddress($req->request->get('outlet_address', ''))
|
||||
->setSalesInvoiceNumber($req->request->get('sales_invoice_number', ''));
|
||||
->setStatus($req->request->get('status'));
|
||||
|
||||
if ($date_claim)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -147,12 +147,6 @@ class Battery
|
|||
*/
|
||||
protected $image_file;
|
||||
|
||||
// flag if battery is active
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default": true})
|
||||
*/
|
||||
protected $flag_active;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->vehicles = new ArrayCollection();
|
||||
|
|
@ -165,8 +159,6 @@ class Battery
|
|||
$this->total_height = 0;
|
||||
|
||||
$this->date_create = new DateTime();
|
||||
|
||||
$this->flag_active = true;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
|
|
@ -390,15 +382,4 @@ class Battery
|
|||
{
|
||||
return $this->image_file;
|
||||
}
|
||||
|
||||
public function isActive()
|
||||
{
|
||||
return $this->flag_active;
|
||||
}
|
||||
|
||||
public function setActive($flag_active = true)
|
||||
{
|
||||
$this->flag_active = $flag_active;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="customer_location", indexes={
|
||||
* @ORM\Index(name="cust_location_idx", columns={"code"}),
|
||||
* })
|
||||
*/
|
||||
class CustomerLocation
|
||||
{
|
||||
// unique id
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=25)
|
||||
* @Assert\NotBlank()
|
||||
*/
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=25)
|
||||
* @Assert\NotBlank()
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
}
|
||||
|
|
@ -422,13 +422,6 @@ class JobOrder
|
|||
*/
|
||||
protected $ownership_type;
|
||||
|
||||
// customer location
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="CustomerLocation", inversedBy="job_orders")
|
||||
* @ORM\JoinColumn(name="cust_location_id", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
protected $cust_location;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
|
|
@ -1206,15 +1199,4 @@ class JobOrder
|
|||
{
|
||||
return $this->ownership_type;
|
||||
}
|
||||
|
||||
public function setCustomerLocation(CustomerLocation $cust_location = null)
|
||||
{
|
||||
$this->cust_location = $cust_location;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCustomerLocation()
|
||||
{
|
||||
return $this->cust_location;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ namespace App\Entity;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
|
|
@ -179,12 +177,4 @@ class Vehicle
|
|||
{
|
||||
return $this->cust_vehicles;
|
||||
}
|
||||
|
||||
public function getActiveBatteries()
|
||||
{
|
||||
$crit = Criteria::create();
|
||||
$crit->where(Criteria::expr()->eq('flag_active', true));
|
||||
|
||||
return $this->batteries->matching($crit);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,42 +245,6 @@ class Warranty
|
|||
*/
|
||||
protected $dealer_branch_code;
|
||||
|
||||
// for non-motiv warranties created via admin panel
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80, options={"default": ""})
|
||||
*/
|
||||
protected $outlet_name;
|
||||
|
||||
// for non-motiv warranties created via admin panel
|
||||
/**
|
||||
* @ORM\Column(type="string", length=30, options={"default": ""})
|
||||
*/
|
||||
protected $outlet_contact_num;
|
||||
|
||||
// for non-motiv warranties created via admin panel
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80, options={"default": ""})
|
||||
*/
|
||||
protected $sender_name;
|
||||
|
||||
// for non-motiv warranties created via admin panel
|
||||
/**
|
||||
* @ORM\Column(type="string", length=30, options={"default": ""})
|
||||
*/
|
||||
protected $sender_contact_num;
|
||||
|
||||
// for non-motiv warranties created via admin panel
|
||||
/**
|
||||
* @ORM\Column(type="string", length=180, options={"default": ""})
|
||||
*/
|
||||
protected $outlet_address;
|
||||
|
||||
// for non-motiv warranties created via admin panel
|
||||
/**
|
||||
* @ORM\Column(type="string", length=30, options={"default": ""})
|
||||
*/
|
||||
protected $sales_invoice_num;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
|
|
@ -292,13 +256,6 @@ class Warranty
|
|||
$this->odometer = 0;
|
||||
$this->flag_validated = false;
|
||||
$this->create_source = 'unknown';
|
||||
|
||||
$this->outlet_name = '';
|
||||
$this->outlet_contact_num = '';
|
||||
$this->sender_name = '';
|
||||
$this->sender_contact_num = '';
|
||||
$this->outlet_address = '';
|
||||
$this->sales_invoice_num = '';
|
||||
}
|
||||
|
||||
public function getID()
|
||||
|
|
@ -737,70 +694,4 @@ class Warranty
|
|||
{
|
||||
return $this->dealer_branch_code;
|
||||
}
|
||||
|
||||
public function setOutletName($outlet_name)
|
||||
{
|
||||
$this->outlet_name = $outlet_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOutletName()
|
||||
{
|
||||
return $this->outlet_name;
|
||||
}
|
||||
|
||||
public function setOutletContactNumber($outlet_contact_num)
|
||||
{
|
||||
$this->outlet_contact_num = $outlet_contact_num;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOutletContactNumber()
|
||||
{
|
||||
return $this->outlet_contact_num;
|
||||
}
|
||||
|
||||
public function setSenderName($sender_name)
|
||||
{
|
||||
$this->sender_name = $sender_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSenderName()
|
||||
{
|
||||
return $this->sender_name;
|
||||
}
|
||||
|
||||
public function setSenderContactNumber($sender_contact_num)
|
||||
{
|
||||
$this->sender_contact_num = $sender_contact_num;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSenderContactNumber()
|
||||
{
|
||||
return $this->sender_contact_num;
|
||||
}
|
||||
|
||||
public function setOutletAddress($outlet_address)
|
||||
{
|
||||
$this->outlet_address = $outlet_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOutletAddress()
|
||||
{
|
||||
return $this->outlet_address;
|
||||
}
|
||||
|
||||
public function setSalesInvoiceNumber($sales_invoice_num)
|
||||
{
|
||||
$this->sales_invoice_num = $sales_invoice_num;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSalesInvoiceNumber()
|
||||
{
|
||||
return $this->sales_invoice_num;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,295 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
use DateTime;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="warranty_raffle_log")
|
||||
*/
|
||||
class WarrantyRaffleLog
|
||||
{
|
||||
// unique id
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
// date created
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
protected $date_create;
|
||||
|
||||
// user that created warranty
|
||||
/**
|
||||
* @ORM\Column(type="string", length=32)
|
||||
*/
|
||||
protected $api_user;
|
||||
|
||||
// data sent
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
protected $data_sent;
|
||||
|
||||
// serial
|
||||
/**
|
||||
* @ORM\Column(type="string", length=20)
|
||||
*/
|
||||
protected $serial;
|
||||
|
||||
// warranty id
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
protected $warranty_id;
|
||||
|
||||
// action done
|
||||
/**
|
||||
* @ORM\Column(type="string", length=50)
|
||||
*/
|
||||
protected $action;
|
||||
|
||||
// battery model name
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
protected $batt_model_name;
|
||||
|
||||
// battery size name
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
protected $batt_size_name;
|
||||
|
||||
// customer first name
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
protected $first_name;
|
||||
|
||||
// customer last name
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
protected $last_name;
|
||||
|
||||
// plate number
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
protected $plate_number;
|
||||
|
||||
// contact number
|
||||
/**
|
||||
* @ORM\Column(type="string", length=30)
|
||||
*/
|
||||
protected $contact_num;
|
||||
|
||||
// email
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
protected $email;
|
||||
|
||||
// customer address
|
||||
/**
|
||||
* @ORM\Column(type="string", length=280)
|
||||
*/
|
||||
protected $address;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
$this->data_sent = [];
|
||||
$this->serial = '';
|
||||
$this->api_user = '';
|
||||
$this->action = '';
|
||||
$this->batt_model_name = '';
|
||||
$this->batt_size_name = '';
|
||||
$this->first_name = '';
|
||||
$this->last_name = '';
|
||||
$this->plate_number = '';
|
||||
$this->contact_num = '';
|
||||
$this->email = '';
|
||||
$this->address = '';
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setDateCreate(DateTime $date_create)
|
||||
{
|
||||
$this->date_create = $date_create;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateCreate()
|
||||
{
|
||||
return $this->date_create;
|
||||
}
|
||||
|
||||
public function setApiUser($api_user)
|
||||
{
|
||||
$this->api_user = $api_user;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getApiUser()
|
||||
{
|
||||
return $this->api_user;
|
||||
}
|
||||
|
||||
public function addDataSent($id, $value)
|
||||
{
|
||||
$this->data_sent[$id] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDataSent($data_sent)
|
||||
{
|
||||
$this->data_sent = $data_sent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDataSent($id)
|
||||
{
|
||||
// return null if we don't have it
|
||||
if (!isset($this->data_sent[$id]))
|
||||
return null;
|
||||
|
||||
return $this->data_sent[$id];
|
||||
}
|
||||
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
|
||||
public function setWarrantyID($warranty_id)
|
||||
{
|
||||
$this->warranty_id = $warranty_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWarrantyID()
|
||||
{
|
||||
return $this->warranty_id;
|
||||
}
|
||||
|
||||
public function setAction($action)
|
||||
{
|
||||
$this->action = $action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAction()
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
public function setBattModelName($batt_model_name)
|
||||
{
|
||||
$this->batt_model_name = $batt_model_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBattModelName()
|
||||
{
|
||||
return $this->batt_model_name;
|
||||
}
|
||||
|
||||
public function setBattSizeName($batt_size_name)
|
||||
{
|
||||
$this->batt_size_name = $batt_size_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBattSizeName()
|
||||
{
|
||||
return $this->batt_size_name;
|
||||
}
|
||||
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
public function setPlateNumber($plate_number)
|
||||
{
|
||||
$this->plate_number = $plate_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlateNumber()
|
||||
{
|
||||
return $this->plate_number;
|
||||
}
|
||||
|
||||
public function setContactNumber($contact_num)
|
||||
{
|
||||
$this->contact_num = $contact_num;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getContactNumber()
|
||||
{
|
||||
return $this->contact_num;
|
||||
}
|
||||
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setAddress($address)
|
||||
{
|
||||
$this->cust_address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAddress()
|
||||
{
|
||||
return $this->cust_address;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use DateTime;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="warranty_serial_load_log")
|
||||
*/
|
||||
class WarrantySerialLoadLog
|
||||
{
|
||||
// unique id
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
// date created
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
protected $date_create;
|
||||
|
||||
// user that uploaded the serials
|
||||
/**
|
||||
* @ORM\Column(type="string", length=32)
|
||||
*/
|
||||
protected $api_user;
|
||||
|
||||
// serial
|
||||
/**
|
||||
* @ORM\Column(type="string", length=50)
|
||||
*/
|
||||
protected $serial;
|
||||
|
||||
// flag if loaded
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $flag_loaded;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=30, nullable=true)
|
||||
*/
|
||||
protected $error;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
$this->api_user = '';
|
||||
$this->serial = '';
|
||||
$this->flag_loaded = false;
|
||||
$this->error = null;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setDateCreate(DateTime $date_create)
|
||||
{
|
||||
$this->date_create = $date_create;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateCreate()
|
||||
{
|
||||
return $this->date_create;
|
||||
}
|
||||
|
||||
public function setApiUser($api_user)
|
||||
{
|
||||
$this->api_user = $api_user;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getApiUser()
|
||||
{
|
||||
return $this->api_user;
|
||||
}
|
||||
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
|
||||
public function setLoaded($flag_loaded = true)
|
||||
{
|
||||
$this->flag_loaded = $flag_loaded;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isLoaded()
|
||||
{
|
||||
return $this->flag_loaded;
|
||||
}
|
||||
|
||||
public function setError($error)
|
||||
{
|
||||
$this->error = $error;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,129 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use DateTime;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(
|
||||
* name="warranty_serial_queue",
|
||||
* )
|
||||
*/
|
||||
class WarrantySerialQueue
|
||||
{
|
||||
// unique id
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
// date created
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
protected $date_create;
|
||||
|
||||
// original filename of warranty serial
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80, nullable=true)
|
||||
*/
|
||||
protected $orig_file_serial;
|
||||
|
||||
// warranty serial file that we created
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80, nullable=true)
|
||||
*/
|
||||
protected $file_serial;
|
||||
|
||||
// status
|
||||
/**
|
||||
* @ORM\Column(type="string", length=20)
|
||||
*/
|
||||
protected $status;
|
||||
|
||||
// user that uploaded the serials
|
||||
/**
|
||||
* @ORM\Column(type="string", length=32)
|
||||
*/
|
||||
protected $api_user;
|
||||
|
||||
// file identifier that we send back
|
||||
/**
|
||||
* @ORM\Column(type="string", length=21)
|
||||
*/
|
||||
protected $file_id;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
$this->file_serial = null;
|
||||
$this->orig_file_serial = null;
|
||||
$this->status = '';
|
||||
$this->api_user = '';
|
||||
$this->file_id = '';
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setFileSerial($file = null)
|
||||
{
|
||||
$this->file_serial = $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFileSerial()
|
||||
{
|
||||
return $this->file_serial;
|
||||
}
|
||||
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setApiUser($api_user)
|
||||
{
|
||||
$this->api_user = $api_user;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getApiUser()
|
||||
{
|
||||
return $this->api_user;
|
||||
}
|
||||
|
||||
public function setFileID($file_id)
|
||||
{
|
||||
$this->file_id = $file_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFileID()
|
||||
{
|
||||
return $this->file_id;
|
||||
}
|
||||
|
||||
public function setOrigFileSerial($file = null)
|
||||
{
|
||||
$this->orig_file_serial = $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrigFileSerial()
|
||||
{
|
||||
return $this->orig_file_serial;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use DateTime;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="warranty_serial_upload_log")
|
||||
*/
|
||||
class WarrantySerialUploadLog
|
||||
{
|
||||
// unique id
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
// date created
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
protected $date_create;
|
||||
|
||||
// user that uploaded the file
|
||||
/**
|
||||
* @ORM\Column(type="string", length=32)
|
||||
*/
|
||||
protected $api_user;
|
||||
|
||||
// original filename of warranty serial
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80, nullable=true)
|
||||
*/
|
||||
protected $orig_file_serial;
|
||||
|
||||
// uploaded file name
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80, nullable=true)
|
||||
*/
|
||||
protected $uploaded_file_serial;
|
||||
|
||||
// flag if uploaded
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $flag_uploaded;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, nullable=true)
|
||||
*/
|
||||
protected $error;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
$this->api_user = '';
|
||||
$this->orig_file_serial = '';
|
||||
$this->orig_file_serial = '';
|
||||
$this->flag_uploaded = false;
|
||||
$this->error = null;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setDateCreate(DateTime $date_create)
|
||||
{
|
||||
$this->date_create = $date_create;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateCreate()
|
||||
{
|
||||
return $this->date_create;
|
||||
}
|
||||
|
||||
public function setApiUser($api_user)
|
||||
{
|
||||
$this->api_user = $api_user;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getApiUser()
|
||||
{
|
||||
return $this->api_user;
|
||||
}
|
||||
|
||||
public function setOrigFileSerial($file = null)
|
||||
{
|
||||
$this->orig_file_serial = $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrigFileSerial()
|
||||
{
|
||||
return $this->orig_file_serial;
|
||||
}
|
||||
|
||||
public function setUploadedFileSerial($file = null)
|
||||
{
|
||||
$this->uploaded_file_serial = $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUploadedFileSerial()
|
||||
{
|
||||
return $this->uploaded_file_serial;
|
||||
}
|
||||
|
||||
public function setUploaded($flag_uploaded = true)
|
||||
{
|
||||
$this->flag_uploaded = $flag_uploaded;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isUploaded()
|
||||
{
|
||||
return $this->flag_uploaded;
|
||||
}
|
||||
|
||||
public function setError($error)
|
||||
{
|
||||
$this->error = $error;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,6 @@ class ModeOfPayment extends NameValue
|
|||
const DEBIT_CARD = 'debit_card';
|
||||
const INSTALLMENT = 'installment';
|
||||
const GCASH = 'gcash';
|
||||
const CREDIT_CARD_AMEX = 'credit_card_amex';
|
||||
|
||||
const COLLECTION = [
|
||||
'cash' => 'Cash',
|
||||
|
|
@ -17,6 +16,5 @@ class ModeOfPayment extends NameValue
|
|||
'debit_card' => 'Debit Card',
|
||||
'installment' => 'Installment - BDO',
|
||||
'gcash' => 'GCash',
|
||||
'credit_card_amex' => 'Credit Card - AMEX',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@ namespace App\Ramcar;
|
|||
|
||||
class TransactionOrigin extends NameValue
|
||||
{
|
||||
const CALL = 'call';
|
||||
const ONLINE = 'online';
|
||||
const FACEBOOK = 'facebook';
|
||||
const VIP = 'vip';
|
||||
const MOBILE_APP = 'mobile_app';
|
||||
const WALK_IN = 'walk_in';
|
||||
const LAZADA = 'lazada';
|
||||
const THIRD_PARTY = 'third_party';
|
||||
const CALL = 'call';
|
||||
const ONLINE = 'online';
|
||||
const FACEBOOK = 'facebook';
|
||||
const VIP = 'vip';
|
||||
const MOBILE_APP = 'mobile_app';
|
||||
const WALK_IN = 'walk_in';
|
||||
const LAZADA = 'lazada';
|
||||
const YOKOHAMA_OP_FACEBOOK = 'yokohama_op_facebook';
|
||||
const YOKOHAMA_TWITTER = 'yokohama_twitter';
|
||||
const YOKOHAMA_INSTAGRAM = 'yokohama_instagram';
|
||||
|
|
@ -27,7 +26,6 @@ class TransactionOrigin extends NameValue
|
|||
'mobile_app' => 'Mobile App',
|
||||
'walk_in' => 'Walk-in',
|
||||
'lazada' => 'Lazada',
|
||||
'third_party' => 'Third Party',
|
||||
'yokohama_op_facebook' => 'Yokohama OP Facebook',
|
||||
'yokohama_twitter' => 'Yokohama Twitter',
|
||||
'yokohama_instagram' => 'Yokohama Instagram',
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class ResqInvoiceGenerator implements InvoiceGeneratorInterface
|
|||
const OTHER_SERVICES_FEE = 200;
|
||||
const COOLANT_FEE = 1600;
|
||||
const REFUEL_FEE_GAS = 320; // for 4 liters
|
||||
const REFUEL_FEE_DIESEL = 320; // for 4 liters
|
||||
const REFUEL_FEE_DIESEL = 340; // for 4 liters
|
||||
|
||||
private $security;
|
||||
protected $em;
|
||||
|
|
@ -84,7 +84,7 @@ class ResqInvoiceGenerator implements InvoiceGeneratorInterface
|
|||
break;
|
||||
case ServiceType::JUMPSTART_WARRANTY:
|
||||
$this->processJumpstartWarranty($total, $invoice);
|
||||
break;
|
||||
|
||||
case ServiceType::BATTERY_REPLACEMENT_NEW:
|
||||
$this->processEntries($total, $criteria, $invoice);
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ use App\Entity\Customer;
|
|||
use App\Entity\CustomerTag;
|
||||
use App\Entity\EmergencyType;
|
||||
use App\Entity\OwnershipType;
|
||||
use App\Entity\CustomerLocation;
|
||||
|
||||
use App\Ramcar\InvoiceCriteria;
|
||||
use App\Ramcar\ServiceType;
|
||||
|
|
@ -425,19 +424,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
}
|
||||
|
||||
// check if customer location is set
|
||||
$cust_location_id = $req->request->get('cust_location', 0);
|
||||
if ($cust_location_id == 0)
|
||||
$error_array['cust_location'] = 'Customer location is required.';
|
||||
else
|
||||
{
|
||||
// get customer location
|
||||
$cust_location = $em->getRepository(CustomerLocation::class)->find($cust_location_id);
|
||||
|
||||
if ($cust_location == null)
|
||||
$error_array['cust_location'] = 'Invalid customer location';
|
||||
}
|
||||
|
||||
// get source of awareness if any
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
|
|
@ -446,13 +432,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get initial concern if any
|
||||
$initial_concern = $req->request->get('initial_concern', '');
|
||||
if (empty($initial_concern))
|
||||
$error_array['initial_concern'] = 'Initial concern of customer is required.';
|
||||
|
||||
// get initial concern notes if any
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
if (empty($initial_concern_notes))
|
||||
$error_array['initial_concern_notes'] = 'Notes on initial concern of customer is required.';
|
||||
|
||||
// get gender if any
|
||||
$gender = $req->request->get('gender', '');
|
||||
|
|
@ -507,8 +489,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setCallerClassification($caller_class)
|
||||
->setGender($gender)
|
||||
->setEmergencyType($etype)
|
||||
->setOwnershipType($owner_type)
|
||||
->setCustomerLocation($cust_location);
|
||||
->setOwnershipType($owner_type);
|
||||
|
||||
// check if user is null, meaning call to create came from API
|
||||
if ($user != null)
|
||||
|
|
@ -711,13 +692,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get initial concern if any
|
||||
$initial_concern = $req->request->get('initial_concern', '');
|
||||
if (empty($initial_concern))
|
||||
$error_array['initial_concern'] = 'Initial concern of customer is required.';
|
||||
|
||||
// get initial concern notes if any
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
if (empty($initial_concern_notes))
|
||||
$error_array['initial_concern_notes'] = 'Notes on initial concern of customer is required.';
|
||||
|
||||
// get gender if any
|
||||
$gender = $req->request->get('gender', '');
|
||||
|
|
@ -733,19 +710,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
||||
|
||||
// check if customer location is set
|
||||
$cust_location_id = $req->request->get('cust_location', 0);
|
||||
if ($cust_location_id == 0)
|
||||
$error_array['cust_location'] = 'Customer location is required.';
|
||||
else
|
||||
{
|
||||
// get customer location
|
||||
$cust_location = $em->getRepository(CustomerLocation::class)->find($cust_location_id);
|
||||
|
||||
if ($cust_location == null)
|
||||
$error_array['cust_location'] = 'Invalid customer location';
|
||||
}
|
||||
|
||||
if (empty($error_array))
|
||||
{
|
||||
// get current user
|
||||
|
|
@ -780,8 +744,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setCallerClassification($caller_class)
|
||||
->setGender($gender)
|
||||
->setEmergencyType($etype)
|
||||
->setOwnershipType($owner_type)
|
||||
->setCustomerLocation($cust_location);
|
||||
->setOwnershipType($owner_type);
|
||||
|
||||
// did they change invoice?
|
||||
$invoice_items = $req->request->get('invoice_items', []);
|
||||
|
|
@ -935,13 +898,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get initial concern if any
|
||||
$initial_concern = $req->request->get('initial_concern', '');
|
||||
if (empty($initial_concern))
|
||||
$error_array['initial_concern'] = 'Initial concern of customer is required.';
|
||||
|
||||
// get initial concern notes if any
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
if (empty($initial_concern_notes))
|
||||
$error_array['initial_concern_notes'] = 'Notes on initial concern of customer is required.';
|
||||
|
||||
// get gender if any
|
||||
$gender = $req->request->get('gender', '');
|
||||
|
|
@ -957,19 +916,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
||||
|
||||
// check if customer location is set
|
||||
$cust_location_id = $req->request->get('cust_location', 0);
|
||||
if ($cust_location_id == 0)
|
||||
$error_array['cust_location'] = 'Customer location is required.';
|
||||
else
|
||||
{
|
||||
// get customer location
|
||||
$cust_location = $em->getRepository(CustomerLocation::class)->find($cust_location_id);
|
||||
|
||||
if ($cust_location == null)
|
||||
$error_array['cust_location'] = 'Invalid customer location';
|
||||
}
|
||||
|
||||
if (empty($error_array))
|
||||
{
|
||||
// coordinates
|
||||
|
|
@ -1001,8 +947,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setGender($gender)
|
||||
->setCallerClassification($caller_class)
|
||||
->setEmergencyType($etype)
|
||||
->setOwnershipType($owner_type)
|
||||
->setCustomerLocation($cust_location);
|
||||
->setOwnershipType($owner_type);
|
||||
|
||||
// validate
|
||||
$errors = $this->validator->validate($obj);
|
||||
|
|
@ -1102,13 +1047,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get initial concern if any
|
||||
$initial_concern = $req->request->get('initial_concern', '');
|
||||
if (empty($initial_concern))
|
||||
$error_array['initial_concern'] = 'Initial concern of customer is required.';
|
||||
|
||||
// get initial concern notes if any
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
if (empty($initial_concern_notes))
|
||||
$error_array['initial_concern_notes'] = 'Notes on initial concern of customer is required.';
|
||||
|
||||
// get gender if any
|
||||
$gender = $req->request->get('gender', '');
|
||||
|
|
@ -1124,19 +1065,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
||||
|
||||
// check if customer location is set
|
||||
$cust_location_id = $req->request->get('cust_location', 0);
|
||||
if ($cust_location_id == 0)
|
||||
$error_array['cust_location'] = 'Customer location is required.';
|
||||
else
|
||||
{
|
||||
// get customer location
|
||||
$cust_location = $em->getRepository(CustomerLocation::class)->find($cust_location_id);
|
||||
|
||||
if ($cust_location == null)
|
||||
$error_array['cust_location'] = 'Invalid customer location';
|
||||
}
|
||||
|
||||
// get current user
|
||||
$user = $this->security->getUser();
|
||||
|
||||
|
|
@ -1170,8 +1098,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setCallerClassification($caller_class)
|
||||
->setGender($gender)
|
||||
->setEmergencyType($etype)
|
||||
->setOwnershipType($owner_type)
|
||||
->setCustomerLocation($cust_location);
|
||||
->setOwnershipType($owner_type);
|
||||
|
||||
if ($user != null)
|
||||
{
|
||||
|
|
@ -1260,13 +1187,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get initial concern if any
|
||||
$initial_concern = $req->request->get('initial_concern', '');
|
||||
if (empty($initial_concern))
|
||||
$error_array['initial_concern'] = 'Initial concern of customer is required.';
|
||||
|
||||
// get initial concern notes if any
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
if (empty($initial_concern_notes))
|
||||
$error_array['initial_concern_notes'] = 'Notes on initial concern of customer is required.';
|
||||
|
||||
// get gender if any
|
||||
$gender = $req->request->get('gender', '');
|
||||
|
|
@ -1282,19 +1205,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
||||
|
||||
// check if customer location is set
|
||||
$cust_location_id = $req->request->get('cust_location', 0);
|
||||
if ($cust_location_id == 0)
|
||||
$error_array['cust_location'] = 'Customer location is required.';
|
||||
else
|
||||
{
|
||||
// get customer location
|
||||
$cust_location = $em->getRepository(CustomerLocation::class)->find($cust_location_id);
|
||||
|
||||
if ($cust_location == null)
|
||||
$error_array['cust_location'] = 'Invalid customer location';
|
||||
}
|
||||
|
||||
if (empty($error_array)) {
|
||||
// coordinates
|
||||
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
||||
|
|
@ -1322,8 +1232,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setGender($gender)
|
||||
->setCallerClassification($caller_class)
|
||||
->setEmergencyType($etype)
|
||||
->setOwnershipType($owner_type)
|
||||
->setCustomerLocation($cust_location);
|
||||
->setOwnershipType($owner_type);
|
||||
|
||||
// validate
|
||||
$errors = $this->validator->validate($obj);
|
||||
|
|
@ -1532,13 +1441,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get initial concern if any
|
||||
$initial_concern = $req->request->get('initial_concern', '');
|
||||
if (empty($initial_concern))
|
||||
$error_array['initial_concern'] = 'Initial concern of customer is required.';
|
||||
|
||||
// get initial concern notes if any
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
if (empty($initial_concern_notes))
|
||||
$error_array['initial_concern_notes'] = 'Notes on initial concern of customer is required.';
|
||||
|
||||
// get gender if any
|
||||
$gender = $req->request->get('gender', '');
|
||||
|
|
@ -1554,19 +1459,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
||||
|
||||
// check if customer location is set
|
||||
$cust_location_id = $req->request->get('cust_location', 0);
|
||||
if ($cust_location_id == 0)
|
||||
$error_array['cust_location'] = 'Customer location is required.';
|
||||
else
|
||||
{
|
||||
// get customer location
|
||||
$cust_location = $em->getRepository(CustomerLocation::class)->find($cust_location_id);
|
||||
|
||||
if ($cust_location == null)
|
||||
$error_array['cust_location'] = 'Invalid customer location';
|
||||
}
|
||||
|
||||
// get previously assigned hub, if any
|
||||
$old_hub = $obj->getHub();
|
||||
|
||||
|
|
@ -1625,7 +1517,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setCallerClassification($caller_class)
|
||||
->setEmergencyType($etype)
|
||||
->setOwnershipType($owner_type)
|
||||
->setCustomerLocation($cust_location)
|
||||
->clearRider();
|
||||
|
||||
if ($user != null)
|
||||
|
|
@ -1769,8 +1660,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
// validated! save the entity
|
||||
$em->persist($obj);
|
||||
$em->flush();
|
||||
|
||||
$this->sendSMSHubRejection($obj, $jo);
|
||||
}
|
||||
|
||||
return $error_array;
|
||||
|
|
@ -1832,13 +1721,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get initial concern if any
|
||||
$initial_concern = $req->request->get('initial_concern', '');
|
||||
if (empty($initial_concern))
|
||||
$error_array['initial_concern'] = 'Initial concern of customer is required.';
|
||||
|
||||
// get initial concern notes if any
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
if (empty($initial_concern_notes))
|
||||
$error_array['initial_concern_notes'] = 'Notes on initial concern of customer is required.';
|
||||
|
||||
// get gender if any
|
||||
$gender = $req->request->get('gender', '');
|
||||
|
|
@ -1854,19 +1739,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
||||
|
||||
// check if customer location is set
|
||||
$cust_location_id = $req->request->get('cust_location', 0);
|
||||
if ($cust_location_id == 0)
|
||||
$error_array['cust_location'] = 'Customer location is required.';
|
||||
else
|
||||
{
|
||||
// get customer location
|
||||
$cust_location = $em->getRepository(CustomerLocation::class)->find($cust_location_id);
|
||||
|
||||
if ($cust_location == null)
|
||||
$error_array['cust_location'] = 'Invalid customer location';
|
||||
}
|
||||
|
||||
if (empty($error_array)) {
|
||||
// rider mqtt event
|
||||
// NOTE: need to send this before saving because rider will be cleared
|
||||
|
|
@ -1919,8 +1791,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setGender($gender)
|
||||
->setCallerClassification($caller_class)
|
||||
->setEmergencyType($etype)
|
||||
->setOwnershipType($owner_type)
|
||||
->setCustomerLocation($cust_location);
|
||||
->setOwnershipType($owner_type);
|
||||
|
||||
if ($user != null)
|
||||
{
|
||||
|
|
@ -2492,7 +2363,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
if ($willing_to_wait == WillingToWaitContent::NOT_WILLING_TO_WAIT)
|
||||
{
|
||||
// reset distance limit if emergency
|
||||
//TODO: move to .env the emergency distance limit
|
||||
$hub_criteria->setLimitDistance(500);
|
||||
$hub_criteria->setEmergency(true);
|
||||
}
|
||||
|
|
@ -2534,19 +2404,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$hub['distance'] = false;
|
||||
}
|
||||
|
||||
// get rider counts
|
||||
$rider_counts = $this->getHubRiderCounts($hub['hub']);
|
||||
|
||||
// counters
|
||||
// get only the active riders for the total rider count per hub
|
||||
// $hub['rider_count'] = count($hub['hub']->getAvailableRiders());
|
||||
$hub['rider_count'] = count($hub['hub']->getActiveRiders());
|
||||
$hub['rider_count'] = count($hub['hub']->getAvailableRiders());
|
||||
$hub['redis_jo_count'] = $hub['jo_count'];
|
||||
|
||||
$hub['rider_logged_in'] = $rider_counts['logged_in'];
|
||||
$hub['rider_in_transit'] = $rider_counts['in_transit'];
|
||||
$hub['rider_available'] = $rider_counts['available'];
|
||||
|
||||
//$hub['redis_jo_count'] = 0;
|
||||
// $hub['jo_count'] = count($hub['hub']->getForAssignmentJobOrders());
|
||||
$hub['jo_count'] = $hub['redis_jo_count'];
|
||||
|
|
@ -2693,10 +2553,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$this->fillDropdownParameters($params);
|
||||
$this->fillFormTags($params);
|
||||
|
||||
// get the rider data to display for table
|
||||
$rider_data = $this->getRiderDataForAssignment($obj);
|
||||
$params['rider_data'] = $rider_data;
|
||||
|
||||
// get template to display
|
||||
$params['template'] = $this->getTwigTemplate('jo_assigning_form');
|
||||
$params['obj'] = $obj;
|
||||
|
|
@ -2822,11 +2678,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
// check if emergency or not
|
||||
$willing_to_wait = $obj->getWillWait();
|
||||
if ($willing_to_wait == WillingToWaitContent::NOT_WILLING_TO_WAIT)
|
||||
{
|
||||
//TODO: move to .env the emergency distance limit
|
||||
$hub_criteria->setLimitDistance(500);
|
||||
$hub_criteria->setEmergency(true);
|
||||
}
|
||||
|
||||
// get JO and customer id for logging purposes
|
||||
$jo_id = $obj->getID();
|
||||
|
|
@ -2863,20 +2715,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$hub['distance'] = false;
|
||||
}
|
||||
|
||||
// get rider counts
|
||||
$rider_counts = $this->getHubRiderCounts($hub['hub']);
|
||||
|
||||
// counters
|
||||
// get only the active riders for the total rider count per hub
|
||||
// $hub['rider_count'] = count($hub['hub']->getAvailableRiders());
|
||||
$hub['rider_count'] = count($hub['hub']->getActiveRiders());
|
||||
$hub['rider_count'] = count($hub['hub']->getAvailableRiders());
|
||||
// $hub['redis_jo_count'] = $hub['jo_count'];
|
||||
$hub['redis_jo_count'] = 0;
|
||||
|
||||
$hub['rider_logged_in'] = $rider_counts['logged_in'];
|
||||
$hub['rider_in_transit'] = $rider_counts['in_transit'];
|
||||
$hub['rider_available'] = $rider_counts['available'];
|
||||
|
||||
// $hub['jo_count'] = count($hub['hub']->getForAssignmentJobOrders());
|
||||
$hub['jo_count'] = $hub['redis_jo_count'];
|
||||
|
||||
|
|
@ -2976,10 +2818,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$this->fillDropdownParameters($params);
|
||||
$this->fillFormTags($params);
|
||||
|
||||
// get the rider data to display for table
|
||||
$rider_data = $this->getRiderDataForAssignment($obj);
|
||||
$params['rider_data'] = $rider_data;
|
||||
|
||||
$params['obj'] = $obj;
|
||||
$params['status_cancelled'] = JOStatus::CANCELLED;
|
||||
// get template to display
|
||||
|
|
@ -3435,34 +3273,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
return false;
|
||||
}
|
||||
|
||||
protected function getHubRiderCounts($hub)
|
||||
{
|
||||
$em = $this->em;
|
||||
|
||||
$hub_id = $hub->getID();
|
||||
|
||||
// get in transit rider count aka flag_available is false AND current_jo_id is not null AND rider is active
|
||||
$in_transit_query = $em->createQuery('SELECT count(r.id) FROM App\Entity\Rider r JOIN r.hub h WHERE h.id = :hub_id AND r.flag_available = false AND r.current_job_order IS NOT NULL AND r.flag_active = true');
|
||||
$in_transit_query->setParameters(['hub_id' => $hub_id]);
|
||||
$in_transit_count = $in_transit_query->getSingleScalarResult();
|
||||
|
||||
// get available rider count aka flag_available is true AND current_jo_id is null AND rider is active
|
||||
$available_query = $em->createQuery('SELECT count(r.id) FROM App\Entity\Rider r JOIN r.hub h WHERE h.id = :hub_id AND r.flag_available = true AND r.current_job_order IS NULL AND r.flag_active = true');
|
||||
$available_query->setParameters(['hub_id' => $hub_id]);
|
||||
$available_count = $available_query->getSingleScalarResult();
|
||||
|
||||
// on duty count = in transit + available
|
||||
$logged_in_count = $in_transit_count + $available_count;
|
||||
|
||||
$rider_count = [
|
||||
'logged_in' => $logged_in_count,
|
||||
'in_transit' => $in_transit_count,
|
||||
'available' => $available_count,
|
||||
];
|
||||
|
||||
return $rider_count;
|
||||
}
|
||||
|
||||
protected function fillDropdownParameters(&$params)
|
||||
{
|
||||
$em = $this->em;
|
||||
|
|
@ -3489,15 +3299,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
$params['ownership_types'] = $ownership_types;
|
||||
|
||||
// list of customer locations
|
||||
$cust_locations = $em->getRepository(CustomerLocation::class)->findBy([], ['name' => 'ASC']);
|
||||
$c_locations = [];
|
||||
foreach ($cust_locations as $cust_location)
|
||||
{
|
||||
$c_locations[$cust_location->getID()] = $cust_location->getName();
|
||||
}
|
||||
$params['cust_locations'] = $c_locations;
|
||||
|
||||
// list of hubs
|
||||
$hubs = $em->getRepository(Hub::class)->findBy([], ['name' => 'ASC']);
|
||||
$fac_hubs = [];
|
||||
|
|
@ -3694,49 +3495,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
];
|
||||
}
|
||||
|
||||
protected function getRiderDataForAssignment($obj)
|
||||
{
|
||||
$hub = $obj->getHub();
|
||||
|
||||
$rider_data = [];
|
||||
|
||||
// get all active riders of hub
|
||||
$active_riders = $hub->getActiveRiders();
|
||||
|
||||
// need to get first name, last name, contact number, plate number, status, image file
|
||||
// status: Online (rider is logged in app), Offline (rider is not logged in app), In transit
|
||||
|
||||
foreach ($active_riders as $rider)
|
||||
{
|
||||
// in transit - flag_available = 0 AND current_job_order is not null
|
||||
// online - flag_available = 1
|
||||
// offline - flag_available = 0 AND current_job_order is null
|
||||
$rider_status = '';
|
||||
|
||||
if ($rider->isAvailable())
|
||||
{
|
||||
$rider_status = 'Online';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($rider->getCurrentJobOrder() == null)
|
||||
$rider_status = 'Offline';
|
||||
else
|
||||
$rider_status = 'In transit';
|
||||
}
|
||||
|
||||
$rider_data[$rider->getID()] = [
|
||||
'first_name' => $rider->getFirstName(),
|
||||
'last_name' => $rider->getLastName(),
|
||||
'contact_number' => $rider->getContactNumber(),
|
||||
'plate_number' => $rider->getPlateNumber(),
|
||||
'image_file' => $rider->getImageFile(),
|
||||
'status' => $rider_status,
|
||||
];
|
||||
}
|
||||
return $rider_data;
|
||||
}
|
||||
|
||||
// TODO: re-enable search, figure out how to group the orWhere filters into one, so can execute that plus the pending filter
|
||||
// check if datatable filter is present and append to query
|
||||
protected function setQueryFilters($datatable, &$query, $qb, $hubs, $tier, $status)
|
||||
|
|
@ -4151,54 +3909,4 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$this->rt->sendSMS($phone_number, $this->translator->trans('message.battery_brand_allcaps'), $message);
|
||||
}
|
||||
|
||||
protected function sendSMSHubRejection($rejection, $jo)
|
||||
{
|
||||
$hub = $rejection->getHub();
|
||||
|
||||
// check if JO service type is NOT battery sales
|
||||
if ($jo->getServiceType() !== ServiceType::BATTERY_REPLACEMENT_NEW)
|
||||
return null;
|
||||
|
||||
// check if hub has a notification number
|
||||
$notif_number = $hub->getNotifNumber();
|
||||
if (empty($notif_number))
|
||||
return null;
|
||||
|
||||
$phone_number = $this->country_code . $notif_number;
|
||||
|
||||
// check if reason is administrative
|
||||
if ($rejection->getReason() == JORejectionReason::ADMINISTRATIVE)
|
||||
return null;
|
||||
|
||||
// sms content
|
||||
// Job Order # - can get from jo
|
||||
// Order Date and Time - get from jo
|
||||
// Date and Time Rejected - get from rejection
|
||||
// Enrollee Name - get from rejection ($hub->getName() . ' - ' . $hub->getBranch())
|
||||
// Reason of Rejection - get from rejection
|
||||
// Remarks - get from rejection
|
||||
// Type of Service - get from jo
|
||||
|
||||
$jo_id = $jo->getID();
|
||||
|
||||
// convert to string format the date fields (order date and time and date and time rejected)
|
||||
$order_date_time = $jo->getDateCreate()->format('d M Y g:i A');
|
||||
$reject_date_time = $rejection->getDateCreate()->format('d M Y g:i A');
|
||||
|
||||
$enrollee = $hub->getName() . ' - ' . $hub->getBranch();
|
||||
$reason = JORejectionReason::getName($rejection->getReason());
|
||||
$remarks = $rejection->getRemarks();
|
||||
|
||||
$service_type = ServiceType::getName($jo->getServiceType());
|
||||
|
||||
$msg = 'Job Order #: ' . $jo_id . "\n" . 'Order Date and Time: ' . $order_date_time . "\n" .
|
||||
'Date and Time Rejected: ' . $reject_date_time . "\n" . 'Enrollee Name: ' . $enrollee . "\n" .
|
||||
'Reason of Rejection: ' . $reason . "\n" . 'Remarks: ' . $remarks . "\n" .
|
||||
'Type of Service: ' . $service_type;
|
||||
|
||||
// error_log($msg);
|
||||
|
||||
$this->rt->sendSMS($phone_number, $this->translator->trans('message.battery_brand_allcaps'), $msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -714,7 +714,7 @@ class ResqRiderAPIHandler implements RiderAPIHandlerInterface
|
|||
if (isset($data['error']))
|
||||
return $data;
|
||||
|
||||
$batts = $this->em->getRepository(Battery::class)->findBy(['flag_active' => true]);
|
||||
$batts = $this->em->getRepository(Battery::class)->findAll();
|
||||
$models = $this->em->getRepository(BatteryModel::class)->findAll();
|
||||
$sizes = $this->em->getRepository(BatterySize::class)->findAll();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use App\Ramcar\WarrantyClass;
|
||||
|
||||
class WarrantyRaffleFilter
|
||||
{
|
||||
public function isValidRaffleEntry($entry)
|
||||
{
|
||||
// entry is an associative array
|
||||
// Serial Number of Battery (NOT blank)
|
||||
if (empty($entry['serial']))
|
||||
return false;
|
||||
|
||||
// Plate Number (NOT blank)
|
||||
if (empty($entry['plate_number']))
|
||||
return false;
|
||||
|
||||
// Warranty Class (ONLY private)
|
||||
if ($entry['warranty_class'] != WarrantyClass::WTY_PRIVATE)
|
||||
return false;
|
||||
|
||||
// either contact number of mobile number is present
|
||||
if ((empty($entry['contact_number'])) &&
|
||||
(empty($entry['mobile_number'])))
|
||||
return false;
|
||||
|
||||
// First Name & Last Name have to be present
|
||||
if ((empty($entry['first_name'])) ||
|
||||
(empty($entry['last_name'])))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use App\Entity\WarrantyRaffleLog;
|
||||
|
||||
class WarrantyRaffleLogger
|
||||
{
|
||||
protected $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function logRaffleInfo($data_sent, $raffle_log_data)
|
||||
{
|
||||
$log_entry = new WarrantyRaffleLog();
|
||||
|
||||
$log_entry->setApiUser($raffle_log_data['user_id'])
|
||||
->setDataSent($data_sent)
|
||||
->setSerial($raffle_log_data['serial'])
|
||||
->setWarrantyID($raffle_log_data['warranty_id'])
|
||||
->setAction($raffle_log_data['action'])
|
||||
->setBattModelName($raffle_log_data['bmodel_name'])
|
||||
->setBattSizename($raffle_log_data['bsize_name'])
|
||||
->setFirstName($raffle_log_data['first_name'])
|
||||
->setLastName($raffle_log_data['last_name'])
|
||||
->setPlateNumber($raffle_log_data['plate_number'])
|
||||
->setContactNumber($raffle_log_data['contact_num'])
|
||||
->setEmail($raffle_log_data['email'])
|
||||
->setAddress($raffle_log_data['address']);
|
||||
|
||||
$this->em->persist($log_entry);
|
||||
$this->em->flush();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use DateTime;
|
||||
|
||||
class WarrantySerialLoadLogger
|
||||
{
|
||||
protected $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function logWarrantySerialLoadInfo($log_data)
|
||||
{
|
||||
// cache directory
|
||||
$cache_dir = __DIR__ . '/../../var/cache';
|
||||
|
||||
$file = $cache_dir . '/warranty_serial_load_log.tab';
|
||||
// error_log('opening file for warranty serial load log - ' . $file);
|
||||
|
||||
$fp = fopen($file, 'w');
|
||||
if ($fp === false)
|
||||
{
|
||||
error_log('could not open file for load data infile - ' . $file);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($log_data as $key => $data)
|
||||
{
|
||||
$line = implode('|', $data) . "\r\n";
|
||||
fwrite($fp, $line);
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
|
||||
// prepared statement
|
||||
$db = $this->em->getConnection();
|
||||
$stmt = $db->prepare('LOAD DATA LOCAL INFILE \''. $file . '\' INTO TABLE warranty_serial_load_log FIELDS TERMINATED BY \'|\' LINES TERMINATED BY \'\\r\\n\' (date_create, api_user, serial, flag_loaded, error)');
|
||||
|
||||
$result = $stmt->execute();
|
||||
if (!$result)
|
||||
error_log('Failed loading data.');
|
||||
|
||||
// TODO: delete file?
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
use App\Entity\WarrantySerialUploadLog;
|
||||
|
||||
class WarrantySerialUploadLogger
|
||||
{
|
||||
protected $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function logWarrantySerialUploadInfo($log_data)
|
||||
{
|
||||
$log_entry = new WarrantySerialUploadLog();
|
||||
|
||||
$user_id = $log_data['user_id'];
|
||||
$is_uploaded = $log_data['is_uploaded'];
|
||||
|
||||
$error = '';
|
||||
$orig_file_serial = '';
|
||||
$uploaded_file_serial = '';
|
||||
|
||||
if (isset($log_data['error']))
|
||||
$error = $log_data['error'];
|
||||
if (isset($log_data['orig_file_serial']))
|
||||
$orig_file_serial = $log_data['orig_file_serial'];
|
||||
if (isset($log_data['uploaded_file_serial']))
|
||||
$uploaded_file_serial = $log_data['uploaded_file_serial'];
|
||||
|
||||
$log_entry->setApiUser($user_id)
|
||||
->setUploaded($is_uploaded)
|
||||
->setOrigFileSerial($orig_file_serial)
|
||||
->setUploadedFileSerial($uploaded_file_serial)
|
||||
->setError($error);
|
||||
|
||||
$this->em->persist($log_entry);
|
||||
$this->em->flush();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -182,16 +182,6 @@
|
|||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="m-menu__item " data-redirect="true" aria-haspopup="true">
|
||||
<a href= "{{ url('rep_jo_raffle_form') }}" class="m-menu__link">
|
||||
<i class="m-menu__link-bullet m-menu__link-bullet--dot">
|
||||
<span></span>
|
||||
</i>
|
||||
<span class="m-menu__link-text">
|
||||
Job Order Raffle Report
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="m-menu__item">
|
||||
|
|
@ -267,14 +257,6 @@
|
|||
Hub Filter Report
|
||||
</span>
|
||||
</a>
|
||||
<a href="{{ url('rep_warranty_raffle_form') }}" class="m-menu__link">
|
||||
<i class="m-menu__link-bullet m-menu__link-bullet--dot">
|
||||
<span></span>
|
||||
</i>
|
||||
<span class="m-menu__link-text">
|
||||
Warranty Raffle Report
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -101,20 +101,6 @@
|
|||
<div class="form-control-feedback hide" data-field="size"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-4">
|
||||
<span class="m-switch m-switch--icon block-switch">
|
||||
<label>
|
||||
<input type="checkbox" name="flag_active" id="flag_active" value="1"{{ obj.isActive() ? ' checked' }}>
|
||||
<label class="switch-label">Active</label>
|
||||
<span></span>
|
||||
</label>
|
||||
</span>
|
||||
<div class="form-control-feedback hide" data-field="flag_active"></div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
<label data-field="image_file">
|
||||
|
|
|
|||
|
|
@ -111,21 +111,6 @@
|
|||
title: 'Brand',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
field: 'flag_active',
|
||||
title: 'Active',
|
||||
template: function (row, index, datatable) {
|
||||
var tag = '';
|
||||
|
||||
if (row.flag_active === true) {
|
||||
tag = '<span class="m-badge m-badge--success m-badge--wide">Yes</span>';
|
||||
} else {
|
||||
tag = '<span class="m-badge m-badge--danger m-badge--wide">No</span>';
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
},
|
||||
/*
|
||||
{
|
||||
field: 'prod_code',
|
||||
|
|
|
|||
|
|
@ -1,142 +0,0 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<!-- BEGIN: Subheader -->
|
||||
<div class="m-subheader">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="mr-auto">
|
||||
<h3 class="m-subheader__title">Customer Locations</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END: Subheader -->
|
||||
<div class="m-content">
|
||||
<!--Begin::Section-->
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<div class="m-portlet m-portlet--mobile">
|
||||
<div class="m-portlet__head">
|
||||
<div class="m-portlet__head-caption">
|
||||
<div class="m-portlet__head-title">
|
||||
<span class="m-portlet__head-icon">
|
||||
<i class="la la-industry"></i>
|
||||
</span>
|
||||
<h3 class="m-portlet__head-text">
|
||||
{% if mode == 'update' %}
|
||||
Edit Ownership Type
|
||||
<small>{{ cust_location.getName() }}</small>
|
||||
{% else %}
|
||||
New Customer Location
|
||||
{% endif %}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="row-form" class="m-form m-form--fit m-form--label-align-right m-form--group-seperator-dashed" method="post" action="{{ mode == 'update' ? url('customer_location_update_submit', {'id': cust_location.getId()}) : url('customer_location_add_submit') }}">
|
||||
<div class="m-portlet__body">
|
||||
<div class="form-group m-form__group row no-border">
|
||||
<label class="col-lg-3 col-form-label" data-field="code">
|
||||
Code:
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<input type="text" name="code" class="form-control m-input" value="{{ cust_location.getCode() }}">
|
||||
<div class="form-control-feedback hide" data-field="code"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<label class="col-lg-3 col-form-label" data-field="name">
|
||||
Name:
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<input type="text" name="name" class="form-control m-input" value="{{ cust_location.getName() }}">
|
||||
<div class="form-control-feedback hide" data-field="name"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-portlet__foot m-portlet__foot--fit">
|
||||
<div class="m-form__actions m-form__actions--solid m-form__actions--right">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
<a href="{{ url('customer_location_list') }}" class="btn btn-secondary">Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
$(function() {
|
||||
$("#row-form").submit(function(e) {
|
||||
var form = $(this);
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: form.prop('action'),
|
||||
data: form.serialize()
|
||||
}).done(function(response) {
|
||||
// remove all error classes
|
||||
removeErrors();
|
||||
swal({
|
||||
title: 'Done!',
|
||||
text: 'Your changes have been saved!',
|
||||
type: 'success',
|
||||
onClose: function() {
|
||||
window.location.href = "{{ url('customer_location_list') }}";
|
||||
}
|
||||
});
|
||||
}).fail(function(response) {
|
||||
if (response.status == 422) {
|
||||
var errors = response.responseJSON.errors;
|
||||
var firstfield = false;
|
||||
|
||||
// remove all error classes first
|
||||
removeErrors();
|
||||
|
||||
// display errors contextually
|
||||
$.each(errors, function(field, msg) {
|
||||
var formfield = $("[name='" + field + "']");
|
||||
var label = $("label[data-field='" + field + "']");
|
||||
var msgbox = $(".form-control-feedback[data-field='" + field + "']");
|
||||
|
||||
// add error classes to bad fields
|
||||
formfield.addClass('form-control-danger');
|
||||
label.addClass('has-danger');
|
||||
msgbox.html(msg).addClass('has-danger').removeClass('hide');
|
||||
|
||||
// check if this field comes first in DOM
|
||||
var domfield = formfield.get(0);
|
||||
|
||||
if (!firstfield || (firstfield && firstfield.compareDocumentPosition(domfield) === 2)) {
|
||||
firstfield = domfield;
|
||||
}
|
||||
});
|
||||
|
||||
// focus on first bad field
|
||||
firstfield.focus();
|
||||
|
||||
// scroll to above that field to make it visible
|
||||
$('html, body').animate({
|
||||
scrollTop: $(firstfield).offset().top - 200
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// remove all error classes
|
||||
function removeErrors() {
|
||||
$(".form-control-danger").removeClass('form-control-danger');
|
||||
$("[data-field]").removeClass('has-danger');
|
||||
$(".form-control-feedback[data-field]").addClass('hide');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<!-- BEGIN: Subheader -->
|
||||
<div class="m-subheader">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="mr-auto">
|
||||
<h3 class="m-subheader__title">
|
||||
Customer Locations
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END: Subheader -->
|
||||
<div class="m-content">
|
||||
<!--Begin::Section-->
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="m-portlet m-portlet--mobile">
|
||||
<div class="m-portlet__body">
|
||||
<div class="m-form m-form--label-align-right m--margin-top-20 m--margin-bottom-30">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-xl-8 order-2 order-xl-1">
|
||||
<div class="form-group m-form__group row align-items-center">
|
||||
<div class="col-md-4">
|
||||
<div class="m-input-icon m-input-icon--left">
|
||||
<input type="text" class="form-control m-input m-input--solid" placeholder="Search..." id="data-rows-search">
|
||||
<span class="m-input-icon__icon m-input-icon__icon--left">
|
||||
<span><i class="la la-search"></i></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4 order-1 order-xl-2 m--align-right">
|
||||
<a href="{{ url('customer_location_add_form') }}" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
|
||||
<span>
|
||||
<i class="la la-industry"></i>
|
||||
<span>New Customer Location</span>
|
||||
</span>
|
||||
</a>
|
||||
<div class="m-separator m-separator--dashed d-xl-none"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--begin: Datatable -->
|
||||
<div id="data-rows"></div>
|
||||
<!--end: Datatable -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
$(function() {
|
||||
var options = {
|
||||
data: {
|
||||
type: 'remote',
|
||||
source: {
|
||||
read: {
|
||||
url: '{{ url("customer_location_rows") }}',
|
||||
method: 'POST'
|
||||
}
|
||||
},
|
||||
saveState: {
|
||||
cookie: false,
|
||||
webstorage: false
|
||||
},
|
||||
pageSize: 10,
|
||||
serverPaging: true,
|
||||
serverFiltering: true,
|
||||
serverSorting: true
|
||||
},
|
||||
layout: {
|
||||
scroll: true
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
width: 30
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: 'Name'
|
||||
},
|
||||
{
|
||||
field: 'Actions',
|
||||
width: 110,
|
||||
title: 'Actions',
|
||||
sortable: false,
|
||||
overflow: 'visible',
|
||||
template: function (row, index, datatable) {
|
||||
var actions = '';
|
||||
|
||||
if (row.meta.update_url != '') {
|
||||
actions += '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" data-id="' + row.name + '" title="Edit"><i class="la la-edit"></i></a>';
|
||||
}
|
||||
|
||||
if (row.meta.delete_url != '') {
|
||||
actions += '<a href="' + row.meta.delete_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-danger m-btn--icon m-btn--icon-only m-btn--pill btn-delete" data-id="' + row.name + '" title="Delete"><i class="la la-trash"></i></a>';
|
||||
}
|
||||
|
||||
return actions;
|
||||
},
|
||||
}
|
||||
],
|
||||
search: {
|
||||
onEnter: false,
|
||||
input: $('#data-rows-search'),
|
||||
delay: 400
|
||||
}
|
||||
};
|
||||
|
||||
var table = $("#data-rows").mDatatable(options);
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
var url = $(this).prop('href');
|
||||
var id = $(this).data('id');
|
||||
var btn = $(this);
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
swal({
|
||||
title: 'Confirmation',
|
||||
html: 'Are you sure you want to delete <strong>' + id + '</strong>?',
|
||||
type: 'warning',
|
||||
showCancelButton: true
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url
|
||||
}).done(function(response) {
|
||||
table.row(btn.parents('tr')).remove();
|
||||
table.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
@ -560,24 +560,6 @@
|
|||
Location
|
||||
</h3>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
<label for="cust_location" data-field="cust_location"> Customer Location </label>
|
||||
<select class="form-control m-input" id="cust-location" name="cust_location">
|
||||
<option value=""></option>
|
||||
{% for id, label in cust_locations %}
|
||||
{% if obj.getCustomerLocation %}
|
||||
<option value="{{ id }}"{{ obj.getCustomerLocation.getID == id ? ' selected' }}>{{ label }}</option>
|
||||
{% else %}
|
||||
<option value="{{ id }}">{{ label }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-control-feedback hide" data-field="cust_location"></div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
<label data-field="delivery_address">Delivery Address</label>
|
||||
|
|
@ -772,10 +754,7 @@
|
|||
<!--<th class="text-right">Distance</th>
|
||||
<th class="text-right">Travel Time</th>
|
||||
-->
|
||||
<th class="text-right">Total Rider Count</th>
|
||||
<th class="text-right">On Duty</th>
|
||||
<th class="text-right">In Transit</th>
|
||||
<th class="text-right">Available</th>
|
||||
<th class="text-right">Available Riders</th>
|
||||
<th class="text-right">Job Order Count</th>
|
||||
<th class="text-right">Jobs For Assignment</th>
|
||||
<th class="text-right">Inventory</th>
|
||||
|
|
@ -785,7 +764,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr class="placeholder-row{{ hubs|length > 0 ? ' hide' }}">
|
||||
<td colspan="11">
|
||||
<td colspan="8">
|
||||
No items to display.
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -798,9 +777,6 @@
|
|||
<td class="text-right">{{ hub.duration ? hub.duration : '-' }}</td>
|
||||
-->
|
||||
<td class="text-right">{{ hub.rider_count }}</td>
|
||||
<td class="text-right">{{ hub.rider_logged_in|default('0') }}</td>
|
||||
<td class="text-right">{{ hub.rider_in_transit|default('0') }}</td>
|
||||
<td class="text-right">{{ hub.rider_available|default('0') }}</td>
|
||||
<td class="text-right">{{ hub.redis_jo_count }}</td>
|
||||
<td class="text-right">{{ hub.jo_count }}</td>
|
||||
<td class="text-right">{{ hub.inventory|default('0') }}</td>
|
||||
|
|
@ -906,64 +882,48 @@
|
|||
</h3>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-12">
|
||||
<label>Click on a row to select a rider</label>
|
||||
<div class="form-control-feedback hide" data-field="rider"></div>
|
||||
<div class="table-frame" data-name="rider">
|
||||
<table id="riders-table" class="table table-compact table-hover table-clickable table-vcenter m-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Contact No.</th>
|
||||
<th>Plate Number</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--
|
||||
{% set avail_riders = obj.getHub.getAvailableRiders|default([]) %}
|
||||
<tr class="placeholder-row{{ obj.getHub and avail_riders|length > 0 ? ' hide' }}">
|
||||
<td colspan="6">
|
||||
No riders available.
|
||||
</td>
|
||||
</tr>
|
||||
<div class="col-lg-12">
|
||||
<label>Click on a row to select a rider</label>
|
||||
<div class="form-control-feedback hide" data-field="rider"></div>
|
||||
<div class="table-frame" data-name="rider">
|
||||
<table id="riders-table" class="table table-compact table-hover table-clickable table-vcenter m-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Contact No.</th>
|
||||
<th>Plate Number</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set avail_riders = obj.getHub.getAvailableRiders|default([]) %}
|
||||
<tr class="placeholder-row{{ obj.getHub and avail_riders|length > 0 ? ' hide' }}">
|
||||
<td colspan="6">
|
||||
No riders available.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% if obj.getHub %}
|
||||
{% for rider in avail_riders %}
|
||||
<tr data-id="{{ rider.getID }}"{{ obj.getRider and obj.getRider.getID == rider.getID ? ' class="m-table__row--primary"' }}>
|
||||
<td>
|
||||
<div class="user-portrait-sm" style="background-image: url('{{ rider.getImageFile ? "/uploads/" ~ rider.getImageFile : "/assets/images/user.gif" }}');"></div>
|
||||
</td>
|
||||
<td>{{ rider.getFirstName }}</td>
|
||||
<td>{{ rider.getLastName }}</td>
|
||||
<td>{{ rider.getContactNumber }}</td>
|
||||
<td>{{ rider.getPlateNumber }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
-->
|
||||
{% if obj.getHub %}
|
||||
{% for key, data in rider_data %}
|
||||
<tr data-id="{{ key }}" {{ obj.getRider and obj.getRider.getID == key ? ' class="m-table__row--primary"' }}>
|
||||
<td>
|
||||
<div class="user-portrait-sm" style="background-image: url('{{ data['image_file'] ? "/uploads/" ~ data['image_file'] : "/assets/images/user.gif" }}');"></div>
|
||||
</td>
|
||||
<td> {{ data['first_name'] }} </td>
|
||||
<td> {{ data['last_name'] }} </td>
|
||||
<td> {{ data['contact_number'] }} </td>
|
||||
<td> {{ data['plate_number'] }} </td>
|
||||
<td> {{ data['status'] }} </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if obj.getHub %}
|
||||
{% for rider in avail_riders %}
|
||||
<tr data-id="{{ rider.getID }}"{{ obj.getRider and obj.getRider.getID == rider.getID ? ' class="m-table__row--primary"' }}>
|
||||
<td>
|
||||
<div class="user-portrait-sm" style="background-image: url('{{ rider.getImageFile ? "/uploads/" ~ rider.getImageFile : "/assets/images/user.gif" }}');"></div>
|
||||
</td>
|
||||
<td>{{ rider.getFirstName }}</td>
|
||||
<td>{{ rider.getLastName }}</td>
|
||||
<td>{{ rider.getContactNumber }}</td>
|
||||
<td>{{ rider.getPlateNumber }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,82 +0,0 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<!-- BEGIN: Subheader -->
|
||||
<div class="m-subheader">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="mr-auto">
|
||||
<h3 class="m-subheader__title">Job Order Raffle Report</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END: Subheader -->
|
||||
<div class="m-content">
|
||||
<!--Begin::Section-->
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<div class="m-portlet m-portlet--mobile">
|
||||
<div class="m-portlet__head">
|
||||
<div class="m-portlet__head-caption">
|
||||
<div class="m-portlet__head-title">
|
||||
<span class="m-portlet__head-icon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</span>
|
||||
<h3 class="m-portlet__head-text">
|
||||
Select a date range
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="row-form" autocomplete="off" class="m-form m-form--fit m-form--label-align-right m-form--group-seperator-dashed" method="post" action="{{ url('rep_jo_raffle_submit') }}">
|
||||
<div class="m-portlet__body">
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="input-daterange input-group" id="date-range">
|
||||
<input role="presentation" type="text" class="form-control m-input" name="date_start" placeholder="Start date" />
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="la la-ellipsis-h"></i></span>
|
||||
</div>
|
||||
<input role="presentation" type="text" class="form-control" name="date_end" placeholder="End date" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-portlet__foot m-portlet__foot--fit">
|
||||
<div class="m-form__actions m-form__actions--solid m-form__actions--right">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
$(function() {
|
||||
$("#date-range").datepicker({
|
||||
orientation: "bottom"
|
||||
});
|
||||
|
||||
$("#row-form").submit(function(e) {
|
||||
var form = $(this);
|
||||
|
||||
if (!$("[name='date_start']").val() || !$("[name='date_end']").val()) {
|
||||
e.preventDefault();
|
||||
|
||||
swal({
|
||||
title: 'Whoops!',
|
||||
text: 'Please fill in both date fields.',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<!-- BEGIN: Subheader -->
|
||||
<div class="m-subheader">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="mr-auto">
|
||||
<h3 class="m-subheader__title">Warranty Raffle Report</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END: Subheader -->
|
||||
<div class="m-content">
|
||||
<!--Begin::Section-->
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<div class="m-portlet m-portlet--mobile">
|
||||
<div class="m-portlet__head">
|
||||
<div class="m-portlet__head-caption">
|
||||
<div class="m-portlet__head-title">
|
||||
<span class="m-portlet__head-icon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</span>
|
||||
<h3 class="m-portlet__head-text">
|
||||
Select a date range
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="row-form" autocomplete="off" class="m-form m-form--fit m-form--label-align-right m-form--group-seperator-dashed" method="post" action="{{ url('rep_warranty_raffle_submit') }}">
|
||||
<div class="m-portlet__body">
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="input-daterange input-group" id="date-range">
|
||||
<input role="presentation" type="text" class="form-control m-input" name="date_start" placeholder="Start date" />
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="la la-ellipsis-h"></i></span>
|
||||
</div>
|
||||
<input role="presentation" type="text" class="form-control" name="date_end" placeholder="End date" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-portlet__foot m-portlet__foot--fit">
|
||||
<div class="m-form__actions m-form__actions--solid m-form__actions--right">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
$(function() {
|
||||
$("#date-range").datepicker({
|
||||
orientation: "bottom"
|
||||
});
|
||||
|
||||
$("#row-form").submit(function(e) {
|
||||
var form = $(this);
|
||||
|
||||
if (!$("[name='date_start']").val() || !$("[name='date_end']").val()) {
|
||||
e.preventDefault();
|
||||
|
||||
swal({
|
||||
title: 'Whoops!',
|
||||
text: 'Please fill in both date fields.',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
@ -233,13 +233,13 @@ $(function() {
|
|||
var batteryIds = [];
|
||||
var battMfgModelSize = []
|
||||
|
||||
{% for batt in obj.getActiveBatteries %}
|
||||
{% for batt in obj.getBatteries %}
|
||||
trow = {
|
||||
id: "{{ batt.getID }}",
|
||||
manufacturer: "{{ batt.getManufacturer.getName|default('') }} ",
|
||||
model: "{{ batt.getModel.getName|default('') }}",
|
||||
size: "{{ batt.getSize.getName|default('') }}",
|
||||
sell_price: "{{ batt.getSellingPrice }}",
|
||||
sell_price: "{{ batt.getSellingPrice }}"
|
||||
};
|
||||
|
||||
battRows.push(trow);
|
||||
|
|
|
|||
|
|
@ -182,54 +182,6 @@
|
|||
<div class="form-control-feedback hide" data-field="status"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-4">
|
||||
<label data-field="sales_invoice_number">
|
||||
Sales Invoice Number
|
||||
</label>
|
||||
<input type="text" name="sales_invoice_number" class="form-control m-input" value="{{ obj.getSalesInvoiceNumber }}" data-name="sales_invoice_number">
|
||||
<div class="form-control-feedback hide" data-field="sales_invoice_number"></div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<label data-field="outlet_name">
|
||||
Outlet Name
|
||||
</label>
|
||||
<input type="text" name="outlet_name" class="form-control m-input" value="{{ obj.getOutletName }}" data-name="outlet_name">
|
||||
<div class="form-control-feedback hide" data-field="outlet_name"></div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<label data-field="outlet_contact_number">
|
||||
Outlet Contact Number
|
||||
</label>
|
||||
<input type="text" name="outlet_contact_number" class="form-control m-input" value="{{ obj.getOutletContactNumber }}" data-name="outlet_contact_number">
|
||||
<div class="form-control-feedback hide" data-field="outlet_contact_number"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-12">
|
||||
<label data-field="outlet_address">
|
||||
Outlet Address
|
||||
</label>
|
||||
<textarea name="outlet_address" class="form-control m-input" data-name="outlet_address" rows="3">{{ obj.getOutletAddress }}</textarea>
|
||||
<div class="form-control-feedback hide" data-field="outlet_address"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
<label data-field="sender_name">
|
||||
Sender Name
|
||||
</label>
|
||||
<input type="text" name="sender_name" class="form-control m-input" value="{{ obj.getSenderName }}" data-name="sender_name">
|
||||
<div class="form-control-feedback hide" data-field="sender_name"></div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<label data-field="sender_contact_number">
|
||||
Sender Contact Number
|
||||
</label>
|
||||
<input type="text" name="sender_contact_number" class="form-control m-input" value="{{ obj.getSenderContactNumber }}" data-name="sender_contact_number">
|
||||
<div class="form-control-feedback hide" data-field="sender_contact_number"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-portlet__foot m-portlet__foot--fit">
|
||||
|
|
|
|||
|
|
@ -1,27 +1,27 @@
|
|||
# text
|
||||
title_login: Motolite Res-Q | Login
|
||||
block_title: Motolite Res-Q
|
||||
title_login: Yokohama Res-Q | Login
|
||||
block_title: Yokohama Res-Q
|
||||
control_panel_sign_in: Sign-in to Control Panel
|
||||
alt_image_logo_login: Res-Q
|
||||
alt_image_dashboard: Motolite
|
||||
copyright: Motolite Res-Q
|
||||
battery_size_tradein_brand: Trade-in Motolite
|
||||
alt_image_dashboard: Yokohama
|
||||
copyright: Yokohama Res-Q
|
||||
battery_size_tradein_brand: Trade-in Yokohama
|
||||
battery_size_tradein_premium: Trade-in Premium
|
||||
battery_size_tradein_other: Trade-in Other
|
||||
battery_size_tradein_lazada: Trade-in Lazada
|
||||
add_cust_vehicle_battery_info: This vehicle is using a Motolite battery
|
||||
jo_title_pdf: Motolite Res-Q Job Order
|
||||
add_cust_vehicle_battery_info: This vehicle is using a Yokohama battery
|
||||
jo_title_pdf: Yokohama Res-Q Job Order
|
||||
country_code_prefix: '+63'
|
||||
delivery_instructions_label: Delivery Instructions
|
||||
no_inventory_message: No stock for [item_display]
|
||||
|
||||
# images
|
||||
image_logo_login: /assets/images/logo-resq.png
|
||||
icon_login: /assets/demo/default/media/img/logo/favicon.ico
|
||||
icon_base_32x32: /assets/images/favicon/favicon-32x32.png
|
||||
icon_base_16x16: /assets/images/favicon/favicon-16x16.png
|
||||
image_dashboard: /assets/images/logo-motolite.png
|
||||
image_jo_pdf: /public/assets/images/logo-resq.png
|
||||
image_logo_login: /yokohama_login.png
|
||||
icon_login: /assets/favicon/favicon.ico
|
||||
icon_base_32x32: /assets/favicon/favicon-32x32.png
|
||||
icon_base_16x16: /assets/favicon/favicon-16x16.png
|
||||
image_dashboard: /yokohama_logo.png
|
||||
image_jo_pdf: /public/yokohama_login.png
|
||||
|
||||
# default point for maps
|
||||
default_lat: 14.6091
|
||||
|
|
@ -29,8 +29,8 @@ default_long: 121.0223
|
|||
default_region: ph
|
||||
|
||||
# warranty text
|
||||
warranty_register_confirm: Congratulations! Your warranty has been successfully registered! Read about Motolite's privacy policy at https://www.motolite.com/privacy/.
|
||||
warranty_update_confirm: Congratulations! Your warranty has been successfully updated! Read about Motolite's privacy policy at https://www.motolite.com/privacy/.
|
||||
warranty_register_confirm: Congratulations! Your warranty has been successfully registered! Read about Yokohama's privacy policy at https://www.motolite.com/privacy/.
|
||||
warranty_update_confirm: Congratulations! Your warranty has been successfully updated! Read about Yokohama's privacy policy at https://www.motolite.com/privacy/.
|
||||
|
||||
# labels
|
||||
label.pdf.jo_number: 'JO Number:'
|
||||
|
|
@ -71,10 +71,10 @@ label.pdf.emp_id_ref: 'Emp. ID/Card No./Ref. By:'
|
|||
label.pdf.discount: 'DISCOUNT:'
|
||||
label.pdf.discount_type: 'Discount Type:'
|
||||
label.pdf.final_amount: 'FINAL AMOUNT:'
|
||||
label.jo.vehicle_battery: 'This vehicle is using a Motolite battery'
|
||||
label.jo.vehicle_battery: 'This vehicle is using a Yokohama battery'
|
||||
|
||||
# messages
|
||||
message.partial_warrantysms: ') has expired already. Please call MOTOLITE EXPRESS HATID at 8370-6686 to have the status of your battery checked to avoid any inconvenience. Thank you for choosing Motolite.'
|
||||
message.partial_warrantysms: ') has expired already. Please call MOTOLITE EXPRESS HATID at 8370-6686 to have the status of your battery checked to avoid any inconvenience. Thank you for choosing Yokohama.'
|
||||
message.battery_brand_allcaps: 'MOTOLITE'
|
||||
message.confirmation_code: 'Your Resq confirmation code is'
|
||||
message.joborder_completed: 'Your Resq job order has been completed.'
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
-- MySQL dump 10.19 Distrib 10.3.36-MariaDB, for Linux (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: resq
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 10.3.36-MariaDB
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `customer_location`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `customer_location`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `customer_location` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`name` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `cust_location_idx` (`code`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `customer_location`
|
||||
--
|
||||
|
||||
LOCK TABLES `customer_location` WRITE;
|
||||
/*!40000 ALTER TABLE `customer_location` DISABLE KEYS */;
|
||||
INSERT INTO `customer_location` VALUES (1,'residence','Residence'),(2,'office','Office'),(3,'on_the_road','On the Road'),(4,'commercial','Commercial');
|
||||
/*!40000 ALTER TABLE `customer_location` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2023-02-23 8:03:35
|
||||
|
|
@ -11,7 +11,7 @@ use MicrosoftAzure\Storage\Common\ServiceException;
|
|||
// $blob_url = 'https://popappshopprodstorage.blob.core.windows.net';
|
||||
$blob_url = 'https://motivstorageaccount.blob.core.windows.net';
|
||||
|
||||
$sas_token = 'sp=r&st=2022-08-30T03:39:37Z&se=2030-09-30T11:39:37Z&sv=2021-06-08&sr=c&sig=9eETL%2F%2B2mbOPtW%2Fa4dZBnC8s61NwJpPZu6tsJS7frmk%3D';
|
||||
$sas_token = 'sp=r&st=2022-06-16T04:09:13Z&se=2030-06-16T12:09:13Z&spr=https&sv=2021-06-08&sr=c&sig=x26qUFEMIqg4JgTCVHoDv%2FtTqCprjogEqtOsTpBjkWA%3D';
|
||||
|
||||
$conn_string = "BlobEndpoint=$blob_url;\nSharedAccessSignature=$sas_token";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
# get the number fo warranty serial files to process
|
||||
declare -i num_files
|
||||
|
||||
num_files=`/var/www/resq/bin/console warrantyserial:count`
|
||||
|
||||
for (( i = 1; i <= num_files; i++ ))
|
||||
do
|
||||
/usr/bin/php /var/www/resq/bin/console warrantyserial:load
|
||||
done
|
||||
92
yokohama_battery_vehicle_results.csv
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
Manufacturer,"Vehicle Model","Year Model","Battery Size","Battery Model",Status,Reason
|
||||
Manufacturer,MODELS,"Year Model","Available PBI Std Size (JIS/DIN/BCI)","Recommended Brand (Yokohama)","NOT ADDED","Could not find battery - AVAILABLE PBI STD SIZE (JIS/DIN/BCI) - RECOMMENDED BRAND (YOKOHAMA)"
|
||||
"BUILD YOUR DREAM (BYD)","F0 Gli","2009 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
CHEVROLET,"AVEO 1.2 L MT (HATCHBACK)","2004 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
CHEVROLET,"AVEO 1.2 LS AT (HATCHBACK)","2004 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
CHEVROLET,"AVEO 1.2 LS MT (HATCHBACK)","2004 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
CHEVROLET,"AVEO 1.4 SEDAN AT","2004 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
CHEVROLET,"AVEO 1.4 SEDAN MT","2004 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
DAEWOO,CIELO,"1996 - 1999","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
DAEWOO,ESPERO,"1995 - 1999","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
DAEWOO,RACER,"1994 - 1999","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
FIAT,"UNO (All Models)","1992 - 1996","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
FORD,"ESCAPE 2.3L","2001 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
FORD,"EVEREST T6 3.2 Titanium","2015 - 2019","LB4 / D31","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - LB4 / D31 - YOKOHAMA SUPER PREMIUM MF"
|
||||
FORD,"EVEREST T6 2.2 Ambiente, Trend, Titanium","2015 - 2019","LB3 / D31","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - LB3 / D31 - YOKOHAMA SUPER PREMIUM MF"
|
||||
FORD,"LYNX (All Trims)","1998 - 2004","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
FOTON,GRATOUR,"2016 - 2019","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HAIMA,M3,"2013 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HAIMA,HAIMA7,"2013 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HONDA,"ACCORD 2.0L/2.2VTEC","1998 - 2002","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HONDA,"ACCORD 3.0L","2003 - 2007","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HYUNDAI,"ELANTRA GLS 1.6 CRDi","1996 - 2009","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HYUNDAI,"COUPE GLS 2.0 GAS AT","1996 - 2007","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HYUNDAI,"COUPE GLS 2.7 V6 AT","1996 - 2007","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HYUNDAI,Excel,"1993 - 1999","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
HYUNDAI,"GRAND STAREX CRDi VGT","2007 - 2018","D31 / 3SMF / N70 / R","YOKOHAMA PLATINUM MF","NOT ADDED","Could not find battery - D31 / 3SMF / N70 / R - YOKOHAMA PLATINUM MF"
|
||||
HYUNDAI,i20,"2008 - 2014","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
ISUZU,"NHR / NKR / NPR / NQR","2003 - 2017","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
ISUZU,QKR,"2018 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
ISUZU,"NLR / NMR / NPR / FVR / FRR","2018 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
ISUZU,"TROOPER (gasoline)","1996 - 2005","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
KIA,"CARENS 2.0 Li GAS EX AT","2006 - 2013","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
KIA,"KIA FORTE","2008 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
KIA,PRIDE,"1990 - 2000","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
"LAND ROVER",Freelander,"1996 - 2014","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
LEXUS,LS460,"2001 - 2017","D31 / 3SMF / N70 / R","YOKOHAMA PLATINUM MF","NOT ADDED","Could not find battery - D31 / 3SMF / N70 / R - YOKOHAMA PLATINUM MF"
|
||||
LEXUS,LX570,"1995 - 2021","D31 / 3SMF / N70 / R","YOKOHAMA PLATINUM MF","NOT ADDED","Could not find battery - D31 / 3SMF / N70 / R - YOKOHAMA PLATINUM MF"
|
||||
,UX200,"2019 - 2021","LN2 / DIN65","YOKOHAMA PLATINUM MF","NOT ADDED","No manufacturer provided."
|
||||
MAZDA,323,"1993 - 2002","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MAZDA,626,"1993 - 2001","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MAZDA,ASTINA,"1989 - 1994","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MAZDA,"CX - 7","2006 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MAZDA,"MAZDA 3","2004 - 2014","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MAZDA,"POWER VAN E2000 GS 2L","1992 - 1999","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"ASX 2.0 (All Trims)","2011 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"EXCEED (gasoline)","1986 - 1994","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"FUZION GLS SPORTS","2007 - 2010","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,GRANDIS,"2005 - 2011","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"L300 (SL20MY)","2019 - 2021","D31 / 3SMF / N70 / R","YOKOHAMA PLATINUM MF","NOT ADDED","Could not find battery - D31 / 3SMF / N70 / R - YOKOHAMA PLATINUM MF"
|
||||
MITSUBISHI,"LANCER (box type)","1983 - 1988","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"LANCER GLXI / GLX / GSR / SOHC*","1989 - 2000","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"LANCER EX (GS41; GLX/MX/GT/GT-A/Ralli-Art)","2007 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"MIRAGE HB / MIRAGE G4","2013 - 2019","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"OUTLANDER GLX","2001 - 2006","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
MITSUBISHI,"SPACE GEAR","1994 - 2007","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"AD RESORT (gasoline)","1994 - 1996","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"ALTIMA (U13 Bluebird)","1993 - 1996","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"ALTIMA (L33)","2012 - 2020","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,BLUEBIRD,"1990 - 1993","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"CEDRIC BROUGHAM","2002 - 2004","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,CEFIRO,"1989 - 1994","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,MAXIMA,"1987 - 1991","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"SENTRA (ALL VARIANTS)","1991 - 2012","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,SYLPHY,"2015 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"SERENA 250 L","2004 - 2013","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"SUNNY PICK UP","1991 - 1997","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"TEANA 2.3 L 230 JK","2003 - 2008","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"TEANA 2.3 L 230 JM","2009 - 2013","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,VANETTE,"1985 - 1994","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"X-TRAIL (T30 ALL VARIANTS)","2001 - 2008","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"X-TRAIL (T31 ALL VARIANTS)","2009 - 2014","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"X-TRAIL (T32 ALL VARIANTS)","2014 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,"JUKE 1.6","2016 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,350Z,"2002 - 2009","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
NISSAN,370Z,"2009 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
PROTON,"WIRA 1.6","1994 - 1998","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
PROTON,"WIRA 1.3GLi, 1.5 Gli","1994 - 1998","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
SUBARU,"FORESTER 2.0","2007 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
SUBARU,LEGACY,"2008 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
SUBARU,IMPREZA,"2009 - 2019","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
SUBARU,"IMPREZA 2.5 WRX","2009 - 2019","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
SUBARU,"LEVORG 2.0GT-S CVT","2014 - 2019","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
SUBARU,"XV 2.0i CVT","2012 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"ALPHARD 2.4 (Gasoline)","2010 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"COROLLA E90, E100, E110 (Altis),","1974 - 1994","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"CORONA T170, T190","1990 - 1998","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,TAMARAW,"1976 - 1986","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"TAMARAW REVO (Gas)","1997 - 2007","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"INNOVA (Gas High)","2007 - 2015","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"RAV-4 (XA10, XA20, XA30, XA40) 2.0Li and 2.4Li Gas","1994 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"AT 86","2012 - 2021","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
TOYOTA,"RAV 4","1996 - 2018","B23 / 1SMF / NS50","YOKOHAMA SUPER PREMIUM MF","NOT ADDED","Could not find battery - B23 / 1SMF / NS50 - YOKOHAMA SUPER PREMIUM MF"
|
||||
|