-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance Bank Statement Reconciliation with Advanced Matching
- Loading branch information
1 parent
288e3e5
commit e52cb09
Showing
4 changed files
with
173 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
database/migrations/2024_02_20_000000_add_reconciliation_fields_to_transactions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
|
||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::table('transactions', function (Blueprint $table) { | ||
$table->boolean('reconciled')->default(false); | ||
$table->text('discrepancy_notes')->nullable(); | ||
$table->timestamp('reconciled_at')->nullable(); | ||
$table->foreignId('reconciled_by_user_id')->nullable()->constrained('users')->nullOnDelete(); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table('transactions', function (Blueprint $table) { | ||
$table->dropForeign(['reconciled_by_user_id']); | ||
$table->dropColumn(['reconciled', 'discrepancy_notes', 'reconciled_at', 'reconciled_by_user_id']); | ||
}); | ||
} | ||
}; |
46 changes: 46 additions & 0 deletions
46
resources/views/bank-statements/reconciliation-result.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
|
||
<div class="space-y-4"> | ||
<div class="flex justify-between"> | ||
<div class="text-sm font-medium text-gray-500">Matched Transactions</div> | ||
<div class="text-sm font-semibold text-green-600">{{ $matched }}</div> | ||
</div> | ||
|
||
<div class="flex justify-between"> | ||
<div class="text-sm font-medium text-gray-500">Unmatched Transactions</div> | ||
<div class="text-sm font-semibold text-red-600">{{ $unmatched }}</div> | ||
</div> | ||
|
||
@if($discrepancies->isNotEmpty()) | ||
<div class="mt-4"> | ||
<div class="text-sm font-medium text-gray-500 mb-2">Discrepancies Found:</div> | ||
<div class="space-y-2"> | ||
@foreach($discrepancies as $discrepancy) | ||
<div class="bg-red-50 p-2 rounded"> | ||
@if($discrepancy['type'] === 'unmatched_transaction') | ||
<div class="text-sm text-red-700"> | ||
Unmatched: {{ money($discrepancy['amount']) }} on {{ $discrepancy['date']->format('Y-m-d') }} | ||
</div> | ||
@elseif($discrepancy['type'] === 'balance_mismatch') | ||
<div class="text-sm text-red-700"> | ||
Balance Mismatch: {{ money($discrepancy['amount']) }} | ||
<div class="text-xs text-red-600"> | ||
Expected: {{ money($discrepancy['expected']) }} | ||
Actual: {{ money($discrepancy['actual']) }} | ||
</div> | ||
</div> | ||
@endif | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endif | ||
|
||
@if($balance_discrepancy != 0) | ||
<div class="mt-4 bg-yellow-50 p-3 rounded"> | ||
<div class="text-sm font-medium text-yellow-800"> | ||
Total Balance Discrepancy: {{ money($balance_discrepancy) }} | ||
</div> | ||
</div> | ||
@endif | ||
</div> |