C# Class BudgetAnalyser.Engine.Ledger.LedgerCalculation

ファイルを表示 Open project: Benrnz/BudgetAnalyser Class Usage Examples

Public Methods

Method Description
CalculateCurrentMonthBucketSpend ( [ ledgerBook, [ filter, [ statement, [ bucketCode ) : decimal

Calculates the current month bucket spend.

CalculateCurrentMonthLedgerBalances ( [ ledgerBook, [ filter, [ statement ) : decimal>.IDictionary

Calculates the current month ledger balances.

CalculateCurrentMonthSurplusBalance ( [ ledgerBook, [ filter, [ statement ) : decimal

Calculates the current month surplus balance.

CalculateOverspentLedgers ( [ statement, [ ledger, System.DateTime beginDate ) : IEnumerable

Finds any overspent ledgers for the month and returns the date and value the of the total overspend. This resulting collection can then be used to subtract from Surplus. Overdrawn ledgers are supplemented from Surplus. Negative values indicate overdrawn ledgers.

LedgerCalculation ( ) : System

Initializes a new instance of the LedgerCalculation class.

LedgerCalculation ( ILogger logger ) : System

Initializes a new instance of the LedgerCalculation class.

LocateApplicableLedgerBalance ( [ ledgerBook, [ filter, string bucketCode ) : decimal

Locates the most recent LedgerEntryLine for the given date filter. Note that this will only return the most recent line that fits the criteria.

LocateApplicableLedgerLine ( LedgerBook ledgerBook, System.DateTime beginDate ) : LedgerEntryLine

Locates the applicable ledger line.

LocateApplicableLedgerLine ( LedgerBook ledgerBook, [ filter ) : LedgerEntryLine

Locates the applicable ledger line.

Private Methods

Method Description
BuildCacheKey ( object dependency1, object dependency2, System.DateTime dependentDate ) : string
CalculateLedgersBalanceSummary ( LedgerBook ledgerBook, System.DateTime beginDate, StatementModel statement ) : decimal>.Dictionary
CalculateTransactionTotal ( System.DateTime beginDate, [ statement, [ entryLine, string bucketCode ) : decimal
CheckCacheForCleanUp ( ) : void
GetOrAddFromCache ( string cacheKey, Func factory ) : object
LocateLedgerEntryLine ( LedgerBook ledgerBook, System.DateTime begin, System.DateTime end ) : LedgerEntryLine
ProcessOverdrawnLedgers ( decimal>.Dictionary runningBalances, decimal>.Dictionary previousBalances, List overSpendTransactions, System.DateTime currentDate ) : void

Method Details

CalculateCurrentMonthBucketSpend() public method

Calculates the current month bucket spend.
///
public CalculateCurrentMonthBucketSpend ( [ ledgerBook, [ filter, [ statement, [ bucketCode ) : decimal
ledgerBook [
filter [
statement [
bucketCode [
return decimal

CalculateCurrentMonthLedgerBalances() public method

Calculates the current month ledger balances.
///
public CalculateCurrentMonthLedgerBalances ( [ ledgerBook, [ filter, [ statement ) : decimal>.IDictionary
ledgerBook [
filter [
statement [
return decimal>.IDictionary

CalculateCurrentMonthSurplusBalance() public method

Calculates the current month surplus balance.
///
public CalculateCurrentMonthSurplusBalance ( [ ledgerBook, [ filter, [ statement ) : decimal
ledgerBook [
filter [
statement [
return decimal

CalculateOverspentLedgers() public method

Finds any overspent ledgers for the month and returns the date and value the of the total overspend. This resulting collection can then be used to subtract from Surplus. Overdrawn ledgers are supplemented from Surplus. Negative values indicate overdrawn ledgers.
public CalculateOverspentLedgers ( [ statement, [ ledger, System.DateTime beginDate ) : IEnumerable
statement [
ledger [
beginDate System.DateTime
return IEnumerable

LedgerCalculation() public method

Initializes a new instance of the LedgerCalculation class.
public LedgerCalculation ( ) : System
return System

LedgerCalculation() public method

Initializes a new instance of the LedgerCalculation class.
public LedgerCalculation ( ILogger logger ) : System
logger ILogger
return System

LocateApplicableLedgerBalance() public method

Locates the most recent LedgerEntryLine for the given date filter. Note that this will only return the most recent line that fits the criteria.
public LocateApplicableLedgerBalance ( [ ledgerBook, [ filter, string bucketCode ) : decimal
ledgerBook [
filter [
bucketCode string
return decimal

LocateApplicableLedgerLine() public method

Locates the applicable ledger line.
public LocateApplicableLedgerLine ( LedgerBook ledgerBook, System.DateTime beginDate ) : LedgerEntryLine
ledgerBook LedgerBook
beginDate System.DateTime
return LedgerEntryLine

LocateApplicableLedgerLine() public method

Locates the applicable ledger line.
public LocateApplicableLedgerLine ( LedgerBook ledgerBook, [ filter ) : LedgerEntryLine
ledgerBook LedgerBook
filter [
return LedgerEntryLine