diff --git a/client-gui2 b/client-gui2 index f40aa6bf..b76f9b43 160000 --- a/client-gui2 +++ b/client-gui2 @@ -1 +1 @@ -Subproject commit f40aa6bfd0f4d0a9096d7f663ec1bce895ae13ce +Subproject commit b76f9b430b6a4f60180e715c71fe1caa99b022ed diff --git a/common/proto/accounting.proto b/common/proto/accounting.proto index e06370a4..55df4b19 100644 --- a/common/proto/accounting.proto +++ b/common/proto/accounting.proto @@ -360,6 +360,7 @@ message ConfigureAccountingPeriodRequest { message CloseAccountingPeriodRequest { int64 period_id = 1; + string revaluation_preview = 2; } message ReopenAccountingPeriodRequest { @@ -409,6 +410,7 @@ message AccountingPeriod { message ListPeriodBalancesRequest { int64 period_id = 1; + bool preview_revaluation = 2; } message PeriodBalance { @@ -440,6 +442,9 @@ message PeriodDenominationBalance { message ListPeriodBalancesResponse { repeated PeriodBalance balances = 1; repeated PeriodDenominationBalance denomination_balances = 2; + // JSON array of proposed valuations for an open period, or the frozen + // evidence for a closed period. Pass the open-period value unchanged to close. + string revaluation_preview = 3; } message GetTrialBalanceRequest { diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 60f31304..9f81056d 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.accounting.rs b/common/src/proto/komp_ac.accounting.rs index 31e247b2..ea5f7d50 100644 --- a/common/src/proto/komp_ac.accounting.rs +++ b/common/src/proto/komp_ac.accounting.rs @@ -368,10 +368,12 @@ pub struct ConfigureAccountingPeriodRequest { pub period_end: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CloseAccountingPeriodRequest { #[prost(int64, tag = "1")] pub period_id: i64, + #[prost(string, tag = "2")] + pub revaluation_preview: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] @@ -450,6 +452,8 @@ pub struct AccountingPeriod { pub struct ListPeriodBalancesRequest { #[prost(int64, tag = "1")] pub period_id: i64, + #[prost(bool, tag = "2")] + pub preview_revaluation: bool, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -500,6 +504,10 @@ pub struct ListPeriodBalancesResponse { pub balances: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "2")] pub denomination_balances: ::prost::alloc::vec::Vec, + /// JSON array of proposed valuations for an open period, or the frozen + /// evidence for a closed period. Pass the open-period value unchanged to close. + #[prost(string, tag = "3")] + pub revaluation_preview: ::prost::alloc::string::String, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] diff --git a/komp-app/src/grpc.rs b/komp-app/src/grpc.rs index 6908fae5..5bfee161 100644 --- a/komp-app/src/grpc.rs +++ b/komp-app/src/grpc.rs @@ -264,8 +264,8 @@ impl GrpcClient { .context("gRPC ConfigureAccountingPeriod call failed")?.into_inner()) } - pub async fn close_accounting_period(&mut self, period_id: i64) -> Result { - let request = self.authenticated_request(CloseAccountingPeriodRequest { period_id })?; + pub async fn close_accounting_period(&mut self, period_id: i64, revaluation_preview: String) -> Result { + let request = self.authenticated_request(CloseAccountingPeriodRequest { period_id, revaluation_preview })?; Ok(self.accounting_client.close_accounting_period(request).await .context("gRPC CloseAccountingPeriod call failed")?.into_inner()) } @@ -297,8 +297,8 @@ impl GrpcClient { .context("gRPC ListAccountingPeriods call failed")?.into_inner()) } - pub async fn list_period_balances(&mut self, period_id: i64) -> Result { - let request = self.authenticated_request(ListPeriodBalancesRequest { period_id })?; + pub async fn list_period_balances(&mut self, period_id: i64, preview_revaluation: bool) -> Result { + let request = self.authenticated_request(ListPeriodBalancesRequest { period_id, preview_revaluation })?; Ok(self.accounting_client.list_period_balances(request).await .context("gRPC ListPeriodBalances call failed")?.into_inner()) } diff --git a/server b/server index 239c2f35..f3ff9392 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 239c2f3539de6fa11d225da4485f9e025e4abb63 +Subproject commit f3ff9392236ac4c5d232a2ee3d41ef76e9355fcb