mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Fix the unit tests.
This commit is contained in:
@@ -71,6 +71,7 @@ class UpgradeDatabase extends Command
|
||||
$this->setTransactionIdentifier();
|
||||
$this->migrateRepetitions();
|
||||
$this->updateAccountCurrencies();
|
||||
$this->line('Updating currency information..');
|
||||
$this->updateTransferCurrencies();
|
||||
$this->updateOtherCurrencies();
|
||||
$this->info('Firefly III database is up to date.');
|
||||
@@ -218,16 +219,10 @@ class UpgradeDatabase extends Command
|
||||
if (is_null($transaction->transaction_currency_id)) {
|
||||
$transaction->transaction_currency_id = $currency->id;
|
||||
$transaction->save();
|
||||
$this->line(sprintf('Transaction #%d is set to %s', $transaction->id, $currency->code));
|
||||
}
|
||||
|
||||
// when mismatch in transaction:
|
||||
if ($transaction->transaction_currency_id !== $currency->id) {
|
||||
$this->line(
|
||||
sprintf(
|
||||
'Transaction #%d is set to %s and foreign %s', $transaction->id, $currency->code, $transaction->transactionCurrency->code
|
||||
)
|
||||
);
|
||||
$transaction->foreign_currency_id = $transaction->transaction_currency_id;
|
||||
$transaction->foreign_amount = $transaction->amount;
|
||||
$transaction->transaction_currency_id = $currency->id;
|
||||
@@ -372,12 +367,10 @@ class UpgradeDatabase extends Command
|
||||
if (is_null($transaction->transaction_currency_id)) {
|
||||
$transaction->transaction_currency_id = $currency->id;
|
||||
$transaction->save();
|
||||
$this->line(sprintf('Transaction #%d is set to %s', $transaction->id, $currency->code));
|
||||
}
|
||||
|
||||
// when mismatch in transaction:
|
||||
if ($transaction->transaction_currency_id !== $currency->id) {
|
||||
$this->line(sprintf('Transaction #%d is set to %s and foreign %s', $transaction->id, $currency->code, $transaction->transactionCurrency->code));
|
||||
$transaction->foreign_currency_id = $transaction->transaction_currency_id;
|
||||
$transaction->foreign_amount = $transaction->amount;
|
||||
$transaction->transaction_currency_id = $currency->id;
|
||||
|
||||
@@ -152,12 +152,9 @@ class ExportController extends Controller
|
||||
$jobs->changeStatus($job, 'export_status_make_exporter');
|
||||
|
||||
/** @var ProcessorInterface $processor */
|
||||
$processor = app(ExpandedProcessor::class);
|
||||
$processor = app(ProcessorInterface::class);
|
||||
$processor->setSettings($settings);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Collect journals:
|
||||
*/
|
||||
|
||||
@@ -13,12 +13,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class ExportJob
|
||||
*
|
||||
* @property User $user
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class ExportJob extends Model
|
||||
|
||||
@@ -13,7 +13,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Export\Processor;
|
||||
use FireflyIII\Export\ExpandedProcessor;
|
||||
use FireflyIII\Export\ProcessorInterface;
|
||||
use FireflyIII\Generator\Chart\Basic\ChartJsGenerator;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
@@ -138,7 +138,8 @@ class FireflyServiceProvider extends ServiceProvider
|
||||
);
|
||||
|
||||
// other generators
|
||||
$this->app->bind(ProcessorInterface::class, Processor::class);
|
||||
// export:
|
||||
$this->app->bind(ProcessorInterface::class, ExpandedProcessor::class);
|
||||
$this->app->bind(UserRepositoryInterface::class, UserRepository::class);
|
||||
$this->app->bind(AttachmentHelperInterface::class, AttachmentHelper::class);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user