Skip to content

Commit

Permalink
Invoice/Bill item stack resize td colspan
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Nov 7, 2018
1 parent f3b8af0 commit 2a0a565
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,13 @@ function convertDateFormat(date, split_character) {

return result.join(split_character);
}

function itemTableResize() {
colspan = $('#items.table.table-bordered thead tr th').length - 1;

$('#items.table.table-bordered tbody #addItem .text-right').attr('colspan', colspan);
$('#items.table.table-bordered tbody #tr-subtotal .text-right:first').attr('colspan', colspan);
$('#items.table.table-bordered tbody #tr-discount .text-right:first').attr('colspan', colspan);
$('#items.table.table-bordered tbody #tr-tax .text-right:first').attr('colspan', colspan);
$('#items.table.table-bordered tbody #tr-total .text-right:first').attr('colspan', colspan);
}
2 changes: 2 additions & 0 deletions resources/views/expenses/bills/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
});
$(document).ready(function(){
itemTableResize();
@if (old('item'))
$('#vendor_id').trigger('change');
@endif
Expand Down
2 changes: 2 additions & 0 deletions resources/views/expenses/bills/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@
});
$(document).ready(function(){
itemTableResize();
@if (old('item'))
$('#vendor_id').trigger('change');
@endif
Expand Down
2 changes: 2 additions & 0 deletions resources/views/incomes/invoices/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
});
$(document).ready(function(){
itemTableResize();
@if (old('item'))
$('#customer_id').trigger('change');
@endif
Expand Down
2 changes: 2 additions & 0 deletions resources/views/incomes/invoices/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@
});
$(document).ready(function(){
itemTableResize();
@if (old('item'))
$('#customer_id').trigger('change');
@endif
Expand Down

0 comments on commit 2a0a565

Please sign in to comment.