Merge branch 'main' into amirah

This commit is contained in:
Amirah22
2022-04-17 14:03:58 +08:00
17 changed files with 165 additions and 9447 deletions
+50 -70
View File
@@ -473,6 +473,7 @@ class MarhunController extends Controller
->get()->toArray();
$lelongbid = LelongBid::where('id', $lelbidmarhun->lelongbid_id)->where('lelong_id', $id)->first();
// dd($lelongbid);
$karat = Lelkarat::where('lelong_id', $id)->get();
foreach($marhuns as $index1=>$marhun)
@@ -512,40 +513,31 @@ class MarhunController extends Controller
public function terimaperubahan(Request $request)
{
dd($request->all());
//update mutu marhun - gadaimarhun
// dd($request->all());
$user = Auth::user();
$currentdate = Carbon::now();
$currentdate = $currentdate->toDateTimeString();
$pengesahan = Pengesahan::where('id', $request->pengesahan_id)
$pengesahan = Pengesahan::where('norujukan', $request->norujukan)
->first();
dd($pengesahan);
$pengesahan->disahkan_oleh = $user->id;
$pengesahan->disahkan_pada = $currentdate;
$pengesahan->update();
$gadaimarhun = GadaiMarhun::where('norujukan', $pengesahan->norujukan)->delete();
$pengesahan->id = $pengesahan['id'] ;
$pengesahan->disahkan_oleh = $user['id'];
$pengesahan->disahkan_pada = $currentdate;
$pengesahan->save();
// dd($pengesahan);
$lelongbid = LelongBid::where('id', $pengesahan->lelongbid_id)->get();
$lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $pengesahan->lelongbid_id)->get();
foreach($lelongbidmarhun as $bidmarhun)
{
$newmarhun = new GadaiMarhun;
$newmarhun->norujukan = $pengesahan->norujukan;
$newmarhun->bil = $bidmarhun->bil;
$newmarhun->marhun = $bidmarhun->marhun;
$newmarhun->nota = $bidmarhun->nota;
$newmarhun->karat = $bidmarhun->karat;
$newmarhun->berat = $bidmarhun->berat;
$newmarhun->save();
}
if($request->jenis_button == "terima")
{
$lelongbidmarhuns = LelongBidMarhun::join('pengesahan', 'lelongbidmarhun.lelongbid_id', '=', 'pengesahan.lelongbid_id')
->where('pengesahan.lelongbid_id', $pengesahan->lelongbid_id)
->where('pengesahan.id', $request->pengesahan_id)
->where('pengesahan.id', $pengesahan->id)
->get();
dd($lelongbidmarhuns['marhun']);
foreach($lelongbidmarhuns as $bidmarhuns)
{
@@ -555,53 +547,53 @@ class MarhunController extends Controller
}
else
{
$bidmarhuns->bil = $bidmarhun->bil;
$bidmarhuns->marhun = $bidmarhun->marhun;
$bidmarhuns->nota = $bidmarhun->nota;
$bidmarhuns->karat = $bidmarhun->karat;
$bidmarhuns->berat = $bidmarhun->berat;
$bidmarhuns->update();
//
}
}
}
$pengesahan = Pengesahan::join('lelongbidmarhun', 'pengesahan.lelongbid_id', '=', 'lelongbidmarhun.lelongbid_id')
->where('pengesahan.lelongbid_id', $pengesahan->lelongbid_id)
->select('pengesahan.id as pengesahan_id')
->first();
$marhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbid_id','=',$pengesahan->lelongbid_id)
->get();
$lelongbid = LelongBid::where('id', $pengesahan->lelongbid_id)->first();
$txtmarhun = ",1 " . $lelongbidmarhuns->marhun ;
$lelongbid->marhun = str_replace( $txtmarhun,"",$lelongbid->marhun);
$lelongbid->berat = $lelongbid->berat - $lelongbidmarhuns->berat;
$lelongbid->hargaasas = $lelongbid->hargaasas - $lelongbidmarhuns->hargaasas;
$lelongbid->save();
// $this->pcdelete($request->pengesahan_id, $pengesahan->lelongbid_id);
}
else if($request->jenis_button == "tangguhlelong")
{
//add into table tangguhlelong
$tangguhlelong = new TangguhLelong;
$tangguhlelong->lelong_id = $pengesahan->lelong_id;
$tangguhlelong->lelongbid_id = $pengesahan->lelongbid_id;
$tangguhlelong->norujukan = $pengesahan->norujukan;
$tangguhlelong->tarikhtangguh = $currentdate;
$tangguhlelong->ditangguh_oleh = $user->id;
$tangguhlelong->ditangguh_pada = $currentdate;
$tangguhlelong->nota = 'Ditangguh Kerana Perubahan Mutu/Karat Marhun';
$tangguhlelong->save();
// $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $pengesahan->lelongbid_id)->delete();
//add into table tangguhlelong
$tangguhlelong = new TangguhLelong;
$tangguhlelong->lelong_id = $pengesahan->lelong_id;
$tangguhlelong->lelongbid_id = $pengesahan->lelongbid_id;
$tangguhlelong->norujukan = $pengesahan->norujukan;
$tangguhlelong->pinjaman = $lelongbid[0]['pinjaman'];
$tangguhlelong->tarikhtangguh = $currentdate;
$tangguhlelong->ditangguh_oleh = $user->id;
$tangguhlelong->ditangguh_pada = $currentdate;
$tangguhlelong->nota = $request->nota;
$tangguhlelong->save();
// dd($tangguhlelong);
$marhundelete = LelongBid::where('id', $pengesahan->lelongbid_id)->delete();
}
$this->pcdelete($request->pengesahan_id, $pengesahan->lelongbid_id);
// $lelongbidmarhunlast = LelongBidMarhun::where('lelongbid_id', $pengesahan->lelongbid_id)->get();
else
{
//
}
// $pengesahanlast = Pengesahan::join('lelongbidmarhun', 'pengesahan.lelongbid_id', '=', 'lelongbidmarhun.lelongbid_id')
// ->where('lelongbidmarhun.id', $lelongbidmarhunlast->id)
// ->where('lelongbid_id', $pengesahan->lelongbid_id)
// ->where('pengesahan.id', $request->pengesahan_id)
// ->first();
// $marhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
// ->where('lelongbid_id','=', $pengesahan->lelongbid_id)
// ->get();
// $lelongbid = LelongBid::where('lelongbid_id', $lelongbidmarhunlast->lelongbid_id)->first();
// $txtmarhun = ",1 " . $lelongbidmarhunlast->marhun ;
// $lelongbid->marhun = str_replace( $txtmarhun,"",$lelongbid->marhun);
// $lelongbid->berat = $lelongbid->berat - $lelongbidmarhunlast->berat_emastambahan;
// $lelongbid->hargaasas = $lelongbid->hargaasas - $lelongbidmarhunlast->harga_asastambahan;
// $lelongbid->save();
return redirect()->route('pengesahan.senarailelongubahmutu')->with('success','Pengesahan Mutu Marhun Berjaya');
}
@@ -640,14 +632,11 @@ class MarhunController extends Controller
public function pcdelete($id, $lelongbid_id)
{
$lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelongbid_id)->first();
$pengesahan = Pengesahan::join('lelongbidmarhun', 'pengesahan.lelongbid_id', '=', 'lelongbidmarhun.lelongbid_id')
->where('pengesahan.lelongbidmarhun_id', $lelongbidmarhun->id)
->where('pengesahan.lelongbid_id', $lelongbid_id)
->select('pengesahan.id as pengesahan_id')
->first();
$marhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbid_id','=',$lelongbid_id)
->get();
@@ -658,16 +647,7 @@ class MarhunController extends Controller
$lelongbid->berat = $lelongbid->berat - $lelongbidmarhun->berat_emastambahan;
$lelongbid->hargaasas = $lelongbid->hargaasas - $lelongbidmarhun->harga_asastambahan;
$lelongbid->save();
if($pengesahan != null)
{
$lelongbidmarhun->delete();
}
$marhundelete = LelongBidMarhun::where('lelongbid_id', $pengesahan->lelongbid_id)->delete();
// return redirect()->route('pengesahan.perubahanmutumarhun')
// ->with('success','Pengesahan Padam Marhun Telah Berjaya');
}
public function senarailelong()
+1 -1
View File
@@ -319,7 +319,7 @@ class SimulasiController extends Controller
foreach($cawangansim as $cawsim)
{
$cawangan = Cawangan::where('id','=',$cawsim->caw_id)->first();
$databid = SimulasiBid::where('simulasi_id','=',$simulasi_id)->get();
$databid = SimulasiBid::where('caw_id','=',$cawsim->caw_id)->where('simulasi_id','=',$simulasi_id)->get();
$packet = 0;
$berat = 0;
@@ -30,6 +30,7 @@ class CreateCawangansTable extends Migration
$table->string('nofaks')->nullable();
$table->string('lokasi')->nullable();
$table->string('pkb_jmc')->nullable();
$table->string('para2')->nullable();
$table->timestamps();
});
@@ -64,7 +64,7 @@ class CreateSimulasisTable extends Migration
$table->decimal('nilaimarhun', $precision = 9, $scale = 2);
$table->decimal('pinjaman', $precision = 9, $scale = 2);
$table->decimal('bakiupah', $precision = 7, $scale = 2);
$table->decimal('cajlain', $precision = 7, $scale = 2);
$table->decimal('cajlain', $precision = 7, $scale = 2)->nullable();
$table->decimal('cajlelong', $precision = 7, $scale = 2);
$table->decimal('baki', $precision = 9, $scale = 2);
$table->decimal('berat', $precision = 7, $scale = 2);
@@ -67,7 +67,7 @@ class CreateLelongsTable extends Migration
$table->decimal('nilaimarhun', $precision = 9, $scale = 2);
$table->decimal('pinjaman', $precision = 9, $scale = 2);
$table->decimal('bakiupah', $precision = 7, $scale = 2);
$table->decimal('cajlain', $precision = 7, $scale = 2);
$table->decimal('cajlain', $precision = 7, $scale = 2)->nullable();
$table->decimal('cajlelong', $precision = 7, $scale = 2);
$table->decimal('baki', $precision = 9, $scale = 2);
$table->decimal('berat', $precision = 7, $scale = 2);
@@ -27,17 +27,17 @@ class CreatePengesahanTable extends Migration
$table->integer('status_ubah')->default(0); //1 = ubah mutu, 2 = tambah marhun, 3 = hapus marhun, 4 = ubah berat, 5 = ubah mutu & berat
$table->timestamps();
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
// $table->foreign('lelong_id')
// ->references('id')->on('lelong')
// ->onDelete('cascade');
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
// $table->foreign('lelongbid_id')
// ->references('id')->on('lelongbid')
// ->onDelete('cascade');
$table->foreign('lelongbidmarhun_id')
->references('id')->on('lelongbidmarhun')
->onDelete('cascade');
// $table->foreign('lelongbidmarhun_id')
// ->references('id')->on('lelongbidmarhun')
// ->onDelete('cascade');
});
}
@@ -18,19 +18,20 @@ class CreateTangguhlelongTable extends Migration
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->unsignedBigInteger('lelongbid_id')->unsigned();
$table->string('norujukan');
$table->string('pinjaman', $precision = 9, $scale = 2);
$table->datetime('tarikhtangguh')->nullable();
$table->integer('ditangguh_oleh');
$table->datetime('ditangguh_pada');
$table->string('nota');
$table->timestamps();
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
// $table->foreign('lelong_id')
// ->references('id')->on('lelong')
// ->onDelete('cascade');
$table->foreign('lelongbid_id')
->references('id')->on('lelongbid')
->onDelete('cascade');
// $table->foreign('lelongbid_id')
// ->references('id')->on('lelongbid')
// ->onDelete('cascade');
});
}
+10 -10
View File
@@ -17,19 +17,19 @@ class KaratSeeder extends Seeder
JenisKarat::create([
'karat' => '24.0Kgb',
'keterangan' => '999.00 Gold Bar',
'dariharga916' => 35
'dariharga916' => 12.86
]);
JenisKarat::create([
'karat' => '24.0K',
'keterangan' => '999.00',
'dariharga916' => 30
'dariharga916' => 11.02
]);
JenisKarat::create([
'karat' => '23.0K',
'keterangan' => '950.00',
'dariharga916' => 3
'dariharga916' => 1.10
]);
JenisKarat::create([
@@ -41,43 +41,43 @@ class KaratSeeder extends Seeder
JenisKarat::create([
'karat' => '21.0K',
'keterangan' => '900.00',
'dariharga916' => -25
'dariharga916' => -9.20
]);
JenisKarat::create([
'karat' => '20.0K',
'keterangan' => '835.00',
'dariharga916' => -60
'dariharga916' => -22.06
]);
JenisKarat::create([
'karat' => '18.0Kp',
'keterangan' => '750.00 putih',
'dariharga916' => -125
'dariharga916' => -45.96
]);
JenisKarat::create([
'karat' => '18.0K',
'keterangan' => '750.00',
'dariharga916' => -125
'dariharga916' => -45.96
]);
JenisKarat::create([
'karat' => '14.0Kp',
'keterangan' => '585.00 putih',
'dariharga916' => -252
'dariharga916' => -92.65
]);
JenisKarat::create([
'karat' => '14.0K',
'keterangan' => '585.00',
'dariharga916' => -252
'dariharga916' => -92.65
]);
JenisKarat::create([
'karat' => '9.0K',
'keterangan' => '375.00',
'dariharga916' => -380
'dariharga916' => -139.71
]);
+2
View File
@@ -115,6 +115,7 @@ class RolesSeeder extends Seeder
'name' => 'notistamatkontrak',
'description' => 'Notis 30 Hari Sebelum Tamat Kontrak'
]);
//account
Permission::create([
@@ -168,6 +169,7 @@ class RolesSeeder extends Seeder
$role6->givePermissionTo('pengesahanpembida');
$role6->givePermissionTo('pengesahan');
$role6->givePermissionTo('notistamatkontrak');
$role6->givePermissionTo('kemaskinihargaasas');
$role7 = Role::create(['name' => 'account']);
$role7->givePermissionTo('pengesahanbayaran');
+26 -9337
View File
File diff suppressed because it is too large Load Diff
@@ -141,7 +141,7 @@
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 25,
"pageLength": 100000000,
dom: 'Bfrtip',
// buttons: [
// // 'copy', 'excel', 'pdf'
@@ -152,4 +152,3 @@ tr:nth-child(even) {
</tbody>
@@ -100,7 +100,7 @@
@elseif($detail[0]['status_ubah'] == 5)
<button class="btn btn-warning btn-sm hovernone-warning" disabled>PENGURANGAN MUTU & BERAT</button>
@else
@endif
</td>
</tr>
@@ -109,11 +109,40 @@
</table>
<div class="modal-footer" style="margin-top:2%;">
<a href="{{ route('pengesahan.perubahanmutumarhun', $id) }}" class="btn btn-primary">Kembali</a>
<button type="button" class="btn btn-danger" onclick="functerima(this)" id="tangguhlelong" >Tangguh Lelong</button>
<button type="button" class="btn btn-danger" onclick="functerima(this)" data-idmarhun="{{ $lelongbid->id }}" data-norujukan="{{ $lelongbid->norujukan }}" id="tangguhlelong" >Tangguh Lelong</button>
<button type="button" class="btn btn-success" onclick="functerima(this)" id="terima" >Teruskan Lelong</button>
</div>
</form>
</div>
<div class="modal fade" data-backdrop="static" tabindex="-1" id="modalremark">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Tangguh Lelong</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('pengesahan.terimaperubahan') }}" method="POST" id="formremark">
@csrf
<input type="hidden" name="norujukan" value="{{ $norujukan }}" />
<input type="hidden" name="lelong_id" value="{{ $id }}" />
<input type="hidden" name="lelongbid_id" value="{{ $lelongbid->id }}" />
<input type="hidden" name="jenis_button" value="tangguhlelong" id="jenis_button" />
<div class="form-group">
<label for="message-text" class="col-form-label">Sila Nyatakan Sebab Tangguh Lelong:</label>
<textarea class="form-control" id="nota" name="nota"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" style="width:15%;" data-dismiss="modal">Tutup</button>
<button type="button" class="btn btn-primary" style="width:15%;" onclick="submit(this)">Sahkan</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
@@ -131,9 +160,26 @@
else if(jenis == "tangguhlelong")
{
$('#jenis_button').val(jenis);
$("#formmutumarhun").submit();
$('#modalremark').modal('show');
let idmarhun = $(e).data('idmarhun');
let norujukan = $(e).data('norujukan');
$('#idmarhun').val(idmarhun);
$('#norujukan').val(norujukan);
console.log(idmarhun, norujukan);
// $("#formmutumarhun").submit();
}
}
function submit(e)
{
let idmarhun = $(e).data('idmarhun');
let norujukan = $(e).data('norujukan');
$('#idmarhun').val(idmarhun);
$('#norujukan').val(norujukan);
$("#formremark").submit();
}
var tablemutumarhun = $('#tablemutumarhun').DataTable( {
"columnDefs": [
@@ -142,8 +188,8 @@
"orderable": false
},
{
"targets": 8,
"orderable": false
"targets": 9,
"orderable": true
}
],
order: [[1, 'asc']],
@@ -64,11 +64,11 @@
"orderable": false
},
{
"targets": 3,
"targets": 4,
"orderable": false
}
],
order: [[1, 'asc']],
order: [[1, 'desc']],
// "ordering": false,
"info": false,
"lengthChange": false,
@@ -141,7 +141,7 @@
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 25,
"pageLength": 10000000,
dom: 'Bfrtip',
// buttons: [
// // 'copy', 'excel', 'pdf'
@@ -17,7 +17,7 @@
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
<th>Tarikh Lelong</th>
<th>Harga Emas Asas</th>
<th>Cawangan</th>
<th>JBG</th>
<th>Caj Lelong</th>
<th class="text-center">Action</th>
@@ -340,7 +340,7 @@
"orderable": false
}
],
order: [[1, 'asc']],
order: [[0, 'asc']],
// "ordering": false,
"searching":false,
"info": false,