28 lines
576 B
PHP
28 lines
576 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CustomerInvoiceLine extends Model
|
|
{
|
|
protected $table = 'SL_SALESINVOICETRAN';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'QTYTOINVOICE' => 'decimal:2',
|
|
'SELLINGPRICE' => 'decimal:2',
|
|
'COSTPRICE' => 'decimal:2',
|
|
];
|
|
|
|
public function invoice()
|
|
{
|
|
return $this->belongsTo(CustomerInvoice::class, 'REFNO', 'REFNO');
|
|
}
|
|
|
|
public function product()
|
|
{
|
|
return $this->belongsTo(Product::class, 'STOCKCODE', 'STOCKCODE');
|
|
}
|
|
}
|