/* Decoded by unphp.net */ session_start(); define('FPDF_FONTPATH','pdf/font/'); require('pdf/bill.php'); include("functions.php"); include('conn.php'); $fyearh=$_SESSION['fyearh']; $tbox=0; $tpkg=0; $troll=0; $tkg=0; global $ptyp; global $slno; global $cname; global $caddress; global $paddress; global $pgst; global $slogan; global $phone; global $gst; global $finv; global $invoiceno; global $edate; global $pos; global $eno; global $ewayno; global $ewaydate; global $pono; global $pdate; global $bank; global $bankbranch; global $bankacno; global $bankifsc; global $heds; global $tc; global $email; global $prnt; $heds="QUOTATION"; $invoiceid=$_REQUEST['invoiceid']; if(isset($_REQUEST['prnt'])){$prnt=$_REQUEST['prnt'];}else{$prnt="pint";} $pdf=new PDF(); $pdf->AliasNbPages(); $pdf->AddFont('calibri','','calibri.php'); $pdf->AddFont('calibri-Bold','','calibri Bold.php'); $pdf->SetAutoPageBreak(false); $pdf->SetTitle('Invoice'); $query = "SELECT * FROM company where cid='$company' "; $result = $link->query($query) or die($mysqli->error.__LINE__); if($result->num_rows >0) { while($row10 = mysqli_fetch_array($result)) { $companyname=$row10['cname']; $slogan=$row10['slogan']; $paddress=$row10['posaddress']; $pgst=$row10['gst']; $phone=$row10['phone']; $logo=$row10['logo']; $logo1=$row10['logo1']; $bank=$row10['bank']; $bankacno=$row10['bankacno']; $bankbranch=$row10['bankbranch']; $bankifsc=$row10['bankifsc']; $tc=$row10['tc']; $email=$row10['email']; } } $result->close(); $query = "SELECT * FROM emate where pid='$invoiceid'"; $result = $link->query($query) or die($mysqli->error.__LINE__); if($result->num_rows >0) { while($row10 = mysqli_fetch_array($result)) { $cusid=$row10['cusid']; $invoiceno=$row10['invoiceno']; $biz=$row10['biz']; $edate=$row10['edate']; $pono=$row10['pono']; $pdate=$row10['pdate']; $cname=$row10['cname']; $caddressd=$row10['address']; $cmobile=$row10['mobile']; $cpos=$row10['statec']; $ewayno=$row10['ewayno']; $ewaydate=$row10['ewaydate']; $tqty=$row10['tqty']; $staxable=$row10['taxable']; $subtotal=$row10['subtotal']; $cgst=$row10['cgstol']; $sgst=$row10['sgstol']; $igst=$row10['igstol']; $disctot=$row10['disctot']; $roundoff=$row10['roundoff']; $namount=$row10['namount']; $taxi=$row10['taxi']; $fright=$row10['fright']; $notes=$row10['notes']; } } $result->close(); $query = "SELECT * FROM ledger where lno='$cusid'"; $result = $link->query($query) or die($mysqli->error.__LINE__); if($result->num_rows >0) { while($rows = mysqli_fetch_array($result)) { $slno=$rows['slno']; $sledger=$rows['sledger']; $address1=$rows['address1']; $address2=$rows['address2']; $state=$rows['state']; $city=$rows['city']; $pincode=$rows['pincode']; $mobile=$rows['mobile']; $gst=$rows['gst']; $pos=$rows['pos']; } $caddress=$address1." ".$address2." ".$city.'-'.$pincode." ".$state." ".$mobile; } if($address1 ==''){ $caddress=$caddressd." ".$cmobile; $pos=$cpos; } if($slno !='12'){ $cname=$cname; } else { $cname=$sledger; } $result->close(); $myarray = array(1); foreach($myarray as $value){ $pdf->AddPage(); $pdf->SetFont('Calibri','',11); $no=0; $nos=0; $row_height=1; $pdf->SetX(10); $pdf->SetY(95); $totsub=0; $totdis=0; $query = "SELECT * FROM elist where pid=(select pid from emate where pid='$invoiceid')"; $result = $link->query($query) or die($mysqli->error.__LINE__); if($result->num_rows >0) { while($row10 = mysqli_fetch_array($result)) { $icode=$row10['icode']; $iname=$row10['iname']; $qty=$row10['qty']; $weight=$row10['weight']; $rate=$row10['rate']; $ptaxable=$row10['taxable']; $tax=$row10['tax']; $disc=$row10['disc']; $ppnamount=$row10['pnamount']; $pamount=$row10['pamount']; $disv=$row10['disv']; $querys = "SELECT * FROM item where code='$icode'"; $results = $link->query($querys) or die($mysqli->error.__LINE__); if($results->num_rows >0) { while($rows = mysqli_fetch_array($results)) { $hsn=$rows['hsn']; $uqc=$rows['uqc']; } } $results->close(); $no=$no+1; $newY = $pdf->getY(); $pdf->SetY($newY-0.5); $pdf->SetWidths(array(6.5,88.5,22,18,25,30)); $pdf->SetAligns(array('L','L','C','R','C','R')); if($qty !=''){ $tdi=$disc*$qty; $pto=$ptaxable+$tdi; $prate=round(($pto/$qty),2); } else { $prate=$rate; } $nos = $pdf->getY(); if($nos >203) { $pdf->SetFont('Arial','B',12); $newY = $pdf->getY(); $pdf->SetY($newY+3); $pdf->SetX(176); $pdf->cell(25,6,'Page Cont...',0,1,'R'); $pdf->SetFont('Calibri','',11); $pdf->AddPage(); $nos=0; $row_height=1; $newY = $pdf->getY(); $pdf->SetY($newY+$row_height); $pdf->SetWidths(array(6.5,88.5,22,18,25,30)); $pdf->SetAligns(array('L','L','C','R','C','R')); $pdf->SetX(10); $pdf->SetY(95); } $newY = $pdf->getY(); if($taxi !=0){ $pdf->Row(array($no,$iname,$rate,$qty.' '.$uqc,$disv,$ptaxable)); } else{ $pdf->Row(array($no,$iname,$rate,$qty.' '.$uqc,$disv,$ptaxable)); } $totsub=$totsub+$ptaxable; $totdis=$totdis+$disv; } } $result->close(); $newY = $pdf->getY(); $pdf->SetY($newY+$row_height); $pdf->SetWidths(array(135,15,15,25)); $pdf->SetAligns(array('R','R','C','R')); $pdf->SetFont('Arial','B',12); $pdf->SetY(209); $pdf->SetX(127); $pdf->cell(18,5,$tqty,0,1,'C'); $pdf->SetY(209); $pdf->SetX(145); $pdf->cell(25,5,INR($totdis) ,0,1,'C'); $pdf->SetY(208.5); $pdf->SetX(175); $pdf->cell(25,6,'',0,1,'R'); $pdf->SetY(220); $pdf->SetFont('Arial','',11); $query = "SELECT sum(cgst) as cgstol,sum(sgst) as sgstol,sum(igst) as igstol,tax,sum(taxable) as taxable FROM elist where pid=(select pid from emate where pid='$invoiceid') group by tax"; $result = $link->query($query) or die($mysqli->error.__LINE__); if($result->num_rows >0) { while($rows = mysqli_fetch_array($result)) { $tax=$rows['tax']; $taxable=$rows['taxable']; $taxs=$tax/2; $cgstol=$rows['cgstol']; $sgstol=$rows['sgstol']; $igstol=$rows['igstol']; $pdf->SetX(10); $newY = $pdf->getY(); $pdf->SetY($newY); $pdf->SetWidths(array(14,30,12,29,11,29)); $pdf->SetAligns(array('C','R','C','R','C','R',)); } } $pdf->SetFont('Arial','B',10); $pdf->SetY(215); $pdf->SetX(10); $pdf->cell(40,6,'Remarks',0,1,'L'); $pdf->SetFont('Arial','',11); $pdf->SetY(220); $pdf->SetX(10); $pdf->cell(120,4,$notes ,0,1,'L'); $pdf->SetFont('Arial','',11); $pdf->SetY(215); $pdf->SetX(175); $pdf->cell(25,6,INR($totsub) ,0,1,'R'); $pdf->SetY(220); $pdf->SetX(175); $pdf->cell(25,6,$cgstol ,0,1,'R'); $pdf->SetY(225); $pdf->SetX(175); $pdf->cell(25,6,$fright ,0,1,'R'); $pdf->SetY(230); $pdf->SetX(175); $pdf->cell(25,6,$roundoff ,0,1,'R'); $pdf->SetFont('Calibri','',12); $rs=convert_number_to_words($namount); $pdf->SetY(238.5); $pdf->SetX(10); $pdf->MultiCell(127,3.5,$rs,0,'L'); $pdf->SetFont('Arial','B',13); $pdf->SetY(238); $pdf->SetX(175); $pdf->cell(25,6,INR($namount) ,0,1,'R'); } $pdf->Output();