Update generate_jurnal.blade.php
This commit is contained in:
@@ -145,7 +145,55 @@
|
||||
$('#dataTable-table').DataTable({
|
||||
responsive: false,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Export Excel',
|
||||
buttons: ['excel', 'csv', 'pdf', 'print', 'colvis'],
|
||||
},
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'Export CSV',
|
||||
customize: function (csv) {
|
||||
// Add header information to the CSV
|
||||
var additionalInfo = `
|
||||
Cabang: {{ $cabang->name }}
|
||||
Periode: {{ ucfirst($month) }} {{ $year }}
|
||||
Cost Centre: {{ $cabang->cost->code }}
|
||||
|
||||
`;
|
||||
return additionalInfo + csv;
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: 'Export PDF',
|
||||
customize: function (doc) {
|
||||
// Add additional information to the PDF
|
||||
doc.content.splice(0, 0, {
|
||||
margin: [0, 0, 0, 12],
|
||||
alignment: 'left',
|
||||
table: {
|
||||
widths: ['*'],
|
||||
body: [
|
||||
[{ text: 'Cabang: {{ $cabang->name }}', style: 'header' }],
|
||||
[{ text: 'Periode: {{ ucfirst($month) }} {{ $year }}', style: 'header' }],
|
||||
[{ text: 'Cost Centre: {{ $cabang->cost->code }}', style: 'header' }]
|
||||
]
|
||||
},
|
||||
layout: 'noBorders'
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
text: 'Print'
|
||||
},
|
||||
{
|
||||
extend: 'colvis',
|
||||
text: 'Column Visibility'
|
||||
}
|
||||
],
|
||||
paging: false,
|
||||
info: false,
|
||||
pageLength: -1
|
||||
|
||||
Reference in New Issue
Block a user