Tracker issue
This commit is contained in:
parent
6a57d1a640
commit
cc68fff67f
@ -119,7 +119,7 @@
|
|||||||
<th>Amount </th>
|
<th>Amount </th>
|
||||||
<th style="text-align: center !important" colspan="2">Discount</th>
|
<th style="text-align: center !important" colspan="2">Discount</th>
|
||||||
<th hidden></th>
|
<th hidden></th>
|
||||||
<?php if ($invoice_type === '1') : ?> <th>Actions</th> <?php endif; ?>
|
<?php if ($invoice_type === '1') : ?> <th></th> <?php endif; ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -129,8 +129,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><select class="form-control book-select" id="<?= "book" . $inx; ?>bookSelect" name="item_details[]" onchange="displayBookTag(this,<?= $inx; ?>)" required data-toggle="select2" style="width: 249px !important;">
|
<td><select class="form-control book-select" id="<?= "book" . $inx; ?>bookSelect" name="item_details[]" onchange="displayBookTag(this,<?= $inx; ?>)" required data-toggle="select2" style="width: 249px !important;">
|
||||||
<option value="">Select a <?= $flag_name; ?></option>
|
<option value="">Select a <?= $flag_name; ?></option>
|
||||||
|
<?php if($invoice_type === '1'){?>
|
||||||
|
|
||||||
<option value="add_new_book">+ Add New Book</option>
|
<option value="add_new_book">+ Add New Book</option>
|
||||||
<?php foreach ($books as $book) : ?>
|
|
||||||
|
<?php }foreach ($books as $book) : ?>
|
||||||
<?php $disabled = ((int)$book->isactive == 0) ? 'disabled' : ''; ?>
|
<?php $disabled = ((int)$book->isactive == 0) ? 'disabled' : ''; ?>
|
||||||
<option value="<?= $book->book_id ?>" <?php if (isset($ii_details['product']) && ($ii_details['product'] === $book->book_id)) echo "selected"; ?> <?= $disabled; ?>>
|
<option value="<?= $book->book_id ?>" <?php if (isset($ii_details['product']) && ($ii_details['product'] === $book->book_id)) echo "selected"; ?> <?= $disabled; ?>>
|
||||||
<?php if((int)$book->isactive == 0){ echo $book->title." (Disabled) ";}else{ echo $book->title; } ?></option>
|
<?php if((int)$book->isactive == 0){ echo $book->title." (Disabled) ";}else{ echo $book->title; } ?></option>
|
||||||
@ -169,8 +172,9 @@
|
|||||||
<td style="width:30% !important;">
|
<td style="width:30% !important;">
|
||||||
<select class="form-control book-select" id="book0" name="item_details[]" onchange="displayBookTag(this,0)" required data-toggle="select2" style="width: 249px !important;">
|
<select class="form-control book-select" id="book0" name="item_details[]" onchange="displayBookTag(this,0)" required data-toggle="select2" style="width: 249px !important;">
|
||||||
<option value="">Select a <?= $flag_name ?></option>
|
<option value="">Select a <?= $flag_name ?></option>
|
||||||
|
<?php if($invoice_type === '1'){?>
|
||||||
<option value="add_new_book">+ Add New Book</option>
|
<option value="add_new_book">+ Add New Book</option>
|
||||||
<?php
|
<?php }
|
||||||
foreach ($books as $book) :
|
foreach ($books as $book) :
|
||||||
if ((int)$book->isactive === 1) : ?>
|
if ((int)$book->isactive === 1) : ?>
|
||||||
<option value="<?= $book->book_id ?>"><?= $book->title; ?></option>
|
<option value="<?= $book->book_id ?>"><?= $book->title; ?></option>
|
||||||
@ -194,7 +198,7 @@
|
|||||||
<td hidden><input type="hidden" class="form-control" id="hiddenInvoiceChildId0" name="invoice_child_id[]" value="" placeholder="hidden for invoice child/item id" /></td>
|
<td hidden><input type="hidden" class="form-control" id="hiddenInvoiceChildId0" name="invoice_child_id[]" value="" placeholder="hidden for invoice child/item id" /></td>
|
||||||
<?php if ($invoice_type === '1') : ?>
|
<?php if ($invoice_type === '1') : ?>
|
||||||
<td>
|
<td>
|
||||||
<center><i class="fa fa-trash remove-item "></i></center>
|
<!-- <center><i class="fa fa-trash remove-item "></i></center> -->
|
||||||
</td>
|
</td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
@ -313,13 +317,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal fade" id="customerModal" tabindex="-1" role="dialog" aria-labelledby="paymentModalLabel" aria-hidden="true">
|
<div class="modal fade" id="customerModal" tabindex="-1" role="dialog" aria-labelledby="paymentModalLabel" aria-hidden="true" data-backdrop="static">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="customerModalLabel">Add New Customer</h5>
|
<h5 class="modal-title" id="customerModalLabel">Add New Customer</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<!-- <span aria-hidden="true">×</span> -->
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -359,7 +363,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"id="closeCustomerModal">Close</button>
|
||||||
<button type="button" class="btn btn-primary save-invoice-customer" onclick="saveInvoiceCustomer()">Save Customer</button>
|
<button type="button" class="btn btn-primary save-invoice-customer" onclick="saveInvoiceCustomer()">Save Customer</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -399,8 +403,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<textarea class="form-control" id="voidReason" rows="3" placeholder="Enter reason for voiding..."></textarea>
|
<textarea class="form-control" id="voidReason" rows="3" placeholder="Enter reason for voiding..." required></textarea>
|
||||||
<!-- <input type="hidden" id="invoiceId" name="invoiceId"> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
@ -410,6 +413,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- </div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Reason for Cancel Modal -->
|
<!-- Reason for Cancel Modal -->
|
||||||
<div class="modal fade" id="cancelReasonModal" tabindex="-1" role="dialog" aria-labelledby="voidReasonModalLabel" aria-hidden="true">
|
<div class="modal fade" id="cancelReasonModal" tabindex="-1" role="dialog" aria-labelledby="voidReasonModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
@ -446,13 +453,14 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="bookName">Book Name</label>
|
<label for="bookName">Book Name<span class="text-danger"> *</span></label>
|
||||||
<input type="text" class="form-control" id="bookName" name="bookName" required>
|
<input type="text" class="form-control" id="bookName" name="bookName" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="bookPrice">Price</label>
|
<label for="bookPrice">Price<span class="text-danger"> *</span></label>
|
||||||
<input type="number" class="form-control" id="bookPrice" name="bookPrice" required>
|
<input type="number" class="form-control" id="bookPrice" name="bookPrice" required min="0">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
@ -461,20 +469,20 @@
|
|||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="isbn_code" class="col-form-label">ISBN Code<span class="text-danger"> *</span></label>
|
<label for="isbn_code" class="col-form-label">ISBN Code</label>
|
||||||
<input type="text" class="form-control" id="isbn_code" name="isbn_code" placeholder="ISBN Code" required />
|
<input type="text" class="form-control" id="isbn_code" name="isbn_code" placeholder="ISBN Code" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="publisher" class="col-form-label">Publisher Name<span class="text-danger"> *</span></label>
|
<label for="publisher" class="col-form-label">Publisher Name</label>
|
||||||
<input type="text" class="form-control" id="publisher" name="publisher" placeholder="Publisher Name" value="<?= isset($details['publisher']) ? $details['publisher'] : '' ?>" required />
|
<input type="text" class="form-control" id="publisher" name="publisher" placeholder="Publisher Name" value="<?= isset($details['publisher']) ? $details['publisher'] : '' ?>" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="publishers_code" class="col-form-label">Publisher Code</label>
|
<label for="publishers_code" class="col-form-label">Publisher Code<span class="text-danger"> *</span></label>
|
||||||
<input type="text" class="form-control" id="publishers_code" name="publishers_code" placeholder="Publisher Code" />
|
<input type="text" class="form-control" id="publishers_code" name="publishers_code" placeholder="Publisher Code"required />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -492,7 +500,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var bookData=<?php echo json_encode($books); ?>;
|
var bookData=<?php echo json_encode($books); ?>;
|
||||||
|
localStorage.setItem('add_book_index', 0);
|
||||||
document.getElementById("addItem").addEventListener("click", function() {
|
document.getElementById("addItem").addEventListener("click", function() {
|
||||||
var bookArray = bookData;
|
var bookArray = bookData;
|
||||||
var table = document.getElementById("itemTable").getElementsByTagName("tbody")[0];
|
var table = document.getElementById("itemTable").getElementsByTagName("tbody")[0];
|
||||||
@ -1216,6 +1224,7 @@
|
|||||||
}
|
}
|
||||||
$('.save-invoice-customer').prop('disabled', false);
|
$('.save-invoice-customer').prop('disabled', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function() {
|
error: function() {
|
||||||
alert("Error occur.");
|
alert("Error occur.");
|
||||||
$('#editAddressesCheckbox').prop('checked', false);
|
$('#editAddressesCheckbox').prop('checked', false);
|
||||||
@ -1226,6 +1235,15 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$('#closeCustomerModal').click(function() {
|
||||||
|
// Reset customer dropdown value
|
||||||
|
$('#customerName').val("").trigger('change');
|
||||||
|
// Optionally, reset input fields
|
||||||
|
$('#cus_first_name').val("");
|
||||||
|
$('#cus_last_name').val("");
|
||||||
|
$('#cus_email').val("");
|
||||||
|
$('#cus_mobile_no').val("");
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
// JavaScript code to handle form submission and AJAX request
|
// JavaScript code to handle form submission and AJAX request
|
||||||
@ -1291,18 +1309,25 @@ $(document).ready(function() {
|
|||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
// JavaScript code to handle voiding invoice and submitting reason
|
// JavaScript code to handle voiding invoice and submitting reason
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Handle clicking on the "Void" button
|
// Handle clicking on the "Void" button
|
||||||
$('#voidButton').click(function() {
|
$('#voidButton').click(function() {
|
||||||
var invoiceId = <?= isset($invoice_details['invoice_id']) ? $invoice_details['invoice_id'] : '' ?>; // Get the invoice_id
|
var invoiceId = <?= isset($invoice_details['invoice_id']) ? $invoice_details['invoice_id'] : '' ?>;
|
||||||
$('#voidReasonModal').modal('show');
|
$('#voidReasonModal').modal('show');
|
||||||
$('#voidReasonModal').find('#voidReason').data('invoiceId', invoiceId); // Set the invoice_id in the modal
|
$('#submitVoidReason').data('invoiceId', invoiceId); // Set the invoice_id in the modal
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle submitting void reason
|
// Handle submitting void reason
|
||||||
$('#submitVoidReason').click(function() {
|
$('#submitVoidReason').click(function() {
|
||||||
var voidReason = $('#voidReason').val();
|
var voidReason = $('#voidReason').val().trim(); // Trim the value to remove whitespace
|
||||||
var invoiceId = $('#voidReason').data('invoiceId'); // Get the invoice_id from the modal
|
var invoiceId = $(this).data('invoiceId'); // Get the invoice_id from the button data
|
||||||
|
|
||||||
|
// Check if voidReason is empty
|
||||||
|
if (voidReason === '') {
|
||||||
|
alert('Please enter a reason for voiding.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Perform AJAX request to update status and reason
|
// Perform AJAX request to update status and reason
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -1330,6 +1355,8 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// JavaScript code to handle voiding invoice and submitting reason
|
// JavaScript code to handle voiding invoice and submitting reason
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
@ -1344,6 +1371,10 @@ $(document).ready(function() {
|
|||||||
$('#submitCancelReason').click(function() {
|
$('#submitCancelReason').click(function() {
|
||||||
var cancelReason = $('#cancelReason').val();
|
var cancelReason = $('#cancelReason').val();
|
||||||
var invoiceIds = $('#cancelReason').data('invoiceIds'); // Get the invoice_id(s) from the modal
|
var invoiceIds = $('#cancelReason').data('invoiceIds'); // Get the invoice_id(s) from the modal
|
||||||
|
if (cancelReason === '') {
|
||||||
|
alert('Please enter a reason for Cancelling.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Perform AJAX request to update status and reason
|
// Perform AJAX request to update status and reason
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@ -280,6 +280,9 @@ p {
|
|||||||
<?php if(!empty($value->notes)){ ?>
|
<?php if(!empty($value->notes)){ ?>
|
||||||
<br><p style="text-align: left !important;"><b>Notes:</b> <?= $value->notes; ?></p>
|
<br><p style="text-align: left !important;"><b>Notes:</b> <?= $value->notes; ?></p>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
<?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)) { ?>
|
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;">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user