Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconciliations Do Not Save Properly #2611

Closed
BrianVB opened this issue Aug 30, 2022 · 1 comment
Closed

Reconciliations Do Not Save Properly #2611

BrianVB opened this issue Aug 30, 2022 · 1 comment
Labels
Milestone

Comments

@BrianVB
Copy link

BrianVB commented Aug 30, 2022

Akaunting version

3.0.6

PHP version

8.1.9

Operating system

Ubuntu 20.04

Steps to reproduce

Install Akaunting and install sample data using github repo instructions.

Create a new reconciliation and allow it to use the default values for the current month. Check all checkboxes and click 'Save as Draft'

Re-open the reconciliation after you saved it. None of the checkboxes are checked.

Expected result

All of the checkboxes that I checked when I saved it should be checked

Actual result

None of the checkboxes are checked.

Additional comments

The issue seems to be in (https://github.com/akaunting/akaunting/blob/master/app/Jobs/Banking/UpdateReconciliation.php#L30) when saving, each transaction will always be unreconciled because the GET param reconcile is always false.

From other tests I've done the reconcile will only be true if you click the 'Reconcile' button in the UI. But, that is only clickable if you have a perfect balance. So, it would appear something needs to be done so clicking the Save button still allows the checked items to be saved as reconciled.

Relevant log output

No response

@BrianVB
Copy link
Author

BrianVB commented Aug 30, 2022

I just want to cross-reference this issue (#2612) because I found these out at the same time while trying to troubleshoot the problems with reconciliations.

For some reason, the values submitted with the checkboxes change based on the status on page load and when submitting. If a checkbox is unchecked on page load and when submitting, it sends as null. If it is checked on page load and when submitting, the value is the number value of the transaction. If it is unchecked on page load but checked when submitting, it is string 'true'. If it is checked on page load an unchecked when submitting, it is string 'false'.

Based on all of that, If you change (https://github.com/akaunting/akaunting/blob/master/app/Jobs/Banking/UpdateReconciliation.php#L23):

if (empty($value)) {
    continue;
}

to:

$reconcile = empty($value) || $value === 'false' ?
    0 :
    1;

then it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants