", "\n", $set_ord['cust_address']);
echo $contentWithNewlines.'
';
}
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('Payment Receipt');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(4, 3, PDF_MARGIN_RIGHT);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
// add a page
$pdf->SetFont('times', 'A4', 12);
$pdf->AddPage();
$html='
';
$html.= ''.$set_deal['name'].' '; if($set_deal['address']!=''){ $contentWithNewlines = str_replace(" ", "\n", $set_deal['address']); $html.= $contentWithNewlines.' '; } $html.= $set_deal['city'].' '; $html.=$set_deal['state'].' '.$set_deal['postcode'].' '; if($set_deal['gst_no']!='' || $set_deal['gst_no']!=NULL){ $html.= 'GST NO: '.$set_deal['gst_no'].' '; } $html.='MOBILE: '.$set_deal['phone'].' |
';
$html.= ''.$set_ord['cust_name'] .' '; if($set_ord['cust_address']!='' || $set_ord['gst_no']!=NULL){ $contentWithNewlines = str_replace(" ", "\n", $set_ord['cust_address']); $html.= $contentWithNewlines.' '; } $html.= $set_sate['state'].' '.$set_ord['cust_pin'].' '; if($set_ord['gst_no']!='' || $set_ord['gst_no']!=NULL){ $html.= 'GST NO: '.$set_ord['gst_no'].' '; }else $html.='MOBILE: '.$set_ord['cust_phone'].''; $html.=' |
INVOICE NO.: '.$ref_id.' DATE :'.date('d-m-Y', strtotime($set_ord['created_at'])).' '; if($set_deal['gst']!='GST'){ $html.=' GST NO: '.$set_deal['gst'].' '; } $html.=' |
NO | PRODUCT NAME | HSN | RATE | QTY | TAX VALUE | GST% | '; if($set_ord['cust_state']==30){ $html.= 'CGST | SGST | '; }else{ $html.='IGST | '; } $html.= 'TOTAL |
---|---|---|---|---|---|---|---|---|---|---|
'.($i=$i + 1).' | '.$set_prod['name'].' '.$set_prod['product_url'].' | '.$ob->hsn.' | '.$ob->rate.' | '.$set_sales['qty'].' | '.$ob->taxable_value.' | '.$ob->gst_percent.'%'.' | '; if($set_ord['cust_state']==30){ $html.=''. $ob->cgst.' | '.$ob->sgst.' | '; }else{ $html.=''.$ob->igst.' | '; } $html.=''.$ob->total.' |
Total | '.$total_qty.' | '.$total_taxable_value.' | '; if($set_ord['cust_state']==30){ $html.=' | '.$cgst.' | '.$sgst.' | '; }else{ $html.=''.$igst.' | '; } $html.=''.$total.' |