Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TRANSLATIONS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Translation Status

Last updated: 2026-10-07 09:57:47
Last updated: 2026-10-09 09:28:47

Reference locale (en): **346 keys**

Expand Down
10 changes: 5 additions & 5 deletions backend/src/controllers/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const mapRowToProduct = (row: unknown[]): Product => ({
description: (row[2] ?? undefined) as string | undefined,
unitPrice: Number(row[3]) || 0,
sku: (row[4] ?? undefined) as string | undefined,
unit: (row[5] ?? "piece") as string,
unit: (row[5] ?? undefined) as string | undefined,
category: (row[6] ?? undefined) as string | undefined,
taxDefinitionId: (row[7] ?? undefined) as string | undefined,
isActive: Boolean(row[8]),
Expand Down Expand Up @@ -75,7 +75,7 @@ export const createProduct = (data: CreateProductRequest): Product => {

const description = toNullable(data.description);
const sku = toNullable(data.sku);
const unit = toNullable(data.unit) || "piece";
const unit = toNullable(data.unit);
const category = toNullable(data.category);
const taxDefinitionId = toNullable(data.taxDefinitionId);
const hsCode = toNullable(data.hsCode);
Expand Down Expand Up @@ -115,7 +115,7 @@ export const createProduct = (data: CreateProductRequest): Product => {
description: description ?? undefined,
unitPrice: data.unitPrice || 0,
sku: sku ?? undefined,
unit: unit,
unit: unit ?? undefined,
category: category ?? undefined,
taxDefinitionId: taxDefinitionId ?? undefined,
hsCode: hsCode ?? undefined,
Expand Down Expand Up @@ -151,8 +151,8 @@ export const updateProduct = (
data.sku !== undefined ? toNullable(data.sku) : existing.sku ?? null;
const unit =
data.unit !== undefined
? toNullable(data.unit) || "piece"
: existing.unit ?? "piece";
? toNullable(data.unit)
: existing.unit ?? null;
const category =
data.category !== undefined
? toNullable(data.category)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/InvoiceEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

item.description = product.name || item.description;
item.unitPrice = Number(product.unitPrice ?? product.unit_price ?? item.unitPrice ?? 0);
item.unit = String(product.unit ?? item.unit ?? "");
item.unit = String(product.unit ?? "");

if (form.taxMode === "line" && product.taxDefinitionId) {
const taxDef = taxDefinitions.find((t: any) => t.id === product.taxDefinitionId);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/products/[id]/edit/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const actions: Actions = {
description: description || undefined,
unitPrice,
sku: sku || undefined,
unit: unit || undefined,
unit,
category: category || undefined,
taxDefinitionId: taxDefinitionId || undefined,
hsCode,
Expand Down
Loading