diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index fbab3e728..8e1897b0d 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -195,7 +195,7 @@ abstract class Report public function export() { - return \Excel::download(new Export($this->views['content'], $this), $this->model->name . '.xlsx'); + return \Excel::download(new Export($this->views['content'], $this), \Str::filename($this->model->name) . '.xlsx'); } public function setYear() diff --git a/app/BulkActions/Purchases/Bills.php b/app/BulkActions/Purchases/Bills.php index ff97a6f65..2cc779925 100644 --- a/app/BulkActions/Purchases/Bills.php +++ b/app/BulkActions/Purchases/Bills.php @@ -73,6 +73,6 @@ class Bills extends BulkAction { $selected = $this->getSelectedInput($request); - return \Excel::download(new Export($selected), trans_choice('general.bills', 2) . '.xlsx'); + return \Excel::download(new Export($selected), \Str::filename(trans_choice('general.bills', 2)) . '.xlsx'); } } diff --git a/app/BulkActions/Purchases/Payments.php b/app/BulkActions/Purchases/Payments.php index 61d6b7b6b..770e0c8dc 100644 --- a/app/BulkActions/Purchases/Payments.php +++ b/app/BulkActions/Purchases/Payments.php @@ -31,6 +31,6 @@ class Payments extends BulkAction { $selected = $this->getSelectedInput($request); - return \Excel::download(new Export($selected), trans_choice('general.payments', 2) . '.xlsx'); + return \Excel::download(new Export($selected), \Str::filename(trans_choice('general.payments', 2)) . '.xlsx'); } } diff --git a/app/BulkActions/Purchases/Vendors.php b/app/BulkActions/Purchases/Vendors.php index 6d6418f5d..25d4eda9c 100644 --- a/app/BulkActions/Purchases/Vendors.php +++ b/app/BulkActions/Purchases/Vendors.php @@ -46,6 +46,6 @@ class Vendors extends BulkAction { $selected = $this->getSelectedInput($request); - return \Excel::download(new Export($selected), trans_choice('general.vendors', 2) . '.xlsx'); + return \Excel::download(new Export($selected), \Str::filename(trans_choice('general.vendors', 2)) . '.xlsx'); } } diff --git a/app/BulkActions/Sales/Customers.php b/app/BulkActions/Sales/Customers.php index f4bb8fa5b..7dcaeae23 100644 --- a/app/BulkActions/Sales/Customers.php +++ b/app/BulkActions/Sales/Customers.php @@ -46,6 +46,6 @@ class Customers extends BulkAction { $selected = $this->getSelectedInput($request); - return \Excel::download(new Export($selected), trans_choice('general.customers', 2) . '.xlsx'); + return \Excel::download(new Export($selected), \Str::filename(trans_choice('general.customers', 2)) . '.xlsx'); } } diff --git a/app/BulkActions/Sales/Invoices.php b/app/BulkActions/Sales/Invoices.php index d5d9ca2be..dee19f571 100644 --- a/app/BulkActions/Sales/Invoices.php +++ b/app/BulkActions/Sales/Invoices.php @@ -87,6 +87,6 @@ class Invoices extends BulkAction { $selected = $this->getSelectedInput($request); - return \Excel::download(new Export($selected), trans_choice('general.invoices', 2) . '.xlsx'); + return \Excel::download(new Export($selected), \Str::filename(trans_choice('general.invoices', 2)) . '.xlsx'); } } diff --git a/app/BulkActions/Sales/Revenues.php b/app/BulkActions/Sales/Revenues.php index 5aaae82d7..218694443 100644 --- a/app/BulkActions/Sales/Revenues.php +++ b/app/BulkActions/Sales/Revenues.php @@ -31,6 +31,6 @@ class Revenues extends BulkAction { $selected = $this->getSelectedInput($request); - return \Excel::download(new Export($selected), trans_choice('general.revenues', 2) . '.xlsx'); + return \Excel::download(new Export($selected), \Str::filename(trans_choice('general.revenues', 2)) . '.xlsx'); } } diff --git a/app/Http/Controllers/Banking/Transactions.php b/app/Http/Controllers/Banking/Transactions.php index bfa13b243..fe23cae88 100644 --- a/app/Http/Controllers/Banking/Transactions.php +++ b/app/Http/Controllers/Banking/Transactions.php @@ -84,6 +84,6 @@ class Transactions extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.transactions', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.transactions', 2)) . '.xlsx'); } } diff --git a/app/Http/Controllers/Common/Items.php b/app/Http/Controllers/Common/Items.php index cfc211a73..30f5312fd 100644 --- a/app/Http/Controllers/Common/Items.php +++ b/app/Http/Controllers/Common/Items.php @@ -235,7 +235,7 @@ class Items extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.items', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.items', 2)) . '.xlsx'); } public function autocomplete() diff --git a/app/Http/Controllers/Purchases/Bills.php b/app/Http/Controllers/Purchases/Bills.php index ede836a24..28d4ef0e1 100644 --- a/app/Http/Controllers/Purchases/Bills.php +++ b/app/Http/Controllers/Purchases/Bills.php @@ -268,7 +268,7 @@ class Bills extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.bills', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.bills', 2)) . '.xlsx'); } /** diff --git a/app/Http/Controllers/Purchases/Payments.php b/app/Http/Controllers/Purchases/Payments.php index 15c1e7263..2e7dd63ca 100644 --- a/app/Http/Controllers/Purchases/Payments.php +++ b/app/Http/Controllers/Purchases/Payments.php @@ -228,6 +228,6 @@ class Payments extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.payments', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.payments', 2)) . '.xlsx'); } } diff --git a/app/Http/Controllers/Purchases/Vendors.php b/app/Http/Controllers/Purchases/Vendors.php index cf4e83b1b..dde264772 100644 --- a/app/Http/Controllers/Purchases/Vendors.php +++ b/app/Http/Controllers/Purchases/Vendors.php @@ -277,7 +277,7 @@ class Vendors extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.vendors', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.vendors', 2)) . '.xlsx'); } public function currency(Contact $vendor) diff --git a/app/Http/Controllers/Sales/Customers.php b/app/Http/Controllers/Sales/Customers.php index 845b3164a..2ae5b08a9 100644 --- a/app/Http/Controllers/Sales/Customers.php +++ b/app/Http/Controllers/Sales/Customers.php @@ -283,7 +283,7 @@ class Customers extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.customers', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.customers', 2)) . '.xlsx'); } public function currency(Contact $customer) diff --git a/app/Http/Controllers/Sales/Invoices.php b/app/Http/Controllers/Sales/Invoices.php index bbdad8975..d22bee484 100644 --- a/app/Http/Controllers/Sales/Invoices.php +++ b/app/Http/Controllers/Sales/Invoices.php @@ -274,7 +274,7 @@ class Invoices extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.invoices', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.invoices', 2)) . '.xlsx'); } /** diff --git a/app/Http/Controllers/Sales/Revenues.php b/app/Http/Controllers/Sales/Revenues.php index 513d5e43d..33126a65b 100644 --- a/app/Http/Controllers/Sales/Revenues.php +++ b/app/Http/Controllers/Sales/Revenues.php @@ -228,6 +228,6 @@ class Revenues extends Controller */ public function export() { - return \Excel::download(new Export(), trans_choice('general.revenues', 2) . '.xlsx'); + return \Excel::download(new Export(), \Str::filename(trans_choice('general.revenues', 2)) . '.xlsx'); } } diff --git a/app/Providers/Macro.php b/app/Providers/Macro.php new file mode 100644 index 000000000..10103900d --- /dev/null +++ b/app/Providers/Macro.php @@ -0,0 +1,40 @@ +