|
|
@@ -26,6 +26,15 @@ public function toArray(Request $request): array
|
|
|
// Banco da movimentação (destino na entrada, origem na saída).
|
|
|
'account_id' => $this->transaction_type === 'entrada' ? $this->to_account_id : $this->from_account_id,
|
|
|
'description' => $this->description,
|
|
|
+ 'financial_plan_account_id' => $this->financial_plan_account_id,
|
|
|
+ 'financial_plan_account' => $this->whenLoaded('financialPlanAccount', function () {
|
|
|
+ return $this->financialPlanAccount ? [
|
|
|
+ 'id' => $this->financialPlanAccount->id,
|
|
|
+ 'code' => $this->financialPlanAccount->code,
|
|
|
+ 'description' => $this->financialPlanAccount->description,
|
|
|
+ 'label' => "{$this->financialPlanAccount->code} - {$this->financialPlanAccount->description}",
|
|
|
+ ] : null;
|
|
|
+ }),
|
|
|
'amount' => (float) $this->amount,
|
|
|
'launch_date' => $this->launch_date,
|
|
|
'origin' => $this->origin,
|