Skip to content

Commit

Permalink
close #3123 Fixed: 31st Dec not reflected in cash flow plot
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Feb 9, 2024
1 parent 226c75c commit e1c931f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/Traits/DateTime.php
Expand Up @@ -46,8 +46,8 @@ public function getStartAndEndDates($year = null): array
} else {
$financial_year = $this->getFinancialYear($year);

$start = $financial_year->copy()->getStartDate();
$end = $financial_year->copy()->getEndDate();
$start = $financial_year->copy()->getStartDate()->startOfDay();
$end = $financial_year->copy()->getEndDate()->endOfDay();
}

return [$start, $end];
Expand Down
4 changes: 2 additions & 2 deletions app/Widgets/CashFlow.php
Expand Up @@ -76,8 +76,8 @@ public function setFilter(): void
{
$financial_year = $this->getFinancialYear();

$this->start_date = Date::parse(request('start_date', $financial_year->copy()->getStartDate()->toDateString()));
$this->end_date = Date::parse(request('end_date', $financial_year->copy()->getEndDate()->toDateString()));
$this->start_date = Date::parse(request('start_date', $financial_year->copy()->getStartDate()->toDateString()))->startOfDay();
$this->end_date = Date::parse(request('end_date', $financial_year->copy()->getEndDate()->toDateString()))->endOfDay();
$this->period = request('period', 'month');
}

Expand Down
4 changes: 2 additions & 2 deletions app/Widgets/Payables.php
Expand Up @@ -40,8 +40,8 @@ public function show()
$arr[2] = '9999';
}

$start = Date::today()->subDays($arr[2])->toDateString() . ' 00:00:00';
$end = Date::today()->subDays($arr[1])->toDateString() . ' 23:59:59';
$start = Date::today()->subDays($arr[2])->startOfDay()->toDateString();
$end = Date::today()->subDays($arr[1])->endOfDay()->toDateString();

if (! Date::parse($bill->due_at)->isBetween($start, $end)) {
continue;
Expand Down
4 changes: 2 additions & 2 deletions app/Widgets/ProfitLoss.php
Expand Up @@ -53,8 +53,8 @@ public function setFilter(): void
{
$financial_year = $this->getFinancialYear();

$this->start_date = Date::parse(request('start_date', $financial_year->copy()->getStartDate()->toDateString()));
$this->end_date = Date::parse(request('end_date', $financial_year->copy()->getEndDate()->toDateString()));
$this->start_date = Date::parse(request('start_date', $financial_year->copy()->getStartDate()->toDateString()))->startOfDay();
$this->end_date = Date::parse(request('end_date', $financial_year->copy()->getEndDate()->toDateString()))->endOfDay();
$this->period = request('period', 'month');
}

Expand Down
4 changes: 2 additions & 2 deletions app/Widgets/Receivables.php
Expand Up @@ -40,8 +40,8 @@ public function show()
$arr[2] = '9999';
}

$start = Date::today()->subDays($arr[2])->toDateString() . ' 00:00:00';
$end = Date::today()->subDays($arr[1])->toDateString() . ' 23:59:59';
$start = Date::today()->subDays($arr[2])->startOfDay()->toDateString();
$end = Date::today()->subDays($arr[1])->endOfDay()->toDateString();

if (! Date::parse($invoice->due_at)->isBetween($start, $end)) {
continue;
Expand Down

0 comments on commit e1c931f

Please sign in to comment.