2 namespace Valuation\Pdf;
6 class Complete extends \Utility\Service\PdfTemplate
14 protected $_title = 'Stock Information';
16 * @var \Stock\Entity\Stock
22 protected $showSalesDataOnly = false;
26 protected $showTradeDataOnly = false;
30 protected $showShortVehicleDetails = false;
34 protected $showCustomerDetails = true;
38 protected $showValuationDetails = true;
42 protected $showPricingDetails = true;
46 protected $showVehicleDetails = true;
50 protected $showVehicleNotes = true;
54 protected $showDamageDetails = true;
58 protected $showAccessoryDetails = true;
62 protected $showSignatureLines = true;
66 protected $showTermsAndConditions = true;
70 protected $showOffersReceived = true;
74 protected $showOfferMade = true;
78 * Utility for easy parameter retrieval.
79 * @param string $param
80 * @param unknown $default
83 protected function getStockParam($param, $default)
85 return !is_null($this->jobRecord->$param)
86 ? $this->jobRecord->$param
91 * Utility for easy parameter retrieval.
92 * @param string $param
93 * @param unknown $default
96 protected function getStockSubParam($ref, $param, $default)
98 $ref = !is_null($this->jobRecord->$ref)
99 ? $this->jobRecord->$ref
101 return is_object($ref)
107 * Utility for easy parameter retrieval.
108 * @param string $param
109 * @param unknown $default
112 protected function getValuationParam($param, $default)
114 return !is_null($this->jobRecord->valuation)
115 && !is_null($this->jobRecord->valuation->$param)
116 ? $this->jobRecord->valuation->$param
124 public function build()
126 #-> Set data item to work with.
127 $this->jobRecord = $this->_input['jobRecord']->stock;
128 $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
129 $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix();
130 $authData = \Utility\Registry::getAuthData();
131 $dateOfPrint = 'Date of print: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>';
132 $printedBy = 'Printed by: <span style="color:#333;">' . $authData['firstName']
133 . ' ' . $authData['familyName'] . '</span>';
134 $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->referenceNumber . '</span>';
137 /* --------------------------------- CUSTOMER, VALUATION, PRICING --------------------------------- */
138 $type = $this->jobRecord->type;
140 '<br /><div style="font-size:16px;font-weight:bold;">'
141 . $type->model->make->name . ' '
142 . $type->model->name . ' '
144 . $type->introYear->name . ' - '
145 . (!is_null($type->discYear) ? $type->discYear->name : 'Current') . ')'
146 . '</div><hr /><br />'
150 /* --------------------------------- CUSTOMER, VALUATION, PRICING --------------------------------- */
152 $customerDetail = ' ';
153 if ($this->showCustomerDetails)
155 $table = $this->newTable(
157 'padding:0;margin:0;font-size:10px;',
159 'padding:2px 3px 2px 0;margin:0;'
161 $department = $this->getValuationParam('department', null);
162 $department = !is_null($department)
166 ->addTitle('Customer', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
167 ->addKeyValueDataSet(array(
168 'Customer name:' => $this->getValuationParam('firstName', ''),
169 'Customer surname:' => $this->getValuationParam('familyName', ''),
170 'ID:' => $this->getValuationParam('idNumber', ''),
171 'Mobile:' => $this->getValuationParam('mobile', ''),
172 'Email:' => $this->getValuationParam('email', ''),
173 'Department:' => $department,
174 ' ' => ' ',
175 'Address:' => ' ',
176 '<span style="color:#FFF;font-size:20px;">a1</span>' => ' ',
177 '<span style="color:#FFF;font-size:10px;">1</span><span style="color:#000;font-size:10px;">______________________________________</span>' => ' ',
178 '<span style="color:#FFF;font-size:20px;">a</span>' => ' ',
179 '<span style="color:#FFF;font-size:10px;">2</span><span style="color:#000;font-size:10px;">______________________________________</span>' => ' ',
180 '<span style="color:#FFF;font-size:20px;">b</span>' => ' ',
181 '<span style="color:#FFF;font-size:10px;">3</span><span style="color:#000;font-size:10px;">______________________________________</span>' => ' '
183 ), 0, 'font-weight:bold;', 'color:#000;');
184 $customerDetail = $table->publish();
186 #-> Customer alternated with dealership details for traders.
187 if ($this->showTradeDataOnly)
189 $table = $this->newTable(
191 'padding:0;margin:0;font-size:10px;',
193 'padding:2px 3px 2px 0;margin:0;'
195 $department = $this->getValuationParam('department', null);
196 $department = !is_null($department)
199 $contact = $this->getStockSubParam('company', 'contact', null);
201 ->addTitle('Dealership', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
202 ->addKeyValueDataSet(array(
203 'Dealership name:' => $this->getStockSubParam('company', 'name', ''),
204 'Contact:' => !is_null($contact) ? $contact->firstName . ' ' . $contact->familyName : '',
205 'Mobile:' => !is_null($contact) ? $contact->mobile : '',
206 'Email:' => !is_null($contact) ? $contact->email : ''
207 ), 0, 'font-weight:bold;', 'color:#000;');
208 $customerDetail = $table->publish();
212 $valuationDetail = ' ';
213 if ($this->showValuationDetails)
215 $table = $this->newTable(
217 'padding:0;margin:0;font-size:10px;',
219 'padding:2px 3px 2px 0;margin:0;'
222 ->getRepository('\PriceGuide\Entity\PriceGuide')
223 ->findOneBy(array('stock' => $this->jobRecord));
224 $pgLoaded = !is_null($pgItem)
225 ? $pgItem->created->format($dateTimeFormat)
227 $valCreated = $this->getValuationParam('created', null);
228 $valCreated = !is_null($valCreated)
229 ? $valCreated->format($dateTimeFormat)
231 $createdBy = $this->getValuationParam('createdBy', null);
232 $createdBy = !is_null($createdBy)
233 ? $createdBy->firstName . ' ' . $createdBy->familyName
235 $valuatedBy = $this->getValuationParam('valuatedBy', null);
236 $valuatedBy = !is_null($valuatedBy)
237 ? $valuatedBy->firstName . ' ' . $valuatedBy->familyName
239 $salesProfile = $this->getValuationParam('salesProfile', null);
240 $salesProfile = !is_null($salesProfile)
241 ? $salesProfile->firstName . ' ' . $salesProfile->familyName
243 $managerProfile = $this->getValuationParam('managerProfile', null);
244 $managerProfile = !is_null($managerProfile)
245 ? $managerProfile->firstName . ' ' . $managerProfile->familyName
247 if ($this->showSalesDataOnly)
250 'Date created:' => $valCreated,
251 'Valuation no.:' => $this->getValuationParam('valuationNumber', ''),
252 'Reference no.:' => $this->getStockParam('referenceNumber', ''),
253 'Created by:' => $createdBy,
254 'Valuator:' => $valuatedBy,
255 'Sales person:' => $salesProfile,
256 'Manager:' => $managerProfile
259 elseif ($this->showTradeDataOnly)
262 'Date created:' => $valCreated,
263 'Date loaded on price guide:' => $pgLoaded
266 elseif ($this->showShortVehicleDetails)
269 'Date created:' => $valCreated,
270 'Valuation no.:' => $this->getValuationParam('valuationNumber', ''),
271 'Reference no.:' => $this->getStockParam('referenceNumber', ''),
272 'Vehicle status:' => $this->getValuationParam('jobState', ''),
273 'Created by:' => $createdBy,
274 'Valuator:' => $valuatedBy,
275 'Sales person:' => $salesProfile,
276 'Manager:' => $managerProfile
282 'Date created:' => $valCreated,
283 'Valuation no.:' => $this->getValuationParam('valuationNumber', ''),
284 'Reference no.:' => $this->getStockParam('referenceNumber', ''),
285 'Vehicle status:' => $this->getValuationParam('jobState', ''),
286 'Created by:' => $createdBy,
287 'Valuator:' => $valuatedBy,
288 'Sales person:' => $salesProfile,
289 'Manager:' => $managerProfile,
290 'Date loaded on price guide:' => $pgLoaded,
291 'Cover Received:' => $this->getStockParam('coverReceived', '')
295 ->addTitle('Valuation details', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
296 ->addKeyValueDataSet($dSet, 0, 'font-weight:bold;', 'color:#F00;');
297 $valuationDetail = $table->publish();
301 $pricingDetail = ' ';
302 $total = $this->getValuationParam('overAllowance', '0.00') + $this->getValuationParam('amountOffered', '0.00');
303 $total = number_format($total, 2, '.', '');
304 if ($this->showPricingDetails)
306 $table = $this->newTable(
308 'padding:0;margin:0;font-size:10px;',
310 'padding:2px 3px 2px 0;margin:0;'
312 if ($this->showSalesDataOnly)
315 'Trade:' => $currencyPrefix . $this->getStockParam('tradePrice', '0.00'),
316 'Retail:' => $currencyPrefix . $this->getStockParam('retailPrice', '0.00'),
317 'List:' => $currencyPrefix . $this->getStockParam('listPrice', '0.00'),
318 'Amount offered:' => $currencyPrefix . $this->getValuationParam('amountOffered', '0.00'),
319 'O.A.:' => $currencyPrefix . $this->getValuationParam('overAllowance', '0.00'),
320 'Total offer:' => $currencyPrefix . $total, // total offer = amount offered + O.A
321 'Bank settlement:' => $currencyPrefix . $this->getValuationParam('bankSettlement', '0.00')
324 elseif ($this->showTradeDataOnly)
327 'Trade:' => $currencyPrefix . $this->getStockParam('tradePrice', '0.00'),
328 'Retail:' => $currencyPrefix . $this->getStockParam('retailPrice', '0.00'),
329 'List:' => $currencyPrefix . $this->getStockParam('listPrice', '0.00'),
330 'Amount offered:' => $currencyPrefix . $this->getValuationParam('amountOffered', '0.00'),
331 'O.A.:' => $currencyPrefix . $this->getValuationParam('overAllowance', '0.00'),
332 'Total offer:' => $currencyPrefix . $total, // total offer = amount offered + O.A
335 elseif ($this->showShortVehicleDetails)
338 'Trade:' => $currencyPrefix . $this->getStockParam('tradePrice', '0.00'),
339 'Retail:' => $currencyPrefix . $this->getStockParam('retailPrice', '0.00'),
340 'List:' => $currencyPrefix . $this->getStockParam('listPrice', '0.00'),
341 'Amount offered:' => $currencyPrefix . $this->getValuationParam('amountOffered', '0.00'),
342 'O.A.:' => $currencyPrefix . $this->getValuationParam('overAllowance', '0.00'),
343 'Total offer:' => $currencyPrefix . $total, // total offer = amount offered + O.A
344 'Bank settlement:' => $currencyPrefix . $this->getValuationParam('bankSettlement', '0.00')
350 'Trade:' => $currencyPrefix . $this->getStockParam('tradePrice', '0.00'),
351 'Retail:' => $currencyPrefix . $this->getStockParam('retailPrice', '0.00'),
352 'List:' => $currencyPrefix . $this->getStockParam('listPrice', '0.00'),
353 'Amount offered:' => $currencyPrefix . $this->getValuationParam('amountOffered', '0.00'),
354 'O.A.:' => $currencyPrefix . $this->getValuationParam('overAllowance', '0.00'),
355 'Total offer:' => $currencyPrefix . $total , // total offer = amount offered + O.A
356 'Projected retail:' => $currencyPrefix . $this->getValuationParam('projectedRetail', '0.00'),
357 'Planned margin:' => $currencyPrefix . $this->getValuationParam('plannedMargin', '0.00'),
358 'Price guide highest offer:' => $currencyPrefix . $this->getStockParam('highestOffer', '0.00'),
359 'Bank settlement:' => $currencyPrefix . $this->getValuationParam('bankSettlement', '0.00')
363 ->addTitle('Pricing details', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
364 ->addKeyValueDataSet($dSet, 0, 'font-weight:bold;', 'color:#F00;');
365 $pricingDetail = $table->publish();
368 #-> First row of data-blocks.
369 if ($this->showCustomerDetails
370 || $this->showValuationDetails
371 || $this->showPricingDetails)
375 array(30, 5, 30, 5, 30),
376 'margin:0;font-size:10px;vertical-align:top;',
378 'padding:10px 0 0 0;'
380 ->setCellValue(0, 0, $customerDetail)
381 ->setCellValue(0, 2, $valuationDetail)
382 ->setCellValue(0, 4, $pricingDetail);
383 $this->append($container->publish() . '<br />');
387 /* --------------------------------- VEHICLE, DAMAGES, ACCESSORIES --------------------------------- */
390 $vehicleDetail = ' ';
391 if ($this->showVehicleDetails)
393 $table = $this->newTable(
395 'padding:0;margin:0;font-size:10px;',
397 'padding:2px 3px 2px 0;margin:0;'
399 if ($this->showShortVehicleDetails)
402 'Year:' => $this->getStockSubParam('vehicleYear', 'name', ''),
403 'Category:' => $type->category->name,
404 'Make:' => $type->model->make->name,
405 'Model:' => $type->model->name,
406 'Type:' => $type->name,
407 'Registration no.:' => $this->getStockParam('registrationNumber', ''),
413 $licenseDiscExpired = $this->getValuationParam('licenseDiscExpired', null);
414 if (is_null($licenseDiscExpired))
416 $licenseDiscExpired = '';
420 $licenseDiscExpired = $licenseDiscExpired
426 $keys = $this->getStockParam('spareKeys', null);
438 'Year:' => $this->getStockSubParam('vehicleYear', 'name', ''),
439 'Category:' => $type->category->name,
440 'Make:' => $type->model->make->name,
441 'Model:' => $type->model->name,
442 'Type:' => $type->name,
443 'Registration no.:' => $this->getStockParam('registrationNumber', ''),
444 'Fuel type:' => $this->getStockSubParam('fuelType', 'name', ''),
445 'Transmission type:' => $this->getStockSubParam('transmissionType', 'name', ''),
446 'VIN no.:' => $this->getStockParam('vinNumber', ''),
447 'Engine no.:' => $this->getStockParam('engineNumber', ''),
448 'License Disc Expired:' => $licenseDiscExpired,
449 'MM code:' => $type->mmCode,
451 'Kms:' => $this->getStockParam('km', ''),
452 'Condition:' => $this->getStockSubParam('condition', 'name', ''),
453 'Main exterior colour:' => $this->getStockSubParam('exteriorColour', 'name', ''),
454 'Main interior colour:' => $this->getStockSubParam('interiorColour', 'name', ''),
455 'Upholstery:' => $this->getStockSubParam('upholstery', 'name', ''),
456 'Papers:' => $this->getStockSubParam('papers', 'name', ''),
457 'Papers comments:' => $this->getStockParam('papersNotes', ''),
458 'Natis:' => $this->getStockSubParam('natis', 'name', ''),
459 'Spare keys:' => $keys,
460 'FSH:' => $this->getStockSubParam('fullServiceHistory', 'name', ''),
461 'FSH comments:' => $this->getStockParam('fshNotes', '')
467 ->addTitle('Vehicle specifications', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
468 ->addKeyValueDataSet($dSet, 0, '', 'color:#000;');
469 $vehicleDetail = $table->publish();
473 $damagesDetail = ' ';
474 if ($this->showDamageDetails)
476 $damageData = array();
477 $damages = $this->jobRecord->damagesToArray();
478 foreach ($damages as $damage)
480 $damageData[$damage['damage']['name'] . ':'] = $currencyPrefix . $damage['amount'];
482 $damageData['Total estimated repair cost:'] =
483 '<span style="color:#F00;">' . $currencyPrefix . $this->getStockParam('damageTotal', '') . '</span>';
484 $damageData['Damages comments:'] = $this->getStockParam('damageNotes', '');
485 $damageData['Previous repairs noted:'] = $this->getStockParam('previousRepairsNoted', false)
488 $damageData['Previous repairs comments:'] = $this->getStockParam('previousRepairsNotes', '');
489 $table = $this->newTable(
491 'padding:0;margin:0;font-size:10px;',
493 'padding:2px 3px 2px 0;margin:0;'
495 $type = $this->jobRecord->type;
497 ->addTitle('Damages', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
498 ->addKeyValueDataSet($damageData, 0, '', 'color:#000;');
499 $damagesDetail = $table->publish();
503 $accessoriesDetail = ' ';
504 if ($this->showAccessoryDetails)
508 $accessories = $this->jobRecord->accessoriesToArray();
509 foreach ($accessories as $accessory)
511 $accs[] = $accessory['accessory']['name'];
515 for ($i = 0; $i <= count($accs); $i += 2)
517 if (isset($accs[$i]))
519 $accData[$accs[$i]] = isset($accs[$i + 1])
525 $accData['<span style="color:#000;font-size:10px;">Comments:</span>'] =
526 '<span style="color:#000;font-size:10px;">' . $this->getStockParam('accessoryNotes', '') . '</span>';
527 $table = $this->newTable(
529 'padding:0;margin:0;font-size:9px;',
531 'padding:2px 3px 2px 0;margin:0;'
533 $type = $this->jobRecord->type;
535 ->addTitle('Accessories', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
536 ->addKeyValueDataSet($accData, 0, 'color:#000;', 'color:#000;');
537 $accessoriesDetail = $table->publish();
540 #-> Second row of data-blocks.
541 if ($this->showVehicleDetails
542 || $this->showDamageDetails
543 || $this->showAccessoryDetails)
547 array(30, 5, 30, 5, 30),
548 'margin:0;font-size:10px;vertical-align:top;',
550 'padding:10px 0 0 0;'
552 ->setCellValue(0, 0, $vehicleDetail)
553 ->setCellValue(0, 2, $damagesDetail)
554 ->setCellValue(0, 4, $accessoriesDetail);
555 $this->append($container->publish() . '<br />');
558 /* --------------------------------- VEHICLE NOTES --------------------------------- */
560 $VehicleNotes = ' ';
561 if ($this->showVehicleNotes)
563 $table = $this->newTable(
565 'padding:0;margin:0;font-size:10px;',
567 'padding:15px 15px 15px 0;margin:0;'
571 '1______________________________________________________________________________________________________________________________________' => ' ',
572 '2______________________________________________________________________________________________________________________________________' => ' ',
573 '3______________________________________________________________________________________________________________________________________' => ' '
577 ->addTitle('Notes:', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
578 ->addKeyValueDataSet($dSet, 0, '', 'color:#000;');
579 $VehicleNotes = $table->publish();
581 #-> Third row of data-blocks.
582 if ($this->showVehicleNotes)
586 array(30, 5, 30, 5, 30),
587 'margin:0;font-size:10px;vertical-align:top;',
589 'padding:10px 0 0 0;'
591 ->setCellValue(0, 0, $VehicleNotes);
592 $this->append($container->publish() . '<br />');
597 /* --------------------------------- SIGNATURES --------------------------------- */
599 if ($this->showSignatureLines)
602 $this->newSignatureLine()
603 ->addSignatureLine('Customer (name)', 'Signature', 'Date')
604 ->addSignatureLine('Manager (name)', 'Signature', 'Date')
610 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
611 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
613 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
614 . $dateOfPrint . '</i></td>'
615 . '<td style="width:5%"> </td>'
616 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
617 . $printedBy . '</i></td>'
618 . '<td style="width:5%"> </td>'
619 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
620 . $referenceNo . '</i></td>'
629 /* --------------------------------- OFFERS RECEIVED/MADE --------------------------------- */
631 if ($this->showOffersReceived || $this->showOfferMade)
634 $this->append('<br/>');
636 if ($this->showOffersReceived)
640 ->getRepository('\PriceGuide\Entity\PriceGuide')
641 ->findBy(array('stock' => $this->jobRecord));
642 if (!empty($pgItems))
644 foreach ($pgItems as $pgItem)
646 $iterator = $pgItem->offers->getIterator();
647 foreach ($iterator as $offer)
649 $status = $offer->status;
651 $offer->company->name,
652 $offer->created->format($dateTimeFormat),
653 $currencyPrefix . $offer->amount,
654 $offer->profile->mobile,
655 $offer->profile->email,
661 $table = $this->newTable(
662 array(20, 15, 15, 10, 30, 10),
663 'padding:0;margin:0;font-size:10px;',
665 'padding:2px 5px 2px 2px;margin:0;'
668 ->addTitle('Offers received', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
669 ->setColumnHeaders(array(
670 'Buyer', 'Date', 'Offer', 'Mobile', 'Email', 'Status'
671 ), array(20, 15, 15, 10, 30, 10),
672 'padding:2px 2px 2px 5px;background-color:#F00;color:#FFF;font-weight:bold;font-size:10px;')
673 ->setDataSet($offers);
674 $this->append($table->publish() . '<br />');
678 if ($this->showOfferMade)
682 ->getRepository('\PriceGuide\Entity\PriceGuide')
683 ->findOneBy(array('stock' => $this->jobRecord));
684 if (!is_null($pgItem))
686 $companyId = \Utility\Registry::resolveCompanyContext();
687 $iterator = $pgItem->offers->getIterator();
688 foreach ($iterator as $offer)
690 $status = $offer->status;
691 if ('Valid' != $status && 'Archived' != $status
692 && $offer->company->id = $companyId)
697 $offer->company->name,
698 $offer->created->format($dateTimeFormat),
699 $currencyPrefix . $offer->amount,
700 $offer->profile->mobile,
701 $offer->profile->email,
706 $table = $this->newTable(
707 array(20, 15, 15, 10, 30, 10),
708 'padding:0;margin:0;font-size:10px;',
710 'padding:2px 5px 2px 2px;margin:0;'
713 ->addTitle('Offers made', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
714 ->setColumnHeaders(array(
715 'Buyer', 'Date', 'Offer', 'Mobile', 'Email', 'Status'
716 ), array(20, 15, 15, 10, 30, 10),
717 'padding:2px 2px 2px 5px;background-color:#F00;color:#FFF;font-weight:bold;font-size:10px;')
718 ->setDataSet($offers);
719 $this->append($table->publish() . '<br />');
723 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
724 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
726 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
727 . $dateOfPrint . '</i></td>'
728 . '<td style="width:5%"> </td>'
729 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
730 . $printedBy . '</i></td>'
731 . '<td style="width:5%"> </td>'
732 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
733 . $referenceNo . '</i></td>'
743 /* --------------------------------- TERMS AND CONDITIONS --------------------------------- */
744 #-> Terms and Conditions.
745 if ($this->showTermsAndConditions)
748 $this->append('<br/>');
750 $table = $this->newTable(
752 'padding:0;margin:0;font-size:9px;',
754 'padding:2px 3px 2px 0;margin:0;'
756 $type = $this->jobRecord->type;
758 ->addTitle('Terms and Conditions', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
759 ->addKeyValueDataSet(array(
760 'I acknowledge, confirm and agree that:' => '',
761 '1. Ownership' => '',
762 '1.1. I am the owner of my trade-in vehicle and I am legally allowed to sell my trade-in vehicle.' => 'Yes / No',
763 '1.2. I am a South African resident.' => 'Yes / No',
764 '1.3. My trade-in vehicle is not subject to a claim of any nature whatsoever by any other person or entity and I '
765 . 'indemnify the Dealer against any claims of any ' => 'Yes / No',
766 '1.4. If my trade-in vehicle is subject to any claim by any other person or entity, the Dealer will not be bound '
767 . 'to this valuation.' => 'Yes / No',
768 '2. VAT Registration' => '',
769 'This transaction is subject to the payment of VAT.' => 'Yes / No',
770 '3. Status of the Vehicle' => '',
771 '3.1. My trade-in vehicle was new when I purchased it.' => 'Yes / No',
772 '3.2. My trade-in vehicle has been used for self-drive hire or taxi work.' => 'Yes / No',
773 '3.3. My trade-in vehicle has a full service history.' => 'Yes / No',
774 '3.4. My trade in vehicle has not been involved in any accident.' => 'Yes / No',
775 '3.5. If my trade-in vehicle has been involved in an accident, there was a total loss claim made (Stolen & Recovered).' => 'Yes / No',
776 '3.6. A current registration paper has been handed over by me.' => 'Yes / No',
777 '3.7. I have supplied the owners and service manuals to the Dealer.' => 'Yes / No',
778 '3.8. My trade-in vehicle is subject to a service and/or maintenance plan and/or warranty.' => 'Yes / No',
779 '4. Status of the Vehicle' => '',
780 'The Dealer will only be bound by its appraised trade-in value of my trade-in vehicle as far as the trade-in has '
781 . 'been approved and accepted in writing by either the dealer principle, designated sales manager or used car manager'
782 . ' and the parties have entered into the Dealer\'s standard Offer to Purchase in respect of my trade-in vehicle.' => '',
783 '5. Outstanding Finance' => '',
784 '5.1. The Dealer, in its absolute and sole discretion, may agree to settle the existing finance in lieu of payment '
785 . '(or part payment) of the trade-in vehicle to me.' => '',
786 '5.2. If the agreed trade-in allowance of the trade-in vehicle is lower than the settlement figure in clause 5.1 above, '
787 . 'I must pay the Registered Credit Provider the difference between the settlement figure and the trade-in allowance with '
788 . 'proof of such payment (made to the registered Credit Provider) submitted to the Dealer prior to the signing of the Offer to Purchase.' => '',
789 '5.3. I will remain liable to the registered Credit Provider in respect of the related finance at all times until the '
790 . 'credit Agreement has been legally terminated.' => '',
791 '5.4. For purposes of clarity, the Dealer does not accept any liability with respect to the related finance set out in '
792 . 'clause 5.4 above at any time or for any reason.' => '',
793 '5.5. The Dealer will use its best endeavors to pay the trade-in allowance to the registered Credit Provider as soon as '
794 . 'is reasonably possible. However the Dealer accepts no liability for any costs or liability incurred by me as a result '
795 . 'of any delay in the payment by the Dealer.' => '',
796 '6. No Financial Advice' => '',
797 'This trade-in valuation does not constitute financial advice to me as contemplated in the Financial Advisory and '
798 . 'Intermediary Services Act 37 of 2002 but is subject to the Consumer Protection Act 68 of 2008.' => '',
800 'The risk of damage or loss in and to the trade-in vehicle will pass from me to the Dealer only once the Dealer has '
801 . 'taken possession of my trade-in vehicle and has received the proper documentation from me to enable it to re-register my trade-in vehicle.' => '',
802 '8. The Dealer\'s right to withdraw from the offer' => '',
803 'The Dealer is bound by this offer only in so far as:' => '',
804 '8.1. I have signed an Offer to Purchase with the same Dealer in respect of this valuation; and' => '',
805 '8.2. Fewer than 7 (seven) days have passed since the issuing of this valuation; and' => '',
806 '8.3. My trade-in vehicle is in the same condition as the date of inspection; and' => '',
807 '8.4. This trade-in valuation was signed by the Valuator and the Manager of the Dealer.' => '',
808 ' <br /> ' => '',
809 'I HAVE READ THE ABOVE TERMS AND CONDITIONS AND CONFIRM MY UNDERSTANDING AND AGREE TO BE BOUND THERETO.' => '',
810 ' <br /> ' => '',
812 'By signing this form, I agree to the [Dealership Name] valuation terms and conditions above.' => '',
813 ' <br /> <br /> <br /> <br /> <br />' => '',
814 '<b>Signature:</b>' => '',
816 'Date: ' . date('Y-m-d') => ''
817 ), 0, 'color:#333;', 'color:#000;');
818 $this->append($table->publish() . '<br />');
821 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
822 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
824 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
825 . $dateOfPrint . '</i></td>'
826 . '<td style="width:5%"> </td>'
827 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
828 . $printedBy . '</i></td>'
829 . '<td style="width:5%"> </td>'
830 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#000;"><i>'
831 . $referenceNo . '</i></td>'