libdrcr: Make Unclassified Statement Line Credits/Debits not a magic string

This commit is contained in:
RunasSudo 2025-06-10 20:05:44 +10:00
parent 6b029a086b
commit bed32b0d54
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 5 additions and 3 deletions

View File

@ -14,3 +14,5 @@ pub type QuantityInt = i64;
// TODO: Make this configurable
pub const CURRENT_YEAR_EARNINGS: &'static str = "Current Year Earnings";
pub const RETAINED_EARNINGS: &'static str = "Retained Earnings";
pub const UNCLASSIFIED_STATEMENT_LINE_CREDITS: &'static str = "Unclassified Statement Line Credits";
pub const UNCLASSIFIED_STATEMENT_LINE_DEBITS: &'static str = "Unclassified Statement Line Debits";

View File

@ -31,7 +31,7 @@ use crate::model::transaction::{
};
use crate::reporting::types::{BalancesAt, DateStartDateEndArgs, ReportingProductId, Transactions};
use crate::util::{get_eofy, sofy_from_eofy};
use crate::QuantityInt;
use crate::{QuantityInt, UNCLASSIFIED_STATEMENT_LINE_CREDITS, UNCLASSIFIED_STATEMENT_LINE_DEBITS};
use super::calculator::ReportingGraphDependencies;
use super::dynamic_report::{entries_for_kind, DynamicReport, DynamicReportEntry, Row, Section};
@ -1238,9 +1238,9 @@ impl ReportingStep for PostUnreconciledStatementLines {
for line in unreconciled_statement_lines {
let unclassified_account = if line.quantity >= 0 {
"Unclassified Statement Line Debits"
UNCLASSIFIED_STATEMENT_LINE_DEBITS
} else {
"Unclassified Statement Line Credits"
UNCLASSIFIED_STATEMENT_LINE_CREDITS
};
transactions.transactions.push(TransactionWithPostings {
transaction: Transaction {