the_mechanic/app/Models/InvoiceChildModel.php
venba-Inspriron-3558 b6c809adc9 FIX_Invoice Module
2025-10-23 12:35:23 +05:30

24 lines
773 B
PHP
Executable File

<?php
namespace App\Models;
use CodeIgniter\Model;
class InvoiceChildModel extends Model
{
protected $table = 'invoice_child';
protected $primaryKey = 'invoice_child_id';
protected $allowedFields = ['invoice_child_id','invoice_id','product_id', 'net_price','qty','discount_type','discount','total','tax','amount','isactive','labour_cost'];
protected $beforeInsert = ['setCreatedBy'];
protected $beforeUpdate = ['setUpdatedBy'];
protected function setCreatedBy(array $data)
{
$data['data']['created_by'] = (int) session()->get('logged_user');
return $data;
}
protected function setUpdatedBy(array $data)
{
$data['data']['updated_by'] = (int) session()->get('logged_user');
return $data;
}
}