restaurant changes
This commit is contained in:
0
Modules/PurchaseEntry/app/Models/.gitkeep
Normal file
0
Modules/PurchaseEntry/app/Models/.gitkeep
Normal file
42
Modules/PurchaseEntry/app/Models/PurchaseEntry.php
Normal file
42
Modules/PurchaseEntry/app/Models/PurchaseEntry.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PurchaseEntry\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Customer\Models\Customer;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Modules\PurchaseEntry\Models\PurchaseEntryDetail;
|
||||
use Modules\Supplier\Models\Supplier;
|
||||
|
||||
class PurchaseEntry extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_purchaseentries';
|
||||
protected $fillable = [
|
||||
'supplier_id',
|
||||
'purchase_date',
|
||||
'payment',
|
||||
'paymentmode_id',
|
||||
'paymentref',
|
||||
'total_amt',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
|
||||
public function purchaseEntryDetails():HasMany{
|
||||
return $this->hasMany(PurchaseEntryDetail::class,'purchaseentry_id');
|
||||
}
|
||||
|
||||
public function supplier():BelongsTo{
|
||||
return $this->belongsTo(Supplier::class);
|
||||
}
|
||||
|
||||
public static function getFillableField(){
|
||||
return (new self())->fillable;
|
||||
}
|
||||
}
|
39
Modules/PurchaseEntry/app/Models/PurchaseEntryDetail.php
Normal file
39
Modules/PurchaseEntry/app/Models/PurchaseEntryDetail.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PurchaseEntry\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\PurchaseEntry\Models\PurchaseEntry;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Modules\Supplier\Models\Supplier;
|
||||
|
||||
|
||||
class PurchaseEntryDetail extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_purchaseentrydetails';
|
||||
protected $fillable = [
|
||||
'purchaseentry_id',
|
||||
'product_id',
|
||||
'category_id',
|
||||
'stock_id',
|
||||
'size_id',
|
||||
'unit',
|
||||
'price',
|
||||
'rate',
|
||||
'quantity',
|
||||
'amount',
|
||||
'desc',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
|
||||
public function order(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PurchaseEntry::class);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user