Example #1
0
    public function pdf(Request $request, $pid)
    {
        $profile = Companyprofile::get();
        foreach ($profile as $com) {
            $cid = $com->id;
            $cname = $com->name;
            $aaddress = $com->address;
            $tele = $com->telephone;
            $mobile = $com->mobile;
            $email = $com->email;
            $url = $com->url;
            $file = $com->file;
        }
        $var = array($pid);
        $spname = "viewpurchase";
        $value = Info::callinfo($var, $spname);
        foreach ($value as $valu) {
            $pname = $valu->pname;
            $purchasedate = $valu->purchasedate;
            $sname = $valu->sname;
            $address = $valu->address;
            $challanno = $valu->challanno;
            $suppliersbillno = $valu->suppliersbillno;
            $suppliersbilldate = $valu->suppliersbilldate;
            $discount = $valu->discount;
            $others_exp = $valu->others_exp;
            $gross_total = $valu->gross_total;
            $status = $valu->status;
        }
        $pdate = date_create($purchasedate);
        $sdate = date_create($suppliersbilldate);
        $spname1 = "purchasedetailsview";
        $value1 = Info::callinfo($var, $spname1);
        $sum = 0;
        foreach ($value1 as $valu) {
            $a = $valu->amount;
            $sum = $sum + $a;
        }
        PDF::AddPage();
        $html1 = '<p></p>
										
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $aaddress . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
						
						  <div>';
        $hst = '<h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						  &nbsp;&nbsp;<u>PURCHASE VOUCHER</u></h2>';
        $hex = '<table border="0" style="width:100%">
								 <tr>
										
										<td>Supplier Name:' . $sname . '</td>
										<td></td>
										<td>Voucher No:' . $pname . '</td>
										
									</tr>
									<tr>
									
										<td>Bill No:' . $suppliersbillno . '</td>
										<td></td>
										<td>Challan No:' . $challanno . '</td>
										
									</tr>
									<tr>
									
										<td>Address:' . $address . '</td>
										<td></td>
										<td>Purchase Date:' . date_format($pdate, "d/m/Y") . '</td>
										
									</tr>
									
									
								
								</table> 
							</div>
							<div>
						
						
					<table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">
					  <tr>
						<th>Item Name</th>
						<th>Quantity</th>
						<th>Measurement Unit</th>
						<th>Rate</th>
						<th>Amount</th>
					  </tr>';
        $html1 = $html1 . $hst . $hex;
        $html2 = '';
        foreach ($value1 as $valu) {
            $html = '<tr><td style="background-color:#ffffff;">' . $valu->iname . '</td>
				<td style="background-color:#ffffff;">' . $valu->quantity . '</td>
				<td style="background-color:#ffffff;">' . $valu->mname . '</td>
				<td style="background-color:#ffffff;">' . $valu->rate . '</td>
				<td style="background-color:#ffffff;">' . $valu->amount . '</td></tr>';
            $html2 = $html2 . $html;
        }
        $html3 = '<tr><td colspan="4" align="right" style="background-color:#ffffff;">';
        $html4 = '';
        $html5 = 'Sub Total:</td><td style="background-color:#ffffff;">' . number_format($sum, 2, '.', '') . '</td></tr>';
        $html6 = '
		      <tr><td colspan="4" align="right" style="background-color:#ffffff;">Discount:</td><td style="background-color:#ffffff;">' . number_format($discount, 2, '.', '') . '</td></tr>';
        $html7 = '
		       <tr><td colspan="4" align="right" style="background-color:#ffffff;">Others Exp.:</td><td style="background-color:#ffffff;">' . number_format($others_exp, 2, '.', '') . '</td></tr>';
        $html8 = '
		       <tr><td colspan="4" align="right" style="background-color:#ffffff;">Gross Total:</td><td style="background-color:#ffffff;">' . number_format($gross_total, 2, '.', '') . '</td></tr>';
        $html9 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord(number_format($gross_total, 2, '.', '')) . ' Taka Only</h4></div>
					<div>
					
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
        $html = $html1 . $html2 . $html3 . $html4 . $html5 . $html6 . $html7 . $html8 . $html9;
        PDF::writeHTML($html, true, false, true, false, '');
        PDF::Output('purchase.pdf');
    }
