');
} else {
$('#report_container').html('');
}
}
//leads report
$(document).ready(function() {
$('#lead-detail').DataTable( {
paging:false,
searching: true,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel'
]
} );
//returns reportx
$('#returns-sources-table').DataTable( {
paging:false,
searching: false,
dom: 'Bfrtip',
order: [[0, 'asc']],
ordering: true,
buttons: [
'copy', 'csv', 'excel'
]
} );
$('#returns-sub-ids-table').DataTable( {
paging:false,
searching: false,
dom: 'Bfrtip',
order: [[0, 'asc']],
ordering: true,
buttons: [
'copy', 'csv', 'excel'
]
} );
$('.returns-by-sub-id-reason').DataTable( {
paging:false,
searching: false,
order: [[0, 'desc']],
ordering: true
});
$('#returns-detail').DataTable( {
paging:false,
searching: false,
dom: 'Bfrtip',
order: [[0, 'desc']],
ordering: true,
buttons: [
'copy', 'csv', 'excel'
]
} );
//categories page
$('#categories-detail').DataTable( {
paging:false,
searching: false,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel'
]
} );
//fraud statistics
$('#fraud-statistics').DataTable({
paging: false,
searching: false,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel'
]
});
//zip coverage
$('#zip-list').DataTable({
paging: true,
pageLength: 50,
searching: false,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel'
]
});
/*
* common
*/
/*if ('' == 'multiple') {
$('#seller_id').prop('multiple', 'multiple');
}*/
if (hasSellerId && $('#seller_id').prop('multiple') == true) {
$('#seller_id').on('focusout', function () {
submitSearchForm();
});
} else if (hasSellerId) {
$('#seller_id').on('change', function () {
submitSearchForm();
});
}
if (hasDatePicker) {
$('#date').on('hide.daterangepicker', function() {
if ($('#seller_id').val() !== '0') {
$('#search_form').submit();
$('#report_container').html('');
}
});
}
/**
* for returns page only, only submit a new report
* if seller is chosen, date is always chosen by default
*/
$('#category').on('change', function() {
if ($('#seller_id').val() !== '0') {
$('#search_form').submit();
}
});
$('#buyer_code').on('change', function() {
if ($('#seller_id').val() !== '0') {
$('#search_form').submit();
}
});
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
$('[data-toggle="dropdown"').dropdown();
//manage-extranet-users
let workAddressReadWrite = $('#use_company_address');
if (workAddressReadWrite.val() == 1) {
setWorkAddressReadWrite(true);
}
workAddressReadWrite.on('change', function() {
if (workAddressReadWrite.val() == 1) {
setWorkAddressReadWrite(true)
} else {
setWorkAddressReadWrite(false)
}
});
});
//manage-extranet-users
/**
* if use company info make read only, else make editable
*
* @param trueFalse
*/
function setWorkAddressReadWrite(trueFalse)
{
$('#street').prop("readonly", trueFalse);
$('#city').prop("readonly", trueFalse);
$('#state').prop("readonly", trueFalse);
$('#zip').prop("readonly", trueFalse);
}