This commit is contained in:
Filipriec
2026-08-31 21:14:01 +02:00
parent 78db4ee75a
commit 81a41b9b1a
5 changed files with 190 additions and 2 deletions

Binary file not shown.

View File

@@ -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>);