mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Merge branches 'develop' and 'develop' of github.com:firefly-iii/firefly-iii into develop
This commit is contained in:
@@ -63,9 +63,11 @@ class EditController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
public function resetHistory(PiggyBank $piggyBank): RedirectResponse {
|
||||
public function resetHistory(PiggyBank $piggyBank): RedirectResponse
|
||||
{
|
||||
$this->piggyRepos->resetHistory($piggyBank);
|
||||
session()->flash('success', (string) trans('firefly.piggy_history_reset'));
|
||||
|
||||
return redirect(route('piggy-banks.show', [$piggyBank->id]));
|
||||
}
|
||||
|
||||
|
@@ -67,7 +67,7 @@ class UserFailedLoginAttempt extends Notification
|
||||
{
|
||||
$settings = ReturnsSettings::getSettings('ntfy', 'user', $notifiable);
|
||||
$message = new Message();
|
||||
$ip = Request::ip();
|
||||
$ip = Request::ip();
|
||||
$message->topic($settings['ntfy_topic']);
|
||||
$message->title((string) trans('email.failed_login_subject'));
|
||||
$message->body((string) trans('email.failed_login_message', ['ip' => $ip, 'email' => $this->user->email]));
|
||||
@@ -80,7 +80,8 @@ class UserFailedLoginAttempt extends Notification
|
||||
*/
|
||||
public function toPushover(User $notifiable): PushoverMessage
|
||||
{
|
||||
$ip = Request::ip();
|
||||
$ip = Request::ip();
|
||||
|
||||
return PushoverMessage::create((string) trans('email.failed_login_message', ['ip' => $ip, 'email' => $this->user->email]))
|
||||
->title((string) trans('email.failed_login_subject'))
|
||||
;
|
||||
@@ -91,7 +92,7 @@ class UserFailedLoginAttempt extends Notification
|
||||
*/
|
||||
public function toSlack(User $notifiable): SlackMessage
|
||||
{
|
||||
$ip = Request::ip();
|
||||
$ip = Request::ip();
|
||||
$message = (string) trans('email.failed_login_message', ['ip' => $ip, 'email' => $this->user->email]);
|
||||
|
||||
return new SlackMessage()->content($message);
|
||||
|
@@ -443,8 +443,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte
|
||||
public function resetHistory(PiggyBank $piggyBank): void
|
||||
{
|
||||
$piggyBank->piggyBankEvents()->delete();
|
||||
foreach($piggyBank->accounts as $account) {
|
||||
if(0 !== bccomp('0',$account->pivot->current_amount)) {
|
||||
foreach ($piggyBank->accounts as $account) {
|
||||
if (0 !== bccomp('0', $account->pivot->current_amount)) {
|
||||
event(new ChangedAmount($piggyBank, $account->pivot->current_amount, null, null));
|
||||
}
|
||||
}
|
||||
|
@@ -33,7 +33,6 @@ use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -48,8 +47,8 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface PiggyBankRepositoryInterface
|
||||
{
|
||||
|
||||
public function resetHistory(PiggyBank $piggyBank): void;
|
||||
|
||||
public function addAmount(PiggyBank $piggyBank, Account $account, string $amount, ?TransactionJournal $journal = null): bool;
|
||||
|
||||
public function addAmountToPiggyBank(PiggyBank $piggyBank, string $amount, TransactionJournal $journal): void;
|
||||
|
Reference in New Issue
Block a user