<?phpnamespace App\Entity\FattureInCloud;use App\API\FattureInCloud\Response\DocumentoArticoloResponse;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity() */class DocumentoArticolo{ /** * Not mapped to API, needed by doctrine * @var int * * @ORM\Id() * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ private $entity_id; /** * Identificativo del prodotto (se nullo, non è presente tra i prodotti) * * @var string|null * * @ORM\Column(type="string", nullable=true) */ private $id; /** * Codice prodotto * * @var string * * @ORM\Column(type="string") */ private $codice; /** * Nome articolo * * @var string * * @ORM\Column(type="string") */ private $nome; /** * Unità di misura per il prodotto * * @var string * * @ORM\Column(type="string") */ private $um; /** * Quantità di prodotto * * @var double * * @ORM\Column(type="float") */ private $quantita; /** * Descrizione del prodotto * * @var string * * @ORM\Column(type="string") */ private $descrizione; /** * Categoria del prodotto (utilizzata per il piano dei conti) * * @var string * * @ORM\Column(type="string") */ private $categoria; /** * Prezzo unitario netto (IVA esclusa) * * @var double * * @ORM\Column(type="float") */ private $prezzo_netto; /** * Prezzo unitario lordo (comprensivo di IVA) * * @var double * * @ORM\Column(type="float") */ private $prezzo_lordo; /** * Valore IVA (percentuale) * * @var double * * @ORM\Column(type="float") */ private $valore_iva; /** * Descrizione della tipologia di IVA * * @var string * * @ORM\Column(type="string") */ private $desc_iva; /** * [Non presente in ordforn e ddt] Indica se l'articolo è imponibile * * @var boolean * * @ORM\Column(type="boolean") */ private $tassabile; /** * [Non presente in ddt] Sconto (percentuale) * * @var double * * @ORM\Column(type="float") */ private $sconto; /** * [Non presente in ordforn e ddt] Indica se a questo articolo vengono applicate ritenute e contributi * * @var boolean * * @ORM\Column(type="boolean") */ private $applica_ra_contributi; /** * Ordine dell'articolo in fattura (ordinamento ascendente) * * @var integer * * @ORM\Column(type="integer") */ private $ordine; /** * [Non presente in ordforn e ddt] Evidenzia l'eventuale sconto in fattura * * @var boolean * * @ORM\Column(type="boolean") */ private $sconto_rosso; /** * [Non presente in ordforn e ddt] Indica se l'articolo è incluso nel DDT (se presente, altrimenti non è significativo) * * @var boolean * * @ORM\Column(type="boolean") */ private $in_ddt; /** * Indica se viene movimentato il magazzino (true: viene movimentato; false: non viene movimentato) [Non presente se in ordforn e ddt, oppure se il prodotto non è collegato all'elenco prodotti, oppure la funzionalità magazzino era disattiva al momento della creazione del documento] * * @var boolean|null * * @ORM\Column(type="boolean", nullable=true) */ private $magazzino; /** * @var DocumentoDettagliato * * @ORM\ManyToOne(targetEntity="DocumentoDettagliato", inversedBy="lista_articoli") */ private $documento; public function __construct(DocumentoArticoloResponse $articolo) { $this->setId($articolo->getId()); $this->setCodice($articolo->getCodice()); $this->setNome($articolo->getNome()); $this->setUm($articolo->getUm()); $this->setQuantita($articolo->getQuantita()); $this->setDescrizione($articolo->getDescrizione()); $this->setCategoria($articolo->getCategoria()); $this->setPrezzoNetto($articolo->getPrezzoNetto()); $this->setPrezzoLordo($articolo->getPrezzoLordo()); $this->setValoreIva($articolo->getValoreIva()); $this->setDescIva($articolo->getDescIva()); $this->setTassabile($articolo->isTassabile()); $this->setSconto($articolo->getSconto()); $this->setApplicaRaContributi($articolo->isApplicaRaContributi()); $this->setOrdine($articolo->getOrdine()); $this->setScontoRosso($articolo->isScontoRosso()); $this->setInDdt($articolo->isInDdt()); $this->setMagazzino($articolo->isMagazzino()); } /** * @return string|null */ public function getId():? string { return $this->id; } /** * @param string|null $id * @return DocumentoArticolo */ public function setId(?string $id): DocumentoArticolo { $this->id = $id; return $this; } /** * @return string */ public function getCodice(): string { return $this->codice; } /** * @param string $codice * @return DocumentoArticolo */ public function setCodice(string $codice): DocumentoArticolo { $this->codice = $codice; return $this; } /** * @return string */ public function getNome(): string { return $this->nome; } /** * @param string $nome * @return DocumentoArticolo */ public function setNome(string $nome): DocumentoArticolo { $this->nome = $nome; return $this; } /** * @return string */ public function getUm(): string { return $this->um; } /** * @param string $um * @return DocumentoArticolo */ public function setUm(string $um): DocumentoArticolo { $this->um = $um; return $this; } /** * @return float */ public function getQuantita(): float { return $this->quantita; } /** * @param float $quantita * @return DocumentoArticolo */ public function setQuantita(float $quantita): DocumentoArticolo { $this->quantita = $quantita; return $this; } /** * @return string */ public function getDescrizione(): string { return $this->descrizione; } /** * @param string $descrizione * @return DocumentoArticolo */ public function setDescrizione(string $descrizione): DocumentoArticolo { $this->descrizione = $descrizione; return $this; } /** * @return string */ public function getCategoria(): string { return $this->categoria; } /** * @param string $categoria * @return DocumentoArticolo */ public function setCategoria(string $categoria): DocumentoArticolo { $this->categoria = $categoria; return $this; } /** * @return float */ public function getPrezzoNetto(): float { return $this->prezzo_netto; } /** * @param float $prezzo_netto * @return DocumentoArticolo */ public function setPrezzoNetto(float $prezzo_netto): DocumentoArticolo { $this->prezzo_netto = $prezzo_netto; return $this; } /** * @return float */ public function getPrezzoLordo(): float { return $this->prezzo_lordo; } /** * @param float $prezzo_lordo * @return DocumentoArticolo */ public function setPrezzoLordo(float $prezzo_lordo): DocumentoArticolo { $this->prezzo_lordo = $prezzo_lordo; return $this; } /** * @return float */ public function getValoreIva(): float { return $this->valore_iva; } /** * @param float $valore_iva * @return DocumentoArticolo */ public function setValoreIva(float $valore_iva): DocumentoArticolo { $this->valore_iva = $valore_iva; return $this; } /** * @return string */ public function getDescIva(): string { return $this->desc_iva; } /** * @param string $desc_iva * @return DocumentoArticolo */ public function setDescIva(string $desc_iva): DocumentoArticolo { $this->desc_iva = $desc_iva; return $this; } /** * @return bool */ public function isTassabile(): bool { return $this->tassabile; } /** * @param bool $tassabile * @return DocumentoArticolo */ public function setTassabile(bool $tassabile): DocumentoArticolo { $this->tassabile = $tassabile; return $this; } /** * @return float */ public function getSconto(): float { return $this->sconto; } /** * @param float $sconto * @return DocumentoArticolo */ public function setSconto(float $sconto): DocumentoArticolo { $this->sconto = $sconto; return $this; } /** * @return bool */ public function isApplicaRaContributi(): bool { return $this->applica_ra_contributi; } /** * @param bool $applica_ra_contributi * @return DocumentoArticolo */ public function setApplicaRaContributi(bool $applica_ra_contributi): DocumentoArticolo { $this->applica_ra_contributi = $applica_ra_contributi; return $this; } /** * @return int */ public function getOrdine(): int { return $this->ordine; } /** * @param int $ordine * @return DocumentoArticolo */ public function setOrdine(int $ordine): DocumentoArticolo { $this->ordine = $ordine; return $this; } /** * @return bool */ public function isScontoRosso(): bool { return $this->sconto_rosso; } /** * @param bool $sconto_rosso * @return DocumentoArticolo */ public function setScontoRosso(bool $sconto_rosso): DocumentoArticolo { $this->sconto_rosso = $sconto_rosso; return $this; } /** * @return bool */ public function isInDdt(): bool { return $this->in_ddt; } /** * @param bool $in_ddt * @return DocumentoArticolo */ public function setInDdt(bool $in_ddt): DocumentoArticolo { $this->in_ddt = $in_ddt; return $this; } /** * @return bool|null */ public function getMagazzino(): ?bool { return $this->magazzino; } /** * @param bool|null $magazzino * @return DocumentoArticolo */ public function setMagazzino(?bool $magazzino): DocumentoArticolo { $this->magazzino = $magazzino; return $this; } /** * @return DocumentoDettagliato */ public function getDocumento(): DocumentoDettagliato { return $this->documento; } /** * @param DocumentoDettagliato $documento * @return DocumentoArticolo */ public function setDocumento(DocumentoDettagliato $documento): DocumentoArticolo { $this->documento = $documento; return $this; }}