app('log')->warning(sprintf('Withdrawal, but did not recognize the type of the source account. It will be replaced with the default account (#%d).',$current['source_id']));
Log::warning(sprintf('Withdrawal, but did not recognize the type of the source account. It will be replaced with the default account (#%d).',$current['source_id']));
app('log')->warning(sprintf('Deposit, but did not recognize the destination account. It will be replaced with the default account (#%d).',$current['destination_id']));
Log::warning(sprintf('Deposit, but did not recognize the destination account. It will be replaced with the default account (#%d).',$current['destination_id']));
$overruleAccount=true;
}
// at this point it is possible that either of the two actions above have accidentally
@ -421,21 +422,21 @@ class TransactionMapper
// no description?
if(!array_key_exists('description',$current)){
app('log')->warning('Did not find a description in the transaction, added "(no description)"');
Log::warning('Did not find a description in the transaction, added "(no description)"');
app('log')->debug('Based on types, this is a withdrawal');
Log::debug('Based on types, this is a withdrawal');
$current['type']='withdrawal';
break;
@ -559,47 +560,47 @@ class TransactionMapper
case$sourceIsNull&&$destIsAsset:
case$sourceIsRevenue&&$destIsAsset:
case$sourceIsAsset&&$destIsExpense:// there is no revenue account, but the account was found under expense, so we assume this is a deposit with an non-existing revenue account
app('log')->debug('Based on types, this is a deposit');
Log::debug('Based on types, this is a deposit');
$current['type']='deposit';
break;
case$sourceIsAsset&&$destIsAsset:
app('log')->debug('Based on types, this is a transfer');
Log::debug('Based on types, this is a transfer');
$current['type']='transfer';// line 382 / 383
break;
case$sourceIsExpense&&$destIsExpense:
app('log')->warning('Both types are expense. Impossible. Lets make source_type = "" and type="withdrawal"');
Log::warning('Both types are expense. Impossible. Lets make source_type = "" and type="withdrawal"');
$current['source_type']='';
$current['type']='withdrawal';
break;
case$sourceIsRevenue&&$destIsRevenue:
app('log')->warning('Both types are revenue. Impossible. Lets make destination_type = "" and type="deposit"');
Log::warning('Both types are revenue. Impossible. Lets make destination_type = "" and type="deposit"');
$current['destination_type']='';
$current['type']='deposit';
break;
case$sourceIsExpense&&$destIsNull:
app('log')->warning('The source is "expense" but the destination is a new account. Weird! Lets make source_type = "" and type="withdrawal"');
Log::warning('The source is "expense" but the destination is a new account. Weird! Lets make source_type = "" and type="withdrawal"');
$current['source_type']='';
$current['type']='withdrawal';
break;
case$sourceIsExpense&&$destIsAsset:
app('log')->warning('The source is "expense" but the destination is an asset. Weird! Lets make source_type = "" and type="deposit"');
Log::warning('The source is "expense" but the destination is an asset. Weird! Lets make source_type = "" and type="deposit"');
$current['source_type']='';
$current['type']='deposit';
break;
default:
app('log')->error(
Log::error(
sprintf(
'Unknown transaction type: source = "%s", destination = "%s". Fall back to "withdrawal"',
$accountType['source']?:null,
@ -625,31 +626,31 @@ class TransactionMapper
if((string)$account->{$field}===(string)$value){
// never found a match before!
if(0===$count){
app('log')->debug(sprintf('Recognized "%s" as a "%s"-account by its "%s".',$value,$account->type,$field));
Log::debug(sprintf('Recognized "%s" as a "%s"-account by its "%s".',$value,$account->type,$field));
$result=$account->type;
$hitField=$field;
++$count;
}
// we found a match before, and it's different too.
if(0!==$count&&$account->type!==$result){
app('log')->warning(sprintf('Recognized "%s" as a "%s"-account (on the "%s"-field) but ALSO as a "%s"-account (previous match was on the "%s"-field)!',$value,$result,$field,$account->type,$hitField));
Log::warning(sprintf('Recognized "%s" as a "%s"-account (on the "%s"-field) but ALSO as a "%s"-account (previous match was on the "%s"-field)!',$value,$result,$field,$account->type,$hitField));
// the previous result always trumps the current result because the order of accountIdentificationSuffixes
app('log')->debug(sprintf('System will keep the previous match and assume account with %s "%s" is a "%s" account',$field,$value,$result));
Log::debug(sprintf('System will keep the previous match and assume account with %s "%s" is a "%s" account',$field,$value,$result));
++$count;
}
// we found a match before and it's different. But the data importer has found both "revenue" AND "expense" accounts. What to do?
app('log')->warning(sprintf('Recognized "%s" as a "%s"-account (on the "%s"-field) but ALSO as a "%s"-account (previous match was on the "%s"-field)!',$value,$result,$field,$account->type,$hitField));
app('log')->debug('Because amount is less than zero, we assume "expense" is the correct type.');
Log::warning(sprintf('Recognized "%s" as a "%s"-account (on the "%s"-field) but ALSO as a "%s"-account (previous match was on the "%s"-field)!',$value,$result,$field,$account->type,$hitField));
Log::debug('Because amount is less than zero, we assume "expense" is the correct type.');
$result='expense';
++$count;
}
// we found a match before and it's different. But: previous result was "expense", current result is "revenue"
app('log')->warning(sprintf('Recognized "%s" as a "%s"-account (on the "%s"-field) but ALSO as a "%s"-account (previous match was on the "%s"-field)!',$value,$result,$field,$account->type,$hitField));
app('log')->debug('Because amount is more than zero, we assume "revenue" is the correct type.');
Log::warning(sprintf('Recognized "%s" as a "%s"-account (on the "%s"-field) but ALSO as a "%s"-account (previous match was on the "%s"-field)!',$value,$result,$field,$account->type,$hitField));
Log::debug('Because amount is more than zero, we assume "revenue" is the correct type.');
$result='revenue';
++$count;
@ -657,7 +658,7 @@ class TransactionMapper
}
}
if(null===$result){
app('log')->debug(sprintf('Unable to recognize the account type of "%s" "%s", or skipped because unsure.',$field,$value));
Log::debug(sprintf('Unable to recognize the account type of "%s" "%s", or skipped because unsure.',$field,$value));
$message=sprintf('You have no requests left for bank account "%s"',$account['name']);
@ -214,7 +215,7 @@ class RoutineManager implements RoutineManagerInterface
$message.='. ';
}
$message.='[Read more about GoCardless rate limits](https://docs.firefly-iii.org/references/faq/data-importer/salt-edge-gocardless/#i-am-rate-limited-by-gocardless).';
Log::debug(sprintf('Duplicate detection method is "%s", so this method is skipped (return true).',$this->configuration->getDuplicateDetectionMethod()));
'Identifier-based duplicate detection found no value ("") for field "%s" in transaction #%d (index #%d).',
$field,
$index,
$transactionIndex
)
);
Log::debug(sprintf('Identifier-based duplicate detection found no value ("") for field "%s" in transaction #%d (index #%d).',$field,$index,$transactionIndex));
continue;
}
$searchResult=$this->searchField($field,$value);
if(0!==$searchResult){
app('log')->debug(
sprintf(
'Looks like field "%s" with value "%s" is not unique, found in group #%d. Return false',
$field,
$value,
$searchResult
)
);
$message=sprintf(
'[a115]: There is already a transaction with %s "%s" (<a href="%s/transactions/show/%d">link</a>).',
$field,
$value,
$this->vanityURL,
$searchResult
);
Log::debug(sprintf('Looks like field "%s" with value "%s" is not unique, found in group #%d. Return false',$field,$value,$searchResult));
$message=sprintf('[a115]: There is already a transaction with %s "%s" (<a href="%s/transactions/show/%d">link</a>).',$field,$value,$this->vanityURL,$searchResult);
$message=sprintf('Created %s <a target="_blank" href="%s">#%d "%s"</a> (%s %s)',$transaction->type,sprintf('%s/transactions/show/%d',$this->vanityURL,$group->id),$group->id,e($transaction->description),$transaction->currencyCode,round((float)$transaction->amount,(int)$transaction->currencyDecimalPlaces)// float but only for display purposes
'Line #%d may have had its currency changed (from ID #%d to ID #%d). This happens because the associated asset account overrules the currency of the transaction.',
$this->addWarning($lineIndex,sprintf('Line #%d may have had its currency changed (from ID #%d to ID #%d). This happens because the associated asset account overrules the currency of the transaction.',$lineIndex,$line['transactions'][$index]['currency_id'],(int)$transaction->currencyId));
'Line #%d may have had its currency changed (from "%s" to "%s"). This happens because the associated asset account overrules the currency of the transaction.',
$this->addWarning($lineIndex,sprintf('Line #%d may have had its currency changed (from "%s" to "%s"). This happens because the associated asset account overrules the currency of the transaction.',$lineIndex,$line['transactions'][$index]['currency_code'],$transaction->currencyCode));