text changes to registration mail content
[namibia] / module / Auction / src / Auction / Pdf / CompleteNew.php
1 <?php
2 namespace Auction\Pdf;
3
4
5
6 class CompleteNew extends \Utility\Service\PdfTemplate
7 {
8
9
10         /**
11          * PDF title.
12          * @var string
13          */
14         protected $_title = 'Stock Information';
15         /**
16          * @var \Stock\Entity\Stock
17          */
18         protected $jobRecord;
19         /**
20          * @var boolean
21          */
22         protected $showTradeDataOnly = true;
23         /**
24          * @var boolean
25          */
26         protected $showCustomerDetails = false;
27         /**
28          * @var boolean
29          */
30         protected $showValuationDetails = false;
31         /**
32          * @var boolean
33          */
34         protected $showMainImage = true;
35         /**
36          * @var boolean
37          */
38         protected $showPricingDetails = true;
39         /**
40          * @var boolean
41          */
42         protected $showVehicleDetails = true;
43         /**
44          * @var boolean
45          */
46         protected $showVehicleNotes = true;
47         /**
48          * @var boolean
49          */
50         protected $showDamageDetails = true;
51         /**
52          * @var boolean
53          */
54         protected $showAccessoryDetails = true;
55         /**
56          * @var boolean
57          */
58         protected $showSignatureLines = false;
59         /**
60          * @var boolean
61          */
62         protected $showTermsAndConditions = false;
63         /**
64          * @var boolean
65          */
66         protected $showOffersReceived = false;
67         /**
68          * @var boolean
69          */
70         protected $showOfferMade = false;
71
72
73         /**
74          * Utility for easy parameter retrieval.
75          * @param string $param
76          * @param unknown $default
77          * @return unknown
78          */
79         protected function getStockParam($param, $default)
80         {
81                 return !is_null($this->jobRecord->$param)
82                         ? $this->jobRecord->$param
83                         : $default;
84         }
85
86         /**
87          * Utility for easy parameter retrieval.
88          * @param string $param
89          * @param unknown $default
90          * @return unknown
91          */
92         protected function getStockSubParam($ref, $param, $default)
93         {
94                 $ref = !is_null($this->jobRecord->$ref)
95                         ? $this->jobRecord->$ref
96                         : null;
97                 return is_object($ref)
98                         ? $ref->$param
99                         : $default;
100         }
101
102         /**
103          * Utility for easy parameter retrieval.
104          * @param string $param
105          * @param unknown $default
106          * @return unknown
107          */
108         protected function getValuationParam($param, $default)
109         {
110                 return !is_null($this->jobRecord->valuation)
111                                 && !is_null($this->jobRecord->valuation->$param)
112                         ? $this->jobRecord->valuation->$param
113                         : $default;
114         }
115
116
117         /**
118          * Build the content.
119          */
120         public function build()
121         {
122                 #-> Set data item to work with.
123                 $this->auctionRecord = $this->_input['jobRecord'];
124                 $this->jobRecord = $this->_input['jobRecord']->stock;
125                 $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
126                 $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix();
127                 $authData = \Utility\Registry::getAuthData();
128                 $dateOfPrint = 'Date of print: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>';
129                 $printedBy   = 'Printed by: <span style="color:#333;">' . $authData['firstName']
130                                          . ' ' . $authData['familyName'] . '</span>';
131                 $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->referenceNumber . '</span>';
132
133
134                 /* --------------------------------- CUSTOMER, VALUATION, PRICING --------------------------------- */
135                 $type = $this->jobRecord->type;
136                 $this->append(
137                                 '<br /><div style="font-size:16px;font-weight:bold;">'
138                                 . $type->model->make->name . ' '
139                                 . $type->model->name . ' '
140                                 . $type->name . ' ('
141                                 . $type->introYear->name . ' - '
142                                 . (!is_null($type->discYear) ? $type->discYear->name : 'Current') . ')'
143                                 . '</div><hr /><br />'
144                                 );
145
146
147                 /* --------------------------------- CUSTOMER, VALUATION, PRICING --------------------------------- */
148                 #-> Customer
149                 $customerDetail = '&nbsp;';
150                 if ($this->showCustomerDetails)
151                 {
152                         $table = $this->newTable(
153                                         array(60, 40),
154                                         'padding:0;margin:0;font-size:10px;',
155                                         '',
156                                         'padding:2px 3px 2px 0;margin:0;'
157                         );
158                         $department = $this->getValuationParam('department', null);
159                         $department = !is_null($department)
160                                 ? $department
161                                 : '&nbsp;';
162                         $table
163                                 ->addTitle('Customer', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
164                                 ->addKeyValueDataSet(array(
165                                                 'Customer name:'    => $this->getValuationParam('firstName', ''),
166                                                 'Customer surname:' => $this->getValuationParam('familyName', ''),
167                                                 'ID:'               => $this->getValuationParam('idNumber', ''),
168                                                 'Mobile:'           => $this->getValuationParam('mobile', ''),
169                                                 'Email:'            => $this->getValuationParam('email', ''),
170                                                 'Department:'       => $department,
171                                                 'Address:'              => '&nbsp;',
172                                                 '<span style="color:#FFF;font-size:20px;">a1</span>'                    => '&nbsp;',
173                                                 '<span style="color:#FFF;font-size:10px;">1</span><span style="color:#000;font-size:10px;">______________________________________</span>'                               => '&nbsp;',
174                                                 '<span style="color:#FFF;font-size:20px;">a</span>'                     => '&nbsp;',
175                                                 '<span style="color:#FFF;font-size:10px;">2</span><span style="color:#000;font-size:10px;">______________________________________</span>'                               => '&nbsp;',
176                                                 '<span style="color:#FFF;font-size:20px;">b</span>'                     => '&nbsp;',
177                                                 '<span style="color:#FFF;font-size:10px;">3</span><span style="color:#000;font-size:10px;">______________________________________</span>'                               => '&nbsp;'
178                                 ), 0, 'font-weight:bold;', 'color:#666;');
179                         $customerDetail = $table->publish();
180                 }
181                 #-> Customer alternated with dealership details for traders.
182                 if ($this->showTradeDataOnly)
183                 {
184                         $table = $this->newTable(
185                                         array(60, 40),
186                                         'padding:0;margin:0;font-size:10px;',
187                                         '',
188                                         'padding:2px 3px 2px 0;margin:0;'
189                         );
190                         $department = $this->getValuationParam('department', null);
191                         $department = !is_null($department)
192                                 ? $department
193                                 : '&nbsp;';
194                         $contact = $this->getStockSubParam('company', 'contact', null);
195                         $table
196                                 ->addTitle('Dealership', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
197                                 ->addKeyValueDataSet(array(
198                                                 'Dealership name:'  => $this->getStockSubParam('company', 'name', ''),
199                                                 'Contact:'              => !is_null($contact) ? $contact->firstName . ' ' . $contact->familyName : '',
200                                                 'Mobile:'           => !is_null($contact) ? $contact->mobile : '',
201                                                 'Email:'            => !is_null($contact) ? $contact->email : ''
202                                 ), 0, 'font-weight:bold;', 'color:#666;');
203                         $customerDetail = $table->publish();
204                 }
205
206                 #-> Valuation
207                 $valuationDetail = '&nbsp;';
208                 if ($this->showValuationDetails)
209                 {
210                         $table = $this->newTable(
211                                         array(55, 45),
212                                         'padding:0;margin:0;font-size:10px;',
213                                         '',
214                                         'padding:2px 3px 2px 0;margin:0;'
215                         );
216                         $pgItem = $this->em
217                                 ->getRepository('\Auction\Entity\Auction')
218                                 ->findOneBy(array('stock' => $this->jobRecord));
219                         $pgLoaded = !is_null($pgItem)
220                                 ? $pgItem->created->format($dateTimeFormat)
221                                 : '&nbsp;';
222                         $valCreated = $this->getValuationParam('created', null);
223                         $valCreated = !is_null($valCreated)
224                                 ? $valCreated->format($dateTimeFormat)
225                                 : '&nbsp;';
226                         $table
227                                 ->addTitle('Valuation details', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
228                                 ->addKeyValueDataSet($this->showTradeDataOnly
229                                                 ? array(
230                                                                 'Date created:'               => $valCreated,
231                                                                 'Date loaded on price guide:' => $pgLoaded
232                                                 )
233                                                 : array(
234                                                                 'Date created:'               => $valCreated,
235                                                                 'Valuation no.:'              => $this->getValuationParam('valuationNumber', ''),
236                                                                 'Reference no.:'              => $this->getStockParam('referenceNumber', ''),
237                                                                 'Date loaded on price guide:' => $pgLoaded
238                                                 ), 0, 'font-weight:bold;', 'color:#F00;');
239                         $valuationDetail = $table->publish();
240                 }
241                 $mainImage = '&nbsp;';
242                 if ($this->showMainImage)
243                 {
244                         $pic = $this->getStockParam('mainImage', '');
245                         if (is_object($pic))
246                         {
247                                 $mainImage = '<img src="' . __DIR__ . '/../../../../../public/img/bin/'. $pic->filename . '" style="padding:0;margin:0;width:100%;" />';
248                         }
249                 }
250
251                 #-> Pricing details
252                 $pricingDetail = '&nbsp;';
253                 $total = $this->getValuationParam('overAllowance', '0.00') + $this->getValuationParam('amountOffered', '0.00');
254                 $total = number_format($total, 2, '.', '');
255                 if ($this->showPricingDetails)
256                 {
257                         $table = $this->newTable(
258                                         array(60, 40),
259                                         'padding:0;margin:0;font-size:10px;',
260                                         '',
261                                         'padding:2px 3px 2px 0;margin:0;'
262                         );
263                         $table
264                                 ->addTitle('Pricing details', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
265                                 ->addKeyValueDataSet($this->showTradeDataOnly
266                                                 ? array(
267                                                                 'Trade:'                     => $currencyPrefix . $this->getStockParam('tradePrice', '0.00'),
268                                                                 'Retail:'                    => $currencyPrefix . $this->getStockParam('retailPrice', '0.00'),
269                                 'List:'                     => $currencyPrefix . $this->getStockParam('listPrice', '0.00'),
270                                                                 'Reserve price:'             => $currencyPrefix . $this->auctionRecord->reservePrice,
271                                                                 'Highest bid:'               => $currencyPrefix . $this->getStockParam('highestBid', '0.00')
272                                                                 
273                                                         
274                                                                 
275                                                                 /* 'Amount offered:'            => $currencyPrefix . $this->getValuationParam('amountOffered', '0.00'), */
276                                                                 /* 'O.A.:'                      => $currencyPrefix . $this->getValuationParam('overAllowance', '0.00'), */
277                                                                 /* 'Total offer:'                => $currencyPrefix . $total, // total offer =  amount offered + O.A */
278                                                 )
279                                                 : array(
280                                                                 'Trade:'                     => $currencyPrefix . $this->getStockParam('tradePrice', '0.00'),
281                                                                 'Retail:'                    => $currencyPrefix . $this->getStockParam('retailPrice', '0.00'),
282                                 'List:'                     => $currencyPrefix . $this->getStockParam('listPrice', '0.00'),
283                                                                 'Amount offered:'            => $currencyPrefix . $this->getValuationParam('amountOffered', '0.00'),
284                                                                 'O.A.:'                      => $currencyPrefix . $this->getValuationParam('overAllowance', '0.00'),
285                                                                 'Total offer:'                   => $currencyPrefix . $total, // total offer =  amount offered + O.A
286                                                                 'Projected retail:'          => $currencyPrefix,
287                                                                 'Planned margin:'            => $currencyPrefix,
288                                                                 'Price guide highest offer:' => $currencyPrefix . $this->getStockParam('highestOffer', '0.00')
289                                                 ), 0, 'font-weight:bold;', 'color:#F00;');
290                         $pricingDetail = $table->publish();
291                 }
292
293                 #-> First row of data-blocks.
294                 if ($this->showCustomerDetails
295                         || $this->showValuationDetails
296                         || $this->showMainImage
297                         || $this->showPricingDetails)
298                 {
299                         $container = $this
300                                 ->newTable(
301                                         array(30, 5, 30, 5, 30),
302                                         'margin:0;font-size:10px;vertical-align:top;',
303                                         '',
304                                         'padding:10px 0 0 0;'
305                                         )
306                                 ->setCellValue(0, 0, $customerDetail)
307                                 ->setCellValue(0, 2, $pricingDetail)
308                                 ->setCellValue(0, 4, $valuationDetail . $mainImage);
309                         $this->append($container->publish() . '<br />');
310                 }
311
312
313                 /* --------------------------------- VEHICLE, DAMAGES, ACCESSORIES --------------------------------- */
314
315                 #-> Vehicle details
316                 $vehicleDetail = '&nbsp;';
317                 if ($this->showVehicleDetails)
318                 {
319                         $keys = $this->getStockParam('spareKeys', null);
320                         if (is_null($keys))
321                         {
322                                 $keys = '';
323                         }
324                         else
325                         {
326                                 $keys = $keys
327                                         ? 'Yes'
328                                         : 'No';
329                         }
330                         $table = $this->newTable(
331                                         array(55, 45),
332                                         'padding:0;margin:0;font-size:10px;',
333                                         '',
334                                         'padding:2px 3px 2px 0;margin:0;'
335                         );
336                         $table
337                                 ->addTitle('Vehicle specifications', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
338                                 ->addKeyValueDataSet(array(
339                                                 'Year:'                 => $this->getStockSubParam('vehicleYear', 'name', ''),
340                                                 'Category:'             => $type->category->name,
341                                                 'Make:'                 => $type->model->make->name,
342                                                 'Model:'                => $type->model->name,
343                                                 'Type:'                 => $type->name,
344                                                 'Registration no.:'     => $this->getStockParam('registrationNumber', ''),
345                                                 'Fuel type:'            => $this->getStockSubParam('fuelType', 'name', ''),
346                                                 'Transmission type:'    => $this->getStockSubParam('transmissionType', 'name', ''),
347                                                 'VIN no.:'              => $this->getStockParam('vinNumber', ''),
348                                                 'Engine no.:'           => $this->getStockParam('engineNumber', ''),
349                                                 'MM code:'              => $type->mmCode,
350                                                 'Kms:'                  => $this->getStockParam('km', ''),
351                                                 'Condition:'            => $this->getStockSubParam('condition', 'name', ''),
352                                                 'Main exterior colour:' => $this->getStockSubParam('exteriorColour', 'name', ''),
353                                                 'Main interior colour:' => $this->getStockSubParam('interiorColour', 'name', ''),
354                                                 'Upholstery:'           => $this->getStockSubParam('upholstery', 'name', ''),
355                                                 'Papers:'               => $this->getStockSubParam('papers', 'name', ''),
356                                                 'Papers comments:'      => $this->getStockParam('papersNotes', ''),
357                                                 'Natis:'                => $this->getStockSubParam('natis', 'name', ''),
358                                                 'Spare keys:'           => $keys,
359                                                 'FSH:'                  => $this->getStockSubParam('fullServiceHistory', 'name', ''),
360                                                 'FSH comments:'         => $this->getStockParam('fshNotes', ''),
361                                                 'Stock number:'         => $this->getStockParam('stockNumber', '')
362                                 ), 0, '', 'color:#666;');
363                         $vehicleDetail = $table->publish();
364                 }
365
366                 #-> Damages
367                 $damagesDetail = '&nbsp;';
368                 if ($this->showDamageDetails)
369                 {
370                         $damageData = array();
371                         $damages = $this->jobRecord->damagesToArray();
372                         foreach ($damages as $damage)
373                         {
374                                 $damageData[$damage['damage']['name'] . ':'] = $currencyPrefix . $damage['amount'];
375                         }
376                         $damageData['Total estimated repair cost:']  =
377                                 '<span style="color:#F00;">' . $currencyPrefix . $this->getStockParam('damageTotal', '') . '</span>';
378                         $damageData['Damages comments:']             = $this->getStockParam('damageNotes', '');
379                         $damageData['Previous repairs noted:']       = $this->getStockParam('previousRepairsNoted', false)
380                                 ? 'Yes'
381                                 : 'No';
382                         $damageData['Previous repairs comments:']    = $this->getStockParam('previousRepairsNotes', '');
383                         $table = $this->newTable(
384                                         array(50, 50),
385                                         'padding:0;margin:0;font-size:10px;',
386                                         '',
387                                         'padding:2px 3px 2px 0;margin:0;'
388                         );
389                         $type = $this->jobRecord->type;
390                         $table
391                                 ->addTitle('Damages', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
392                                 ->addKeyValueDataSet($damageData, 0, '', 'color:#666;');
393                         $damagesDetail = $table->publish();
394                 }
395
396                 #-> Accessories
397                 $accessoriesDetail = '&nbsp;';
398                 if ($this->showAccessoryDetails)
399                 {
400                         $accs = array();
401                         $accData = array();
402                         $accessories = $this->jobRecord->accessoriesToArray();
403                         foreach ($accessories as $accessory)
404                         {
405                                 $accs[] = $accessory['accessory']['name'];
406                         }
407                         if (!empty($accs))
408                         {
409                                 for ($i = 0; $i <= count($accs); $i += 2)
410                                 {
411                                         if (isset($accs[$i]))
412                                         {
413                                                 $accData[$accs[$i]] = isset($accs[$i + 1])
414                                                         ? $accs[$i + 1]
415                                                         : '';
416                                         }
417                                 }
418                         }
419                         $accData['<span style="color:#000;font-size:10px;">Comments:</span>'] =
420                                 '<span style="color:#666;font-size:10px;">' . $this->getStockParam('accessoryNotes', '') . '</span>';
421                         $table = $this->newTable(
422                                         array(50, 50),
423                                         'padding:0;margin:0;font-size:9px;',
424                                         '',
425                                         'padding:2px 3px 2px 0;margin:0;'
426                         );
427                         $type = $this->jobRecord->type;
428                         $table
429                                 ->addTitle('Accessories', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
430                                 ->addKeyValueDataSet($accData, 0, 'color:#666;', 'color:#666;');
431                         $accessoriesDetail = $table->publish();
432                 }
433
434                 #-> Second row of data-blocks.
435                 if ($this->showVehicleDetails
436                         || $this->showDamageDetails
437                         || $this->showAccessoryDetails)
438                 {
439                         $container = $this
440                                 ->newTable(
441                                         array(30, 5, 30, 5, 30),
442                                         'margin:0;font-size:10px;vertical-align:top;',
443                                         '',
444                                         'padding:10px 0 0 0;'
445                                         )
446                                 ->setCellValue(0, 0, $vehicleDetail)
447                                 ->setCellValue(0, 2, $damagesDetail)
448                                 ->setCellValue(0, 4, $accessoriesDetail);
449                         $this->append($container->publish() . '<br />');
450                 }
451                 
452                 /* --------------------------------- VEHICLE NOTES --------------------------------- */
453                 #-> Vehicle Notes
454                 $VehicleNotes = '&nbsp;';
455                 if ($this->showVehicleNotes)
456                 {
457                         $table = $this->newTable(
458                                         array(55, 45),
459                                         'padding:0;margin:0;font-size:10px;',
460                                         '',
461                                         'padding:15px 15px 15px 0;margin:0;'
462                         );
463                                 
464                         $dSet = array(
465                                         '1______________________________________________________________________________________________________________________________________'         => '&nbsp;',
466                                         '2______________________________________________________________________________________________________________________________________'         => '&nbsp;',
467                                         '3______________________________________________________________________________________________________________________________________'         => '&nbsp;'
468                         );
469                 
470                         $table
471                         ->addTitle('Notes:', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
472                         ->addKeyValueDataSet($dSet, 0, '', 'color:#666;');
473                         $VehicleNotes = $table->publish();
474                 }
475                 #-> Third row of data-blocks.
476                 if ($this->showVehicleNotes)
477                 {
478                 $container = $this
479                 ->newTable(
480                                 array(30, 5, 30, 5, 30),
481                                 'margin:0;font-size:10px;vertical-align:top;',
482                                         '',
483                                         'padding:10px 0 0 0;'
484                         )
485                         ->setCellValue(0, 0, $VehicleNotes);
486                                 $this->append($container->publish() . '<br />');
487                 }
488                 
489                 
490
491
492
493                 /* --------------------------------- SIGNATURES --------------------------------- */
494                 #-> Signatures.
495                 if ($this->showSignatureLines)
496                 {
497                         $this->append(
498                                         $this->newSignatureLine()
499                                                 ->addSignatureLine('Customer (name)', 'Signature', 'Date')
500                                                 ->addSignatureLine('Manager (name)', 'Signature', 'Date')
501                                                 ->publish()
502                                         );
503                 }
504
505                 $this->append(
506                                 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
507                                 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
508                                 . '<tr>'
509                                 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
510                                 . $dateOfPrint . '</i></td>'
511                                 . '<td style="width:5%">&nbsp;</td>'
512                                 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
513                                 . $printedBy . '</i></td>'
514                                 . '<td style="width:5%">&nbsp;</td>'
515                                 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
516                                 . $referenceNo . '</i></td>'
517                                 . '</tr>'
518                                 . '</table>'
519                                 . '</div>'
520                                 );
521
522
523
524
525                 /* --------------------------------- TERMS AND CONDITIONS --------------------------------- */
526                 #-> Terms and Conditions.
527                 if ($this->showTermsAndConditions)
528                 {
529                         $this->nextPage();
530                         $this->append('<br/>');
531
532                         $table = $this->newTable(
533                                         array(90, 10),
534                                         'padding:0;margin:0;font-size:9px;',
535                                         '',
536                                         'padding:2px 3px 2px 0;margin:0;'
537                         );
538                         $type = $this->jobRecord->type;
539                         $table
540                                 ->addTitle('Terms and Conditions', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
541                                 ->addKeyValueDataSet(array(
542                                                 'I acknowledge, confirm and agree that:' => '',
543                                                 '1. Ownership' => '',
544                                                 '1.1. I am the owner of my trade-in vehicle and I am legally allowed to sell my trade-in vehicle.' => 'Yes / No',
545                                                 '1.2. I am a South African resident.' => 'Yes / No',
546                                                 '1.3. My trade-in vehicle is not subject to a claim of any nature whatsoever by any other person or entity and I '
547                                                 . 'indemnify the Dealer against any claims of any ' => 'Yes / No',
548                                                 '1.4. If my trade-in vehicle is subject to any claim by any other person or entity, the Dealer will not be bound '
549                                                 . 'to this valuation.' => 'Yes / No',
550                                                 '2. VAT Registration' => '',
551                                                 'This transaction is subject to the payment of VAT.' => 'Yes / No',
552                                                 '3. Status of the Vehicle' => '',
553                                                 '3.1. My trade-in vehicle was new when I purchased it.' => 'Yes / No',
554                                                 '3.2. My trade-in vehicle has been used for self-drive hire or taxi work.' => 'Yes / No',
555                                                 '3.3. My trade-in vehicle has a full service history.' => 'Yes / No',
556                                                 '3.4. My trade in vehicle has not been involved in any accident.' => 'Yes / No',
557                                                 '3.5. If my trade-in vehicle has been involved in an accident, there was a total loss claim made (Stolen & Recovered).' => 'Yes / No',
558                                                 '3.6. A current registration paper has been handed over by me.' => 'Yes / No',
559                                                 '3.7. I have supplied the owners and service manuals to the Dealer.' => 'Yes / No',
560                                                 '3.8. My trade-in vehicle is subject to a service and/or maintenance plan and/or warranty.' => 'Yes / No',
561                                                 '4. Status of the Vehicle' => '',
562                                                 'The Dealer will only be bound by its appraised trade-in value of my trade-in vehicle as far as the trade-in has '
563                                                 . 'been approved and accepted in writing by either the dealer principle, designated sales manager or used car manager'
564                                                 . ' and the parties have entered into the Dealer\'s standard Offer to Purchase in respect of my trade-in vehicle.' => '',
565                                                 '5. Outstanding Finance' => '',
566                                                 '5.1. The Dealer, in its absolute and sole discretion, may agree to settle the existing finance in lieu of payment '
567                                                 . '(or part payment) of the trade-in vehicle to me.' => '',
568                                                 '5.2. If the agreed trade-in allowance of the trade-in vehicle is lower than the settlement figure in clause 5.1 above, '
569                                                 . 'I must pay the Registered Credit Provider the difference between the settlement figure and the trade-in allowance with '
570                                                 . 'proof of such payment (made to the registered Credit Provider) submitted to the Dealer prior to the signing of the Offer to Purchase.' => '',
571                                                 '5.3. I will remain liable to the registered Credit Provider in respect of the related finance at all times until the '
572                                                 . 'credit Agreement has been legally terminated.' => '',
573                                                 '5.4. For purposes of clarity, the Dealer does not accept any liability with respect to the related finance set out in '
574                                                 . 'clause 5.4 above at any time or for any reason.' => '',
575                                                 '5.5. The Dealer will use its best endeavors to pay the trade-in allowance to the registered Credit Provider as soon as '
576                                                 . 'is reasonably possible. However the Dealer accepts no liability for any costs or liability incurred by me as a result '
577                                                 . 'of any delay in the payment by the Dealer.' => '',
578                                                 '6. No Financial Advice' => '',
579                                                 'This trade-in valuation does not constitute financial advice to me as contemplated in the Financial Advisory and '
580                                                 . 'Intermediary Services Act 37 of 2002 but is subject to the Consumer Protection Act 68 of 2008.' => '',
581                                                 '7. Risk' => '',
582                                                 '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 '
583                                                 . '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.' => '',
584                                                 '8. The Dealer\'s right to withdraw from the offer' => '',
585                                                 'The Dealer is bound by this offer only in so far as:' => '',
586                                                 '8.1. I have signed an Offer to Purchase with the same Dealer in respect of this valuation; and' => '',
587                                                 '8.2. Fewer than 7 (seven) days have passed since the issuing of this valuation; and' => '',
588                                                 '8.3. My trade-in vehicle is in the same condition as the date of inspection; and' => '',
589                                                 '8.4. This trade-in valuation was signed by the Valuator and the Manager of the Dealer.' => '',
590                                                 '&nbsp;<br />&nbsp;' => '',
591                                                 'I HAVE READ THE ABOVE TERMS AND CONDITIONS AND CONFIRM MY UNDERSTANDING AND AGREE TO BE BOUND THERETO.' => '',
592                                                 '&nbsp;<br />&nbsp;' => '',
593                                                 'Acceptance' => '',
594                                                 'By signing this form, I agree to the [Dealership Name] valuation terms and conditions above.' => '',
595                                                 '&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />' => '',
596                                                 '<b>Signature:</b>' => '',
597                                                 '&nbsp;' => '',
598                                                 'Date: ' . date('Y-m-d') => ''
599                                 ), 0, 'color:#333;', 'color:#000;');
600                         $this->append($table->publish() . '<br />');
601
602                         $this->append(
603                                         '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
604                                         . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
605                                         . '<tr>'
606                                         . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
607                                         . $dateOfPrint . '</i></td>'
608                                         . '<td style="width:5%">&nbsp;</td>'
609                                         . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
610                                         . $printedBy . '</i></td>'
611                                         . '<td style="width:5%">&nbsp;</td>'
612                                         . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
613                                         . $referenceNo . '</i></td>'
614                                         . '</tr>'
615                                         . '</table>'
616                                         . '</div>'
617                         );
618                 }
619
620                 return;
621         }
622
623
624 }