diff --git a/app/Http/Controllers/AdminPaymentController.php b/app/Http/Controllers/AdminPaymentController.php index eaafe59..632d7a8 100644 --- a/app/Http/Controllers/AdminPaymentController.php +++ b/app/Http/Controllers/AdminPaymentController.php @@ -25,6 +25,7 @@ class AdminPaymentController extends Controller 'amount' => ['required', 'numeric', 'min:0'], 'method' => ['nullable', 'string', 'max:255'], 'reference' => ['nullable', 'string', 'max:255'], + 'receipt_number' => ['nullable', 'string', 'max:255'], ]); $payment = $member->payments()->create($validated); @@ -52,6 +53,7 @@ class AdminPaymentController extends Controller 'amount' => ['required', 'numeric', 'min:0'], 'method' => ['nullable', 'string', 'max:255'], 'reference' => ['nullable', 'string', 'max:255'], + 'receipt_number' => ['nullable', 'string', 'max:255'], ]); $payment->update($validated); diff --git a/app/Http/Controllers/PaymentVerificationController.php b/app/Http/Controllers/PaymentVerificationController.php index 84a4c76..29f6fee 100644 --- a/app/Http/Controllers/PaymentVerificationController.php +++ b/app/Http/Controllers/PaymentVerificationController.php @@ -46,7 +46,8 @@ class PaymentVerificationController extends Controller $query->whereHas('member', function ($q) use ($search) { $q->where('full_name', 'like', "%{$search}%") ->orWhere('email', 'like', "%{$search}%"); - })->orWhere('reference', 'like', "%{$search}%"); + })->orWhere('reference', 'like', "%{$search}%") + ->orWhere('receipt_number', 'like', "%{$search}%"); } $payments = $query->paginate(20)->withQueryString(); diff --git a/app/Models/MembershipPayment.php b/app/Models/MembershipPayment.php index 401797e..f2c1570 100644 --- a/app/Models/MembershipPayment.php +++ b/app/Models/MembershipPayment.php @@ -39,6 +39,7 @@ class MembershipPayment extends Model 'disability_discount', 'method', 'reference', + 'receipt_number', 'status', 'payment_method', 'receipt_path', diff --git a/database/migrations/2026_02_05_163500_add_receipt_number_to_membership_payments_table.php b/database/migrations/2026_02_05_163500_add_receipt_number_to_membership_payments_table.php new file mode 100644 index 0000000..36a3415 --- /dev/null +++ b/database/migrations/2026_02_05_163500_add_receipt_number_to_membership_payments_table.php @@ -0,0 +1,30 @@ +string('receipt_number')->nullable()->after('reference'); + }); + + DB::table('membership_payments') + ->whereNull('receipt_number') + ->whereNotNull('reference') + ->where('reference', '<>', '') + ->where('notes', 'like', '2026-02-03 會員名冊與會員費與捐款統計資料.xlsx%') + ->update(['receipt_number' => DB::raw('reference')]); + } + + public function down(): void + { + Schema::table('membership_payments', function (Blueprint $table) { + $table->dropColumn('receipt_number'); + }); + } +}; diff --git a/lang/zh_TW.json b/lang/zh_TW.json index 14da49a..87d9504 100644 --- a/lang/zh_TW.json +++ b/lang/zh_TW.json @@ -296,6 +296,7 @@ "Submitted By": "提交者", "Verify": "審核", "Receipt": "收據", + "Receipt Number": "收據編號", "Download Receipt": "下載收據", "Edit member": "編輯會員", "Full name": "全名", diff --git a/resources/views/admin/members/show.blade.php b/resources/views/admin/members/show.blade.php index c90247b..540a195 100644 --- a/resources/views/admin/members/show.blade.php +++ b/resources/views/admin/members/show.blade.php @@ -366,6 +366,9 @@ 方式 + + 收據編號 + 狀態 @@ -394,6 +397,9 @@ {{ $payment->payment_method_label ?? ($payment->method ?? __('N/A')) }} + + {{ $payment->receipt_number ?? '—' }} + {!! $payment->status_label ?? '' . __('Legacy') . '' !!} @@ -435,7 +441,7 @@ @empty - + diff --git a/resources/views/admin/payment-verifications/index.blade.php b/resources/views/admin/payment-verifications/index.blade.php index 8f624e6..a0935fb 100644 --- a/resources/views/admin/payment-verifications/index.blade.php +++ b/resources/views/admin/payment-verifications/index.blade.php @@ -79,7 +79,7 @@
-
-
參考編號
+
收據編號
+
{{ $payment->receipt_number ?? '—' }}
+
+ +
+
付款參考
{{ $payment->reference ?? '—' }}
@@ -326,4 +331,4 @@ }); @endpush - \ No newline at end of file + diff --git a/resources/views/admin/payments/create.blade.php b/resources/views/admin/payments/create.blade.php index c383db1..bdc9685 100644 --- a/resources/views/admin/payments/create.blade.php +++ b/resources/views/admin/payments/create.blade.php @@ -83,7 +83,7 @@
+
+ + + @error('receipt_number') +

{{ $message }}

+ @enderror +
+