- Nueva tabla isr_tables y isr_brackets en BD - Controlador IsrController para CRUD de tablas ISR - Integración con pestaña ISR en settings - Soporte para importación via CSV - Captura manual de brackets
36 lines
803 B
PHP
36 lines
803 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class IsrBracket extends Model
|
|
{
|
|
protected $table = 'isr_brackets';
|
|
|
|
protected $fillable = ['isr_table_id', 'lower_limit', 'upper_limit', 'fixed_fee', 'rate', 'order'];
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'lower_limit' => 'decimal:2',
|
|
'upper_limit' => 'decimal:2',
|
|
'fixed_fee' => 'decimal:2',
|
|
'rate' => 'decimal:2',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Relación con la tabla ISR
|
|
*/
|
|
public function isrTable(): BelongsTo
|
|
{
|
|
return $this->belongsTo(IsrTable::class);
|
|
}
|
|
} |