feat: add currency for articles (#834)
Co-authored-by: Jakob Wennberg <jakob.wennberg@gmail.com>
This commit is contained in:
co-authored by
Jakob Wennberg
parent
2a1ec5ec2f
commit
edef48471c
@@ -70,8 +70,8 @@ export const PATCH = withRouteContext(
|
||||
const updateData: Record<string, unknown> = {}
|
||||
for (const key of [
|
||||
'name', 'name_en', 'type', 'unit', 'price_excl_vat', 'vat_rate',
|
||||
'revenue_account', 'cost_price', 'ean', 'housework_type', 'notes',
|
||||
'article_number', 'active',
|
||||
'currency', 'revenue_account', 'cost_price', 'ean', 'housework_type',
|
||||
'notes', 'article_number', 'active',
|
||||
] as const) {
|
||||
if (body[key] !== undefined) updateData[key] = body[key]
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ export const POST = withRouteContext(
|
||||
unit: body.unit ?? 'st',
|
||||
price_excl_vat: body.price_excl_vat,
|
||||
vat_rate: body.vat_rate ?? 25,
|
||||
currency: body.currency ?? 'SEK',
|
||||
revenue_account: body.revenue_account ?? null,
|
||||
cost_price: body.cost_price ?? null,
|
||||
ean: body.ean ?? null,
|
||||
|
||||
Reference in New Issue
Block a user