| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?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;
- /**
- * @property int $id
- * @property int $unit_id
- * @property int|null $franchisee_account_receive_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\FranchiseeAccountReceive|null $franchiseeAccountReceive
- * @property-read \App\Models\Unit $unit
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable onlyTrashed()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable query()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereCreatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereDeletedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereDiscount($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereDueDate($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereFine($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereFranchiseeAccountReceiveId($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereHistory($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereId($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereObs($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereOrigin($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable wherePaidValue($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable wherePaymentDate($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereStatus($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereUnitId($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereUpdatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable whereValue($value)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable withTrashed(bool $withTrashed = true)
- * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitAccountPayable withoutTrashed()
- * @mixin \Eloquent
- */
- class UnitAccountPayable extends Model
- {
- use HasFactory, SoftDeletes;
- public const ORIGIN_TBR = 'tbr';
- public const ORIGIN_MANUAL = 'manual';
- protected $table = 'unit_account_payables';
- 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 franchiseeAccountReceive(): BelongsTo
- {
- return $this->belongsTo(FranchiseeAccountReceive::class, 'franchisee_account_receive_id');
- }
- }
|