Bug 31038: Fix price formating in cashup summary
This patch uses the existing format_price JS include to format prices in the cashup summary modal Test plan 1) Create some transactions and a cashup 2) View the cashup summary modal and confirm amounts are not nicely formatted 3) Apply patch 4) Confirm amounts in cashup summary modals are now nicely formatted Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
4a9d5dd9a1
commit
f46b636d03
3 changed files with 6 additions and 4 deletions
|
@ -332,6 +332,7 @@
|
|||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
|
||||
[% INCLUDE 'format_price.inc' %]
|
||||
[% Asset.js("js/cashup_modal.js") | $raw %]
|
||||
[% INCLUDE 'calendar.inc' %]
|
||||
[% INCLUDE 'js-date-format.inc' %]
|
||||
|
|
|
@ -195,6 +195,7 @@
|
|||
|
||||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% INCLUDE 'format_price.inc' %]
|
||||
[% Asset.js("js/cashup_modal.js") | $raw %]
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
|
|
@ -16,19 +16,19 @@ $('#cashupSummaryModal').on('show.bs.modal', function(e) {
|
|||
var tbody = summary_modal.find('tbody')
|
||||
tbody.empty();
|
||||
for (out of data.summary.payout_grouped) {
|
||||
tbody.append('<tr><td>' + out.credit_type.description + '</td><td>- ' + out.total + '</td></tr>');
|
||||
tbody.append('<tr><td>' + out.credit_type.description + '</td><td>- ' + out.total.format_price() + '</td></tr>');
|
||||
}
|
||||
|
||||
for (income of data.summary.income_grouped) {
|
||||
tbody.append('<tr><td>' + income.debit_type.description + '</td><td>' + income.total + '</td></tr>');
|
||||
tbody.append('<tr><td>' + income.debit_type.description + '</td><td>' + income.total.format_price() + '</td></tr>');
|
||||
}
|
||||
|
||||
var tfoot = summary_modal.find('tfoot');
|
||||
tfoot.empty();
|
||||
tfoot.append('<tr><td>Total</td><td>' + data.summary.total + '</td></tr>');
|
||||
tfoot.append('<tr><td>Total</td><td>' + data.summary.total.format_price() + '</td></tr>');
|
||||
for (type of data.summary.total_grouped) {
|
||||
if (type.total !== 0) {
|
||||
tfoot.append('<tr><td>' + type.payment_type + '</td><td>' + type.total + '</td></tr>');
|
||||
tfoot.append('<tr><td>' + type.payment_type + '</td><td>' + type.total.format_price() + '</td></tr>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue