diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index c56f38ff..8da96f12 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -216,9 +216,9 @@ class InvoiceController extends Controller $total = array_reduce($subtotalArray, function ($v1, $v2) { return $v1 + $v2; }); - if ($total != $booking->amount) { + if ($total != $booking->bia) { return response()->json([ - 'message' => 'Booking amount expected is '.$booking->amount.'. Your Invoice amount is '.$total + 'message' => 'Booking amount expected is '.$booking->bia.'. Your Invoice amount is '.$total ], 400); } diff --git a/database/migrations/2020_09_25_154412_add_service_charge_to_bookings.php b/database/migrations/2020_09_25_154412_add_service_charge_to_bookings.php new file mode 100644 index 00000000..114601b7 --- /dev/null +++ b/database/migrations/2020_09_25_154412_add_service_charge_to_bookings.php @@ -0,0 +1,32 @@ +double('service_charge')->default(null)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('bookings', function (Blueprint $table) { + $table->dropColumn('service_charge'); + }); + } +}