fix splits command

and add splits test
This commit is contained in:
hackerESQ
2024-09-09 19:39:38 -05:00
parent 0c27ebaba5
commit 75fbd60a54
6 changed files with 80 additions and 32 deletions
+3 -1
View File
@@ -21,7 +21,8 @@ class Transaction extends Model
'transaction_type',
'quantity',
'cost_basis',
'sale_price'
'sale_price',
'split',
];
protected $hidden = [];
@@ -185,6 +186,7 @@ class Transaction extends Model
'quantity' => $this->quantity,
'average_cost_basis' => $this->cost_basis,
'total_cost_basis' => $this->quantity * $this->cost_basis,
'splits_synced_at' => now(),
])->syncTransactionsAndDividends();
}
}