Fix production view for initial display.

This commit is contained in:
2025-03-31 09:51:18 +02:00
parent 94c012cd70
commit 4cb13ebc85

View File

@@ -30,8 +30,9 @@ if (isset($_POST['action']) && $_POST['action'] == 'set_values') {
$local_db->query($query); $local_db->query($query);
} }
$actual = new DateTime();
$dates = get_month($local_db, $table_aggregation); $dates = get_month($local_db, $table_aggregation);
$chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $dates[0]; $chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $actual->format('Y-m');
$production_values = get_production_values_for_month($local_db, $table_aggregation, $chosen_date); $production_values = get_production_values_for_month($local_db, $table_aggregation, $chosen_date);
$month_production = get_month_production($local_db, $table_production, $chosen_date); $month_production = get_month_production($local_db, $table_production, $chosen_date);