getData('bill'); /** * @var \Modules\Billing\Models\BillElement[] $elements */ $elements = $bill->getElements(); $mpdf = new Mpdf([ 'mode' => 'utf-8', 'format' => 'A4-L', 'orientation' => 'L', 'margin_left' => 20, 'margin_right' => 15, 'margin_top' => 48, 'margin_bottom' => 25, 'margin_header' => 10, 'margin_footer' => 10, ]); $mpdf->SetDisplayMode('fullpage'); $mpdf->SetTitle($bill->getNumber()); $mpdf->SetAuthor('Karaka'); $html = '
Date: 13th November 2008
SOLD TO:

345 Anotherstreet
Little Village
Their City
CB22 6SO
  SHIP TO:

345 Anotherstreet
Little Village
Their City
CB22 6SO

'; foreach ($elements as $element) { $html .= ' '; } $html .= '
Ref. No. Quantity Description Unit Price Amount
' . $element->itemNumber . ' ' . $element->quantity . ' ' . $element->itemName . ' ' . $element->singleSalesPriceNet->getCurrency(null) . ' ' . $element->totalSalesPriceNet->getCurrency(null) . '
Subtotal: ' . $bill->netSales->getCurrency(null) . '
Tax: £18.25
Shipping: £42.56
TOTAL: ' . $bill->grossSales->getCurrency(null) . '
Deposit: £100.00
Balance due: £1782.56
Payment terms: payment due in 30 days
'; $mpdf->AddPage(); $mpdf->WriteHTML($html); $mpdf->Output($this->getData('path'), \Mpdf\Output\Destination::FILE);