jobRecord->stock->$param) ? $this->jobRecord->stock->$param : $default; } /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getStockSubParam($ref, $param, $default) { $ref = !is_null($this->jobRecord->stock->$ref) ? $this->jobRecord->stock->$ref : null; return is_object($ref) ? $ref->$param : $default; } /** * Build the content. */ public function build() { #-> Set data item to work with. $this->jobRecord = $this->_input['jobRecord']; $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat(); $dateFormat = \Utility\Definitions\Locale::getDateFormat(); $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix(); $authData = \Utility\Registry::getAuthData(); $auctionDate = $this->jobRecord->endDate->format($dateFormat); $dateOfPrint = 'Report date: ' . date('Y-m-d H:i:s') . ''; /* $authData['firstName']; $authData['familyName']; */ $referenceNo = 'Reference no.: ' . $this->jobRecord->stock->referenceNumber . ''; /* --------------------------------- TRANSUNION REPORT --------------------------------- */ $type = $this->jobRecord->stock->type; $this->append( '
' . 'TRANSUNION REPORT
' . '

' . ' ' ); #-> Receipt Detail $ReceiptDetail = ' '; $seller = $this->jobRecord->company->name; $this->append( 'I, the undersigned ' . $buyer . ' (known hereinafter as “The Purchaser”) declare that:- ' . '
' . '1. I am The Purchaser of the below-mentioned vehicle which was purchased from ' . $seller . ' (“The Seller”)' . 'by web-auction conducted by Bid4Cars on the ' . $auctionDate .'
' . '2. I hereby acknowledge having taken delivery from “The Seller” of the vehicle, the specifics of which are summarized here:-' . '
' ); /* --------------------------------- VEHICLE, DAMAGES, ACCESSORIES --------------------------------- */ #-> Vehicle details $vehicleDetail = ' '; $keys = $this->getStockParam('spareKeys', null); if (is_null($keys)) { $keys = ''; } else { $keys = $keys ? 'Yes' : 'No'; } $table = $this->newTable( array(55, 45), 'padding:0;margin:0;font-size:10px;', '', 'padding:2px 3px 2px 0;margin:0;' ); $table ->addTitle('Vehicle specifications', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1) ->addKeyValueDataSet(array( 'Year:' => $this->getStockSubParam('vehicleYear', 'name', ''), 'Category:' => $type->category->name, 'Make:' => $type->model->make->name, 'Model:' => $type->model->name, 'Type:' => $type->name, 'Registration no.:' => $this->getStockParam('registrationNumber', ''), 'Fuel type:' => $this->getStockSubParam('fuelType', 'name', ''), 'Transmission type:' => $this->getStockSubParam('transmissionType', 'name', ''), 'VIN no.:' => $this->getStockParam('vinNumber', ''), 'Engine no.:' => $this->getStockParam('engineNumber', ''), 'MM code:' => $type->mmCode, 'Kms:' => $this->getStockParam('km', ''), 'Condition:' => $this->getStockSubParam('condition', 'name', ''), 'Main exterior colour:' => $this->getStockSubParam('exteriorColour', 'name', ''), 'Main interior colour:' => $this->getStockSubParam('interiorColour', 'name', ''), 'Upholstery:' => $this->getStockSubParam('upholstery', 'name', ''), 'Papers:' => $this->getStockSubParam('papers', 'name', ''), 'Papers comments:' => $this->getStockParam('papersNotes', ''), 'Natis:' => $this->getStockSubParam('natis', 'name', ''), 'Spare keys:' => $keys, 'FSH:' => $this->getStockSubParam('fullServiceHistory', 'name', ''), 'FSH comments:' => $this->getStockParam('fshNotes', '') ), 0, '', 'color:#666;'); $vehicleDetail = $table->publish(); #-> Second row of data-blocks. $container = $this ->newTable( array(30, 5, 30, 5, 30), 'margin:0;font-size:10px;vertical-align:top;', '', 'padding:10px 0 0 0;' ) ->setCellValue(0, 0, $vehicleDetail); $this->append($container->publish() . '
'); /* --------------------------------- DELIVERY RECEIPT CONTINUE --------------------------------- */ $this->append( '
' . '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.' . '
' . '4. The provisions of the terms are to be read as if specifically set out and incorporated herein.' . '



' . 'DATED at ____________________________________________ on ' . $auctionDate . '



' . 'Signature : ____________________________' . '
' . 'Print Name : ' . $buyer . '
' . 'Who warrants being the authorized representative of the Purchaser.' . '
' . '
' ); $this->append( '
' . '' . '' . '' . '' . '' . '' . '' . '' . '
' . $dateOfPrint . ' ' . $printedBy . ' ' . $referenceNo . '
' . '
' . '
' ); } }