Example #2
0
    public function printcollection()
    {
        $profile = Companyprofile::get();
        foreach ($profile as $com) {
            $id = $com->id;
            $cname = $com->name;
            $address = $com->address;
            $tele = $com->telephone;
            $mobile = $com->mobile;
            $email = $com->email;
            $url = $com->url;
            $file = $com->file;
        }
        $spname = "todaycollection";
        $c = Combo::callcombo($spname);
        $spname3 = "todaycash";
        $c5 = Combo::callcombo($spname3);
        $spname4 = "todaybankcollection";
        $c6 = Combo::callcombo($spname4);
        $spname5 = "todaycashcollection";
        $c7 = Combo::callcombo($spname5);
        $spname6 = "todaybkashcollection";
        $c8 = Combo::callcombo($spname6);
        $spsap = "todaysapcollection";
        $csap = Combo::callcombo($spsap);
        $spkcs = "todaykcscollection";
        $ckcs = Combo::callcombo($spkcs);
        $spmbank = "todaymbankcollection";
        $cmbank = Combo::callcombo($spmbank);
        foreach ($c6 as $cc) {
            $totalbankcash = $cc->cash;
        }
        foreach ($c7 as $ccc) {
            $totalhandcash = $ccc->cash;
        }
        foreach ($c8 as $ccc) {
            $totalbkash = $ccc->cash;
        }
        foreach ($csap as $ccc) {
            $totalsap = $ccc->cash;
        }
        foreach ($ckcs as $ccc) {
            $totalkcs = $ccc->cash;
        }
        foreach ($cmbank as $ccc) {
            $totalmbank = $ccc->cash;
        }
        $sum = 0;
        foreach ($c as $p) {
            $a = $p->amount;
            $sum = $sum + $a;
        }
        PDF::AddPage('L');
        $html1 = '
			<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
						
						<h2>
					    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<u>Statement of Daily Collection</u></h2><h4><br>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Date: ' . date("d/m/Y") . '  To  ' . date("d/m/Y") . '</h4>
						</div>
						
				<table border="1" style="background-color:lightblue; width:100%; padding:20px;">	
					<tr>
						<th style="width:3%;">SL</th>
						<th style="width:10%;">Name</th>
						<th style="width:12%;">Present Address</th>
						<th>Amount</th>
						<th style="width:7%;">Voucher No.</th>
						<th>Bank Amount</th>
						<th>Cash</th>
						<th>BKash</th>
						<th>SAP</th>
						<th>KCS</th>
						<th>MBank</th>
						<th>Total</th>
					</tr>';
        $html2 = '';
        $i = 1;
        $sum = 0;
        foreach ($c as $p) {
            if ($p->type == 3) {
                $bankamount = $p->amount;
                $cashamount = '';
                $bkash = '';
                $sap = '';
                $kcs = '';
                $mbank = '';
            } else {
                if ($p->type == 4) {
                    $bankamount = '';
                    $cashamount = $p->amount;
                    $bkash = '';
                    $sap = '';
                    $kcs = '';
                    $mbank = '';
                } else {
                    if ($p->type == 6) {
                        $bankamount = '';
                        $cashamount = '';
                        $bkash = $p->amount;
                        $sap = '';
                        $kcs = '';
                        $mbank = '';
                    } else {
                        if ($p->type == 7) {
                            $bankamount = '';
                            $cashamount = '';
                            $bkash = '';
                            $sap = $p->amount;
                            $kcs = '';
                            $mbank = '';
                        } else {
                            if ($p->type == 8) {
                                $bankamount = '';
                                $cashamount = '';
                                $bkash = '';
                                $sap = '';
                                $kcs = $p->amount;
                                $mbank = '';
                            } else {
                                if ($p->type == 9) {
                                    $bankamount = '';
                                    $cashamount = '';
                                    $bkash = '';
                                    $sap = '';
                                    $kcs = '';
                                    $mbank = $p->amount;
                                }
                            }
                        }
                    }
                }
            }
            $html = '<tr><td style="background-color:#ffffff;">' . $i . '</td>
				<td style="background-color:#ffffff;">' . $p->name . '</td>
				<td style="background-color:#ffffff;">' . $p->preaddress . '</td>
				<td style="background-color:#ffffff;">' . $p->amount . '</td>
				<td style="background-color:#ffffff;"><a href="http://192.168.1.8/IMS/voucher/pdf/' . $p->id . '/' . $p->type . '"   target="_blank">' . $p->vnno . '</a></td>					
				<td style="background-color:#ffffff;">' . $bankamount . '</td>
				<td style="background-color:#ffffff;">' . $cashamount . '</td>
				<td style="background-color:#ffffff;">' . $bkash . '</td>
				<td style="background-color:#ffffff;">' . $sap . '</td>
				<td style="background-color:#ffffff;">' . $kcs . '</td>
				<td style="background-color:#ffffff;">' . $mbank . '</td>
				<td style="background-color:#ffffff;">' . $p->amount . '</td>
				</tr>';
            $html2 = $html2 . $html;
            $i++;
            $sum = $sum + $p->amount;
        }
        $html3 = '<tr><td colspan="5" align="right" style="background-color:#ffffff;">';
        $html4 = '';
        $html5 = 'Total:</td>
				<td style="background-color:#ffffff;">' . $totalbankcash . '</td>
				<td style="background-color:#ffffff;">' . $totalhandcash . '</td>
				<td style="background-color:#ffffff;">' . $totalbkash . '</td>
				<td style="background-color:#ffffff;">' . $totalsap . '</td>
				<td style="background-color:#ffffff;">' . $totalkcs . '</td>
				<td style="background-color:#ffffff;">' . $totalmbank . '</td>
				<td style="background-color:#ffffff;">' . number_format($sum, 2, '.', '') . '</td></tr>';
        $html6 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord(number_format($sum, 2, '.', '')) . ' Taka Only</h4></div>
						<div>
					
						</div>
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Prepared By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;						
						  Checked By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


						Approved By
						  </h3>
						
						
							
						</div>';
        $html = $html1 . $html2 . $html3 . $html4 . $html5 . $html6;
        PDF::writeHTML($html, true, false, true, false, '');
        PDF::Output('vp.pdf');
    }
    public function pdf(Request $request, $id)
    {
        $profile = Companyprofile::get();
        foreach ($profile as $com) {
            $cid = $com->id;
            $cname = $com->name;
            $aaddress = $com->address;
            $tele = $com->telephone;
            $mobile = $com->mobile;
            $email = $com->email;
            $url = $com->url;
            $file = $com->file;
        }
        $var = array($id);
        $spname = "ledgerentry";
        $value = Info::callinfo($var, $spname);
        //print_r($value);
        foreach ($value as $valu) {
            $id = $valu->id;
            $amount = $valu->amount;
            $description = $valu->description;
            $name = $valu->name;
            $code = $valu->code;
            $created_at = $valu->created_at;
        }
        $date = date_create($created_at);
        PDF::AddPage();
        $html1 = '
				<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $aaddress . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Ledger Voucher</u></h2>
								 <table border="0" style="width:100%">
									<tr>
										
										<td>Accounts Name:' . $name . '</td>
										<td></td>
										<td>Manual V. No:7</td>
										
									</tr>
									

								
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $created_at . '</td>
									</tr>
									<tr>
								   
									<td>Description:' . $description . '</td>
										<td></td>
										<td></td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:35%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:15%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
        $coa = DB::table('coa')->where('id', 1)->first();
        $html2 = '
			<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $name . '</td>
				<td style="background-color:#ffffff;">' . $code . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $coa->name . '</td>
				<td style="background-color:#ffffff;">' . $coa->code . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
		
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
        $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div>
					
						</div>
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
        $html = $html1 . $html2 . $html3;
        PDF::writeHTML($html, true, false, true, false, '');
        PDF::Output('ledgerentry.pdf');
    }
    public function pdf(Request $request, $id, $type, $status)
    {
        //echo $id.$type.$status;
        $voucher = DB::table('voucher')->where('id', $id)->first();
        //print_r($voucher);
        $vnno = $voucher->vnno;
        $amount = $voucher->amount;
        $sid = $voucher->sid;
        $cid = $voucher->cid;
        $type = $voucher->type;
        $vdate = $voucher->vdate;
        //echo '<br>';
        $vouchercontra = DB::table('vouchercontra')->where('vid', $voucher->id)->first();
        //print_r($vouchercontra);
        $vid = $vouchercontra->vid;
        $baccid = $vouchercontra->baccid;
        $checkno = $vouchercontra->checkno;
        $cashid = $vouchercontra->cashid;
        $profile = Companyprofile::get();
        foreach ($profile as $com) {
            $cid = $com->id;
            $cname = $com->name;
            $address = $com->address;
            $tele = $com->telephone;
            $mobile = $com->mobile;
            $email = $com->email;
            $url = $com->url;
            $file = $com->file;
        }
        if ($status == 1) {
            $date = date_create($vdate);
            PDF::AddPage();
            $bname = DB::table('bankinfo')->where('id', $baccid)->first();
            $brancename = DB::table('bankaccount')->where('id', $baccid)->first();
            $html1 = '
				<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Cash Contra</u></h2>
								 <table border="0" style="width:100%">
									<tr>
										
										<td>Voucher No:' . $vnno . '</td>
										<td></td>
										<td>Manual V. No:' . $type . '</td>
										
									</tr>
									<tr>
										
										<td>Bank Name:</td>
										<td></td>
										<td>Branch Name:' . $brancename->branchname . '</td>
										
									</tr>
									<tr>
										<td>A/C No.' . $brancename->name . '</td>
										<td></td>
										<td>Check No.' . $checkno . '</td>
										
									  </tr>
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:35%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:15%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
            $bname = DB::table('bankaccount')->where('id', $baccid)->pluck('name');
            $coa = DB::table('coa')->where('id', 1)->first();
            $bcode = DB::table('bankaccount')->where('id', $baccid)->pluck('code');
            $html2 = '
			<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $coa->name . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $coa->code . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $bname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $bcode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
		
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
            $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
            $html = $html1 . $html2 . $html3;
            PDF::writeHTML($html, true, false, true, false, '');
            PDF::Output('contravouchar.pdf');
        } else {
            if ($status == 2) {
                $date = date_create($vdate);
                PDF::AddPage();
                $bname = DB::table('bankinfo')->where('id', $baccid)->first();
                $brancename = DB::table('bankaccount')->where('id', $baccid)->first();
                $html1 = '
				<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Bank Contra</u></h2>
								 <table border="0" style="width:100%">
									<tr>
										
										<td>Voucher No:' . $vnno . '</td>
										<td></td>
										<td>Manual V. No:' . $type . '</td>
										
									</tr>
									<tr>
										
										<td>Bank Name:</td>
										<td></td>
										<td>Branch Name:' . $brancename->branchname . '</td>
										
									</tr>
									<tr>
										<td>A/C No.' . $brancename->name . '</td>
										<td></td>
										<td>Check No.' . $checkno . '</td>
										
									  </tr>
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:35%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:15%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                $bname = DB::table('bankaccount')->where('id', $baccid)->pluck('name');
                $coa = DB::table('coa')->where('id', 1)->first();
                $bcode = DB::table('bankaccount')->where('id', $baccid)->pluck('code');
                $html2 = '
			<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $bname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $bcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $coa->name . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $coa->code . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
		
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                $html = $html1 . $html2 . $html3;
                PDF::writeHTML($html, true, false, true, false, '');
                PDF::Output('contravouchar.pdf');
            } else {
                if ($status == 3) {
                    $date = date_create($vdate);
                    PDF::AddPage();
                    $bname = DB::table('bankinfo')->where('id', $baccid)->first();
                    $brancename = DB::table('bankaccount')->where('id', $baccid)->first();
                    $html1 = '
				<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Bank To Bank Contra</u></h2>
								 <table border="0" style="width:100%">
									<tr>
										
										<td>Voucher No:' . $vnno . '</td>
										<td></td>
										<td>Manual V. No:' . $type . '</td>
										
									</tr>
									
									
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:35%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:15%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                    $bname = DB::table('bankaccount')->where('id', $baccid)->pluck('name');
                    $cash = DB::table('bankaccount')->where('id', $cashid)->pluck('name');
                    $ccode = DB::table('bankaccount')->where('id', $cashid)->pluck('code');
                    $bcode = DB::table('bankaccount')->where('id', $baccid)->pluck('code');
                    $html2 = '
			<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $bname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $bcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cash . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $ccode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
		
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                    $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                    $html = $html1 . $html2 . $html3;
                    PDF::writeHTML($html, true, false, true, false, '');
                    PDF::Output('contravouchar.pdf');
                }
            }
        }
    }
