pub struct SqliteGeneralLedgerRepository { /* private fields */ }Available on crate feature
sqlite only.Implementations§
Source§impl SqliteGeneralLedgerRepository
impl SqliteGeneralLedgerRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl GeneralLedgerRepository for SqliteGeneralLedgerRepository
impl GeneralLedgerRepository for SqliteGeneralLedgerRepository
Source§fn create_account(&self, input: CreateGlAccount) -> Result<GlAccount>
fn create_account(&self, input: CreateGlAccount) -> Result<GlAccount>
Create a GL account
Source§fn get_account_by_number(
&self,
account_number: &str,
) -> Result<Option<GlAccount>>
fn get_account_by_number( &self, account_number: &str, ) -> Result<Option<GlAccount>>
Get account by account number
Source§fn update_account(&self, id: Uuid, input: UpdateGlAccount) -> Result<GlAccount>
fn update_account(&self, id: Uuid, input: UpdateGlAccount) -> Result<GlAccount>
Update account
Source§fn list_accounts(&self, filter: GlAccountFilter) -> Result<Vec<GlAccount>>
fn list_accounts(&self, filter: GlAccountFilter) -> Result<Vec<GlAccount>>
List accounts (Chart of Accounts)
Source§fn get_account_hierarchy(&self) -> Result<Vec<GlAccount>>
fn get_account_hierarchy(&self) -> Result<Vec<GlAccount>>
Get account hierarchy (parent-child)
Source§fn initialize_chart_of_accounts(&self) -> Result<Vec<GlAccount>>
fn initialize_chart_of_accounts(&self) -> Result<Vec<GlAccount>>
Initialize default Chart of Accounts
Source§fn create_period(&self, input: CreateGlPeriod) -> Result<GlPeriod>
fn create_period(&self, input: CreateGlPeriod) -> Result<GlPeriod>
Create a GL period
Source§fn get_period_for_date(&self, date: NaiveDate) -> Result<Option<GlPeriod>>
fn get_period_for_date(&self, date: NaiveDate) -> Result<Option<GlPeriod>>
Get period for a date
Source§fn list_periods(&self, filter: GlPeriodFilter) -> Result<Vec<GlPeriod>>
fn list_periods(&self, filter: GlPeriodFilter) -> Result<Vec<GlPeriod>>
List periods
Source§fn lock_period(&self, id: Uuid, locked_by: &str) -> Result<GlPeriod>
fn lock_period(&self, id: Uuid, locked_by: &str) -> Result<GlPeriod>
Lock a period (prevents any changes)
Source§fn create_journal_entry(
&self,
input: CreateJournalEntry,
) -> Result<JournalEntry>
fn create_journal_entry( &self, input: CreateJournalEntry, ) -> Result<JournalEntry>
Create a journal entry
Source§fn get_journal_entry(&self, id: Uuid) -> Result<Option<JournalEntry>>
fn get_journal_entry(&self, id: Uuid) -> Result<Option<JournalEntry>>
Get journal entry by ID
Source§fn get_journal_entry_by_number(
&self,
number: &str,
) -> Result<Option<JournalEntry>>
fn get_journal_entry_by_number( &self, number: &str, ) -> Result<Option<JournalEntry>>
Get journal entry by number
Source§fn list_journal_entries(
&self,
filter: JournalEntryFilter,
) -> Result<Vec<JournalEntry>>
fn list_journal_entries( &self, filter: JournalEntryFilter, ) -> Result<Vec<JournalEntry>>
List journal entries
Source§fn post_journal_entry(&self, id: Uuid, posted_by: &str) -> Result<JournalEntry>
fn post_journal_entry(&self, id: Uuid, posted_by: &str) -> Result<JournalEntry>
Post a journal entry (update account balances)
Source§fn void_journal_entry(&self, id: Uuid) -> Result<JournalEntry>
fn void_journal_entry(&self, id: Uuid) -> Result<JournalEntry>
Void a journal entry
Source§fn reverse_journal_entry(
&self,
id: Uuid,
reversal_date: NaiveDate,
) -> Result<JournalEntry>
fn reverse_journal_entry( &self, id: Uuid, reversal_date: NaiveDate, ) -> Result<JournalEntry>
Reverse a journal entry (creates reversing entry)
Source§fn get_journal_entry_lines(
&self,
journal_entry_id: Uuid,
) -> Result<Vec<JournalEntryLine>>
fn get_journal_entry_lines( &self, journal_entry_id: Uuid, ) -> Result<Vec<JournalEntryLine>>
Get journal entry lines
Source§fn get_auto_posting_config(&self) -> Result<Option<AutoPostingConfig>>
fn get_auto_posting_config(&self) -> Result<Option<AutoPostingConfig>>
Get active auto-posting config
Source§fn set_auto_posting_config(
&self,
input: CreateAutoPostingConfig,
) -> Result<AutoPostingConfig>
fn set_auto_posting_config( &self, input: CreateAutoPostingConfig, ) -> Result<AutoPostingConfig>
Create/update auto-posting config
Source§fn auto_post_invoice(&self, invoice_id: InvoiceId) -> Result<JournalEntry>
fn auto_post_invoice(&self, invoice_id: InvoiceId) -> Result<JournalEntry>
Auto-post invoice creation (DR AR / CR Revenue)
Source§fn auto_post_payment_received(&self, payment_id: Uuid) -> Result<JournalEntry>
fn auto_post_payment_received(&self, payment_id: Uuid) -> Result<JournalEntry>
Auto-post payment received (DR Cash / CR AR)
Source§fn auto_post_bill(&self, bill_id: Uuid) -> Result<JournalEntry>
fn auto_post_bill(&self, bill_id: Uuid) -> Result<JournalEntry>
Auto-post bill creation (DR Expense / CR AP)
Source§fn auto_post_bill_payment(&self, payment_id: Uuid) -> Result<JournalEntry>
fn auto_post_bill_payment(&self, payment_id: Uuid) -> Result<JournalEntry>
Auto-post bill payment (DR AP / CR Cash)
Source§fn auto_post_inventory_cost(
&self,
cost_transaction_id: Uuid,
) -> Result<JournalEntry>
fn auto_post_inventory_cost( &self, cost_transaction_id: Uuid, ) -> Result<JournalEntry>
Auto-post inventory cost transaction (DR/CR Inventory/COGS)
Source§fn auto_post_write_off(&self, write_off_id: Uuid) -> Result<JournalEntry>
fn auto_post_write_off(&self, write_off_id: Uuid) -> Result<JournalEntry>
Auto-post write-off (DR Bad Debt / CR AR)
Source§fn get_trial_balance(&self, as_of_date: NaiveDate) -> Result<TrialBalance>
fn get_trial_balance(&self, as_of_date: NaiveDate) -> Result<TrialBalance>
Generate trial balance
Source§fn get_balance_sheet(&self, as_of_date: NaiveDate) -> Result<BalanceSheet>
fn get_balance_sheet(&self, as_of_date: NaiveDate) -> Result<BalanceSheet>
Generate balance sheet
Source§fn get_income_statement(
&self,
start_date: NaiveDate,
end_date: NaiveDate,
) -> Result<IncomeStatement>
fn get_income_statement( &self, start_date: NaiveDate, end_date: NaiveDate, ) -> Result<IncomeStatement>
Generate income statement
Source§fn get_account_balance(
&self,
account_id: Uuid,
_as_of_date: Option<NaiveDate>,
) -> Result<Option<Decimal>>
fn get_account_balance( &self, account_id: Uuid, _as_of_date: Option<NaiveDate>, ) -> Result<Option<Decimal>>
Get account balance (None if account is not found)
Source§fn get_account_transactions(
&self,
account_id: Uuid,
filter: JournalEntryFilter,
) -> Result<Vec<JournalEntryLine>>
fn get_account_transactions( &self, account_id: Uuid, filter: JournalEntryFilter, ) -> Result<Vec<JournalEntryLine>>
Get account transaction history
Source§fn run_period_close(
&self,
period_id: Uuid,
closed_by: &str,
) -> Result<JournalEntry>
fn run_period_close( &self, period_id: Uuid, closed_by: &str, ) -> Result<JournalEntry>
Run period close (creates closing entries)
Source§fn revalue(
&self,
as_of_date: NaiveDate,
base_currency: Option<Currency>,
) -> Result<RevaluationResult>
fn revalue( &self, as_of_date: NaiveDate, base_currency: Option<Currency>, ) -> Result<RevaluationResult>
Revalue foreign-currency account balances at the as-of exchange rate,
posting the net unrealized gain/loss as a balanced adjusting entry. Read more
fn create_accounts_batch( &self, inputs: Vec<CreateGlAccount>, ) -> Result<BatchResult<GlAccount>>
fn get_accounts_batch(&self, ids: Vec<Uuid>) -> Result<Vec<GlAccount>>
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteGeneralLedgerRepository
impl !UnwindSafe for SqliteGeneralLedgerRepository
impl Freeze for SqliteGeneralLedgerRepository
impl Send for SqliteGeneralLedgerRepository
impl Sync for SqliteGeneralLedgerRepository
impl Unpin for SqliteGeneralLedgerRepository
impl UnsafeUnpin for SqliteGeneralLedgerRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more