|
|
@@ -129,9 +129,12 @@
|
|
|
data-bs-content="Visualizza ricevuta"><i class="fa-regular fa-eye"></i></button>
|
|
|
@endif
|
|
|
@if($record->status == 0)
|
|
|
- <a target="_blank" class="btn u" href="/in?new=1&memberId={{$record->member_id}}&causalId=&subCausalId=&createSubscription=&months={{implode("|", json_decode($record->months))}}&price={{$record->price}}&subscription_price=&courseId={{$record->member_course_id}}&rateId={{$record->id}}" data-bs-toggle="popover"
|
|
|
+ <a class="btn u" href="/in?new=1&memberId={{$record->member_id}}&causalId={{!$record->is_subscription ? $record->member_course->course->causal_id : ''}}&subCausalId={{$record->is_subscription ? $record->member_course->course->sub_causal_id : ''}}&createSubscription={{$record->is_subscription ? '1' : ''}}&months={{implode("|", json_decode($record->months))}}&price={{!$record->is_subscription ? $record->price : ''}}&subscription_price={{$record->is_subscription ? $record->price : ''}}&courseId={{$record->member_course_id}}&rateId={{$record->id}}" data-bs-toggle="popover"
|
|
|
data-bs-trigger="hover focus" data-bs-placement="bottom"
|
|
|
data-bs-content="Crea entrata"><i class="fa-regular fa-file-lines"></i></a>
|
|
|
+ <a class="btn u" onclick="confirmDelete({{$record->id}})" data-bs-toggle="popover"
|
|
|
+ data-bs-trigger="hover focus" data-bs-placement="bottom"
|
|
|
+ data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
|
|
|
@endif
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -244,160 +247,33 @@
|
|
|
@push('scripts')
|
|
|
<script>
|
|
|
|
|
|
- /*
|
|
|
- $(document).ready(function () {
|
|
|
- loadDataTable();
|
|
|
- });
|
|
|
-
|
|
|
- $('.filterStatus').select2({ "language": { "noResults": function () { return "Nessun risultato"; } } });
|
|
|
- $('.filterMember').select2({
|
|
|
- "language": { "noResults": function () { return "Nessun risultato"; } }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- Livewire.on('load-data-table', () => {
|
|
|
- $('.filterStatus').select2({ "language": { "noResults": function () { return "Nessun risultato"; } } });
|
|
|
- $('.filterMember').select2({ "language": { "noResults": function () { return "Nessun risultato"; } } });
|
|
|
+ function confirmDelete(id)
|
|
|
+ {
|
|
|
+ if (confirm('Confermi di voler eliminare la rata?'))
|
|
|
+ {
|
|
|
+ @this.delete(id);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
loadDataTable();
|
|
|
- });
|
|
|
+ } );
|
|
|
|
|
|
Livewire.on('load-data-table', () => {
|
|
|
- setTimeout(function () { loadDataTable() }, 100);
|
|
|
- });
|
|
|
-
|
|
|
- Livewire.on('destroy-data-table', () => {
|
|
|
- $('#tablesaw-350').DataTable().destroy();
|
|
|
- });
|
|
|
-
|
|
|
- function destroyDataTable() {
|
|
|
- $('#tablesaw-350').DataTable().destroy();
|
|
|
- }
|
|
|
-
|
|
|
- var isFilter = false;
|
|
|
- $(document).ready(function () {
|
|
|
- $(document).on("click", ".showHideFilter", function () {
|
|
|
- if (isFilter) {
|
|
|
- isFilter = false;
|
|
|
- $(".showFilter").hide();
|
|
|
- }
|
|
|
- else {
|
|
|
- isFilter = true;
|
|
|
- $(".showFilter").show();
|
|
|
- }
|
|
|
- });
|
|
|
+ loadDataTable();
|
|
|
});
|
|
|
|
|
|
- function sendMail(id) {
|
|
|
- $.get("/receipt/mail/" + id, function (data, status) {
|
|
|
- alert('Mail inviata');
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- @if(isset($_GET["showFilters"]))
|
|
|
- var filterStatus = localStorage.getItem("filterStatusReceipt");
|
|
|
- if (filterStatus) {
|
|
|
- $('.filterStatus').val(filterStatus).trigger('change');
|
|
|
- }
|
|
|
- var filterFrom = localStorage.getItem("filterFromReceipt");
|
|
|
- if (filterFrom) {
|
|
|
- $('input[name="txtFrom"]').val(filterFrom);
|
|
|
- }
|
|
|
- var filterTo = localStorage.getItem("filterToReceipt");
|
|
|
- if (filterTo) {
|
|
|
- $('input[name="txtTo"]').val(filterFrom);
|
|
|
- }
|
|
|
- var filterMember = localStorage.getItem("filterMemberReceipt");
|
|
|
- if (filterMember) {
|
|
|
- $('.filterMember').val(filterMember).trigger('change');
|
|
|
- }
|
|
|
- @endif
|
|
|
-
|
|
|
- function reset() {
|
|
|
- $(".todayButton").addClass("lightGrey");
|
|
|
- $(".yesterdayButton").addClass("lightGrey");
|
|
|
- $('.filterStatus').val(null).trigger("change");
|
|
|
- $('.filterMember').val(null).trigger("change");
|
|
|
- $('.filterFrom').val('');
|
|
|
- $('.filterTo').val('');
|
|
|
- destroyDataTable();
|
|
|
- loadDataTable();
|
|
|
- }
|
|
|
-
|
|
|
- function loadDataTable() {
|
|
|
-
|
|
|
- if ($.fn.DataTable.isDataTable('#tablesaw-350')) {
|
|
|
+ function loadDataTable(){
|
|
|
+ if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
|
|
|
$('#tablesaw-350').DataTable().destroy();
|
|
|
}
|
|
|
-
|
|
|
- var filterStatus = $('.filterStatus').val();
|
|
|
- localStorage.setItem("filterStatusReceipt", filterStatus);
|
|
|
-
|
|
|
- var filterFrom = $('.filterFrom').val();
|
|
|
- localStorage.setItem("filterFromReceipt", filterFrom);
|
|
|
-
|
|
|
- var filterTo = $('.filterTo').val();
|
|
|
- localStorage.setItem("filterToReeipt", filterTo);
|
|
|
-
|
|
|
- var filterMember = $('.filterMember').val();
|
|
|
- localStorage.setItem("filterMemberReceipt", filterMember);
|
|
|
-
|
|
|
$('#tablesaw-350').DataTable({
|
|
|
- serverSide: true,
|
|
|
- ajax: {
|
|
|
- url: '/get_receipts?filterStatus=' + filterStatus + '&filterFrom=' + filterFrom + '&filterTo=' + filterTo + '&filterMember=' + filterMember,
|
|
|
- dataSrc: function (json) {
|
|
|
- if (json.totals) {
|
|
|
- totals = json.totals;
|
|
|
- }
|
|
|
- return json.data;
|
|
|
- }
|
|
|
- },
|
|
|
thead: {
|
|
|
- 'th': { 'background-color': 'blue' }
|
|
|
+ 'th': {'background-color': 'blue'}
|
|
|
},
|
|
|
- columns: [
|
|
|
- {
|
|
|
- data: 'year'
|
|
|
- },
|
|
|
- {
|
|
|
- data: 'number'
|
|
|
- },
|
|
|
- {
|
|
|
- data: 'last_name'
|
|
|
- },
|
|
|
- {
|
|
|
- data: 'first_name'
|
|
|
- },
|
|
|
- {
|
|
|
- data: "status",
|
|
|
- render: function (data) {
|
|
|
- // Split class and text
|
|
|
- var ret = '<span class="tablesaw-cell-content"><span class="badge tessera-badge ' + (data == 1 ? 'active' : 'suspended') + '">' + (data == 1 ? 'Attiva' : 'Annullata') + '</span></span>';
|
|
|
- return ret;
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- data: 'date'
|
|
|
- },
|
|
|
- {
|
|
|
- data: 'totals'
|
|
|
- },
|
|
|
- {
|
|
|
- data: "action",
|
|
|
- render: function (data) {
|
|
|
- var ids = data.split("|");
|
|
|
- // Split class and text
|
|
|
- var ret = '<button type="button" class="btn u" onclick="document.location.href=' + "'" + '/in?id=' + ids[1] + "&from=receipts'" + '" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Visualizza ricevuta"><i class="fa-regular fa-eye"></i></button>';
|
|
|
- ret += '<a target="_blank" class="btn u" href="/receipt/' + ids[0] + '" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Stampa ricevuta"><i class="fa-regular fa-file-lines"></i></a>';
|
|
|
- ret += '<a target="_blank" class="btn u" onclick="sendMail(' + ids[0] + ')"><i class="fa-regular fa-envelope" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Invia email"></i></a>';
|
|
|
- return ret;
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
layout: {
|
|
|
- topStart: null,
|
|
|
- topEnd: null,
|
|
|
+ topStart : null,
|
|
|
+ topEnd : null,
|
|
|
top1A: {
|
|
|
buttons: [
|
|
|
{
|
|
|
@@ -405,23 +281,23 @@
|
|
|
text: 'ESPORTA',
|
|
|
buttons: [
|
|
|
{
|
|
|
- extend: 'excelHtml5', "action": newexportaction,
|
|
|
- title: 'Ricevute',
|
|
|
+ extend: 'excelHtml5',
|
|
|
+ title: 'Metodi di pagamento',
|
|
|
exportOptions: {
|
|
|
columns: ":not(':last')"
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- extend: 'pdfHtml5', "action": newexportaction,
|
|
|
- title: 'Ricevute',
|
|
|
+ extend: 'pdfHtml5',
|
|
|
+ title: 'Metodi di pagamento',
|
|
|
exportOptions: {
|
|
|
columns: ":not(':last')"
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- extend: 'print', "action": newexportaction,
|
|
|
+ extend: 'print',
|
|
|
text: 'Stampa',
|
|
|
- title: 'Ricevute',
|
|
|
+ title: 'Metodi di pagamento',
|
|
|
exportOptions: {
|
|
|
columns: ":not(':last')"
|
|
|
}
|
|
|
@@ -431,36 +307,32 @@
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- top1B: {
|
|
|
+ top1B : {
|
|
|
pageLength: {
|
|
|
menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
|
|
|
}
|
|
|
},
|
|
|
- top1C: 'search',
|
|
|
+ top1C :'search',
|
|
|
},
|
|
|
- order: [[0, 'desc'], [1, 'asc']],
|
|
|
pagingType: 'numbers',
|
|
|
"language": {
|
|
|
"url": "/assets/js/Italian.json"
|
|
|
},
|
|
|
"fnInitComplete": function (oSettings, json) {
|
|
|
- var html = ' <a href="#" class="showHideFilter btn--ui"><i class="fa-solid fa-sliders"></i></a>';
|
|
|
+ var html = ' <a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
|
|
|
$(".dt-search").append(html);
|
|
|
}
|
|
|
});
|
|
|
$('#tablesaw-350 thead tr th').addClass('col');
|
|
|
$('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
|
|
|
- $('#tablesaw-350').on('draw.dt', function () {
|
|
|
- $('[data-bs-toggle="popover"]').popover()
|
|
|
- });
|
|
|
|
|
|
- $(document).ready(function () {
|
|
|
- $(document).on("click", ".addData", function () {
|
|
|
+ $(document).ready(function() {
|
|
|
+ $(document).on("click",".addData",function() {
|
|
|
$(".title--section_addButton").trigger("click")
|
|
|
});
|
|
|
- });
|
|
|
+ } );
|
|
|
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
</script>
|
|
|
@endpush
|