5 class Portal extends \Utility\Service\PdfTemplate
12 protected $_title = 'Stock Information';
15 * @var \Stock\Entity\Stock
22 protected $showTradeDataOnly = true;
27 protected $showCustomerDetails = false;
32 protected $showValuationDetails = false;
37 protected $showMainImage = true;
42 protected $showPricingDetails = true;
47 protected $showVehicleDetails = true;
52 protected $showVehicleNotes = true;
57 protected $showDamageDetails = true;
62 protected $showAccessoryDetails = true;
67 protected $showSignatureLines = true;
72 protected $showTermsAndConditions = false;
77 protected $showOffersReceived = true;
82 protected $showOfferMade = true;
85 * Utility for easy parameter retrieval.
86 * @param string $param
87 * @param unknown $default
90 protected function getStockParam($param, $default)
92 return !is_null($this->jobRecord->$param) ? $this->jobRecord->$param : $default;
96 * Utility for easy parameter retrieval.
97 * @param string $param
98 * @param unknown $default
101 protected function getStockSubParam($ref, $param, $default)
103 $ref = !is_null($this->jobRecord->$ref) ? $this->jobRecord->$ref : null;
104 return is_object($ref) ? $ref->$param : $default;
108 * Utility for easy parameter retrieval.
109 * @param string $param
110 * @param unknown $default
113 protected function getValuationParam($param, $default)
115 return !is_null($this->jobRecord->valuation) && !is_null($this->jobRecord->valuation->$param) ? $this->jobRecord->valuation->$param : $default;
121 public function build()
123 #-> Set data item to work with.
124 $this->auctionRecord = $this->_input['jobRecord'];
125 $this->jobRecord = $this->_input['jobRecord']->stock;
126 $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
127 $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix();
128 $authData = \Utility\Registry::getAuthData();
129 $dateOfPrint = 'Date of print: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>';
130 $printedBy = 'Printed by: <span style="color:#333;">' . $authData['firstName']
131 . ' ' . $authData['familyName'] . '</span>';
132 $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->referenceNumber . '</span>';
135 /* --------------------------------- CUSTOMER, VALUATION, PRICING --------------------------------- */
136 $type = $this->jobRecord->type;
138 '<br /><div style="font-size:16px;font-weight:bold;">'
139 . $type->model->make->name . ' '
140 . $type->model->name . ' '
142 . $type->introYear->name . ' - '
143 . (!is_null($type->discYear) ? $type->discYear->name : 'Current') . ')'
144 . '</div><hr /><br />'
148 /* --------------------------------- CUSTOMER, VALUATION, PRICING --------------------------------- */
150 $customerDetail = ' ';
151 if ($this->showCustomerDetails)
153 $table = $this->newTable(
154 array(60, 40), 'padding:0;margin:0;font-size:10px;', '',
155 'padding:2px 3px 2px 0;margin:0;'
157 $department = $this->getValuationParam('department', null);
158 $department = !is_null($department) ? $department : ' ';
160 ->addTitle('Customer',
161 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
162 ->addKeyValueDataSet(array(
163 'Customer name:' => $this->getValuationParam('firstName', ''),
164 'Customer surname:' => $this->getValuationParam('familyName', ''),
165 'ID:' => $this->getValuationParam('idNumber', ''),
166 'Mobile:' => $this->getValuationParam('mobile', ''),
167 'Email:' => $this->getValuationParam('email', ''),
168 'Department:' => $department,
169 'Address:' => ' ',
170 '<span style="color:#FFF;font-size:20px;">a1</span>' => ' ',
171 '<span style="color:#FFF;font-size:10px;">1</span><span style="color:#000;font-size:10px;">______________________________________</span>' => ' ',
172 '<span style="color:#FFF;font-size:20px;">a</span>' => ' ',
173 '<span style="color:#FFF;font-size:10px;">2</span><span style="color:#000;font-size:10px;">______________________________________</span>' => ' ',
174 '<span style="color:#FFF;font-size:20px;">b</span>' => ' ',
175 '<span style="color:#FFF;font-size:10px;">3</span><span style="color:#000;font-size:10px;">______________________________________</span>' => ' '
176 ), 0, 'font-weight:bold;', 'color:#666;');
177 $customerDetail = $table->publish();
179 #-> Customer alternated with dealership details for traders.
180 if ($this->showTradeDataOnly)
182 $table = $this->newTable(
183 array(60, 40), 'padding:0;margin:0;font-size:10px;', '',
184 'padding:2px 3px 2px 0;margin:0;'
186 $department = $this->getValuationParam('department', null);
187 $department = !is_null($department) ? $department : ' ';
188 $contact = $this->getStockSubParam('company', 'contact', null);
190 ->addTitle('Dealership',
191 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
192 ->addKeyValueDataSet(array(
193 'Dealership name:' => $this->getStockSubParam('company', 'name', ''),
194 'Contact:' => !is_null($contact) ? $contact->firstName . ' ' . $contact->familyName : '',
195 'Mobile:' => !is_null($contact) ? $contact->mobile : '',
196 'Email:' => !is_null($contact) ? $contact->email : ''
197 ), 0, 'font-weight:bold;', 'color:#666;');
198 $customerDetail = $table->publish();
202 $valuationDetail = ' ';
203 if ($this->showValuationDetails)
205 $table = $this->newTable(
206 array(55, 45), 'padding:0;margin:0;font-size:10px;', '',
207 'padding:2px 3px 2px 0;margin:0;'
210 ->getRepository('\Auction\Entity\Auction')
211 ->findOneBy(array('stock' => $this->jobRecord));
212 $pgLoaded = !is_null($pgItem) ? $pgItem->created->format($dateTimeFormat) : ' ';
213 $valCreated = $this->getValuationParam('created', null);
214 $valCreated = !is_null($valCreated) ? $valCreated->format($dateTimeFormat) : ' ';
216 ->addTitle('Valuation details',
217 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
218 ->addKeyValueDataSet($this->showTradeDataOnly ? array(
219 'Date created:' => $valCreated,
220 'Date loaded on price guide:' => $pgLoaded
222 'Date created:' => $valCreated,
223 'Valuation no.:' => $this->getValuationParam('valuationNumber', ''),
224 'Reference no.:' => $this->getStockParam('referenceNumber', ''),
225 'Date loaded on price guide:' => $pgLoaded
226 ), 0, 'font-weight:bold;', 'color:#F00;');
227 $valuationDetail = $table->publish();
229 $mainImage = ' ';
230 if ($this->showMainImage)
232 $pic = $this->getStockParam('mainImage', '');
235 $mainImage = '<img src="' . __DIR__ . '/../../../../../public/img/bin/' . $pic->filename . '" style="padding:0;margin:0;width:100%;" />';
240 $pricingDetail = ' ';
241 $total = $this->getValuationParam('overAllowance', '0.00') + $this->getValuationParam('amountOffered',
243 $total = number_format($total, 2, '.', '');
244 if ($this->showPricingDetails)
246 $table = $this->newTable(
247 array(60, 40), 'padding:0;margin:0;font-size:10px;', '',
248 'padding:2px 3px 2px 0;margin:0;'
251 ->addTitle('Pricing details',
252 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
253 ->addKeyValueDataSet($this->showTradeDataOnly ? array(
254 'Trade:' => $currencyPrefix . $this->getStockParam('tradePrice',
256 'Retail:' => $currencyPrefix . $this->getStockParam('retailPrice',
258 'List:' => $currencyPrefix . $this->getStockParam('listPrice',
260 'Reserve price:' => $currencyPrefix . $this->auctionRecord->reservePrice,
261 'Highest bid:' => $currencyPrefix . $this->getStockParam('highestBid',
266 /* 'Amount offered:' => $currencyPrefix . $this->getValuationParam('amountOffered', '0.00'), */
267 /* 'O.A.:' => $currencyPrefix . $this->getValuationParam('overAllowance', '0.00'), */
268 /* 'Total offer:' => $currencyPrefix . $total, // total offer = amount offered + O.A */
270 'Trade:' => $currencyPrefix . $this->getStockParam('tradePrice',
272 'Retail:' => $currencyPrefix . $this->getStockParam('retailPrice',
274 'List:' => $currencyPrefix . $this->getStockParam('listPrice',
276 'Amount offered:' => $currencyPrefix . $this->getValuationParam('amountOffered',
278 'O.A.:' => $currencyPrefix . $this->getValuationParam('overAllowance',
280 'Total offer:' => $currencyPrefix . $total, // total offer = amount offered + O.A
281 'Projected retail:' => $currencyPrefix,
282 'Planned margin:' => $currencyPrefix,
283 'Price guide highest offer:' => $currencyPrefix . $this->getStockParam('highestOffer',
285 ), 0, 'font-weight:bold;', 'color:#F00;');
286 $pricingDetail = $table->publish();
289 #-> First row of data-blocks.
290 if ($this->showCustomerDetails || $this->showValuationDetails || $this->showMainImage || $this->showPricingDetails)
294 array(30, 5, 30, 5, 30),
295 'margin:0;font-size:10px;vertical-align:top;', '',
296 'padding:10px 0 0 0;'
298 ->setCellValue(0, 0, $customerDetail)
299 ->setCellValue(0, 2, $pricingDetail)
300 ->setCellValue(0, 4, $valuationDetail . $mainImage);
301 $this->append($container->publish() . '<br />');
304 /* --------------------------------- Buyer Details --------------------------------- */
307 $table = $this->newTable(
308 array(30, 30), 'padding:0;margin:0;font-size:10px;', '',
309 'padding:2px 3px 2px 0;margin:0;'
313 ->addTitle('Buyers Details',
314 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
315 ->addKeyValueDataSet(array(
316 'Dealership name:' => $this->auctionRecord->soldToCompany->name,
317 'Contact:' => !is_null($this->auctionRecord->soldToProfile) ? $this->auctionRecord->soldToProfile->firstName . ' ' . $this->auctionRecord->soldToProfile->familyName : '',
318 'Mobile:' => !is_null($this->auctionRecord->soldToProfile) ? $this->auctionRecord->soldToProfile->mobile : '',
319 'Email:' => !is_null($this->auctionRecord->soldToProfile) ? $this->auctionRecord->soldToProfile->email : ''
320 ), 0, 'font-weight:bold;', 'color:#666;');
321 $buyerDetails = $table->publish();
323 $this->append($buyerDetails . '<br />');
327 /* --------------------------------- VEHICLE, DAMAGES, ACCESSORIES --------------------------------- */
330 $vehicleDetail = ' ';
331 if ($this->showVehicleDetails)
333 $keys = $this->getStockParam('spareKeys', null);
340 $keys = $keys ? 'Yes' : 'No';
342 $table = $this->newTable(
343 array(55, 45), 'padding:0;margin:0;font-size:10px;', '',
344 'padding:2px 3px 2px 0;margin:0;'
347 ->addTitle('Vehicle specifications',
348 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
349 ->addKeyValueDataSet(array(
350 'Year:' => $this->getStockSubParam('vehicleYear', 'name', ''),
351 'Category:' => $type->category->name,
352 'Make:' => $type->model->make->name,
353 'Model:' => $type->model->name,
354 'Type:' => $type->name,
355 'Registration no.:' => $this->getStockParam('registrationNumber', ''),
356 'Fuel type:' => $this->getStockSubParam('fuelType', 'name', ''),
357 'Transmission type:' => $this->getStockSubParam('transmissionType',
359 'VIN no.:' => $this->getStockParam('vinNumber', ''),
360 'Engine no.:' => $this->getStockParam('engineNumber', ''),
361 'MM code:' => $type->mmCode,
362 'Kms:' => $this->getStockParam('km', ''),
363 'Condition:' => $this->getStockSubParam('condition', 'name', ''),
364 'Main exterior colour:' => $this->getStockSubParam('exteriorColour',
366 'Main interior colour:' => $this->getStockSubParam('interiorColour',
368 'Upholstery:' => $this->getStockSubParam('upholstery', 'name', ''),
369 'Papers:' => $this->getStockSubParam('papers', 'name', ''),
370 'Papers comments:' => $this->getStockParam('papersNotes', ''),
371 'Natis:' => $this->getStockSubParam('natis', 'name', ''),
372 'Spare keys:' => $keys,
373 'FSH:' => $this->getStockSubParam('fullServiceHistory', 'name', ''),
374 'FSH comments:' => $this->getStockParam('fshNotes', ''),
375 'Stock number:' => $this->getStockParam('stockNumber', '')
376 ), 0, '', 'color:#666;');
377 $vehicleDetail = $table->publish();
381 $damagesDetail = ' ';
382 if ($this->showDamageDetails)
384 $damageData = array();
385 $damages = $this->jobRecord->damagesToArray();
386 foreach ($damages as $damage)
388 $damageData[$damage['damage']['name'] . ':'] = $currencyPrefix . $damage['amount'];
390 $damageData['Total estimated repair cost:'] = '<span style="color:#F00;">' . $currencyPrefix . $this->getStockParam('damageTotal',
392 $damageData['Damages comments:'] = $this->getStockParam('damageNotes', '');
393 $damageData['Previous repairs noted:'] = $this->getStockParam('previousRepairsNoted',
394 false) ? 'Yes' : 'No';
395 $damageData['Previous repairs comments:'] = $this->getStockParam('previousRepairsNotes',
397 $table = $this->newTable(
398 array(50, 50), 'padding:0;margin:0;font-size:10px;', '',
399 'padding:2px 3px 2px 0;margin:0;'
401 $type = $this->jobRecord->type;
403 ->addTitle('Damages',
404 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
405 ->addKeyValueDataSet($damageData, 0, '', 'color:#666;');
406 $damagesDetail = $table->publish();
410 $accessoriesDetail = ' ';
411 if ($this->showAccessoryDetails)
415 $accessories = $this->jobRecord->accessoriesToArray();
416 foreach ($accessories as $accessory)
418 $accs[] = $accessory['accessory']['name'];
422 for ($i = 0; $i <= count($accs); $i += 2)
424 if (isset($accs[$i]))
426 $accData[$accs[$i]] = isset($accs[$i + 1]) ? $accs[$i + 1] : '';
430 $accData['<span style="color:#000;font-size:10px;">Comments:</span>'] = '<span style="color:#666;font-size:10px;">' . $this->getStockParam('accessoryNotes',
432 $table = $this->newTable(
433 array(50, 50), 'padding:0;margin:0;font-size:9px;', '',
434 'padding:2px 3px 2px 0;margin:0;'
436 $type = $this->jobRecord->type;
438 ->addTitle('Accessories',
439 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
440 ->addKeyValueDataSet($accData, 0, 'color:#666;', 'color:#666;');
441 $accessoriesDetail = $table->publish();
444 #-> Second row of data-blocks.
445 if ($this->showVehicleDetails || $this->showDamageDetails || $this->showAccessoryDetails)
449 array(30, 5, 30, 5, 30),
450 'margin:0;font-size:10px;vertical-align:top;', '',
451 'padding:10px 0 0 0;'
453 ->setCellValue(0, 0, $vehicleDetail)
454 ->setCellValue(0, 2, $damagesDetail)
455 ->setCellValue(0, 4, $accessoriesDetail);
456 $this->append($container->publish() . '<br />');
459 /* --------------------------------- VEHICLE NOTES --------------------------------- */
461 $VehicleNotes = ' ';
462 if ($this->showVehicleNotes)
464 $table = $this->newTable(
465 array(55, 45), 'padding:0;margin:0;font-size:10px;', '',
466 'padding:15px 15px 15px 0;margin:0;'
470 '1______________________________________________________________________________________________________________________________________' => ' ',
471 '2______________________________________________________________________________________________________________________________________' => ' ',
472 '3______________________________________________________________________________________________________________________________________' => ' '
477 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
478 ->addKeyValueDataSet($dSet, 0, '', 'color:#666;');
479 $VehicleNotes = $table->publish();
481 #-> Third row of data-blocks.
482 if ($this->showVehicleNotes)
486 array(30, 5, 30, 5, 30),
487 'margin:0;font-size:10px;vertical-align:top;', '',
488 'padding:10px 0 0 0;'
490 ->setCellValue(0, 0, $VehicleNotes);
491 $this->append($container->publish() . '<br />');
498 /* --------------------------------- SIGNATURES --------------------------------- */
500 if ($this->showSignatureLines)
503 $this->newSignatureLine()
504 ->addSignatureLine('Customer (name)', 'Signature', 'Date')
505 ->addSignatureLine('Manager (name)', 'Signature', 'Date')
511 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
512 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
514 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
515 . $dateOfPrint . '</i></td>'
516 . '<td style="width:5%"> </td>'
517 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
518 . $printedBy . '</i></td>'
519 . '<td style="width:5%"> </td>'
520 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
521 . $referenceNo . '</i></td>'
530 /* --------------------------------- TERMS AND CONDITIONS --------------------------------- */
531 #-> Terms and Conditions.
532 if ($this->showTermsAndConditions)
535 $this->append('<br/>');
537 $table = $this->newTable(
538 array(90, 10), 'padding:0;margin:0;font-size:9px;', '',
539 'padding:2px 3px 2px 0;margin:0;'
541 $type = $this->jobRecord->type;
543 ->addTitle('Terms and Conditions',
544 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
545 ->addKeyValueDataSet(array(
546 'I acknowledge, confirm and agree that:' => '',
547 '1. Ownership' => '',
548 '1.1. I am the owner of my trade-in vehicle and I am legally allowed to sell my trade-in vehicle.' => 'Yes / No',
549 '1.2. I am a South African resident.' => 'Yes / No',
550 '1.3. My trade-in vehicle is not subject to a claim of any nature whatsoever by any other person or entity and I '
551 . 'indemnify the Dealer against any claims of any ' => 'Yes / No',
552 '1.4. If my trade-in vehicle is subject to any claim by any other person or entity, the Dealer will not be bound '
553 . 'to this valuation.' => 'Yes / No',
554 '2. VAT Registration' => '',
555 'This transaction is subject to the payment of VAT.' => 'Yes / No',
556 '3. Status of the Vehicle' => '',
557 '3.1. My trade-in vehicle was new when I purchased it.' => 'Yes / No',
558 '3.2. My trade-in vehicle has been used for self-drive hire or taxi work.' => 'Yes / No',
559 '3.3. My trade-in vehicle has a full service history.' => 'Yes / No',
560 '3.4. My trade in vehicle has not been involved in any accident.' => 'Yes / No',
561 '3.5. If my trade-in vehicle has been involved in an accident, there was a total loss claim made (Stolen & Recovered).' => 'Yes / No',
562 '3.6. A current registration paper has been handed over by me.' => 'Yes / No',
563 '3.7. I have supplied the owners and service manuals to the Dealer.' => 'Yes / No',
564 '3.8. My trade-in vehicle is subject to a service and/or maintenance plan and/or warranty.' => 'Yes / No',
565 '4. Status of the Vehicle' => '',
566 'The Dealer will only be bound by its appraised trade-in value of my trade-in vehicle as far as the trade-in has '
567 . 'been approved and accepted in writing by either the dealer principle, designated sales manager or used car manager'
568 . ' and the parties have entered into the Dealer\'s standard Offer to Purchase in respect of my trade-in vehicle.' => '',
569 '5. Outstanding Finance' => '',
570 '5.1. The Dealer, in its absolute and sole discretion, may agree to settle the existing finance in lieu of payment '
571 . '(or part payment) of the trade-in vehicle to me.' => '',
572 '5.2. If the agreed trade-in allowance of the trade-in vehicle is lower than the settlement figure in clause 5.1 above, '
573 . 'I must pay the Registered Credit Provider the difference between the settlement figure and the trade-in allowance with '
574 . 'proof of such payment (made to the registered Credit Provider) submitted to the Dealer prior to the signing of the Offer to Purchase.' => '',
575 '5.3. I will remain liable to the registered Credit Provider in respect of the related finance at all times until the '
576 . 'credit Agreement has been legally terminated.' => '',
577 '5.4. For purposes of clarity, the Dealer does not accept any liability with respect to the related finance set out in '
578 . 'clause 5.4 above at any time or for any reason.' => '',
579 '5.5. The Dealer will use its best endeavors to pay the trade-in allowance to the registered Credit Provider as soon as '
580 . 'is reasonably possible. However the Dealer accepts no liability for any costs or liability incurred by me as a result '
581 . 'of any delay in the payment by the Dealer.' => '',
582 '6. No Financial Advice' => '',
583 'This trade-in valuation does not constitute financial advice to me as contemplated in the Financial Advisory and '
584 . 'Intermediary Services Act 37 of 2002 but is subject to the Consumer Protection Act 68 of 2008.' => '',
586 '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 '
587 . '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.' => '',
588 '8. The Dealer\'s right to withdraw from the offer' => '',
589 'The Dealer is bound by this offer only in so far as:' => '',
590 '8.1. I have signed an Offer to Purchase with the same Dealer in respect of this valuation; and' => '',
591 '8.2. Fewer than 7 (seven) days have passed since the issuing of this valuation; and' => '',
592 '8.3. My trade-in vehicle is in the same condition as the date of inspection; and' => '',
593 '8.4. This trade-in valuation was signed by the Valuator and the Manager of the Dealer.' => '',
594 ' <br /> ' => '',
595 'I HAVE READ THE ABOVE TERMS AND CONDITIONS AND CONFIRM MY UNDERSTANDING AND AGREE TO BE BOUND THERETO.' => '',
596 ' <br /> ' => '',
598 'By signing this form, I agree to the [Dealership Name] valuation terms and conditions above.' => '',
599 ' <br /> <br /> <br /> <br /> <br />' => '',
600 '<b>Signature:</b>' => '',
602 'Date: ' . date('Y-m-d') => ''
603 ), 0, 'color:#333;', 'color:#000;');
604 $this->append($table->publish() . '<br />');
607 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
608 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
610 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
611 . $dateOfPrint . '</i></td>'
612 . '<td style="width:5%"> </td>'
613 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
614 . $printedBy . '</i></td>'
615 . '<td style="width:5%"> </td>'
616 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
617 . $referenceNo . '</i></td>'
625 /* --------------------------------- OFFERS RECEIVED/MADE --------------------------------- */
627 if ($this->showOffersReceived || $this->showOfferMade)
631 if ($this->showOffersReceived)
635 ->getRepository('\PriceGuide\Entity\PriceGuide')
636 ->findBy(array('stock' => $this->jobRecord));
637 if (!empty($pgItems))
639 foreach ($pgItems as $pgItem)
641 $iterator = $pgItem->offers->getIterator();
642 foreach ($iterator as $offer)
644 $status = $offer->status;
646 $offer->company->name,
647 $offer->created->format($dateTimeFormat),
648 $currencyPrefix . $offer->amount,
649 $offer->profile->mobile,
650 $offer->profile->email,
657 $this->append('<br/>');
658 $table = $this->newTable(
659 array(20, 15, 15, 10, 30, 10),
660 'padding:0;margin:0;font-size:10px;',
662 'padding:2px 5px 2px 2px;margin:0;'
665 ->addTitle('Offers received', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
666 ->setColumnHeaders(array(
667 'Buyer', 'Date', 'Offer', 'Mobile', 'Email', 'Status'
668 ), array(20, 15, 15, 10, 30, 10),
669 'padding:2px 2px 2px 5px;background-color:#F00;color:#FFF;font-weight:bold;font-size:10px;')
670 ->setDataSet($offers);
671 $this->append($table->publish() . '<br />');
674 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
675 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
677 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
678 . $dateOfPrint . '</i></td>'
679 . '<td style="width:5%"> </td>'
680 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
681 . $printedBy . '</i></td>'
682 . '<td style="width:5%"> </td>'
683 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
684 . $referenceNo . '</i></td>'
694 if ($this->showOfferMade)
698 ->getRepository('\PriceGuide\Entity\PriceGuide')
699 ->findOneBy(array('stock' => $this->jobRecord));
700 if (!is_null($pgItem))
702 $companyId = \Utility\Registry::resolveCompanyContext();
703 $iterator = $pgItem->offers->getIterator();
704 foreach ($iterator as $offer)
706 $status = $offer->status;
708 $offer->company->name,
709 $offer->created->format($dateTimeFormat),
710 $currencyPrefix . $offer->amount,
711 $offer->profile->mobile,
712 $offer->profile->email,
717 $table = $this->newTable(
718 array(20, 15, 15, 10, 30, 10),
719 'padding:0;margin:0;font-size:10px;',
721 'padding:2px 5px 2px 2px;margin:0;'
725 $this->append('<br/>');
727 ->addTitle('Offers made', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
728 ->setColumnHeaders(array(
729 'Buyer', 'Date', 'Offer', 'Mobile', 'Email', 'Status'
730 ), array(20, 15, 15, 10, 30, 10),
731 'padding:2px 2px 2px 5px;background-color:#F00;color:#FFF;font-weight:bold;font-size:10px;')
732 ->setDataSet($offers);
733 $this->append($table->publish() . '<br />');
736 '<div style="position:absolute;bottom:0;left:0;padding:0;margin:0;width:100%;">'
737 . '<table cellpadding="0px" cellspacing="0px" style="border:0px;width:100%;">'
739 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
740 . $dateOfPrint . '</i></td>'
741 . '<td style="width:5%"> </td>'
742 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
743 . $printedBy . '</i></td>'
744 . '<td style="width:5%"> </td>'
745 . '<td style="width:30%;border-bottom: solid 1px #333;font-size:10px;font-weight:bold;color:#666;"><i>'
746 . $referenceNo . '</i></td>'
759 // /* --------------------------------- BID HISTORY --------------------------------- */
760 // $this->nextPage();
761 // $table = $this->newTable(
762 // array(20, 15, 10, 10, 20, 15, 10), 'padding:0;margin:0;font-size:10px;',
763 // '', 'padding:2px 3px 2px 0;margin:0;'
767 // ->addTitle('Bid History',
768 // 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1);
770 // $table->setColumnHeaders(array(
778 // ), array(20, 15, 10, 10, 20, 15, 10), 'font-weight: bold; color: #ffffff; background-color: #D42E30;');
781 // foreach ($this->auctionRecord->bids as $bid)
784 // $bid->company->name,
785 // $bid->profile->firstName . ' ' . $bid->profile->familyName,
787 // $bid->profile->mobile,
788 // $bid->profile->email,
789 // $bid->created->format('Y-m-d H:i:s'),
794 // $table->setDataSet($data);
797 // $bidHistory = $table->publish();
799 // $this->append($bidHistory . '<br />');