Excel column formatting for exports
This commit is contained in:
@@ -5,8 +5,10 @@ namespace App\Exports\Banking;
|
||||
use App\Abstracts\Export;
|
||||
use App\Models\Banking\Transfer as Model;
|
||||
use App\Utilities\Date;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class Transfers extends Export
|
||||
class Transfers extends Export implements WithColumnFormatting
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
@@ -57,4 +59,11 @@ class Transfers extends Export
|
||||
'reference',
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_DATE_YYYYMMDD,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ namespace App\Exports\Purchases\Sheets;
|
||||
|
||||
use App\Abstracts\Export;
|
||||
use App\Models\Banking\Transaction as Model;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class BillTransactions extends Export
|
||||
class BillTransactions extends Export implements WithColumnFormatting
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
@@ -51,4 +53,11 @@ class BillTransactions extends Export
|
||||
'reconciled',
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_DATE_YYYYMMDD,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ namespace App\Exports\Purchases\Sheets;
|
||||
|
||||
use App\Abstracts\Export;
|
||||
use App\Models\Purchase\Bill as Model;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class Bills extends Export
|
||||
class Bills extends Export implements WithColumnFormatting
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
@@ -46,4 +48,12 @@ class Bills extends Export
|
||||
'footer',
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'D' => NumberFormat::FORMAT_DATE_YYYYMMDD,
|
||||
'E' => NumberFormat::FORMAT_DATE_YYYYMMDD,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ namespace App\Exports\Sales\Sheets;
|
||||
|
||||
use App\Abstracts\Export;
|
||||
use App\Models\Banking\Transaction as Model;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class InvoiceTransactions extends Export
|
||||
class InvoiceTransactions extends Export implements WithColumnFormatting
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
@@ -51,4 +53,11 @@ class InvoiceTransactions extends Export
|
||||
'reconciled',
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_DATE_YYYYMMDD,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ namespace App\Exports\Sales\Sheets;
|
||||
|
||||
use App\Abstracts\Export;
|
||||
use App\Models\Sale\Invoice as Model;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class Invoices extends Export
|
||||
class Invoices extends Export implements WithColumnFormatting
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
@@ -46,4 +48,12 @@ class Invoices extends Export
|
||||
'footer',
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'D' => NumberFormat::FORMAT_DATE_YYYYMMDD,
|
||||
'E' => NumberFormat::FORMAT_DATE_YYYYMMDD,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user