feat: add total balance calculation and display in account management; update account card to show calculated balance
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m26s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m26s
This commit is contained in:
@@ -25,6 +25,7 @@ interface AccountFormData {
|
||||
folderId: string;
|
||||
externalUrl: string;
|
||||
initialBalance: number;
|
||||
totalBalance: number;
|
||||
}
|
||||
|
||||
interface AccountEditDialogProps {
|
||||
@@ -101,21 +102,42 @@ export function AccountEditDialog({
|
||||
</Select>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>Solde initial</Label>
|
||||
<Label>Solde total</Label>
|
||||
<Input
|
||||
type="number"
|
||||
step="0.01"
|
||||
value={formData.initialBalance}
|
||||
value={formData.totalBalance}
|
||||
onChange={(e) =>
|
||||
onFormDataChange({
|
||||
...formData,
|
||||
initialBalance: parseFloat(e.target.value) || 0,
|
||||
totalBalance: parseFloat(e.target.value) || 0,
|
||||
})
|
||||
}
|
||||
placeholder="0.00"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Solde de départ pour équilibrer le compte
|
||||
Solde total du compte (balance + solde initial)
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>Solde initial</Label>
|
||||
<Input
|
||||
type="number"
|
||||
step="0.01"
|
||||
value={formData.initialBalance}
|
||||
onChange={(e) => {
|
||||
const newInitialBalance = parseFloat(e.target.value) || 0;
|
||||
onFormDataChange({
|
||||
...formData,
|
||||
initialBalance: newInitialBalance,
|
||||
// Ajuster le solde total pour maintenir la cohérence
|
||||
totalBalance: formData.totalBalance,
|
||||
});
|
||||
}}
|
||||
placeholder="0.00"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Solde de départ pour équilibrer le compte. Le balance sera calculé automatiquement (solde total - solde initial).
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user