Live Issues addresses are not printing fixes : ps
This commit is contained in:
parent
85bf5336bc
commit
da41a90bd9
@ -49,7 +49,7 @@ $routes->get('dashboard/', 'Home::index');
|
||||
|
||||
# Users Routes
|
||||
$routes->get("user_list/", "Users::index");
|
||||
$routes->get("user_page/(:any)", "Users::user_page/$1");
|
||||
$routes->get("user_page/(:any)/(:any)", "Users::user_page/$1/$2");
|
||||
$routes->post("insert_users", "Users::insert_users");
|
||||
$routes->get('users/fetch_event_names', 'Users::fetch_event_names');
|
||||
|
||||
|
||||
@ -742,8 +742,10 @@ class ApiIntegration extends ResourceController
|
||||
$billing_addr = NULL;$shipping_addr = NULL;
|
||||
$lineitems_array = [];
|
||||
$billing_array = []; $shipping_array = [];
|
||||
$lineitems_subtotal = 0; $lineitems_tax = 0;
|
||||
$lineitems_discount = 0; $lineitems_total=0;
|
||||
$lineitems_subtotal = 0; ## for lineitem product wise price total
|
||||
$lineitems_tax = 0; ## for lineitem product wise tax
|
||||
$lineitems_discount = 0; ## for lineitem product wise discount
|
||||
$lineitems_total=0; ## for lineitem grand total
|
||||
|
||||
// $line_items = ;
|
||||
|
||||
@ -794,7 +796,8 @@ class ApiIntegration extends ResourceController
|
||||
}
|
||||
}
|
||||
|
||||
$subtotal = (float)$lineitems_subtotal + (float)$records['shipping_total'];
|
||||
// $subtotal = (float)$lineitems_subtotal + (float)$records['shipping_total'];
|
||||
$subtotal = (float)$lineitems_subtotal;
|
||||
$tax = $lineitems_tax + (float)$records['shipping_tax'];
|
||||
$total = ($lineitems_total)+(float)$records['shipping_total'] + (float)$records['shipping_tax'];
|
||||
$final_status = '';
|
||||
@ -830,7 +833,8 @@ class ApiIntegration extends ResourceController
|
||||
$invoice_data['subtotal']=(int)$subtotal;
|
||||
$invoice_data['tax']=(int)$tax;
|
||||
$invoice_data['discount']=(int)$lineitems_discount;
|
||||
$invoice_data['total_amount']= $records['total'];
|
||||
$invoice_data['total_amount']= round($records['total']);
|
||||
$invoice_data['exact_total_amount']= (float)$records['total'];
|
||||
$invoice_data['payment_status']=$records['status'];
|
||||
$invoice_data['order_number']=$records['order_key'];
|
||||
$invoice_data['payment_method']=$records['payment_method_title'];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -49,12 +49,13 @@ class Users extends BaseController
|
||||
}
|
||||
|
||||
## To Load User Add/Update page
|
||||
public function user_page($id)
|
||||
public function user_page($id,$flag)
|
||||
{
|
||||
helper('session');
|
||||
$session_role = get_user_role();
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
$data['dummy_flag'] = $flag; // for redirect purpose.
|
||||
if ($id === '0') {
|
||||
$this->logger->info("Users: In Add page");
|
||||
$data['page_name'] = 'Add User';
|
||||
@ -247,7 +248,12 @@ class Users extends BaseController
|
||||
$this->logger->error("Users: Err Occur =".$e->getMessage());
|
||||
session()->setFlashdata('error', 'Message: ' .$e->getMessage());
|
||||
}
|
||||
return redirect()->route('user_list');
|
||||
// Redirect back to the user_page function or any other appropriate page
|
||||
if($this->request->getPost('dummy_flag') == 1){
|
||||
return redirect()->to(base_url("user_page/{$user_id}/1"));
|
||||
}else{
|
||||
return redirect()->route('user_list');
|
||||
}
|
||||
}
|
||||
|
||||
## For delete the user details (Which means inactive the details)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,30 @@
|
||||
<style>
|
||||
|
||||
/* CSS for modal content */
|
||||
#pdfPreviewModal .modal-dialog {
|
||||
max-width: 210mm; /* A5 width */
|
||||
max-width: 210mm;
|
||||
/* A5 width */
|
||||
width: auto;
|
||||
margin: 1.75rem auto;
|
||||
}
|
||||
|
||||
#pdfPreviewModal .modal-body {
|
||||
font-family: 'Apple System', 'BlinkMacSystemFont', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
.table-responsive{
|
||||
|
||||
.table-responsive {
|
||||
font-family: 'Apple System', 'BlinkMacSystemFont', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#printPdfButton .ri-printer-line {
|
||||
font-size: 8px;
|
||||
}
|
||||
.modal-lg, .modal-xl {
|
||||
max-width: 678px;
|
||||
}
|
||||
|
||||
.modal-lg,
|
||||
.modal-xl {
|
||||
max-width: 678px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -28,7 +33,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="float-right">
|
||||
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
||||
@ -75,7 +80,7 @@
|
||||
</td>
|
||||
<td class="preview-pdf" data-order="<?= strtotime($row['invoice_date']); ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $invoice_date; ?></td>
|
||||
<td class="preview-pdf" data-order="<?= $row['customer_name']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['customer_name']; ?></td>
|
||||
<td class="preview-pdf" data-order="<?= $row['status']; ?>;" id="status-column" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['status']; ?></td>
|
||||
<td class="preview-pdf" data-order="<?= $row['status']; ?>;" id="status-column" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['status']; ?></td>
|
||||
<td class="preview-pdf" data-order="<?= $row['total_amount']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= "₹ " . $row['total_amount']; ?></td>
|
||||
<td>
|
||||
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>
|
||||
@ -117,19 +122,19 @@
|
||||
<div class="modal fade" id="pdfPreviewModal" tabindex="-1" role="dialog" aria-labelledby="pdfPreviewModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="pdfPreviewModalLabel"></h5>
|
||||
<!-- Placeholder for status -->
|
||||
<a href="#" class="" id="downloadPdfButton" title="Invoice PDF" style="font-size: large;"><i class="ri-file-download-line"></i> </a>
|
||||
<a href="#" class="ri-printer-line" id="printPdfButton" title="Print Invoice" style="font-size: large; margin-left: 8px;"></a>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="font-size: 27px; margin-bottom: 2px;">
|
||||
<span id="statusText"></span>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="pdfPreviewModalLabel"></h5>
|
||||
<!-- Placeholder for status -->
|
||||
<a href="#" class="" id="downloadPdfButton" title="Invoice PDF" style="font-size: large;"><i class="ri-file-download-line"></i> </a>
|
||||
<a href="#" class="ri-printer-line" id="printPdfButton" title="Print Invoice" style="font-size: large; margin-left: 8px;"></a>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="font-size: 27px; margin-bottom: 2px;">
|
||||
<span id="statusText"></span>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<!-- PDF content will be loaded here -->
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
@ -171,48 +176,52 @@
|
||||
$(document).ready(function() {
|
||||
var actionColumnIndex = $('#action-column').index();
|
||||
$('#scroll-horizontal-datatable_wrapper').DataTable({
|
||||
"order": [ [0, "desc"] ], // 4 is the column index of "created_on" in your table
|
||||
"columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
|
||||
"order": [
|
||||
[0, "desc"]
|
||||
], // 4 is the column index of "created_on" in your table
|
||||
"columnDefs": [{
|
||||
"targets": [actionColumnIndex],
|
||||
"orderable": false
|
||||
}]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).on('click', '.preview-pdf', function() {
|
||||
var invoiceId = $(this).data('invoice-id');
|
||||
$(document).on('click', '.preview-pdf', function() {
|
||||
var invoiceId = $(this).data('invoice-id');
|
||||
|
||||
// Send AJAX request to controller
|
||||
$.ajax({
|
||||
url: '<?= base_url('generate_invoice_pdf_preview/') ?>' + invoiceId,
|
||||
type: 'GET',
|
||||
dataType: 'html',
|
||||
success: function(response) {
|
||||
// Display the PDF content in a modal or an iframe
|
||||
$('#pdfPreviewModal .modal-body').html(response);
|
||||
$('#downloadPdfButton').attr('href', '<?= base_url("generate_invoice_pdf/") ?>' + invoiceId);
|
||||
|
||||
// Get the status text
|
||||
var status = $('.preview-pdf[data-invoice-id="' + invoiceId + '"]').closest('tr').find('#status-column').text().trim();
|
||||
|
||||
// Update the status in the modal header
|
||||
$('#statusText').text('' + status);
|
||||
// Send AJAX request to controller
|
||||
$.ajax({
|
||||
url: '<?= base_url('generate_invoice_pdf_preview/') ?>' + invoiceId,
|
||||
type: 'GET',
|
||||
dataType: 'html',
|
||||
success: function(response) {
|
||||
// Display the PDF content in a modal or an iframe
|
||||
$('#pdfPreviewModal .modal-body').html(response);
|
||||
$('#downloadPdfButton').attr('href', '<?= base_url("generate_invoice_pdf/") ?>' + invoiceId);
|
||||
|
||||
// Hide the "Edit" button if the status is approved
|
||||
if (status.toLowerCase() === 'approved') {
|
||||
$('#editInvoiceButton').hide();
|
||||
} else {
|
||||
$('#editInvoiceButton').show();
|
||||
$('#editInvoiceButton').attr('href', '<?= base_url("new_book_invoice/") ?>' + invoiceId);
|
||||
// Get the status text
|
||||
var status = $('.preview-pdf[data-invoice-id="' + invoiceId + '"]').closest('tr').find('#status-column').text().trim();
|
||||
|
||||
// Update the status in the modal header
|
||||
$('#statusText').text('' + status);
|
||||
|
||||
// Hide the "Edit" button if the status is approved
|
||||
if (status.toLowerCase() === 'approved') {
|
||||
$('#editInvoiceButton').hide();
|
||||
} else {
|
||||
$('#editInvoiceButton').show();
|
||||
$('#editInvoiceButton').attr('href', '<?= base_url("new_book_invoice/") ?>' + invoiceId);
|
||||
}
|
||||
|
||||
$('#pdfPreviewModal').modal('show');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
alert('Failed to load PDF preview.');
|
||||
}
|
||||
|
||||
$('#pdfPreviewModal').modal('show');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
alert('Failed to load PDF preview.');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
// JavaScript click event handler for printing PDF
|
||||
@ -240,6 +249,4 @@
|
||||
};
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</script>
|
||||
@ -1,26 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
/* Add your CSS styles here to format the invoice for mPDF */
|
||||
body {
|
||||
|
||||
font-family: 'Times New Roman', Times, sans-serif;
|
||||
|
||||
font-size: 12px; /* Change this value to your desired font size */
|
||||
font-family: 'Times New Roman', Times, sans-serif;
|
||||
|
||||
font-size: 12px;
|
||||
/* Change this value to your desired font size */
|
||||
}
|
||||
|
||||
/* Style for the main table with border */
|
||||
table.main-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border: -0.5px solid black; /* Add a border around the entire invoice */
|
||||
border: -0.5px solid black;
|
||||
/* Add a border around the entire invoice */
|
||||
}
|
||||
|
||||
table.main-table th,
|
||||
table.main-table td {
|
||||
border: none; /* Remove borders from all cells inside the main table */
|
||||
border: none;
|
||||
/* Remove borders from all cells inside the main table */
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
@ -41,7 +45,8 @@
|
||||
}
|
||||
|
||||
img.business-logo {
|
||||
max-width: 200px; /* Adjust the size of the logo */
|
||||
max-width: 200px;
|
||||
/* Adjust the size of the logo */
|
||||
}
|
||||
|
||||
/* Style for the business name */
|
||||
@ -71,70 +76,83 @@
|
||||
}
|
||||
|
||||
/* Style for the billing and shipping addresses */
|
||||
.billing-address, .shipping-address {
|
||||
.billing-address,
|
||||
.shipping-address {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/* Style for the invoice-related table */
|
||||
table.invoice-related-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.invoice-related-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table.invoice-related-table th,
|
||||
table.invoice-related-table td {
|
||||
border: none; /* Remove borders from all cells in the invoice items table */
|
||||
padding: 8px;
|
||||
text-align: center; /* Center-align text in cells */
|
||||
}
|
||||
table.invoice-related-table th,
|
||||
table.invoice-related-table td {
|
||||
border: none;
|
||||
/* Remove borders from all cells in the invoice items table */
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
/* Center-align text in cells */
|
||||
}
|
||||
|
||||
table.invoice-related-table th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
table.invoice-related-table th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Style for the business stamp and terms */
|
||||
.business-stamp, .terms {
|
||||
.business-stamp,
|
||||
.terms {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.subtotal-table {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.subtotal-table table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid black; /* Add a border around the subtotal table */
|
||||
}
|
||||
.subtotal-table table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid black;
|
||||
/* Add a border around the subtotal table */
|
||||
}
|
||||
|
||||
.subtotal-table th,
|
||||
.subtotal-table td {
|
||||
border: none; /* Remove borders from cells inside the subtotal table */
|
||||
padding: 8px;
|
||||
text-align: right;
|
||||
}
|
||||
.subtotal-table th,
|
||||
.subtotal-table td {
|
||||
border: none;
|
||||
/* Remove borders from cells inside the subtotal table */
|
||||
padding: 8px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.subtotal-table th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
.subtotal-table th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.subtotal-table td:last-child {
|
||||
font-weight: bold; /* Make the last column (total values) bold */
|
||||
}
|
||||
td.invoice-number {
|
||||
font-size: 18px; /* Increase font size to your desired value */
|
||||
/* Highlight background color */
|
||||
font-weight: bold; /* Make the text bold */
|
||||
}
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0rem;
|
||||
}
|
||||
.subtotal-table td:last-child {
|
||||
font-weight: bold;
|
||||
/* Make the last column (total values) bold */
|
||||
}
|
||||
|
||||
td.invoice-number {
|
||||
font-size: 18px;
|
||||
/* Increase font size to your desired value */
|
||||
/* Highlight background color */
|
||||
font-weight: bold;
|
||||
/* Make the text bold */
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="main-table">
|
||||
<tr>
|
||||
@ -144,15 +162,15 @@ p {
|
||||
<tr>
|
||||
<td class="business-logo-container">
|
||||
<img src="https://vijayabharathambooks.com/wp-content/uploads/2021/09/vijaya-bharatham-logo-8pt.png" alt="Business Logo" class="business-logo">
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><?= $value->company_address ?>,<br>
|
||||
<?= $value->company_city ?>,
|
||||
<?= $value->company_state ?>
|
||||
<?= $value->company_postal_code ? " - ".$value->company_postal_code:"" ?>.</p>
|
||||
<?= $value->company_city ?>,
|
||||
<?= $value->company_state ?>
|
||||
<?= $value->company_postal_code ? " - " . $value->company_postal_code : "" ?>.</p>
|
||||
<p><?= $value->company_email ?></p>
|
||||
<p><?= $value->company_mobile_no ?></p>
|
||||
</td>
|
||||
@ -161,29 +179,29 @@ p {
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table class="invoice-info-table">
|
||||
<table class="invoice-info-table">
|
||||
<?php foreach ($data as $value) : ?>
|
||||
<tr>
|
||||
<th><?php echo ($value->wp_api_order_id) ? 'Order # ' . $value->invoice_number : 'Invoice # ' . $value->invoice_number; ?></th>
|
||||
<th><?php echo ($value->wp_api_order_id) ? 'Order # ' . $value->invoice_number : 'Invoice # ' . $value->invoice_number; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Invoice Date : <?= $value->formatted_invoice_date ?></th>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php if ($value->due_date) : ?>
|
||||
<tr>
|
||||
<th>Due Date : <?= $value->formatted_due_date ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Due Date : <?= $value->formatted_due_date ?></th>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if ($invoice_type === '2') : ?>
|
||||
<?php foreach ($invoiceItems as $item) : ?>
|
||||
<tr>
|
||||
<th>From Subscription : <?= date('d/m/y', strtotime($item->from_subscription)) ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>To Subscription : <?= date('d/m/y', strtotime($item->to_subscription)) ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>From Subscription : <?= date('d/m/y', strtotime($item->from_subscription)) ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>To Subscription : <?= date('d/m/y', strtotime($item->to_subscription)) ?></th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
@ -200,30 +218,35 @@ p {
|
||||
<tr>
|
||||
<td class="billing-address">
|
||||
<?php foreach ($data as $value) : ?>
|
||||
<?= $value->customer_name ?><br>
|
||||
<?= $value->customer_ship_address." ," ?><br>
|
||||
<?= $value->customer_ship_city ?> <?= $value->customer_ship_state ? $value->customer_bill_state :""?>
|
||||
<?= $value->customer_ship_postal_code ? " - ".$value->customer_ship_postal_code :""; ?>
|
||||
<?= $value->customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?><br>
|
||||
|
||||
<?= $value->mobile_no." ." ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?= $value->customer_name ?><br>
|
||||
<?php if($value->customer_bill_address){ ?>
|
||||
<?= $value->customer_bill_address ? $value->customer_bill_address." ," : ""?><br>
|
||||
<?= $value->customer_bill_city ? $value->customer_bill_city : "" ?> <?= $value->customer_bill_state ? $value->customer_bill_state : "" ?>
|
||||
<?= $value->customer_bill_postal_code ? " - " . $value->customer_bill_postal_code : ""; ?>
|
||||
<?= $value->customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?><br>
|
||||
<?= $value->mobile_no ? $value->mobile_no." ." : "" ?>
|
||||
<?php }else{
|
||||
echo $value->billing_address;
|
||||
echo "<br>";
|
||||
echo $value->mobile_no ? $value->mobile_no." ." : ""; } endforeach; ?>
|
||||
</td>
|
||||
<td class="shipping-address">
|
||||
<?php foreach ($data as $value) : ?>
|
||||
<?= $value->customer_name ?><br>
|
||||
<?= $value->customer_bill_address." ," ?><br>
|
||||
<?= $value->customer_bill_city ?> <?= $value->customer_bill_state ? $value->customer_bill_state : "" ?>
|
||||
<?= $value->customer_bill_postal_code ? " - ".$value->customer_bill_postal_code :""; ?>
|
||||
<?= $value->customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?><br>
|
||||
|
||||
<?= $value->mobile_no." ." ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if($value->customer_ship_address){ ?>
|
||||
<?= $value->customer_ship_address ? $value->customer_ship_address." ," : "" ?><br>
|
||||
<?= $value->customer_ship_city ? $value->customer_ship_city : "" ?> <?= $value->customer_ship_state ? $value->customer_bill_state : "" ?>
|
||||
<?= $value->customer_ship_postal_code ? " - " . $value->customer_ship_postal_code : ""; ?>
|
||||
<?= $value->customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?><br>
|
||||
<?= $value->mobile_no ? $value->mobile_no." ." : "" ?>
|
||||
<?php }else{
|
||||
echo $value->shipping_address;
|
||||
echo "<br>";
|
||||
echo $value->mobile_no ? $value->mobile_no." ." : ""; } endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br> <br>
|
||||
<br> <br>
|
||||
<table class="invoice-related-table">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -231,72 +254,72 @@ p {
|
||||
<th>Item Name</th>
|
||||
<th>Qty</th>
|
||||
<th>Rate</th>
|
||||
|
||||
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $serialNumber = 1; ?>
|
||||
<?php $serialNumber = 1; ?>
|
||||
<?php foreach ($invoiceItems as $item) : ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $serialNumber++; ?>
|
||||
|
||||
</td>
|
||||
<?= $serialNumber++; ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td><?= $item->title ?></td>
|
||||
<td><?= $item->quantity ?></td>
|
||||
<td>₹<?= number_format($item->unit_price, 2, '.', ',') ?></td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td>₹<?= number_format($item->subtotal, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="subtotal-table">
|
||||
<?php foreach ($data as $value) : ?>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Subtotal : ₹<?= number_format($value->subtotal, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Discount : <?= $value->discount ? "(-)".number_format($value->discount, 2, '.', ','): number_format(0, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
|
||||
<!-- -->
|
||||
<?php if ($value->shipping_label != '') : ?>
|
||||
<tr>
|
||||
<td colspan="5" align="right"><?= $value->shipping_label?> : ₹<?= number_format($value->shipping_charge, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<?php foreach ($data as $value) : ?>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Subtotal : ₹<?= number_format($value->subtotal, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Discount : <?= $value->discount ? "(-)" . number_format($value->discount, 2, '.', ',') : number_format(0, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$sign = ($value->total_amount >= $value->exact_total_amount) ? '+' : '-';
|
||||
$difference = abs($value->exact_total_amount - $value->total_amount);
|
||||
?>
|
||||
<!-- -->
|
||||
<?php if ($value->shipping_label != '') : ?>
|
||||
<tr>
|
||||
<td colspan="5" align="right"><?= $value->shipping_label ?> : ₹<?= number_format($value->shipping_charge, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
|
||||
<td colspan="5" align="right"> Rounding : <?= $sign.number_format($difference, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Total : ₹<?= number_format($value->total_amount, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php if ($value->status === 'Draft'): ?>
|
||||
<!-- Set Balance if status is draft and paid is 0 -->
|
||||
<tr>
|
||||
<td colspan="5" align="right">Balance : ₹<?= number_format($value->total_amount, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ($value->status === 'Approved'): ?>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Paid : ₹<?= number_format($value->total_amount, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php
|
||||
$sign = ($value->total_amount >= $value->exact_total_amount) ? '+' : '-';
|
||||
$difference = abs($value->exact_total_amount - $value->total_amount);
|
||||
?>
|
||||
|
||||
<td colspan="5" align="right"> Rounding : <?= $sign . number_format($difference, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Total : ₹<?= number_format($value->total_amount, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php if ($value->status === 'Draft') : ?>
|
||||
<!-- Set Balance if status is draft and paid is 0 -->
|
||||
<tr>
|
||||
<td colspan="5" align="right">Balance : ₹<?= number_format($value->total_amount, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ($value->status === 'Approved') : ?>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Paid : ₹<?= number_format($value->total_amount, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<div class="business-stamp">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php foreach ($data as $value) : ?>
|
||||
@ -305,27 +328,30 @@ p {
|
||||
<!-- <if(!empty($value->notes)){
|
||||
<br><p style="text-align: left !important;"><b>Notes:</b> $value->notes; ?></p>
|
||||
} ?> -->
|
||||
<?php if(!empty($value->reason)){ ?>
|
||||
<br><p style="text-align: left !important;"><b>Reason:</b> <?= $value->reason; ?></p>
|
||||
<?php if (!empty($value->reason)) { ?>
|
||||
<br>
|
||||
<p style="text-align: left !important;"><b>Reason:</b> <?= $value->reason; ?></p>
|
||||
<?php } ?>
|
||||
<?php foreach ($invoiceTerms as $row) :
|
||||
<?php foreach ($invoiceTerms as $row) :
|
||||
if (!empty($row->terms)) { ?>
|
||||
<br><pre style="font-family: 'Times New Roman', Times, sans-serif; font-size: 12px; text-align: left;">
|
||||
<br>
|
||||
<pre style="font-family: 'Times New Roman', Times, sans-serif; font-size: 12px; text-align: left;">
|
||||
<?= $row->terms ?>
|
||||
</pre>
|
||||
<?php }
|
||||
<?php }
|
||||
endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<!-- ... (your existing HTML template) -->
|
||||
|
||||
<!-- Add this to the end of your HTML template -->
|
||||
<!-- Add this to the end of your HTML template -->
|
||||
|
||||
|
||||
<!-- <img src="https://cdn.pixabay.com/photo/2012/04/26/14/17/blue-42596_960_720.png" /> -->
|
||||
<!-- <img src="https://cdn.pixabay.com/photo/2012/04/26/14/17/blue-42596_960_720.png" /> -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
@ -70,7 +70,7 @@
|
||||
</div>
|
||||
|
||||
<!-- item-->
|
||||
<a href="<?= base_url()."user_page/".$loggedin_person_id; ?>" class="dropdown-item notify-item">
|
||||
<a href="<?= base_url()."user_page/".$loggedin_person_id."/1"; ?>" class="dropdown-item notify-item">
|
||||
<i class="ri-account-circle-line"></i>
|
||||
<span>My Account</span>
|
||||
</a>
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<input type="text" class="form-control" id="mobile_no" name="mobile_no" placeholder="Mobile Number (Enter only numbers)" data-toggle="input-mask" data-mask-format="0000000000" value="<?= isset($details['mobile_no']) ? $details['mobile_no'] : '' ?>" autofocus required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="role" class="col-form-label">Role<span class="text-danger">*</span></label>
|
||||
<label for="role" class="col-form-label" id="role_label">Role<span class="text-danger">*</span></label>
|
||||
<select id="role" name="role" class="form-control" required>
|
||||
<option value="">Select Role</option>
|
||||
<option value="admin" <?= isset($details['role']) && $details['role'] === 'admin' ? 'selected' : '' ?>>Admin</option>
|
||||
@ -126,6 +126,7 @@
|
||||
<?php } ?>
|
||||
</div>
|
||||
<input type="hidden" id="user_id" name="user_id" placeholder="hidden for user id" value="<?= isset($details['user_id']) ? $details['user_id'] : '' ?>" />
|
||||
<input type="hidden" id="dummy_flag" name="dummy_flag" placeholder="hidden for dummy flag redirect purpose" value="<?= isset($dummy_flag) ? $dummy_flag : '' ?>" />
|
||||
|
||||
<?php if (!empty($details) && $loggedin_person_role !== 'manager') { ?>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
@ -250,6 +251,11 @@
|
||||
<!-- Modify the existing JavaScript code -->
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var flag_for_validations = "<?= isset($dummy_flag) ? $dummy_flag : '' ?>";
|
||||
if (flag_for_validations == '1') {
|
||||
$('#role_label').html('Role');
|
||||
$('#role').removeAttr("required").prop('disabled', true);
|
||||
}
|
||||
// Function to show/hide the event name container based on the selected role
|
||||
function toggleEventNameContainer() {
|
||||
var selectedRole = $('#role').val();
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="float-right">
|
||||
<a href="<?= base_url()."user_page/0"; ?>" class="btn btn-primary"><i class="ri-user-add-line"></i> Add User </a>
|
||||
<a href="<?= base_url()."user_page/0/0"; ?>" class="btn btn-primary"><i class="ri-user-add-line"></i> Add User </a>
|
||||
</div><!-- end col-->
|
||||
<br>
|
||||
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
||||
@ -52,7 +52,7 @@
|
||||
$class = 'badge badge-soft-danger';
|
||||
$message = 'In-Active';
|
||||
}
|
||||
$edit_page_route = base_url()."user_page/".$row['user_id'];
|
||||
$edit_page_route = base_url()."user_page/".$row['user_id']."/0";
|
||||
$addressParts = array(
|
||||
$row['address'],
|
||||
$row['city'],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user