Update pampasan module with enhanced agreement tracking and semporna processing

- Add agreement_printed_at timestamp to pampasan table for tracking printed agreements
- Update jenis handling for semporna v2 processing logic
- Refactor barangkes controller eager loading for improved performance
- Remove obsolete jenis migration files and consolidate schema changes
- Update related models and controllers for semporna v2 compatibility
This commit is contained in:
Afiq Hamzah
2025-09-22 13:00:08 +08:00
parent 38dd97c4f2
commit f5874b956d
10 changed files with 174 additions and 279 deletions
+3
View File
@@ -2,11 +2,14 @@
namespace App\Support;
use App\Cawangan;
use App\KadarUpah;
use App\Pampasan;
use App\Support\v1\GadaiV1 as Version1Gadai;
use App\Services\MasterServices;
use App\Support\v1\Penebusan;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request as HttpRequest;
use Illuminate\Support\Facades\Log;
+13
View File
@@ -15,6 +15,8 @@ use App\KomuditiPurchase;
use App\KomuditiTransaksi;
use App\Marhun;
use App\Moratorium;
use App\Palsu;
use App\Pampasan;
use App\Support\OnePercent;
use App\Support\Tawarruq;
use App\Support\v1\Calculation as V1Calculation;
@@ -479,6 +481,17 @@ class Penebusan
$upah_rebet_sebenar = $harga_tebus - $gadai['bakipjm'];
}
$isPampasan = Pampasan::on($cawangan['mysql'])->where('norujukan', $request->norujukan)->exists();
if($isPampasan){
$barang_kes = Palsu::on($cawangan['mysql'])->where('norujukan', $norujukan)->first();
$harga_tebus = $barang_kes->untung + $barang_kes->pembiayaan;
$upah_tebus = $barang_kes->untung;
$upah_rebet = $this->kiraUpahRebetSebenar($kodcaw,$norujukan);
$upah_rebet_sebenar = $barang_kes->untung;
$rebet = $gadai['hargajualan'] - $harga_tebus;
}
$create_tebus = Tebus::on($cawangan['mysql'])->create([
'kodcaw'=> $kodcaw,