- - + +
Produit :
-UGS :
+N° SERIE :
N° Facture :
Client :
Adresse :
@@ -353,8 +353,8 @@diff --git a/app/Controllers/OrderController.php b/app/Controllers/OrderController.php index 27910e9d..cb726efe 100644 --- a/app/Controllers/OrderController.php +++ b/app/Controllers/OrderController.php @@ -96,14 +96,23 @@ class OrderController extends AdminController // POUR CAISSIÈRE // ======================================== if ($users['group_name'] == "Caissière") { - $Remise = new Remise(); - + $Remise = new Remise(); + foreach ($data as $key => $value) { - $date_time = date('d-m-Y h:i a', strtotime($value['date_time'])); - + $date_time = date('d-m-Y h:i a', strtotime($value['date_time'])); + $buttons = ''; $discount = (float)$value['discount']; - + $itemCount = (int)$value['item_count']; + + // Génération des boutons d'impression + if ($itemCount > 1) { + $printButtons = ''; + } else { + $printButtons = ''; + $printButtons .= ' '; + } + // ✅ VÉRIFICATION : Si la commande est refusée (paid_status = 0), aucun bouton if ($value['paid_status'] == 0) { $buttons = ' Accès bloqué'; @@ -112,15 +121,15 @@ class OrderController extends AdminController if (in_array('viewOrder', $this->permission)) { // CAS 1 : Commande payée (1) ou livrée (3) → Toujours afficher imprimer if (in_array($value['paid_status'], [1, 3])) { - $buttons .= ''; + $buttons .= $printButtons; } // CAS 2 : Commande en attente (2) SANS remise → Afficher imprimer elseif ($value['paid_status'] == 2 && $discount == 0) { - $buttons .= ''; - } + $buttons .= $printButtons; + } // CAS 3 : Commande en attente (2) AVEC remise validée → Afficher imprimer elseif ($value['paid_status'] == 2 && $Remise->hasRemiseValidatedForOrder($value['id'])) { - $buttons .= ''; + $buttons .= $printButtons; } // CAS 4 : Commande en attente (2) AVEC remise en attente → Indicateur elseif ($value['paid_status'] == 2 && $Remise->hasRemisePendingForOrder($value['id'])) { @@ -221,15 +230,21 @@ class OrderController extends AdminController // ======================================== elseif(in_array($users['group_name'], ["Direction", "DAF", "SuperAdmin", "Administrator"])){ foreach ($data as $key => $value) { - $date_time = date('d-m-Y h:i a', strtotime($value['date_time'])); - + $date_time = date('d-m-Y h:i a', strtotime($value['date_time'])); + $buttons = ''; - + $itemCount = (int)$value['item_count']; + // Bouton imprimer if (in_array('viewOrder', $this->permission) && $users['group_name'] != "SECURITE" && $users['group_name'] != "COMMERCIALE") { - $buttons .= ''; + if ($itemCount > 1) { + $buttons .= ''; + } else { + $buttons .= ''; + $buttons .= ' '; + } } - + // ✅ Bouton modifier pour statuts 0 (Refusé) et 2 (En Attente) if (in_array('updateOrder', $this->permission) && in_array($value['paid_status'], [0, 2])) { $buttons .= ' '; @@ -287,15 +302,21 @@ class OrderController extends AdminController // ======================================== else { foreach ($data as $key => $value) { - $date_time = date('d-m-Y h:i a', strtotime($value['date_time'])); - + $date_time = date('d-m-Y h:i a', strtotime($value['date_time'])); + $buttons = ''; - + $itemCount = (int)$value['item_count']; + // Bouton imprimer if (in_array('viewOrder', $this->permission) && $users['group_name'] != "SECURITE" && $users['group_name'] != "COMMERCIALE") { - $buttons .= ''; + if ($itemCount > 1) { + $buttons .= ''; + } else { + $buttons .= ''; + $buttons .= ' '; + } } - + // ✅ Bouton modifier pour statuts 0 et 2, ET si c'est l'utilisateur créateur if (in_array('updateOrder', $this->permission) && $users["id"] == $value['user_id'] @@ -642,7 +663,7 @@ class OrderController extends AdminController $data1 = [ 'date_demande' => date('Y-m-d H:i:s'), 'montant_demande' => $discount, - 'total_price' => $amounts, + 'total_price' => $gross_amount, 'id_store' => $users['store_id'], 'id_order' => $order_id, 'product' => $product_output, @@ -1112,7 +1133,7 @@ public function update(int $id) $data1 = [ 'date_demande' => date('Y-m-d H:i:s'), 'montant_demande' => $this->request->getPost('discount'), - 'total_price' => $amounts, + 'total_price' => $gross_amount, 'id_store' => $user['store_id'], 'id_order' => $id, 'product' => $product_output, @@ -2080,6 +2101,7 @@ public function print5(int $id) display: flex; flex-direction: column; border-bottom: 2px dashed #aaa; + overflow: hidden; } .facture-box:last-child { @@ -2091,7 +2113,6 @@ public function print5(int $id) font-size: 24px; font-weight: bold; text-decoration: underline; - margin-bottom: 12px; } .f-company { @@ -2120,13 +2141,13 @@ public function print5(int $id) .f-table { width: 100%; border-collapse: collapse; - margin-bottom: 10px; + margin-bottom: 6px; } .f-table th, .f-table td { border-left: 2px solid #000; border-right: 2px solid #000; - padding: 8px 10px; + padding: 3px 8px; text-align: center; font-size: 12px; } @@ -2137,7 +2158,7 @@ public function print5(int $id) border-bottom: 2px solid #000; } - .f-table td { height: 30px; } + .f-table td { height: 20px; } .f-table tbody tr:last-child td { border-bottom: 2px solid #000; @@ -2147,7 +2168,7 @@ public function print5(int $id) .f-words { font-size: 12px; line-height: 1.3; - margin-bottom: 12px; + margin-bottom: 8px; } /* Signatures */ @@ -2268,8 +2289,6 @@ public function print5(int $id) $qrId = 'qr_recto_'.$i; $html .= '
';
- // die(var_dump($produitStock));
foreach ($produitStock as $key => $value) {
- // die(var_dump($value)); // Debugging: Check what $value contains
-
- // Add the row data
$result['data'][$key] = [
$value['sku'],
$value['qty'],
@@ -241,7 +261,6 @@ class ReportController extends AdminController
];
}
- // Return data in JSON format
return $this->response->setJSON($result);
}
@@ -526,7 +545,7 @@ class ReportController extends AdminController
$imageUrl, // 0 - Image
$order['bill_no'] ?? 'N/A', // 1 - N° Facture
$product['name'], // 2 - Désignation
- $product['sku'], // 3 - UGS
+ $product['sku'], // 3 - N° SERIE
$brandName, // 4 - Marque
$order['customer_name'], // 5 - Client
$agentName, // 6 - Agent Sécurité
diff --git a/app/Controllers/SecuriteController.php b/app/Controllers/SecuriteController.php
index a5b3f84f..9b2a7d51 100644
--- a/app/Controllers/SecuriteController.php
+++ b/app/Controllers/SecuriteController.php
@@ -61,7 +61,7 @@ class SecuriteController extends AdminController
$result['data'][] = [
'image' => $img,
- 'ugs' => esc($product['sku']),
+ 'num_serie' => esc($product['sku']),
'designation' => esc($product['name']),
'statut' => $statut,
'action' => $buttons
@@ -88,7 +88,7 @@ class SecuriteController extends AdminController
$response = [
'image' => base_url('assets/images/product_image/' . $product['image']),
'nom' => $product['name'],
- 'ugs' => $product['sku'],
+ 'num_serie' => $product['sku'],
'bill_no' => $data['bill_no'],
'customer_name' => $order_data['customer_name'],
'customer_address' => $order_data['customer_address'],
diff --git a/app/Models/OrderItems.php b/app/Models/OrderItems.php
index 6382c784..9d02f5b0 100644
--- a/app/Models/OrderItems.php
+++ b/app/Models/OrderItems.php
@@ -24,15 +24,32 @@ class OrderItems extends Model
return $this->where('order_id', $order_id)->findAll();
}
- public function getAllSoldProductToday() {
- return $this->select('
- COUNT(orders_item.id) as total_product_sold,
+ public function getAllSoldProductToday($startDate = null, $endDate = null, $storeId = null, $userId = null) {
+ $builder = $this->select('
+ COUNT(orders_item.id) as total_product_sold,
(SELECT SUM(products.qty) FROM products) as total_unsold_product
')
- ->join('orders', 'orders_item.order_id = orders.id')
- ->where('DATE(orders.date_time)', date('Y-m-d'))
- ->get()
- ->getRow();
+ ->join('orders', 'orders_item.order_id = orders.id');
+
+ if (!empty($startDate) || !empty($endDate) || !empty($storeId) || !empty($userId)) {
+ if (!empty($startDate)) {
+ $builder->where('DATE(orders.date_time) >=', $startDate);
+ }
+ if (!empty($endDate)) {
+ $builder->where('DATE(orders.date_time) <=', $endDate);
+ }
+ } else {
+ $builder->where('DATE(orders.date_time)', date('Y-m-d'));
+ }
+
+ if (!empty($storeId)) {
+ $builder->where('orders.store_id', $storeId);
+ }
+ if (!empty($userId)) {
+ $builder->where('orders.user_id', $userId);
+ }
+
+ return $builder->get()->getRow();
}
public function getSumOrdersItemData($order_id = null)
diff --git a/app/Models/Orders.php b/app/Models/Orders.php
index 392db9e9..48d64309 100644
--- a/app/Models/Orders.php
+++ b/app/Models/Orders.php
@@ -124,6 +124,7 @@ class Orders extends Model
->join('orders_item', 'orders_item.order_id = orders.id', 'left')
->join('products', 'products.id = orders_item.product_id', 'left')
->select("IFNULL(GROUP_CONCAT(DISTINCT products.name SEPARATOR '\\n'), '') AS product_names", false)
+ ->select("COUNT(DISTINCT orders_item.id) AS item_count", false)
->groupBy('orders.id');
// Récupération du groupe de l'utilisateur
@@ -387,7 +388,7 @@ class Orders extends Model
->findAll();
}
- public function getPaymentModes($startDate = null, $endDate = null)
+ public function getPaymentModes($startDate = null, $endDate = null, $storeId = null, $userId = null)
{
$session = session();
$users = $session->get('user');
@@ -395,79 +396,85 @@ class Orders extends Model
$baseQuery = $this->db->table('orders')
->select('
-
- SUM(CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+
+ SUM(CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
THEN orders.discount
- ELSE orders.net_amount
+ ELSE orders.net_amount
END) AS total,
-
-
- SUM(CASE
- WHEN orders.order_payment_mode = "MVOLA" THEN
- CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+
+
+ SUM(CASE
+ WHEN orders.order_payment_mode = "MVOLA" THEN
+ CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
THEN (orders.tranche_1 * orders.discount / orders.net_amount)
- ELSE orders.tranche_1
+ ELSE orders.tranche_1
END
- ELSE 0
+ ELSE 0
END) AS total_mvola1,
- SUM(CASE
- WHEN orders.order_payment_mode_1 = "MVOLA" THEN
- CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+ SUM(CASE
+ WHEN orders.order_payment_mode_1 = "MVOLA" THEN
+ CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
THEN (orders.tranche_2 * orders.discount / orders.net_amount)
- ELSE orders.tranche_2
+ ELSE orders.tranche_2
END
- ELSE 0
+ ELSE 0
END) AS total_mvola2,
-
-
- SUM(CASE
- WHEN orders.order_payment_mode = "En espèce" THEN
- CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+
+
+ SUM(CASE
+ WHEN orders.order_payment_mode = "En espèce" THEN
+ CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
THEN (orders.tranche_1 * orders.discount / orders.net_amount)
- ELSE orders.tranche_1
+ ELSE orders.tranche_1
END
- ELSE 0
+ ELSE 0
END) AS total_espece1,
- SUM(CASE
- WHEN orders.order_payment_mode_1 = "En espèce" THEN
- CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+ SUM(CASE
+ WHEN orders.order_payment_mode_1 = "En espèce" THEN
+ CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
THEN (orders.tranche_2 * orders.discount / orders.net_amount)
- ELSE orders.tranche_2
+ ELSE orders.tranche_2
END
- ELSE 0
+ ELSE 0
END) AS total_espece2,
-
-
- SUM(CASE
- WHEN orders.order_payment_mode = "Virement bancaire" THEN
- CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+
+
+ SUM(CASE
+ WHEN orders.order_payment_mode = "Virement bancaire" THEN
+ CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
THEN (orders.tranche_1 * orders.discount / orders.net_amount)
- ELSE orders.tranche_1
+ ELSE orders.tranche_1
END
- ELSE 0
+ ELSE 0
END) AS total_virement_bancaire1,
- SUM(CASE
- WHEN orders.order_payment_mode_1 = "Virement bancaire" THEN
- CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+ SUM(CASE
+ WHEN orders.order_payment_mode_1 = "Virement bancaire" THEN
+ CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
THEN (orders.tranche_2 * orders.discount / orders.net_amount)
- ELSE orders.tranche_2
+ ELSE orders.tranche_2
END
- ELSE 0
+ ELSE 0
END) AS total_virement_bancaire2
')
->whereIn('orders.paid_status', [1, 3]);
- if (!$isAdmin) {
+ if (!empty($storeId)) {
+ $baseQuery->where('orders.store_id', $storeId);
+ } elseif (!$isAdmin) {
$baseQuery->where('orders.store_id', $users['store_id']);
}
+ if (!empty($userId)) {
+ $baseQuery->where('orders.user_id', $userId);
+ }
+
if ($startDate) {
$baseQuery->where('DATE(orders.date_time) >=', $startDate);
}
@@ -478,21 +485,47 @@ class Orders extends Model
return $baseQuery->get()->getRowObject();
}
- public function getTotalOrders()
+ public function getTotalOrders($startDate = null, $endDate = null, $storeId = null, $userId = null)
{
- return $this->db->table('orders')
- ->select(' COUNT(*) as total_orders')
- ->get()
- ->getRow();
+ $builder = $this->db->table('orders')
+ ->select('COUNT(*) as total_orders');
+
+ if (!empty($storeId)) {
+ $builder->where('store_id', $storeId);
+ }
+ if (!empty($userId)) {
+ $builder->where('user_id', $userId);
+ }
+ if (!empty($startDate)) {
+ $builder->where('DATE(date_time) >=', $startDate);
+ }
+ if (!empty($endDate)) {
+ $builder->where('DATE(date_time) <=', $endDate);
+ }
+
+ return $builder->get()->getRow();
}
- public function getTotalOrderPerStore()
+ public function getTotalOrderPerStore($startDate = null, $endDate = null, $storeId = null, $userId = null)
{
- return $this->db->table('orders')
+ $builder = $this->db->table('orders')
->select('store_id, COUNT(*) as total')
- ->groupBy('store_id')
- ->get()
- ->getResult();
+ ->groupBy('store_id');
+
+ if (!empty($storeId)) {
+ $builder->where('store_id', $storeId);
+ }
+ if (!empty($userId)) {
+ $builder->where('user_id', $userId);
+ }
+ if (!empty($startDate)) {
+ $builder->where('DATE(date_time) >=', $startDate);
+ }
+ if (!empty($endDate)) {
+ $builder->where('DATE(date_time) <=', $endDate);
+ }
+
+ return $builder->get()->getResult();
}
public function getPaymentModesPercentage()
@@ -556,53 +589,57 @@ class Orders extends Model
return $order;
}
- public function getTotalProductvente2(?int $id)
+ public function getTotalProductvente2(?int $id, $startDate = null, $endDate = null)
{
+ $builder = $this->db->table('orders')
+ ->select('orders.id, orders.paid_status, orders.store_id, orders.date_time, brands.name, products.name as Pname, products.sku')
+ ->join('orders_item', 'orders.id = orders_item.order_id')
+ ->join('products', 'orders_item.product_id = products.id')
+ ->join('brands', 'brands.id = products.marque')
+ ->whereIn('orders.paid_status', [1, 3]);
+
if ($id != 0) {
- $order = $this->db->table('orders')
- ->select('orders.id, orders.paid_status, orders.store_id, orders.date_time, brands.name, products.name as Pname, products.sku')
- ->join('orders_item', 'orders.id = orders_item.order_id')
- ->join('products', 'orders_item.product_id = products.id')
- ->join('brands', 'brands.id = products.marque')
- ->whereIn('orders.paid_status', [1, 3]) // ← CHANGÉ ICI
- ->where('orders.store_id', $id)
- ->get()
- ->getResult();
- } else {
- $order = $this->db->table('orders')
- ->select('orders.id, orders.paid_status, orders.store_id, orders.date_time, brands.name, products.name as Pname, products.sku')
- ->join('orders_item', 'orders.id = orders_item.order_id')
- ->join('products', 'orders_item.product_id = products.id')
- ->join('brands', 'brands.id = products.marque')
- ->whereIn('orders.paid_status', [1, 3]) // ← CHANGÉ ICI
- ->get()
- ->getResult();
+ $builder->where('orders.store_id', $id);
}
-
- return $order;
+ if (!empty($startDate)) {
+ $builder->where('DATE(orders.date_time) >=', $startDate);
+ }
+ if (!empty($endDate)) {
+ $builder->where('DATE(orders.date_time) <=', $endDate);
+ }
+
+ return $builder->get()->getResult();
}
- public function getOrderVendue()
+ public function getOrderVendue($storeId = null, $startDate = null, $endDate = null)
{
- $order = $this->db->table('products')
+ $builder = $this->db->table('products')
->select('
- products.*,
- products.name as Pname,
- products.sku,
- CASE
- WHEN orders.discount > 0 AND orders.discount IS NOT NULL
- THEN orders.discount
- ELSE orders.gross_amount
+ products.*,
+ products.name as Pname,
+ products.sku,
+ CASE
+ WHEN orders.discount > 0 AND orders.discount IS NOT NULL
+ THEN orders.discount
+ ELSE orders.gross_amount
END as totalNet,
orders.date_time as DateTime
- ', false) // ← MODIFIÉ ICI
+ ', false)
->join('orders_item', 'products.id = orders_item.product_id')
->join('orders', 'orders_item.order_id = orders.id')
- ->whereIn('orders.paid_status', [1, 3]) // ← ET ICI
- ->get()
- ->getResultArray();
-
- return $order;
+ ->whereIn('orders.paid_status', [1, 3]);
+
+ if (!empty($storeId) && $storeId != 0) {
+ $builder->where('orders.store_id', $storeId);
+ }
+ if (!empty($startDate)) {
+ $builder->where('DATE(orders.date_time) >=', $startDate);
+ }
+ if (!empty($endDate)) {
+ $builder->where('DATE(orders.date_time) <=', $endDate);
+ }
+
+ return $builder->get()->getResultArray();
}
public function getPerformanceByOrders($startDate = null, $endDate = null, $pvente = null, $commercialId = null)
diff --git a/app/Models/Remise.php b/app/Models/Remise.php
index 0364139a..2e7adb69 100644
--- a/app/Models/Remise.php
+++ b/app/Models/Remise.php
@@ -16,10 +16,9 @@ class Remise extends Model
$session = session();
$users = $session->get('user');
- // ✅ SUPERADMIN VOIT TOUTES LES DEMANDES "EN ATTENTE" (POUR VALIDATION)
+ // ✅ SUPERADMIN VOIT TOUTES LES DEMANDES (TOUS STATUTS)
if ($users["group_name"] === "SuperAdmin") {
- return $this->where('demande_status', 'En attente')
- ->orderBy('date_demande', 'DESC')
+ return $this->orderBy('date_demande', 'DESC')
->findAll();
}
diff --git a/app/Models/Reports.php b/app/Models/Reports.php
index dec52b01..6c7d536c 100644
--- a/app/Models/Reports.php
+++ b/app/Models/Reports.php
@@ -39,37 +39,51 @@ class Reports extends Model
* @param mixed $year
* @return array
*/
- public function getOrderData($year)
- {
+ public function getOrderData($year, $startDate = null, $endDate = null, $storeId = null, $userId = null)
+ {
if ($year) {
$months = $this->months();
-
+
// Fetch orders with paid_status = 1 or 3
- $result = $this->whereIn('paid_status', [1, 3])->findAll();
-
+ $builder = $this->whereIn('paid_status', [1, 3]);
+
+ if (!empty($storeId)) {
+ $builder->where('store_id', $storeId);
+ }
+ if (!empty($userId)) {
+ $builder->where('user_id', $userId);
+ }
+ if (!empty($startDate)) {
+ $builder->where('DATE(date_time) >=', $startDate);
+ }
+ if (!empty($endDate)) {
+ $builder->where('DATE(date_time) <=', $endDate);
+ }
+
+ $result = $builder->findAll();
+
$final_data = [];
-
+
foreach ($months as $month) {
- $get_mon_year = $year . '-' . $month;
+ $get_mon_year = $year . '-' . $month;
$final_data[$get_mon_year] = [];
-
+
foreach ($result as $v) {
- $month_year = date('Y-m', strtotime($v['date_time']));
+ $month_year = date('Y-m', strtotime($v['date_time']));
if ($get_mon_year == $month_year) {
- // Modifier le montant selon votre logique
if (!empty($v['discount']) && $v['discount'] > 0) {
- $v['amount_to_display'] = $v['discount']; // Utiliser le rabais
+ $v['amount_to_display'] = $v['discount'];
} else {
- $v['amount_to_display'] = $v['gross_amount']; // Utiliser gross_amount
+ $v['amount_to_display'] = $v['gross_amount'];
}
$final_data[$get_mon_year][] = $v;
}
}
}
-
+
return $final_data;
}
-
+
return [];
}
}
\ No newline at end of file
diff --git a/app/Views/reports/index.php b/app/Views/reports/index.php
index 06429a2c..c919dc33 100644
--- a/app/Views/reports/index.php
+++ b/app/Views/reports/index.php
@@ -13,20 +13,59 @@
-
-
+
-
+
-
+
+
+
+
+
-
-
+
+
@@ -228,14 +235,16 @@
]
});
- const filterBtn = document.getElementById('storeFilter');
+ const storeSelect = document.getElementById('storeFilter');
- filterBtn.addEventListener('change', function () {
- let filterValue = filterBtn.value === "TOUS" ? "0" : filterBtn.value;
+ storeSelect.addEventListener('change', function () {
+ let filterValue = storeSelect.value === "TOUS" ? "0" : storeSelect.value;
+ let startDate = $('#startDateStock').val();
+ let endDate = $('#endDateStock').val();
+ let params = '?startDate=' + startDate + '&endDate=' + endDate;
- // Update the DataTable dynamically without reinitialization
- manageTable.ajax.url('fetchData/' + filterValue).load();
- manageTable2.ajax.url('fetchDataStock/' + filterValue).load();
+ manageTable.ajax.url('fetchData/' + filterValue + params).load();
+ manageTable2.ajax.url('fetchDataStock/' + filterValue + params).load();
});
let productsSold = = $ventes ?>;
@@ -272,32 +281,14 @@
applyFilter("TOUS");
});
- $.fn.dataTable.ext.search.push(function (settings, data, dataIndex) {
- if (settings.nTable.id !== 'export1') return true; // Apply only to your table
-
- const startDate = $('#startDate').val();
- const endDate = $('#endDate').val();
- const saleDate = data[3]; // assuming column 4 is "Date de vente"
-
- // If no start date, show everything (default)
- if (!startDate) {
- return true;
- }
-
- const sale = new Date(saleDate);
- const start = new Date(startDate);
- const end = endDate ? new Date(endDate) : null;
-
- if (end) {
- return sale >= start && sale <= end;
- } else {
- return sale >= start;
- }
- });
-
-
$('#filteredB1').on('click', function () {
- manageTable3.draw(); // re-filter table
+ let storeId = $('#exportStoreFilter').val();
+ let filterValue = storeId === "TOUS" ? "0" : storeId;
+ let startDate = $('#startDate').val();
+ let endDate = $('#endDate').val();
+ let params = '?startDate=' + startDate + '&endDate=' + endDate;
+
+ manageTable3.ajax.url('fetchDataStock2/' + filterValue + params).load();
});
diff --git a/app/Views/securite/index.php b/app/Views/securite/index.php
index 947b357a..7612d076 100644
--- a/app/Views/securite/index.php
+++ b/app/Views/securite/index.php
@@ -308,7 +308,7 @@
Produit :
- UGS :
+ N° SERIE :
N° Facture :
Client :
Adresse :
@@ -353,8 +353,8 @@
- UGS:
-
+ N° SERIE:
+
Marque:
@@ -430,7 +430,7 @@ $(function() {
},
columns: [
{ data: 'image', orderable: false },
- { data: 'ugs' },
+ { data: 'num_serie' },
{ data: 'designation' },
{ data: 'statut' },
{ data: 'action', orderable: false }
@@ -462,7 +462,7 @@ $(function() {
success: function(response) {
$('#editImage').attr('src', response.image);
$('#editNom').text(response.nom);
- $('#editUgs').text(response.ugs);
+ $('#editNumSerie').text(response.num_serie);
$('#editBillNo').text(response.bill_no);
$('#editClient').text(response.customer_name);
$('#editAddress').text(response.customer_address);
@@ -767,7 +767,7 @@ $(function() {
data.push([
'N° Facture',
'Désignation',
- 'UGS',
+ 'N° SERIE',
'Marque',
'Client',
'Magasin',
@@ -818,7 +818,7 @@ function viewDetails(id) {
$('#detailImage').attr('src', data[0]);
$('#detailBillNo').text(data[1]);
$('#detailDesignation').text(data[2]);
- $('#detailUGS').text(data[3]);
+ $('#detailNumSerie').text(data[3]);
$('#detailMarque').text(data[4]);
$('#detailSerie').text(data[3]);
$('#detailStore').text(data[7]);