fix:협업지원금 입력 3자리 콤마 포맷 적용
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -365,6 +365,11 @@ function saveSettlementDate(commissionId, field, value) {
|
||||
});
|
||||
}
|
||||
|
||||
function formatCommissionInput(el) {
|
||||
const raw = el.value.replace(/,/g, '').replace(/[^0-9]/g, '');
|
||||
el.value = raw ? Number(raw).toLocaleString() : '';
|
||||
}
|
||||
|
||||
function onTenantSelect(managementId) {
|
||||
if (!managementId) return;
|
||||
htmx.ajax('GET', '{{ route("finance.sales-commissions.payment-form") }}?management_id=' + managementId, {
|
||||
|
||||
@@ -172,12 +172,13 @@ class="h-6 text-xs px-1 border border-gray-300 rounded cursor-pointer hover:bord
|
||||
{{-- 협업지원금 --}}
|
||||
<td class="px-4 py-2 text-center">
|
||||
@if(!$isGroup)
|
||||
<input type="number"
|
||||
class="w-20 h-6 text-xs px-1 border border-gray-300 rounded cursor-pointer hover:border-orange-400 focus:outline-none focus:border-orange-500 {{ ($commission->referrer_commission ?? 0) > 0 ? 'text-orange-600 font-medium bg-orange-50 border-orange-400' : 'text-gray-500 bg-gray-50' }}"
|
||||
value="{{ ($commission->referrer_commission ?? 0) > 0 ? intval($commission->referrer_commission) : '' }}"
|
||||
<input type="text"
|
||||
class="w-24 h-6 text-xs px-1 border border-gray-300 rounded cursor-pointer hover:border-orange-400 focus:outline-none focus:border-orange-500 text-right {{ ($commission->referrer_commission ?? 0) > 0 ? 'text-orange-600 font-medium bg-orange-50 border-orange-400' : 'text-gray-500 bg-gray-50' }}"
|
||||
value="{{ ($commission->referrer_commission ?? 0) > 0 ? number_format(intval($commission->referrer_commission)) : '' }}"
|
||||
placeholder="0"
|
||||
min="0"
|
||||
onchange="saveSettlementDate({{ $commission->id }}, 'referrer_commission', this.value)">
|
||||
onfocus="this.value = this.value.replace(/,/g, '')"
|
||||
onblur="formatCommissionInput(this)"
|
||||
onchange="saveSettlementDate({{ $commission->id }}, 'referrer_commission', this.value.replace(/,/g, ''))">
|
||||
@else
|
||||
<span class="text-gray-400">-</span>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user