From c9669da6c113eae4ab07d9b356b5f5a73d422b6e Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Thu, 2 May 2024 12:01:31 +0530 Subject: [PATCH] CHANGE_INVOICE_ALIGNMENT_ADD_DESCRIPTION : AADHAVAN --- app/Config/Routes.php | 9 + app/Controllers/Customer.php | 184 +++++--- app/Controllers/Invoice.php | 46 +- app/Models/CustomerModel.php | 39 ++ app/Models/InvoiceModel.php | 4 +- app/Views/invoice_form.php | 304 +++++++++++-- app/Views/invoice_pdf_template.php | 56 ++- app/Views/invoice_print_preview_template.php | 427 ++++++++++++++++++ app/Views/offline_invoice_list.php | 42 +- composer.lock | 12 +- vendor/composer/ClassLoader.php | 108 +++-- vendor/composer/InstalledVersions.php | 17 +- vendor/composer/autoload_classmap.php | 28 +- vendor/composer/autoload_real.php | 6 +- vendor/composer/autoload_static.php | 28 +- vendor/composer/installed.json | 14 +- vendor/composer/installed.php | 10 +- .../.github/ISSUE_TEMPLATE/01_bug_report.yml | 2 +- vendor/mpdf/mpdf/.github/SECURITY.md | 3 +- .../mpdf/mpdf/.github/workflows/coverage.yml | 2 +- vendor/mpdf/mpdf/.github/workflows/cs.yml | 2 +- vendor/mpdf/mpdf/.github/workflows/tests.yml | 5 +- vendor/mpdf/mpdf/CHANGELOG.md | 3 +- vendor/mpdf/mpdf/README.md | 1 + vendor/mpdf/mpdf/composer.json | 2 +- vendor/mpdf/mpdf/src/AssetFetcher.php | 2 +- vendor/mpdf/mpdf/src/Color/ColorConverter.php | 5 +- vendor/mpdf/mpdf/src/Http/CurlHttpClient.php | 2 +- vendor/mpdf/mpdf/src/Mpdf.php | 4 +- vendor/mpdf/mpdf/src/Otl.php | 4 + vendor/mpdf/mpdf/src/Tag/Option.php | 3 +- 31 files changed, 1124 insertions(+), 250 deletions(-) create mode 100644 app/Views/invoice_print_preview_template.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 8b62d107..5f3d234a 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -134,6 +134,7 @@ $routes->get("delete_invoice/(:any)", "Invoice::delete_invoice/$1"); $routes->add('approve_invoice/(:num)', 'Invoice::approve_invoice/$1'); $routes->get('generate_invoice_pdf/(:num)', 'Invoice::generate_invoice_pdf/$1'); $routes->get('generate_invoice_pdf_preview/(:any)', 'Invoice::generate_invoice_pdf_preview/$1'); +$routes->get('generate_invoice_print_preview/(:any)', 'Invoice::generate_invoice_print_preview/$1'); $routes->get('print_address/(:num)', 'Invoice::print_address/$1'); @@ -173,6 +174,14 @@ $routes->get('subscription_inactive', 'Invoice::subscription_inactive'); # Api integration Routes $routes->post('api/(:any)', 'ApiIntegration::api_integration/$1'); + +# Get Country List + +$routes->get('get_country', 'Customer::get_country_list'); +$routes->post('save_address_from_model', 'Customer::save_address_from_model'); + + + // $routes->group("api", function ($routes) { // // $routes->post("create_products/", "ApiIntegration::save_book_details"); // // $routes->match(['put', 'post', 'get', 'delete'], 'products', 'ApiIntegration::book_api_integration'); diff --git a/app/Controllers/Customer.php b/app/Controllers/Customer.php index 3150760f..585212bf 100644 --- a/app/Controllers/Customer.php +++ b/app/Controllers/Customer.php @@ -276,6 +276,13 @@ class Customer extends BaseController $country_details = $model->orderBy('country_id', 'ASC')->findAll(); return $country_details; } + public function get_country_list() + { + $model = new CustomerModel(); + $model->setTable('countries'); + $country_details = $model->orderBy('country_id', 'ASC')->findAll(); + return json_encode($country_details); + } public function get_state_details() { @@ -548,81 +555,126 @@ class Customer extends BaseController ## For Ajax Call To Save Invoice Customer... public function save_invoice_customer() -{ - helper('session'); - $session_bid = get_business_id(); - $session_uid = get_logged_user_id(); - $model = new CustomerModel(); + { + helper('session'); + $session_bid = get_business_id(); + $session_uid = get_logged_user_id(); + $model = new CustomerModel(); - $data = [ - 'first_name' => $this->request->getPost('cus_first_name'), - 'last_name' => $this->request->getPost('cus_last_name') ? $this->request->getPost('cus_last_name') : '', - 'mobile_no' => $this->request->getPost('cus_mobile_no'), - 'email' => $this->request->getPost('cus_email'), - 'date_of_birth' => NULL, - 'type' => "customer", - 'mode' => "Offline", - 'business_id' => $session_bid, - 'isactive' => 1, - 'created_by' => $session_uid - ]; - - if ($model->insert($data)) { - $customerId = $model->insertID(); - - $this->logger->info("Invoice Customer : has been added successfully. Inserted ID = " . $customerId); - - // Store both billing and shipping addresses - $billingAddress = [ - 'customer_id' => $customerId, - 'first_name' => $this->request->getPost('cus_first_name'), - 'last_name' => $this->request->getPost('cus_last_name') ? $this->request->getPost('cus_last_name') : '', - 'address_type' => 1, // Billing address type - 'billing_address1' => $this->request->getPost('baddress1'), - 'billing_address2' => $this->request->getPost('baddress2'), - 'billing_city' => $this->request->getPost('bcity'), - 'billing_state' => $this->request->getPost('bstate'), - 'billing_country' => $this->request->getPost('bcountry'), - 'billing_pincode' => $this->request->getPost('bzip') - ]; - - $shippingAddress = [ - 'customer_id' => $customerId, + $data = [ 'first_name' => $this->request->getPost('cus_first_name'), 'last_name' => $this->request->getPost('cus_last_name') ? $this->request->getPost('cus_last_name') : '', - 'address_type' => 2, // Shipping address type - 'shipping_address1' => $this->request->getPost('saddress1'), - 'shipping_address2' => $this->request->getPost('saddress2'), - 'shipping_city' => $this->request->getPost('scity'), - 'shipping_state' => $this->request->getPost('sstate'), - 'shipping_country' => $this->request->getPost('scountry'), - 'shipping_pincode' => $this->request->getPost('szip') + 'mobile_no' => $this->request->getPost('cus_mobile_no'), + 'email' => $this->request->getPost('cus_email'), + 'date_of_birth' => NULL, + 'type' => "customer", + 'mode' => "Offline", + 'business_id' => $session_bid, + 'isactive' => 1, + 'created_by' => $session_uid ]; - // Call the method to store both addresses - $result = $model->storeCustomerAddresses($billingAddress, $shippingAddress); - if($customerId){ - $cus_first_name = $this->request->getPost('cus_first_name'); - $cus_last_name = $this->request->getPost('cus_last_name'); - $name = $cus_first_name; - if ($cus_last_name !== null) { - $name .= ' ' . $cus_last_name; + if ($model->insert($data)) { + $customerId = $model->insertID(); + + $this->logger->info("Invoice Customer : has been added successfully. Inserted ID = " . $customerId); + + // Store both billing and shipping addresses + $billingAddress = [ + 'customer_id' => $customerId, + 'first_name' => $this->request->getPost('cus_first_name'), + 'last_name' => $this->request->getPost('cus_last_name') ? $this->request->getPost('cus_last_name') : '', + 'address_type' => 1, // Billing address type + 'billing_address1' => $this->request->getPost('baddress1'), + 'billing_address2' => $this->request->getPost('baddress2'), + 'billing_city' => $this->request->getPost('bcity'), + 'billing_state' => $this->request->getPost('bstate'), + 'billing_country' => $this->request->getPost('bcountry'), + 'billing_pincode' => $this->request->getPost('bzip') + ]; + + $shippingAddress = [ + 'customer_id' => $customerId, + 'first_name' => $this->request->getPost('cus_first_name'), + 'last_name' => $this->request->getPost('cus_last_name') ? $this->request->getPost('cus_last_name') : '', + 'address_type' => 2, // Shipping address type + 'shipping_address1' => $this->request->getPost('saddress1'), + 'shipping_address2' => $this->request->getPost('saddress2'), + 'shipping_city' => $this->request->getPost('scity'), + 'shipping_state' => $this->request->getPost('sstate'), + 'shipping_country' => $this->request->getPost('scountry'), + 'shipping_pincode' => $this->request->getPost('szip') + ]; + + // Call the method to store both addresses + $result = $model->storeCustomerAddresses($billingAddress, $shippingAddress); + if($customerId){ + $cus_first_name = $this->request->getPost('cus_first_name'); + $cus_last_name = $this->request->getPost('cus_last_name'); + $name = $cus_first_name; + if ($cus_last_name !== null) { + $name .= ' ' . $cus_last_name; + } } + + if ($customerId) { + // Success response + $results = ['status' => true, 'message' => 'Customer and addresses saved successfully', 'cus_id' => $customerId,'cus_name'=>$name,"billing_addr_id"=>$result['billing_addr_id'],"shipping_addr_id"=>$result['shipping_addr_id']]; + } else { + // Error response + $results = ['status' => false, 'message' => 'Failed to save customer and addresses']; + } + } else { + $this->logger->error("Invoice Customer: Error could not be added. Please try again."); + $results = ['status' => false, 'message' => 'Customer could not be added']; } - if ($customerId) { - // Success response - $results = ['status' => true, 'message' => 'Customer and addresses saved successfully', 'cus_id' => $customerId,'cus_name'=>$name,"billing_addr_id"=>$result['billing_addr_id'],"shipping_addr_id"=>$result['shipping_addr_id']]; - } else { - // Error response - $results = ['status' => false, 'message' => 'Failed to save customer and addresses']; - } - } else { - $this->logger->error("Invoice Customer: Error could not be added. Please try again."); - $results = ['status' => false, 'message' => 'Customer could not be added']; + return $this->response->setJSON(['data' => $results]); } - return $this->response->setJSON(['data' => $results]); -} + + public function save_address_from_model(){ + // print_r($this->request->getPost());die; + + + $requestDataBilling = $this->request->getPost('billing'); + $requestDataShipping = $this->request->getPost('shipping'); + + $customer_id_for_addresses = $this->request->getPost('customer_id'); + + // $bill_addr = $this->save_customer_addresses_model($customer_id_for_addresses, $requestDataBilling, 'b'); + // $ship_addr = $this->save_customer_addresses_model($customer_id_for_addresses, $requestDataBilling, 's'); + + $billingData = [ + 'first_name' => $this->request->getPost('first_name'), + 'last_name' => $this->request->getPost('last_name'), + 'address_1'=> $requestDataBilling['address'], + 'address_2'=> '', + 'country' => $requestDataBilling['country'], + 'state' => $requestDataBilling['state'], + 'city' => $requestDataBilling['state'], + 'postal_code' => $requestDataBilling['postalCode'], + ]; + + $shippingData = [ + 'first_name' => $this->request->getPost('first_name'), + 'last_name' => $this->request->getPost('last_name'), + 'address_1'=> $requestDataShipping['address'], + 'address_2'=> '', + 'country' => $requestDataShipping['country'], + 'state' => $requestDataShipping['state'], + 'city' => $requestDataShipping['state'], + 'postal_code' => $requestDataShipping['postalCode'], + ]; + + $model = new CustomerModel(); + + $insertedId = $model->updateAddress($customer_id_for_addresses, $billingData, 'b'); + $insertedId = $model->updateAddress($customer_id_for_addresses, $shippingData, 's'); + + } + + + } diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index 5b300572..67a60e9e 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -5,6 +5,7 @@ namespace App\Controllers; use App\Models\EventModel; use App\Models\CustomerModel; use App\Models\InvoiceModel; +use App\Models\BusinessModel; use App\Models\BooksModel; use App\Helpers\NotificationHelper; @@ -252,7 +253,7 @@ class Invoice extends BaseController 'event_id' => (int)$this->request->getPost('event_id'), 'business_id' => (int)get_business_id(), 'status' => $invoice_status, - 'isactive' => 1 + 'isactive' => 1, ]; ## Based on the invoice ID, we designated Insert or Update on Details... @@ -426,6 +427,7 @@ class Invoice extends BaseController if (!empty($requestData['item_details'][$x])) { $invoiceitem_arr[$x]['invoice_id'] = $id; $invoiceitem_arr[$x]['product'] = (int)$requestData['item_details'][$x]; + $invoiceitem_arr[$x]['description'] = $requestData['description'][$x]; $invoiceitem_arr[$x]['quantity'] = (int)$requestData['quantity'][$x]; $invoiceitem_arr[$x]['tax'] = (float)$requestData['tax'][$x]; $invoiceitem_arr[$x]['unit_price'] = (float)$requestData['rate'][$x]; @@ -689,6 +691,7 @@ class Invoice extends BaseController $invoice_type = $data[0]->invoice_type; // Create an mPDF object + $mpdf = new Mpdf([ 'mode' => '', 'format' => [148, 210], // Set custom width and height in millimeters @@ -732,11 +735,16 @@ class Invoice extends BaseController $mpdf->showWatermarkText = true; } + $BusinessModel = new BusinessModel(); + $business = $BusinessModel->where('business_id',$data[0]->business_id)->first(); + // Generate the PDF content (HTML) with data - $html = view('invoice_pdf_template', ['data' => $data, 'invoiceItems' => $invoiceItems, 'invoice_type' => $invoice_type, 'invoiceTerms' => $data]); + $html = view('invoice_pdf_template', ['data' => $data, 'invoiceItems' => $invoiceItems,'business' => $business, 'invoice_type' => $invoice_type, 'invoiceTerms' => $data]); // echo $html;die; // Load HTML into the mPDF instance + // print_r($html);die; + $mpdf->WriteHTML($html); // Output the PDF to the browser for download @@ -748,7 +756,38 @@ class Invoice extends BaseController { // Load required model $model = new InvoiceModel(); + $BusinessModel = new BusinessModel(); $data = $model->getInvoiceData($id); + + $business = $BusinessModel->where('business_id',$data[0]->business_id)->first(); + $invoiceItems = $model->getInvoiceItems($id, 'groupby'); + + foreach ($invoiceItems as $index => $singleItem) { + $productImgs = $model->getProductImgs($singleItem->product); + $invoiceItems[$index]->imgs = $productImgs; + } + + + $invoice_type = $data[0]->invoice_type; + + // Get status data + $status = $data[0]->status; + + // Load view with data + $html = view('invoice_pdf_template', ['data' => $data, 'invoiceItems' => $invoiceItems, 'invoice_type' => $invoice_type,'business' => $business, 'invoiceTerms' => $data, 'status' => $status]); + + // Return HTML content + echo $html; + } + + public function generate_invoice_print_preview($id) + { + // Load required model + $model = new InvoiceModel(); + $data = $model->getInvoiceData($id); + $BusinessModel = new BusinessModel(); + + $business = $BusinessModel->where('business_id',$data[0]->business_id)->first(); // print_r($data);die; $invoiceItems = $model->getInvoiceItems($id, 'groupby'); @@ -763,13 +802,12 @@ class Invoice extends BaseController $status = $data[0]->status; // Load view with data - $html = view('invoice_pdf_template', ['data' => $data, 'invoiceItems' => $invoiceItems, 'invoice_type' => $invoice_type, 'invoiceTerms' => $data, 'status' => $status]); + $html = view('invoice_print_preview_template', ['data' => $data, 'invoiceItems' => $invoiceItems,'business'=>$business, 'invoice_type' => $invoice_type, 'invoiceTerms' => $data, 'status' => $status]); // Return HTML content echo $html; } - public function print_address($id) { // Fetch the invoice data based on $id diff --git a/app/Models/CustomerModel.php b/app/Models/CustomerModel.php index a96343ed..ad491b43 100644 --- a/app/Models/CustomerModel.php +++ b/app/Models/CustomerModel.php @@ -59,6 +59,45 @@ class CustomerModel extends Model return $this->db->insertID(); // Return the last inserted ID } + public function updateAddress($id, $addressData, $addressType) { + + + if ($addressType == 'b') { + $addressTypeValue = 1; + } else { + $addressTypeValue = 2; + } + $isActive = 1; + + // Check if an active address of the specified type already exists for the customer + $existingAddress = $this->db->table('customer_addresses') + ->where('customer_id', $id) + ->where('isactive', $isActive) + ->where('address_type', $addressTypeValue) + ->get() + ->getRow(); + + // If an active address of the specified type exists, update it + if ($existingAddress) { + $this->db->table('customer_addresses') + ->where('customer_id', $id) + ->where('address_type', $addressTypeValue) + ->update($addressData); + return $id; // Return the customer ID + } else { + // If no active address of the specified type exists, insert a new one + $addressData['customer_id'] = $id; + $addressData['address_type'] = $addressTypeValue; + $addressData['isactive'] = $isActive; + $this->db->table('customer_addresses')->insert($addressData); + return $this->db->insertID(); // Return the last inserted ID + } + } + + + + + public function insertAddressBatch($addressesDataArray) { $this->db->table('customer_addresses')->insertBatch($addressesDataArray); return $this->db->insertID(); // Note: insertID() might not be applicable for batch inserts diff --git a/app/Models/InvoiceModel.php b/app/Models/InvoiceModel.php index de400331..2389f44a 100644 --- a/app/Models/InvoiceModel.php +++ b/app/Models/InvoiceModel.php @@ -18,6 +18,7 @@ public function saveInvoiceItemDetails($data){ if($id != ''){ unset($row['invoice_child_id']); // Remove the id from the data to avoid updating it unset($row['created_by']); // bcoz here data are Updating here. + $this->db->table('invoiceitems')->where('invoice_child_id', $id)->update($row);// Update the row with the specified id $affectedRows = $this->db->affectedRows(); $statement[$i] = "Invoice Item - ".$id." ".$affectedRows ? " Updated":" Not Updated"; @@ -254,7 +255,7 @@ public function getJoinedData($where, $orderby = []) { if ($stringflag == 'groupby') { - $select = 'invoiceitems.*, B.*, GROUP_CONCAT(C.name SEPARATOR \',\') as name'; + $select = ' B.*, GROUP_CONCAT(C.name SEPARATOR \',\') as name,invoiceitems.*'; $group_by = 'invoiceitems.invoice_child_id'; } else { $select = 'invoiceitems.*, B.*, C.name as category_name'; @@ -270,7 +271,6 @@ public function getJoinedData($where, $orderby = []) ->groupBy($group_by) // Fixed the variable name here ->get() ->getResult(); - //->orderBy("book_img_id", "asc") // Order by book_img_id in ascending order //->limit(1,0) diff --git a/app/Views/invoice_form.php b/app/Views/invoice_form.php index c19a4539..fddefd83 100644 --- a/app/Views/invoice_form.php +++ b/app/Views/invoice_form.php @@ -6,6 +6,7 @@ .blueText { color: blue !important; } +
@@ -20,14 +21,21 @@
customer_id === $invoice_details['customer_id']) { $displayvalue = $customer->first_name . ' ' . $customer->last_name; + $last_name = $customer->last_name; + $first_name = $customer->first_name; } } ?> - + + + + bookSelect" name="item_details[]" onchange="displayBookTag(this,)" required data-toggle="select2" style="width: 249px !important;"> + - " name="quantity[]" oninput="calculateInvoice(this,)" value="" min="1" /> + + " name="quantity[]" oninput="calculateInvoice(this,)" value="" min="1" /> - " name="rate[]" oninput="calculateInvoice(this,)" value="" readonly /> + " name="rate[]" oninput="calculateInvoice(this,)" value="" readonly /> - " name="tax[]" value="" readonly /> + " name="tax[]" value="" readonly /> - " name="amount[]" value="" readonly /> + " name="amount[]" value="" readonly /> - " name="discount_amount[]" oninput="calculateInvoice(this,)" value="" min="0" step="0.01" /> + " name="discount_amount[]" oninput="calculateInvoice(this,)" value="" min="0" step="0.01" /> - + " name="invoice_child_id[]" value="" placeholder="hidden for invoice child/item id" value="" /> - +
@@ -192,10 +202,11 @@ endforeach; ?> + - + @@ -306,8 +317,10 @@
- - + +
@@ -599,6 +612,99 @@ + + \ No newline at end of file diff --git a/app/Views/invoice_pdf_template.php b/app/Views/invoice_pdf_template.php index 45f3fbcb..95f5f662 100644 --- a/app/Views/invoice_pdf_template.php +++ b/app/Views/invoice_pdf_template.php @@ -8,14 +8,21 @@ size: 148mm 210mm; /* Width Height */ } /* Add your CSS styles here to format the invoice for mPDF */ + td{ + /* display: flex; + */ + /* align-items: flex-start; */ + } body { font-family: 'Times New Roman', Times, sans-serif; + color : black !important; font-size: 8pt; /* Change this value to your desired font size */ } + /* Style for the main table with border */ table.main-table { width: 100%; @@ -96,12 +103,13 @@ border: none; /* Remove borders from all cells in the invoice items table */ padding: 8px; - text-align: center; + /* text-align: center; */ /* Center-align text in cells */ } table.invoice-related-table th { - background-color: #f2f2f2; + /* background-color: #f2f2f2; */ + background-color: #D0D0CD; font-weight: bold; } @@ -128,7 +136,7 @@ .subtotal-table td { border: none; /* Remove borders from cells inside the subtotal table */ - padding: 8px; + padding: 3px; text-align: right; } @@ -154,6 +162,12 @@ margin-top: 0; margin-bottom: 0rem; } + + .test-works p { + margin-left: 6px; + } + + @@ -170,13 +184,13 @@ - -

company_address ?>,
+ +

company_address ?>,
company_city ?>, company_state ?> company_postal_code ? " - " . $value->company_postal_code : "" ?>.

company_email ?>

-

company_mobile_no ?>

+

company_mobile_no ?>

@@ -214,7 +228,7 @@ - +
@@ -252,10 +266,10 @@
Billing Address Shipping Address


- + - + @@ -266,17 +280,19 @@ - - - - + + + - + @@ -327,8 +343,8 @@ -
-

Thank you!

+
+ @@ -345,6 +361,14 @@
+ +
+
+
+ + + +
diff --git a/app/Views/invoice_print_preview_template.php b/app/Views/invoice_print_preview_template.php new file mode 100644 index 00000000..976df88e --- /dev/null +++ b/app/Views/invoice_print_preview_template.php @@ -0,0 +1,427 @@ + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + +
+

company_address ?>,
+ company_city ?>, + company_state ?> + company_postal_code ? " - " . $value->company_postal_code : "" ?>.

+

company_email ?>

+

company_mobile_no ?>

+
+
+ + + + + + + + + + due_date) : ?> + + + + + + + + + + + + + + + + +
wp_api_order_id) ? 'Order # ' . $value->invoice_number : 'Invoice # ' . $value->invoice_number; ?>
Invoice Date : formatted_invoice_date ?>
Due Date : formatted_due_date ?>
From Subscription : from_subscription)) ?>
To Subscription : to_subscription)) ?>
+
+ + + + + + + + + + +
Billing AddressShipping Address
+ + customer_name ?>
+ customer_bill_address && ($value->baddr_id !== null || $value->baddr_id !== '')){ ?> + customer_bill_address ? $value->customer_bill_address." ," : ""?>
+ customer_bill_city ? $value->customer_bill_city : "" ?> customer_bill_state ? $value->customer_bill_state : "" ?> + customer_bill_postal_code ? " - " . $value->customer_bill_postal_code : ""; ?> + customer_bill_country ? $value->customer_bill_country . "." : $value->bcountry ?>
+ baddr_id === null || $value->baddr_id === '') { + echo $value->billing_address ? '

'.$value->billing_address.'

' : ''; + } ?> + mobile_no ? $value->mobile_no." ." : "" ?> + +
+ + customer_name ?>
+ customer_ship_address && ($value->saddr_id !== null || $value->saddr_id !== '')){ ?> + customer_ship_address ? $value->customer_ship_address." ," : "" ?>
+ customer_ship_city ? $value->customer_ship_city : "" ?> customer_ship_state ? $value->customer_bill_state : "" ?> + customer_ship_postal_code ? " - " . $value->customer_ship_postal_code : ""; ?> + customer_ship_country ? $value->customer_ship_country . "." : $value->scountry ?>
+ saddr_id === null || $value->saddr_id === '') { + echo $value->shipping_address ? '

'.$value->shipping_address.'

' : ''; + } ?> + mobile_no ? $value->mobile_no." ." : "" ?> + +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + shipping_label != '') : ?> + + + + + + + total_amount >= $value->exact_total_amount) ? '+' : '-'; + $difference = abs($value->exact_total_amount - $value->total_amount); + ?> + + + + + + + status === 'Draft') : ?> + + + + + + status === 'Approved') : ?> + + + + + +
Subtotal :   ₹subtotal, 2, '.', ',') ?>
Discount :   discount ? "(-)" . number_format($value->discount, 2, '.', ',') : number_format(0, 2, '.', ',') ?>
shipping_label ?> :   ₹shipping_charge, 2, '.', ',') ?>
Rounding :   
Total :   ₹total_amount, 2, '.', ',') ?>
Balance :   ₹total_amount, 2, '.', ',') ?>
Paid :   ₹total_amount, 2, '.', ',') ?>
+ +
+ +
+ + +
+ + reason)) { ?> +
+

Reason: reason; ?>

+ + terms)) { ?> +
+
+                        terms ?>
+                    
+ +
+ +
+
+

Bank Details

+ + + +
+ + + + + + + + +
+ status === 'Draft') { + echo '
Draft
'; + + } + if ($data[0]->status === 'Cancelled') { + echo '
Cancelled
'; + + } + if ($data[0]->status === 'Void') { + echo '
Void
'; + + }?> +
+ + + \ No newline at end of file diff --git a/app/Views/offline_invoice_list.php b/app/Views/offline_invoice_list.php index 67350218..fa959ac4 100644 --- a/app/Views/offline_invoice_list.php +++ b/app/Views/offline_invoice_list.php @@ -32,6 +32,9 @@ .modal-lg, .modal-xl { max-width: 678px; } +.modal-body { + font-size: 1.3em !important; +}