diff --git a/common/proto/ecb.proto b/common/proto/ecb.proto index 4e3a2da9..6c679df2 100644 --- a/common/proto/ecb.proto +++ b/common/proto/ecb.proto @@ -148,7 +148,7 @@ message PreviewEcbConversionRequest { message PreviewEcbConversionResponse { string original_amount = 1; string original_currency = 2; - string eur_amount = 3; + string converted_amount = 3; string conversion_basis_date = 4; string determination_method = 5; string rounding_method = 6; @@ -174,6 +174,17 @@ message PreviewEcbConversionResponse { ExchangeRateDateRule applied_date_rule = 19; ExchangeRateSource applied_source = 20; string selection_reason = 21; + + // The currency converted_amount is stated in: the profile's accounting + // currency (EUR unless the profile keeps its books in something else). + string converted_currency = 22; + + // True when reaching converted_currency needed two hops (original currency + // to EUR, then EUR to converted_currency) because neither is EUR. The + // fields above then describe only the second, final hop; the full + // provenance of both hops is available from ListEcbConversionEvidence + // after posting. + bool via_two_hop_conversion = 23; } // Identify one logical money cell whose conversion history should be inspected. @@ -206,7 +217,7 @@ message EcbConversionEvidence { int64 row_revision = 2; string original_amount = 3; string original_currency = 4; - string eur_amount = 5; + string converted_amount = 5; string conversion_context = 6; string conversion_basis_date = 7; string determination_method = 8; @@ -232,6 +243,16 @@ message EcbConversionEvidence { // Immutable audit data for an accountant-controlled exception. string selection_reason = 23; optional string selected_by_user_id = 24; + + // The currency converted_amount is stated in. Always EUR for the + // original-currency-to-EUR leg; the profile's native currency for the + // EUR-to-native leg that follows it when that native currency is not EUR. + string converted_currency = 25; + + // Set only on the EUR-to-native-currency leg of a two-hop conversion. Names + // the original-currency-to-EUR leg's evidence_id, which produced this row's + // original_amount/original_currency (always EUR). + optional int64 derived_from_evidence_id = 26; } message ListEcbConversionEvidenceResponse { diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index b8a7c42a..4e234c52 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.ecb.rs b/common/src/proto/komp_ac.ecb.rs index c801661a..3cf183a2 100644 --- a/common/src/proto/komp_ac.ecb.rs +++ b/common/src/proto/komp_ac.ecb.rs @@ -132,7 +132,7 @@ pub struct PreviewEcbConversionResponse { #[prost(string, tag = "2")] pub original_currency: ::prost::alloc::string::String, #[prost(string, tag = "3")] - pub eur_amount: ::prost::alloc::string::String, + pub converted_amount: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub conversion_basis_date: ::prost::alloc::string::String, #[prost(string, tag = "5")] @@ -174,6 +174,17 @@ pub struct PreviewEcbConversionResponse { pub applied_source: i32, #[prost(string, tag = "21")] pub selection_reason: ::prost::alloc::string::String, + /// The currency converted_amount is stated in: the profile's accounting + /// currency (EUR unless the profile keeps its books in something else). + #[prost(string, tag = "22")] + pub converted_currency: ::prost::alloc::string::String, + /// True when reaching converted_currency needed two hops (original currency + /// to EUR, then EUR to converted_currency) because neither is EUR. The + /// fields above then describe only the second, final hop; the full + /// provenance of both hops is available from ListEcbConversionEvidence + /// after posting. + #[prost(bool, tag = "23")] + pub via_two_hop_conversion: bool, } /// Identify one logical money cell whose conversion history should be inspected. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -211,7 +222,7 @@ pub struct EcbConversionEvidence { #[prost(string, tag = "4")] pub original_currency: ::prost::alloc::string::String, #[prost(string, tag = "5")] - pub eur_amount: ::prost::alloc::string::String, + pub converted_amount: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub conversion_context: ::prost::alloc::string::String, #[prost(string, tag = "7")] @@ -254,6 +265,16 @@ pub struct EcbConversionEvidence { pub selection_reason: ::prost::alloc::string::String, #[prost(string, optional, tag = "24")] pub selected_by_user_id: ::core::option::Option<::prost::alloc::string::String>, + /// The currency converted_amount is stated in. Always EUR for the + /// original-currency-to-EUR leg; the profile's native currency for the + /// EUR-to-native leg that follows it when that native currency is not EUR. + #[prost(string, tag = "25")] + pub converted_currency: ::prost::alloc::string::String, + /// Set only on the EUR-to-native-currency leg of a two-hop conversion. Names + /// the original-currency-to-EUR leg's evidence_id, which produced this row's + /// original_amount/original_currency (always EUR). + #[prost(int64, optional, tag = "26")] + pub derived_from_evidence_id: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListEcbConversionEvidenceResponse { diff --git a/server b/server index 9a14bb11..0fc100a4 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 9a14bb116a0d281fe7965198cebf6e6689a53f0b +Subproject commit 0fc100a4342846eea066bd239d546f206568cd23 diff --git a/web/locales/cs/main.ftl b/web/locales/cs/main.ftl index 194e2676..ce656ed5 100644 --- a/web/locales/cs/main.ftl +++ b/web/locales/cs/main.ftl @@ -755,7 +755,7 @@ builder-choose-profile = Vyberte profil builder-new-profile = Nový profil… builder-new-profile-name = Název nového profilu builder-accounting-currency = Účetní měna -builder-accounting-currency-hint = Účetnictví se zatím vede v EUR — ostatní měny jsou v seznamu, ale server je zatím odmítá. +builder-accounting-currency-hint = Účetnictví může být vedeno v jakékoli měně, pro kterou ECB zveřejňuje referenční kurz. Jiná měna než EUR se v případě potřeby přepočítá přes EUR, protože kurzy ECB jsou vždy vyjádřeny vůči euru. builder-table-name = Název tabulky builder-add-column-heading = Přidat sloupec builder-add-column-button = Přidat sloupec diff --git a/web/locales/en/main.ftl b/web/locales/en/main.ftl index 8c9f8318..8ecf2d68 100644 --- a/web/locales/en/main.ftl +++ b/web/locales/en/main.ftl @@ -743,7 +743,7 @@ builder-choose-profile = Choose a profile builder-new-profile = New profile… builder-new-profile-name = New profile name builder-accounting-currency = Accounting currency -builder-accounting-currency-hint = Books are kept in EUR for now — other currencies are listed but the server still refuses them. +builder-accounting-currency-hint = Books can be kept in any currency ECB publishes a reference rate for. A currency other than EUR is converted through EUR when needed, since ECB rates are always quoted against the euro. builder-table-name = Table name builder-add-column-heading = Add a column builder-add-column-button = Add column diff --git a/web/locales/sk/main.ftl b/web/locales/sk/main.ftl index fc240161..5949c941 100644 --- a/web/locales/sk/main.ftl +++ b/web/locales/sk/main.ftl @@ -753,7 +753,7 @@ builder-choose-profile = Vyberte profil builder-new-profile = Nový profil… builder-new-profile-name = Názov nového profilu builder-accounting-currency = Účtovná mena -builder-accounting-currency-hint = Účtovníctvo sa zatiaľ vedie v EUR — ostatné meny sú v zozname, ale server ich ešte odmieta. +builder-accounting-currency-hint = Účtovníctvo môže byť vedené v akejkoľvek mene, pre ktorú ECB zverejňuje referenčný kurz. Iná mena ako EUR sa v prípade potreby prepočíta cez EUR, keďže kurzy ECB sú vždy vyjadrené voči euru. builder-table-name = Názov tabuľky builder-add-column-heading = Pridať stĺpec builder-add-column-button = Pridať stĺpec