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

448 lines
31 KiB
PHP

<!-- <link rel="stylesheet" href="<?php //echo base_url();
?>assets_admin/css/invoice.css"> -->
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/invoice.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/all.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/bootstrap.min.css">
<div class="wraper responsive-width" style="margin:0px;padding:0px;">
<main class="printdiv1" id="main">
<div class="main-wrap">
<div class="dashboard-cover">
<div class="invoice_wrap" id="printpage">
<?php
// echo '<pre>';
$single_invoice_no = '';
$billPrintCount = 0;
$billPrintCountArray = [];
// print_r(($invoicelist));
// print_r(($invoiceids));
$isSingleInvoice = false;
if (count($invoiceids) == 1) {
$isSingleInvoice = true;
}
foreach ($invoicelist as $i_key => $i_value) {
$single_invoice_no = $i_value['invoice_no'];
array_push($billPrintCountArray, $i_value['bill_print_count']);
}
$cssStyle = (!empty($invoicelist) && (count($invoicelist) > 20)) ? 'style="page-break-after: always;"' : '';
?>
<div class="invoice_main" <?= $cssStyle; ?>>
<?php
if (empty($school_info['markscard_header'])) {
$logo_img = base_url() . 'common_assets/black_logo.png';
} else if (file_exists('common_assets/' . $school_info['markscard_header'])) {
$logo_img = base_url() . 'common_assets/' . $school_info['markscard_header'];
} 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" width="60px">
<hr align="left" style="width:50%;">
<h4 style="padding:0px;margin:0px;"><?= $school_info['school_name']; ?></h4>
<p class="address" style="word-wrap: break-word;margin:0;padding:0;"><?= $school_info['address']; ?></p>
</div>
</td>
<td style="width:20%">
<div class="bill-type" style="text-align:center;">
<p><label for="">Bill Type</label> : <span>Original</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">
<div class="row">
<div class="col"><b>Student Name : </b><span style="font-size: 18px;"><?= $studentinfo['studentname'] ?></span></div>
<div class="col"><b>Parent PAN: </b><span style="font-size: 18px;"><?= $studentinfo['parent_pan'] ?></span></div>
<div class="col" style="font-size: 18px;"><b><?= $isSingleInvoice ? 'Invoice Number' : 'Bill Print Count' ?>: </b><?= $isSingleInvoice ? $single_invoice_no : $billPrintCountArray[0] ?></div>
</div>
<div class="row mt-1">
<div class="col"><b>Classroom : </b>
<span style="font-size: 18px;">
<?php
// $section_id = (!empty($studentinfo['section_id']) && isset($studentinfo['section_id'])) ? $studentinfo['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' => $studentinfo['course_id']))->row()->course_name;
// echo (!empty($section_name)) ? $course_name . ' - ' . $section_name : $course_name;
echo $studentinfo['classroom_name'];
?>
</span>
</div>
<div class="col"><b>Student ID : </b><span style="font-size: 18px;"><?= $studentinfo['studentId'] ?></span></div>
<div class="col"><b>Batch : </b><span style="font-size: 18px;"><?= str_replace('Batch ', '', $studentinfo['batch_name']) ?></span></div>
</div>
<div class="row mt-1">
<?php
if ($isSingleInvoice) {
?>
<div class="" style="width: 33.33%">
<b> BiBill Count : </b><span style="font-size: 18px;"><?= $billPrintCountArray[0] ?></span>
</div>
<?php } ?>
<div class="col"><b>Transaction Date & Time : </b><span style="font-size: 18px;"><?= $nDate ?></span></div>
</div>
</div>
<div class="invoice_footer_row" style="padding-top:10px;">
<table class="footer_tbl_main" width="100%" style="border:1px solid #000;border-collapse: collapse;text-align:center;font-size:16px;">
<tr>
<th style="width:5%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">S.NO</th>
<th style="width:25%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">Description Fee</th>
<?php
if (!$isSingleInvoice) {
?>
<th style="width:8%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">Invoice No.</th>
<?php } ?>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">Billed By</th>
<th style="width:15%; text-align:center;border:1px solid #000;color: #212529;font-size:16px; padding: 8px;">Mode of Payment</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Paid Date</th>
<th style="width:8%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Discount</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Fine</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Amount</th>
</tr>
<tbody>
<?php
$totalAmt = 0;
if (!empty($invoicelist)) {
$sno = 1;
foreach ($invoicelist as $ivalue) {
$totalAmt = $totalAmt + $ivalue['payment_amt'];
?>
<tr>
<td style="width:5%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $sno; ?></td>
<td style="width:25%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['fee_values'] ?><small>(<?= $ivalue['payment_for'] ?>)</small></td>
<?php
if (!$isSingleInvoice) {
?>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;">
<?php
if ($school_info['invoice_prefix_status'] == 1 && !empty($ivalue['invoice_no']))
echo $school_info['invoice_prefix'] . $ivalue['invoice_no'];
else
echo $ivalue['invoice_no'];
//echo $ivalue['course_fee_id'].$ivalue['studentId'].'/'.$ivalue['install_sno']
?>
</td>
<?php } ?>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['payment_recived_id'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['payment_method'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= date('d-m-Y', strtotime($ivalue['payment_date'])); ?></td>
<td style="width:8%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['deduction_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['fine_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['payment_amt'] ?></td>
</tr>
<?php
$sno++;
}
} else {
?>
<tr>
<td colspan=5> No Data Found</td>
</tr>
<?php } ?>
</tbody>
<?php
$totalAmt = 0;
$fine_amount = 0;
$disc_amount = 0;
if (!empty($invoicelist)) {
$sno = 1;
foreach ($invoicelist as $ivalue) {
$totalAmt = $totalAmt + $ivalue['payment_amt'];
$fine_amount = $fine_amount + $ivalue['fine_amount'];
$disc_amount = $disc_amount + $ivalue['deduction_amount'];
}
?>
<tr style="border:1px solid;">
<th colspan="<?= !$isSingleInvoice ? 6 : 5 ?>" style="border:1px solid #000;padding:5px;text-align:center; font-size:16px;"></th>
<th style="border:1px solid #000;padding:5px;text-align:center;font-size:16px;"><?php echo $disc_amount ?></th>
<th style="border:1px solid #000;padding:5px;text-align:center;font-size:16px;"><?php echo $fine_amount ?></th>
<th style="border:1px solid #000;padding:5px;text-align:center;font-size:16px;"><?php echo $totalAmt ?></th>
</tr>
<?php } ?>
</table>
<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;font-size:12px;">Amount In Word</label> :
<span style="font-size: 12px;width: 100px;font-weight: 600;font-size:16px;"><?php echo '"' . amountInWords((float)$totalAmt + $fine_amount - $disc_amount) . '"'; ?></span>
<p style="color: #212529;padding-top:5px; font-size: 10px; text-align: start;">“This is computer generated receipt, no signature required.”</p>
</td>
<td width=45% style="border:1px solid #000;padding:16px 5px;border-left:0;border-top: 0;">
<table class="bottom-tbl" width=100% style="border: 2px solid #000;">
<tr>
<th style="padding:8px;text-align:left;width:65%; font-size: 16px;">Total Paid Amount </th>
<th style="padding:8px;text-align:left;width:5%;font-size: 16px;">:</th>
<td style="width:30%;padding:8px;text-align:right;font-size: 16px;"><?= $school_info['currency_symbol']; ?>. <?= (number_format($totalAmt + $fine_amount - $disc_amount)) ?></td>
</tr>
</table>
</td>
</tr>
</table>
<div class="row">
<div class="row"></div>
</div>
</div>
</div>
<hr>
<div class="invoice_main" <?= $cssStyle; ?>>
<?php
if (empty($school_info['markscard_header'])) {
$logo_img = base_url() . 'common_assets/black_logo.png';
} else if (file_exists('common_assets/' . $school_info['markscard_header'])) {
$logo_img = base_url() . 'common_assets/' . $school_info['markscard_header'];
} 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" width="60px">
<hr align="left" style="width:50%;">
<h4 style="padding:0px;margin:0px;"><?= $school_info['school_name']; ?></h4>
<p class="address" style="word-wrap: break-word;margin:0;padding:0;"><?= $school_info['address']; ?></p>
</div>
</td>
<td style="width:20%">
<div class="bill-type" style="text-align:center;">
<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">
<div class="row">
<div class="col"><b>Student Name : </b><span style="font-size: 18px;"><?= $studentinfo['studentname'] ?></span></div>
<div class="col"><b>Parent PAN: </b><span style="font-size: 18px;"><?= $studentinfo['parent_pan'] ?></span></div>
<div class="col" style="font-size: 18px;"><b><?= $isSingleInvoice ? 'Invoice Number' : 'Bill Print Count' ?>: </b><?= $isSingleInvoice ? $single_invoice_no : $billPrintCountArray[0] ?></div>
</div>
<div class="row mt-1">
<div class="col"><b>Classroom : </b>
<span style="font-size: 18px;">
<?php
$section_id = (!empty($studentinfo['section_id']) && isset($studentinfo['section_id'])) ? $studentinfo['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' => $studentinfo['course_id']))->row()->course_name;
echo (!empty($section_name)) ? $course_name . ' - ' . $section_name : $course_name;
?>
</span>
</div>
<div class="col"><b>Student ID : </b><span style="font-size: 18px;"><?= $studentinfo['studentId'] ?></span></div>
<div class="col"><b>Batch : </b><span style="font-size: 18px;"><?= str_replace('Batch ', '', $studentinfo['batch_name']) ?></span></div>
</div>
<div class="row mt-1">
<?php
if ($isSingleInvoice) {
?>
<div class="" style="width: 33.33%">
<b> BiBill Count : </b><span style="font-size: 18px;"><?= $billPrintCountArray[0] ?></span>
</div>
<?php } ?>
<div class="col"><b>Transaction Date & Time : </b><span style="font-size: 18px;"><?= $nDate ?></span></div>
</div>
</div>
<div class="invoice_footer_row" style="padding-top:10px;">
<table class="footer_tbl_main" width="100%" style="border:1px solid #000;border-collapse: collapse;text-align:center;font-size:16px;">
<tr>
<th style="width:5%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">S.NO</th>
<th style="width:25%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">Description Fee</th>
<?php
if (!$isSingleInvoice) {
?>
<th style="width:8%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">Invoice No.</th>
<?php } ?>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px; padding: 8px;">Billed By</th>
<th style="width:15%; text-align:center;border:1px solid #000;color: #212529;font-size:16px; padding: 8px;">Mode of Payment</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Paid Date</th>
<th style="width:8%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Discount</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Fine</th>
<th style="width:10%; text-align:center;border:1px solid #000;color: #212529; font-size:16px;padding: 8px;">Amount</th>
</tr>
<tbody>
<?php
$totalAmt = 0;
if (!empty($invoicelist)) {
$sno = 1;
foreach ($invoicelist as $ivalue) {
$totalAmt = $totalAmt + $ivalue['payment_amt'];
?>
<tr>
<td style="width:5%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $sno; ?></td>
<td style="width:25%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['fee_values'] ?><small>(<?= $ivalue['payment_for'] ?>)</small></td>
<?php
if (!$isSingleInvoice) {
?>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:16px;">
<?php
if ($school_info['invoice_prefix_status'] == 1 && !empty($ivalue['invoice_no']))
echo $school_info['invoice_prefix'] . $ivalue['invoice_no'];
else
echo $ivalue['invoice_no'];
//echo $ivalue['course_fee_id'].$ivalue['studentId'].'/'.$ivalue['install_sno']
?>
</td>
<?php } ?>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['payment_recived_id'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['payment_method'] ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= date('d-m-Y', strtotime($ivalue['payment_date'])); ?></td>
<td style="width:8%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['deduction_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['fine_amount']; ?></td>
<td style="width:10%; text-align:center;border:1px solid #000;color: #212529;padding: 5px; font-size:18px;"><?= $ivalue['payment_amt'] ?></td>
</tr>
<?php
$sno++;
}
} else {
?>
<tr>
<td colspan=5> No Data Found</td>
</tr>
<?php } ?>
</tbody>
<?php
$totalAmt = 0;
$fine_amount = 0;
$disc_amount = 0;
if (!empty($invoicelist)) {
$sno = 1;
foreach ($invoicelist as $ivalue) {
$totalAmt = $totalAmt + $ivalue['payment_amt'];
$fine_amount = $fine_amount + $ivalue['fine_amount'];
$disc_amount = $disc_amount + $ivalue['deduction_amount'];
}
?>
<tr style="border:1px solid;">
<th colspan="<?= !$isSingleInvoice ? 6 : 5 ?>" style="border:1px solid #000;padding:5px;text-align:center; font-size:18px;"></th>
<th style="border:1px solid #000;padding:5px;text-align:center;font-size:18px;"><?php echo $disc_amount ?></th>
<th style="border:1px solid #000;padding:5px;text-align:center;font-size:18px;"><?php echo $fine_amount ?></th>
<th style="border:1px solid #000;padding:5px;text-align:center;font-size:18px;"><?php echo $totalAmt ?></th>
</tr>
<?php } ?>
</table>
<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;font-size:12px;">Amount In Word</label> :
<span style="font-size: 12px;width: 100px;font-weight: 600;font-size:16px;"><?php echo '"' . amountInWords((float)$totalAmt + $fine_amount - $disc_amount) . '"'; ?></span>
<p style="color: #212529;padding-top:5px; font-size: 10px; text-align: start;">“This is computer generated receipt, no signature required.”</p>
</td>
<td width=45% style="border:1px solid #000;padding:16px 5px;border-left:0;border-top: 0;">
<table class="bottom-tbl" width=100% style="border: 2px solid #000;">
<tr>
<th style="padding:8px;text-align:left;width:65%; font-size: 16px;">Total Paid Amount </th>
<th style="padding:8px;text-align:left;width:5%;font-size: 16px;">:</th>
<td style="width:30%;padding:8px;text-align:right;font-size: 16px;"><?= $school_info['currency_symbol']; ?>. <?= (number_format($totalAmt + $fine_amount - $disc_amount)) ?></td>
</tr>
</table>
</td>
</tr>
</table>
<div class="row">
<div class="row"></div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>