Merge branch '329-transition-branch-for-cmb-and-resq-merging' of gitlab.com:jankstudio/resq into 336-trans-method-to-check-if-new-battery

This commit is contained in:
Korina Cordero 2020-02-12 01:41:50 +00:00
commit 4f9e7959b5
35 changed files with 1211 additions and 1065 deletions

2079
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -158,48 +158,48 @@ services:
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
# CMB invoice generator
#App\Service\InvoiceGenerator\CMBInvoiceGenerator: ~
App\Service\InvoiceGenerator\CMBInvoiceGenerator: ~
# Resq invoice generator
App\Service\InvoiceGenerator\ResqInvoiceGenerator: ~
#App\Service\InvoiceGenerator\ResqInvoiceGenerator: ~
# invoice generator interface
#App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\CMBInvoiceGenerator"
App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\ResqInvoiceGenerator"
App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\CMBInvoiceGenerator"
#App\Service\InvoiceGeneratorInterface: "@App\\Service\\InvoiceGenerator\\ResqInvoiceGenerator"
# Resq job order generator
App\Service\JobOrderHandler\ResqJobOrderHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
# CMB job order generator
#App\Service\JobOrderHandler\CMBJobOrderHandler:
#App\Service\JobOrderHandler\ResqJobOrderHandler:
# arguments:
# $country_code: "%env(COUNTRY_CODE)%"
#job order generator interface
#App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\CMBJobOrderHandler"
App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\ResqJobOrderHandler"
# CMB customer generator
#App\Service\CustomerHandler\CMBCustomerHandler:
# arguments:
# $country_code: "%env(COUNTRY_CODE)%"
# Resq customer generator
App\Service\CustomerHandler\ResqCustomerHandler:
# CMB job order generator
App\Service\JobOrderHandler\CMBJobOrderHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
#job order generator interface
App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\CMBJobOrderHandler"
#App\Service\JobOrderHandlerInterface: "@App\\Service\\JobOrderHandler\\ResqJobOrderHandler"
# CMB customer generator
App\Service\CustomerHandler\CMBCustomerHandler:
arguments:
$country_code: "%env(COUNTRY_CODE)%"
# Resq customer generator
#App\Service\CustomerHandler\ResqCustomerHandler:
# arguments:
# $country_code: "%env(COUNTRY_CODE)%"
# customer generator interface
#App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\CMBCustomerHandler"
App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\ResqCustomerHandler"
App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\CMBCustomerHandler"
#App\Service\CustomerHandlerInterface: "@App\\Service\\CustomerHandler\\ResqCustomerHandler"
# rider assignment
#App\Service\RiderAssignmentHandler\CMBRiderAssignmentHandler: ~
# rider assignment interface
#App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler"
App\Service\RiderAssignmentHandlerInterface: "@App\\Service\\RiderAssignmentHandler\\CMBRiderAssignmentHandler"
# rider API service
App\Service\RiderAPIHandler\CMBRiderAPIHandler:

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\JobOrder;
@ -17,9 +17,9 @@ class AdjustLongLatCommand extends Command
{
protected $em;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $em)
{
$this->em = $om;
$this->em = $em;
parent::__construct();
}

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Battery;
@ -18,7 +18,7 @@ class ComputeWarrantyExpiryDateCommand extends Command
protected $em;
protected $wh;
public function __construct(ObjectManager $em, WarrantyHandler $wh)
public function __construct(EntityManagerInterface $em, WarrantyHandler $wh)
{
$this->em = $em;
$this->wh = $wh;

View file

@ -8,7 +8,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Warranty;
use App\Entity\Customer;
@ -33,7 +33,7 @@ class CreateCustomerFromWarrantyCommand extends Command
protected $cvu_mfg_id;
protected $cvu_brand_id;
public function __construct(ObjectManager $em, $cvu_mfg_id, $cvu_brand_id)
public function __construct(EntityManagerInterface $em, $cvu_mfg_id, $cvu_brand_id)
{
$this->em = $em;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\JobOrder;
use App\Entity\JOEvent;
@ -22,7 +22,7 @@ class FulfillOldJobOrderCommand extends Command
{
protected $em;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\JobOrder;
use App\Entity\JOEvent;
@ -22,7 +22,7 @@ class FulfillPendingJobOrderCommand extends Command
{
protected $em;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\VehicleManufacturer;
use App\Entity\Vehicle;
@ -21,7 +21,7 @@ class GenerateBatteryCompatibilityCommand extends Command
protected $em;
protected $vmfg_index;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\JobOrder;
use App\Entity\Warranty;
@ -25,7 +25,7 @@ class GenerateWarrantyFromJobOrderCommand extends Command
protected $sapbatt_hash;
protected $warranties_hash;
public function __construct(ObjectManager $em)
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use CrEOF\Spatial\PHP\Types\Geometry\Point;
use DateTime;
@ -30,7 +30,7 @@ class ImportBatteryPriceCommand extends Command
protected $em;
protected $size_index;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;
$this->size_index = [];

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Battery;
use App\Entity\BatteryManufacturer;
@ -27,7 +27,7 @@ class ImportCMBBatteryDataCommand extends Command
protected $bsize_hash;
protected $batt_hash;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\BatterySize;
@ -20,7 +20,7 @@ class ImportCMBBatteryTradeInPriceCommand extends Command
protected $bsize_hash;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\BatteryManufacturer;
use App\Entity\BatteryModel;
@ -50,7 +50,7 @@ class ImportCMBVehicleCompatibilityCommand extends Command
protected $vmanu_hash;
protected $vmake_hash;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use DateTime;
@ -49,7 +49,7 @@ class ImportCustomerCommand extends Command
protected $mfg_index;
protected $vehicle_index;
public function __construct(ObjectManager $em)
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
$this->populateMfgIndex();

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Warranty;
use App\Entity\Battery;
@ -44,7 +44,7 @@ class ImportLegacyJobOrderCommand extends Command
protected $row_max_field_size;
protected $data_max_field_size;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Outlet;
use App\Entity\Hub;
@ -19,7 +19,7 @@ class ImportOutletsCommand extends Command
{
private $object_manager;
public function __construct(ObjectManager $om, ValidatorInterface $validator)
public function __construct(EntityManagerInterface $om, ValidatorInterface $validator)
{
$this->object_manager = $om;
$this->validator = $validator;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use CrEOF\Spatial\PHP\Types\Geometry\Point;
use DateTime;
@ -34,7 +34,7 @@ class ImportPartnersCommand extends Command
protected $em;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\SAPBattery;
use App\Entity\SAPBatteryBrand;
@ -22,7 +22,7 @@ class ImportSAPBatteryCommand extends Command
private $batt_size_hash;
private $batt_brand_hash;
public function __construct(ObjectManager $em)
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
$this->initBatteryHash();

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use CrEOF\Spatial\PHP\Types\Geometry\Point;
use DateTime;
@ -35,7 +35,7 @@ class ImportVehicleBatteryCommand extends Command
protected $batt_index;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;
$this->vmfg_index = [];

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use CrEOF\Spatial\PHP\Types\Geometry\Point;
use DateTime;
@ -28,7 +28,7 @@ class ImportVehicleCompatibilityCommand extends Command
protected $bsize_index;
protected $b_index;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;
$this->vmfg_index = [];

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Vehicle;
@ -15,7 +15,7 @@ class MergeDuplicateVehiclesCommand extends Command
{
protected $em;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;

View file

@ -8,7 +8,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\DBAL\Connection;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Service\JobOrderCache;
use App\Entity\JobOrder;
use App\Ramcar\JOStatus;
@ -21,7 +21,7 @@ class RefreshJobOrderCacheCommand extends Command
protected $em;
protected $jo_cache;
public function __construct(ObjectManager $om, JobOrderCache $jo_cache)
public function __construct(EntityManagerInterface $om, JobOrderCache $jo_cache)
{
$this->em = $om;
$this->jo_cache = $jo_cache;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use DateTime;
@ -21,7 +21,7 @@ class ReportRiderTime extends Command
protected $jo_index;
protected $filtered_jo_index;
public function __construct(ObjectManager $em)
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;

View file

@ -6,7 +6,7 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Service\RedisClientProvider;
@ -17,7 +17,7 @@ class SeedRiderSessionsCommand extends Command
protected $em;
protected $redis;
public function __construct(ObjectManager $om, RedisClientProvider $redis)
public function __construct(EntityManagerInterface $om, RedisClientProvider $redis)
{
$this->em = $om;
$this->redis = $redis->getRedisClient();

View file

@ -8,7 +8,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Customer;
use App\Entity\PrivacyPolicy;
@ -22,7 +22,7 @@ class SetCustomerPrivacyPolicyCommand extends Command
private $policy_third_party_id;
private $policy_mobile_id;
public function __construct(ObjectManager $om, $policy_promo,
public function __construct(EntityManagerInterface $om, $policy_promo,
$policy_third_party, $policy_mobile)
{
$this->em = $om;

View file

@ -7,8 +7,6 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use App\Service\APNSClient;
use DateTime;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\JobOrder;
@ -18,7 +18,7 @@ class UpdateCustomerVehicleBatteryCommand extends Command
protected $em;
protected $custvehicle_hash;
public function __construct(ObjectManager $om)
public function __construct(EntityManagerInterface $om)
{
$this->em = $om;
$this->custvehicle_hash = [];

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Warranty;
use App\Entity\CustomerVehicle;
@ -19,7 +19,7 @@ class UpdateCustomerVehicleWarrantyCommand extends Command
protected $em;
protected $wh;
public function __construct(ObjectManager $em, WarrantyHandler $wh)
public function __construct(EntityManagerInterface $em, WarrantyHandler $wh)
{
$this->em = $em;
$this->wh = $wh;

View file

@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\Rider;
use App\Entity\Battery;
@ -20,7 +20,7 @@ class UploadCleanupCommand extends Command
private $encoder_factory;
private $object_manager;
public function __construct(ObjectManager $om, Filesystem $fs, FileUploader $uploader)
public function __construct(EntityManagerInterface $om, Filesystem $fs, FileUploader $uploader)
{
$this->object_manager = $om;
$this->filesystem = $fs;

View file

@ -8,7 +8,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\User;
use App\Entity\Role;
@ -18,7 +18,7 @@ class UserCreateCommand extends Command
private $encoder_factory;
private $object_manager;
public function __construct(EncoderFactoryInterface $ef, ObjectManager $om)
public function __construct(EncoderFactoryInterface $ef, EntityManagerInterface $om)
{
$this->encoder_factory = $ef;
$this->object_manager = $om;

View file

@ -909,7 +909,7 @@ class JobOrderController extends Controller
$this->denyAccessUnlessGranted('jo_onestep.edit', null, 'No access.');
$error_array = [];
$error_array = $jo_handler->generateOneStepJobOrder($req, $id);
$error_array = $jo_handler->processOneStepJobOrder($req, $id);
// check if any errors were found
if (!empty($error_array)) {

View file

@ -444,7 +444,8 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
->setColor('')
->setStatusCondition('')
->setFuelType('')
->setActive();
->setActive()
->setWarrantyCode($req->request->get('warranty_code'));
if (($req->request->get('service_type')) == CMBServiceType::BATTERY_REPLACEMENT_NEW)
{
@ -480,6 +481,11 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
{
$jo->setCustomerVehicle($cust_vehicle);
$jo->setCustomer($cust_vehicle->getCustomer());
// save serial into cv
$cust_vehicle->setWarrantyCode($req->request->get('warranty_code'));
$em->persist($cust_vehicle);
}
}
}
@ -893,8 +899,11 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
// save to customer vehicle battery record
$this->updateVehicleBattery($obj);
// validated! save the entity
$em->flush();
// save serial to customer vehicle
$cust_vehicle = $obj->getCustomerVehicle();
$cust_vehicle->setWarrantyCode($req->request->get('warranty_code'));
$em->persist($cust_vehicle);
// get rider
$rider = $obj->getRider();
@ -909,7 +918,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
// create the warranty if new battery only
if ($obj->getServiceType () == CMBServiceType::BATTERY_REPLACEMENT_NEW)
{
$serial = null;
$serial = $req->request->get('warranty_code') ;
$warranty_class = $obj->getWarrantyClass();
$first_name = $obj->getCustomer()->getFirstName();
$last_name = $obj->getCustomer()->getLastName();
@ -945,6 +954,9 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
$this->wh->createWarranty($serial, $plate_number, $first_name, $last_name, $mobile_number, $batt_list, $date_purchase, $warranty_class);
}
}
// validated! save the entity
$em->flush();
}
}
@ -2301,6 +2313,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
// warranty expiration
// use GetWarrantyPrivate for passenger warranty
$warr_months = 0;
$warr = $jo->getWarrantyClass();
if ($warr == CMBWarrantyClass::WTY_PASSENGER)
$warr_months = $battery->getWarrantyPrivate();

View file

@ -526,7 +526,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
// create warranty
if($this->jo_handler->checkIfNewBattery($jo))
{
$serial = null;
$serial = $jo->getCustomerVehicle()->getWarrantyCode();
$warranty_class = $jo->getWarrantyClass();
$first_name = $jo->getCustomer()->getFirstName();
$last_name = $jo->getCustomer()->getLastName();

View file

@ -122,6 +122,9 @@
"ocramius/proxy-manager": {
"version": "2.2.0"
},
"php": {
"version": "7.2"
},
"predis/predis": {
"version": "v1.1.1"
},
@ -185,6 +188,9 @@
"symfony/dotenv": {
"version": "v4.0.2"
},
"symfony/error-handler": {
"version": "v4.4.4"
},
"symfony/event-dispatcher": {
"version": "v4.0.2"
},

View file

@ -211,7 +211,7 @@
</div>
<div class="col-lg-3">
<label data-field="warranty_code">Serial Number</label>
<input type="text" name="warranty_code" id="warranty-code" class="form-control m-input" value="{{ obj.getCustomerVehicle ? obj.getCustomerVehicle.getWarrantyCode }}" data-vehicle-field="1" disabled>
<input type="text" name="warranty_code" id="warranty-code" class="form-control m-input" value="{{ obj.getCustomerVehicle ? obj.getCustomerVehicle.getWarrantyCode }}">
<div class="form-control-feedback hide" data-field="warranty_code"></div>
</div>
<div class="col-lg-3">
@ -1109,7 +1109,7 @@ $(function() {
$("#warranty-code").val(vdata.battery.warranty_code);
$("#warranty-expiration").val(vdata.battery.warranty_expiration);
} else {
$("#current-battery, #warranty-code, #warranty-expiration").val("No current battery").css('color', '#f4516c');
$("#current-battery, #warranty-expiration").val("No current battery").css('color', '#f4516c');
}
})
}).focus();