Skip to content

Commit 9c603e5

Browse files
committed
feat(finance): Phase 97 — Expense Claims Management with approval workflow
https://claude.ai/code/session_01RdUGwo74JXChRCF88Yu27d
1 parent 5c04833 commit 9c603e5

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

erp/app/Modules/Finance/Models/ExpenseClaim.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
class ExpenseClaim extends Model
1313
{
14+
protected $table = 'finance_expense_claims';
15+
1416
use BelongsToTenant;
1517
use SoftDeletes;
1618

erp/app/Modules/Finance/Models/ExpenseItem.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
class ExpenseItem extends Model
1010
{
11+
protected $table = 'finance_expense_items';
12+
1113
use BelongsToTenant;
1214

1315
protected $fillable = [

erp/database/migrations/2026_07_27_100001_create_expense_claims_table.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
{
99
public function up(): void
1010
{
11-
Schema::dropIfExists('expense_claim_items');
12-
Schema::dropIfExists('expense_items');
13-
Schema::dropIfExists('expense_claims');
11+
// Finance expense claims use a separate table to avoid conflicting
12+
// with the HR module's expense_claims table (different schema)
13+
Schema::dropIfExists('finance_expense_items');
14+
Schema::dropIfExists('finance_expense_claims');
1415

15-
Schema::create('expense_claims', function (Blueprint $table) {
16+
Schema::create('finance_expense_claims', function (Blueprint $table) {
1617
$table->id();
1718
$table->unsignedBigInteger('tenant_id');
1819
$table->string('reference')->unique();
1920
$table->unsignedBigInteger('submitted_by');
2021
$table->unsignedBigInteger('approved_by')->nullable();
21-
$table->enum('status', ['draft', 'submitted', 'approved', 'rejected', 'paid'])->default('draft');
22+
$table->string('status')->default('draft');
2223
$table->date('claim_date');
2324
$table->string('currency', 3)->default('USD');
2425
$table->decimal('total_amount', 15, 2)->default(0);
@@ -33,6 +34,6 @@ public function up(): void
3334

3435
public function down(): void
3536
{
36-
Schema::dropIfExists('expense_claims');
37+
Schema::dropIfExists('finance_expense_claims');
3738
}
3839
};

erp/database/migrations/2026_07_27_100002_create_expense_items_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
public function up(): void
1010
{
11-
Schema::create('expense_items', function (Blueprint $table) {
11+
Schema::create('finance_expense_items', function (Blueprint $table) {
1212
$table->id();
1313
$table->unsignedBigInteger('tenant_id');
1414
$table->unsignedBigInteger('expense_claim_id');
@@ -23,6 +23,6 @@ public function up(): void
2323

2424
public function down(): void
2525
{
26-
Schema::dropIfExists('expense_items');
26+
Schema::dropIfExists('finance_expense_items');
2727
}
2828
};

0 commit comments

Comments
 (0)