diff --git a/api/v1/get/equipments.php b/api/v1/get/equipments.php index 2b45597..a8dead3 100644 --- a/api/v1/get/equipments.php +++ b/api/v1/get/equipments.php @@ -169,7 +169,7 @@ else { } //SQL for Paging - $sql = 'SELECT e.rowID as equipmentID, e.productrowid, e.serialnumber, e.status, e.created, e.createdby, e.hw_version, e.sw_version, e.accounthierarchy, e.service_date, e.warranty_date, p.productcode, p.productname from equipment e LEFT JOIN products p ON e.productrowid = p.rowID '.$whereclause.' ORDER BY '.$sort.' LIMIT :page,:num_products'; + $sql = 'SELECT e.rowID as equipmentID, e.productrowid, e.serialnumber, e.status, e.created, e.createdby, e.hw_version, e.sw_version, e.accounthierarchy, e.service_date, e.warranty_date, e.order_ref, p.productcode, p.productname from equipment e LEFT JOIN products p ON e.productrowid = p.rowID '.$whereclause.' ORDER BY '.$sort.' LIMIT :page,:num_products'; } $stmt = $pdo->prepare($sql); diff --git a/api/v1/post/equipments.php b/api/v1/post/equipments.php index 2462614..2466594 100644 --- a/api/v1/post/equipments.php +++ b/api/v1/post/equipments.php @@ -120,6 +120,11 @@ if ($command == 'update'){ { changelog($dbname,'equipment',$equipment_data['rowID'],'status',$post_content['status'],$username); } + //UPDATE CHANGELOG BASED ON ORDER_REF change + if ($post_content['order_ref'] != $equipment_data['order_ref']) + { + changelog($dbname,'equipment',$equipment_data['rowID'],'order_ref',$post_content['order_ref'],$username); + } $post_content['accounthierarchy'] = $accounthierarchy; diff --git a/assets/functions.php b/assets/functions.php index caa328d..c81eed3 100644 --- a/assets/functions.php +++ b/assets/functions.php @@ -1715,7 +1715,7 @@ function showlog($object,$objectID){ $object_text = 'status'.$change['object_value'].'_text'; $object_value = $$object_text; } - $view .= ''; + $view .= ''; } return $view; diff --git a/equipment_manage.php b/equipment_manage.php index 17b5011..43ae9a4 100644 --- a/equipment_manage.php +++ b/equipment_manage.php @@ -26,7 +26,8 @@ $equipment = [ 'hw_version' => 'R08', 'sw_version' => '', 'service_date' => $date, - 'warranty_date' => $date + 'warranty_date' => $date, + 'order_ref' => '' ]; $equipment_ID = $_GET['equipmentID'] ?? ''; @@ -218,6 +219,8 @@ $view .= '
+ + '.$changelog.'
'; diff --git a/equipments_mass_update.php b/equipments_mass_update.php index c278cef..4f488c2 100644 --- a/equipments_mass_update.php +++ b/equipments_mass_update.php @@ -54,6 +54,7 @@ if ($update_allowed === 1){ if (isset ($responses->rowID)){ $output_excel[$val]['rowID'] = $responses->rowID; $output_excel[$val]['serialnumber'] = $val; + $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']; @@ -166,6 +167,12 @@ $view .= '
'.$mass_update_input.'
+
+

+
+
+ +

diff --git a/settings/translations/translations_NL.php b/settings/translations/translations_NL.php index 66dfcd9..a7ffe73 100644 --- a/settings/translations/translations_NL.php +++ b/settings/translations/translations_NL.php @@ -114,6 +114,7 @@ $equipment_label7 = 'Garantie startdatum'; $equipment_label8 = 'Service datum'; $equipment_label9 = 'Service geldig tot'; $equipment_label10 = 'Activanummer'; +$equipment_label11 = 'Order referentie'; $equiment_search = 'Zoek serienummer...'; diff --git a/settings/translations/translations_US.php b/settings/translations/translations_US.php index 21f03b4..0e06f73 100644 --- a/settings/translations/translations_US.php +++ b/settings/translations/translations_US.php @@ -113,6 +113,7 @@ $equipment_label7 = 'Warranty start date'; $equipment_label8 = 'Date of Service'; $equipment_label9 = 'Service renewal'; $equipment_label10 = 'Assets ID'; +$equipment_label11 = 'Order reference'; $equiment_search = 'Search serialnumber...';