mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-23 11:41:21 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a3b7d7c1a | ||
|
|
87f14617cc | ||
|
|
9f24f765ea | ||
|
|
48c802e5cc | ||
|
|
9c0893fa8c | ||
|
|
0dfb97c5f7 | ||
|
|
4b4384b1a8 | ||
|
|
9b10984d81 | ||
|
|
10a2a4cf5b | ||
|
|
d48e4c66b2 | ||
|
|
d357142075 | ||
|
|
2e7d339d7e | ||
|
|
6303b172b1 |
@@ -7,7 +7,9 @@ php:
|
|||||||
- 7
|
- 7
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- composer install
|
- composer selfupdate
|
||||||
|
- composer install --no-dev
|
||||||
|
- composer update
|
||||||
- php artisan env
|
- php artisan env
|
||||||
- mv -v .env.testing .env
|
- mv -v .env.testing .env
|
||||||
- php artisan env
|
- php artisan env
|
||||||
|
|||||||
@@ -175,10 +175,13 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
/** @var FiscalHelperInterface $fiscalHelper */
|
/** @var FiscalHelperInterface $fiscalHelper */
|
||||||
$fiscalHelper = app('FireflyIII\Helpers\FiscalHelperInterface');
|
$fiscalHelper = app('FireflyIII\Helpers\FiscalHelperInterface');
|
||||||
$start = clone $date;
|
$start = clone $date;
|
||||||
$end = Carbon::now();
|
$start->startOfMonth();
|
||||||
$months = [];
|
$end = Carbon::now();
|
||||||
|
$end->endOfMonth();
|
||||||
|
$months = [];
|
||||||
|
|
||||||
while ($start <= $end) {
|
while ($start <= $end) {
|
||||||
|
// current year:
|
||||||
$year = $fiscalHelper->endOfFiscalYear($start)->year;
|
$year = $fiscalHelper->endOfFiscalYear($start)->year;
|
||||||
|
|
||||||
if (!isset($months[$year])) {
|
if (!isset($months[$year])) {
|
||||||
@@ -193,6 +196,7 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
|
|
||||||
$currentEnd = clone $start;
|
$currentEnd = clone $start;
|
||||||
$currentEnd->endOfMonth();
|
$currentEnd->endOfMonth();
|
||||||
|
|
||||||
$months[$year]['months'][] = [
|
$months[$year]['months'][] = [
|
||||||
'formatted' => $start->formatLocalized('%B %Y'),
|
'formatted' => $start->formatLocalized('%B %Y'),
|
||||||
'start' => $start->format('Y-m-d'),
|
'start' => $start->format('Y-m-d'),
|
||||||
@@ -200,7 +204,10 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
'month' => $start->month,
|
'month' => $start->month,
|
||||||
'year' => $year,
|
'year' => $year,
|
||||||
];
|
];
|
||||||
$start->addMonth();
|
|
||||||
|
// to make the hop to the next month properly:
|
||||||
|
$start = clone $currentEnd;
|
||||||
|
$start->addDay();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $months;
|
return $months;
|
||||||
|
|||||||
@@ -341,6 +341,7 @@ class RuleController extends Controller
|
|||||||
$data = [
|
$data = [
|
||||||
'rule_group_id' => $repository->getFirstRuleGroup()->id,
|
'rule_group_id' => $repository->getFirstRuleGroup()->id,
|
||||||
'stop_processing' => 0,
|
'stop_processing' => 0,
|
||||||
|
'user_id' => Auth::user()->id,
|
||||||
'title' => trans('firefly.default_rule_name'),
|
'title' => trans('firefly.default_rule_name'),
|
||||||
'description' => trans('firefly.default_rule_description'),
|
'description' => trans('firefly.default_rule_description'),
|
||||||
'trigger' => 'store-journal',
|
'trigger' => 'store-journal',
|
||||||
@@ -373,7 +374,7 @@ class RuleController extends Controller
|
|||||||
|
|
||||||
if ($repository->count() === 0) {
|
if ($repository->count() === 0) {
|
||||||
$data = [
|
$data = [
|
||||||
'user' => Auth::user()->id,
|
'user_id' => Auth::user()->id,
|
||||||
'title' => trans('firefly.default_rule_group_name'),
|
'title' => trans('firefly.default_rule_group_name'),
|
||||||
'description' => trans('firefly.default_rule_group_description'),
|
'description' => trans('firefly.default_rule_group_description'),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class RuleGroupController extends Controller
|
|||||||
$data = [
|
$data = [
|
||||||
'title' => $request->input('title'),
|
'title' => $request->input('title'),
|
||||||
'description' => $request->input('description'),
|
'description' => $request->input('description'),
|
||||||
'user' => Auth::user()->id,
|
'user_id' => Auth::user()->id,
|
||||||
];
|
];
|
||||||
|
|
||||||
$ruleGroup = $repository->store($data);
|
$ruleGroup = $repository->store($data);
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
|
|||||||
|
|
||||||
$newRuleGroup = new RuleGroup(
|
$newRuleGroup = new RuleGroup(
|
||||||
[
|
[
|
||||||
'user_id' => $data['user'],
|
'user_id' => $data['user_id'],
|
||||||
'title' => $data['title'],
|
'title' => $data['title'],
|
||||||
'description' => $data['description'],
|
'description' => $data['description'],
|
||||||
'order' => ($order + 1),
|
'order' => ($order + 1),
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class Navigation
|
|||||||
'1W' => 'addWeek', 'week' => 'addWeek', 'weekly' => 'addWeek',
|
'1W' => 'addWeek', 'week' => 'addWeek', 'weekly' => 'addWeek',
|
||||||
'1M' => 'addMonth', 'month' => 'addMonth', 'monthly' => 'addMonth',
|
'1M' => 'addMonth', 'month' => 'addMonth', 'monthly' => 'addMonth',
|
||||||
'3M' => 'addMonths', 'quarter' => 'addMonths', 'quarterly' => 'addMonths', '6M' => 'addMonths', 'half-year' => 'addMonths',
|
'3M' => 'addMonths', 'quarter' => 'addMonths', 'quarterly' => 'addMonths', '6M' => 'addMonths', 'half-year' => 'addMonths',
|
||||||
'year' => 'addYear', 'yearly' => 'addYear',
|
'year' => 'addYear', 'yearly' => 'addYear', '1Y' => 'addYear',
|
||||||
];
|
];
|
||||||
$modifierMap = [
|
$modifierMap = [
|
||||||
'quarter' => 3,
|
'quarter' => 3,
|
||||||
@@ -82,6 +82,20 @@ class Navigation
|
|||||||
|
|
||||||
$subDay = ['week', 'weekly', '1W', 'month', 'monthly', '1M', '3M', 'quarter', 'quarterly', '6M', 'half-year', 'year', 'yearly'];
|
$subDay = ['week', 'weekly', '1W', 'month', 'monthly', '1M', '3M', 'quarter', 'quarterly', '6M', 'half-year', 'year', 'yearly'];
|
||||||
|
|
||||||
|
// if the range is custom, the end of the period
|
||||||
|
// is another X days (x is the difference between start)
|
||||||
|
// and end added to $theCurrentEnd
|
||||||
|
if ($repeatFreq == 'custom') {
|
||||||
|
/** @var Carbon $tStart */
|
||||||
|
$tStart = session('start', Carbon::now()->startOfMonth());
|
||||||
|
/** @var Carbon $tEnd */
|
||||||
|
$tEnd = session('end', Carbon::now()->endOfMonth());
|
||||||
|
$diffInDays = $tStart->diffInDays($tEnd);
|
||||||
|
$currentEnd->addDays($diffInDays);
|
||||||
|
|
||||||
|
return $currentEnd;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($functionMap[$repeatFreq])) {
|
if (!isset($functionMap[$repeatFreq])) {
|
||||||
throw new FireflyException('Cannot do endOfPeriod for $repeat_freq "' . $repeatFreq . '"');
|
throw new FireflyException('Cannot do endOfPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||||
}
|
}
|
||||||
@@ -152,6 +166,7 @@ class Navigation
|
|||||||
$formatMap = [
|
$formatMap = [
|
||||||
'1D' => '%e %B %Y',
|
'1D' => '%e %B %Y',
|
||||||
'daily' => '%e %B %Y',
|
'daily' => '%e %B %Y',
|
||||||
|
'custom' => '%e %B %Y',
|
||||||
'1W' => 'Week %W, %Y',
|
'1W' => 'Week %W, %Y',
|
||||||
'week' => 'Week %W, %Y',
|
'week' => 'Week %W, %Y',
|
||||||
'weekly' => 'Week %W, %Y',
|
'weekly' => 'Week %W, %Y',
|
||||||
@@ -163,6 +178,7 @@ class Navigation
|
|||||||
'1Y' => '%Y',
|
'1Y' => '%Y',
|
||||||
'year' => '%Y',
|
'year' => '%Y',
|
||||||
'yearly' => '%Y',
|
'yearly' => '%Y',
|
||||||
|
'6M' => '%B %Y',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -198,6 +214,7 @@ class Navigation
|
|||||||
'quarterly' => 'firstOfQuarter',
|
'quarterly' => 'firstOfQuarter',
|
||||||
'year' => 'startOfYear',
|
'year' => 'startOfYear',
|
||||||
'yearly' => 'startOfYear',
|
'yearly' => 'startOfYear',
|
||||||
|
'1Y' => 'startOfYear',
|
||||||
];
|
];
|
||||||
if (isset($functionMap[$repeatFreq])) {
|
if (isset($functionMap[$repeatFreq])) {
|
||||||
$function = $functionMap[$repeatFreq];
|
$function = $functionMap[$repeatFreq];
|
||||||
@@ -214,6 +231,11 @@ class Navigation
|
|||||||
|
|
||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
if ($repeatFreq === 'custom') {
|
||||||
|
return $date; // the date is already at the start.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
throw new FireflyException('Cannot do startOfPeriod for $repeat_freq "' . $repeatFreq . '"');
|
throw new FireflyException('Cannot do startOfPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,12 +261,15 @@ class Navigation
|
|||||||
'1M' => 'subMonths',
|
'1M' => 'subMonths',
|
||||||
'monthly' => 'subMonths',
|
'monthly' => 'subMonths',
|
||||||
'year' => 'subYears',
|
'year' => 'subYears',
|
||||||
|
'1Y' => 'subYears',
|
||||||
'yearly' => 'subYears',
|
'yearly' => 'subYears',
|
||||||
];
|
];
|
||||||
$modifierMap = [
|
$modifierMap = [
|
||||||
'quarter' => 3,
|
'quarter' => 3,
|
||||||
|
'3M' => 3,
|
||||||
'quarterly' => 3,
|
'quarterly' => 3,
|
||||||
'half-year' => 6,
|
'half-year' => 6,
|
||||||
|
'6M' => 6,
|
||||||
];
|
];
|
||||||
if (isset($functionMap[$repeatFreq])) {
|
if (isset($functionMap[$repeatFreq])) {
|
||||||
$function = $functionMap[$repeatFreq];
|
$function = $functionMap[$repeatFreq];
|
||||||
@@ -258,6 +283,18 @@ class Navigation
|
|||||||
|
|
||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
// a custom range requires the session start
|
||||||
|
// and session end to calculate the difference in days.
|
||||||
|
// this is then subtracted from $theDate (* $subtract).
|
||||||
|
if($repeatFreq === 'custom') {
|
||||||
|
/** @var Carbon $tStart */
|
||||||
|
$tStart = session('start', Carbon::now()->startOfMonth());
|
||||||
|
/** @var Carbon $tEnd */
|
||||||
|
$tEnd = session('end', Carbon::now()->endOfMonth());
|
||||||
|
$diffInDays = $tStart->diffInDays($tEnd);
|
||||||
|
$date->subDays($diffInDays * $subtract);
|
||||||
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq . '"');
|
throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'chart' => 'chartjs',
|
'chart' => 'chartjs',
|
||||||
'version' => '3.7.0',
|
'version' => '3.7.2.3',
|
||||||
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
|
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
|
||||||
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
|
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
|
||||||
'csv_import_enabled' => true,
|
'csv_import_enabled' => true,
|
||||||
|
|||||||
@@ -10,6 +10,17 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'text' => [
|
'text' => [
|
||||||
'3.7.0' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
|
'3.7.0' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
|
||||||
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0'],
|
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0',
|
||||||
|
'3.7.1' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
|
||||||
|
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0',
|
||||||
|
'3.7.2' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
|
||||||
|
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0',
|
||||||
|
'3.7.2.1' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
|
||||||
|
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0',
|
||||||
|
'3.7.2.2' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
|
||||||
|
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0',
|
||||||
|
'3.7.2.3' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
|
||||||
|
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ function preSelectDate(e) {
|
|||||||
"use strict";
|
"use strict";
|
||||||
var link = $(e.target);
|
var link = $(e.target);
|
||||||
var picker = $('#inputDateRange').data('daterangepicker');
|
var picker = $('#inputDateRange').data('daterangepicker');
|
||||||
picker.setStartDate(link.data('start'));
|
picker.setStartDate(moment(link.data('start'), "YYYY-MM-DD"));
|
||||||
picker.setEndDate(link.data('end'));
|
picker.setEndDate(moment(link.data('end'), "YYYY-MM-DD"));
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user