diff --git a/app/Controllers/Products.php b/app/Controllers/Products.php index d3b345b..ca72f15 100755 --- a/app/Controllers/Products.php +++ b/app/Controllers/Products.php @@ -43,6 +43,14 @@ class Products extends BaseController $ProductCategoryModel = new ProductCategoryModel(); $productcategory = $ProductCategoryModel->orderBy('product_category_id')->findAll(); + // print_r($productcategory); + foreach ($productcategory as &$category) { + $sub_query_result = $this->ProductModel + ->select('count(product_category) as total_product') + ->where('product_category', $category['product_category_name']) + ->first(); + $category['total_product'] = $sub_query_result['total_product'] ?? 0; + } $data['productcategory'] = $productcategory; return view('product_categories',$data); } diff --git a/app/Controllers/Purchase.php b/app/Controllers/Purchase.php index c3ad635..a78f307 100755 --- a/app/Controllers/Purchase.php +++ b/app/Controllers/Purchase.php @@ -206,6 +206,12 @@ class Purchase extends BaseController $data['purchase_product'] = $purchase_product; + $productAll = $this->ProductModel->select('products.*, manufacturer.manufacturer_name') + ->join('manufacturer', 'manufacturer.manufacturer_id = products.manufacturer_id') + ->where('products.isactive',1) + ->findAll(); + $data['productAll']= json_encode($productAll); + $data['purchase_order_id']= $purchase_order_id; diff --git a/app/Models/PurchaseOrderModel.php b/app/Models/PurchaseOrderModel.php index 61d920f..a617990 100755 --- a/app/Models/PurchaseOrderModel.php +++ b/app/Models/PurchaseOrderModel.php @@ -10,11 +10,11 @@ class PurchaseOrderModel extends Model public function getPurchaseOrdersWithProducts($logged_user_branch_id) { // Select required fields from both tables - $this->select('purchase_order.*, COUNT(purchase_order_child.purchase_order_id) AS product_count,vendor.vendor_name,SUM(purchase_order_child.qty) AS purchase_qty, purchase_order_child.received_qty'); + $this->select('purchase_order.*, COUNT(purchase_order_child.purchase_order_id) AS product_count,vendor.vendor_name,SUM(purchase_order_child.qty) AS purchase_qty, SUM(purchase_order_child.received_qty) AS received_qty'); // Join the sales_order_product table based on sales_order_id $this->join('purchase_order_child', 'purchase_order_child.purchase_order_id = purchase_order.purchase_order_id'); - $this ->join('vendor', 'vendor.vendor_id = purchase_order.vendor_id'); + $this->join('vendor', 'vendor.vendor_id = purchase_order.vendor_id'); // Group by sales_order_id to get count of products per sales order $this->groupBy('purchase_order.purchase_order_id'); diff --git a/app/Models/SalesOrderModel.php b/app/Models/SalesOrderModel.php index dd5b3ac..7646a7d 100755 --- a/app/Models/SalesOrderModel.php +++ b/app/Models/SalesOrderModel.php @@ -36,7 +36,7 @@ class SalesOrderModel extends Model // Add condition to fetch only active sales orders $this ->where('sales_order.branch_id',$logged_user_branch_id); - $this->orderBy('sales_order.order_number','desc'); + $this->orderBy('sales_order.sales_order_id','desc'); // Get the results return $this->findAll(); } diff --git a/app/Views/jobs_list.php b/app/Views/jobs_list.php index d91f31e..4fa52d8 100755 --- a/app/Views/jobs_list.php +++ b/app/Views/jobs_list.php @@ -44,15 +44,12 @@
| Job Card | Order Number | Vehicle No | Client | @@ -67,6 +64,7 @@||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| = $value['job_card_id']; ?> | = $value['order_number']; ?> | = $value['reg_no']; ?> | = $value['client_name']; ?> = $value['client_mobile_no']; ?> |
@@ -182,6 +180,13 @@
"language": {
"search": "Search: " // Customize search label
},
+ "columnDefs": [
+ {
+ "targets": [0], // Target the first column (JC Id)
+ "visible": false, // Hide the column
+ "searchable": false // Make it non-searchable (optional)
+ }
+ ]
});
diff --git a/app/Views/product_categories.php b/app/Views/product_categories.php
index 1c1ed18..fa4cb9a 100644
--- a/app/Views/product_categories.php
+++ b/app/Views/product_categories.php
@@ -25,6 +25,7 @@
||||||||||||||||||||||||||||||
| Product Category | +Total Product | Status | Products | ||||||||||||||||||||||||||||||
| + |
Active
diff --git a/app/Views/purchase_form.php b/app/Views/purchase_form.php
index 736c4fb..42afa57 100755
--- a/app/Views/purchase_form.php
+++ b/app/Views/purchase_form.php
@@ -149,11 +149,14 @@
| Item Details |
- Qty |
-
+
+ Original Qty |
+ Rcvd Qty |
Received |
Amount |
-
+
+ Qty |
+
|
|
+
+ |
+
-
+ 0) ? 'max="' . $purchasechild['qty'] . '"' : '' ?> >
|
diff --git a/app/Views/purchase_list.php b/app/Views/purchase_list.php
index c1400a3..b374e7b 100755
--- a/app/Views/purchase_list.php
+++ b/app/Views/purchase_list.php
@@ -49,31 +49,34 @@
| PO Id |
Order Number |
Vendor Name |
Order Date |
Contact Details |
- Items |
- Qty |
- Received Items |
+ Items Details |
Status |
Actions |
| |||||||||
| = $value['purchase_order_id']; ?> | = $value['order_number']; ?> | = $value['vendor_name']; ?> | = date('j F Y', strtotime($value['order_date'])); ?> | = $value['contact_person_name']; ?> - = $value['contact_person_mobile']; ?> - | = $value['product_count']; ?> | -= $value['purchase_qty'] ?> | -= $value['selected_product_count']; ?> | + = $value['contact_person_mobile']; ?> + += "Product : ".$value['product_count']." "; ?> + = "Tot Qty : ".$value['purchase_qty']." "; ?> + = (isset($value['received_qty']) && $value['received_qty'] != '')? "Rcvd Qty : ".$value['received_qty']." " : "Rcvd Qty : 0 "; ?> + |
-
-
-
-
-
|