Example #5
0
    public function pdf(Request $request, $id, $type)
    {
        //echo $id.$type;
        $profile = Companyprofile::get();
        foreach ($profile as $com) {
            $cid = $com->id;
            $cname = $com->name;
            $address = $com->address;
            $tele = $com->telephone;
            $mobile = $com->mobile;
            $email = $com->email;
            $url = $com->url;
            $file = $com->file;
        }
        if ($type == 1) {
            $var = array($id, $type);
            $spname = "voucher";
            $value = Info::callinfo($var, $spname);
            //print_r($value);
            foreach ($value as $v) {
                $vrno = $v->vrno;
                $mvno = $v->mvno;
                $amount = $v->amount;
                $bname = $v->bname;
                $branchname = $v->branchname;
                $accno = $v->accno;
                $checkno = $v->checkno;
                $vdate = $v->vdate;
                $baid = $v->baid;
                $sid = $v->sid;
                $bacode = $v->bacode;
                $scode = $v->scode;
            }
            $date = date_create($vdate);
            PDF::AddPage();
            $html1 = '
				<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Bank Payment Voucher</u></h2>
								 <table border="0" style="width:100%">
									<tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
										
										<td>Bank Name:' . $bname . '</td>
										<td></td>
										<td>Branch Name:' . $branchname . '</td>
										
									</tr>
									<tr>
										<td>A/C No.' . $accno . '</td>
										<td></td>
										<td>Check No.' . $checkno . '</td>
										
									  </tr>
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
            $sname = DB::table('suppliers')->where('id', $sid)->pluck('name');
            $bname = DB::table('bankaccount')->where('id', $baid)->pluck('name');
            $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $sname . '</td>
				<td style="background-color:#ffffff;">' . $scode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $bname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $bacode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
            $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
            $html = $html1 . $html2 . $html3;
            PDF::writeHTML($html, true, false, true, false, '');
            PDF::Output('vbp.pdf');
        } else {
            if ($type == 2) {
                $var = array($id, $type);
                $spname = "voucher";
                $value = Info::callinfo($var, $spname);
                //print_r($value);
                foreach ($value as $v) {
                    $vrno = $v->vrno;
                    $mvno = $v->mvno;
                    $amount = $v->amount;
                    $sid = $v->sid;
                    $scode = $v->scode;
                    $vdate = $v->vdate;
                }
                $date = date_create($vdate);
                PDF::AddPage();
                $html1 = '
				<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
					
					<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Payment Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
										<td>Unit/Place:</td>
										<td></td>
										<td>Manual V. No.</td>
										
									</tr>
									
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                $sname = DB::table('suppliers')->where('id', $sid)->pluck('name');
                $cashname = DB::table('coa')->where('id', 1)->pluck('name');
                $cashcode = DB::table('coa')->where('id', 1)->pluck('code');
                $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $sname . '</td>
				<td style="background-color:#ffffff;">' . $scode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cashname . '</td>
				<td style="background-color:#ffffff;">' . $cashcode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                $html = $html1 . $html2 . $html3;
                PDF::writeHTML($html, true, false, true, false, '');
                PDF::Output('vbpp.pdf');
            } else {
                if ($type == 3) {
                    $var = array($id, $type);
                    $spname = "voucher";
                    $value = Info::callinfo($var, $spname);
                    //print_r($value);
                    foreach ($value as $v) {
                        $vrno = $v->vrno;
                        $mvno = $v->mvno;
                        $amount = $v->amount;
                        $bname = $v->bname;
                        $branchname = $v->branchname;
                        $accno = $v->accno;
                        $checkno = $v->checkno;
                        $vdate = $v->vdate;
                        $baid = $v->baid;
                        $cid = $v->cid;
                        $bacode = $v->bacode;
                        $ccode = $v->ccode;
                    }
                    $date = date_create($vdate);
                    PDF::AddPage();
                    $html1 = '<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Bank Receive Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
										<td>Bank Name:' . $bname . '</td>
										<td></td>
										<td>Branch Name:' . $branchname . '</td>
										
									</tr>
									<tr>
										<td>A/C No.' . $accno . '</td>
										<td></td>
										<td>Check No.' . $checkno . '</td>
										
									  </tr>
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                    $cname = DB::table('customers')->where('id', $cid)->pluck('name');
                    $bname = DB::table('bankaccount')->where('id', $baid)->pluck('name');
                    $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $bname . '</td>
				<td style="background-color:#ffffff;">' . $bacode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cname . '</td>
				<td style="background-color:#ffffff;">' . $ccode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                    $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                    $html = $html1 . $html2 . $html3;
                    PDF::writeHTML($html, true, false, true, false, '');
                    PDF::Output('vbp.pdf');
                } else {
                    if ($type == 4) {
                        $var = array($id, $type);
                        $spname = "voucher";
                        $value = Info::callinfo($var, $spname);
                        //print_r($value);
                        foreach ($value as $v) {
                            $vrno = $v->vrno;
                            $mvno = $v->mvno;
                            $amount = $v->amount;
                            $cid = $v->cid;
                            $ccode = $v->ccode;
                            $vdate = $v->vdate;
                        }
                        $date = date_create($vdate);
                        PDF::AddPage();
                        $html1 = ' <p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Receive Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
									
										<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
										
									</tr>
									
								
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                        $cname = DB::table('customers')->where('id', $cid)->pluck('name');
                        $cashname = DB::table('coa')->where('id', 1)->pluck('name');
                        $cashcode = DB::table('coa')->where('id', 1)->pluck('code');
                        $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cashname . '</td>
				<td style="background-color:#ffffff;">' . $cashcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $ccode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                        $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                        $html = $html1 . $html2 . $html3;
                        PDF::writeHTML($html, true, false, true, false, '');
                        PDF::Output('vbpp.pdf');
                    } else {
                        if ($type == 5) {
                            $var = array($id, $type);
                            $spname = "voucher";
                            $value = Info::callinfo($var, $spname);
                            //print_r($value);
                            foreach ($value as $v) {
                                $vrno = $v->vrno;
                                $mvno = $v->mvno;
                                $amount = $v->amount;
                                $bname = $v->bname;
                                $baname = $v->baname;
                                $branchname = $v->branchname;
                                $checkno = $v->checkno;
                                $vdate = $v->vdate;
                                $baid = $v->baid;
                                $bacode = $v->bacode;
                            }
                            $date = date_create($vdate);
                            PDF::AddPage();
                            $html1 = '<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Contra Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
										<td>Bank Name:' . $bname . '</td>
										<td></td>
										<td>Branch Name:' . $branchname . '</td>
										
									</tr>
									<tr>
										<td>A/C No.' . $baname . '</td>
										<td></td>
										<td>Check No.' . $checkno . '</td>
										
									  </tr>
									<tr>
								   
									<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
									</tr>
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                            $cashname = DB::table('coa')->where('id', 1)->pluck('name');
                            $cashcode = DB::table('coa')->where('id', 1)->pluck('code');
                            $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cashname . '</td>
				<td style="background-color:#ffffff;">' . $cashcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $baname . '</td>
				<td style="background-color:#ffffff;">' . $bacode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                            $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                            $html = $html1 . $html2 . $html3;
                            PDF::writeHTML($html, true, false, true, false, '');
                            PDF::Output('vbp.pdf');
                        } else {
                            if ($type == 6) {
                                $var = array($id, $type);
                                $spname = "voucher";
                                $value = Info::callinfo($var, $spname);
                                //print_r($value);
                                foreach ($value as $v) {
                                    $vrno = $v->vrno;
                                    $mvno = $v->mvno;
                                    $amount = $v->amount;
                                    $cid = $v->cid;
                                    $ccode = $v->ccode;
                                    $vdate = $v->vdate;
                                }
                                $date = date_create($vdate);
                                PDF::AddPage();
                                $html1 = '<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>bKash Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
									
										<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
										
									</tr>
									
								
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                                $cname = DB::table('customers')->where('id', $cid)->pluck('name');
                                $cashname = DB::table('coa')->where('id', 1)->pluck('name');
                                $cashcode = DB::table('coa')->where('id', 1)->pluck('code');
                                $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cashname . '</td>
				<td style="background-color:#ffffff;">' . $cashcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $ccode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                                $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                                $html = $html1 . $html2 . $html3;
                                PDF::writeHTML($html, true, false, true, false, '');
                                PDF::Output('vbpp.pdf');
                            } else {
                                if ($type == 7) {
                                    $var = array($id, $type);
                                    $spname = "voucher";
                                    $value = Info::callinfo($var, $spname);
                                    //print_r($value);
                                    foreach ($value as $v) {
                                        $vrno = $v->vrno;
                                        $mvno = $v->mvno;
                                        $amount = $v->amount;
                                        $cid = $v->cid;
                                        $ccode = $v->ccode;
                                        $vdate = $v->vdate;
                                    }
                                    $date = date_create($vdate);
                                    PDF::AddPage();
                                    $html1 = '<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>SAP Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
									
										<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
										
									</tr>
									
								
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                                    $cname = DB::table('customers')->where('id', $cid)->pluck('name');
                                    $cashname = DB::table('coa')->where('id', 1)->pluck('name');
                                    $cashcode = DB::table('coa')->where('id', 1)->pluck('code');
                                    $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cashname . '</td>
				<td style="background-color:#ffffff;">' . $cashcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $ccode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                                    $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                                    $html = $html1 . $html2 . $html3;
                                    PDF::writeHTML($html, true, false, true, false, '');
                                    PDF::Output('vbpp.pdf');
                                } else {
                                    if ($type == 8) {
                                        $var = array($id, $type);
                                        $spname = "voucher";
                                        $value = Info::callinfo($var, $spname);
                                        //print_r($value);
                                        foreach ($value as $v) {
                                            $vrno = $v->vrno;
                                            $mvno = $v->mvno;
                                            $amount = $v->amount;
                                            $cid = $v->cid;
                                            $ccode = $v->ccode;
                                            $vdate = $v->vdate;
                                        }
                                        $date = date_create($vdate);
                                        PDF::AddPage();
                                        $html1 = '<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>KCS Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
									
										<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
										
									</tr>
									
								
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                                        $cname = DB::table('customers')->where('id', $cid)->pluck('name');
                                        $cashname = DB::table('coa')->where('id', 1)->pluck('name');
                                        $cashcode = DB::table('coa')->where('id', 1)->pluck('code');
                                        $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cashname . '</td>
				<td style="background-color:#ffffff;">' . $cashcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $ccode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                                        $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                                        $html = $html1 . $html2 . $html3;
                                        PDF::writeHTML($html, true, false, true, false, '');
                                        PDF::Output('vbpp.pdf');
                                    } else {
                                        if ($type == 9) {
                                            $var = array($id, $type);
                                            $spname = "voucher";
                                            $value = Info::callinfo($var, $spname);
                                            //print_r($value);
                                            foreach ($value as $v) {
                                                $vrno = $v->vrno;
                                                $mvno = $v->mvno;
                                                $amount = $v->amount;
                                                $cid = $v->cid;
                                                $ccode = $v->ccode;
                                                $vdate = $v->vdate;
                                            }
                                            $date = date_create($vdate);
                                            PDF::AddPage();
                                            $html1 = '<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
				<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>MBank Voucher</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Voucher No:' . $vrno . '</td>
										<td></td>
										<td>Manual V. No:' . $mvno . '</td>
										
									</tr>
									<tr>
									
										<td>Month:' . date_format($date, " F,Y") . '</td>
										<td></td>
										<td>Date:' . $vdate . '</td>
										
									</tr>
									
								
								</table> 
							</div>
					
					
			
			
				
		
		  <div> </div>
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
				<th style="width:10%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SL</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Head of Accounts</th>
				<th style="width:20%">&nbsp;&nbsp;&nbsp;&nbsp;A/C Code</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;DR(BDT)</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;CR(BDT)</th>
			  </tr>';
                                            $cname = DB::table('customers')->where('id', $cid)->pluck('name');
                                            $cashname = DB::table('coa')->where('id', 1)->pluck('name');
                                            $cashcode = DB::table('coa')->where('id', 1)->pluck('code');
                                            $html2 = '<tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cashname . '</td>
				<td style="background-color:#ffffff;">' . $cashcode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;"></td>
			  </tr>
			  <tr>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $cname . '</td>
				<td style="background-color:#ffffff;">' . $ccode . '</td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>
			   <tr>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;"></td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total:</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;' . $amount . '</td>
			  </tr>';
                                            $html3 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($amount) . ' Taka Only</h4></div>
						<div></div>
					<div></div><div></div>
						
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
                                            $html = $html1 . $html2 . $html3;
                                            PDF::writeHTML($html, true, false, true, false, '');
                                            PDF::Output('vbpp.pdf');
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    public function pdf(Request $request, $pid)
    {
        $profile = Companyprofile::get();
        //print_r($profile);
        foreach ($profile as $com) {
            $id = $com->id;
            $cname = $com->name;
            $address = $com->address;
            $tele = $com->telephone;
            $mobile = $com->mobile;
            $email = $com->email;
            $url = $com->url;
            $file = $com->file;
        }
        $var = array($pid);
        $spname = "viewsales";
        $value = Info::callinfo($var, $spname);
        foreach ($value as $valu) {
            $id = $valu->id;
            $sailname = $valu->sname;
            $salesdate = $valu->salesdate;
            $cusname = $valu->cname;
            $phone = $valu->phone;
            $preaddress = $valu->preaddress;
        }
        //$pdate=date_create($purchasedate);
        //$sdate=date_create($suppliersbilldate);
        $spname1 = "salesdetailsview";
        $value1 = Info::callinfo($var, $spname1);
        $sum = 0;
        foreach ($value1 as $valu) {
            $a = $valu->amount;
            $sum = $sum + $a;
        }
        PDF::AddPage();
        $html1 = '
			<p></p>
					<div>
						<table>
							<tr>
								<td style="width:20%">
									<img src="uploads/' . $file . '" alt="logo" height="150";>
								</td>
								<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
								</td>
							</tr>

						</table>	
					</div><div>
					<table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">	
			  <tr>
			   <th>SI No</th>
				<th>Item Name</th>
				<th>Quantity</th>
				<th>Measurement Unit</th>
				<th>Rate</th>
				<th>Amount</th>
			  </tr>';
        $html2 = '';
        $i = 1;
        $sum = 0;
        foreach ($value1 as $valu) {
            $html = '<tr><td>' . $i . '</td>
				<td style="background-color:#ffffff;">' . $valu->iname . '</td>
				<td style="background-color:#ffffff;">' . $valu->quantity . '</td>
				<td style="background-color:#ffffff;">' . $valu->mname . '</td>
				<td style="background-color:#ffffff;">' . $valu->rate . '</td>
				<td style="background-color:#ffffff;">' . $valu->amount . '</td></tr>';
            $html2 = $html2 . $html;
            $i++;
            $sum = $sum + $valu->amount;
        }
        $html3 = '<tr><td colspan="5" align="right">';
        $html4 = '';
        $html5 = 'Total:</td><td style="background-color:#ffffff;">' . number_format($sum, 2, '.', '') . '</td></tr>';
        $html6 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord($sum) . ' Taka Only</h4></div>
		                  <div></div>
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
        $html = $html1 . $html2 . $html3 . $html4 . $html5 . $html6;
        PDF::writeHTML($html, true, false, true, false, '');
        PDF::Output('sales.pdf');
    }
    public function challan(Request $request, $pid)
    {
        $profile = Companyprofile::get();
        //print_r($profile);
        foreach ($profile as $com) {
            $id = $com->id;
            $cname = $com->name;
            $address = $com->address;
            $tele = $com->telephone;
            $mobile = $com->mobile;
            $email = $com->email;
            $url = $com->url;
            $file = $com->file;
        }
        $var = array($pid);
        $spname = "viewsales";
        $value = Info::callinfo($var, $spname);
        foreach ($value as $valu) {
            $id = $valu->id;
            $sailname = $valu->sname;
            $salesdate = $valu->salesdate;
            $cusname = $valu->cname;
            $phone = $valu->phone;
            $preaddress = $valu->preaddress;
        }
        //$pdate=date_create($purchasedate);
        //$sdate=date_create($suppliersbilldate);
        $spname1 = "salesdetailsview";
        $value1 = Info::callinfo($var, $spname1);
        $spname2 = "challanitem";
        $value2 = Info::callinfo($var, $spname2);
        $value3 = Info::callinfo($var, $spname2);
        //print_r($var); die();
        $sum = 0;
        foreach ($value1 as $valu) {
            $a = $valu->amount;
            $sum = $sum + $a;
        }
        PDF::AddPage();
        $html1 = '
			<p></p>
				<div>
					<table>
						<tr>
							<td style="width:20%">
								<img src="uploads/' . $file . '" alt="logo" height="150";>
							</td>
							<td style="width:85% font-size:30%">
								<h2>' . $cname . '</h2>
								
								' . $address . '
									<br>Tel:' . $tele . ',Mobile:' . $mobile . '
									<br>E-mail:' . $email . '
									<br>' . $url . '
								 
							</td>
						</tr>

					</table>	
				</div>
		
		<div>
					             <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;
						<u>CHALLAN</u></h2>
								 <table border="0" style="width:100%">
								 <tr>
										
										<td>Customer Name:' . $cusname . '</td>
										<td></td>
										<td>Voucher No:' . $sailname . '</td>
										
									</tr>
									<tr>
									
										<td>Address:' . $preaddress . '</td>
										<td></td>
										<td>Date:' . $salesdate . '</td>
										
									</tr>
										<tr>
									
										<td>Mobile No:' . $phone . '</td>
										<td></td>
										<td></td>
										
									</tr>
									
								
								</table> 
							</div>
		
		  <div> 
		  <table border="1 solid" style="background-color:lightblue; width:100%; padding:20px;">		
			  <tr>
				<th style="width:15%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SI No</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Code</th>
				<th style="width:30%;">&nbsp;&nbsp;&nbsp;Description</th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quantity</th>
				
			  </tr>';
        $html2 = '';
        $i = 1;
        $total = 0;
        foreach ($value1 as $valu) {
            $html = '<tr><td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $i . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $valu->icode . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;' . $valu->iname . '</td>
				<td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $valu->quantity . '</td>
				
				</tr>';
            $html2 = $html2 . $html;
            $i++;
            $total = $total + $valu->quantity;
        }
        $html3 = '<tr><td colspan="3" align="right" style="background-color:#ffffff;">';
        $html4 = '';
        $html5 = 'Total:</td><td style="background-color:#ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $total . '</td></tr>';
        $html6 = '<tr><td colspan="4">';
        $html7 = '';
        foreach ($value3 as $v) {
            $factioyitems = DB::table('factioyitems')->where('itemsid', $v->id)->where('salesid', $id)->get();
            //print_r($factioyitems);
            $h = '<span style="color:green;">' . $id . $v->id . $v->name . '</span>(';
            $h1 = '';
            foreach ($factioyitems as $f) {
                $h2 = '' . $f->slno . ',';
                $h1 = $h1 . $h2;
            }
            $h3 = ')<br>';
            $html = $h . $h1 . $h3;
            $html7 = $html7 . $html;
        }
        $html8 = '</td></tr>';
        $html9 = '</table><h4>Amount in word:' . CommonController::convertNumberToWord(number_format($total, 2, '.', '')) . ' Pcs Only</h4></div>
		
					<div>
					

						</div>
						<div class="col-md-12"  style=" background-color: #ffffff;color:#000000;">
						<h3>&nbsp;&nbsp;&nbsp; Received By
		                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												
						  Prepared By
						  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						


						Approved By
						  </h3>
						
						
							
						</div>';
        $html = $html1 . $html2 . $html3 . $html4 . $html5 . $html6 . $html7 . $html8 . $html9;
        PDF::writeHTML($html, true, false, true, false, '');
        PDF::Output('challan.pdf');
    }