Files
alrahma_sunday_school/app/Models/PurchaseOrderItemModel.php
T
root a30c1398a1
Tests / PHPUnit (push) Failing after 1m21s
fix financials
2026-07-18 22:57:40 -04:00

22 lines
733 B
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class PurchaseOrderItemModel extends Model
{
protected $table = 'purchase_order_items';
protected $primaryKey = 'id';
protected $allowedFields = ['purchase_order_id','supply_id','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',
'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]',
];
}