From 96fd43384a979dd51c4176e4011a4acbfb304452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Mon, 15 Feb 2021 22:58:58 +0300 Subject: [PATCH] fixed excel data format --- app/Exports/Banking/Transactions.php | 11 ++++++++++- app/Exports/Purchases/Payments.php | 11 ++++++++++- app/Exports/Sales/Revenues.php | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/Exports/Banking/Transactions.php b/app/Exports/Banking/Transactions.php index 90f4b342d..d2e7a0ffc 100644 --- a/app/Exports/Banking/Transactions.php +++ b/app/Exports/Banking/Transactions.php @@ -4,8 +4,10 @@ namespace App\Exports\Banking; use App\Abstracts\Export; use App\Models\Banking\Transaction as Model; +use Maatwebsite\Excel\Concerns\WithColumnFormatting; +use PhpOffice\PhpSpreadsheet\Style\NumberFormat; -class Transactions extends Export +class Transactions extends Export implements WithColumnFormatting { public function collection() { @@ -51,4 +53,11 @@ class Transactions extends Export 'reconciled', ]; } + + public function columnFormats(): array + { + return [ + 'B' => NumberFormat::FORMAT_DATE_YYYYMMDD, + ]; + } } diff --git a/app/Exports/Purchases/Payments.php b/app/Exports/Purchases/Payments.php index d5558f434..8acdbec9f 100644 --- a/app/Exports/Purchases/Payments.php +++ b/app/Exports/Purchases/Payments.php @@ -4,8 +4,10 @@ namespace App\Exports\Purchases; use App\Abstracts\Export; use App\Models\Banking\Transaction as Model; +use Maatwebsite\Excel\Concerns\WithColumnFormatting; +use PhpOffice\PhpSpreadsheet\Style\NumberFormat; -class Payments extends Export +class Payments extends Export implements WithColumnFormatting { public function collection() { @@ -45,4 +47,11 @@ class Payments extends Export 'reconciled', ]; } + + public function columnFormats(): array + { + return [ + 'A' => NumberFormat::FORMAT_DATE_YYYYMMDD, + ]; + } } diff --git a/app/Exports/Sales/Revenues.php b/app/Exports/Sales/Revenues.php index 12de9e077..47e7c6dfe 100644 --- a/app/Exports/Sales/Revenues.php +++ b/app/Exports/Sales/Revenues.php @@ -4,8 +4,10 @@ namespace App\Exports\Sales; use App\Abstracts\Export; use App\Models\Banking\Transaction as Model; +use Maatwebsite\Excel\Concerns\WithColumnFormatting; +use PhpOffice\PhpSpreadsheet\Style\NumberFormat; -class Revenues extends Export +class Revenues extends Export implements WithColumnFormatting { public function collection() { @@ -45,4 +47,11 @@ class Revenues extends Export 'reconciled', ]; } + + public function columnFormats(): array + { + return [ + 'A' => NumberFormat::FORMAT_DATE_YYYYMMDD, + ]; + } }