mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 00:34:35 -04:00
Work on paying bulk invoices
This commit is contained in:
parent
c55d4f1b5b
commit
434d4a46d7
@ -52,7 +52,6 @@ class InvoiceController extends Controller
|
|||||||
return '<input type="checkbox" name="hashed_ids[]" value="'. $invoice->hashed_id .'"/>';
|
return '<input type="checkbox" name="hashed_ids[]" value="'. $invoice->hashed_id .'"/>';
|
||||||
})
|
})
|
||||||
->editColumn('status_id', function ($invoice){
|
->editColumn('status_id', function ($invoice){
|
||||||
Log::error($invoice->status);
|
|
||||||
return Invoice::badgeForStatus($invoice->status);
|
return Invoice::badgeForStatus($invoice->status);
|
||||||
})
|
})
|
||||||
->rawColumns(['checkbox', 'action', 'status_id'])
|
->rawColumns(['checkbox', 'action', 'status_id'])
|
||||||
|
@ -14,8 +14,16 @@
|
|||||||
|
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
|
|
||||||
{!! Former::dark_button(ctrans('texts.download'))->addClass('download_invoices') !!}
|
<div class="btn-group">
|
||||||
{!! Former::success_button(ctrans('texts.pay_now'))->addClass('pay_invoices') !!}
|
<button type="button" class="btn btn-success" id="pay_invoices">{{ ctrans('texts.pay_now') }}</button>
|
||||||
|
<button type="button" class="btn btn-success dropdown-toggle dropdown-toggle-split" id="pay_invoices_drop" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
<span class="sr-only">Toggle Dropdown</span>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<a class="dropdown-item" id="download_invoices" href="#">{{ctrans('texts.download')}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<select class="form-control" style="width: 220px;" id="statuses" name="client_status[]" multiple="multiple">
|
<select class="form-control" style="width: 220px;" id="statuses" name="client_status[]" multiple="multiple">
|
||||||
<option value="paid">{{ ctrans('texts.status_paid') }}</option>
|
<option value="paid">{{ ctrans('texts.status_paid') }}</option>
|
||||||
@ -111,20 +119,21 @@ $(function() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
var searchTimeout = false;
|
||||||
|
var selected = [];
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
var searchTimeout = false;
|
toggleButtonGroup();
|
||||||
|
|
||||||
$('.pay_invoices').attr("disabled", true);
|
|
||||||
$('.download_invoices').attr("disabled", true);
|
|
||||||
|
|
||||||
$("#datatable").on('change', 'input[type=checkbox]', function() {
|
$("#datatable").on('change', 'input[type=checkbox]', function() {
|
||||||
var selected = [];
|
selected = [];
|
||||||
$.each($("input[name='hashed_ids[]']:checked"), function(){
|
$.each($("input[name='hashed_ids[]']:checked"), function(){
|
||||||
|
|
||||||
selected.push($(this).val());
|
selected.push($(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
toggleButtonGroup();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#table_filter').on('keyup', function(){
|
$('#table_filter').on('keyup', function(){
|
||||||
@ -140,7 +149,7 @@ $(document).ready(function() {
|
|||||||
$(this).closest('table').find(':checkbox:not(:disabled)').prop('checked', this.checked);
|
$(this).closest('table').find(':checkbox:not(:disabled)').prop('checked', this.checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.pay_invoices').click(function() {
|
$('.btn .btn-success .pay_invoices').click(function() {
|
||||||
alert('pay');
|
alert('pay');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -148,8 +157,26 @@ $(document).ready(function() {
|
|||||||
alert('download');
|
alert('download');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function toggleButtonGroup()
|
||||||
|
{
|
||||||
|
if(selected.length == 0)
|
||||||
|
{
|
||||||
|
$('#pay_invoices').addClass('disabled');
|
||||||
|
$('#pay_invoices_drop').addClass('disabled');
|
||||||
|
$('#download_invoices').addClass('disabled');
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#pay_invoices').removeClass('disabled');
|
||||||
|
$('#pay_invoices_drop').removeClass('disabled');
|
||||||
|
$('#download_invoices').removeClass('disabled');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function filterTable() {
|
function filterTable() {
|
||||||
|
|
||||||
table_filter = $('#table_filter').val();
|
table_filter = $('#table_filter').val();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user