Fix invalid check for transferring between accounts with different currencies

This commit is contained in:
Illya Marchenko 2024-08-28 22:40:12 +03:00
parent 1646d484fb
commit e1c9f56921
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F

View File

@ -135,7 +135,7 @@ func ImportTransaction(monobankTransaction monobank.WebHookResponse) error {
// when transfer between different currencies, convert
sourceAccount := App().Config.GetAccountByFirefly3Name(firefly3Transaction.SourceName)
if sourceAccount.Currency != destAccount.Currency {
if len(sourceAccount.Currency) > 0 && sourceAccount.Currency != destAccount.Currency {
// swap amounts
firefly3Transaction.ForeignAmount = firefly3Transaction.Amount
firefly3Transaction.Amount = strconv.Itoa(int(math.Abs(math.Round(monobankTransaction.Data.StatementItem.OperationAmount / 100))))