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.
-
ignoreOfxTrans(acct_id, fitid)¶ Show the modal for reconciling an OFXTransaction without a matching Transaction. Calls
ignoreOfxTransDivForm()to generate the modal form div content. Uses an inline function to handle the save action, which callsreconcileOfxNoTrans()to perform the reconcile action.Arguments: - acct_id (number) – the Account ID of the OFXTransaction
- fitid (string) – the FitID of the OFXTransaction
-
ignoreOfxTransDivForm(acct_id, fitid)¶ Generate the modal form div content for the modal to reconcile a Transaction without a matching OFXTransaction. Called by
transNoOfx().Arguments: - acct_id (number) – the Account ID of the OFXTransaction
- fitid (string) – the FitID of the OFXTransaction
-
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_idfrom thereconciledvariable, 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_idfrom thereconciledvariable and empties the Transaction div’s reconciled div.Arguments: - trans_id (Integer) – the transaction id
-
reconcileDoUnreconcileNoTrans(acct_id, fitid)¶ Unreconcile a reconciled NoTrans OFXTransaction. This removes
acct_id + "%" + fitidfrom theofxIgnoredvariable and regenerates the OFXTransaction’s div.Arguments: - acct_id (number) – the Account ID of the OFXTransaction
- fitid (string) – the FitID of the OFXTransaction
-
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/reconcilevia ajax. Feedback is provided by appending a div with idreconcile-msgtodiv#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
-
reconcileOfxNoTrans(acct_id, fitid, note)¶ Reconcile an OFXTransaction without a matching Transaction. Called from the Save button handler in
ignoreOfxTrans().
-
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. Called from
reconcileShowTransactions(),makeTransSaveCallback()andupdateReconcileTrans().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 theeventandui, 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
reconciledvariable.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.