CMXX - Smaller improvements firmware indicators

This commit is contained in:
“VeLiTi”
2024-11-27 13:56:14 +01:00
parent 96a019a616
commit c818152448
3 changed files with 27 additions and 21 deletions

View File

@@ -128,16 +128,16 @@ foreach ($responses as $response){
$output[] = array(
"#" => $response['rowID'] ,
$contract_status => $$status,
$contract_account => $partner_data['soldto'],
$contract_type => $$type,
$contract_billinglabel =>$$contract_billingplan_text,
$contract_start_date =>$response['start_date'],
$contract_end_date => $date,
$contract_reference =>$response['reference'],
$contract_billing_count =>$billing_run,
$contract_service_2 =>$response['service_count'],
$contract_overrun => $usage_percentage,
"Status" => $$status,
"Account" => $partner_data['soldto'],
"Type" => $$type,
"Billingplan" =>$$contract_billingplan_text,
"Start date" =>$response['start_date'],
"End date" => $date,
"Reference" =>$response['reference'],
"Consumed" =>$billing_run,
"Contracted" =>$response['service_count'],
"Deviation" => $usage_percentage,
"Snapshot_date" => $da,
"Period" => $period

View File

@@ -16,6 +16,11 @@ $sql = 'UPDATE equipment e LEFT JOIN products_software ps ON e.productrowid = ps
$stmt = $pdo->prepare($sql);
$stmt->execute();
//UPDATE ASSETS-> SW_LATEST_VERSION WITH PRODUCT_SOFTWARE FROM 2 TO 0
$sql = 'UPDATE equipment e LEFT JOIN products_software ps ON e.productrowid = ps.productrowid SET e.sw_version_latest = 0 WHERE ps.rowID IS NOT NULL AND sw_version_latest = 2';
$stmt = $pdo->prepare($sql);
$stmt->execute();
//UPDATE LATEST TO NO IN CASE HW_VERSION ARE EQUAL AND SW_VERSIONS NOT AND NOT LATEST
$sql = 'UPDATE equipment e JOIN products_software ps ON e.productrowid = ps.productrowid SET e.sw_version_latest = 0 WHERE ps.latest = 1 AND lower(e.sw_version) <> lower(ps.version) AND lower(e.hw_version) = lower(ps.hw_version) AND e.sw_version_latest = 1';
$stmt = $pdo->prepare($sql);