6 class TuhpiAccident extends \Utility\Service\PdfTemplate
14 protected $_title = 'HPI Accident Only Report';
16 * @var \Stock\Entity\Stock
23 protected $showCustomerDetails = false;
27 protected $showValuationDetails = false;
31 protected $showPricingDetails = false;
35 protected $showVehicleDetails = false;
39 protected $showVehicleNotes = false;
43 protected $showDamageDetails = false;
47 protected $showAccessoryDetails = false;
51 protected $showSignatureLines = false;
55 protected $showTermsAndConditions = false;
59 protected $showOffersReceived = false;
63 protected $showOfferMade = false;
67 * Utility for easy parameter retrieval.
68 * @param string $param
69 * @param unknown $default
72 protected function getStockParam($param, $default)
74 return !is_null($this->jobRecord->$param)
75 ? $this->jobRecord->$param
80 * Utility for easy parameter retrieval.
81 * @param string $param
82 * @param unknown $default
85 protected function getStockSubParam($ref, $param, $default)
87 $ref = !is_null($this->jobRecord->$ref)
88 ? $this->jobRecord->$ref
90 return is_object($ref)
96 * Utility for easy parameter retrieval.
97 * @param string $param
98 * @param unknown $default
101 protected function getValuationParam($param, $default)
103 return !is_null($this->jobRecord->valuation)
104 && !is_null($this->jobRecord->valuation->$param)
105 ? $this->jobRecord->valuation->$param
113 public function build()
115 ini_set('memory_limit','-1');
117 #-> Set data item to work with.
118 $authData = \Utility\Registry::getAuthData();
120 $this->jobRecord = $this->_input['jobRecord'];
122 $recordId = $this->_input['contract']->PdfTemplate['recordId'];
124 if(!empty($recordId) && '' != $recordId)
126 $result = $this->em->createQuery(
128 . 'FROM \Stock\Entity\Tuhpi tuhpi '
129 . 'JOIN tuhpi.stock stock '
130 . 'WHERE tuhpi.id = :id '
131 . 'ORDER BY tuhpi.created ASC '
133 ->setParameter( 'id' , $recordId );
137 $result = $this->em->createQuery(
139 . 'FROM \Stock\Entity\Tuhpi tuhpi '
140 . 'JOIN tuhpi.stock stock '
141 . 'WHERE stock.id = :stockId '
142 . ' AND IDENTITY(tuhpi.company) = :companyId '
143 . 'ORDER BY tuhpi.created ASC '
145 ->setParameter( 'stockId' , $this->jobRecord->id )
146 ->setParameter( 'companyId' , $authData['company']['id'] );
150 // \Utility\Debug::errorLog('$result->getSQL()',$result->getSQL());
151 // \Utility\Debug::errorLog('$result->getParameters()',$result->getParameters());
153 $result = $result->getResult();
155 foreach ($result as $data)
158 // \Utility\Debug::errorLog('$data->id',$data->id);
160 $companyProfileOffice = $data->company->contact->office;
161 $companyProfilefax = $data->company->contact->fax;
162 $companyRegion = $data->company->region->name;
163 $companyCity = $data->company->city->name;
164 $companyPostalCode = $data->company->postalCode;
165 $companyStreet = $data->company->street;
168 // \Utility\Debug::errorLog('$data->ah_data',$data->ah_data);
170 $ah_data = unserialize($data->ah_data);
175 $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
176 $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix();
177 $authData = \Utility\Registry::getAuthData();
178 $msg = 'NO RECORD FOUND ON OUR DATABASE';
180 //\Utility\Debug::errorLog('$authData', $authData['']);
182 // $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
183 // manufactured/imported late in one year but being sold and first registered as new in a later year.
184 // TransUnion HPI is a registered financial services provider (22938).
185 // _______________________________________________________________________________________________________________________
186 // Please check this confirmation carefully to ensure that you enquired on the correct VIN/Engine number. Should you have any queries, please contact
187 // Customer Services at: (0861) 507 507
188 // Report Date: 2014/08/15 11:22 AM ';
190 // $dateOfPrint = 'Date of print HPI: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>';
191 // $printedBy = 'Printed by HPI: <span style="color:#333;">' . $authData['firstName']
192 // . ' ' . $authData['familyName'] . '</span>';
193 // $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->referenceNumber . '</span>';
197 // <h1 style="font-size:20px; margin:0 auto; text-align:center">TRANSUNION REPORT</h1>
198 // <div style="width:100%"></div>
200 // <div style="display:block; width:115px; height:82px; margin-left:640px; margin-top:-40px; " >
201 // <img style="" width="115px" height="82px" src="' . __DIR__ . '/../../../../../public/img/app/logos/tuhpi.jpg" style="padding:0;margin:0;width:100%;" />
208 // <img width="53" height="67" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/logo.png"/>
209 // <div style="padding-left: 1pt;text-indent: 0pt;text-align: left;margin-top: 25px;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 20.5pt;">
211 // <span style=" color: #00a6d2;margin-left:-10px;">Union</span>
212 // <span style="color: #B8C8C3;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 5pt;margin-left:-7px;" >®</span>
217 <div style="text-align: left;margin-bottom: 25px;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 20.5pt;">
218 <img width="261" height="50" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/TULogo_blue.jpg"/>
223 /* --------------------------------- USER, TransUnion --------------------------------- */
226 // $type = $this->jobRecord->type;
228 <div style="background-image:linear-gradient(to bottom,#d6d0c4,white 20%);position: relative;">
229 <table style="width:100%;margin-top:-20px;">
231 <td style="width:70%;">
232 <p style="line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;">
233 Wanderers Office Park, 52 Corlett Drive, lllovo, 2196
235 <p style="margin-top:-1px;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;">
236 P O Box 4522, Johannesburg, 2000
239 <td style="width:30%;">
240 <p style="text-indent: 50%;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;">
242 <a href="http://www.transunion.co.za/" target="_blank" style="color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;">
246 <p style="margin-top:-1px;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt">
247 Call Centre: 0861 504 504
249 <p style="margin-top:-1px;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt">
251 <a href="mailto:dealersguide@transunion.co.za" style="color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;">
252 dealersguide@transunion.co.za
258 <p style="line-height: 20pt;text-align: left;color: #04a6cd;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 18pt;">
259 Vehicle Accident Report
261 <table style="width:90%;text-align: left;margin-top:-20px;">
263 <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
266 <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
267 ' . $authData['firstName']. ' ' . $authData['familyName'] . '
271 <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
274 <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
275 ' . $companyProfileOffice . '
279 <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
282 <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
283 ' . $companyProfilefax . '
287 <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
290 <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
291 ' . $companyStreet . ' ' . $companyRegion . ' ' . $companyCity . ' ' . $companyPostalCode . '
295 <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
298 <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;">
299 ' . date('Y-m-d H:i:s') . '
304 <div style="width:90%;margin-top:50pt;">
305 <p style="text-indent: 0pt;line-height: 56%;text-align: left;">
306 <img width="26" height="27" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_012.jpg"/>
307 <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;">
308 Thank you for your enquiry. The vehicle description you have submitted has been checked against our records, the result of the search is displayed below.
311 <span style="text-indent: 0pt;text-align: left;padding-top:5px;"></span>
312 <p style="text-indent: 0pt;line-height: 56%;text-align: left;">
313 <img width="29" height="26" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_013.jpg"/>
314 <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;">
315 To assist you we have added details explanations in each section.
318 <span style="text-indent: 0pt;text-align: left;padding-top:5px;"></span>
319 <p style="text-indent: 0pt;line-height: 56%;text-align: left;">
320 <img width="26" height="27" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_012.jpg"/>
321 <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;">
322 Should you have any queries please contact TransUnion on 0861 482 482 from Monday to Friday
323 08h00 -17h00 and Saturday 08h00 -13h00.
326 <span style="text-indent: 0pt;text-align: left;padding-top:5px;"></span>
327 <p style="text-indent: 0pt;line-height: 56%;text-align: left;">
328 <img width="29" height="26" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_013.jpg"/>
329 <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;">
330 By accessing and relying on this report you are deemed to have read and agreed to AIS's terms and conditions as reflected at
331 <a href="http://www.motoronline.co.za/portal/page?_pageid=0,4049541,0_8493546&_dad=portal30&_schema=PORTAL30" target="_blank" style="color: #050505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;">
332 http://www.motoronline.co.za/portal/page?_pageid=0,4049541,0_8493546&_dad=portal30&_schema=PORTAL30
338 <div style="width:90%;margin-top:300pt;">
339 <p style="text-indent: 0pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;">
340 Registered with the National Credit Regulator - Reg Number NCRCB4
345 $this->append($intro);
346 /* $container = $this
348 array(30, 5, 30, 5, 30),
349 'margin:0;font-size:10px;vertical-align:top;',
351 'padding:10px 0 0 0;'
353 ->setCellValue(0, 0, $intro);
355 $this->append($container->publish()); */
358 /* --------------------------------- INFORMATION SUPPLIED / INFORMATION VERIFIED --------------------------------- */
364 // $this->append($vehicleInfo);
367 /* --------------------------------- ACCIDENT HISTORY --------------------------------- */
369 $accidentHistory = '<br />
370 <div style="margin-top:50pt;"></div>
371 <div style="height: 30px;background-image:linear-gradient(to right,#9bb5c4,white 80%);"></div>
372 <p style="margin-left: 20pt;text-align: left;margin-top: -45px; color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 18pt;">
373 Car Accident History Report
376 <li style="margin-left: 20px;color: #04a6cd;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 12pt;">
377 <span style="-webkit-border-radius: 0px 99px 99px 20px;-moz-border-radius: 0px 99px 99px 20px;border-radius: 0px 99px 99px 20px;max-width: 500px !important;padding-right: 10%;">
378 VEHICLE DETAILS SUPPLIED
380 <table style="width:90%;text-align: left;margin-left: -30px;margin-top: 10px;" >
382 <td style="width:30%;">
383 <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
387 <td style="width:70%;">
388 <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
389 ' . $this->getStockParam('vinNumber', '') . '
394 <td style="width:30%;">
395 <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
399 <td style="width:70%;">
400 <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
401 ' . $this->getStockParam('engineNumber', '') . '
406 <td style="width:30%;">
407 <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
411 <td style="width:70%;">
412 <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
413 ' . $this->getStockParam('registrationNumber', '') . '
419 <li style="margin-left: 20px;padding-top: 20px;color: #04a6cd;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 12pt;">
420 <span style="-webkit-border-radius: 0px 99px 99px 20px;-moz-border-radius: 0px 99px 99px 20px;border-radius: 0px 99px 99px 20px;max-width: 500px !important;padding-right: 10%;">
426 // \Utility\Debug::errorLog('$ah_data',$ah_data);
429 if (!empty($ah_data))
431 $accidentHistory .= '
432 <table style="width:100%;text-align: left;margin-left: -30px;margin-top: 10px;" >
434 <td style="width:15%;">
435 <span style="margin-top:-17px;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
439 <td style="width:15%;">
440 <span style="text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
441 <p>Assessment Date</p>
444 <td style="width:20%;">
445 <span style="text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
446 <p>Vehicle Description</p>
449 <td style="width:15%;">
450 <span style="margin-top:-17px;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
454 <td style="width:15%;">
455 <span style="margin-top:-17px;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
459 <td style="width:20%;">
460 <span style="text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;">
461 <p>Repair Cost Indicator</p>
468 foreach ($ah_data as $ah)
470 \Utility\Debug::errorLog('$ah',$ah);
472 $accidentHistory .= '
474 <td style="width:15%;">
475 <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;">
476 ' . $ah['source'] . '
479 <td style="width:15%;">
480 <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;">
481 ' . str_replace('T',' ',$ah['assessmentDate']) . '
484 <td style="width:20%;">
485 <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;">
486 ' . $ah['vehicleDescription'] . '
489 <td style="width:15%;">
490 <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;">
491 ' . $ah['vinMatch'] . '
494 <td style="width:15%;">
495 <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;">
496 ' . $ah['regMatch'] . '
499 <td style="width:20%;">
500 <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;">
501 ' . $ah['estimatedRepairCost'] . '
510 $accidentHistory .= '<table style="width:90%;text-align: left;margin-left: -30px;margin-top: 10px;" >
512 <td style="width:90%;">
513 <p style="text-indent: 0pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 12pt;">
520 $accidentHistory .= '
525 $this->append($accidentHistory);