cioraneanu / firefly-pico

A delightful Firefly III companion web app for effortless transaction tracking
GNU Affero General Public License v3.0
429 stars 19 forks source link

[Bug] Error when creating Cross-currency transfer #95

Closed etnperlong closed 2 months ago

etnperlong commented 2 months ago

Hi,

Thanks for your work on implementing the transfers with different currencies in version v1.3.0 and resolved the issue https://github.com/cioraneanu/firefly-pico/issues/20

However, when I tried to create a transfer from GBP -> HKD, it showed me an error "The content of this field is invalid without currency information."

I think it might be because the 'foreign_currency_id' is not set in the POST request to /api/transactions

This is the request when I try to create the transactions on Pico

{
    "apply_rules": true,
    "fire_webhooks": true,
    "transactions": [
        {
            "amount": "100.00",
            "foreign_amount": "1005",
            "description": "GBP -> HKD",
            "notes": "",
            "source_id": "30",
            "source_name": "Zing",
            "destination_id": "58",
            "destination_name": "HSBC HK",
            "date": "2024-08-29 10:10",
            "type": "transfer",
            "tags": []
        }
    ]
}

I'd appreciate it if you could take the time to look into this. Thank you!

cioraneanu commented 2 months ago

Thanks for pointing it out. I've pushed a fix on the dev version to try out. :)