<?php

namespace App\Http\Resources;

use App\Danoral\Entidades\SyncEntidades;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Danoral\U;


class CobrosJSys extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'idESuper'                  => strval( SyncEntidades::cambioID_edif($this->id_EntidadPadre)),
            'idE'                       => strval( SyncEntidades::cambioID_apto($this->id_Entidad)),
            'codE'                      => trim($this->cod_Entidad),
            'fecha'                     => date("d/m/Y",strtotime($this->fechaT)),
            'cta'                       => $this->ctaDT,
            'descripcion'               => $this->descripcion_itemsdt_des,
            'monto'                     => number_format($this->montoDT, 2, ',', '.'),
            'caja'                      => trim($this->refT),
        ];
    }
}
