Merge branch 'dillon/90-e-invoice-e' into vapor/development

This commit is contained in:
Dillon Ngo
2025-12-12 13:10:50 +08:00
18 changed files with 357 additions and 144 deletions
@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddInvoiceStatusToBookingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('bookings', function (Blueprint $table) {
$table->unsignedTinyInteger('invoice_status')
->default(0)
->after('status');
$table->index('invoice_status', 'bookings_invoice_status_index');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('bookings', function (Blueprint $table) {
$table->dropIndex('bookings_invoice_status_index');
$table->dropColumn('invoice_status');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddInvoiceStatusToBookingLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('booking_logs', function (Blueprint $table) {
$table->boolean('invoice_status')
->default(false)
->after('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('booking_logs', function (Blueprint $table) {
$table->dropColumn('invoice_status');
});
}
}
+7 -2
View File
@@ -679,8 +679,13 @@ class DummyDataSeeder extends Seeder
// once the invoice is generated the transaction table will include 2 new transaction type TransactionType::INVOICE, TransactionType::SUPPLIER_DELIVERY
// and for documents will be generated and attached to the booking.
// once this process is complete the booking status will update to ApprovalStatus::COMPLETED
$this->createInvoiceTransactionProcessor->execute($booking);
$this->createInvoiceTransactionProcessor->execute($booking, "", null, [
'generateEInvoice' => false,
'generateEInvoiceWithNormalInvoiceTemplate' => false,
'generateEInvoiceRefund' => false,
'bookingOriginalStatus' => ApprovalStatus::COMPLETED
]
);
}
}