diff --git a/modules/EcommerceFinance/Services/FinanceLedgerInternalTransferEditor.php b/modules/EcommerceFinance/Services/FinanceLedgerInternalTransferEditor.php index 9caacdeb..30cd1248 100644 --- a/modules/EcommerceFinance/Services/FinanceLedgerInternalTransferEditor.php +++ b/modules/EcommerceFinance/Services/FinanceLedgerInternalTransferEditor.php @@ -112,7 +112,7 @@ class FinanceLedgerInternalTransferEditor } if ($created > 0) { - $this->audit('internal_transfer_create', $approvalNo, [ + $this->audit('internal_xfer_create', $approvalNo, [ 'txn_date' => $date, 'from_account_short' => $from, 'to_account_short' => $to, @@ -162,7 +162,7 @@ class FinanceLedgerInternalTransferEditor ->where('source', FinanceLedgerTransactionWriter::INTERNAL_TRANSFER_SOURCE) ->where('approval_no', $approvalNo) ->delete(); - $this->audit('internal_transfer_delete', $approvalNo, [ + $this->audit('internal_xfer_delete', $approvalNo, [ 'rows' => $rows->map(static fn (object $item): array => [ 'account_short' => (string) $item->account_short, 'income' => round((float) $item->income, 2), diff --git a/tests/Feature/Business/FinanceLedgerManualTransactionTest.php b/tests/Feature/Business/FinanceLedgerManualTransactionTest.php index a2b6f1f3..a4bce2d0 100644 --- a/tests/Feature/Business/FinanceLedgerManualTransactionTest.php +++ b/tests/Feature/Business/FinanceLedgerManualTransactionTest.php @@ -435,6 +435,10 @@ class FinanceLedgerManualTransactionTest extends FeatureTestCase 'account_short' => '手工账户乙', 'current_balance' => 30, ], 'business_mirror'); + $this->assertDatabaseHas('fin_ledger_edit_events', [ + 'entity_type' => 'internal_xfer_create', + 'user_name' => 'Test User', + ], 'business_mirror'); $this->postJson($this->internalTransferUrl(), $payload) ->assertOk() @@ -469,6 +473,10 @@ class FinanceLedgerManualTransactionTest extends FeatureTestCase 'account_short' => '手工账户乙', 'current_balance' => 0, ], 'business_mirror'); + $this->assertDatabaseHas('fin_ledger_edit_events', [ + 'entity_type' => 'internal_xfer_delete', + 'user_name' => 'Test User', + ], 'business_mirror'); } public function test_internal_transfer_page_and_same_account_validation(): void