namibia
df0489e1eeeeab5a9bd44e1d84fce49924fe1bac
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
<?php namespace Auction\Pdf; class Deliveryreceipt extends \Utility\Service\PdfTemplate { /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getStockParam($param, $default) { return !is_null($this->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; } /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getValuationParam($param, $default) { return !is_null($this->jobRecord->valuation) && !is_null($this->jobRecord->valuation->$param) ? $this->jobRecord->valuation->$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 = 'Date of print: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>'; $printedBy = 'Printed by: <span style="color:#333;">' . $authData['firstName'] . ' ' . $authData['familyName'] . '</span>'; $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->stock->referenceNumber . '</span>'; /* --------------------------------- DELIVERY RECEIPT --------------------------------- */ $type = $this->jobRecord->stock->type; $this->append( '<br /> <div style="font-size:16px;font-weight:bold;text-align:center">' . 'DELIVERY RECEIPT </div>' . '<br><br>' ); #-> Receipt Detail $ReceiptDetail = ' '; $buyer = $this->jobRecord->soldToCompany->name; $seller = $this->jobRecord->company->name; $this->append( 'I, the undersigned ' . $buyer . ' (known hereinafter as �The Purchaser�) declare that:- ' . '<br>' . '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 .'<br>' . '2. I hereby acknowledge having taken delivery from �The Seller� of the vehicle, the specifics of which are summarized here:-' . '<br>' ); /* --------------------------------- 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() . '<br />'); /* --------------------------------- DELIVERY RECEIPT CONTINUE --------------------------------- */ $this->append( '<div>' . '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.' . '<br>' . '4. The provisions of the terms are to be read as if specifically set out and incorporated herein.' . '<br><br><br><br>' . 'DATED at ____________________________________________ on ' . $auctionDate . '<br><br><br><br>' . 'Signature : ____________________________' . '<br>' . 'Print Name : ' . $buyer . '<br>' . 'Who warrants being the authorized representative of the Purchaser.' . '<br>' . '</div>' ); $this->append( '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">' . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">' . '<tr>' . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>' . $dateOfPrint . '</i></td>' . '<td style="width:5%"> </td>' . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>' . $printedBy . '</i></td>' . '<td style="width:5%"> </td>' . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>' . $referenceNo . '</i></td>' . '</tr>' . '</table>' . '<br>' . '</div>' ); } } |
Commits for namibiamodule/Auction/src/Auction/Pdf/Deliveryreceipt.php
Revision | Author | Commited | Message |
---|---|---|---|
df0489 ... | Mark | Fri 14 Oct, 2016 10:01:00 +0000 | initial commit |