|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
|
|
|
|
|
|
//check the lastest compound number stored in dbase filtered by jenis |
|
|
|
|
|
|
|
|
//check the latest compound number stored in dbase filtered by jenis |
|
|
$notice = Compound::where('jenis_n', $jenis)->withTrashed()->latest()->first(); |
|
|
$notice = Compound::where('jenis_n', $jenis)->withTrashed()->latest()->first(); |
|
|
|
|
|
|
|
|
//sanitize compound number to return only integer |
|
|
//sanitize compound number to return only integer |
|
|
|
|
|
|
|
|
}else if($modul == '03') |
|
|
}else if($modul == '03') |
|
|
{ |
|
|
{ |
|
|
//check if theres no 001, start fresh with 0001 |
|
|
//check if theres no 001, start fresh with 0001 |
|
|
if (empty(Compound::where('jenis', $jenis)->where('kpd', $tag.'0001')->first())) { |
|
|
|
|
|
|
|
|
if (empty(Compound::where('jenis', $jenis)->where('kpd', $tag.'0001')->withTrashed()->first())) { |
|
|
|
|
|
|
|
|
$num = '0001'; |
|
|
$num = '0001'; |
|
|
|
|
|
|