Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Reconciliation: Cleared checkbox not working

Brett Johnson   ( User )

Commented 2 years ago

I found a post from about 11 months ago reporting the same behavior with no resolution. I have posted my findings there, but no response.

When I go in to reconcile an account, the "cleared" amount is always the total of all transactions for the date range regardless if they have the cleared checkbox or not. I have reproduced this in my private servers (both dev and prod) as well as on the Akaunting.com hosted service.

To reproduce, I create a company on the hosted service, added a transaction, in my case a Cash Payment of $100. I then created a new reconciliation for the Cash account, and the 1 transaction is listed. The Cleared total shows -$100, and a difference of -$100 even though the "Cleared" checkbox for that transaction is not checked.
Nothing seems to happen when I check or clear the "Cleared" checkbox.

I have tested in both the latest versions of FireFox and Chrome.

I put some debugging messages in the reconciliation.js, and there is an even that does trigger on change of the Cleared checkbox, calling the "onCalculate()" method (twice each click in fact). The method gets a list of transactions using this call:
let transactions = this.form.transactions;
This appears to return all the transactions on the form, regardless of the state of the checkbox.
The code then parses each transaction, determines if it's income or expense, again never looking to see if the Cleared checkbox is checked. Finally the code totals the income - expense and then adds that to the opening balance to get the cleared amount. Again, at no point is the state of the "Cleared" checkbox considered.

Up to this point, I have just been adjusting my transactions so they fall in the date range so the reconciliation always balanced for the period. I am now getting to the point where I have outstanding checks that haven't cleared so I can no longer reconcile my accounts. I could just keep moving the date of uncleared items so they don't fall in the reconciliation time frame, but that really defeats the purpose of having an accounting system.

I am willing to try and create a patch, but I have only been working with Laravel / VueJS for a couple of weeks now, and not fully comfortable on the development. My first inclination is to see if there is a way in VueJS / JavaScript to select only the transactions that are checked inside the onCalculate() method. My second idea is to switch the way the code is splitting the single transaction name on "_" (underscore) then reassembling the string using "-" (hyphen) to access the Transaction Amount. Instead, I am thinking it would make sense to use replace() "_" with "-", then use startsWith() to determine if it's income, or expense, then I would select the DOM Element, check the state (checked or unchecked) and if checked, then add the Amount to the appropriate Total (income or expense).

Not sure the best way to proceed. Any recommendations, or a patch would be greatly appreciated.

Brett Johnson   ( User )

Commented 2 years ago

I was able to get this working as expected:
in resources/assets/js/views/banking/reconciliations.js modify line 95 from:

if (!transactions[transaction]) {

to

if (transactions[transaction].length === 0) {

I will work on submitting a pull request.

Please login or register to leave a response.

Showing 1 to 2 of 2 discussions