7th nov Bug fixes : ps
This commit is contained in:
parent
9348f0ee3f
commit
42cf774ff9
@ -125,10 +125,12 @@ public function updateData($table, $data, $where)
|
||||
->join('customers as C','C.customer_id= invoice.customer_id','left')
|
||||
->join('business as B','B.business_id = invoice.business_id','left')
|
||||
->join('customer_addresses as A','A.customer_id=invoice.customer_id and A.address_type=1','left')
|
||||
->join('states', 'states.state_short_name = A.state AND A.country = "IN"', 'left')
|
||||
->join('countries', 'countries.country_short_name = A.country', 'left')
|
||||
->select('invoice.*,concat(C.first_name," ",C.last_name) as customer_name,A.address_1, A.address_2,A.postal_code,A.city, A.state,C.mobile_no,B.title,B.business_logo,B.terms,B.address,B.city,B.state,B.postal_code,B.email,B.mobile_no')
|
||||
|
||||
->select('states.state_name != "",states.state_name,A.state) as customer_bill_state,concat(A.address_1," ", A.address_2) as customer_bill_address,A.postal_code as customer_bill_postal_code ,A.city as customer_bill_city, countries.country_name as customer_bill_country')
|
||||
->get()
|
||||
->getResult();
|
||||
->getResult();
|
||||
|
||||
}
|
||||
// this function Also Used For Approve Notification.
|
||||
@ -139,7 +141,8 @@ public function updateData($table, $data, $where)
|
||||
->join('books as B', 'B.book_id = invoiceitems.product', 'left')
|
||||
->join('book_categories as BC', 'BC.book_id = invoiceitems.product', 'left')
|
||||
->join('category as C', 'C.id = BC.category_id', 'left')
|
||||
->select('invoiceitems.*,B.*,C.name as category_name')
|
||||
->select('invoiceitems.*,B.*,GROUP_CONCAT(C.name SEPARATOR \',\') as name')
|
||||
->groupBy('invoiceitems.invoice_child_id')
|
||||
//->orderBy("book_img_id", "asc") // Order by book_img_id in ascending order
|
||||
//->limit(1,0)
|
||||
->get()
|
||||
@ -195,13 +198,16 @@ public function updateData($table, $data, $where)
|
||||
}
|
||||
public function getNonMembershipCategoryBooks()
|
||||
{
|
||||
return $this->db->table('books')
|
||||
$data = $this->db->table('books')
|
||||
->select('books.*')
|
||||
->join('book_categories', 'book_categories.book_id= books.book_id', 'left')
|
||||
->join('category','category.id=book_categories.category_id')
|
||||
->where('category.name !=', 'membership')
|
||||
->groupBy('books.book_id')
|
||||
->get()
|
||||
->getResult();
|
||||
return $data;
|
||||
|
||||
}
|
||||
public function insertSubscriptionData($data)
|
||||
{
|
||||
|
||||
@ -60,13 +60,13 @@
|
||||
<?= $value->postal_code ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="address">
|
||||
<p>To:</p>
|
||||
<p><?= $value->customer_name ?></p>
|
||||
<p><?= $value->address_1 ?><?= $value->address_2 ?></p>
|
||||
<p><?= $value->city ?> <?= $value->state ?></p>
|
||||
<p><?= $value->postal_code ?></p>
|
||||
<p><?= $value->customer_bill_address ?></p>
|
||||
<p><?= $value->customer_bill_city ?> <?= $value->customer_bill_state ?></p>
|
||||
<p><?= $value->customer_bill_postal_code ?></p>
|
||||
<p><?= $value->customer_bill_country ?></p>
|
||||
</div>
|
||||
<div class="barcode">
|
||||
<img src="barcode.png" alt="Barcode">
|
||||
|
||||
@ -315,6 +315,8 @@
|
||||
|
||||
<script>
|
||||
$("#addressCopiedAsShipping").on("change", function() {
|
||||
var count = $(".after-shipping-addr-add-more").length;
|
||||
|
||||
if ($(this).is(":checked")) {
|
||||
var customerAddress1 = $("#baddress1").val();
|
||||
var customerAddress2 = $("#baddress2").val();
|
||||
@ -326,13 +328,13 @@
|
||||
|
||||
$("#saddress1").val(customerAddress1).prop("readonly", false);
|
||||
$("#saddress2").val(customerAddress2).prop("readonly", false);
|
||||
$("#scountry0").val(customerCountry).prop("readonly", false);
|
||||
$("#scountry"+count).val(customerCountry).prop("readonly", false);
|
||||
if (customerCountry == 'IN') {
|
||||
$("#sistate0").val(customerInputState).css("display", "none").prop("readonly", false);
|
||||
$("#sdstate0").val(customerDropdownState).css("display", "block").prop("readonly", false);
|
||||
$("#sistate"+count).val(customerInputState).css("display", "none").prop("readonly", false);
|
||||
$("#sdstate"+count).val(customerDropdownState).css("display", "block").prop("readonly", false);
|
||||
} else {
|
||||
$("#sistate0").val(customerInputState).css("display", "block").prop("readonly", false);
|
||||
$("#sdstate0").val(customerDropdownState).css("display", "none").prop("readonly", false);
|
||||
$("#sistate"+count).val(customerInputState).css("display", "block").prop("readonly", false);
|
||||
$("#sdstate"+count).val(customerDropdownState).css("display", "none").prop("readonly", false);
|
||||
}
|
||||
$("#scity").val(customerCity).prop("readonly", false);
|
||||
$("#szip").val(customerPostalCode).prop("readonly", false);
|
||||
@ -340,10 +342,10 @@
|
||||
// Clear the billing address fields when the checkbox is unchecked
|
||||
$("#saddress1").val("").prop("readonly", false);
|
||||
$("#saddress2").val("").prop("readonly", false);
|
||||
$("#scountry0").val("").prop("readonly", false);
|
||||
$("#scity").val("").prop("readonly", false);
|
||||
$("#sistate0").val("").prop("readonly", false);
|
||||
$("#sdstate0").val("").prop("readonly", false);
|
||||
$("#scountry"+count).val("").prop("readonly", false);
|
||||
$("#sistate"+count).val("").css("display", "block").prop("readonly", false);
|
||||
$("#sdstate"+count).val("").css("display", "none").prop("readonly", false);
|
||||
$("#szip").val("").prop("readonly", false);
|
||||
$("#scustomer_address_id").val("") // Hidden Field ressetted bcoz Adress history
|
||||
}
|
||||
@ -450,6 +452,8 @@
|
||||
alert("At least one Shipping Address must be displayed.");
|
||||
}
|
||||
toggleButtons();
|
||||
// if($('#addressCopiedAsShipping').is(':checked')){}
|
||||
// else{ $('#addressCopiedAsShipping').prop("checked", false); }
|
||||
});
|
||||
|
||||
function toggleButtons() {
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
<!-- <style>
|
||||
/* Target the Select2 container and set the width */
|
||||
.select2-container .select2-dropdown {
|
||||
<style>
|
||||
td .select2-container{
|
||||
width: 249px !important;
|
||||
}
|
||||
</style> -->
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
@ -78,13 +77,13 @@
|
||||
<input type="date" class="form-control" id="invoiceDate" name="invoice_date" value="<?= isset($invoice_details['invoice_date']) ? $invoice_details['invoice_date'] : '' ?>" required>
|
||||
</div>
|
||||
<?php if ($invoice_type === '1') : ?>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="fromsubcription">From Subcription</label>
|
||||
<input type="date" class="form-control" id="fromsubcription" name="from_subscription" value="<?= isset($invoice_item_details[0]['from_subscription']) ? $invoice_item_details[0]['from_subscription'] : '' ?>">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="fromsubcription">From Subcription<span class="text-danger"> *</span></label>
|
||||
<input type="date" class="form-control" id="fromsubcription" name="from_subscription" value="<?= isset($invoice_item_details[0]['from_subscription']) ? $invoice_item_details[0]['from_subscription'] : '' ?>" required onchange="updateToDateMinDate(this.value)">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tosubcription">To Subcription</label>
|
||||
<input type="date" class="form-control" id="to_subcription" name="to_subscription" value="<?= isset($invoice_item_details[0]['to_subscription']) ? $invoice_item_details[0]['to_subscription'] : '' ?>">
|
||||
<label for="tosubcription">To Subcription<span class="text-danger"> *</span></label>
|
||||
<input type="date" class="form-control" id="tosubcription" name="to_subscription" value="<?= isset($invoice_item_details[0]['to_subscription']) ? $invoice_item_details[0]['to_subscription'] : '' ?>" required>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@ -122,7 +121,7 @@
|
||||
</td>
|
||||
<td style="width:8%;"><input type="text" class="form-control item-tax" id="<?= "tax" . $inx; ?>" name="tax[]" value="<?= isset($ii_details['tax']) ? $ii_details['tax'] : '' ?>" readonly />
|
||||
</td>
|
||||
<td style="width:12%;"><input type="text" class="form-control item-amount" id="<?= "amount" . $inx; ?>" name="amount[]" value="<?= isset($ii_details['subtotal']) ? $ii_details['subtotal'] : '' ?>" />
|
||||
<td style="width:12%;"><input type="text" class="form-control item-amount" id="<?= "amount" . $inx; ?>" name="amount[]" value="<?= isset($ii_details['subtotal']) ? $ii_details['subtotal'] : '' ?>" readonly />
|
||||
</td>
|
||||
<td style="width:12%;"><input type="text" class="form-control item-discount-amount" id="<?= "item_discount_amount" . $inx; ?>" name="discount_amount[]" oninput="calculateInvoice(this,<?= $inx; ?>)" value="<?= isset($ii_details['discount_amount']) ? $ii_details['discount_amount'] : '' ?>" />
|
||||
|
||||
@ -146,10 +145,11 @@
|
||||
<tr>
|
||||
<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;">
|
||||
<option value="">Select a book</option>
|
||||
<?php foreach ($books as $book) : ?>
|
||||
<option value="<?= $book->book_id ?>"><?= $book->title ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
foreach ($books as $book) :
|
||||
if ((int)$book->isactive === 1) : ?>
|
||||
<option value="<?= $book->book_id ?>"><?= $book->title; ?></option>
|
||||
<?php endif; endforeach; ?>
|
||||
</select></td>
|
||||
<td style="width:10%;"><input type="number" class="form-control item-quantity" id="quantity0" name="quantity[]" oninput="calculateInvoice(this,0)" />
|
||||
</td>
|
||||
@ -316,9 +316,9 @@
|
||||
|
||||
cell1.innerHTML = `<select class="form-control book-select" id="book${counter}" name="item_details[]" onchange="displayBookTag(this, ${counter})" data-toggle="select2">
|
||||
<option value="">Select a book</option>
|
||||
<?php foreach ($books as $book) : ?>
|
||||
<?php foreach ($books as $book) : if ((int)$book->isactive === 1) : ?>
|
||||
<option value="<?= $book->book_id ?>"><?= $book->title ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; endforeach; ?>
|
||||
</select>`;
|
||||
|
||||
// cell1.innerHTML = '<input type="text" class="form-control" name="item_details[]">';
|
||||
@ -375,7 +375,7 @@
|
||||
} else {
|
||||
row.querySelector('#amount' + counter).value = ''; // Clear the amount if either quantity or rate is not a number
|
||||
}
|
||||
|
||||
row.querySelector('#amount' + counter).readOnly = true;
|
||||
calculateOverallTotals();
|
||||
}
|
||||
|
||||
@ -506,7 +506,6 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
var iid_arr = <?php echo json_encode($invoice_item_details); ?>;
|
||||
var cust_id = "<?= isset($invoice_details['customer_id']) ? $invoice_details['customer_id'] : ""; ?>";
|
||||
var ship_addr_id = "<?= isset($invoice_details['shipping_address_id']) ? $invoice_details['shipping_address_id'] : ""; ?>";
|
||||
@ -514,7 +513,10 @@
|
||||
load_details1(ship_addr_id, cust_id);
|
||||
load_details2(ship_addr_id, cust_id);
|
||||
}
|
||||
|
||||
var fromDateValue = "<?= isset($invoice_item_details[0]['from_subscription']) ? $invoice_item_details[0]['from_subscription'] : ""; ?>";
|
||||
if (fromDateValue != '') {
|
||||
updateToDateMinDate(fromDateValue)
|
||||
}
|
||||
var bill_addr = "";
|
||||
|
||||
$("#customerName").change(function() {
|
||||
@ -670,11 +672,10 @@
|
||||
return serial_number;
|
||||
}
|
||||
|
||||
bill_addr = "<?= isset($invoice_details['billing_address']) ? $invoice_details['billing_address'] : ""; ?>";
|
||||
if (bill_addr != '') { $("#storeBillingAddress").val(bill_addr);}
|
||||
|
||||
});
|
||||
</script>
|
||||
<!-- bill_addr = "<?= isset($invoice_details['billing_address']) ? $invoice_details['billing_address'] : ""; ?>"; -->
|
||||
<!-- if (bill_addr != '') { $("#storeBillingAddress").val(bill_addr);} -->
|
||||
<script>
|
||||
document.getElementById('saveapproved').addEventListener('click', function() {
|
||||
// Set the status field to 'Draft' before submitting
|
||||
@ -695,6 +696,14 @@
|
||||
// Set the min and max date attributes
|
||||
invoiceDateInput.setAttribute("min", minDate);
|
||||
invoiceDateInput.setAttribute("max", maxDate);
|
||||
|
||||
const fromsubcriptionDateInput = document.getElementById("fromsubcription");
|
||||
fromsubcriptionDateInput.setAttribute("max", maxDate);
|
||||
|
||||
function updateToDateMinDate(fromDateValue) {
|
||||
const toDateInput = document.getElementById('tosubcription');
|
||||
toDateInput.min = fromDateValue;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user