mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Update code for piggy banks.
This commit is contained in:
@@ -34,15 +34,16 @@ class PiggyBankObserver
|
||||
{
|
||||
public function created(PiggyBank $piggyBank): void
|
||||
{
|
||||
app('log')->debug('Observe "created" of a piggy bank.');
|
||||
$repetition = new PiggyBankRepetition();
|
||||
$repetition->piggyBank()->associate($piggyBank);
|
||||
$repetition->start_date = $piggyBank->start_date;
|
||||
$repetition->start_date_tz = $piggyBank->start_date->format('e');
|
||||
$repetition->target_date = $piggyBank->target_date;
|
||||
$repetition->target_date_tz = $piggyBank->target_date?->format('e');
|
||||
$repetition->current_amount = '0';
|
||||
$repetition->save();
|
||||
app('log')->debug('Observe "created" of a piggy bank. DO NOTHING.');
|
||||
|
||||
// $repetition = new PiggyBankRepetition();
|
||||
// $repetition->piggyBank()->associate($piggyBank);
|
||||
// $repetition->start_date = $piggyBank->start_date;
|
||||
// $repetition->start_date_tz = $piggyBank->start_date->format('e');
|
||||
// $repetition->target_date = $piggyBank->target_date;
|
||||
// $repetition->target_date_tz = $piggyBank->target_date?->format('e');
|
||||
// $repetition->current_amount = '0';
|
||||
// $repetition->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user