Add phone login support and member import functionality
Features: - Support login via phone number or email (LoginRequest) - Add members:import-roster command for Excel roster import - Merge survey emails with roster data Code Quality (Phase 1-4): - Add database locking for balance calculation - Add self-approval checks for finance workflow - Create service layer (FinanceDocumentApprovalService, PaymentVerificationService) - Add HasAccountingEntries and HasApprovalWorkflow traits - Create FormRequest classes for validation - Add status-badge component - Define authorization gates in AuthServiceProvider - Add accounting config file Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,10 +38,13 @@ class CashierLedgerEntry extends Model
|
||||
* 類型常數
|
||||
*/
|
||||
const ENTRY_TYPE_RECEIPT = 'receipt';
|
||||
|
||||
const ENTRY_TYPE_PAYMENT = 'payment';
|
||||
|
||||
const PAYMENT_METHOD_BANK_TRANSFER = 'bank_transfer';
|
||||
|
||||
const PAYMENT_METHOD_CHECK = 'check';
|
||||
|
||||
const PAYMENT_METHOD_CASH = 'cash';
|
||||
|
||||
/**
|
||||
@@ -74,11 +77,13 @@ class CashierLedgerEntry extends Model
|
||||
|
||||
/**
|
||||
* 取得最新餘額(從最後一筆記錄)
|
||||
* 注意:調用此方法時應在 DB::transaction() 中進行,以確保鎖定生效
|
||||
*/
|
||||
public static function getLatestBalance(string $bankAccount = null): float
|
||||
public static function getLatestBalance(?string $bankAccount = null): float
|
||||
{
|
||||
$query = self::orderBy('entry_date', 'desc')
|
||||
->orderBy('id', 'desc');
|
||||
->orderBy('id', 'desc')
|
||||
->lockForUpdate();
|
||||
|
||||
if ($bankAccount) {
|
||||
$query->where('bank_account', $bankAccount);
|
||||
|
||||
Reference in New Issue
Block a user