Add branch code to capi and mobile requests. Add branch code to Warranty Details Report. #597

This commit is contained in:
Korina Cordero 2021-07-22 07:52:18 +00:00
parent bc80cc91ea
commit b9a6109c78
3 changed files with 12 additions and 3 deletions

View file

@ -3164,6 +3164,7 @@ class APIController extends Controller implements LoggedController
'warr_card' => $warr_card_url, 'warr_card' => $warr_card_url,
'dealer_name' => $warr->getDealerName() ?? '', 'dealer_name' => $warr->getDealerName() ?? '',
'dealer_address' => $warr->getDealerAddress() ?? '', 'dealer_address' => $warr->getDealerAddress() ?? '',
'branch_code' => $warr->getDealerBranchCode() ?? '',
]; ];
} }
else else
@ -3185,6 +3186,7 @@ class APIController extends Controller implements LoggedController
'warr_card' => '', 'warr_card' => '',
'dealer_name' => '', 'dealer_name' => '',
'dealer_address' => '', 'dealer_address' => '',
'branch_code' => '',
]; ];
} }
} }
@ -3207,6 +3209,7 @@ class APIController extends Controller implements LoggedController
'warr_card' => '', 'warr_card' => '',
'dealer_name' => '', 'dealer_name' => '',
'dealer_address' => '', 'dealer_address' => '',
'branch_code' => '',
]; ];
} }
@ -3253,6 +3256,7 @@ class APIController extends Controller implements LoggedController
'date_purchase' => $other_data['date_purchase'], 'date_purchase' => $other_data['date_purchase'],
'dealer_name' => $other_data['dealer_name'], 'dealer_name' => $other_data['dealer_name'],
'dealer_address' => $other_data['dealer_address'], 'dealer_address' => $other_data['dealer_address'],
'branch_code' => $other_data['branch_code'],
'message' => [ 'message' => [
'register_error' => 'Warranty serial code has already been registered.', 'register_error' => 'Warranty serial code has already been registered.',
'edit_error' => 'Sorry, warranty is registered under another vehicle not in your list of vehicles.', 'edit_error' => 'Sorry, warranty is registered under another vehicle not in your list of vehicles.',
@ -3464,6 +3468,7 @@ class APIController extends Controller implements LoggedController
->setCustomerAddress($req->request->get('cust_address')) ->setCustomerAddress($req->request->get('cust_address'))
->setDealerName($req->request->get('dealer_name')) ->setDealerName($req->request->get('dealer_name'))
->setDealerAddress($req->request->get('dealer_address')) ->setDealerAddress($req->request->get('dealer_address'))
->setDealerBranchCode($req->request->get('branch_code'))
->setValidated(false); ->setValidated(false);
// TODO: check for date purchase and date expire // TODO: check for date purchase and date expire

View file

@ -211,6 +211,7 @@ class CustomerWarrantyController extends APIController
'vmodel' => $warr->getVehicleModelYear(), 'vmodel' => $warr->getVehicleModelYear(),
'dealer_name' => $warr->getDealerName(), 'dealer_name' => $warr->getDealerName(),
'dealer_address' => $warr->getDealerAddress(), 'dealer_address' => $warr->getDealerAddress(),
'branch_code' => $warr->getDealerBranchCode(),
'province_id' => $warr->getProvinceID(), 'province_id' => $warr->getProvinceID(),
'municipality_id' => $warr->getMunicipalityID(), 'municipality_id' => $warr->getMunicipalityID(),
]; ];
@ -238,6 +239,7 @@ class CustomerWarrantyController extends APIController
'vmodel' => '', 'vmodel' => '',
'dealer_name' => '', 'dealer_name' => '',
'dealer_address' => '', 'dealer_address' => '',
'branch_code' => '',
'province_id' => '', 'province_id' => '',
'municipality_id' => '', 'municipality_id' => '',
]; ];
@ -289,6 +291,7 @@ class CustomerWarrantyController extends APIController
'vmodel' => $other_data['vmodel'], 'vmodel' => $other_data['vmodel'],
'dealer_name' => $other_data['dealer_name'], 'dealer_name' => $other_data['dealer_name'],
'dealer_address' => $other_data['dealer_address'], 'dealer_address' => $other_data['dealer_address'],
'branch_code' => $other_data['branch_code'],
'province_id' => $other_data['province_id'], 'province_id' => $other_data['province_id'],
'municipality_id' => $other_data['municipality_id'], 'municipality_id' => $other_data['municipality_id'],
]; ];
@ -537,12 +540,11 @@ class CustomerWarrantyController extends APIController
->setDatePurchaseCustomer($date_pur_cust) ->setDatePurchaseCustomer($date_pur_cust)
->setContactNumber($req->request->get('contact_num')) ->setContactNumber($req->request->get('contact_num'))
->setCustomerAddress($req->request->get('cust_address')) ->setCustomerAddress($req->request->get('cust_address'))
->setDealerName($req->request->get('dealer_name'))
->setDealerAddress($req->request->get('dealer_address'))
->setVehicle($vehicle) ->setVehicle($vehicle)
->setVehicleModelYear($req->request->get('vmodel')) ->setVehicleModelYear($req->request->get('vmodel'))
->setDealerName($req->request->get('dealer_name')) ->setDealerName($req->request->get('dealer_name'))
->setDealerAddress($req->request->get('dealer_address')) ->setDealerAddress($req->request->get('dealer_address'))
->setDealerBranchCode($req->request->get('branch_code'))
->setCustomer($cust) ->setCustomer($cust)
->setValidated(false) ->setValidated(false)

