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->stock->valuation)
&& !is_null($this->jobRecord->stock->valuation->$param)
? $this->jobRecord->stock->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: ' . date('Y-m-d H:i:s') . '';
$printedBy = 'Printed by: ' . $authData['firstName']
. ' ' . $authData['familyName'] . '';
$referenceNo = 'Reference no.: ' . $this->jobRecord->stock->referenceNumber . '';
/* --------------------------------- Buyer & Seller details --------------------------------- */
#-> Buyer & Seller details
$table = $this->newTable(
array(60, 40),
'padding:0;margin:0;font-size:10px;',
'',
'padding:2px 3px 2px 0;margin:0;'
);
$table
->addTitle('Buyer', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
->addKeyValueDataSet(array(
'Buyer dealership:' => $this->jobRecord->soldToCompany->name,
'Buyer name:' => $this->jobRecord->soldToCompany->contact->firstName,
'Buyer surname:' => $this->jobRecord->soldToCompany->contact->familyName,
'Buyer Mobile:' => $this->jobRecord->soldToCompany->contact->mobile,
'Buyer Email:' => $this->jobRecord->soldToCompany->contact->email,
), 0, 'font-weight:bold;', 'color:#666;');
$buyerDetail = $table->publish();
$table = $this->newTable(
array(60, 40),
'padding:0;margin:0;font-size:10px;',
'',
'padding:2px 3px 2px 0;margin:0;'
);
$table
->addTitle('Seller', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1)
->addKeyValueDataSet(array(
'Seller dealership:' => $this->jobRecord->company->name,
'Seller name:' => $this->jobRecord->company->contact->firstName,
'Seller surname:' => $this->jobRecord->company->contact->familyName,
'Seller Mobile:' => $this->jobRecord->company->contact->mobile,
'Seller Email:' => $this->jobRecord->company->contact->email,
), 0, 'font-weight:bold;', 'color:#666;');
$sellerDetail = $table->publish();
$container = $this
->newTable(
array(45, 10, 45),
'margin:0;font-size:10px;vertical-align:top;',
'',
'padding:10px 0 0 0;'
)
->setCellValue(0, 0, $buyerDetail)
->setCellValue(0, 2, $sellerDetail);
$this->append($container->publish() . '
');
/* --------------------------------- DECLARATION --------------------------------- */
$this->append(
'
' . $dateOfPrint . ' | ' . '' . ' | ' . $printedBy . ' | ' . '' . ' | ' . $referenceNo . ' | ' . '