Post fares/expenses on PIREP to Airline journal #130
This commit is contained in:
@@ -19,6 +19,9 @@ class JournalRepository extends BaseRepository implements CacheableInterface
|
||||
{
|
||||
use CacheableRepository;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function model()
|
||||
{
|
||||
return JournalTransaction::class;
|
||||
@@ -58,7 +61,6 @@ class JournalRepository extends BaseRepository implements CacheableInterface
|
||||
'currency' => config('phpvms.currency'),
|
||||
'memo' => $memo,
|
||||
'post_date' => $post_date ?: Carbon::now(),
|
||||
'transaction_group' => $transaction_group,
|
||||
];
|
||||
|
||||
if($reference !== null) {
|
||||
@@ -66,6 +68,11 @@ class JournalRepository extends BaseRepository implements CacheableInterface
|
||||
$attrs['ref_class_id'] = $reference->id;
|
||||
}
|
||||
|
||||
if($transaction_group) {
|
||||
$transaction_group = str_replace(' ', '_', $transaction_group);
|
||||
$attrs['transaction_group'] = $transaction_group;
|
||||
}
|
||||
|
||||
try {
|
||||
$transaction = $this->create($attrs);
|
||||
} catch (ValidatorException $e) {
|
||||
|
||||
Reference in New Issue
Block a user