Skip to content

Commit

Permalink
feat(debtors): List the account in the Debtor Group's list (#1613)
Browse files Browse the repository at this point in the history
- Update request for list account adding property account number
- Update interface for debtor group list`
  • Loading branch information
lomamech authored and jniles committed May 8, 2017
1 parent 71206e2 commit 72aa815
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions client/src/modules/debtors/groups.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<div class="row">
<div class="col-md-6">
<h4 style="margin-top : 0px;"><span ng-if="debtorGroup.locked" class="fa fa-lock text-danger"></span> <b>{{debtorGroup.name}}</b></h4>
<h5 style="margin-top : 0px;"></span><span translate> FORM.LABELS.ACCOUNT_NUMBER </span> : <b>{{debtorGroup.account_number}}</b></h5>
</div>
<div class="col-md-6 text-float-util">
<a data-method="update" ui-sref="debtorGroups.update({uuid : debtorGroup.uuid})" class=""><span class="fa fa-pencil-square-o" aria-hidden="true"></span> <span translate>DEBTOR_GROUP.EDIT</span></a>
Expand Down
8 changes: 5 additions & 3 deletions server/controllers/finance/debtors/groups/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ function list(req, res, next) {
* (SELECT COUNT(uuid) from debtor where group_uuid = debtor_group.uuid) as total_debtors
*/
sql = `
SELECT BUID(debtor_group.uuid) as uuid, name, account_id, BUID(location_id) as location_id, phone, email, note,
locked, max_credit, is_convention, BUID(price_list_uuid) as price_list_uuid, debtor_group.created_at,
apply_subsidies, apply_discounts, apply_billing_services, COUNT(debtor.uuid) as total_debtors
SELECT BUID(debtor_group.uuid) as uuid, debtor_group.name, debtor_group.account_id, BUID(debtor_group.location_id) as location_id,
debtor_group.phone, debtor_group.email, debtor_group.note, debtor_group.locked, debtor_group.max_credit, debtor_group.is_convention,
BUID(debtor_group.price_list_uuid) as price_list_uuid, debtor_group.created_at, debtor_group.apply_subsidies, debtor_group.apply_discounts,
debtor_group.apply_billing_services, COUNT(debtor.uuid) as total_debtors, account.number AS account_number
FROM debtor_group
JOIN account ON account.id = debtor_group.account_id
LEFT JOIN debtor
ON debtor.group_uuid = debtor_group.uuid
`;
Expand Down

0 comments on commit 72aa815

Please sign in to comment.