mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 17:33:45 +00:00
Fix bill
This commit is contained in:
@@ -112,21 +112,27 @@ class IndexController extends Controller
|
|||||||
'bills' => [],
|
'bills' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// expected today? default:
|
||||||
|
$array['next_expected_match_diff'] = trans('firefly.not_expected_period');
|
||||||
$nextExpectedMatch = new Carbon($array['next_expected_match']);
|
$nextExpectedMatch = new Carbon($array['next_expected_match']);
|
||||||
$array['next_expected_match_diff'] = $nextExpectedMatch->isToday()
|
if ($nextExpectedMatch->isToday()) {
|
||||||
? trans('firefly.today')
|
$array['next_expected_match_diff'] = trans('firefly.today');
|
||||||
: $nextExpectedMatch->diffForHumans(
|
}
|
||||||
today(), Carbon::DIFF_RELATIVE_TO_NOW
|
$current = $array['pay_dates'][0] ?? null;
|
||||||
);
|
if (null !== $current && !$nextExpectedMatch->isToday()) {
|
||||||
$currency = $bill->transactionCurrency ?? $defaultCurrency;
|
$currentExpectedMatch = Carbon::createFromFormat('!Y-m-d', $current);
|
||||||
$array['currency_id'] = $currency->id;
|
$array['next_expected_match_diff'] = $currentExpectedMatch->diffForHumans(today(), Carbon::DIFF_RELATIVE_TO_NOW);
|
||||||
$array['currency_name'] = $currency->name;
|
}
|
||||||
$array['currency_symbol'] = $currency->symbol;
|
|
||||||
$array['currency_code'] = $currency->code;
|
$currency = $bill->transactionCurrency ?? $defaultCurrency;
|
||||||
$array['currency_decimal_places'] = $currency->decimal_places;
|
$array['currency_id'] = $currency->id;
|
||||||
$array['attachments'] = $this->repository->getAttachments($bill);
|
$array['currency_name'] = $currency->name;
|
||||||
$array['rules'] = $rules[$bill['id']] ?? [];
|
$array['currency_symbol'] = $currency->symbol;
|
||||||
$bills[$groupOrder]['bills'][] = $array;
|
$array['currency_code'] = $currency->code;
|
||||||
|
$array['currency_decimal_places'] = $currency->decimal_places;
|
||||||
|
$array['attachments'] = $this->repository->getAttachments($bill);
|
||||||
|
$array['rules'] = $rules[$bill['id']] ?? [];
|
||||||
|
$bills[$groupOrder]['bills'][] = $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// order by key
|
// order by key
|
||||||
|
@@ -108,7 +108,7 @@ class BillUpdateService
|
|||||||
if (isset($data['skip']) && '' !== (string) $data['skip']) {
|
if (isset($data['skip']) && '' !== (string) $data['skip']) {
|
||||||
$bill->skip = $data['skip'];
|
$bill->skip = $data['skip'];
|
||||||
}
|
}
|
||||||
if (isset($data['active']) && '' !== (string) $data['active']) {
|
if (isset($data['active']) && is_bool($data['active'])) {
|
||||||
$bill->active = $data['active'];
|
$bill->active = $data['active'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user