mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 13:10:35 +00:00
Merge
This commit is contained in:
@@ -293,6 +293,7 @@ trait JournalServiceTrait
|
||||
if ('' === $amount) {
|
||||
throw new FireflyException(sprintf('The amount cannot be an empty string: "%s"', $amount));
|
||||
}
|
||||
Log::debug(sprintf('Now in getAmount("%s")', $amount));
|
||||
if (0 === bccomp('0', $amount)) {
|
||||
throw new FireflyException(sprintf('The amount seems to be zero: "%s"', $amount));
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ class GroupUpdateService
|
||||
*/
|
||||
public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
Log::debug('Now in group update service', $data);
|
||||
/** @var array $transactions */
|
||||
$transactions = $data['transactions'] ?? [];
|
||||
@@ -117,6 +118,7 @@ class GroupUpdateService
|
||||
*/
|
||||
private function updateTransactionJournal(TransactionGroup $transactionGroup, TransactionJournal $journal, array $data): void
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
if (empty($data)) {
|
||||
return;
|
||||
}
|
||||
@@ -141,6 +143,7 @@ class GroupUpdateService
|
||||
*/
|
||||
private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
// updated or created transaction journals:
|
||||
$updated = [];
|
||||
/**
|
||||
|
||||
@@ -126,6 +126,7 @@ class JournalUpdateService
|
||||
*/
|
||||
public function update(): void
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
Log::debug(sprintf('Now in JournalUpdateService for journal #%d.', $this->transactionJournal->id));
|
||||
|
||||
if ($this->removeReconciliation()) {
|
||||
@@ -690,11 +691,13 @@ class JournalUpdateService
|
||||
*/
|
||||
private function updateAmount(): void
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
if (!$this->hasFields(['amount'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$value = $this->data['amount'] ?? '';
|
||||
Log::debug(sprintf('Amount is now "%s"', $value));
|
||||
try {
|
||||
$amount = $this->getAmount($value);
|
||||
} catch (FireflyException $e) {
|
||||
|
||||
Reference in New Issue
Block a user