예제 #1
0
def _write_diversification_table(departement_code: str, worksheet: Worksheet,
                                 current_row: int) -> int:
    worksheet.update_value(f'A{current_row}', 'Indicateur')
    worksheet.update_value(f'B{current_row}', 'Valeur')
    worksheet.update_value(f'E{current_row}', 'Indicateur')
    worksheet.update_value(f'F{current_row}', 'Valeur')
    worksheet.update_value(f'I{current_row}', 'Indicateur')
    worksheet.update_value(f'J{current_row}', 'Valeur')
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}',
                           '# Offreurs depuis le début du pass')
    worksheet.update_value(f'B{current_row}',
                           get_offerer_count(departement_code))
    worksheet.update_value(f'E{current_row}',
                           '# Offres depuis le début du pass')
    worksheet.update_value(
        f'F{current_row}',
        get_offers_with_user_offerer_and_stock_count(departement_code))
    worksheet.update_value(f'I{current_row}', '# Réservations')
    worksheet.update_value(f'J{current_row}',
                           get_all_bookings_count(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(
        f'A{current_row}',
        '# Offreurs ayant mis une offre depuis le début du pass')
    worksheet.update_value(f'B{current_row}',
                           get_offerer_with_stock_count(departement_code))
    worksheet.update_value(f'E{current_row}', '# Offres disponibles')
    worksheet.update_value(
        f'F{current_row}',
        get_offers_available_on_discovery_count(departement_code))
    worksheet.update_value(f'I{current_row}', '# Réservations validées')
    worksheet.update_value(f'J{current_row}',
                           get_all_used_or_finished_bookings(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}',
                           '# Offreurs ayant une offre disponible')
    worksheet.update_value(
        f'B{current_row}',
        get_offerers_with_offer_available_on_discovery_count(departement_code))
    worksheet.update_value(f'E{current_row}', '# Offres réservées')
    worksheet.update_value(
        f'F{current_row}',
        get_offers_with_non_cancelled_bookings_count(departement_code))
    worksheet.update_value(f'I{current_row}', '# Réservations annulées')
    worksheet.update_value(f'J{current_row}',
                           count_all_cancelled_bookings(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}', '# Offreurs réservés')
    worksheet.update_value(
        f'B{current_row}',
        get_offerers_with_non_cancelled_bookings_count(departement_code))
    return current_row
예제 #2
0
def _write_usage_table(departement_code: str, worksheet: Worksheet,
                       current_row: int) -> int:
    worksheet.update_value(f'A{current_row}', '# Comptes activés')
    worksheet.update_value(f'B{current_row}',
                           count_activated_users(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}', '# Comptes ayant réservé')
    worksheet.update_value(f'B{current_row}',
                           count_users_having_booked(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}', '# Moyen de réservations')
    worksheet.update_value(
        f'B{current_row}',
        get_mean_number_of_bookings_per_user_having_booked(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}', '€ Moyen de dépenses')
    worksheet.update_value(f'B{current_row}',
                           get_mean_amount_spent_by_user(departement_code))
    return current_row
예제 #3
0
def _write_finance_table(departement_code: str, worksheet: Worksheet,
                         current_row: int) -> int:
    worksheet.update_value(f'A{current_row}', 'Indicateur')
    worksheet.update_value(f'B{current_row}', 'Valeur')
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}', '€ Crédit total activé')
    worksheet.update_value(f'B{current_row}',
                           get_total_deposits(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}', '€ Crédit total dépensé')
    worksheet.update_value(f'B{current_row}',
                           get_total_amount_spent(departement_code))
    current_row += DashboardConfig.space_between_lines
    worksheet.update_value(f'A{current_row}',
                           '€ Dépenses totales à rembourser')
    worksheet.update_value(f'B{current_row}',
                           get_total_amount_to_pay(departement_code))
    return current_row