This commit is contained in:
James Cole 2020-08-22 19:46:08 +02:00
parent 5e0c0e25f2
commit 1dfda62125
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
5 changed files with 16 additions and 30 deletions

View File

@ -50,7 +50,6 @@ use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
use Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Class TransactionController
*/
@ -59,9 +58,7 @@ class TransactionController extends Controller
use TransactionFilter;
private TransactionGroupRepositoryInterface $groupRepository;
private JournalAPIRepositoryInterface $journalAPIRepository;
private JournalRepositoryInterface $repository;

View File

@ -42,23 +42,12 @@ class TransactionUpdateRequest extends FormRequest
{
use TransactionValidation, GroupValidation, ConvertsDataTypes;
/** @var array Array values. */
private $arrayFields;
/** @var array Boolean values. */
private $booleanFields;
/** @var array Fields that contain date values. */
private $dateFields;
/** @var array Fields that contain integer values. */
private $integerFields;
/** @var array Fields that contain string values. */
private $stringFields;
/** @var array Fields that contain text (with newlines) */
private $textareaFields;
private array $arrayFields;
private array $booleanFields;
private array $dateFields;
private array $integerFields;
private array $stringFields;
private array $textareaFields;
/**

View File

@ -136,7 +136,7 @@ class AccountValidator
switch ($this->transactionType) {
default:
$result = false;
$this->sourceError = 'Firefly III cannot validate the account information you submitted.';
$this->sourceError = trans('validation.invalid_account_info');
Log::error(sprintf('AccountValidator::validateSource cannot handle "%s", so it will always return false.', $this->transactionType));
break;
case TransactionType::WITHDRAWAL:

View File

@ -539,11 +539,11 @@ export default {
destName = row.destination_account.name;
// depends on the transaction type, where we get the currency.
if('withdrawal' === transactionType || 'transfer' === transactionType) {
if ('withdrawal' === transactionType || 'transfer' === transactionType) {
row.currency_id = row.source_account.currency_id;
// console.log('Overruled currency ID to ' + row.currency_id);
}
if('deposit' === transactionType) {
if ('deposit' === transactionType) {
row.currency_id = row.destination_account.currency_id;
// console.log('Overruled currency ID to ' + row.currency_id);
}
@ -576,7 +576,7 @@ export default {
}
tagList = [];
foreignAmount = null;
foreignAmount = '0';
foreignCurrency = null;
// loop tags
for (let tagKey in row.tags) {
@ -638,10 +638,10 @@ export default {
notes: row.custom_fields.notes,
tags: tagList
};
if (null !== foreignAmount) {
currentArray.foreign_amount = foreignAmount;
currentArray.foreign_currency_id = foreignCurrency;
}
// always submit foreign amount info.
currentArray.foreign_amount = foreignAmount;
currentArray.foreign_currency_id = foreignCurrency;
// set budget id and piggy ID.
currentArray.budget_id = parseInt(row.budget);
currentArray.bill_id = parseInt(row.bill);

View File

@ -34,7 +34,7 @@
v-for="currency in this.enabledCurrencies"
:value="currency.id"
:label="currency.attributes.name"
:selected="value.currency_id === currency.id"
:selected="parseInt(value.currency_id) === parseInt(currency.id)"
>
{{ currency.attributes.name }}
@ -67,9 +67,9 @@
props: ['source', 'destination', 'transactionType', 'value', 'error', 'no_currency', 'title',],
mounted() {
//console.log('ForeignAmountSelect mounted()');
this.liability = false;
this.loadCurrencies();
},
data() {
return {