BBnepal-Accounts/application/views/student/student-fee-invoice.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

252 lines
16 KiB
PHP

<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/invoice.css">
<div class="wraper responsive-width">
<main class="common_margin" id="main">
<div class="main-wrap">
<div class="dashboard-cover">
<a href="<?= base_url(); ?>student/my-payments"><button type="button" class="btn btn-success btn-sm btn-dark">Back</button></a>
<div class="common-heading">
<h2>Transactions Details</h2>
</div>
<div class="invoice_wrap" id="printpage">
<div class="invoice_head" id="printableArea">
<div class="invoice_head_left">
Bill Details
</div>
<div class="invoice_right">
<p id="printSection"><img src="<?php echo base_url(); ?>assets_admin/images/print.png" /></p>
<a href="<?= base_url(); ?>student/invoicedownload/<?= urlsafe_b64encode($invoice_data['studentId']) ?>/<?= urlsafe_b64encode($invoice_data['txn_id']) ?>"><i class="fas fa-download"></i></a>
</div>
</div>
<div class="invoice_main" style="">
<?php
if(empty($school_info['color_logo'])) {
$logo_img=base_url().'common_assets/black_logo.png';
}
else if(file_exists('common_assets/'.$school_info['color_logo']))
{
$logo_img=base_url().'common_assets/'.$school_info['color_logo'];
}
else {
$logo_img=base_url().'common_assets/black_logo.png';
}
?>
<div class="invoice_head_row">
<table width="100%" class="head_tbl">
<tr>
<td style="width:40%">
<div class="top_logo">
<img class="logo_img" src="<?= $logo_img; ?>" alt="Logo Here">
<hr align="left" style="width:50%;">
<h4 style="margin:0;padding:0;"><?= $school_info['school_name']; ?></h4>
<p class="address" style="width:250px;word-wrap: break-word;margin:0;padding:0;"><?= $school_info['address']; ?></p>
</div>
</td>
<td style="width:20%">
<div class="bill-type">
<p><label for="">Bill Type</label> : <span>Copy</span></p>
</div>
</td>
<td style="width:30%">
<ul>
<li><label for="">Phone :</label><span><?= $school_info['phone']; ?></span></li>
<li><label for="">Email :</label><span><?= $school_info['email']; ?></span></li>
<li><label for="">Website :</label><span><?= $school_info['website_link']; ?></span></li>
<li><label for="">School PAN :</label><span><?= (!empty($school_info['pan'])) ? $school_info['pan']:"-"; ?></span></li>
</ul>
</td>
</tr>
</table>
<hr/>
</div>
<div class="invoice_body" >
<table style="width:100%">
<tr>
<th style="padding:2px 2px 2px 5px;width:12%;font-weight:600;font-size:12px;text-align:left;">Student Name</th><th style="width:2%;font-weight:600;font-size:12px">:</th><td style="width:20%;font-size:12px;text-align:left;"><?= $invoice_data['studentname'] ?></td>
<th style="padding:5px;width:10%;font-weight:600;font-size:12px;text-align:left;">Parent PAN</th><th style="width:2%;font-weight:600;font-size:12px">:</th><td style="width:17%;font-size:12px;text-align:left;"><?= (!empty($invoice_data['parent_pan'])) ? $invoice_data['parent_pan'] : '--'; ?></td>
<th style="padding:5px;width:18%;font-weight:600;font-size:12px;text-align:left;"> Bill Print Count</th><th style="width:1%;font-weight:600;font-size:12px">:</th><td style="width:20%;font-size:12px;text-align:left;"><?= $invoice_data['bill_print_count'] ?></td>
</tr>
<tr>
<th style="padding:2px 2px 2px 5px;width:12%;font-weight:600;font-size:12px;text-align:left;">Classroom</th><th style="width:2%;font-weight:600;font-size:12px">:</th><td style="width:20%;font-size:12px;text-align:left;"><?php
$section_id = (!empty($invoice_data['section_id']) && isset($invoice_data['section_id'])) ? $invoice_data['section_id'] : 0;
if ($section_id != 0)
$section_name = $this->db->get_where('section', array('id' => $section_id))->row()->section_name;
else
$section_name = '';
$course_name = $this->db->get_where('course', array('id' => $invoice_data['course_id']))->row()->course_name;
echo (!empty($section_name)) ? $course_name . ' - ' . $section_name : $course_name;
?></td>
<th style="padding:5px;width:10%;font-weight:600;font-size:12px;text-align:left;">Student ID</th><th style="width:2%;font-weight:600;font-size:12px">:</th><td style="width:17%;font-size:12px;text-align:left;"><?= $invoice_data['studentId'] ?></td>
<th style="padding:5px;width:18%;font-weight:600;font-size:12px;text-align:left;">Transaction Date & Time</th><th style="width:1%;font-weight:600;font-size:12px">:</th><td style="width:20%;font-size:12px;text-align:left;"><?= $invoice_data['tdt'] ?></td>
</tr>
<tr>
<th style="padding:2px 2px 2px 5px;width:12%;font-weight:600;font-size:12px;text-align:left;">Batch</th><th style="width:2%;font-weight:600;font-size:12px">:</th><td style="width:20%;font-size:12px;text-align:left;"><?= $invoice_data['batch_name']; ?></td>
<th style="padding:5px;width:10%;font-weight:600;font-size:12px"></th><th style="width:2%;font-weight:600;font-size:12px"></th><td style="width:17%;font-weight:600;font-size:12px;text-align:left;"></td>
<th style="padding:5px;width:18%;font-weight:600;font-size:12px"></th><th style="width:1%;font-weight:600;font-size:12px"></th><td style="width:20%;font-weight:600;font-size:12px;text-align:left;"></td>
</tr>
</table>
</div>
<div class="invoice_footer_row" style="padding: 20px 10px 0px;" >
<table class="footer_tbl_main" width="100%" style="border-collapse: collapse;text-align:center;font-size:12px;" >
<thead >
<tr>
<th style="width:5%;border:1px solid #000;padding:2px;font-weight:600">SNO</th>
<th style="width:20%;border:1px solid #000;padding:2px;font-weight:600">Description</th>
<th style="width:15%;border:1px solid #000;padding:2px;font-weight:600">Bill No</th>
<th style="width:10%;border:1px solid #000;padding:2px;font-weight:600">Bill By </th>
<th style="width:10%;border:1px solid #000;padding:2px;font-weight:600">Mode of Payment</th>
<th style="width:10%;border:1px solid #000;padding:2px;font-weight:600">Paid Date</th>
<th style="width:10%;border:1px solid #000;padding:2px;font-weight:600"><?php echo (!empty(ucfirst($invoice_data['deduction_type']))) ? ucfirst($invoice_data['deduction_type']) : "Scholarship/\nDiscount"; ?></th>
<th style="width:10%;border:1px solid #000;padding:2px;font-weight:600">Fine</th>
<th style="width:10%;border:1px solid #000;padding:2px;font-weight:600">Amount</th>
<!-- <th>Fine</th> -->
<!-- <th><?php //echo (!empty(ucfirst($invoice_data['deduction_type']))) ? ucfirst($invoice_data['deduction_type']) : "Scholarship/Discount"; ?></th> -->
<!-- <th>Total Amount</th> -->
</tr>
</thead>
<tbody>
<tr style="border:1px solid #000">
<td style="border:1px solid #000;padding:2px;">1</td>
<td style="border:1px solid #000;padding:2px;"><?= $invoice_data['payment_for'] ?></td>
<td style="border:1px solid #000;padding:2px;"><?php
if($school_info['invoice_prefix_status'] == 1 && !empty($invoice_data['invoice_no']))
echo $school_info['invoice_prefix'].$invoice_data['invoice_no'];
else
echo $invoice_data['invoice_no'];
// echo $invoice_data['invoice_no'];
// $invoice_data['course_fee_id'].$invoice_data['studentId'].'/'.$invoice_data['install_sno'] ?></td>
<td style="border:1px solid #000;padding:2px;"><?= $invoice_data['received_by'] ?></td>
<td style="border:1px solid #000;padding:2px;"><?= $invoice_data['payment_method'] ?></td>
<td style="border:1px solid #000;padding:2px;"><?= date('d-m-Y H:i:s', strtotime($invoice_data['paid_date'])) ?></td>
<td style="border:1px solid #000;padding:2px;"><?= $invoice_data['deduction_amount']; ?></td>
<td style="border:1px solid #000;padding:2px;"><?= $invoice_data['fine_amount']; ?></td>
<!-- <td><?php //echo $invoice_data['payment_amt'] ?></td> -->
<!-- <td><?php // echo $invoice_data['fine_amount'] ?></td> -->
<!-- <td></td> -->
<td style="border:1px solid #000;text-align:center;padding:5px;"> <?= $invoice_data['payment_amt']; ?></td>
</tr>
<tr>
<td colspan="6" style="border:1px solid #000;padding:2px;text-align:center;"></td>
<td style="border:1px solid #000;padding:2px;text-align:center;"><?= $invoice_data['deduction_amount']; ?></td>
<td style="border:1px solid #000;padding:2px;text-align:center;"><?= $invoice_data['fine_amount']; ?></td>
<td style="border:1px solid #000;padding:2px;text-align:center;"><?= $invoice_data['payment_amt']; ?></td>
</tr>
</tbody>
<tr>
<td colspan="9">
<table class="footer_tbl_sub" style="border-collapse: collapse;" width=100% >
<tr>
<td colspan="7" width=65% style="border:1px solid #000;text-align:left;border-right:0;border-top: 0;padding-left:35px;">
<label for="" style="font-size: 12px;width: 100px;font-weight: 600;">Amount In Word</label> : &nbsp;&nbsp;
<span style="font-size: 12px;width: 100px;font-weight: 600;"><?php echo '"'. amountInWords((($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount'])) .'"'; ?></span>
<p style="color: #212529;padding-top:5px;">“This is computer generated receipt, no signature required.”</p>
</td>
<td width=45% style="border:1px solid #000;padding: 5px;border-left:0;border-top: 0;">
<table class="bottom-tbl" width=100% style="border: 2px solid #000;" >
<tr >
<th style="padding:2px;text-align:left;width:65%">Total Fee Amount </th><th style="padding:2px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;"><?= $invoice_data['payment_amt']; ?></td>
</tr>
<tr>
<th style="padding:2px;text-align:left;width:65%">Total Fine </th><th style="padding:2px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;"><?= $invoice_data['fine_amount']; ?></td>
</tr>
<tr>
<th style="padding:2px;text-align:left;width:65%">Total <?php echo (!empty(ucfirst($invoice_data['deduction_type']))) ? ucfirst($invoice_data['deduction_type']) : "Scholarship/\nDiscount"; ?> </th><th style="padding:2px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;"><?= $invoice_data['deduction_amount']; ?></td>
</tr>
<tr>
<th style="padding:2px;text-align:left;width:65%">Total Paid Amount </th><th style="padding:2px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;"><?= $school_info['currency_symbol']; ?>. <?= (($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount']) ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<script type="text/javascript">
// $("#printSection").on("click", function() {
// //alert($(window).height());
// var ht = $(window).height();
// var wt = $(window).width();
// var divContents = $("#printpage").html();
// var printWindow = window.open('', '', 'height=' + ht + 'px,width=' + wt + 'px');
// printWindow.document.write('<html><head><title>Invoice</title>');
// printWindow.document.write('<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/invoice.css">');
// printWindow.document.write('</head><body>');
// printWindow.document.write(divContents);
// printWindow.document.write('</body></html>');
// printWindow.document.close();
// printWindow.print();
// });
$("#printSection").on("click", function() {
var element = $(".bill_count").text();
$(".bill_count").text(parseInt(element)+1);
$.ajax({
url: "<?= base_url().'admin/printcount_increment'; ?>",
method: "POST",
data: {
inoviceids: <?php echo $invoice_data['student_fee_online_transactions_id']; ?>
},
success: function(response) {
console.log('done');
} });
var frame1 = $('<iframe />').attr("id", "printDiv");
frame1[0].name = "frame1";
frame1.css({"position": "absolute", "top": "-1000000px"});
var divContents = $("#printpage").html();
$("body").append(frame1);
var frameDoc = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;
frameDoc.document.open();
//Create a new HTML document.
frameDoc.document.write('<html>');
frameDoc.document.write('<head>');
frameDoc.document.write('<title></title>');
// frameDoc.document.write('<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/bootstrap.min.css">');
frameDoc.document.write('<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/invoice.css">');
frameDoc.document.write('</head>');
frameDoc.document.write('<body>');
frameDoc.document.write(divContents);
frameDoc.document.write('</body>');
frameDoc.document.write('</html>');
frameDoc.document.close();
setTimeout(function () {
document.getElementById('printDiv').contentWindow.focus();
document.getElementById('printDiv').contentWindow.print();
// frame1.remove();
if (winload) {
window.location.reload(true);
}
}, 500);
return true;
});
</script>