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

408 lines
29 KiB
PHP

<div class="wraper responsive-width" style="height:100% !important;">
<main class="" id="main">
<div class="main-wrap" style="page-break-after: always;">
<div class="dashboard-cover">
<?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_wrap">
<div class="invoice_head_row" style="background-color:#F1F1F1">
<table width="100%" class="head_tbl" style="padding-top: 25px;">
<tr>
<td style="width:30%">
<table width="100%">
<tr>
<td width="100%" ><img class="logo_img" src="<?= $logo_img; ?>" alt="Logo Here"></td>
</tr>
<tr><td><hr style="width:100%;"></td></tr>
<tr>
<td width="100%"><h4><?= $school_info['school_name']; ?></h4></td>
</tr>
<tr>
<td width="100%"><p class="address"><?= $school_info['address']; ?></p></td>
</tr>
</table>
<div class="top_logo" style="padding-left:10px;">
</div>
</td>
<td style="width:30%">
<table >
<tr>
<th style="padding:0px 0px 0px 50px;">Bill Type</th><th> :</th><td>Original</td>
</tr>
</table>
</td>
<td style="width:40%">
<table style="text-align: left;">
<tr>
<th style="text-align: left;padding:5px;">Phone</th><th>:</th><td><span><?= $school_info['phone']; ?></span></td>
</tr>
<tr>
<th style="text-align: left;padding:5px;">Email</th><th>:</th><td><span><?= $school_info['email']; ?></span></td>
</tr>
<tr>
<th style="text-align: left;padding:5px;">Website</th><th>:</th><td><span><?= $school_info['website_link']; ?></span></td>
</tr>
<tr>
<th style="text-align: left;padding:5px;">School PAN</th><th>:</th><td><span><?= (!empty($school_info['pan'])) ? $school_info['pan']:"-"; ?></span></td>
</tr>
</table>
</td>
</tr>
</table>
<hr/>
</div>
<div style="margin:20px 5px">
<table width="100%" >
<tr>
<th style="padding:7px 7px 7px 0px;text-align:left; width:12%">Student Name </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= $invoice_data['studentname'] ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:12%">Parent PAN </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= (!empty($invoice_data['parent_pan'])) ? $invoice_data['parent_pan'] : '-'; ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:14%">Bill Print Count </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:16%"><span><?= $invoice_data['bill_print_count'] ?></span></td>
</tr>
<tr>
<th style="padding:7px 7px 7px 0px;text-align:left; width:12%">Classroom </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?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;
?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left; width:12%">Student ID </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= $invoice_data['studentId'] ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:14%">Transaction Date & Time </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:16%"><span><span><?= date('d-m-Y H:i:s', strtotime($invoice_data['tdt'])) ?></span></td>
</tr>
<tr>
<th style="padding:7px 7px 7px 0px;text-align:left; width:15%">Batch </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= $invoice_data['batch_name']; ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:15%"></th><th style="text-align:left; width:2%"></th><td style="text-align:left; width:20%"><span></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:15%"></th><th style="text-align:left; width:2%"></th><td style="text-align:left; width:20%"><span></span></td>
</tr>
</table>
</div>
<div class="invoice_table">
<table class="tblbody" style="border:1px solid #000; border-collapse: collapse; margin:5px;width: 100%;">
<thead>
<tr >
<th style="width:5%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">SNo</th>
<th style="width:25%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Description</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Bill No</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Billed By</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Mode of Payment</th>
<th style="width:15%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Paid Date</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;"><?php echo (!empty(ucfirst($invoice_data['deduction_type']))) ? ucfirst($invoice_data['deduction_type']) : "Scholarship/\nDiscount"; ?></th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Fine</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width:5%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;">1</td>
<td style="width:20%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['payment_for'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?php echo $invoice_data['invoice_no']; //echo $invoice_data['course_fee_id'].$invoice_data['studentId'].'/'.$invoice_data['install_sno'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['received_by'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['payment_method'] ?></td>
<td style="width:15%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= date('d-m-Y H:i:s', strtotime($invoice_data['paid_date'])) ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['deduction_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['fine_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= (($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount']) ?></td>
</tr>
<tr>
<td colspan="6" style="border:1px solid #000;padding:5px;text-align:center;"></td>
<td style="border:1px solid #000;padding:5px;text-align:center;"><?= $invoice_data['deduction_amount']; ?></td>
<td style="border:1px solid #000;padding:5px;text-align:center;"><?= $invoice_data['fine_amount']; ?></td>
<td style="border:1px solid #000;padding:5px;text-align:center;"><?= $invoice_data['payment_amt']; ?></td>
</tr>
</tbody>
<tr>
<td colspan="6" style="padding:10px 5px 10px 50px;text-align:left;width:60%">
<p style="padding:5px;font-weight:bold;"><span><b>Amount In Word :</b>
<?php echo '"'. amountInWords((($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount'])) .'"'; ?></span></p>
<br>
<p style="padding:5px;"> “This is computer generated receipt, no signature required.”</p>
</td>
<td colspan="3" style="padding:5px;width:40%;">
<table style="border:2px solid #000;border-collapse: collapse; margin:5px;width:100%;background-color:white;">
<tbody>
<tr >
<th style="padding:5px;text-align:left;width:65%">Total Fee Amount </th><th style="padding:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-weight:bold;"><?= $invoice_data['payment_amt']; ?></td>
</tr>
<tr>
<th style="padding:5px;text-align:left;width:65%">Total Fine </th><th style="padding:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-weight:bold;"><?= $invoice_data['fine_amount']; ?></td>
</tr>
<tr>
<th style="padding:5px;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:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-weight:bold;"><?= $invoice_data['deduction_amount']; ?></td>
</tr>
<tr>
<th style="padding:5px;text-align:left;width:65%">Total Paid Amount </th><th style="padding:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-weight:bold;"><?= $school_info['currency_symbol']; ?>. <?= (($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount']) ?></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>
</div>
<hr>
</div>
</div>
<!-- *************************************Copy****************************** -->
<div class="main-wrap">
<div class="dashboard-cover">
<?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_wrap">
<div class="invoice_head_row" style="background-color:#F1F1F1">
<table width="100%" class="head_tbl" style="padding-top: 25px;">
<tr>
<td style="width:30%">
<table width="100%">
<tr>
<td width="100%" ><img class="logo_img" src="<?= $logo_img; ?>" alt="Logo Here"></td>
</tr>
<tr><td><hr style="width:100%;"></td></tr>
<tr>
<td width="100%"><h4><?= $school_info['school_name']; ?></h4></td>
</tr>
<tr>
<td width="100%"><p class="address"><?= $school_info['address']; ?></p></td>
</tr>
</table>
<div class="top_logo" style="padding-left:10px;">
</div>
</td>
<td style="width:30%">
<table >
<tr>
<th style="padding:0px 0px 0px 50px;">Bill Type</th><th> :</th><td>Copy</td>
</tr>
</table>
</td>
<td style="width:40%">
<table style="text-align: left;">
<tr>
<th style="text-align: left;padding:5px;">Phone</th><th>:</th><td><span><?= $school_info['phone']; ?></span></td>
</tr>
<tr>
<th style="text-align: left;padding:5px;">Email</th><th>:</th><td><span><?= $school_info['email']; ?></span></td>
</tr>
<tr>
<th style="text-align: left;padding:5px;">Website</th><th>:</th><td><span><?= $school_info['website_link']; ?></span></td>
</tr>
<tr>
<th style="text-align: left;padding:5px;">School PAN</th><th>:</th><td><span><?= (!empty($school_info['pan'])) ? $school_info['pan']:"-"; ?></span></td>
</tr>
</table>
</td>
</tr>
</table>
<hr/>
</div>
<div style="margin:20px 5px">
<table width="100%" >
<tr>
<th style="padding:7px 7px 7px 0px;text-align:left; width:12%">Student Name </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= $invoice_data['studentname'] ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:12%">Parent PAN </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= (!empty($invoice_data['parent_pan'])) ? $invoice_data['parent_pan'] : '-'; ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:14%">Bill Print Count </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:16%"><span><?= $invoice_data['bill_print_count'] ?></span></td>
</tr>
<tr>
<th style="padding:7px 7px 7px 0px;text-align:left; width:12%">Classroom </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?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;
?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left; width:12%">Student ID </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= $invoice_data['studentId'] ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:14%">Transaction Date & Time </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:16%"><span><span><?= date('d-m-Y H:i:s', strtotime($invoice_data['tdt'])) ?></span></td>
</tr>
<tr>
<th style="padding:7px 7px 7px 0px;text-align:left; width:15%">Batch </th><th style="text-align:left; width:2%">:</th><td style="text-align:left; width:20%"><span><?= $invoice_data['batch_name']; ?></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:15%"></th><th style="text-align:left; width:2%"></th><td style="text-align:left; width:20%"><span></span></td>
<th style="padding:7px 7px 7px 0px;text-align:left;width:15%"></th><th style="text-align:left; width:2%"></th><td style="text-align:left; width:20%"><span></span></td>
</tr>
</table>
</div>
<div class="invoice_table">
<table class="tblbody" style="border:1px solid #000; border-collapse: collapse; margin:5px;width: 100%;">
<thead>
<tr >
<th style="width:5%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">SNo</th>
<th style="width:25%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Description</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Bill No</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Billed By</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Mode of Payment</th>
<th style="width:15%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Paid Date</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;"><?php echo (!empty(ucfirst($invoice_data['deduction_type']))) ? ucfirst($invoice_data['deduction_type']) : "Scholarship/\nDiscount"; ?></th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Fine</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; padding: 7px;">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width:5%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;">1</td>
<td style="width:20%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['payment_for'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?php echo $invoice_data['invoice_no']; //echo $invoice_data['course_fee_id'].$invoice_data['studentId'].'/'.$invoice_data['install_sno'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['received_by'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['payment_method'] ?></td>
<td style="width:15%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= date('d-m-Y H:i:s', strtotime($invoice_data['paid_date'])) ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['deduction_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= $invoice_data['fine_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 7px;"><?= (($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount']) ?></td>
</tr>
<tr>
<td colspan="6" style="border:1px solid #000;padding:5px;text-align:center;"></td>
<td style="border:1px solid #000;padding:5px;text-align:center;"><?= $invoice_data['deduction_amount']; ?></td>
<td style="border:1px solid #000;padding:5px;text-align:center;"><?= $invoice_data['fine_amount']; ?></td>
<td style="border:1px solid #000;padding:5px;text-align:center;"><?= $invoice_data['payment_amt']; ?></td>
</tr>
</tbody>
<tr>
<td colspan="6" style="padding:10px 5px 10px 50px;text-align:left;width:60%">
<p style="padding:5px;font-weight:bold;"><span><b>Amount In Word :</b>
<?php echo '"'. amountInWords((($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount'])) .'"'; ?></span></p>
<br>
<p style="padding:5px;"> “This is computer generated receipt, no signature required.”</p>
</td>
<td colspan="3" style="padding:5px;width:40%;">
<table style="border:2px solid #000;border-collapse: collapse; margin:5px;width:100%;background-color:white;">
<tbody>
<tr >
<th style="padding:5px;text-align:left;width:65%">Total Fee Amount </th><th style="padding:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-weight:bold;"><?= $invoice_data['payment_amt']; ?></td>
</tr>
<tr>
<th style="padding:5px;text-align:left;width:65%">Total Fine </th><th style="padding:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-weight:bold;"><?= $invoice_data['fine_amount']; ?></td>
</tr>
<tr>
<th style="padding:5px;text-align:left;width:65%;font-size:14px;">Total <?php echo (!empty(ucfirst($invoice_data['deduction_type']))) ? ucfirst($invoice_data['deduction_type']) : "Scholarship/\nDiscount"; ?> </th><th style="padding:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-size:14px;font-weight:bold;"><?= $invoice_data['deduction_amount']; ?></td>
</tr>
<tr>
<th style="padding:5px;text-align:left;width:65%;font-size:14px;">Total Paid Amount </th><th style="padding:5px;text-align:left;width:5%">:</th><td style="width:30%;padding:5px;text-align:right;font-weight:bold;font-size:14px;"><?= $school_info['currency_symbol']; ?>. <?= (($invoice_data['payment_amt'] + $invoice_data['fine_amount'] ) - $invoice_data['deduction_amount']) ?></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>
</div>
<hr>
</div>
</div>
</main>
</div>