mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Can now create recurring transactions. #1469
This commit is contained in:
@@ -65,14 +65,19 @@ class Recurrence extends Model
|
||||
*/
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'first_date' => 'date',
|
||||
'latest_date' => 'date',
|
||||
'active' => 'bool',
|
||||
'apply_rules' => 'bool',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'title' => 'string',
|
||||
'description' => 'string',
|
||||
'first_date' => 'date',
|
||||
'repeat_until' => 'date',
|
||||
'latest_date' => 'date',
|
||||
'repetitions' => 'int',
|
||||
'active' => 'bool',
|
||||
'apply_rules' => 'bool',
|
||||
];
|
||||
/** @var array */
|
||||
/** @var array */
|
||||
protected $fillable
|
||||
= ['user_id', 'transaction_type_id', 'title', 'description', 'first_date', 'repeat_until', 'latest_date', 'repetitions', 'apply_rules', 'active'];
|
||||
/** @var string */
|
||||
|
@@ -35,6 +35,18 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
*/
|
||||
class RecurrenceMeta extends Model
|
||||
{
|
||||
/** @var array */
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'name' => 'string',
|
||||
'value' => 'string',
|
||||
];
|
||||
/** @var array */
|
||||
protected $fillable = ['recurrence_id', 'name', 'value'];
|
||||
/** @var string */
|
||||
protected $table = 'recurrences_meta';
|
||||
|
||||
/**
|
||||
|
@@ -40,6 +40,18 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
*/
|
||||
class RecurrenceRepetition extends Model
|
||||
{
|
||||
/** @var array */
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'repetition_type' => 'string',
|
||||
'repetition_moment' => 'string',
|
||||
'repetition_skip' => 'int',
|
||||
];
|
||||
protected $fillable = ['recurrence_id', 'repetition_type', 'repetition_moment', 'repetition_skip'];
|
||||
/** @var string */
|
||||
protected $table = 'recurrences_repetitions';
|
||||
|
||||
/**
|
||||
|
@@ -48,6 +48,16 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
class RecurrenceTransaction extends Model
|
||||
{
|
||||
/** @var array */
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'amount' => 'string',
|
||||
'foreign_amount' => 'string',
|
||||
'description' => 'string',
|
||||
];
|
||||
/** @var array */
|
||||
protected $fillable
|
||||
= ['recurrence_id', 'transaction_currency_id', 'foreign_currency_id', 'source_account_id', 'destination_account_id', 'amount', 'foreign_amount',
|
||||
'description'];
|
||||
|
@@ -35,6 +35,17 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
*/
|
||||
class RecurrenceTransactionMeta extends Model
|
||||
{
|
||||
/** @var array */
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'name' => 'string',
|
||||
'value' => 'string',
|
||||
];
|
||||
protected $fillable = ['rt_id', 'name', 'value'];
|
||||
/** @var string */
|
||||
protected $table = 'rt_meta';
|
||||
|
||||
/**
|
||||
@@ -43,7 +54,7 @@ class RecurrenceTransactionMeta extends Model
|
||||
*/
|
||||
public function recurrenceTransaction(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(RecurrenceTransaction::class);
|
||||
return $this->belongsTo(RecurrenceTransaction::class, 'rt_id');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user