Image(ROOTDIR.'/assets/img/logo.png', 20, 25, 75);
elseif (file_exists(ROOTDIR.'/assets/img/logo.jpg')) $pdf->Image(ROOTDIR.'/assets/img/logo.jpg', 20, 25, 75);
elseif (file_exists(ROOTDIR.'/assets/img/logo.jpeg')) $pdf->Image(ROOTDIR.'/assets/img/logo.jpeg', 20, 25, 75);
else $pdf->Image(ROOTDIR.'/assets/img/placeholder.png', 20, 25, 75);
# Company Details
$pdf->SetFont($pdfFont,'',13);
$pdf->Cell(0,6,trim($companyaddress[0]),0,1,'R');
$pdf->SetFont($pdfFont,'',9);
for ( $i = 1; $i <= ((count($companyaddress)>6) ? count($companyaddress) : 6); $i += 1) {
$pdf->Cell(0, 4, trim($companyaddress[$i] ?? ''), 0, 1, 'R');
}
$pdf->Ln(5);
$pdf->SetFont($pdfFont,'B',10);
$tblhtml = "
| {$_LANG['quotenumber']} |
{$_LANG['quotesubject']} |
{$_LANG['quotedatecreated']} |
{$_LANG['quotevaliduntil']} |
| {$quotenumber} |
{$subject} |
{$datecreated} |
{$validuntil} |
";
$pdf->writeHTML($tblhtml, true, false, false, false, '');
$pdf->Ln(10);
$pdf->SetFont($pdfFont,'B',10);
$pdf->Cell(0,4,$_LANG['quoterecipient'],0,1);
$pdf->SetFont($pdfFont,'',9);
if ($clientsdetails["companyname"]) {
$pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L');
$pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');
} else {
$pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');
}
$pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L');
if ($clientsdetails["address2"]) {
$pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L');
}
$pdf->Cell(0,4,$clientsdetails["city"].', '.$clientsdetails["state"].', '.$clientsdetails["postcode"],0,1,'L');
$pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');
$pdf->Ln(10);
if ($proposal) {
$pdf->SetFont($pdfFont,'',9);
$pdf->MultiCell(170,5,$proposal);
$pdf->Ln(10);
}
$pdf->SetDrawColor(200);
$pdf->SetFillColor(239);
$pdf->SetFont($pdfFont,'',8);
$tblhtml = '
| '.$_LANG['quoteqty'].' |
'.$_LANG['quotedesc'].' |
'.$_LANG['quoteunitprice'].' |
'.$_LANG['quotediscount'].' |
'.$_LANG['quotelinetotal'].' |
';
foreach ($lineitems AS $item) {
$tblhtml .= '
| '.$item['qty'].' |
'.nl2br($item['description']).'
|
'.$item['unitprice'].' |
'.$item['discount'].' |
'.$item['total'].' |
';
}
$tblhtml .= '
| '.$_LANG['invoicessubtotal'].' |
'.$subtotal.' |
';
if ($taxlevel1['rate']>0) $tblhtml .= '
| '.$taxlevel1['name'].' @ '.$taxlevel1['rate'].'% |
'.$tax1.' |
';
if ($taxlevel2['rate']>0) $tblhtml .= '
| '.$taxlevel2['name'].' @ '.$taxlevel2['rate'].'% |
'.$tax2.' |
';
$tblhtml .= '
| '.$_LANG['invoicestotal'].' |
'.$total.' |
';
$pdf->writeHTML($tblhtml, true, false, false, false, '');
if ($notes) {
$pdf->Ln(6);
$pdf->SetFont($pdfFont,'',8);
$pdf->MultiCell(170,5,$_LANG['invoicesnotes'].": $notes");
}