6 class Deliveryreceipt 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)
38 * Utility for easy parameter retrieval.
39 * @param string $param
40 * @param unknown $default
43 protected function getValuationParam($param, $default)
45 return !is_null($this->jobRecord->valuation)
46 && !is_null($this->jobRecord->valuation->$param)
47 ? $this->jobRecord->valuation->$param
55 public function build()
57 #-> Set data item to work with.
58 $this->jobRecord = $this->_input['jobRecord'];
59 $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
60 $dateFormat = \Utility\Definitions\Locale::getDateFormat();
61 $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix();
62 $authData = \Utility\Registry::getAuthData();
63 $auctionDate = $this->jobRecord->endDate->format($dateFormat);
64 $dateOfPrint = 'Date of print: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>';
65 $printedBy = 'Printed by: <span style="color:#333;">' . $authData['firstName']
66 . ' ' . $authData['familyName'] . '</span>';
67 $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->stock->referenceNumber . '</span>';
70 /* --------------------------------- DELIVERY RECEIPT --------------------------------- */
71 $type = $this->jobRecord->stock->type;
73 '<br /> <div style="font-size:16px;font-weight:bold;text-align:center">'
74 . 'DELIVERY RECEIPT </div>' . '<br><br>'
78 $ReceiptDetail = ' ';
80 $buyer = $this->jobRecord->soldToCompany->name;
81 $seller = $this->jobRecord->company->name;
86 . ' (known hereinafter as
\93The Purchaser
\94) declare that:- '
88 . '1. I am The Purchaser of the below-mentioned vehicle which was purchased from '
89 . $seller . ' (
\93The Seller
\94)'
90 . 'by web-auction conducted by Bid4Cars on the '
93 . '2. I hereby acknowledge having taken delivery from
\93The Seller
\94 of the vehicle, the specifics of which are summarized here:-'
97 /* --------------------------------- VEHICLE, DAMAGES, ACCESSORIES --------------------------------- */
100 $vehicleDetail = ' ';
102 $keys = $this->getStockParam('spareKeys', null);
113 $table = $this->newTable(
115 'padding:0;margin:0;font-size:10px;',
117 'padding:2px 3px 2px 0;margin:0;'
120 ->addTitle('Vehicle specifications', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
121 ->addKeyValueDataSet(array(
122 'Year:' => $this->getStockSubParam('vehicleYear', 'name', ''),
123 'Category:' => $type->category->name,
124 'Make:' => $type->model->make->name,
125 'Model:' => $type->model->name,
126 'Type:' => $type->name,
127 'Registration no.:' => $this->getStockParam('registrationNumber', ''),
128 'Fuel type:' => $this->getStockSubParam('fuelType', 'name', ''),
129 'Transmission type:' => $this->getStockSubParam('transmissionType', 'name', ''),
130 'VIN no.:' => $this->getStockParam('vinNumber', ''),
131 'Engine no.:' => $this->getStockParam('engineNumber', ''),
132 'MM code:' => $type->mmCode,
133 'Kms:' => $this->getStockParam('km', ''),
134 'Condition:' => $this->getStockSubParam('condition', 'name', ''),
135 'Main exterior colour:' => $this->getStockSubParam('exteriorColour', 'name', ''),
136 'Main interior colour:' => $this->getStockSubParam('interiorColour', 'name', ''),
137 'Upholstery:' => $this->getStockSubParam('upholstery', 'name', ''),
138 'Papers:' => $this->getStockSubParam('papers', 'name', ''),
139 'Papers comments:' => $this->getStockParam('papersNotes', ''),
140 'Natis:' => $this->getStockSubParam('natis', 'name', ''),
141 'Spare keys:' => $keys,
142 'FSH:' => $this->getStockSubParam('fullServiceHistory', 'name', ''),
143 'FSH comments:' => $this->getStockParam('fshNotes', '')
144 ), 0, '', 'color:#666;');
145 $vehicleDetail = $table->publish();
149 #-> Second row of data-blocks.
152 array(30, 5, 30, 5, 30),
153 'margin:0;font-size:10px;vertical-align:top;',
155 'padding:10px 0 0 0;'
157 ->setCellValue(0, 0, $vehicleDetail);
158 $this->append($container->publish() . '<br />');
160 /* --------------------------------- DELIVERY RECEIPT CONTINUE --------------------------------- */
165 . '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.'
167 . '4. The provisions of the terms are to be read as if specifically set out and incorporated herein.'
169 . 'DATED at ____________________________________________ on ' . $auctionDate
171 . 'Signature : ____________________________'
173 . 'Print Name : ' . $buyer
175 . 'Who warrants being the authorized representative of the Purchaser.'
184 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
185 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
187 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
188 . $dateOfPrint . '</i></td>'
189 . '<td style="width:5%"> </td>'
190 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
191 . $printedBy . '</i></td>'
192 . '<td style="width:5%"> </td>'
193 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
194 . $referenceNo . '</i></td>'