Add location to account.

This commit is contained in:
James Cole
2019-12-28 19:49:33 +01:00
parent 950b706e7c
commit 021d421c6f
7 changed files with 155 additions and 42 deletions

View File

@@ -99,7 +99,7 @@ class ShowController extends Controller
if ($end < $start) {
[$start, $end] = [$end, $start]; // @codeCoverageIgnore
}
$location = $account->locations()->first();
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
$today = new Carbon;
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
@@ -128,7 +128,7 @@ class ShowController extends Controller
'accounts.show',
compact(
'account', 'showAll', 'objectType', 'currency', 'today', 'periods', 'subTitleIcon', 'groups', 'subTitle', 'start', 'end',
'chartUri'
'chartUri', 'location'
)
);
}

View File

@@ -67,6 +67,11 @@ class AccountFormRequest extends Request
'interest' => $this->string('interest'),
'interest_period' => $this->string('interest_period'),
'include_net_worth' => '1',
// new: location
'longitude' => $this->float('location_longitude'),
'latitude' => $this->float('location_latitude'),
'zoom_level' => $this->integer('location_zoomlevel'),
'has_location' => $this->boolean('location_has_tag'),
];
if (false === $this->boolean('include_net_worth')) {
$data['include_net_worth'] = '0';