<?php

namespace App\Entity;

use App\Repository\AssetregisterRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass=AssetregisterRepository::class)
 */
class Assetregister
{
    public const NUM_ITEMS = 10;
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity=Group::class, inversedBy="assetregisters")
     * @ORM\JoinColumn(nullable=false)
     */
    private $groups;

    /**
     * @ORM\ManyToOne(targetEntity=Subgroup::class, inversedBy="assetregisters")
     * @ORM\JoinColumn(nullable=false)
     */
    private $subgroup;

    /**
     * @ORM\ManyToOne(targetEntity=Assetname::class, inversedBy="assetregisters")
     * @ORM\JoinColumn(nullable=false)
     */
    private $assetname;

    /**
     * @ORM\Column(type="date")
     */
    private $acquisitiondate;

    /**
     * @ORM\Column(type="float")
     */
    private $acquisitioncost;

    /**
     * @ORM\Column(type="string", length=150)
     */
    private $serialno;

    /**
     * @ORM\Column(type="float")
     */
    private $quantity;

    /**
     * @ORM\ManyToOne(targetEntity=Unit::class, inversedBy="assetregisters")
     * @ORM\JoinColumn(nullable=false)
     */
    private $unit;

    /**
     * @ORM\ManyToOne(targetEntity=Vendor::class, inversedBy="assetregisters")
     * @ORM\JoinColumn(nullable=false)
     */
    private $vendor;

    /**
     * @ORM\ManyToOne(targetEntity=Businessunit::class, inversedBy="assetregisters")
     * @ORM\JoinColumn(nullable=false)
     */
    private $businessunit;

    /**
     * @ORM\ManyToOne(targetEntity=Location::class, inversedBy="assetregisters")
     */
    private $location;

    /**
     * @ORM\Column(type="date", nullable=true)
     */
    private $disposaldate;

    /**
     * @ORM\Column(type="float", nullable=true)
     */
    private $disposalamount;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $docpath;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $remarks;

    /**
     * @ORM\Column(type="float", nullable=true)
     */
    private $openingbalence;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $note;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $spnote;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $status;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $type;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $active;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $entrydate;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $entryby;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $editdate;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $editby;

    /**
     * @ORM\Column(type="integer")
     */
    private $totaldepdays;

    /**
     * @ORM\Column(type="date")
     */
    private $lastdepdate;

    /**
     * @ORM\Column(type="float")
     */
    private $depreciationrate;

    /**
     * @ORM\OneToMany(targetEntity=Assetdisposal::class, mappedBy="assetregister")
     */
    private $assetdisposals;

    public function __construct()
    {
        $this->assetdisposals = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getGroups(): ?Group
    {
        return $this->groups;
    }

    public function setGroups(?Group $groups): self
    {
        $this->groups = $groups;

        return $this;
    }

    public function getSubgroup(): ?Subgroup
    {
        return $this->subgroup;
    }

    public function setSubgroup(?Subgroup $subgroup): self
    {
        $this->subgroup = $subgroup;

        return $this;
    }

    public function getAssetname(): ?Assetname
    {
        return $this->assetname;
    }

    public function setAssetname(?Assetname $assetname): self
    {
        $this->assetname = $assetname;

        return $this;
    }

    public function getAcquisitiondate(): ?\DateTimeInterface
    {
        return $this->acquisitiondate;
    }

    public function setAcquisitiondate(\DateTimeInterface $acquisitiondate): self
    {
        $this->acquisitiondate = $acquisitiondate;

        return $this;
    }

    public function getAcquisitioncost(): ?float
    {
        return $this->acquisitioncost;
    }

    public function setAcquisitioncost(float $acquisitioncost): self
    {
        $this->acquisitioncost = $acquisitioncost;

        return $this;
    }

    public function getSerialno(): ?string
    {
        return $this->serialno;
    }

    public function setSerialno(string $serialno): self
    {
        $this->serialno = $serialno;

        return $this;
    }

    public function getQuantity(): ?float
    {
        return $this->quantity;
    }

    public function setQuantity(float $quantity): self
    {
        $this->quantity = $quantity;

        return $this;
    }

    public function getUnit(): ?Unit
    {
        return $this->unit;
    }

    public function setUnit(?Unit $unit): self
    {
        $this->unit = $unit;

        return $this;
    }

    public function getVendor(): ?Vendor
    {
        return $this->vendor;
    }

    public function setVendor(?Vendor $vendor): self
    {
        $this->vendor = $vendor;

        return $this;
    }

    public function getBusinessunit(): ?Businessunit
    {
        return $this->businessunit;
    }

    public function setBusinessunit(?Businessunit $businessunit): self
    {
        $this->businessunit = $businessunit;

        return $this;
    }

    public function getLocation(): ?Location
    {
        return $this->location;
    }

    public function setLocation(?Location $location): self
    {
        $this->location = $location;

        return $this;
    }

    public function getDisposaldate(): ?\DateTimeInterface
    {
        return $this->disposaldate;
    }

    public function setDisposaldate(?\DateTimeInterface $disposaldate): self
    {
        $this->disposaldate = $disposaldate;

        return $this;
    }

    public function getDisposalamount(): ?float
    {
        return $this->disposalamount;
    }

    public function setDisposalamount(?float $disposalamount): self
    {
        $this->disposalamount = $disposalamount;

        return $this;
    }

    public function getDocpath(): ?string
    {
        return $this->docpath;
    }

    public function setDocpath(?string $docpath): self
    {
        $this->docpath = $docpath;

        return $this;
    }

    public function getRemarks(): ?string
    {
        return $this->remarks;
    }

    public function setRemarks(?string $remarks): self
    {
        $this->remarks = $remarks;

        return $this;
    }

    public function getOpeningbalence(): ?float
    {
        return $this->openingbalence;
    }

    public function setOpeningbalence(?float $openingbalence): self
    {
        $this->openingbalence = $openingbalence;

        return $this;
    }

    public function getNote(): ?string
    {
        return $this->note;
    }

    public function setNote(?string $note): self
    {
        $this->note = $note;

        return $this;
    }

    public function getSpnote(): ?string
    {
        return $this->spnote;
    }

    public function setSpnote(?string $spnote): self
    {
        $this->spnote = $spnote;

        return $this;
    }

    public function getStatus(): ?int
    {
        return $this->status;
    }

    public function setStatus(?int $status): self
    {
        $this->status = $status;

        return $this;
    }

    public function getType(): ?int
    {
        return $this->type;
    }

    public function setType(?int $type): self
    {
        $this->type = $type;

        return $this;
    }

    public function getActive(): ?int
    {
        return $this->active;
    }

    public function setActive(?int $active): self
    {
        $this->active = $active;

        return $this;
    }

    public function getEntrydate(): ?\DateTimeInterface
    {
        return $this->entrydate;
    }

    public function setEntrydate(?\DateTimeInterface $entrydate): self
    {
        $this->entrydate = $entrydate;

        return $this;
    }

    public function getEntryby(): ?int
    {
        return $this->entryby;
    }

    public function setEntryby(?int $entryby): self
    {
        $this->entryby = $entryby;

        return $this;
    }

    public function getEditdate(): ?\DateTimeInterface
    {
        return $this->editdate;
    }

    public function setEditdate(?\DateTimeInterface $editdate): self
    {
        $this->editdate = $editdate;

        return $this;
    }

    public function getEditby(): ?int
    {
        return $this->editby;
    }

    public function setEditby(?int $editby): self
    {
        $this->editby = $editby;

        return $this;
    }

    public function getTotaldepdays(): ?int
    {
        return $this->totaldepdays;
    }

    public function setTotaldepdays(int $totaldepdays): self
    {
        $this->totaldepdays = $totaldepdays;

        return $this;
    }

    public function getLastdepdate(): ?\DateTimeInterface
    {
        return $this->lastdepdate;
    }

    public function setLastdepdate(\DateTimeInterface $lastdepdate): self
    {
        $this->lastdepdate = $lastdepdate;

        return $this;
    }

    public function getDepreciationrate(): ?float
    {
        return $this->depreciationrate;
    }

    public function setDepreciationrate(float $depreciationrate): self
    {
        $this->depreciationrate = $depreciationrate;

        return $this;
    }

    /**
     * @return Collection|Assetdisposal[]
     */
    public function getAssetdisposals(): Collection
    {
        return $this->assetdisposals;
    }

    public function addAssetdisposal(Assetdisposal $assetdisposal): self
    {
        if (!$this->assetdisposals->contains($assetdisposal)) {
            $this->assetdisposals[] = $assetdisposal;
            $assetdisposal->setAssetregister($this);
        }

        return $this;
    }

    public function removeAssetdisposal(Assetdisposal $assetdisposal): self
    {
        if ($this->assetdisposals->removeElement($assetdisposal)) {
            // set the owning side to null (unless already changed)
            if ($assetdisposal->getAssetregister() === $this) {
                $assetdisposal->setAssetregister(null);
            }
        }

        return $this;
    }
}
