Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk
2022-10-24 17:42:35 +03:00
26 changed files with 417 additions and 165 deletions

View File

@@ -150,7 +150,7 @@ abstract class Report
public function applySearchStringFilter($event)
{
$input = request('search');
$input = request('search', '');
// Remove year as it's handled based on financial start
$search_year = 'year:' . $this->getSearchStringValue('year', '', $input);

View File

@@ -56,6 +56,10 @@ abstract class Report
public $loaded = false;
public $bar_formatter_type = 'money';
public $donut_formatter_type = 'percent';
public $chart = [
'bar' => [
'colors' => [
@@ -310,12 +314,12 @@ abstract class Report
continue;
}
$this->chart[$table_key]['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter();
$this->chart[$table_key]['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter('percent');
$this->chart[$table_key]['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->bar_formatter_type);
$this->chart[$table_key]['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->donut_formatter_type);
}
} else {
$this->chart['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter();
$this->chart['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter('percent');
$this->chart['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->bar_formatter_type);
$this->chart['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->donut_formatter_type);
}
}

View File

@@ -8,16 +8,12 @@ trait SearchString
* Get the value of a name in search string
* Example: search=type:customer year:2020 account_id:20
* Example: issued_at>=2021-02-01 issued_at<=2021-02-10 account_id:49
*
* @return string|array
*/
public function getSearchStringValue($name, $default = '', $input = null)
public function getSearchStringValue(string $name, string $default = '', string $input = ''): string|array
{
$value = $default;
if (is_null($input)) {
$input = request('search');
}
$input = $input ?: request('search', '');
// $manager = $this->getSearchStringManager();
// $parsed = $manager->parse($input);
@@ -30,14 +26,14 @@ trait SearchString
if (empty($variable[0]) || ($variable[0] != $name) || empty($variable[1])) {
continue;
}
if (strpos($column, ':')) {
$value = $variable[1];
break;
}
if (!is_array($value)) {
if (! is_array($value)) {
$value = [];
}