Merge branch 'staging' into feature/senior-officer
This commit is contained in:
@@ -27,9 +27,4 @@ class PenawaranDetailTender extends Model
|
||||
{
|
||||
return $this->belongsTo(KJPP::class, 'kjpp_rekanan_id', 'id');
|
||||
}
|
||||
|
||||
public function emailTenderLog(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PenawaranEmailTenderLog::class, 'penawaran_id', 'id', PenawaranTender::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,9 @@ class PenawaranEmailTenderLog extends Model
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function penawaran()
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'penawaran_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,17 @@ class PenawaranTender extends Model
|
||||
{
|
||||
return $this->hasMany(PenawaranDetailTender::class, 'penawaran_id', 'id')->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function detail(){
|
||||
return $this->belongsTo(PenawaranDetailTender::class, 'id', 'penawaran_id')->where('status', 1);
|
||||
}
|
||||
// andy add
|
||||
|
||||
public function emailTenderLog(): HasMany
|
||||
{
|
||||
return $this->hasMany(PenawaranEmailTenderLog::class, 'penawaran_id', 'id');
|
||||
}
|
||||
|
||||
public function penawaranKjpp()
|
||||
{
|
||||
return $this->hasMany(PenawaranDetailTender::class, 'penawaran_id');
|
||||
@@ -46,4 +55,8 @@ class PenawaranTender extends Model
|
||||
{
|
||||
return $this->belongsTo(JenisLaporan::class, 'jenis_laporan_id', 'id');
|
||||
}
|
||||
|
||||
public function persetujuan(){
|
||||
return $this->belongsTo(PersetujuanPenawaran::class, 'id', 'penawaran_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
public function penawaranTender()
|
||||
{
|
||||
return $this->hasMany(PenawaranTender::class, 'nomor_registrasi');
|
||||
return $this->belongsTo(PenawaranTender::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function region()
|
||||
|
||||
57
app/Models/PersetujuanPenawaran.php
Normal file
57
app/Models/PersetujuanPenawaran.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Usermanagemenet\Models\User;
|
||||
|
||||
class PersetujuanPenawaran extends Base
|
||||
{
|
||||
|
||||
protected $table = 'persetujuan_penawaran';
|
||||
|
||||
protected $fillable = [
|
||||
'penawaran_id',
|
||||
'nomor_proposal_penawaran',
|
||||
'tanggal_proposal_penawaran',
|
||||
'biaya_final',
|
||||
'sla_resume',
|
||||
'sla_final',
|
||||
'file_persetujuan_penawaran',
|
||||
'surat_representasi',
|
||||
'bukti_bayar',
|
||||
'status',
|
||||
'authorized_status',
|
||||
'authorized_at',
|
||||
'authorized_by',
|
||||
'status',
|
||||
'catatan',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tanggal_proposal_penawaran' => 'date',
|
||||
'sla_resume' => 'date',
|
||||
'sla_final' => 'date',
|
||||
'biaya_final' => 'decimal:2',
|
||||
'status' => 'boolean',
|
||||
'authorized_status' => 'boolean',
|
||||
'authorized_at' => 'datetime',
|
||||
];
|
||||
|
||||
// Relationship with Penawaran
|
||||
public function penawaran()
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'penawaran_id');
|
||||
}
|
||||
|
||||
// Relationship with Region
|
||||
public function region()
|
||||
{
|
||||
return $this->belongsTo(Region::class);
|
||||
}
|
||||
|
||||
// Relationship with User (for authorized_by)
|
||||
public function authorizedBy()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'authorized_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user