default accounting currency

This commit is contained in:
Priec
2026-09-12 19:33:21 +02:00
parent 017ca87c67
commit 156d1c4464
6 changed files with 62 additions and 41 deletions

View File

@@ -122,6 +122,9 @@ message GetModuleConfigurationRequest {
message SetModuleConfigurationRequest {
ModuleScope scope = 1;
repeated string enabled_modules = 2;
// Initializes an existing profile's bookkeeping currency. Empty leaves it unchanged.
// Global scope and changes to an already configured currency are rejected.
string accounting_currency = 3;
}
message ModuleConfiguration {
@@ -130,6 +133,7 @@ message ModuleConfiguration {
repeated string selected_modules = 3;
repeated string inherited_modules = 4;
repeated string effective_modules = 5;
string accounting_currency = 6;
}
message CreateCustomExchangeRatesTableRequest {
@@ -172,11 +176,11 @@ message PostTableDefinitionRequest {
// Empty means the row is identified by its id alone.
repeated string row_display_columns = 7;
// ISO-4217 currency the profile keeps its accounting in. A profile is one
// accounting entity and keeps one set of books, so this is required only when
// the request creates the profile, and is ignored afterwards. It is unrelated
// to individual MONEY-column currencies: tables may hold money in any currency, and amounts convert
// to this one when they reach the ledger.
// Default ISO-4217 currency for this table's MONEY columns. Explicit column
// currencies take precedence; when omitted, the profile currency is used.
// The resolved default is saved for columns added later. When this request
// creates a profile, it also initializes that profile's bookkeeping currency.
// Supplying a table default never changes an existing profile's currency.
string accounting_currency = 8;
// Initial compiled direct-rate provider. It is enabled for each initial
@@ -187,7 +191,7 @@ message PostTableDefinitionRequest {
repeated string foreign_currencies = 12;
// When true, the table is stored once in the global physical schema and is
// visible from every profile. profile_name and accounting_currency are ignored.
// visible from every profile. profile_name is ignored.
bool global = 9;
// Names for the columns a definition row generates, in place of the ones the
@@ -398,8 +402,8 @@ message ColumnDefinition {
// from quantity-ledger contributions.
bool quantity_ledger = 4;
// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
// for every other field type.
// Canonical uppercase ISO-4217 currency code. MONEY inherits the table/profile
// default when omitted. Forbidden for field types without currency support.
string currency = 5;
// When true, the server rejects omitted or explicitly null values.

Binary file not shown.

View File

@@ -29,6 +29,10 @@ pub struct SetModuleConfigurationRequest {
pub scope: ::core::option::Option<ModuleScope>,
#[prost(string, repeated, tag = "2")]
pub enabled_modules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Initializes an existing profile's bookkeeping currency. Empty leaves it unchanged.
/// Global scope and changes to an already configured currency are rejected.
#[prost(string, tag = "3")]
pub accounting_currency: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
@@ -43,6 +47,8 @@ pub struct ModuleConfiguration {
pub inherited_modules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "5")]
pub effective_modules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "6")]
pub accounting_currency: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
@@ -91,11 +97,11 @@ pub struct PostTableDefinitionRequest {
/// Empty means the row is identified by its id alone.
#[prost(string, repeated, tag = "7")]
pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// ISO-4217 currency the profile keeps its accounting in. A profile is one
/// accounting entity and keeps one set of books, so this is required only when
/// the request creates the profile, and is ignored afterwards. It is unrelated
/// to individual MONEY-column currencies: tables may hold money in any currency, and amounts convert
/// to this one when they reach the ledger.
/// Default ISO-4217 currency for this table's MONEY columns. Explicit column
/// currencies take precedence; when omitted, the profile currency is used.
/// The resolved default is saved for columns added later. When this request
/// creates a profile, it also initializes that profile's bookkeeping currency.
/// Supplying a table default never changes an existing profile's currency.
#[prost(string, tag = "8")]
pub accounting_currency: ::prost::alloc::string::String,
/// Initial compiled direct-rate provider. It is enabled for each initial
@@ -106,7 +112,7 @@ pub struct PostTableDefinitionRequest {
#[prost(string, repeated, tag = "12")]
pub foreign_currencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// When true, the table is stored once in the global physical schema and is
/// visible from every profile. profile_name and accounting_currency are ignored.
/// visible from every profile. profile_name is ignored.
#[prost(bool, tag = "9")]
pub global: bool,
/// Names for the columns a definition row generates, in place of the ones the
@@ -347,8 +353,8 @@ pub struct ColumnDefinition {
/// from quantity-ledger contributions.
#[prost(bool, tag = "4")]
pub quantity_ledger: bool,
/// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
/// for every other field type.
/// Canonical uppercase ISO-4217 currency code. MONEY inherits the table/profile
/// default when omitted. Forbidden for field types without currency support.
#[prost(string, tag = "5")]
pub currency: ::prost::alloc::string::String,
/// When true, the server rejects omitted or explicitly null values.