mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 04:19:12 +00:00
Expand JSON.
This commit is contained in:
@@ -173,6 +173,7 @@ class Json implements JsonInterface
|
|||||||
$to = $entry->transactions[1]->account;
|
$to = $entry->transactions[1]->account;
|
||||||
$budget = $entry->budgets()->first();
|
$budget = $entry->budgets()->first();
|
||||||
$category = $entry->categories()->first();
|
$category = $entry->categories()->first();
|
||||||
|
$recurring = $entry->recurringTransaction()->first();
|
||||||
$arr = [
|
$arr = [
|
||||||
'date' => $entry->date->format('j F Y'),
|
'date' => $entry->date->format('j F Y'),
|
||||||
'description' => [
|
'description' => [
|
||||||
@@ -195,15 +196,20 @@ class Json implements JsonInterface
|
|||||||
'delete' => route('transactions.delete', $entry->id)
|
'delete' => route('transactions.delete', $entry->id)
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
if($budget) {
|
if ($budget) {
|
||||||
$arr['components']['budget_id'] = $budget->id;
|
$arr['components']['budget_id'] = $budget->id;
|
||||||
$arr['components']['budget_name'] = $budget->name;
|
$arr['components']['budget_name'] = $budget->name;
|
||||||
$arr['components']['budget_url'] = route('budgets.show',$budget->id);
|
$arr['components']['budget_url'] = route('budgets.show', $budget->id);
|
||||||
}
|
}
|
||||||
if($category) {
|
if ($category) {
|
||||||
$arr['components']['category_id'] = $category->id;
|
$arr['components']['category_id'] = $category->id;
|
||||||
$arr['components']['category_name'] = $category->name;
|
$arr['components']['category_name'] = $category->name;
|
||||||
$arr['components']['category_url'] = route('categories.show',$category->id);
|
$arr['components']['category_url'] = route('categories.show', $category->id);
|
||||||
|
}
|
||||||
|
if ($recurring) {
|
||||||
|
$arr['components']['recurring_id'] = $recurring->id;
|
||||||
|
$arr['components']['recurring_name'] = e($recurring->name);
|
||||||
|
$arr['components']['recurring_url'] = route('recurring.show', $recurring->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['data'][] = $arr;
|
$data['data'][] = $arr;
|
||||||
@@ -351,8 +357,8 @@ class Json implements JsonInterface
|
|||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$data['data'][] = [
|
$data['data'][] = [
|
||||||
|
|
||||||
'name' => ['name' => $entry->name,'url' => route('recurring.show',$entry->id)],
|
'name' => ['name' => $entry->name, 'url' => route('recurring.show', $entry->id)],
|
||||||
'match' => explode(' ',$entry->match),
|
'match' => explode(' ', $entry->match),
|
||||||
'amount_max' => floatval($entry->amount_max),
|
'amount_max' => floatval($entry->amount_max),
|
||||||
'amount_min' => floatval($entry->amount_min),
|
'amount_min' => floatval($entry->amount_min),
|
||||||
'date' => $entry->date->format('j F Y'),
|
'date' => $entry->date->format('j F Y'),
|
||||||
|
|||||||
Reference in New Issue
Block a user