diff --git a/apps/web/src/components/invoice-generator/index.tsx b/apps/web/src/components/invoice-generator/index.tsx index 3e64e43..db28f3e 100644 --- a/apps/web/src/components/invoice-generator/index.tsx +++ b/apps/web/src/components/invoice-generator/index.tsx @@ -33,42 +33,20 @@ function InputLabel({ name, htmlId }: { name: string; htmlId: string }) { } function InputRow({ - placeholder, - label, id, - name, - autoComplete, type, - defaultValue, - multiple, - required, - step, - min, - onBeforeInput: onInput, unit, - maxLength, + label, + name, + ...restProps }: GenericFieldProps) { const htmlId = id ?? `inputfield.${name}`; - return (
- - {unit ? {unit} : null} + + {unit ? {unit} : null}
); @@ -239,6 +217,10 @@ function InvoiceItem({ }) { const t = useScopedI18n("invoicegenerator"); + const [quantity, setQuantity] = useState(0); + const [unitPrice, setUnitPrice] = useState(0); + const totalPrice = quantity * unitPrice; + return (
- + setQuantity(Number(e.currentTarget.value))} required /> - +
- - +
+ + + setUnitPrice(Number(e.currentTarget.value))} + required + step={0.01} + min={0} + unit="€" + /> + + + - +
); } diff --git a/apps/web/src/locales/en.ts b/apps/web/src/locales/en.ts index a1b08a6..0b0ee87 100644 --- a/apps/web/src/locales/en.ts +++ b/apps/web/src/locales/en.ts @@ -56,6 +56,7 @@ const en = { "invoicegenerator.Quantity": "Quantity", "invoicegenerator.Unit": "Unit", "invoicegenerator.Unit price": "Unit price", + "invoicegenerator.Total price": "Total price", "invoicegenerator.Attachment": "Attachment", "invoicegenerator.Attachments": "Attachments", "invoicegenerator.Items": "Items", diff --git a/apps/web/src/locales/fi.ts b/apps/web/src/locales/fi.ts index d5cb7ab..e73f49c 100644 --- a/apps/web/src/locales/fi.ts +++ b/apps/web/src/locales/fi.ts @@ -56,6 +56,7 @@ const fi = { "invoicegenerator.Quantity": "Määrä", "invoicegenerator.Unit": "Yksikkö", "invoicegenerator.Unit price": "Yksikköhinta", + "invoicegenerator.Total price": "Yhteensä", "invoicegenerator.Attachment": "Liite", "invoicegenerator.Attachments": "Liitteet", "invoicegenerator.Items": "Erittely",