From aaa91e1493c6642ca8ec332a9410a6d6bb6244b6 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Sat, 1 Nov 2025 18:09:33 +0530 Subject: [PATCH] FIX_Invoice Bug Fixes --- app/Controllers/Products.php | 26 +-- app/Views/invoice_form.php | 259 ++++++++++++++++++---------- app/Views/invoice_list.php | 12 +- app/Views/invoice_pdf_layout.php | 75 +++++--- app/Views/layout/header.php | 4 +- app/Views/product_categories.php | 27 +-- app/Views/product_category_list.php | 18 +- app/Views/product_list.php | 11 +- app/Views/sales_list.php | 11 +- app/Views/sales_order_form.php | 2 +- 10 files changed, 274 insertions(+), 171 deletions(-) diff --git a/app/Controllers/Products.php b/app/Controllers/Products.php index cbf4a09..dcb3d15 100755 --- a/app/Controllers/Products.php +++ b/app/Controllers/Products.php @@ -657,7 +657,7 @@ class Products extends BaseController public function quick_add() { - $tax = floatval($this->request->getPost('tax')) / 2; + $tax = floatval($this->request->getPost('product_tax')) / 2; $bid = $this->session->get('logged_user_branch_id'); $ml = 0; @@ -666,29 +666,29 @@ class Products extends BaseController $barrel = 0; $ltr_per_barrel = 0; - $per = $this->request->getPost('per'); + $per = $this->request->getPost('product_per'); if ($per === 'ml') { - $ml = floatval($this->request->getPost('ml') ?? 0); + $ml = floatval($this->request->getPost('product_ml') ?? 0); } elseif ($per === 'box') { - $box = floatval($this->request->getPost('box') ?? 0); - $qty_per_box = floatval($this->request->getPost('qty_per_box') ?? 0); + $box = floatval($this->request->getPost('product_box') ?? 0); + $qty_per_box = floatval($this->request->getPost('product_qty_per_box') ?? 0); } elseif ($per === 'barrel') { - $barrel = floatval($this->request->getPost('barrel') ?? 0); - $ltr_per_barrel = floatval($this->request->getPost('ltr_per_barrel') ?? 0); + $barrel = floatval($this->request->getPost('product_barrel') ?? 0); + $ltr_per_barrel = floatval($this->request->getPost('product_ltr_per_barrel') ?? 0); } - $qty_in_stock = floatval($this->request->getPost('qty_stock') ?: 0); // Get qty_stock from POST + $qty_in_stock = floatval($this->request->getPost('product_qty_stock') ?: 0); // Get qty_stock from POST $purchase_order_level = floor($qty_in_stock / 2); // Calculate purchase reorder level (half of qty in stock) $purchase_order_level = is_nan($purchase_order_level) ? '' : $purchase_order_level; // Safely assign values (handle invalid numbers) $reorder_level = is_nan($qty_in_stock) ? '' : $qty_in_stock; $data = [ 'cubic_centimeter_id' => json_encode($this->request->getPost('cubic_centimeter_id')), - 'product_name' => $this->request->getPost('productname'), - 'product_category' => $this->request->getPost('productcategory'), - 'total_amount' => $this->request->getPost('total_amount'), - 'unit_price' => $this->request->getPost('unit_price'), + 'product_name' => $this->request->getPost('product_name'), + 'product_category' => $this->request->getPost('product_category'), + 'total_amount' => $this->request->getPost('product_total_amount'), + 'unit_price' => $this->request->getPost('product_unit_price'), 'qty_stock' => $qty_in_stock, 'sgst' => $tax, 'cgst' => $tax, @@ -702,7 +702,7 @@ class Products extends BaseController 'branch_id' => $bid, 'purchase_order_level'=> $purchase_order_level, 'reorder_level' => $reorder_level, - 'manufacturer_id' => $this->request->getPost('manufacturer'), + 'manufacturer_id' => $this->request->getPost('product_manufacturer'), ]; $insertID = $this->ProductModel->insert($data); diff --git a/app/Views/invoice_form.php b/app/Views/invoice_form.php index 1183945..44669d6 100755 --- a/app/Views/invoice_form.php +++ b/app/Views/invoice_form.php @@ -11,6 +11,39 @@ padding: 5px !important; } + + +
@@ -207,7 +240,7 @@ + value="" > + min="1" + value="" onchange="updateThirdColumnValue(this); updateTaxAmount(this)" onkeydown="return false;" > --> + value="" > -
+ +
+ @@ -283,9 +317,11 @@ @@ -540,21 +576,21 @@
- - + +
Pricing Information :
- - + +
- - @@ -562,28 +598,28 @@
- - + +
Stock Information :
-
-
- - -
+
+
+ + +
-