备货单&审批流程
This commit is contained in:
@@ -37,13 +37,26 @@ class VehMoneyValue extends Model
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
/**
|
||||
* 允许自动填充模型字段
|
||||
*/
|
||||
protected $fillable = ['id', 'currency', 'amount', 'exchange_rate', 'remark', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* 不允许自动填充模型字段
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'object_scene','object_id','field','currency','amount','exchange_rate',
|
||||
'remark','created_at','updated_at'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'amount' => 'string',
|
||||
'exchange_rate' => 'string',
|
||||
];
|
||||
|
||||
/** 按本行汇率换到结算币;无汇率返回 null */
|
||||
public function amountInSettlement(int $scale = 2): ?string
|
||||
{
|
||||
if ($this->exchange_rate === null) return null;
|
||||
return (string) bcmul((string)$this->amount, (string)$this->exchange_rate, $scale);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user