Skip to content

Commit

Permalink
fix(voucher): prise en charge reference bug
Browse files Browse the repository at this point in the history
This commit fixes a bug in the prise en charge module due to naming
confusion of columns in the voucher table.
  • Loading branch information
Jonathan Niles authored and jniles committed Feb 15, 2017
1 parent 213eb97 commit 5b8fbad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/src/js/services/VoucherService.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function VoucherService(Api, $http, util, TransactionTypeStore) {
}

if (escapedItem.reference) {
escapedItem.reference_uuid = escapedItem.reference.uuid;
escapedItem.document_uuid = escapedItem.reference.uuid;
}

return escapedItem;
Expand Down
6 changes: 3 additions & 3 deletions client/src/partials/vouchers/modals/scanBarcode.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ function VoucherScanBarcodeController($state, Notify, Barcodes, Patients, Debtor
data.type_id = bhConstants.transactionType.SUPPORT_INCOME;

data.debit = {
debit : data.amount
debit : data.amount,
};

data.credit = {
account_id : data.group.account_id,
reference : data.invoice.uuid,
entity : data.patient.debtor_uuid,
reference : data.invoice,
entity : { uuid : data.patient.debtor_uuid },
credit: data.amount
};

Expand Down
3 changes: 3 additions & 0 deletions client/src/partials/vouchers/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ function SimpleJournalVoucherController(Vouchers, Accounts, Session, util, Notif
creditRow.configure(data.credit);
}

// HACK to get this to work. Why are vouchers so poorly designed?
creditRow.document_uuid = data.credit.reference.uuid;

vm.Voucher.validate();
});
}

0 comments on commit 5b8fbad

Please sign in to comment.