Skip to content

Commit 916f3ec

Browse files
committed
fix: added fixes for the create invoice form
1 parent b885555 commit 916f3ec

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

packages/create-invoice-form/src/lib/invoice/form-view.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
>
233233
<span>Due: </span>
234234
<span
235-
>{currency ? currency.symbol : ""}
235+
>{invoiceCurrency ? invoiceCurrency.symbol : ""}
236236
{" "}
237237
{invoiceTotals.totalAmount.toFixed(2)}</span
238238
>

packages/create-invoice-form/src/lib/invoice/form.svelte

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -398,19 +398,6 @@
398398
</div>
399399
</Accordion>
400400
</div>
401-
402-
<Dropdown
403-
{config}
404-
selectedValue={invoiceCurrency
405-
? `${invoiceCurrency.symbol} ${invoiceCurrency?.network ? `(${invoiceCurrency?.network})` : ""}`
406-
: undefined}
407-
placeholder="Invoice currency (labeling)"
408-
options={defaultCurrencies.map((currency) => ({
409-
value: currency,
410-
label: `${currency.symbol} ${currency?.network ? `(${currency?.network})` : ""}`,
411-
}))}
412-
onchange={handleInvoiceCurrencyChange}
413-
/>
414401
<Dropdown
415402
{config}
416403
placeholder="Payment chain"
@@ -425,6 +412,18 @@
425412
})}
426413
onchange={handleNetworkChange}
427414
/>
415+
<Dropdown
416+
{config}
417+
selectedValue={invoiceCurrency
418+
? `${invoiceCurrency.symbol} ${invoiceCurrency?.network ? `(${invoiceCurrency?.network})` : ""}`
419+
: undefined}
420+
placeholder="Invoice currency (labeling)"
421+
options={defaultCurrencies.map((currency) => ({
422+
value: currency,
423+
label: `${currency.symbol} ${currency?.network ? `(${currency?.network})` : ""}`,
424+
}))}
425+
onchange={handleInvoiceCurrencyChange}
426+
/>
428427
<Dropdown
429428
{config}
430429
placeholder="Settlement currency"

packages/create-invoice-form/src/lib/utils/resetForm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export function getInitialFormData() {
1616
{
1717
name: "",
1818
quantity: 1,
19-
unitPrice: "",
20-
discount: "",
19+
unitPrice: 0,
20+
discount: 0,
2121
tax: {
22-
amount: "",
22+
amount: 0,
2323
type: "percentage" as "fixed" | "percentage",
2424
},
2525
currency: "",

0 commit comments

Comments
 (0)