From 6be1d1b703576d6ec8379bd4ddd5a18106fa469b Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 10 Oct 2024 10:56:29 +0530 Subject: [PATCH] FIX_SALSE_ORDER_FORM_TABLR APPEND ISSUE : RV --- app/Controllers/Sales.php | 12 ++++++------ app/Views/product_form.php | 14 +++++++++++++- app/Views/sales_order_form.php | 32 +++++++++++++++++++++----------- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index 0121de5..cbadf4f 100755 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -208,17 +208,17 @@ class Sales extends BaseController $itemtax=$this->request->getPost('item-tax'); $unitprice=$this->request->getPost('unit-price'); $sales_product_id = $this->request->getPost('sales_order_product_id'); - + $product_names_id = $this->request->getPost('product_names_id'); $status = $this->request->getPost('status'); - foreach ($product_ids as $key => $product_string) { + foreach ($product_ids as $key => $product_id) { - $product_id = null; - $product_names_id = null; + // $product_id = null; + // $product_names_id = null; - list($product_id, $product_names_id) = explode('-', $product_string); + // list($product_id, $product_names_id) = explode('-', $product_string); $qty = isset($quantities[$key]) ? $quantities[$key] : 0; if ($status == 'Created') { @@ -237,7 +237,7 @@ class Sales extends BaseController $product_data = [ 'sales_order_id' => $sales_order_id, 'product_id' => $product_id, - 'product_names_id' => $product_names_id, + 'product_names_id' => $product_names_id[$key], 'qty' => $qty, 'discount' => $discount, 'discount_type' => $discount_type, diff --git a/app/Views/product_form.php b/app/Views/product_form.php index 6c56274..596c75e 100755 --- a/app/Views/product_form.php +++ b/app/Views/product_form.php @@ -909,7 +909,7 @@ function addHTMLInput(data = null)
- x + x +
`; @@ -927,4 +927,16 @@ function removeHTMLInput(element) } } +function deleteProductName(data) { + console.log(data); + + if (data != null) { + // Correctly form the URL by wrapping the ternary operator inside parentheses + var url = "" + (data ? data : ''); + console.log(url); + window.location.href = url; + } +} + + \ No newline at end of file diff --git a/app/Views/sales_order_form.php b/app/Views/sales_order_form.php index ee3caae..825fb30 100755 --- a/app/Views/sales_order_form.php +++ b/app/Views/sales_order_form.php @@ -183,8 +183,9 @@ if ($salechild['isactive'] == 1) : ?> + '; + ` + + ' + @@ -1122,4 +1120,16 @@ $(document).on('click', '#selectClient', function() { } }); + + + + \ No newline at end of file