src/Entity/FattureInCloud/DocumentoArticolo.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\FattureInCloud;
  3. use App\API\FattureInCloud\Response\DocumentoArticoloResponse;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity()
  7.  */
  8. class DocumentoArticolo
  9. {
  10.     /**
  11.      * Not mapped to API, needed by doctrine
  12.      * @var int
  13.      *
  14.      * @ORM\Id()
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\GeneratedValue(strategy="AUTO")
  17.      */
  18.     private $entity_id;
  19.     /**
  20.      * Identificativo del prodotto (se nullo, non è presente tra i prodotti)
  21.      *
  22.      * @var string|null
  23.      *
  24.      * @ORM\Column(type="string", nullable=true)
  25.      */
  26.     private $id;
  27.     /**
  28.      * Codice prodotto
  29.      *
  30.      * @var string
  31.      *
  32.      * @ORM\Column(type="string")
  33.      */
  34.     private $codice;
  35.     /**
  36.      * Nome articolo
  37.      *
  38.      * @var string
  39.      *
  40.      * @ORM\Column(type="string")
  41.      */
  42.     private $nome;
  43.     /**
  44.      * Unità di misura per il prodotto
  45.      *
  46.      * @var string
  47.      *
  48.      * @ORM\Column(type="string")
  49.      */
  50.     private $um;
  51.     /**
  52.      * Quantità di prodotto
  53.      *
  54.      * @var double
  55.      *
  56.      * @ORM\Column(type="float")
  57.      */
  58.     private $quantita;
  59.     /**
  60.      * Descrizione del prodotto
  61.      *
  62.      * @var string
  63.      *
  64.      * @ORM\Column(type="string")
  65.      */
  66.     private $descrizione;
  67.     /**
  68.      * Categoria del prodotto (utilizzata per il piano dei conti)
  69.      *
  70.      * @var string
  71.      *
  72.      * @ORM\Column(type="string")
  73.      */
  74.     private $categoria;
  75.     /**
  76.      * Prezzo unitario netto (IVA esclusa)
  77.      *
  78.      * @var double
  79.      *
  80.      * @ORM\Column(type="float")
  81.      */
  82.     private $prezzo_netto;
  83.     /**
  84.      * Prezzo unitario lordo (comprensivo di IVA)
  85.      *
  86.      * @var double
  87.      *
  88.      * @ORM\Column(type="float")
  89.      */
  90.     private $prezzo_lordo;
  91.     /**
  92.      * Valore IVA (percentuale)
  93.      *
  94.      * @var double
  95.      *
  96.      * @ORM\Column(type="float")
  97.      */
  98.     private $valore_iva;
  99.     /**
  100.      * Descrizione della tipologia di IVA
  101.      *
  102.      * @var string
  103.      *
  104.      * @ORM\Column(type="string")
  105.      */
  106.     private $desc_iva;
  107.     /**
  108.      * [Non presente in ordforn e ddt] Indica se l'articolo è imponibile
  109.      *
  110.      * @var boolean
  111.      *
  112.      * @ORM\Column(type="boolean")
  113.      */
  114.     private $tassabile;
  115.     /**
  116.      * [Non presente in ddt] Sconto (percentuale)
  117.      *
  118.      * @var double
  119.      *
  120.      * @ORM\Column(type="float")
  121.      */
  122.     private $sconto;
  123.     /**
  124.      * [Non presente in ordforn e ddt] Indica se a questo articolo vengono applicate ritenute e contributi
  125.      *
  126.      * @var boolean
  127.      *
  128.      * @ORM\Column(type="boolean")
  129.      */
  130.     private $applica_ra_contributi;
  131.     /**
  132.      * Ordine dell'articolo in fattura (ordinamento ascendente)
  133.      *
  134.      * @var integer
  135.      *
  136.      * @ORM\Column(type="integer")
  137.      */
  138.     private $ordine;
  139.     /**
  140.      * [Non presente in ordforn e ddt] Evidenzia l'eventuale sconto in fattura
  141.      *
  142.      * @var boolean
  143.      *
  144.      * @ORM\Column(type="boolean")
  145.      */
  146.     private $sconto_rosso;
  147.     /**
  148.      * [Non presente in ordforn e ddt] Indica se l'articolo è incluso nel DDT (se presente, altrimenti non è significativo)
  149.      *
  150.      * @var boolean
  151.      *
  152.      * @ORM\Column(type="boolean")
  153.      */
  154.     private $in_ddt;
  155.     /**
  156.      * 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]
  157.      *
  158.      * @var boolean|null
  159.      *
  160.      * @ORM\Column(type="boolean", nullable=true)
  161.      */
  162.     private $magazzino;
  163.     /**
  164.      * @var DocumentoDettagliato
  165.      *
  166.      * @ORM\ManyToOne(targetEntity="DocumentoDettagliato", inversedBy="lista_articoli")
  167.      */
  168.     private $documento;
  169.     public function __construct(DocumentoArticoloResponse $articolo)
  170.     {
  171.         $this->setId($articolo->getId());
  172.         $this->setCodice($articolo->getCodice());
  173.         $this->setNome($articolo->getNome());
  174.         $this->setUm($articolo->getUm());
  175.         $this->setQuantita($articolo->getQuantita());
  176.         $this->setDescrizione($articolo->getDescrizione());
  177.         $this->setCategoria($articolo->getCategoria());
  178.         $this->setPrezzoNetto($articolo->getPrezzoNetto());
  179.         $this->setPrezzoLordo($articolo->getPrezzoLordo());
  180.         $this->setValoreIva($articolo->getValoreIva());
  181.         $this->setDescIva($articolo->getDescIva());
  182.         $this->setTassabile($articolo->isTassabile());
  183.         $this->setSconto($articolo->getSconto());
  184.         $this->setApplicaRaContributi($articolo->isApplicaRaContributi());
  185.         $this->setOrdine($articolo->getOrdine());
  186.         $this->setScontoRosso($articolo->isScontoRosso());
  187.         $this->setInDdt($articolo->isInDdt());
  188.         $this->setMagazzino($articolo->isMagazzino());
  189.     }
  190.     /**
  191.      * @return string|null
  192.      */
  193.     public function getId():? string
  194.     {
  195.         return $this->id;
  196.     }
  197.     /**
  198.      * @param string|null $id
  199.      * @return DocumentoArticolo
  200.      */
  201.     public function setId(?string $id): DocumentoArticolo
  202.     {
  203.         $this->id $id;
  204.         return $this;
  205.     }
  206.     /**
  207.      * @return string
  208.      */
  209.     public function getCodice(): string
  210.     {
  211.         return $this->codice;
  212.     }
  213.     /**
  214.      * @param string $codice
  215.      * @return DocumentoArticolo
  216.      */
  217.     public function setCodice(string $codice): DocumentoArticolo
  218.     {
  219.         $this->codice $codice;
  220.         return $this;
  221.     }
  222.     /**
  223.      * @return string
  224.      */
  225.     public function getNome(): string
  226.     {
  227.         return $this->nome;
  228.     }
  229.     /**
  230.      * @param string $nome
  231.      * @return DocumentoArticolo
  232.      */
  233.     public function setNome(string $nome): DocumentoArticolo
  234.     {
  235.         $this->nome $nome;
  236.         return $this;
  237.     }
  238.     /**
  239.      * @return string
  240.      */
  241.     public function getUm(): string
  242.     {
  243.         return $this->um;
  244.     }
  245.     /**
  246.      * @param string $um
  247.      * @return DocumentoArticolo
  248.      */
  249.     public function setUm(string $um): DocumentoArticolo
  250.     {
  251.         $this->um $um;
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return float
  256.      */
  257.     public function getQuantita(): float
  258.     {
  259.         return $this->quantita;
  260.     }
  261.     /**
  262.      * @param float $quantita
  263.      * @return DocumentoArticolo
  264.      */
  265.     public function setQuantita(float $quantita): DocumentoArticolo
  266.     {
  267.         $this->quantita $quantita;
  268.         return $this;
  269.     }
  270.     /**
  271.      * @return string
  272.      */
  273.     public function getDescrizione(): string
  274.     {
  275.         return $this->descrizione;
  276.     }
  277.     /**
  278.      * @param string $descrizione
  279.      * @return DocumentoArticolo
  280.      */
  281.     public function setDescrizione(string $descrizione): DocumentoArticolo
  282.     {
  283.         $this->descrizione $descrizione;
  284.         return $this;
  285.     }
  286.     /**
  287.      * @return string
  288.      */
  289.     public function getCategoria(): string
  290.     {
  291.         return $this->categoria;
  292.     }
  293.     /**
  294.      * @param string $categoria
  295.      * @return DocumentoArticolo
  296.      */
  297.     public function setCategoria(string $categoria): DocumentoArticolo
  298.     {
  299.         $this->categoria $categoria;
  300.         return $this;
  301.     }
  302.     /**
  303.      * @return float
  304.      */
  305.     public function getPrezzoNetto(): float
  306.     {
  307.         return $this->prezzo_netto;
  308.     }
  309.     /**
  310.      * @param float $prezzo_netto
  311.      * @return DocumentoArticolo
  312.      */
  313.     public function setPrezzoNetto(float $prezzo_netto): DocumentoArticolo
  314.     {
  315.         $this->prezzo_netto $prezzo_netto;
  316.         return $this;
  317.     }
  318.     /**
  319.      * @return float
  320.      */
  321.     public function getPrezzoLordo(): float
  322.     {
  323.         return $this->prezzo_lordo;
  324.     }
  325.     /**
  326.      * @param float $prezzo_lordo
  327.      * @return DocumentoArticolo
  328.      */
  329.     public function setPrezzoLordo(float $prezzo_lordo): DocumentoArticolo
  330.     {
  331.         $this->prezzo_lordo $prezzo_lordo;
  332.         return $this;
  333.     }
  334.     /**
  335.      * @return float
  336.      */
  337.     public function getValoreIva(): float
  338.     {
  339.         return $this->valore_iva;
  340.     }
  341.     /**
  342.      * @param float $valore_iva
  343.      * @return DocumentoArticolo
  344.      */
  345.     public function setValoreIva(float $valore_iva): DocumentoArticolo
  346.     {
  347.         $this->valore_iva $valore_iva;
  348.         return $this;
  349.     }
  350.     /**
  351.      * @return string
  352.      */
  353.     public function getDescIva(): string
  354.     {
  355.         return $this->desc_iva;
  356.     }
  357.     /**
  358.      * @param string $desc_iva
  359.      * @return DocumentoArticolo
  360.      */
  361.     public function setDescIva(string $desc_iva): DocumentoArticolo
  362.     {
  363.         $this->desc_iva $desc_iva;
  364.         return $this;
  365.     }
  366.     /**
  367.      * @return bool
  368.      */
  369.     public function isTassabile(): bool
  370.     {
  371.         return $this->tassabile;
  372.     }
  373.     /**
  374.      * @param bool $tassabile
  375.      * @return DocumentoArticolo
  376.      */
  377.     public function setTassabile(bool $tassabile): DocumentoArticolo
  378.     {
  379.         $this->tassabile $tassabile;
  380.         return $this;
  381.     }
  382.     /**
  383.      * @return float
  384.      */
  385.     public function getSconto(): float
  386.     {
  387.         return $this->sconto;
  388.     }
  389.     /**
  390.      * @param float $sconto
  391.      * @return DocumentoArticolo
  392.      */
  393.     public function setSconto(float $sconto): DocumentoArticolo
  394.     {
  395.         $this->sconto $sconto;
  396.         return $this;
  397.     }
  398.     /**
  399.      * @return bool
  400.      */
  401.     public function isApplicaRaContributi(): bool
  402.     {
  403.         return $this->applica_ra_contributi;
  404.     }
  405.     /**
  406.      * @param bool $applica_ra_contributi
  407.      * @return DocumentoArticolo
  408.      */
  409.     public function setApplicaRaContributi(bool $applica_ra_contributi): DocumentoArticolo
  410.     {
  411.         $this->applica_ra_contributi $applica_ra_contributi;
  412.         return $this;
  413.     }
  414.     /**
  415.      * @return int
  416.      */
  417.     public function getOrdine(): int
  418.     {
  419.         return $this->ordine;
  420.     }
  421.     /**
  422.      * @param int $ordine
  423.      * @return DocumentoArticolo
  424.      */
  425.     public function setOrdine(int $ordine): DocumentoArticolo
  426.     {
  427.         $this->ordine $ordine;
  428.         return $this;
  429.     }
  430.     /**
  431.      * @return bool
  432.      */
  433.     public function isScontoRosso(): bool
  434.     {
  435.         return $this->sconto_rosso;
  436.     }
  437.     /**
  438.      * @param bool $sconto_rosso
  439.      * @return DocumentoArticolo
  440.      */
  441.     public function setScontoRosso(bool $sconto_rosso): DocumentoArticolo
  442.     {
  443.         $this->sconto_rosso $sconto_rosso;
  444.         return $this;
  445.     }
  446.     /**
  447.      * @return bool
  448.      */
  449.     public function isInDdt(): bool
  450.     {
  451.         return $this->in_ddt;
  452.     }
  453.     /**
  454.      * @param bool $in_ddt
  455.      * @return DocumentoArticolo
  456.      */
  457.     public function setInDdt(bool $in_ddt): DocumentoArticolo
  458.     {
  459.         $this->in_ddt $in_ddt;
  460.         return $this;
  461.     }
  462.     /**
  463.      * @return bool|null
  464.      */
  465.     public function getMagazzino(): ?bool
  466.     {
  467.         return $this->magazzino;
  468.     }
  469.     /**
  470.      * @param bool|null $magazzino
  471.      * @return DocumentoArticolo
  472.      */
  473.     public function setMagazzino(?bool $magazzino): DocumentoArticolo
  474.     {
  475.         $this->magazzino $magazzino;
  476.         return $this;
  477.     }
  478.     /**
  479.      * @return DocumentoDettagliato
  480.      */
  481.     public function getDocumento(): DocumentoDettagliato
  482.     {
  483.         return $this->documento;
  484.     }
  485.     /**
  486.      * @param DocumentoDettagliato $documento
  487.      * @return DocumentoArticolo
  488.      */
  489.     public function setDocumento(DocumentoDettagliato $documento): DocumentoArticolo
  490.     {
  491.         $this->documento $documento;
  492.         return $this;
  493.     }
  494. }