CompanyAccountReceivable.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. use Illuminate\Database\Eloquent\SoftDeletes;
  7. /**
  8. * Contas a Receber avulsas da matriz (franqueadora) — lançamentos manuais.
  9. *
  10. * @property int $id
  11. * @property int|null $financial_plan_account_id
  12. * @property string $origin
  13. * @property string $history
  14. * @property numeric $value
  15. * @property numeric $paid_value
  16. * @property numeric $discount
  17. * @property numeric $fine
  18. * @property \Illuminate\Support\Carbon $due_date
  19. * @property \Illuminate\Support\Carbon|null $payment_date
  20. * @property string $status
  21. * @property string|null $obs
  22. */
  23. class CompanyAccountReceivable extends Model
  24. {
  25. use HasFactory, SoftDeletes;
  26. public const ORIGIN_MANUAL = 'manual';
  27. protected $table = 'company_account_receivables';
  28. protected $guarded = ['id'];
  29. protected $casts = [
  30. 'value' => 'decimal:2',
  31. 'paid_value' => 'decimal:2',
  32. 'discount' => 'decimal:2',
  33. 'fine' => 'decimal:2',
  34. 'due_date' => 'date',
  35. 'payment_date' => 'date',
  36. 'created_at' => 'datetime',
  37. 'updated_at' => 'datetime',
  38. 'deleted_at' => 'datetime',
  39. ];
  40. public function planAccount(): BelongsTo
  41. {
  42. return $this->belongsTo(FinancialPlanAccount::class, 'financial_plan_account_id');
  43. }
  44. }