stock module changes 3 -vadivel J

This commit is contained in:
vadivel J 2024-10-22 14:14:03 +05:30
parent c96e12221b
commit b614019747
2 changed files with 10 additions and 7 deletions

View File

@ -212,15 +212,18 @@ class StockController extends BaseController
->where('materialCode',$materialCode) ->where('materialCode',$materialCode)
->first(); ->first();
if($resultExists){
if(!empty($resultExists)){
$this->incomingSilicaSandDetails_model $updated = $this->incomingSilicaSandDetails_model
->where('igrNo_fk', $IGRNO) ->where('igrNo_fk', $IGRNO)
->where('materialCode', $materialCode) ->where('materialCode', $materialCode)
->update($dbData); ->set($dbData)
->update();
}else{ }else{
$this->incomingSilicaSandDetails_model->insert($dbData); $inserted = $this->incomingSilicaSandDetails_model->insert($dbData);
} }
} }

View File

@ -18,8 +18,8 @@ class IncomingSilicaSandDetailsModel extends Model
'moistureLoss', 'moistureLossQty','sieveLossQty','salableQty', 'remark', 'moistureLoss', 'moistureLossQty','sieveLossQty','salableQty', 'remark',
'is_active','created_at','updated_at']; 'is_active','created_at','updated_at'];
protected bool $allowEmptyInserts = true; protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = false; protected bool $updateOnlyChanged = true;
protected array $casts = []; protected array $casts = [];
protected array $castHandlers = []; protected array $castHandlers = [];