| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?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\SoftDeletes;
- /**
- * Contas a Receber avulsas da unidade (lançamentos manuais, aluno opcional).
- *
- * @property int $id
- * @property int $unit_id
- * @property int|null $student_id
- * @property int|null $financial_plan_account_id
- * @property string $origin
- * @property string $history
- * @property numeric $value
- * @property numeric $paid_value
- * @property numeric $discount
- * @property numeric $fine
- * @property \Illuminate\Support\Carbon $due_date
- * @property \Illuminate\Support\Carbon|null $payment_date
- * @property string $status
- * @property string|null $obs
- * @property \Illuminate\Support\Carbon|null $created_at
- * @property \Illuminate\Support\Carbon|null $updated_at
- * @property \Illuminate\Support\Carbon|null $deleted_at
- * @property-read \App\Models\FinancialPlanAccount|null $planAccount
- * @property-read \App\Models\Student|null $student
- * @property-read \App\Models\Unit $unit
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable onlyTrashed()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable query()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereCreatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereDeletedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereDiscount($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereDueDate($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereFinancialPlanAccountId($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereFine($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereHistory($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereId($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereObs($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereOrigin($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable wherePaidValue($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable wherePaymentDate($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereStatus($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereStudentId($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereUnitId($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereUpdatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable whereValue($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable withTrashed(bool $withTrashed = true)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountReceivable withoutTrashed()
- * @mixin \Eloquent
- */
- class UnitAccountReceivable extends Model
- {
- use HasFactory, SoftDeletes;
- public const ORIGIN_MANUAL = 'manual';
- protected $table = 'unit_account_receivables';
- protected $guarded = ['id'];
- protected $casts = [
- 'value' => 'decimal:2',
- 'paid_value' => 'decimal:2',
- 'discount' => 'decimal:2',
- 'fine' => 'decimal:2',
- 'due_date' => 'date',
- 'payment_date' => 'date',
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- 'deleted_at' => 'datetime',
- ];
- public function unit(): BelongsTo
- {
- return $this->belongsTo(Unit::class, 'unit_id');
- }
- public function student(): BelongsTo
- {
- return $this->belongsTo(Student::class, 'student_id');
- }
- public function planAccount(): BelongsTo
- {
- return $this->belongsTo(FinancialPlanAccount::class, 'financial_plan_account_id');
- }
- }
|