Files
simrs-jatim/webservice/farmasi/app/MutasiBarang.php
2024-04-19 14:04:41 +07:00

43 lines
1.2 KiB
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
class MutasiBarang extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'KodePeriode', 'KodeDepo', 'KodeBarang', 'StockAwal', 'Masuk','Keluar','StockAkhir','Opname','HPPAwal',
'HPPAkhir', 'StStock', 'HAvgBeli', 'HLastBeliAw', 'HLastBeliAk', 'HTAwal', 'HTAkhir', 'Gabung', 'HargaGabung'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [];
protected $table = 'TTLogMutasiBarang';
protected $primaryKey = ['KodePeriode','KodeDepo','KodeBarang','StStock'];
protected $keyType = 'string';
public $incrementing = false;
protected function setKeysForSaveQuery(Builder $query)
{
$query
->where('KodePeriode', '=', $this->getAttribute('KodePeriode'))
->where('KodeDepo', '=', $this->getAttribute('KodeDepo'));
->where('KodeBarang', '=', $this->getAttribute('KodeBarang'));
->where('StStock', '=', $this->getAttribute('StStock'));
return $query;
}
}