From c7981a7c31bb737b3a6a6827499f54238de12b7b Mon Sep 17 00:00:00 2001 From: daengdeni Date: Mon, 22 Apr 2024 16:50:22 +0700 Subject: [PATCH] update module interest history --- ...065433_create_interest_histories_table.php | 31 +++++++++++++++++++ Entities/InterestHistory.php | 16 ++++++++++ Http/Controllers/HapusBukuController.php | 11 +++++++ 3 files changed, 58 insertions(+) create mode 100644 Database/Migrations/2024_04_22_065433_create_interest_histories_table.php create mode 100644 Entities/InterestHistory.php diff --git a/Database/Migrations/2024_04_22_065433_create_interest_histories_table.php b/Database/Migrations/2024_04_22_065433_create_interest_histories_table.php new file mode 100644 index 0000000..9516bc8 --- /dev/null +++ b/Database/Migrations/2024_04_22_065433_create_interest_histories_table.php @@ -0,0 +1,31 @@ +id(); + $table->string('nomor_pinjaman',20); + $table->string('periode_bunga',6); + $table->string('nilai_bunga_intra'); + $table->string('nilai_bunga_extra'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('interest_histories'); + } +}; diff --git a/Entities/InterestHistory.php b/Entities/InterestHistory.php new file mode 100644 index 0000000..89bbc94 --- /dev/null +++ b/Entities/InterestHistory.php @@ -0,0 +1,16 @@ + $value){ + $bunga = $value->suku_bunga / 100 * $value->baki_debet; + $value->jumlah_bunga = $bunga; + $value->save(); + } + + } }