<?php
namespace App\Entity\Idempiere\MaterialManagement;
/**
* @author rbellorin@sumagroups.com
* @version 2026-02-26
*/
use App\Entity\Idempiere\MProduct;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=StorageOnHandRepository::class, readOnly=true)
* @ORM\Table(name="m_storageonhand")
*/
class StorageOnHand
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
*/
private int $ad_client_id;
/**
* @ORM\Id
* @ORM\Column(type="integer")
*/
private int $ad_org_id;
/**
* @ORM\Column(type="string", length=1)
*/
private string $isactive;
/**
* @ORM\Id
* @ORM\Column(type="integer")
*/
private int $m_locator_id;
/**
* Parte del ID compuesto (y evita el warning).
*
* @ORM\Id
* @ORM\ManyToOne(targetEntity=MProduct::class, inversedBy="storagesOnHand")
* @ORM\JoinColumn(name="m_product_id", referencedColumnName="m_product_id", nullable=false)
*/
private MProduct $product;
/**
* @ORM\Column(type="integer")
*/
private int $qtyonhand;
/**
* @ORM\Column(type="string", length=40)
*/
private string $m_storageonhand_uu;
/**
* Parte del ID compuesto (y evita el warning).
*
* @ORM\Id
* @ORM\ManyToOne(targetEntity=Locator::class, inversedBy="storagesOnHand")
* @ORM\JoinColumn(name="m_locator_id", referencedColumnName="m_locator_id", nullable=false)
*/
private Locator $locator;
// Getters
public function getAdClientId(): int { return $this->ad_client_id; }
public function getAdOrgId(): int { return $this->ad_org_id; }
public function getIsactive(): string { return $this->isactive; }
public function isActive(): bool { return $this->isactive === 'Y'; }
public function getMLocatorId(): int { return $this->m_locator_id; }
public function getProduct(): MProduct { return $this->product; }
public function getMProductId(): int { return (int) $this->product->getMProductId(); }
public function getQtyOnHand(): int { return $this->qtyonhand; }
public function getStorageOnHandUu(): string { return $this->m_storageonhand_uu; }
public function getLocator(): Locator { return $this->locator; }
}