jobRecord->$param) ? $this->jobRecord->$param : $default; } /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getStockSubParam($ref, $param, $default) { $ref = !is_null($this->jobRecord->$ref) ? $this->jobRecord->$ref : null; return is_object($ref) ? $ref->$param : $default; } /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getValuationParam($param, $default) { return !is_null($this->jobRecord->valuation) && !is_null($this->jobRecord->valuation->$param) ? $this->jobRecord->valuation->$param : $default; } /** * Build the content. */ public function build() { #-> Set data item to work with. $authData = \Utility\Registry::getAuthData(); $this->jobRecord = $this->_input['jobRecord']; $recordId = $this->_input['contract']->PdfTemplate['recordId']; if(!empty($recordId) && '' != $recordId) { $result = $this->em->createQuery( 'SELECT tuhpi ' . 'FROM \Stock\Entity\Tuhpi tuhpi ' . 'JOIN tuhpi.stock stock ' . 'WHERE tuhpi.id = :id ' . 'ORDER BY tuhpi.created ASC ' ) ->setParameter( 'id' , $recordId ); } else { $result = $this->em->createQuery( 'SELECT tuhpi ' . 'FROM \Stock\Entity\Tuhpi tuhpi ' . 'JOIN tuhpi.stock stock ' . 'WHERE stock.id = :stockId ' . ' AND IDENTITY(tuhpi.company) = :companyId ' . 'ORDER BY tuhpi.created ASC ' ) ->setParameter( 'stockId' , $this->jobRecord->id ) ->setParameter( 'companyId' , $authData['company']['id'] ); } // $result = $this->em->createQuery( // 'SELECT tuhpi ' // . 'FROM \Stock\Entity\Tuhpi tuhpi ' // . 'JOIN tuhpi.stock stock ' // . 'WHERE stock.id = :stockId ' // . ' AND IDENTITY(tuhpi.company) = :companyId ' // . 'ORDER BY tuhpi.created ASC ' // ) // ->setParameter( 'stockId' , $this->jobRecord->id ) // ->setParameter( 'companyId' , $authData['company']['id'] ) // ->getResult(); $result = $result->getResult(); foreach ($result as $data) { $companyProfileOffice = $data->company->contact->office; $companyProfilefax = $data->company->contact->fax; $companyRegion = $data->company->region->name; $companyCity = $data->company->city->name; $companyPostalCode = $data->company->postalCode; $companyStreet = $data->company->street; $companyDealerType = $data->company->dealerType; $companyClientType = $data->company->clientType; $companyCompanyRegistrationNumber = $data->company->companyRegistrationNumber; $companyBusinessName = $data->company->businessName; $f_financeProvider = $data->f_financeProvider; $f_financeBranch = $data->f_financeBranch; $f_agreementOrAccountNumber = $data->f_agreementOrAccountNumber; $f_agreementType = $data->f_agreementType; $f_telephoneNumber = $data->f_telephoneNumber; $f_resultCode = $data->f_resultCode; $fh_data = unserialize($data->fh_data); $ah_data = unserialize($data->ah_data); $si_policeStation = $data->si_policeStation; $si_caseNumber = $data->si_caseNumber; $si_dateStolen = $data->si_dateStolen; $si_vinMatch = $data->si_vinMatch; $si_engineMatch = $data->si_engineMatch; $si_registrationMatch = $data->si_registrationMatch; $si_resultCode = $data->si_resultCode; $ai_company = $data->ai_company; $ai_referenceNumber = $data->ai_referenceNumber; $ai_alertReason = $data->ai_alertReason; $ai_telephoneNumber = $data->ai_telephoneNumber; $ai_resultCode = $data->ai_resultCode; $ivid_responseCode = $data->ivid_responseCode; $ivid_responseDescription = $data->ivid_responseDescription; $ivid_referenceNumber = $data->ivid_referenceNumber; $ivid_contactNumber = $data->ivid_contactNumber; $ivid_resultCode = $data->ivid_resultCode; $mi_company = $data->mi_company; $mi_referenceNumber = $data->mi_referenceNumber; $mi_contactNumber = $data->mi_contactNumber; $mi_dateApplied = $data->mi_dateApplied; $mi_resultCode = $data->mi_resultCode; $vesa_certificateNumber = $data->vesa_CertificateNumber; $vesa_dateFitted = $data->vesa_dateFitted; $vesa_brandName = $data->vesa_brandName; $vesa_brandModel = $data->vesa_brandModel; $vesa_deviceDescriptionType = $data->vesa_deviceDescriptionType; $vesa_resultCode = $data->vesa_resultCode; $rh_data = unserialize($data->rh_data); $eh_data = unserialize($data->eh_data); $mh_data = unserialize($data->mh_data); $vc_month = $data->vc_month; $vc_year = $data->vc_year; $vc_newOptionCode = $data->vc_newOptionCode; $vc_usedOptionCode = $data->vc_usedOptionCode; $vc_maximumRange = $data->vc_maximumRange; $vc_minimunRange = $data->vc_minimunRange; $vc_newPrice = $data->vc_newPrice; $vc_retailPrice = $data->vc_retailPrice; $vc_tradePrice = $data->vc_tradePrice; $vc_resultCode = $data->vc_resultCode; $vvi_guideMonth = $data->vvi_guideMonth; $vvi_guideYear = $data->vvi_guideYear; $vvi_newListPrice = $data->vvi_newListPrice; $vvi_retailPrice = $data->vvi_retailPrice; $vvi_tradePrice = $data->vvi_tradePrice; $vvi_costPrice = $data->vvi_costPrice; $vvi_adjustedRetailPrice_mileageAndCondition = $data->vvi_adjustedRetailPrice_mileageAndCondition; $vvi_AdjustedTradePrice_MileageAndCondition = $data->vvi_AdjustedTradePrice_MileageAndCondition; $vvi_adjustedRetailPrice = $data->vvi_adjustedRetailPrice; $vvi_adjustedTradePrice = $data->vvi_adjustedTradePrice; $vvi_estimatedRetailPrice = $data->vvi_estimatedRetailPrice; $vvi_estimatedTradePrice = $data->vvi_estimatedTradePrice; $vvi_estimatedCostPrice = $data->vvi_estimatedCostPrice ; $vvi_adjustedEstimatedRetailPrice_mileageAndCondition = $data->vvi_adjustedEstimatedRetailPrice_mileageAndCondition = 0; $vvi_adjustedEstimatedTradePrice_mileageAndCondition = $data->vvi_adjustedEstimatedTradePrice_mileageAndCondition = 0; $vvi_adjustedEstimatedCostPrice_mileageAndCondition = $data->vvi_adjustedEstimatedCostPrice_mileageAndCondition = 0; $vvi_adjustedEstimatedRetailPrice = $data->vvi_adjustedEstimatedRetailPrice; $vvi_adjustedEstimatedTradePrice = $data->vvi_adjustedEstimatedTradePrice; $vvi_adjustedEstimatedCostPrice = $data->vvi_adjustedEstimatedCostPrice; $vvi_resultCode = $data->vvi_resultCode; $error_code = $data->error_code; } $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat(); $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix(); $authData = \Utility\Registry::getAuthData(); $msg = 'NO RECORD FOUND ON OUR DATABASE'; //\Utility\Debug::errorLog('$authData', $authData['']); $test = '* Year of Manufacturer - The year of manufacture and the year of first registration normally coincides. If not, the difference is caused by vehicles being manufactured/imported late in one year but being sold and first registered as new in a later year. TransUnion HPI is a registered financial services provider (22938). _______________________________________________________________________________________________________________________ Please check this confirmation carefully to ensure that you enquired on the correct VIN/Engine number. Should you have any queries, please contact Customer Services at: (0861) 507 507 Report Date: 2014/08/15 11:22 AM '; $dateOfPrint = 'Date of print HPI: ' . date('Y-m-d H:i:s') . ''; $printedBy = 'Printed by HPI: ' . $authData['firstName'] . ' ' . $authData['familyName'] . ''; $referenceNo = 'Reference no.: ' . $this->jobRecord->referenceNumber . ''; $this->_logo = '

TRANSUNION REPORT

'; /* --------------------------------- USER, TransUnion --------------------------------- */ $type = $this->jobRecord->type; $intro =' Adobe Acrobat 11 Pro
FOR ATTENTION :
' . $companyBusinessName . ' TransUnion
User : ' . $authData['firstName']. ' ' . $authData['familyName'] . ' Reg. No. 94/04014/07
' . $companyStreet . ' P.O. Box 1240
Randburg
' . $companyRegion . ' 2125
' . $companyCity . '
' . $companyPostalCode . '
Tel: ' . $companyProfileOffice . ' Tel: (0861) 504 504
Fax:' . $companyProfilefax . ' Fax: (0861) 506 506
Client Reference No.: Reference No.: ' . $this->jobRecord->referenceNumber . '
Date of Enquiry : ' . date('Y-m-d H:i:s') . '

Thank you for your enquiry. The information you have submitted has been checked against our records, the result of the search is displayed below.

TransUnion Vehicle Enquiry

'; $this->append($intro); /* $container = $this ->newTable( array(30, 5, 30, 5, 30), 'margin:0;font-size:10px;vertical-align:top;', '', 'padding:10px 0 0 0;' ) ->setCellValue(0, 0, $intro); $this->append($container->publish()); */ /* --------------------------------- INFORMATION SUPPLIED / INFORMATION VERIFIED --------------------------------- */ $vehicleInfo ='
INFORMATION SUPPLIED INFORMATION VERIFIED
Manufacturer : ' . $type->model->make->name . ' ' . $data->vci_matchManufacturer . ' 
Model Description: ' . $type->name . ' ' . $data->vci_matchModel . ' 
VIN or Chassis No. : ' . $this->getStockParam('vinNumber', '') . ' ' . $data->vci_matchVinorChassis . ' 
Engine No. : ' . $this->getStockParam('engineNumber', '') . ' ' . $data->vci_matchEngineNumber . ' 
Registration No. : ' . $this->getStockParam('registrationNumber', '') . ' ' . $data->vci_matchVehicleRegistration . ' 
Colour : ' . $this->getStockSubParam('exteriorColour', 'name', '') . ' ' . $data->vci_matchColour . ' 
Year of Manufacture : ' . $this->getStockSubParam('vehicleYear', 'name', '') . ' ' . $data->vci_matchYear . ' 

' . $data->vci_matchString . ' 


ADDITIONAL INFORMATION REGISTERED
'; $this->append($vehicleInfo); /* --------------------------------- FINANCE INTEREST --------------------------------- */ $financeIntrest ='

FINANCE INTEREST

Finance Provider : ' . $f_financeProvider . '
Finance Branch : ' . $f_financeBranch . '
Agreement Or Account Number: ' . $f_agreementOrAccountNumber . '
Agreement Type: ' . $f_agreementType . '
Telephone Number: ' . $f_telephoneNumber . '
Result Code: ' . $f_resultCode . '

'; if ($f_financeProvider == '' || $f_financeBranch == '' || $f_agreementOrAccountNumber == '' || $f_agreementType == '' || $f_telephoneNumber == '') { $msgHeading = '

FINANCE INTEREST

'; $this->append($msgHeading); $this->append($msg . '

'); } else { $this->append($financeIntrest); } //$this->_page++; /* --------------------------------- FINANCE HISTORY INTEREST --------------------------------- */ $financeHistoryIntrest = '

FINANCE HISTORY INTEREST

'; foreach ($fh_data as $fh) { $resultCodeFh = isset($fh['resultCode']) ? $fh['resultCode'] : ''; $financeHistoryIntrest .= ' '; } if (empty($fh_data)) { $financeHistoryIntrest .= ''; } $financeHistoryIntrest .= '
Finance House : ' . $fh['financeHouse'] . '
Agreement Or Account Number: ' . $fh['agreementOrAccountNumber'] . '
Agreement Type: ' . $fh['agreementType'] . '
Telephone Number: ' . $fh['telephoneNumber'] . '
Start Date : ' . $fh['startDate'] . '
End Date : ' . $fh['endDate'] . '
Result Code: ' . $resultCodeFh . '

' . $msg . '

'; $this->append($financeHistoryIntrest); //$this->_page++; /* --------------------------------- POLICE STOLEN INTEREST --------------------------------- */ $policeStolen ='

POLICE STOLEN INTEREST

Description Status Police Station SAP Case Number Date Stolen Vin Match Engine Match Registration Match
Successful Enquiry ' . $si_resultCode . ' ' . $si_policeStation . ' ' . $si_caseNumber . ' ' . $si_dateStolen . ' ' . $si_vinMatch . ' ' . $si_engineMatch . ' ' . $si_registrationMatch . '

'; if ($si_resultCode == '' || $si_policeStation == '' || $si_caseNumber == '' || $si_dateStolen == '' || $si_dateStolen == '' || $si_vinMatch == '' || $si_engineMatch == '' || $si_registrationMatch == '' ) { $msgHeading = '

POLICE STOLEN INTEREST

'; $this->append($msgHeading); $this->append(''); $this->append('
' . $msg . '

'); } else { $this->append($policeStolen); } // $this->_page++; /* --------------------------------- ACCIDENT HISTORY --------------------------------- */ $emptyLine ='
Description

'; $this->append($emptyLine); $accidentHistory = '

ACCIDENT HISTORY

'; foreach ($ah_data as $ah) { $accidentHistory .= ' '; } if (empty($ah_data)) { $financeHistoryIntrest .= ''; } $accidentHistory .= '
Assessment Date: ' . $ah['assessmentDate'] . '
Vehicle Description: ' . $ah['vehicleDescription'] . '
Vin Match: ' . $ah['vinMatch'] . '
Reg Match: ' . $ah['regMatch'] . '
Estimated Repair Cost: ' . $ah['estimatedRepairCost'] . '
Result Code: ' . $ah['resultCode'] . '

' . $msg . '

'; $this->append($accidentHistory); //$this->_page++; /* --------------------------------- MICRODOT --------------------------------- */ $microdot ='

MICRODOT

Company: ' . $mi_company . '
Reference Number: ' . $mi_referenceNumber . '
Contact Number: ' . $mi_contactNumber . '
Date Applied: ' . $mi_dateApplied . '
Result Code: ' . $mi_resultCode . '

'; if ($mi_company == '' || $mi_referenceNumber == '' || $mi_contactNumber == '' || $mi_dateApplied = '') { $msgHeading = '

MICRODOT

'; $this->append($msgHeading); $this->append($msg . '

'); } else { $this->append($microdot); } /* --------------------------------- VESA SECURITY DEVICE HISTORY --------------------------------- */ $vesaInformation =' 

VESA SECURITY DEVICE HISTORY

Certificate Number: ' . $vesa_certificateNumber . '
Date Fitted: ' . $vesa_dateFitted . '
Brand Name: ' . $vesa_brandName . '
Brand Model: ' . $vesa_brandModel . '
Device Description Type: ' . $vesa_deviceDescriptionType . '
Result Code: ' . $vesa_resultCode . '

'; if ($vesa_certificateNumber == '' || $vesa_dateFitted == '' || $vesa_brandName == '' || $vesa_brandModel = '' || $vesa_deviceDescriptionType == '') { $msgHeading = '

VESA SECURITY DEVICE HISTORY

'; $this->append($msgHeading); $this->append($msg . '

'); } else { $this->append($vesaInformation); } //$this->_page++; /* --------------------------------- MILEAGES --------------------------------- */ $mileage = '

 

MILEAGES

'; foreach ($mh_data as $mh) { $resultCodeMh = isset($fh['resultCode']) ? $fh['resultCode'] : ''; $mileage .= ' '; } if (empty($mh_data)) { $financeHistoryIntrest .= ''; } $mileage .= '
Source: ' . $mh['source'] . '
Vehicle Mileage: ' . $mh['vehicleMileage'] . '
Date Registered: ' . $mh['dateRegistered'] . '
Result Code: ' . $resultCodeMh . '

' . $msg . '

'; $this->append($mileage); /* --------------------------------- PREVIOUS INQUIRIES --------------------------------- */ $enquiryHistory = '

PREVIOUS INQUIRIES

'; foreach ($eh_data as $eh) { $enquiryHistory .= ' '; } if (empty($eh_data)) { $financeHistoryIntrest .= ''; } $enquiryHistory .= '
Customer type: ' . $eh['source'] . '
Transaction Date: ' . $eh['transactionDate'] . '

' . $msg . '

'; $this->append($enquiryHistory); /* --------------------------------- PREVIOUS REGISTRATIONS --------------------------------- */ $registrationHistory = '

PREVIOUS REGISTRATIONS

'; foreach ($rh_data as $rh) { $registrationHistory .= ' '; } if (empty($rh_data)) { $financeHistoryIntrest .= ''; } $registrationHistory .= '
Registration Number: ' . $rh['registrationNumber'] . '
Date Registered ' . $rh['dateRegistered'] . '

' . $msg . '

'; $this->append($registrationHistory); //$this->_page++; /* --------------------------------- IVID RESPONSE x --------------------------------- */ $vesaInformation ='

IVID RESPONSE

Code Description IVID Reference Number IVID Contact Number
' . $ivid_responseCode . ' ' . $ivid_responseDescription . ' ' . $ivid_referenceNumber . ' ' . $ivid_contactNumber . '

'; if ($ivid_responseCode == '' || $ivid_responseDescription == '' || $ivid_referenceNumber == '' || $ivid_contactNumber == '') { $msgHeading = '

IVID RESPONSE

'; $this->append($msgHeading); $this->append($msg . '

'); } else { $this->append($vesaInformation); } /* --------------------------------- SIGNATURES --------------------------------- */ #-> Signatures. /* if ($this->showSignatureLines) { $this->append( $this->newSignatureLine() ->addSignatureLine('Customer (name)', 'Signature', 'Date') ->addSignatureLine('Manager (name)', 'Signature', 'Date') ->publish() ); } $this->append( '
' . '' . '' . '' . '' . '' . '' . '' . '' . '
' . $dateOfPrint . ' ' . $printedBy . ' ' . $referenceNo . '
' . '
' ); */ /* $this->append( '
' . '' . '' . '' . '' . '' . '' . '' . '' . '
' . $dateOfPrint . ' ' . $printedBy . ' ' . $referenceNo . '
' . '
' ); */ return; } }