| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Request;
- use Illuminate\Http\Resources\Json\JsonResource;
- /**
- * Recebível avulso (manual) da unidade, normalizado com os mesmos campos das
- * parcelas de aluno para conviver na mesma listagem de Contas a Receber.
- */
- class UnitAccountReceivableResource extends JsonResource
- {
- public function toArray(Request $request): array
- {
- return [
- 'id' => $this->id,
- 'source' => 'manual',
- 'student_contract_id' => null,
- 'student_id' => $this->student_id,
- 'student_name' => $this->student?->name,
- 'financial_plan_account_id' => $this->financial_plan_account_id,
- 'type' => 'manual',
- 'history' => $this->history,
- 'installment_number' => null,
- 'total_installments' => null,
- 'order' => null,
- 'value' => (float) $this->value,
- 'paid_value' => (float) $this->paid_value,
- 'discount' => (float) $this->discount,
- 'fine' => (float) $this->fine,
- 'due_date' => $this->due_date?->format('Y-m-d'),
- 'payment_date' => $this->payment_date?->format('Y-m-d'),
- 'status' => $this->status,
- 'obs' => $this->obs,
- 'asaas_id' => null,
- 'invoice_url' => null,
- 'billing_type' => null,
- 'asaas_status' => null,
- ];
- }
- }
|