jsdoc.reconcile¶
File: biweeklybudget/flaskapp/static/js/reconcile.js
-
clean_fitid
(fitid)¶ Given an OFXTransaction fitid, return a “clean” (alphanumeric) version of it, suitable for use as an HTML element id.
Arguments: - fitid (String) – original, unmodified OFXTransaction fitid.
-
makeTransFromOfx
(acct_id, fitid)¶ Link function to create a Transaction from a specified OFXTransaction, and then reconcile them.
Arguments: - acct_id (Integer) – the OFXTransaction account ID
- fitid (String) – the OFXTransaction fitid
-
makeTransSaveCallback
(data, acct_id, fitid)¶ Callback for the “Save” button on the Transaction modal created by
makeTransFromOfx()
. Displays the new Transaction at the bottom of the Transactions list, then reconciles it with the original OFXTransactionArguments: - data (Object) – response data from POST to /forms/transaction
- acct_id (Integer) – the OFXTransaction account ID
- fitid (String) – the OFXTransaction fitid
-
reconcileDoUnreconcile
(trans_id, acct_id, fitid)¶ Unreconcile a reconciled OFXTransaction/Transaction. This removes
trans_id
from thereconciled
variable, empties the Transaction div’s reconciled div, and shows the OFX div.Arguments: - trans_id (Integer) – the transaction id
- acct_id (Integer) – the account id
- fitid (String) – the FITID
-
reconcileDoUnreconcileNoOfx
(trans_id)¶ Unreconcile a reconciled NoOFX Transaction. This removes
trans_id
from thereconciled
variable and empties the Transaction div’s reconciled div.Arguments: - trans_id (Integer) – the transaction id
-
reconcileGetOFX
()¶ Show unreconciled OFX transactions in the proper div. Empty the div, then load transactions via ajax. Uses
reconcileShowOFX()
as the ajax callback.
-
reconcileGetTransactions
()¶ Show unreconciled transactions in the proper div. Empty the div, then load transactions via ajax. Uses
reconcileShowTransactions()
as the ajax callback.
-
reconcileHandleSubmit
()¶ Handle click of the Submit button on the reconcile view. This POSTs to
/ajax/reconcile
via ajax. Feedback is provided by appending a div with idreconcile-msg
todiv#notifications-row/div.col-lg-12
.
-
reconcileOfxDiv
(trans)¶ Generate a div for an individual OFXTransaction, to display on the reconcile view.
Arguments: - ofxtrans (Object) – ajax JSON object representing one OFXTransaction
-
reconcileShowOFX
(data)¶ Ajax callback handler for
reconcileGetOFX()
. Display the returned data in the proper div.Arguments: - data (Object) – ajax response (JSON array of OFXTransaction Objects)
-
reconcileShowTransactions
(data)¶ Ajax callback handler for
reconcileGetTransactions()
. Display the returned data in the proper div.Sets each Transaction div as
droppable
, usingreconcileTransHandleDropEvent()
as the drop event handler andreconcileTransDroppableAccept()
to test if a draggable is droppable on the element.Arguments: - data (Object) – ajax response (JSON array of Transaction Objects)
-
reconcileTransDiv
(trans)¶ Generate a div for an individual Transaction, to display on the reconcile view.
Arguments: - trans (Object) – ajax JSON object representing one Transaction
-
reconcileTransDroppableAccept
(drag)¶ Accept function for droppables, to determine if a given draggable can be dropped on it.
Arguments: - drag (Object) – the draggable element being dropped.
-
reconcileTransHandleDropEvent
(event, ui)¶ Handler for Drop events on reconcile Transaction divs. Setup as handler via
reconcileShowTransactions()
. This just gets the draggable and the target from theevent
andui
, and then passes them on toreconcileTransactions()
.Arguments: - event (Object) – the drop event
- ui (Object) – the UI element, containing the draggable
-
reconcileTransNoOfx
(trans_id, note)¶ Reconcile a Transaction without a matching OFXTransaction. Called from the Save button handler in
transNoOfx()
.
-
reconcileTransactions
(ofx_div, target)¶ Reconcile a transaction; move the divs and other elements as necessary, and updated the
reconciled
variable.Arguments: - ofx_div (Object) – the OFXTransaction div element (draggable)
- target (Object) – the Transaction div (drop target)
-
transModalOfxFillAndShow
(data)¶ Callback for the GET /ajax/ofx/<acct_id>/<fitid> from
makeTransFromOfx()
. Receives the OFXTransaction data and populates it into the Transaction modal form.Arguments: - data (Object) – OFXTransaction response data
-
transNoOfx
(trans_id)¶ Show the modal for reconciling a Transaction without a matching OFXTransaction. Calls
transNoOfxDivForm()
to generate the modal form div content. Uses an inline function to handle the save action, which callsreconcileTransNoOfx()
to perform the reconcile action.Arguments: - trans_id (number) – the ID of the Transaction
-
transNoOfxDivForm
(trans_id)¶ Generate the modal form div content for the modal to reconcile a Transaction without a matching OFXTransaction. Called by
transNoOfx()
.Arguments: - trans_id (number) – the ID of the Transaction
-
updateReconcileTrans
(trans_id)¶ Trigger update of a single Transaction on the reconcile page.
Arguments: - trans_id (Integer) – the Transaction ID to update.