| @@ -442,7 +442,7 @@ class CompoundResourceController extends BaseController | |||
| else{ | |||
| //check the lastest compound number stored in dbase filtered by jenis | |||
| $compound = Compound::where('jenis', $jenis)->withTrashed()->latest()->first(); | |||
| $compound = Compound::where('jenis', $jenis)->whereNotNull('kpd')->withTrashed()->latest()->first(); | |||
| //sanitize compound number to return only integer | |||
| $num = filter_var($compound['kpd'], FILTER_SANITIZE_NUMBER_INT); | |||