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

Sort the Voucher Receipt's lines by Account Number #2221

Closed
jniles opened this issue Oct 19, 2017 · 0 comments · Fixed by #2252
Closed

Sort the Voucher Receipt's lines by Account Number #2221

jniles opened this issue Oct 19, 2017 · 0 comments · Fixed by #2252
Assignees

Comments

@jniles
Copy link
Contributor

jniles commented Oct 19, 2017

The receipt produced by any voucher has the tendency to be quite complex. It is hard to read as well, because the lines tend to be printed in a nonsensical order. See below for an example:

voucherreceipt
Fig 1: Voucher Receipt with Multiple Lines

This can easily be solved by sorting by account. This will (at minimum) group the debtor lines by arranging them with the 41 and 42s clumped together.

Note that you should sort by account number, and not account_id. The account_id is not guaranteed to be in order.

@jniles jniles self-assigned this Oct 26, 2017
jniles added a commit to jniles/bhima that referenced this issue Oct 26, 2017
This commit fixes the voucher receipt by sorting the lines first by
account, then by amounts, and finally by the entity affected.  This
should ensure a fairly stable appearance to all receipts, no matter how
the accountant ordered the transaction initially or in what order the
database decided to enter them.

Closes IMA-WorldHealth#2221.
bors bot added a commit that referenced this issue Oct 27, 2017
2252: fix(vouchers): sort receipt items r=DedrickEnc a=jniles

This commit fixes the voucher receipt by sorting the lines first by account, then by amounts, and finally by the entity affected.  This should ensure a fairly stable appearance to all receipts, no matter how the accountant ordered the transaction initially or in what order the database decided to enter them.

Closes #2221.

**Unordered Voucher Items (prior to this change)**
![unorderedvouchers](https://user-images.githubusercontent.com/896472/32049987-263725a6-ba47-11e7-94fa-65e9a40132cd.png)

**Ordered Voucher Items (after this change)**
![orderedvouchers](https://user-images.githubusercontent.com/896472/32050008-335b08b0-ba47-11e7-94ee-3800bc14e55d.png)
@bors bors bot closed this as completed in #2252 Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant