mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 08:30:06 +00:00
Fix bug in bill name import routine
This commit is contained in:
@@ -21,7 +21,7 @@ class BillName extends BasicConverter implements ConverterInterface
|
|||||||
/** @var BillRepositoryInterface $repository */
|
/** @var BillRepositoryInterface $repository */
|
||||||
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
||||||
|
|
||||||
$bill = null;
|
$bill = new Bill;
|
||||||
// is mapped? Then it's easy!
|
// is mapped? Then it's easy!
|
||||||
if (isset($this->mapped[$this->index][$this->value])) {
|
if (isset($this->mapped[$this->index][$this->value])) {
|
||||||
$bill = $repository->find($this->mapped[$this->index][$this->value]);
|
$bill = $repository->find($this->mapped[$this->index][$this->value]);
|
||||||
|
|||||||
@@ -147,8 +147,15 @@ class Importer
|
|||||||
$transactionType = $this->getTransactionType(); // defaults to deposit
|
$transactionType = $this->getTransactionType(); // defaults to deposit
|
||||||
$errors = new MessageBag;
|
$errors = new MessageBag;
|
||||||
$journal = TransactionJournal::create(
|
$journal = TransactionJournal::create(
|
||||||
['user_id' => Auth::user()->id, 'transaction_type_id' => $transactionType->id, 'transaction_currency_id' => $this->importData['currency']->id,
|
[
|
||||||
'description' => $this->importData['description'], 'completed' => 0, 'date' => $date, 'bill_id' => $this->importData['bill-id'],]
|
'user_id' => Auth::user()->id,
|
||||||
|
'transaction_type_id' => $transactionType->id,
|
||||||
|
'transaction_currency_id' => $this->importData['currency']->id,
|
||||||
|
'description' => $this->importData['description'],
|
||||||
|
'completed' => 0,
|
||||||
|
'date' => $date,
|
||||||
|
'bill_id' => $this->importData['bill-id'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
if ($journal->getErrors()->count() == 0) {
|
if ($journal->getErrors()->count() == 0) {
|
||||||
// first transaction
|
// first transaction
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Bill implements PostProcessorInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
// get bill id.
|
// get bill id.
|
||||||
if (!is_null($this->data['bill'])) {
|
if (!is_null($this->data['bill']->id)) {
|
||||||
$this->data['bill-id'] = $this->data['bill']->id;
|
$this->data['bill-id'] = $this->data['bill']->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user