Generate the models and migrations for incoming invoices.
This commit is contained in:
55
app/Models/Incoming.php
Normal file
55
app/Models/Incoming.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Incoming extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'supplier_id',
|
||||
'invoice_number',
|
||||
'issue_date',
|
||||
'due_date',
|
||||
'invoice_type_code',
|
||||
'currency_code',
|
||||
'net',
|
||||
'gross',
|
||||
'tax',
|
||||
'pay_date',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the supplier of the incoming invoice.
|
||||
*/
|
||||
public function supplier(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Supplier::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the items (invoice positions) of this incoming invoice.
|
||||
*/
|
||||
public function items(): HasMany
|
||||
{
|
||||
return $this->hasMany(Incomingitem::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tax subtotals for the incoming invoice.
|
||||
*/
|
||||
public function taxes(): HasMany
|
||||
{
|
||||
return $this->hasMany(Incomingtax::class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user