- customer_id === $invoice_details['customer_id']) {
$displayvalue = $customer->first_name . ' ' . $customer->last_name;
@@ -38,9 +39,7 @@
-
+
Please select customer.
@@ -1224,6 +1226,8 @@
state ? customer_billing_addressDetails.push(state) : "";
v.country_name ? customer_billing_addressDetails.push(v.country_name) : "";
customer_billing_id = v.customer_address_id;
+ $('#hidden_first_name').val(v.first_name);
+ $('#hidden_last_name').val(v.last_name);
});
}else{
@@ -1292,6 +1296,8 @@
state ? customer_shipping_addressDetails.push(state) : "";
v.country_name ? customer_shipping_addressDetails.push(v.country_name) : "";
customer_shipping_id = v.customer_address_id;
+ $('#hidden_first_name').val(v.first_name);
+ $('#hidden_last_name').val(v.last_name);
});
}
$("#storeShippingAddress").val(customer_shipping_addressDetails.join(', \n') + ".").prop("readonly", true);
@@ -1954,10 +1960,10 @@ function saveInvoiceCustomer() {
function submitAddress() {
$('#storeBillingAddress').val("").prop('readonly',false);
$('#storeShippingAddress').val("").prop('readonly',false);
- var cus_id = $('#customer_name').val();
+ var cus_id = $('#customer_name').val() ? $('#customer_name').val() : $('#customerName').val();
console.log("Qucik add Addresses - customer id = ",cus_id);
- var last_name = $("#last_name").val();
- var first_name = $("#first_name").val();
+ var last_name = $("#hidden_last_name").val();
+ var first_name = $("#hidden_first_name").val();
var QB_AddressLine = $("#quick_billing_address").val();
var QB_Country = $("#quick_billing_country").val();
var QB_State = $("#quick_billing_state").val();
@@ -2034,7 +2040,7 @@ function saveInvoiceCustomer() {
QS_city: QS_City,
QS_zip: QS_PostalCode
};
-
+ console.log("Before -",formData);
$.ajax({
type: "POST",
url: "",