Initial commit: Horux Strategy Platform
- Laravel 11 backend with API REST - React 18 + TypeScript + Vite frontend - Multi-parser architecture for accounting systems (CONTPAQi, Aspel, SAP) - 27+ financial metrics calculation - PDF report generation with Browsershot - Complete documentation (10 documents) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
57
backend/app/Models/Balanza.php
Normal file
57
backend/app/Models/Balanza.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Balanza extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'cliente_id',
|
||||
'periodo_inicio',
|
||||
'periodo_fin',
|
||||
'sistema_origen',
|
||||
'archivo_original',
|
||||
'status',
|
||||
'error_mensaje',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'periodo_inicio' => 'date',
|
||||
'periodo_fin' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
public function cliente(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Cliente::class);
|
||||
}
|
||||
|
||||
public function cuentas(): HasMany
|
||||
{
|
||||
return $this->hasMany(Cuenta::class);
|
||||
}
|
||||
|
||||
public function reportes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Reporte::class, 'reporte_balanza');
|
||||
}
|
||||
|
||||
public function cuentasActivas(): HasMany
|
||||
{
|
||||
return $this->hasMany(Cuenta::class)->where('excluida', false);
|
||||
}
|
||||
|
||||
public function cuentasPadre(): HasMany
|
||||
{
|
||||
return $this->hasMany(Cuenta::class)->where('es_cuenta_padre', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user