How to display the current taxonomy slug in a query loop in a Code element?

I have a post type, customers, it stores data(custom acf fields), namely invoice_number, date, phone_number, project_amount, address. And also project-month and project-year taxonomies. I have an analytics page that displays each month in a table and next to it should be the sum of all project_ammout of all clients for that month. I need to get the sum of projects of the contracted month, I have a taxonomy of month and project prices separately for this purpose.

I have a loop in “tr” which outputs the terms, and in the element “code” I have already prescribed this php code which does the sum by custom acf project amount. But now I have ‘terms’ => ‘january’, instead of january should be substituted automatically slag term, how do I do it? Also with the year.
array(
‘taxonomy’ => ‘project-month’,
‘field’ => ‘slug’,
‘terms’ => ‘january’,
),
array(
‘taxonomy’ => ‘project-year’,
‘field’ => ‘slug’,
‘terms’ => ‘2024’
),

All code.

<?php $args = array( 'post_type' => 'customer', 'posts_per_page' => -1, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'project-month', 'field' => 'slug', 'terms' => 'january', ), array( 'taxonomy' => 'project-year', 'field' => 'slug', 'terms' => '2024', ), ), ); $query = new WP_Query( $args ); $total_project_amount = 0; if ( $query->have_posts() ) { // Начинаем цикл while ( $query->have_posts() ) { $query->the_post(); $project_amount = get_field('project_amount'); $total_project_amount += $project_amount; } wp_reset_postdata(); } echo '$' .$total_project_amount; ?>