From 1797974fc0c5568df84efe0e04e262caa6e87cd3 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Thu, 19 Dec 2024 10:28:36 +0530 Subject: [PATCH] FIX_SHIPPING ADDRESS NAME IN INVOICE PDF AND CUSTOMER ADD PAGE --- app/Controllers/Customer.php | 7 ++++--- app/Controllers/Invoice.php | 2 +- app/Views/invoice_form.php | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Controllers/Customer.php b/app/Controllers/Customer.php index 49a76d19..bc5c40bc 100755 --- a/app/Controllers/Customer.php +++ b/app/Controllers/Customer.php @@ -191,13 +191,14 @@ class Customer extends BaseController $address_array = []; if ($count > 0) { for ($x = 0; $x < $count; $x++) { - $address_array[$x]['first_name'] = $requestData['cfname']; + $saddress1_name = $requestData['saddress1_name'][$x]; + $address_array[$x]['first_name'] = $addressType == 1? $requestData['cfname']: $saddress1_name; $address_array[$x]['last_name'] = $requestData['csname']; // $address_array[$x]['company'] = ""; $address_array[$x]['email'] = $requestData['cmail']; $address_array[$x]['mobile_no'] = $requestData['cmobile']; - $saddress1_name = $requestData['saddress1_name'][$x]; - $address_array[$x]['address_1'] = $addressType == 1? $baddress1[$x]: $saddress1_name .','. $baddress1[$x]; + + $address_array[$x]['address_1'] = $baddress1[$x]; $address_array[$x]['address_2'] = $baddress2[$x]; $address_array[$x]['city'] = $bcity[$x]; $address_array[$x]['state'] = $bcountry[$x] === 'IN' ? $bdropdownstate[$x] : $binputstate[$x] ; diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index 37b7e89a..898f3fbb 100755 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -153,7 +153,7 @@ class Invoice extends BaseController $where = ['customer_addresses.isactive' => 1, 'customer_addresses.customer_id' => (int)$id]; $where['address_type'] = 1; $data['customer_billing'] = $this->get_customer_address($where, []); - $select = ["customer_address_id", "CONCAT(address_1,' ',address_2) as address"]; + $select = ["customer_address_id", "CONCAT(address_1,' ',address_2) as address","first_name"]; $where['address_type'] = 2; $data['customer_shipping'] = $this->get_customer_address($where, $select); return $this->response->setJSON(['data' => $data]); diff --git a/app/Views/invoice_form.php b/app/Views/invoice_form.php index c294fcf3..253c6d2e 100755 --- a/app/Views/invoice_form.php +++ b/app/Views/invoice_form.php @@ -1368,7 +1368,7 @@ if (isset($invoice_item_details[0]['to_subscription']) && !empty($invoice_item_d $.each(cust_ship_arr, function(k, v) { $('#loadShippingDropdown').append($('