predvaha
This commit is contained in:
Submodule client-gui2 updated: 91a46f6cf2...9839994ea5
@@ -63,6 +63,11 @@ service Accounting {
|
||||
returns (ListAccountingPeriodsResponse);
|
||||
rpc ListPeriodBalances(ListPeriodBalancesRequest) returns (ListPeriodBalancesResponse);
|
||||
|
||||
// Return a predvaha from one closed period's frozen account balances.
|
||||
// Opening and closing signed balances are presented on their debit or credit
|
||||
// side, while period turnover retains the journal's debit and credit columns.
|
||||
rpc GetTrialBalance(GetTrialBalanceRequest) returns (GetTrialBalanceResponse);
|
||||
|
||||
// Materialize one row per directly transferable source account in a table
|
||||
// containing an ACCOUNTING_TRANSFER definition. Source fields are frozen
|
||||
// accounting facts; target fields start as an unchanged same-path copy and
|
||||
@@ -437,6 +442,43 @@ message ListPeriodBalancesResponse {
|
||||
repeated PeriodDenominationBalance denomination_balances = 2;
|
||||
}
|
||||
|
||||
message GetTrialBalanceRequest {
|
||||
int64 period_id = 1;
|
||||
}
|
||||
|
||||
message TrialBalanceRow {
|
||||
// Slash-delimited root-to-leaf account path. Rows include both posting
|
||||
// accounts and consolidated ancestors from the frozen period snapshot.
|
||||
string account = 1;
|
||||
uint32 depth = 2;
|
||||
bool is_summary = 3;
|
||||
string currency = 4;
|
||||
string opening_debit = 5;
|
||||
string opening_credit = 6;
|
||||
string period_debit = 7;
|
||||
string period_credit = 8;
|
||||
string closing_debit = 9;
|
||||
string closing_credit = 10;
|
||||
}
|
||||
|
||||
message TrialBalanceTotals {
|
||||
// Totals are calculated from root rows only, because descendant rows are
|
||||
// already consolidated into their ancestors.
|
||||
string opening_debit = 1;
|
||||
string opening_credit = 2;
|
||||
string period_debit = 3;
|
||||
string period_credit = 4;
|
||||
string closing_debit = 5;
|
||||
string closing_credit = 6;
|
||||
}
|
||||
|
||||
message GetTrialBalanceResponse {
|
||||
AccountingPeriod period = 1;
|
||||
string currency = 2;
|
||||
repeated TrialBalanceRow rows = 3;
|
||||
TrialBalanceTotals totals = 4;
|
||||
}
|
||||
|
||||
message GenerateAccountingTransferRequest {
|
||||
string profile_name = 1;
|
||||
string table_name = 2;
|
||||
|
||||
Binary file not shown.
@@ -502,6 +502,68 @@ pub struct ListPeriodBalancesResponse {
|
||||
pub denomination_balances: ::prost::alloc::vec::Vec<PeriodDenominationBalance>,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct GetTrialBalanceRequest {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub period_id: i64,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct TrialBalanceRow {
|
||||
/// Slash-delimited root-to-leaf account path. Rows include both posting
|
||||
/// accounts and consolidated ancestors from the frozen period snapshot.
|
||||
#[prost(string, tag = "1")]
|
||||
pub account: ::prost::alloc::string::String,
|
||||
#[prost(uint32, tag = "2")]
|
||||
pub depth: u32,
|
||||
#[prost(bool, tag = "3")]
|
||||
pub is_summary: bool,
|
||||
#[prost(string, tag = "4")]
|
||||
pub currency: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "5")]
|
||||
pub opening_debit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "6")]
|
||||
pub opening_credit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "7")]
|
||||
pub period_debit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "8")]
|
||||
pub period_credit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "9")]
|
||||
pub closing_debit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "10")]
|
||||
pub closing_credit: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct TrialBalanceTotals {
|
||||
/// Totals are calculated from root rows only, because descendant rows are
|
||||
/// already consolidated into their ancestors.
|
||||
#[prost(string, tag = "1")]
|
||||
pub opening_debit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "2")]
|
||||
pub opening_credit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "3")]
|
||||
pub period_debit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "4")]
|
||||
pub period_credit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "5")]
|
||||
pub closing_debit: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "6")]
|
||||
pub closing_credit: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct GetTrialBalanceResponse {
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub period: ::core::option::Option<AccountingPeriod>,
|
||||
#[prost(string, tag = "2")]
|
||||
pub currency: ::prost::alloc::string::String,
|
||||
#[prost(message, repeated, tag = "3")]
|
||||
pub rows: ::prost::alloc::vec::Vec<TrialBalanceRow>,
|
||||
#[prost(message, optional, tag = "4")]
|
||||
pub totals: ::core::option::Option<TrialBalanceTotals>,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct GenerateAccountingTransferRequest {
|
||||
#[prost(string, tag = "1")]
|
||||
@@ -1375,6 +1437,35 @@ pub mod accounting_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Return a predvaha from one closed period's frozen account balances.
|
||||
/// Opening and closing signed balances are presented on their debit or credit
|
||||
/// side, while period turnover retains the journal's debit and credit columns.
|
||||
pub async fn get_trial_balance(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::GetTrialBalanceRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::GetTrialBalanceResponse>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
.ready()
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tonic::Status::unknown(
|
||||
format!("Service was not ready: {}", e.into()),
|
||||
)
|
||||
})?;
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/komp_ac.accounting.Accounting/GetTrialBalance",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new("komp_ac.accounting.Accounting", "GetTrialBalance"),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Materialize one row per directly transferable source account in a table
|
||||
/// containing an ACCOUNTING_TRANSFER definition. Source fields are frozen
|
||||
/// accounting facts; target fields start as an unchanged same-path copy and
|
||||
@@ -1631,6 +1722,16 @@ pub mod accounting_server {
|
||||
tonic::Response<super::ListPeriodBalancesResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Return a predvaha from one closed period's frozen account balances.
|
||||
/// Opening and closing signed balances are presented on their debit or credit
|
||||
/// side, while period turnover retains the journal's debit and credit columns.
|
||||
async fn get_trial_balance(
|
||||
&self,
|
||||
request: tonic::Request<super::GetTrialBalanceRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::GetTrialBalanceResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Materialize one row per directly transferable source account in a table
|
||||
/// containing an ACCOUNTING_TRANSFER definition. Source fields are frozen
|
||||
/// accounting facts; target fields start as an unchanged same-path copy and
|
||||
@@ -2573,6 +2674,51 @@ pub mod accounting_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.accounting.Accounting/GetTrialBalance" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct GetTrialBalanceSvc<T: Accounting>(pub Arc<T>);
|
||||
impl<
|
||||
T: Accounting,
|
||||
> tonic::server::UnaryService<super::GetTrialBalanceRequest>
|
||||
for GetTrialBalanceSvc<T> {
|
||||
type Response = super::GetTrialBalanceResponse;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::GetTrialBalanceRequest>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as Accounting>::get_trial_balance(&inner, request).await
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
}
|
||||
let accept_compression_encodings = self.accept_compression_encodings;
|
||||
let send_compression_encodings = self.send_compression_encodings;
|
||||
let max_decoding_message_size = self.max_decoding_message_size;
|
||||
let max_encoding_message_size = self.max_encoding_message_size;
|
||||
let inner = self.inner.clone();
|
||||
let fut = async move {
|
||||
let method = GetTrialBalanceSvc(inner);
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let mut grpc = tonic::server::Grpc::new(codec)
|
||||
.apply_compression_config(
|
||||
accept_compression_encodings,
|
||||
send_compression_encodings,
|
||||
)
|
||||
.apply_max_message_size_config(
|
||||
max_decoding_message_size,
|
||||
max_encoding_message_size,
|
||||
);
|
||||
let res = grpc.unary(method, req).await;
|
||||
Ok(res)
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.accounting.Accounting/GenerateAccountingTransfer" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct GenerateAccountingTransferSvc<T: Accounting>(pub Arc<T>);
|
||||
|
||||
2
server
2
server
Submodule server updated: 61f373ee5c...48d6b1cd08
Reference in New Issue
Block a user