fix some revisi

This commit is contained in:
Jagad R R
2025-01-19 14:57:01 +07:00
parent 430700bc59
commit 1610d83bc6
17 changed files with 562 additions and 477 deletions
@@ -149,7 +149,21 @@
{
extend: 'excel',
text: 'Export Excel',
buttons: ['excel', 'csv', 'pdf', 'print', 'colvis'],
customize: function (xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
// Add additional information to the Excel sheet
var additionalInfo = `
Cabang: {{ $cabang->name }}
Periode: {{ ucfirst($month) }} {{ $year }}
Cost Centre: {{ $cabang->cost->code }}
`;
var rows = additionalInfo.split('\n').map(function (text) {
return `<row><c t="inlineStr"><is><t>${text.trim()}</t></is></c></row>`;
}).join('');
// Inject the additional information at the top of the sheet
var data = $(sheet).find('sheetData').prepend(rows);
}
},
{
extend: 'csv',
@@ -157,11 +171,10 @@
customize: function (csv) {
// Add header information to the CSV
var additionalInfo = `
Cabang: {{ $cabang->name }}
Periode: {{ ucfirst($month) }} {{ $year }}
Cost Centre: {{ $cabang->cost->code }}
`;
Cabang: {{ $cabang->name }}
Periode: {{ ucfirst($month) }} {{ $year }}
Cost Centre: {{ $cabang->cost->code }}
`;
return additionalInfo + csv;
}
},