Documentation ¶
Overview ¶
Package reconcile provides functionality for reconciling entries imported from a bank with existing entries that have not yet been reconciled.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChanges ¶
func GetChanges(reconciled []*fin.Entry) *findb.EntryChanges
GetChanges returns the changes needed to add / reconcile the entries from the bank. reconciled are the entries from the bank that have been reconciled. That is, the bank entries in reconciled that match an existing entry in the datastore will have a non-zero Id field
Types ¶
type AmountCheckNo ¶
AmountCheckNo is a key consisting of amount and check number. To be reconciled, entries must be organized by amount and check number.
type ByAmountCheckNo ¶
type ByAmountCheckNo map[AmountCheckNo][]*fin.Entry
The entries organized by amount and check number. Under each key, the entries are sorted by date in descending order. An empty instance of this type can be used as an aggregator. See the aggregators package. Note that methods of this type change the Id field of the fin.Entry values in place through the pointers.
func New ¶
func New(entries []*fin.Entry) ByAmountCheckNo
New creates a new ByAmountCheckNo from existing entries. Note that the returned instance has methods that change the Id field of the fin.Entry structures of entries in place through the pointers as no defensive copying is done.
func (ByAmountCheckNo) Include ¶
func (b ByAmountCheckNo) Include(e *fin.Entry)
func (ByAmountCheckNo) Reconcile ¶
func (b ByAmountCheckNo) Reconcile(unreconciled ByAmountCheckNo, maxDays int)
Reconcile reconciles the entries from the bank in this instance with the the existing, unreconciled entries in unreconciled. When Reconcile returns, the Id field of each entry in this instance matches the ID field of the entry it reconciles with in unreconciled. If an entry in this instance does not reconcile with any entry, then its ID field is set to zero. maxDays is the maximum days allowed between entries reconciled together that lack a check number.