fix #23: allow empty convertedTotal

This commit is contained in:
vas3k
2025-05-22 19:42:41 +02:00
parent 347cf2a0e8
commit 289b436236
3 changed files with 18 additions and 14 deletions

View File

@@ -146,15 +146,17 @@ export default function TransactionEditForm({
/>
{formData.currencyCode !== settings.default_currency || formData.convertedTotal !== 0 ? (
<>
<FormInput
title={`Total converted to ${formData.convertedCurrencyCode || "UNKNOWN CURRENCY"}`}
type="number"
step="0.01"
name="convertedTotal"
defaultValue={formData.convertedTotal.toFixed(2)}
isRequired={fieldMap.convertedTotal.isRequired}
className="max-w-36"
/>
{formData.convertedTotal !== null && (
<FormInput
title={`Total converted to ${formData.convertedCurrencyCode || "UNKNOWN CURRENCY"}`}
type="number"
step="0.01"
name="convertedTotal"
defaultValue={formData.convertedTotal.toFixed(2)}
isRequired={fieldMap.convertedTotal.isRequired}
className="max-w-36"
/>
)}
{(!formData.convertedCurrencyCode || formData.convertedCurrencyCode !== settings.default_currency) && (
<FormSelectCurrency
title="Convert to"