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 .= '