mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Fix #3715
This commit is contained in:
@@ -50,7 +50,6 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
|||||||
use League\Fractal\Resource\Item;
|
use League\Fractal\Resource\Item;
|
||||||
use Log;
|
use Log;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TransactionController
|
* Class TransactionController
|
||||||
*/
|
*/
|
||||||
@@ -59,9 +58,7 @@ class TransactionController extends Controller
|
|||||||
use TransactionFilter;
|
use TransactionFilter;
|
||||||
|
|
||||||
private TransactionGroupRepositoryInterface $groupRepository;
|
private TransactionGroupRepositoryInterface $groupRepository;
|
||||||
|
|
||||||
private JournalAPIRepositoryInterface $journalAPIRepository;
|
private JournalAPIRepositoryInterface $journalAPIRepository;
|
||||||
|
|
||||||
private JournalRepositoryInterface $repository;
|
private JournalRepositoryInterface $repository;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -42,23 +42,12 @@ class TransactionUpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
use TransactionValidation, GroupValidation, ConvertsDataTypes;
|
use TransactionValidation, GroupValidation, ConvertsDataTypes;
|
||||||
|
|
||||||
/** @var array Array values. */
|
private array $arrayFields;
|
||||||
private $arrayFields;
|
private array $booleanFields;
|
||||||
|
private array $dateFields;
|
||||||
/** @var array Boolean values. */
|
private array $integerFields;
|
||||||
private $booleanFields;
|
private array $stringFields;
|
||||||
|
private array $textareaFields;
|
||||||
/** @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;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -136,7 +136,7 @@ class AccountValidator
|
|||||||
switch ($this->transactionType) {
|
switch ($this->transactionType) {
|
||||||
default:
|
default:
|
||||||
$result = false;
|
$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));
|
Log::error(sprintf('AccountValidator::validateSource cannot handle "%s", so it will always return false.', $this->transactionType));
|
||||||
break;
|
break;
|
||||||
case TransactionType::WITHDRAWAL:
|
case TransactionType::WITHDRAWAL:
|
||||||
|
@@ -539,11 +539,11 @@ export default {
|
|||||||
destName = row.destination_account.name;
|
destName = row.destination_account.name;
|
||||||
|
|
||||||
// depends on the transaction type, where we get the currency.
|
// 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;
|
row.currency_id = row.source_account.currency_id;
|
||||||
// console.log('Overruled currency ID to ' + row.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;
|
row.currency_id = row.destination_account.currency_id;
|
||||||
// console.log('Overruled currency ID to ' + row.currency_id);
|
// console.log('Overruled currency ID to ' + row.currency_id);
|
||||||
}
|
}
|
||||||
@@ -576,7 +576,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tagList = [];
|
tagList = [];
|
||||||
foreignAmount = null;
|
foreignAmount = '0';
|
||||||
foreignCurrency = null;
|
foreignCurrency = null;
|
||||||
// loop tags
|
// loop tags
|
||||||
for (let tagKey in row.tags) {
|
for (let tagKey in row.tags) {
|
||||||
@@ -638,10 +638,10 @@ export default {
|
|||||||
notes: row.custom_fields.notes,
|
notes: row.custom_fields.notes,
|
||||||
tags: tagList
|
tags: tagList
|
||||||
};
|
};
|
||||||
if (null !== foreignAmount) {
|
// always submit foreign amount info.
|
||||||
currentArray.foreign_amount = foreignAmount;
|
currentArray.foreign_amount = foreignAmount;
|
||||||
currentArray.foreign_currency_id = foreignCurrency;
|
currentArray.foreign_currency_id = foreignCurrency;
|
||||||
}
|
|
||||||
// set budget id and piggy ID.
|
// set budget id and piggy ID.
|
||||||
currentArray.budget_id = parseInt(row.budget);
|
currentArray.budget_id = parseInt(row.budget);
|
||||||
currentArray.bill_id = parseInt(row.bill);
|
currentArray.bill_id = parseInt(row.bill);
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
v-for="currency in this.enabledCurrencies"
|
v-for="currency in this.enabledCurrencies"
|
||||||
:value="currency.id"
|
:value="currency.id"
|
||||||
:label="currency.attributes.name"
|
:label="currency.attributes.name"
|
||||||
:selected="value.currency_id === currency.id"
|
:selected="parseInt(value.currency_id) === parseInt(currency.id)"
|
||||||
|
|
||||||
>
|
>
|
||||||
{{ currency.attributes.name }}
|
{{ currency.attributes.name }}
|
||||||
@@ -67,9 +67,9 @@
|
|||||||
|
|
||||||
props: ['source', 'destination', 'transactionType', 'value', 'error', 'no_currency', 'title',],
|
props: ['source', 'destination', 'transactionType', 'value', 'error', 'no_currency', 'title',],
|
||||||
mounted() {
|
mounted() {
|
||||||
//console.log('ForeignAmountSelect mounted()');
|
|
||||||
this.liability = false;
|
this.liability = false;
|
||||||
this.loadCurrencies();
|
this.loadCurrencies();
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user