FIX_ALIGNMENT IN REPORTS

This commit is contained in:
Srinivas-Saravanan 2024-12-19 10:46:22 +05:30
parent 1797974fc0
commit 0b134896d0
7 changed files with 45 additions and 27 deletions

View File

@ -656,9 +656,9 @@ class Customer extends BaseController
$shippingData = [ $shippingData = [
'customer_id' => $this->request->getPost('customer_id'), 'customer_id' => $this->request->getPost('customer_id'),
'first_name' => $this->request->getPost('first_name'), 'first_name' => isset($shipping_address_name)?$shipping_address_name:$this->request->getPost('first_name'),
'last_name' => $this->request->getPost('last_name'), 'last_name' => '',
'shipping_address1'=> $shipping_address_name . ','.$this->request->getPost('QS_address'), 'shipping_address1'=> $this->request->getPost('QS_address'),
'shipping_address2'=> '', 'shipping_address2'=> '',
'shipping_country' => $this->request->getPost('QS_country'), 'shipping_country' => $this->request->getPost('QS_country'),
'shipping_state' => $this->request->getPost('QS_state'), 'shipping_state' => $this->request->getPost('QS_state'),

View File

@ -2514,7 +2514,7 @@ $('#saveButton').click(function() {
$('#storeShippingAddress').empty(); $('#storeShippingAddress').empty();
var new_QS_ShippingAddrOption = $('<option>', { var new_QS_ShippingAddrOption = $('<option>', {
value: QS_AddressId, value: QS_AddressId,
text: QS_AddressLine, text: shipping_address_name+','+ QS_AddressLine,
selected: true selected: true
}); });
$('#storeShippingAddress').val(quick_shipping_Address).prop("readonly", true); $('#storeShippingAddress').val(quick_shipping_Address).prop("readonly", true);

View File

@ -46,12 +46,12 @@
<?php foreach ($report_data as $row): ?> <?php foreach ($report_data as $row): ?>
<?php foreach ($row->books as $book): ?> <?php foreach ($row->books as $book): ?>
<tr> <tr>
<td style="text-align: left;"><?= isset($row->publisher_code) ? $row->publisher_code : '-' ?></td> <td style="text-align: center;"><?= isset($row->publisher_code) ? $row->publisher_code : '-' ?></td>
<td style="text-align: center;"><?= $row->publisher_item_count ?></td> <td style="text-align: center;"><?= $row->publisher_item_count ?></td>
<td style="text-align: right;"><?= number_format($row->publisher_total_cost, 2) ?></td> <td style="text-align: right;"><?= number_format($row->publisher_total_cost, 2) ?></td>
<td style="text-align: left;"><?= $book->book_name ?></td> <td style="text-align: left;"><?= $book->book_name ?></td>
<td style="text-align: left;"><?= $book->item_count ?></td> <td style="text-align: center;"><?= $book->item_count ?></td>
<td style="text-align: right;"><?= number_format($book->total_cost, 2) ?></td> <td style="text-align: left;"><?= number_format($book->total_cost, 2) ?></td>
<td style="text-align: center;"><?= strtoupper($row->payment_method) ?></td> <td style="text-align: center;"><?= strtoupper($row->payment_method) ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -133,9 +133,9 @@
$invoice_date = date("d/m/Y", $unixTime);?> $invoice_date = date("d/m/Y", $unixTime);?>
<td><?= $invoice_date ?></td> <td><?= $invoice_date ?></td>
<td style="text-align: left;"><?= $row['first_name'] ?></td> <td style="text-align: left;"><?= $row['first_name'] ?></td>
<td style="text-align: center;"><?= strtoupper($row['payment_method'])?></td> <td style="text-align: left;"><?= strtoupper($row['payment_method'])?></td>
<td><?= $row['payment_status'] ?></td> <td><?= $row['payment_status'] ?></td>
<td style="text-align: right;"><?= $row['total_amount'] ?></td> <td style="text-align: left;"><?= $row['total_amount'] ?></td>
<?php <?php
$total += $row['total_amount']; // Add each row's total_amount to $total $total += $row['total_amount']; // Add each row's total_amount to $total
?> ?>

View File

@ -59,7 +59,7 @@
<td style="text-align: left;"><?php echo $row->title; ?></td> <td style="text-align: left;"><?php echo $row->title; ?></td>
<td style="text-align: left;"><?php echo $row->author; ?></td> <td style="text-align: left;"><?php echo $row->author; ?></td>
<td style="text-align: left;"><?php echo $row->publishers_code?></td> <td style="text-align: left;"><?php echo $row->publishers_code?></td>
<td style="text-align: end;"><?php echo $row->price ?></td> <td style="text-align: left;"><?php echo $row->price ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>

View File

@ -115,23 +115,41 @@ Sri Kasi, 12, M.V. Naidu Street, Chetpet,Chennai -
] ]
}); });
$('#datatable-buttons thead tr').clone(true).appendTo('#datatable-buttons thead'); $('#datatable-buttons thead tr:eq(1)').remove(); // Remove any existing second row in the header
$('#datatable-buttons thead tr').clone(true).appendTo('#datatable-buttons thead'); // Clone the header row
$('#datatable-buttons thead tr:eq(1) th').each(function(i) { $('#datatable-buttons thead tr:eq(1) th').each(function(i) {
var title = $(this).text(); var title = $(this).text(); // Get the column title
var uniqueValues = table.column(i).data().unique().sort(); var visibleColumns = table.columns(':visible'); // Get only visible columns
var visibleColumnIndex = visibleColumns.indexes()[i]; // Map header index to visible column index
// Skip if the column is not visible or has no title
if (visibleColumnIndex === undefined || !title) {
$(this).empty(); // Clear the header cell
return;
}
var column = table.column(visibleColumnIndex); // Get the visible column object
var uniqueValues = column.data().unique().sort(); // Fetch unique values for the column
// Create a dropdown for filtering
var select = $('<select class="form-control form-control-sm"><option value="">Search ' + title + '</option></select>') var select = $('<select class="form-control form-control-sm"><option value="">Search ' + title + '</option></select>')
.appendTo($(this).empty()) .appendTo($(this).empty()) // Append the dropdown to the header cell
.on('change', function() { .on('change', function() {
var val = $.fn.dataTable.util.escapeRegex($(this).val()); var val = $.fn.dataTable.util.escapeRegex($(this).val());
table.column(i) column
.search(val ? '^' + val + '$' : '', true, false) .search(val ? '^' + val + '$' : '', true, false) // Apply exact match filtering
.draw(); .draw();
}); });
uniqueValues.each(function(d, j) { // Populate the dropdown with unique values
uniqueValues.each(function(d) {
if (d) { // Only add non-empty values
select.append('<option value="' + d + '">' + d + '</option>'); select.append('<option value="' + d + '">' + d + '</option>');
}
}); });
$('input', this).on('keyup change', function() { $('input', this).on('keyup change', function() {
if (table.column(i).search() !== this.value) { if (table.column(i).search() !== this.value) {
table table

View File

@ -53,7 +53,7 @@
<td style="text-align: left;"><?= $row['first_name'].' ('.$row['role'].')'?></td> <td style="text-align: left;"><?= $row['first_name'].' ('.$row['role'].')'?></td>
<td style="text-align: center;"><?= $row['books_sold'] ?></td> <td style="text-align: center;"><?= $row['books_sold'] ?></td>
<td style="text-align: center;"><?= strtoupper($row['payment_method'])?></td> <td style="text-align: center;"><?= strtoupper($row['payment_method'])?></td>
<td style="text-align: right;"><?= $row['total_amount'] ?></td> <td style="text-align: left;"><?= $row['total_amount'] ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>