Created
February 7, 2018 05:02
-
-
Save awolad/2c596eb5e97b06584c545e2b17277c8f to your computer and use it in GitHub Desktop.
Add subtotal row for tally calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("table.report-fix-table tr.unique_tr_for_sub_total").each(function () { | |
var currentTd = $(this).find('td:nth-child(2)').text() | |
var nextTd = $(this).next().find('td:nth-child(2)').text() | |
if (currentTd != nextTd) { | |
$(this).after( | |
'<tr class="unique_tr_for_sub_total">' + | |
'<td style="border: none;border-left: 1px solid #dddcdc;"></td>' + | |
/*'<td style="border: none;"></td>' +*/ | |
'<td style="border: none;"></td>' + | |
'<td style="border: none;"></td>' + | |
'<td style="border: none;"><strong>Sub Total: </strong></td>' + | |
'<td class="sub_total" style="text-align: right!important;"><strong></strong></td>' + | |
'</tr>' | |
); | |
} | |
tally('td.sub_total', 'receive_amount') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment