From 42cf774ff99baa04ecf6c157f57b4c8ceb75900e Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 8 Nov 2023 18:54:10 +0530 Subject: [PATCH] 7th nov Bug fixes : ps --- app/Models/InvoiceModel.php | 14 +++++--- app/Views/address_pdf_template.php | 8 ++--- app/Views/customer_form.php | 20 ++++++----- app/Views/invoice_form.php | 53 +++++++++++++++++------------- 4 files changed, 57 insertions(+), 38 deletions(-) diff --git a/app/Models/InvoiceModel.php b/app/Models/InvoiceModel.php index d75a0459..0b728683 100644 --- a/app/Models/InvoiceModel.php +++ b/app/Models/InvoiceModel.php @@ -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) { diff --git a/app/Views/address_pdf_template.php b/app/Views/address_pdf_template.php index 632d118e..e45f2dfc 100644 --- a/app/Views/address_pdf_template.php +++ b/app/Views/address_pdf_template.php @@ -60,13 +60,13 @@ postal_code ?> -

To:

customer_name ?>

-

address_1 ?>address_2 ?>

-

city ?> state ?>

-

postal_code ?>

+

customer_bill_address ?>

+

customer_bill_city ?> customer_bill_state ?>

+

customer_bill_postal_code ?>

+

customer_bill_country ?>

Barcode diff --git a/app/Views/customer_form.php b/app/Views/customer_form.php index 39037dbe..c00f1f34 100644 --- a/app/Views/customer_form.php +++ b/app/Views/customer_form.php @@ -315,6 +315,8 @@ + +