Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /home/elvh3918/public_html/tenant/app/Models/Trans/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/elvh3918/public_html/tenant/app/Models/Trans/POS.php
<?php

namespace App\Models\Trans;

use Illuminate\Database\Eloquent\Model;

class POS extends Model
{
    protected $table = "pos";
    protected $fillable = [
        'format',
        'series',
        'date_trans',
        'tenant_id',
        'user_id',
        'curr_id',
        'curr_id_to',
        'curr_rate',
        'qty',
        'total',
        'discount',
        'charge',
        'vat',
        'pos_type',
        'payment_type',
        'payment_id',
        'description',
    ];

    public function getCreatedAtAttribute()
    {
        return \Carbon\Carbon::parse($this->attributes['created_at'])->diffForHumans();
    }

    public function getUpdatedAtAttribute()
    {
        return \Carbon\Carbon::parse($this->attributes['updated_at'])->diffForHumans();
    }

    public function tenant()
    {
        return $this->belongsTo('App\Models\Master\Tenant', 'tenant_id');
    }

    public function user()
    {
        return $this->belongsTo('App\Models\User', 'user_id');
    }

    public function currency()
    {
        return $this->belongsTo('App\Models\Admin\Settings\Currency', 'curr_id');
    }

    public function currency_to()
    {
        return $this->belongsTo('App\Models\Admin\Settings\Currency', 'curr_id_to');
    }

    public function payment()
    {
        return $this->morphTo();
    }
    
    public function pos_details()
    {
        return $this->hasMany('App\Models\Trans\POS_Detail', 'pos_id', 'id');
    }

    public function common_code_pos_types()
    {
        return $this->belongsTo('App\Models\Admin\Settings\CommonCode', 'trans_type')->where('code', '=', 'POS_Types');
    }
}

Yohohohohohooho | Sanrei Aya