26 lines
894 B
PHP
26 lines
894 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
use App\Models\Concerns\SchoolYearAutoFillTrait;
|
|
|
|
class PurchaseOrderItemModel extends Model
|
|
{
|
|
use SchoolYearAutoFillTrait;
|
|
|
|
protected $table = 'purchase_order_items';
|
|
protected $primaryKey = 'id';
|
|
protected $allowedFields = ['purchase_order_id','supply_id','school_year','description','quantity','received_qty','unit_cost'];
|
|
protected $useTimestamps = true;
|
|
|
|
protected $validationRules = [
|
|
'purchase_order_id' => 'required|is_natural_no_zero',
|
|
'supply_id' => 'required|is_natural_no_zero',
|
|
'school_year' => 'required|string|max_length[9]',
|
|
'quantity' => 'required|is_natural_no_zero',
|
|
'received_qty' => 'if_exist|integer|greater_than_equal_to[0]',
|
|
'unit_cost' => 'required|decimal|greater_than_equal_to[0]',
|
|
];
|
|
}
|