root 4 years ago
parent
commit
3ddc19b0cd

+ 5
- 2
app/Http/Controllers/Api/CompoundResourceController.php View File

@@ -710,12 +710,15 @@ class CompoundResourceController extends BaseController

//for compound numbering
$countKPD = $this->compound->withTrashed()->count();
$kpd = 'KPD'.$countKPD;
$non = 'KPD'.$countKPD;

$no_siri = date('yn').'-'.$countKPD.'-0';

$compoundData = [
'jenis' => 'Parkir',
'kpd' => 'KPD'.$countKPD,
'kpd' => $kpd,
'non' => $non,
'nama' => '-',
'identity' => '-',
'alamat' => '-',
@@ -931,7 +934,7 @@ class CompoundResourceController extends BaseController
// }else{
// $tawaran = $compound->jumlah_asal_kompaun;
// }
$this->dispatch(new StoreNotice($request->all(), $kpd, $staff->_id, $no_siri));
$this->dispatch(new StoreNotice($request->all(), $non, $staff->_id, $no_siri));

//mobile already accept 'kpd' string, so no need to change string name to 'notis'.
array_push($data, array('kpd' => $non));

+ 3
- 3
app/Jobs/StoreNotice.php View File

@@ -147,7 +147,7 @@ class StoreNotice implements ShouldQueue
// dispatch(new UpdateCompoundPrice($this->kpd));

$staff = Staff::with('StaffDetail')->where('_id', $this->no_badan)->first();
$compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('kpd',$this->kpd)->first();
$compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('kpd',$this->non)->first();

$site = SiteSetting::first();
$faulty = Faulty::with('DeedLaw')->where('_id',$compound->seksyen_kesalahan)->first();
@@ -167,8 +167,8 @@ class StoreNotice implements ShouldQueue
];
$subHistory = [
'no_siri' => $compound->ConfidentialFile->no_siri,
'tajuk' => "Penguatkuasa ".$staff->StaffDetail->full_name." mengeluarkan notis ".$this->kpd,
'huraian' => "Notis ".$this->kpd." telah dikeluarkan oleh penguatkuasa <a href='".url('/main/staff')."/".$staff->_id."/profile'>".$staff->StaffDetail->full_name."</a> di bawah akta seksyen kesalahan [".$faulty->sketr."] ".$faulty->nama,
'tajuk' => "Penguatkuasa ".$staff->StaffDetail->full_name." mengeluarkan notis ".$this->non,
'huraian' => "Notis ".$this->non." telah dikeluarkan oleh penguatkuasa <a href='".url('/main/staff')."/".$staff->_id."/profile'>".$staff->StaffDetail->full_name."</a> di bawah akta seksyen kesalahan [".$faulty->sketr."] ".$faulty->nama,
];

$groupByDate = History::where('tarikh_kumpulan', $gDate)->first();

Loading…
Cancel
Save