-
-
- {group.currency}
-
-
{
- // Permit digits and at most one decimal point.
- const v = e.target.value.replace(/[^0-9.]/g, '')
- const parts = v.split('.')
- const sanitized = parts.length > 2
- ? parts[0] + '.' + parts.slice(1).join('')
- : v
- setSettlingAmount(sanitized)
- }}
- onKeyDown={(e) => {
- if (e.key === 'Enter') recordSettlement(t, settlingAmount)
- if (e.key === 'Escape') { setSettlingIndex(null); setSettlingAmount('') }
- }}
- placeholder={t.amount.toFixed(2)}
- aria-label="Amount paid"
- className="w-full pl-12 pr-3 py-2 text-[16px] font-mono rounded-lg
- border border-osps-gray-light focus:border-osps-green focus:outline-none
- focus:ring-2 focus:ring-osps-green/20 transition-all"
- />
+ {isConfirming && (
+
+ {!isOwnedByMe && (
+
+ Recording payment on behalf of {fromName}
+
+ )}
+
+
+
+ {group.currency}
+
+ {
+ // Permit digits and at most one decimal point.
+ const v = e.target.value.replace(/[^0-9.]/g, '')
+ const parts = v.split('.')
+ const sanitized = parts.length > 2
+ ? parts[0] + '.' + parts.slice(1).join('')
+ : v
+ setSettlingAmount(sanitized)
+ }}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') recordSettlement(t, settlingAmount)
+ if (e.key === 'Escape') { setSettlingIndex(null); setSettlingAmount('') }
+ }}
+ placeholder={t.amount.toFixed(2)}
+ aria-label="Amount paid"
+ className="w-full pl-12 pr-3 py-2 text-[16px] font-mono rounded-lg
+ border border-osps-gray-light focus:border-osps-green focus:outline-none
+ focus:ring-2 focus:ring-osps-green/20 transition-all"
+ />
+
+
+
-
-
)}
diff --git a/supabase/migrations/allow_member_record_settlement.sql b/supabase/migrations/allow_member_record_settlement.sql
new file mode 100644
index 0000000..3ff320b
--- /dev/null
+++ b/supabase/migrations/allow_member_record_settlement.sql
@@ -0,0 +1,8 @@
+-- Allow any group member to record a settlement, not just the payer.
+-- The payer (paid_by) is still whoever the transaction says — this just
+-- removes the restriction that the recorder must be the payer.
+drop policy "Members can create settlements" on public.settlements;
+
+create policy "Members can create settlements"
+ on public.settlements for insert
+ with check (public.is_group_member(group_id));