View file

@ -749,6 +749,7 @@ class ReportController extends Controller
'Warranty File Card', 'Warranty File Card',
'Warranty Vehicle Model Year', 'Warranty Vehicle Model Year',
'Warranty Odometer', 'Warranty Odometer',
'Warranty Dealer Branch Code',
'Warranty Dealer Name', 'Warranty Dealer Name',
'Warranty Dealer Address', 'Warranty Dealer Address',
'Warranty Contact Number', 'Warranty Contact Number',
@ -1553,7 +1554,7 @@ class ReportController extends Controller
w.warranty_privacy_policy, w.bty_model_id, w.bty_size_id, w.warranty_privacy_policy, w.bty_model_id, w.bty_size_id,
w.email as w_email, w.vehicle_id, w.customer_id, w.file_invoice, w.email as w_email, w.vehicle_id, w.customer_id, w.file_invoice,
w.file_warr_card, w.v_model_year, w.odometer, w.dealer_name, w.file_warr_card, w.v_model_year, w.odometer, w.dealer_name,
w.dealer_address, w.contact_num, w.cust_address, w.dealer_address, w.dealer_branch_code, w.contact_num, w.cust_address,
w.date_purchase_cust, w.flag_validated, w.province_id, w.date_purchase_cust, w.flag_validated, w.province_id,
w.municipality_id, w.create_source AS w_create_source, c.id AS c_id, w.municipality_id, w.create_source AS w_create_source, c.id AS c_id,
c.first_name AS c_fname, c.last_name AS c_lname, c.flag_confirmed, c.first_name AS c_fname, c.last_name AS c_lname, c.flag_confirmed,
@ -1651,6 +1652,7 @@ class ReportController extends Controller
'warr_file_warr_card' => $row['file_warr_card'], 'warr_file_warr_card' => $row['file_warr_card'],
'warr_v_model_year' => $row['v_model_year'], 'warr_v_model_year' => $row['v_model_year'],
'warr_odometer' => $row['odometer'], 'warr_odometer' => $row['odometer'],
'warr_dealer_branch_code' => $row['dealer_branch_code'],
'warr_dealer_name' => $row['dealer_name'], 'warr_dealer_name' => $row['dealer_name'],
'warr_dealer_address' => $row['dealer_address'], 'warr_dealer_address' => $row['dealer_address'],
'warr_contact_number' => $row['contact_num'], 'warr_contact_number' => $row['contact_num'],