diff --git a/app/Http/Controllers/ChartController.php b/app/Http/Controllers/ChartController.php new file mode 100644 index 000000000000..bc0b254f8c27 --- /dev/null +++ b/app/Http/Controllers/ChartController.php @@ -0,0 +1,76 @@ +json([],200); + } + +} diff --git a/app/Http/Requests/Chart/ShowChartRequest.php b/app/Http/Requests/Chart/ShowChartRequest.php new file mode 100644 index 000000000000..0c510f1940ec --- /dev/null +++ b/app/Http/Requests/Chart/ShowChartRequest.php @@ -0,0 +1,34 @@ +user()->isAdmin(); + } + + public function rules() + { + return [ + ]; + } +} diff --git a/app/Services/Chart/ChartService.php b/app/Services/Chart/ChartService.php new file mode 100644 index 000000000000..f1cc714eec3b --- /dev/null +++ b/app/Services/Chart/ChartService.php @@ -0,0 +1,48 @@ +company = $company; + } + + public function getCurrencyCodes() + { + + $currencies = Payment::withTrashed() + ->where('company_id', $this->company->id) + ->where('is_deleted', 0) + ->distinct() + ->get(['currency_id']); + + $expense_currencies = Expense::withTrashed() + ->where('company_id', $this->company->id) + ->where('is_deleted', 0) + ->distinct() + ->get(['expense_currency_id']); + + + $currencies = $currencies->merge($expense_currencies)->unique(); + + + } + +}