From 2427d40273f583300905039d84779959bbf1b3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Fri, 30 Jan 2026 10:56:34 +0100 Subject: [PATCH] Update salesid and soldto inclusion based on hierarchy level visibility in mass update form --- equipments_mass_update.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/equipments_mass_update.php b/equipments_mass_update.php index 146818b..565043e 100644 --- a/equipments_mass_update.php +++ b/equipments_mass_update.php @@ -68,8 +68,18 @@ if ($update_allowed === 1){ $output_excel[$val]['productname'] = ${$responses->productname} ?? $responses->productname; $output_excel[$val]['order_ref'] = $_POST['order_ref']; $output_excel[$val]['status'] = $_POST['status']; - $output_excel[$val]['salesid'] = $_POST['salesid']; - $output_excel[$val]['soldto'] = $_POST['soldto']; + + // Only include salesid/soldto if form fields were visible (hierarchy 0-1) + $hierarchyLevel = getHierarchyLevel(json_decode($_SESSION['authorization']['partnerhierarchy'])); + if ($hierarchyLevel == 0 || $hierarchyLevel == 1) { + if (isset($_POST['salesid'])) { + $output_excel[$val]['salesid'] = $_POST['salesid']; + } + if (isset($_POST['soldto'])) { + $output_excel[$val]['soldto'] = $_POST['soldto']; + } + } + if (!empty($_POST['shipto']) || $_POST['shipto'] !=''){ $output_excel[$val]['shipto'] = $_POST['shipto']; }