6 class HPI extends \Utility\Service\PdfTemplate
9 * Utility for easy parameter retrieval.
10 * @param string $param
11 * @param unknown $default
14 protected function getStockParam($param, $default)
16 return !is_null($this->jobRecord->stock->$param)
17 ? $this->jobRecord->stock->$param
22 * Utility for easy parameter retrieval.
23 * @param string $param
24 * @param unknown $default
27 protected function getStockSubParam($ref, $param, $default)
29 $ref = !is_null($this->jobRecord->stock->$ref)
30 ? $this->jobRecord->stock->$ref
32 return is_object($ref)
42 public function build()
44 #-> Set data item to work with.
45 $this->jobRecord = $this->_input['jobRecord'];
46 $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
47 $dateFormat = \Utility\Definitions\Locale::getDateFormat();
48 $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix();
49 $authData = \Utility\Registry::getAuthData();
50 $auctionDate = $this->jobRecord->endDate->format($dateFormat);
51 $dateOfPrint = 'Report date: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>';
55 /* $authData['firstName'];
56 $authData['familyName']; */
57 $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->stock->referenceNumber . '</span>';
60 /* --------------------------------- TRANSUNION REPORT --------------------------------- */
61 $type = $this->jobRecord->stock->type;
63 '<br /> <div style="font-size:24px;font-weight:bold;text-align:center">'
64 . 'TRANSUNION REPORT </div>' . '<br><br>' .
69 $ReceiptDetail = ' ';
71 $seller = $this->jobRecord->company->name;
76 . ' (known hereinafter as
\93The Purchaser
\94) declare that:- '
78 . '1. I am The Purchaser of the below-mentioned vehicle which was purchased from '
79 . $seller . ' (
\93The Seller
\94)'
80 . 'by web-auction conducted by Bid4Cars on the '
83 . '2. I hereby acknowledge having taken delivery from
\93The Seller
\94 of the vehicle, the specifics of which are summarized here:-'
87 /* --------------------------------- VEHICLE, DAMAGES, ACCESSORIES --------------------------------- */
90 $vehicleDetail = ' ';
92 $keys = $this->getStockParam('spareKeys', null);
103 $table = $this->newTable(
105 'padding:0;margin:0;font-size:10px;',
107 'padding:2px 3px 2px 0;margin:0;'
110 ->addTitle('Vehicle specifications', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
111 ->addKeyValueDataSet(array(
112 'Year:' => $this->getStockSubParam('vehicleYear', 'name', ''),
113 'Category:' => $type->category->name,
114 'Make:' => $type->model->make->name,
115 'Model:' => $type->model->name,
116 'Type:' => $type->name,
117 'Registration no.:' => $this->getStockParam('registrationNumber', ''),
118 'Fuel type:' => $this->getStockSubParam('fuelType', 'name', ''),
119 'Transmission type:' => $this->getStockSubParam('transmissionType', 'name', ''),
120 'VIN no.:' => $this->getStockParam('vinNumber', ''),
121 'Engine no.:' => $this->getStockParam('engineNumber', ''),
122 'MM code:' => $type->mmCode,
123 'Kms:' => $this->getStockParam('km', ''),
124 'Condition:' => $this->getStockSubParam('condition', 'name', ''),
125 'Main exterior colour:' => $this->getStockSubParam('exteriorColour', 'name', ''),
126 'Main interior colour:' => $this->getStockSubParam('interiorColour', 'name', ''),
127 'Upholstery:' => $this->getStockSubParam('upholstery', 'name', ''),
128 'Papers:' => $this->getStockSubParam('papers', 'name', ''),
129 'Papers comments:' => $this->getStockParam('papersNotes', ''),
130 'Natis:' => $this->getStockSubParam('natis', 'name', ''),
131 'Spare keys:' => $keys,
132 'FSH:' => $this->getStockSubParam('fullServiceHistory', 'name', ''),
133 'FSH comments:' => $this->getStockParam('fshNotes', '')
134 ), 0, '', 'color:#666;');
135 $vehicleDetail = $table->publish();
139 #-> Second row of data-blocks.
142 array(30, 5, 30, 5, 30),
143 'margin:0;font-size:10px;vertical-align:top;',
145 'padding:10px 0 0 0;'
147 ->setCellValue(0, 0, $vehicleDetail);
148 $this->append($container->publish() . '<br />');
150 /* --------------------------------- DELIVERY RECEIPT CONTINUE --------------------------------- */
155 . '3. I confirm and acknowledge that I am bound by the terms and conditions of auction and sale, as set out on the Bid4Cars website.'
157 . '4. The provisions of the terms are to be read as if specifically set out and incorporated herein.'
159 . 'DATED at ____________________________________________ on ' . $auctionDate
161 . 'Signature : ____________________________'
163 . 'Print Name : ' . $buyer
165 . 'Who warrants being the authorized representative of the Purchaser.'
174 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
175 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
177 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
178 . $dateOfPrint . '</i></td>'
179 . '<td style="width:5%"> </td>'
180 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
181 . $printedBy . '</i></td>'
182 . '<td style="width:5%"> </td>'
183 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
184 . $referenceNo . '</i></td>'