Bug: Vendor form sends currency ID instead of currency code — 400 Bad Request
Description
When creating a new vendor via the UI (/vendors/new), the currency dropdown sends the numeric currency ID (e.g. 1007) instead of the ISO currency code string (e.g. "THB"). The backend CreateVendorDto expects currencyCode to be a string (@IsString()), so the request fails with a 400 Bad Request.
This makes it impossible to create vendors through the UI when a currency is selected.
Steps to Reproduce
1. Go to /vendors/new
3. Fill in required fields (display name, etc.)
5. Select any currency from the dropdown (e.g. "Thai Baht")
7. Click Save
9. Request fails with 400 Bad Request
Expected Behavior
The currency dropdown should send the ISO currency code string ("THB", "USD", etc.) in the currency_code field.
Actual Behavior
The dropdown sends the numeric database ID (e.g. 1007 for THB):
```
json
{
"display_name": "Mr. Joe Smith",
"currency_code": 1007,
...
}
```
The backend rejects this because CreateVendorDto validates currencyCode with @IsString().
Root Cause
The frontend currency <Select> component is using the CURRENCIES.ID column as the option value instead of CURRENCIES.CURRENCY_CODE.
Environment
- Bigcapital version: v0.25.16 (Docker latest as of March 1, 2026)
- Deployment: Self-hosted via Coolify (Docker Compose)
- Browser: Brave 145 / Chromium 145 (also reproducible in other browsers)
Additional Context
The same currency dropdown works correctly on the Customer form — this appears to be specific to the Vendor form. This may also affect the Vendor edit form.
关闭于 2026-03-07 2 条评论