mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Fix #3182
This commit is contained in:
@@ -108,6 +108,9 @@ class TransactionFactory
|
|||||||
*/
|
*/
|
||||||
public function createNegative(string $amount, ?string $foreignAmount): ?Transaction
|
public function createNegative(string $amount, ?string $foreignAmount): ?Transaction
|
||||||
{
|
{
|
||||||
|
if ('' === $foreignAmount) {
|
||||||
|
$foreignAmount = null;
|
||||||
|
}
|
||||||
if (null !== $foreignAmount) {
|
if (null !== $foreignAmount) {
|
||||||
$foreignAmount = app('steam')->negative($foreignAmount);
|
$foreignAmount = app('steam')->negative($foreignAmount);
|
||||||
}
|
}
|
||||||
@@ -124,6 +127,9 @@ class TransactionFactory
|
|||||||
*/
|
*/
|
||||||
public function createPositive(string $amount, ?string $foreignAmount): ?Transaction
|
public function createPositive(string $amount, ?string $foreignAmount): ?Transaction
|
||||||
{
|
{
|
||||||
|
if ('' === $foreignAmount) {
|
||||||
|
$foreignAmount = null;
|
||||||
|
}
|
||||||
if (null !== $foreignAmount) {
|
if (null !== $foreignAmount) {
|
||||||
$foreignAmount = app('steam')->positive($foreignAmount);
|
$foreignAmount = app('steam')->positive($foreignAmount);
|
||||||
}
|
}
|
||||||
@@ -158,7 +164,10 @@ class TransactionFactory
|
|||||||
private function create(string $amount, ?string $foreignAmount): ?Transaction
|
private function create(string $amount, ?string $foreignAmount): ?Transaction
|
||||||
{
|
{
|
||||||
$result = null;
|
$result = null;
|
||||||
$data = [
|
if ('' === $foreignAmount) {
|
||||||
|
$foreignAmount = null;
|
||||||
|
}
|
||||||
|
$data = [
|
||||||
'reconciled' => $this->reconciled,
|
'reconciled' => $this->reconciled,
|
||||||
'account_id' => $this->account->id,
|
'account_id' => $this->account->id,
|
||||||
'transaction_journal_id' => $this->journal->id,
|
'transaction_journal_id' => $this->journal->id,
|
||||||
|
Reference in New Issue
Block a user