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

fix(Trial Balance): limit lookup to FY #2569

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

jniles
Copy link
Collaborator

@jniles jniles commented Feb 24, 2018

This commit limits the Trial Balance lookup to only oldest fiscal year.

Closes #2568.

This commit limits the Trial Balance lookup to only oldest fiscal year.
It also fixes a grouping bug that summed the before total an extra time.
This lead to N * beginning_balance being reported for N transactions.

Closes Third-Culture-Software#2568.
Copy link
Collaborator

@mbayopanda mbayopanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a test locally with the test dataset the trial balance shows correct values.

it looks good to me 👍

GROUP BY u.account_id;

SELECT account_id, account.number AS number, account.label AS label,
balance_before, debit_equiv, credit_equiv,
balance_before + debit_equiv - credit_equiv AS balance_final
FROM (
SELECT posting_journal.account_id, SUM(totals.balance_before) AS balance_before, SUM(debit_equiv) AS debit_equiv,
SELECT posting_journal.account_id, MAX(totals.balance_before) AS balance_before, SUM(debit_equiv) AS debit_equiv,
Copy link
Collaborator

@mbayopanda mbayopanda Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix this MAX if it is required, in my test i cannot see the error with MAX

@mbayopanda
Copy link
Collaborator

bors r+

bors bot added a commit that referenced this pull request Feb 28, 2018
2569: fix(Trial Balance): limit lookup to FY r=mbayopanda a=jniles

This commit limits the Trial Balance lookup to only oldest fiscal year.

Closes #2568.
@bors
Copy link
Contributor

bors bot commented Feb 28, 2018

Build succeeded

@bors bors bot merged commit 16ce3c3 into Third-Culture-Software:master Feb 28, 2018
@jniles jniles deleted the fix-trial-balance-scope branch March 6, 2018 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants