From cc1e3fe334cff3bad971816979a62ce224f3cdb6 Mon Sep 17 00:00:00 2001 From: Keanu D?lle Date: Thu, 21 Apr 2022 21:30:28 +0200 Subject: [PATCH] FEA: allow setting up names for lump sum and money for time --- config/default.toml | 4 +++- config/development.toml | 4 +++- src/helper/settings.rs | 4 +++- src/modules/event_billing/generate_billing_csv.rs | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config/default.toml b/config/default.toml index e14f25a..9ff964a 100644 --- a/config/default.toml +++ b/config/default.toml @@ -36,4 +36,6 @@ default_pagination_limit = 20 #If set true members don't need billing related permissions if they are member_responsible for specific event member_responsible_overwrites_permissions = true send_personnel_billing_to_email = true -personnel_billing_emails = "receiver@localhost,receiver2@localhost" \ No newline at end of file +personnel_billing_emails = "receiver@localhost,receiver2@localhost" +lump_sum_name = "Lump Sum" +money_for_time_name = "Money for Time" \ No newline at end of file diff --git a/config/development.toml b/config/development.toml index a74366e..dba19fa 100644 --- a/config/development.toml +++ b/config/development.toml @@ -37,4 +37,6 @@ default_pagination_limit = 20 #If set true members don't need billing related permissions if they are member_responsible for specific event member_responsible_overwrites_permissions = true send_personnel_billing_to_email = true -personnel_billing_emails = "receiver@localhost,receiver2@localhost" \ No newline at end of file +personnel_billing_emails = "receiver@localhost,receiver2@localhost" +lump_sum_name = "Lump Sum" +money_for_time_name = "Money for Time" \ No newline at end of file diff --git a/src/helper/settings.rs b/src/helper/settings.rs index 59b0b8e..19e0a6a 100644 --- a/src/helper/settings.rs +++ b/src/helper/settings.rs @@ -43,7 +43,9 @@ pub struct Api { pub struct Billing { pub member_responsible_overwrites_permissions: bool, pub send_personnel_billing_to_email: bool, - pub personnel_billing_email: String, + pub personnel_billing_emails: String, + pub lump_sum_name: String, + pub money_for_time_name: String, } #[derive(Debug, Deserialize, Default, Clone)] diff --git a/src/modules/event_billing/generate_billing_csv.rs b/src/modules/event_billing/generate_billing_csv.rs index 1d23be0..15ffa9c 100644 --- a/src/modules/event_billing/generate_billing_csv.rs +++ b/src/modules/event_billing/generate_billing_csv.rs @@ -110,7 +110,7 @@ pub fn generate_billing_csv(settings: &State, event_id: uuid::Uuid) -> res.push_str(&format!("Abrechnungssatz:,{},{},Pauschale:,{},€/Stunde:,{}\n", sanitize(billing_rate.name), sanitize(billing_rate.description.unwrap_or(String::from(""))), sanitize(format!("{} €", billing_rate.lump_sum)), sanitize(format!("{} €", billing_rate.payment_per_hour)))); } - res.push_str(&format!("{},{},{},{},{},{},{},{},{}\n", String::from("Personalnummer"), String::from("Vorname"), String::from("Nachname"), String::from("Von"), String::from("Bis"), String::from("Stunden"), String::from("Pauschale"), String::from("Stundengeld"), String::from("Gesamt"))); + res.push_str(&format!("{},{},{},{},{},{},{},{},{}\n", String::from("Personalnummer"), String::from("Vorname"), String::from("Nachname"), String::from("Von"), String::from("Bis"), String::from("Stunden"), settings.billing.lump_sum_name, settings.billing.money_for_time_name, String::from("Gesamt"))); let position_instances = get_position_instances(settings, instance.instance_id)?;