allow 2 decimals wallets credit

This commit is contained in:
Arnaud Delcasse 2025-07-04 10:53:15 +02:00
parent 3734beeb62
commit af0d632a78
4 changed files with 15 additions and 8 deletions

View File

@ -4,7 +4,7 @@
walletdialog: false
}">
<div class="px-4 py-5 sm:px-6">
<p class="text-center text-lg">Solde : {{if .ViewState.beneficiary.Data.wallet}}{{ .ViewState.beneficiary.Data.wallet }}{{else}}0{{end}} €</p>
<p class="text-center text-lg">Solde : {{if .ViewState.beneficiary.Data.wallet}}{{ printf "%.2f" .ViewState.beneficiary.Data.wallet }}{{else}}0{{end}} €</p>
<button @click="walletdialog = !walletdialog"
class="rounded-2xl border border-transparent bg-co-blue px-4 py-2 my-4 mt-8 w-full text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
Créditer le compte
@ -26,7 +26,7 @@
</div>
<form method="POST" action="/app/wallets/{{.ViewState.beneficiary.ID}}/credit" class="my-4">
<div class="my-8">
<input type="number" id="amount" name="amount" value="0"
<input type="number" step="0.01" id="amount" name="amount" value="0"
class="w-full shadow-sm focus:ring-co-blue focus:border-co-blue px-2 p-1 sm:text-sm border-gray-300 rounded-2xl">
</div>
<div class="mt-5 sm:mt-6">

View File

@ -40,11 +40,11 @@
{{ $driver := (index $.ViewState.solidarity_drivers .DriverId)}}
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ $driver.Data.first_name }} {{ $driver.Data.last_name }}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .DriverDistance }} km</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .PassengerDistance }} km</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if $driver.Data.other_properties}}{{ $driver.Data.other_properties.comment }}{{end}}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">{{ $driver.Data.first_name }} {{ $driver.Data.last_name }}</td>
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .DriverDistance }} km</td>
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .PassengerDistance }} km</td>
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">{{if $driver.Data.other_properties}}{{ $driver.Data.other_properties.comment }}{{end}}</td>
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
{{if solidarityDriverValidatedProfile $driver (solidarityDocuments $driver.ID) }}
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
{{else}}

View File

@ -30,6 +30,10 @@
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Statut
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Prix
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
&nbsp;
@ -69,6 +73,9 @@
<span class="p-1 text-xs bg-co-red text-white rounded-xl">Annulé</span>
{{ end }}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ .Journey.Price.Amount }} {{ .Journey.Price.Currency }}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<a class="text-co-blue" href="/app/solidarity-transport/bookings/{{.Id}}">
Voir

View File

@ -249,7 +249,7 @@
{{end}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Compte mobilié (solde)</dt>
<dd class="mt-1 text-sm text-gray-900">{{if .passenger.Data.wallet}}{{ .passenger.Data.wallet }}{{else}}0{{end}} EUR</dd>
<dd class="mt-1 text-sm text-gray-900">{{if .passenger.Data.wallet}}{{ printf "%.2f" .passenger.Data.wallet }}{{else}}0{{end}} EUR</dd>
</div>
</dl>
</div>