src/Entity/ProjectOrders.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectOrdersRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ProjectOrdersRepository::class)
  10.  */
  11. class ProjectOrders
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({
  18.      *     "order.base",
  19.      *     "project.orders",
  20.      *     "worker.manage.base.timesheet",
  21.      *     "worker.manage.base.timesheet.payments",
  22.      *     "customer.selected.project",
  23.      *
  24.      *     "project.details.orders",
  25.      *     "order.detail",
  26.      * 
  27.      *      "order.moveable",
  28.      *
  29.      *     "project.orders.expense.assigned.order.base",
  30.      *
  31.      *     "project.order.expense.need",
  32.      *
  33.      *     "order.core", "order@core",
  34.      *
  35.      *     "order.minify.core", "order_minify@core"
  36.      *
  37.      *
  38.      * })
  39.      */
  40.     private $id;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=Projects::class, inversedBy="project_orders" )
  43.      * @ORM\JoinColumn(nullable=false)
  44.      * @Groups({
  45.      *     "order.assigned.project",
  46.      *     "project.order.project"
  47.      * })
  48.      */
  49.      #
  50.     private $project;
  51.     /**
  52.      * A manipulated or simulated column is used to prevent circular references.
  53.      * It is used for retrieving the necessary information related to an project in expenses positions to generate
  54.      * a list of minified project for the associated spending
  55.      * @Groups({
  56.      *     "project.orders.expense.position.base",
  57.      *     })
  58.      */
  59.     private array $required_project_details_of_order_for_expense_position;
  60.     /**
  61.      * @return array
  62.      */
  63.     public function getRequiredProjectDetailsOfOrderForExpensePosition(): array
  64.     {
  65.         return [
  66.             "id" => $this->getProject()->getId(),
  67.             "project_id" => $this->getProject()->getProjectId(),
  68.             "name" => $this->getProject()->getName()
  69.         ];
  70.     }
  71.     /**
  72.      * @ORM\Column(type="string", length=64)
  73.      * @Groups({
  74.      *          "project.orders",
  75.      *          "worker.manage.base.timesheet",
  76.      *          "worker.manage.base.timesheet.payments",
  77.      *          "customer.selected.project",
  78.      *
  79.      *     "project.details.orders",
  80.      *     "order.detail",
  81.      *
  82.      *     "order.moveable",
  83.      *     "order.base",
  84.      *     "project.orders.expense.assigned.order.base",
  85.      *
  86.      *     "project.order.expense.need",
  87.      *
  88.      *     "order.core", "order@core"
  89.      *
  90.      *     })
  91.      */
  92.     private $order_nr;
  93.     /**
  94.      * @ORM\Column(type="string", length=255, nullable=true)
  95.      * @Groups({
  96.      *      "project.orders",
  97.      *      "worker.manage.base.timesheet",
  98.      *
  99.      *      "project.details.orders",
  100.      *      "order.detail"
  101.      *
  102.      *
  103.      *
  104.      * })
  105.      */
  106.     private $order_description;
  107.     /**
  108.      * @ORM\Column(type="float")
  109.      * @Groups({
  110.      *     "project.orders",
  111.      *     "worker.manage.base.timesheet",
  112.      *
  113.      *     "project.details.orders",
  114.      *     "order.detail",
  115.      *     "project.order.core"
  116.      *
  117.      *     })
  118.      */
  119.     // TODO This should be replace with order_price
  120.     private $order_prise;
  121.     /**
  122.      * @deprecated
  123.      * @ORM\OneToMany(targetEntity=WorkerTimesheetPayments::class, mappedBy="project_order")
  124.      */
  125.     private $workerTimesheetPayments;
  126.     /**
  127.      * @deprecated use status inside feedback
  128.      * @ORM\Column(type="integer", nullable=true)
  129.      * @Groups({
  130.      *     "project.details.orders",
  131.      *      "order.detail"
  132.      * })
  133.      */
  134.     private $order_status;
  135.     /**
  136.      * @ORM\Column(type="datetime_immutable", nullable=true)
  137.      * @Groups({
  138.      *     "project.details.orders",
  139.      *      "order.detail"
  140.      * })
  141.      */
  142.     private $should_end_at;
  143.     /**
  144.      * @ORM\Column(type="datetime_immutable", nullable=true)
  145.      * @Groups({
  146.      *     "project.details.orders",
  147.      *     "order.detail"
  148.      * })
  149.      */
  150.     private $is_end_at;
  151.     /**
  152.      * @ORM\Column(type="float", nullable=true)
  153.      * @Groups({
  154.      *     "project.details.orders",
  155.      *      "order.detail"
  156.      * })
  157.      */
  158.     private $hourly_rate;
  159.     /**
  160.      * @ORM\OneToMany(targetEntity=ProjectOrderFeedback::class, mappedBy="project_order", orphanRemoval=true, cascade={"persist", "remove"})
  161.      * @Groups({
  162.      *       "project.details.orders",
  163.      *       "order.detail"
  164.      *  })
  165.      * @ORM\OrderBy({"created_at": "DESC"})
  166.      */
  167.     private $project_order_feedback;
  168.     /**
  169.      * @ORM\OneToMany(targetEntity=ProjectOrderInvoices::class, mappedBy="project_order", orphanRemoval=true, cascade={"persist", "remove"})
  170.      * @Groups({
  171.      *      "project.details.orders",
  172.      *      "order.detail"
  173.      * })
  174.      * @ORM\OrderBy({"created_at": "DESC"})
  175.      */
  176.     private $project_order_invoices;
  177.     /**
  178.      * @ORM\Column(type="datetime_immutable", nullable=true)
  179.      * @Groups({
  180.      *       "project.details.orders",
  181.      *       "order.detail"
  182.      *  })
  183.      */
  184.     private $order_at;
  185.     /**
  186.      * @ORM\ManyToOne(targetEntity=ProjectOwnerContactPersons::class, inversedBy="projectOrders")
  187.      * @Groups({
  188.      *        "project.details.orders",
  189.      *        "order.detail"
  190.      *   })
  191.      */
  192.     private $contact_person;
  193.     /**
  194.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="projectOrders")
  195.      */
  196.     private $author;
  197.     /**
  198.      * @deprecated use $projectOrderExpenses
  199.      * @ORM\OneToMany(targetEntity=ProjectOrderExtraCosts::class, mappedBy="project_order")
  200.      * @Groups({
  201.      *         "project.details.orders",
  202.      *         "order.detail"
  203.      *    })
  204.      */
  205.     private $project_order_extra_costs;
  206.     /**
  207.      * @ORM\Column(type="string", length=64, nullable=true)    
  208.      * @Groups({
  209.      *         "project.details.orders",
  210.      *         "order.detail",
  211.      *          "order.base"
  212.      *    })
  213.      */
  214.     private $project_owner_order_nr;
  215.     /**
  216.      * @ORM\Column(type="float", nullable=true)
  217.      * @Groups({
  218.      *         "project.details.orders",
  219.      *         "order.detail"
  220.      *    })
  221.      */
  222.     private $hours_spent;
  223.     /**
  224.      * @ORM\Column(type="float", nullable=true)
  225.      * @Groups({
  226.      *         "project.details.orders",
  227.      *         "order.detail"
  228.      *    })
  229.      */
  230.     private $cost_spent;
  231.     /**
  232.      * @ORM\OneToMany(targetEntity=ProjectOrderUndertakings::class, mappedBy="project_order")
  233.     * @Groups({
  234.      *      "project.details.orders",
  235.      *      "order.detail"
  236.      * })
  237.      * @ORM\OrderBy({"created_at": "DESC"})
  238.      */
  239.     private $project_order_undertakings;
  240.     /**
  241.      * @ORM\ManyToOne(targetEntity=InvoiceType::class, inversedBy="projectOrders")
  242.      * ORM\Column(options={"comment": "Type of invoice, this order is standard or Undertaking via (Gutschrift) use as default Customer Invoice type"})
  243.      * @Groups({
  244.      *         "project.details.orders",
  245.      *         "order.detail"
  246.      *    })
  247.      */
  248.     private $invoice_type;
  249.     /**
  250.      * TODO this should be move to worker_activity
  251.      * @ORM\ManyToOne(targetEntity=Worker::class, inversedBy="projectOrders")
  252.      * @Groups({
  253.      *     "project.details.orders",
  254.      *     "order.detail",
  255.      *     "project.orders.core",
  256.      *
  257.      *     "project.order.lead"
  258.      * })
  259.      */
  260.     private $order_lead;
  261.     /**
  262.      * TODO this should be move to worker_activity
  263.      * @ORM\ManyToOne(targetEntity=WorkerActivities::class, inversedBy="projectOrders")
  264.      * @ORM\JoinColumn(options={"comment": "This relation-ship from merged 'worker' over worker_activities table"})
  265.      * @Groups({*
  266.      *          "order.lead.worker.activity"
  267.      *    })
  268.      */
  269.     private $order_primary_lead;
  270.     /**
  271.      * @ORM\ManyToMany(targetEntity=WorkerActivities::class)
  272.      * @ORM\JoinTable(
  273.      *     name="project_order_alternate_leads",
  274.      *     joinColumns={@ORM\JoinColumn(name="project_order_id", referencedColumnName="id")},
  275.      *     inverseJoinColumns={@ORM\JoinColumn(name="worker_activity_id", referencedColumnName="id")})
  276.      * @Groups({
  277.      *     "worker.alternate.leads",
  278.      * })
  279.      */
  280.     private $order_alternate_leads;
  281.     /**
  282.      * @deprecated
  283.      * @ORM\OneToMany(targetEntity=ProjectOrderExpenses::class, mappedBy="project_order")
  284.      * @Groups({
  285.      *          "project.details.orders.expenses"
  286.      *     })
  287.      */
  288.     private $project_order_expenses;
  289.     /**
  290.      * @ORM\OneToMany(targetEntity=ProjectOrderExpensePositions::class, mappedBy="project_order")
  291.      * @Groups({
  292.      *
  293.      *           "project.orders.expense.positions",
  294.      *
  295.      *           "project.orders.expense.minify.version",
  296.      *      })
  297.      */
  298.     private $project_order_expense_positions;
  299.     /**
  300.      * @ORM\Column(type="float", nullable=true)
  301.      * @Groups({
  302.      *     "order.detail",
  303.      *     "project.details.orders",
  304.      *     "project.order.core"
  305.      * })
  306.      */
  307.     private $material_budget_as_percent;
  308.     /**
  309.      * @ORM\Column(type="float", nullable=true)
  310.      * @Groups({
  311.      *      "order.detail",
  312.      *      "project.details.orders"
  313.      *  })
  314.      */
  315.     private $timesheet_budget_as_percent;
  316.     /**
  317.      * Prise 10.000 %20 gewinn ziel 2.000
  318.      * Materialkosten: %30 10.000 => 3.300
  319.      * Timesheetkosten: %50 10.000 => 5000
  320.      * 10000 - (3.300 + 5000) => 8.300
  321.      * 10 2000
  322.      * ? 1700
  323.      */
  324.     /**
  325.      * @ORM\Column(type="float", nullable=true)
  326.      * @Groups({
  327.      *       "order.detail",
  328.      *       "project.details.orders"
  329.      *   })
  330.      */
  331.     private $target_profit_as_percent;
  332.     /**
  333.      * @ORM\ManyToOne(targetEntity=Branches::class, inversedBy="projectOrders")
  334.      * @Groups({
  335.      *          "branch",
  336.      *          "project.order.branch",
  337.      *     "order.base"
  338.      *    })
  339.      */
  340.     private $order_branch;
  341.     /**
  342.      * @ORM\ManyToOne(targetEntity=BranchDepartements::class, inversedBy="projectOrders")
  343.      * @Groups({
  344.      *         "branch.departement",
  345.      *         "project.order.branch.departement"
  346.      *     })
  347.      */
  348.     private $branch_departement;
  349.     /**
  350.      * @ORM\ManyToMany(targetEntity=WorkerActivities::class, inversedBy="assigned_orders")
  351.      */
  352.     private $assigned_workers;
  353.     /**
  354.      * @ORM\OneToMany(targetEntity=StockIssue::class, mappedBy="project_order")
  355.      * @Groups({
  356.      *      "project_order@stock_issues"
  357.      *  })
  358.      */
  359.     private $stock_issues;
  360.     /**
  361.      * @ORM\OneToMany(targetEntity=StockTransactions::class, mappedBy="project_order_id")
  362.      */
  363.     private $stock_transactions;
  364.     public function __construct()
  365.     {
  366.         $this->workerTimesheetPayments = new ArrayCollection();
  367.         $this->project_order_feedback = new ArrayCollection();
  368.         $this->project_order_invoices = new ArrayCollection();
  369.         $this->project_order_extra_costs = new ArrayCollection();
  370.         $this->project_order_undertakings = new ArrayCollection();
  371.         $this->project_order_expenses = new ArrayCollection();
  372.         $this->project_order_expense_positions = new ArrayCollection();
  373.         $this->order_alternate_leads = new ArrayCollection();
  374.         $this->assigned_workers = new ArrayCollection();
  375.         $this->stock_issues = new ArrayCollection();
  376.         $this->stock_transactions = new ArrayCollection();
  377.     }
  378.     public function getId(): ?int
  379.     {
  380.         return $this->id;
  381.     }
  382.     public function getProject(): ?Projects
  383.     {
  384.         return $this->project;
  385.     }
  386.     public function setProject(?Projects $project): self
  387.     {
  388.         $this->project $project;
  389.         return $this;
  390.     }
  391.     public function getOrderNr(): ?string
  392.     {
  393.         return $this->order_nr;
  394.     }
  395.     public function setOrderNr(string $order_nr): self
  396.     {
  397.         $this->order_nr $order_nr;
  398.         return $this;
  399.     }
  400.     public function getOrderDescription(): ?string
  401.     {
  402.         return $this->order_description;
  403.     }
  404.     public function setOrderDescription(?string $order_description): self
  405.     {
  406.         $this->order_description $order_description;
  407.         return $this;
  408.     }
  409.     public function getOrderPrise(): ?float
  410.     {
  411.         return $this->order_prise;
  412.     }
  413.     public function setOrderPrise(float $order_prise): self
  414.     {
  415.         $this->order_prise $order_prise;
  416.         return $this;
  417.     }
  418.     /**
  419.      * @return Collection<int, WorkerTimesheetPayments>
  420.      */
  421.     public function getWorkerTimesheetPayments(): Collection
  422.     {
  423.         return $this->workerTimesheetPayments;
  424.     }
  425.     public function addWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  426.     {
  427.         if (!$this->workerTimesheetPayments->contains($workerTimesheetPayment)) {
  428.             $this->workerTimesheetPayments[] = $workerTimesheetPayment;
  429.             $workerTimesheetPayment->setProjectOrder($this);
  430.         }
  431.         return $this;
  432.     }
  433.     public function removeWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  434.     {
  435.         if ($this->workerTimesheetPayments->removeElement($workerTimesheetPayment)) {
  436.             // set the owning side to null (unless already changed)
  437.             if ($workerTimesheetPayment->getProjectOrder() === $this) {
  438.                 $workerTimesheetPayment->setProjectOrder(null);
  439.             }
  440.         }
  441.         return $this;
  442.     }
  443.     /**
  444.      * @deprecated since 1.27 (to be removed in 2.0). Use getOrderStatus() instead feedback.
  445.      */
  446.     public function getOrderStatus(): ?int
  447.     {
  448.         return $this->order_status;
  449.     }
  450.     /**
  451.      * @deprecated since 1.27 (to be removed in 2.0). Use getOrderStatus() instead feedback.
  452.     */
  453.     public function setOrderStatus(?int $order_status): self
  454.     {
  455.         $this->order_status $order_status;
  456.         return $this;
  457.     }
  458.     public function getShouldEndAt(): ?\DateTimeImmutable
  459.     {
  460.         return $this->should_end_at;
  461.     }
  462.     public function setShouldEndAt(?\DateTimeImmutable $should_end_at): self
  463.     {
  464.         $this->should_end_at $should_end_at;
  465.         return $this;
  466.     }
  467.     public function getIsEndAt(): ?\DateTimeImmutable
  468.     {
  469.         return $this->is_end_at;
  470.     }
  471.     public function setIsEndAt(?\DateTimeImmutable $is_end_at): self
  472.     {
  473.         $this->is_end_at $is_end_at;
  474.         return $this;
  475.     }
  476.     public function getHourlyRate(): ?float
  477.     {
  478.         return $this->hourly_rate;
  479.     }
  480.     public function setHourlyRate(?float $hourly_rate): self
  481.     {
  482.         $this->hourly_rate $hourly_rate;
  483.         return $this;
  484.     }
  485.     /**
  486.      * @return Collection<int, ProjectOrderFeedback>
  487.      */
  488.     public function getProjectOrderFeedback(): Collection
  489.     {
  490.         return $this->project_order_feedback;
  491.     }
  492.     public function addProjectOrderFeedback(ProjectOrderFeedback $projectOrderFeedback): self
  493.     {
  494.         if (!$this->project_order_feedback->contains($projectOrderFeedback)) {
  495.             $this->project_order_feedback[] = $projectOrderFeedback;
  496.             $projectOrderFeedback->setProjectOrder($this);
  497.         }
  498.         return $this;
  499.     }
  500.     public function removeProjectOrderFeedback(ProjectOrderFeedback $projectOrderFeedback): self
  501.     {
  502.         if ($this->project_order_feedback->removeElement($projectOrderFeedback)) {
  503.             // set the owning side to null (unless already changed)
  504.             if ($projectOrderFeedback->getProjectOrder() === $this) {
  505.                 $projectOrderFeedback->setProjectOrder(null);
  506.             }
  507.         }
  508.         return $this;
  509.     }
  510.     /**
  511.      * @return Collection<int, ProjectOrderInvoices>
  512.      */
  513.     public function getProjectOrderInvoices(): Collection
  514.     {
  515.         return $this->project_order_invoices;
  516.     }
  517.     public function addProjectOrderInvoice(ProjectOrderInvoices $projectOrderInvoice): self
  518.     {
  519.         if (!$this->project_order_invoices->contains($projectOrderInvoice)) {
  520.             $this->project_order_invoices[] = $projectOrderInvoice;
  521.             $projectOrderInvoice->setProjectOrder($this);
  522.         }
  523.         return $this;
  524.     }
  525.     public function removeProjectOrderInvoice(ProjectOrderInvoices $projectOrderInvoice): self
  526.     {
  527.         if ($this->project_order_invoices->removeElement($projectOrderInvoice)) {
  528.             // set the owning side to null (unless already changed)
  529.             if ($projectOrderInvoice->getProjectOrder() === $this) {
  530.                 $projectOrderInvoice->setProjectOrder(null);
  531.             }
  532.         }
  533.         return $this;
  534.     }
  535.     public function getOrderAt(): ?\DateTimeImmutable
  536.     {
  537.         return $this->order_at;
  538.     }
  539.     public function setOrderAt(?\DateTimeImmutable $order_at): self
  540.     {
  541.         $this->order_at $order_at;
  542.         return $this;
  543.     }
  544.     public function getContactPerson(): ?ProjectOwnerContactPersons
  545.     {
  546.         return $this->contact_person;
  547.     }
  548.     public function setContactPerson(?ProjectOwnerContactPersons $contact_person): self
  549.     {
  550.         $this->contact_person $contact_person;
  551.         return $this;
  552.     }
  553.     public function getAuthor(): ?User
  554.     {
  555.         return $this->author;
  556.     }
  557.     public function setAuthor(?User $author): self
  558.     {
  559.         $this->author $author;
  560.         return $this;
  561.     }
  562.     /**
  563.      * @return Collection<int, ProjectOrderExtraCosts>
  564.      */
  565.     public function getProjectOrderExtraCosts(): Collection
  566.     {
  567.         return $this->project_order_extra_costs;
  568.     }
  569.     public function addProjectOrderExtraCost(ProjectOrderExtraCosts $projectOrderExtraCost): self
  570.     {
  571.         if (!$this->project_order_extra_costs->contains($projectOrderExtraCost)) {
  572.             $this->project_order_extra_costs[] = $projectOrderExtraCost;
  573.             $projectOrderExtraCost->setProjectOrder($this);
  574.         }
  575.         return $this;
  576.     }
  577.     public function removeProjectOrderExtraCost(ProjectOrderExtraCosts $projectOrderExtraCost): self
  578.     {
  579.         if ($this->project_order_extra_costs->removeElement($projectOrderExtraCost)) {
  580.             // set the owning side to null (unless already changed)
  581.             if ($projectOrderExtraCost->getProjectOrder() === $this) {
  582.                 $projectOrderExtraCost->setProjectOrder(null);
  583.             }
  584.         }
  585.         return $this;
  586.     }
  587.     public function getProjectOwnerOrderNr(): ?string
  588.     {
  589.         return $this->project_owner_order_nr;
  590.     }
  591.     public function setProjectOwnerOrderNr(?string $project_owner_order_nr): self
  592.     {
  593.         $this->project_owner_order_nr $project_owner_order_nr;
  594.         return $this;
  595.     }
  596.     public function getHoursSpent(): ?float
  597.     {
  598.         return $this->hours_spent;
  599.     }
  600.     public function setHoursSpent(?float $hours_spent): self
  601.     {
  602.         $this->hours_spent $hours_spent;
  603.         return $this;
  604.     }
  605.     public function getCostSpent(): ?float
  606.     {
  607.         return $this->cost_spent;
  608.     }
  609.     public function setCostSpent(?float $cost_spent): self
  610.     {
  611.         $this->cost_spent $cost_spent;
  612.         return $this;
  613.     }
  614.     /**
  615.      * @return Collection<int, ProjectOrderUndertakings>
  616.      */
  617.     public function getProjectOrderUndertakings(): Collection
  618.     {
  619.         return $this->project_order_undertakings;
  620.     }
  621.     public function addProjectOrderUndertaking(ProjectOrderUndertakings $project_order_undertaking): self
  622.     {
  623.         if (!$this->project_order_undertakings->contains($project_order_undertaking)) {
  624.             $this->project_order_undertakings[] = $project_order_undertaking;
  625.             $project_order_undertaking->setProjectOrder($this);
  626.         }
  627.         return $this;
  628.     }
  629.     public function removeProjectOrderUndetaking(ProjectOrderUndertakings $project_order_undertaking): self
  630.     {
  631.         if ($this->project_order_undertakings->removeElement($project_order_undertaking)) {
  632.             // set the owning side to null (unless already changed)
  633.             if ($project_order_undertaking->getProjectOrder() === $this) {
  634.                 $project_order_undertaking->setProjectOrder(null);
  635.             }
  636.         }
  637.         return $this;
  638.     }
  639.     public function getInvoiceType(): ?InvoiceType
  640.     {
  641.         return $this->invoice_type;
  642.     }
  643.     public function setInvoiceType(?InvoiceType $invoice_type): self
  644.     {
  645.         $this->invoice_type $invoice_type;
  646.         return $this;
  647.     }
  648.     public function getOrderLead(): ?Worker
  649.     {
  650.         return $this->order_lead;
  651.     }
  652.     public function setOrderLead(?Worker $order_lead): self
  653.     {
  654.         $this->order_lead $order_lead;
  655.         return $this;
  656.     }
  657.     public function getOrderPrimaryLead(): ?WorkerActivities
  658.     {
  659.         return $this->order_primary_lead;
  660.     }
  661.     public function setOrderPrimaryLead(?WorkerActivities $order_lead): self
  662.     {
  663.         $this->order_primary_lead $order_lead;
  664.         return $this;
  665.     }
  666.     /**
  667.      * @return Collection<int, ProjectOrderExpenses>
  668.      */
  669.     public function getProjectOrderExpenses(): Collection
  670.     {
  671.         return $this->project_order_expenses;
  672.     }
  673.     public function addProjectOrderExpense(ProjectOrderExpenses $projectOrderExpense): self
  674.     {
  675.         if (!$this->project_order_expenses->contains($projectOrderExpense)) {
  676.             $this->project_order_expenses[] = $projectOrderExpense;
  677.             $projectOrderExpense->setProjectOrder($this);
  678.         }
  679.         return $this;
  680.     }
  681.     public function removeProjectOrderExpense(ProjectOrderExpenses $projectOrderExpense): self
  682.     {
  683.         if ($this->project_order_expenses->removeElement($projectOrderExpense)) {
  684.             // set the owning side to null (unless already changed)
  685.             if ($projectOrderExpense->getProjectOrder() === $this) {
  686.                 $projectOrderExpense->setProjectOrder(null);
  687.             }
  688.         }
  689.         return $this;
  690.     }
  691.     /**
  692.      * @return Collection<int, ProjectOrderExpensePositions>
  693.      */
  694.     public function getProjectOrderExpensePositions(): Collection
  695.     {
  696.         return $this->project_order_expense_positions;
  697.     }
  698.     public function addProjectOrderExpensePosition(ProjectOrderExpensePositions $projectOrderExpensePosition): self
  699.     {
  700.         if (!$this->project_order_expense_positions->contains($projectOrderExpensePosition)) {
  701.             $this->project_order_expense_positions[] = $projectOrderExpensePosition;
  702.             $projectOrderExpensePosition->setProjectOrder($this);
  703.         }
  704.         return $this;
  705.     }
  706.     public function removeProjectOrderExpensePosition(ProjectOrderExpensePositions $projectOrderExpensePosition): self
  707.     {
  708.         if ($this->project_order_expense_positions->removeElement($projectOrderExpensePosition)) {
  709.             // set the owning side to null (unless already changed)
  710.             if ($projectOrderExpensePosition->getProjectOrder() === $this) {
  711.                 $projectOrderExpensePosition->setProjectOrder(null);
  712.             }
  713.         }
  714.         return $this;
  715.     }
  716.     public function getMaterialBudgetAsPercent(): ?float
  717.     {
  718.         return $this->material_budget_as_percent;
  719.     }
  720.     public function setMaterialBudgetAsPercent(?float $material_budget_as_percent): self
  721.     {
  722.         $this->material_budget_as_percent $material_budget_as_percent;
  723.         return $this;
  724.     }
  725.     public function getTimesheetBudgetAsPercent(): ?float
  726.     {
  727.         return $this->timesheet_budget_as_percent;
  728.     }
  729.     public function setTimesheetBudgetAsPercent(?float $timesheet_budget_as_percent): self
  730.     {
  731.         $this->timesheet_budget_as_percent $timesheet_budget_as_percent;
  732.         return $this;
  733.     }
  734.     public function getTargetProfitAsPercent(): ?float
  735.     {
  736.         return $this->target_profit_as_percent;
  737.     }
  738.     public function setTargetProfitAsPercent(?float $target_profit_as_percent): self
  739.     {
  740.         $this->target_profit_as_percent $target_profit_as_percent;
  741.         return $this;
  742.     }
  743.     /**
  744.      * @return Collection<int, WorkerActivities>
  745.      */
  746.     public function getOrderAlternateLeads(): Collection
  747.     {
  748.         return $this->order_alternate_leads;
  749.     }
  750.     public function addOrderAlternateLead(WorkerActivities $orderAlternateLead): self
  751.     {
  752.         if (!$this->order_alternate_leads->contains($orderAlternateLead)) {
  753.             $this->order_alternate_leads[] = $orderAlternateLead;
  754.         }
  755.         return $this;
  756.     }
  757.     public function removeOrderAlternateLead(WorkerActivities $orderAlternateLead): self
  758.     {
  759.         $this->order_alternate_leads->removeElement($orderAlternateLead);
  760.         return $this;
  761.     }
  762.     public function getOrderBranch(): ?Branches
  763.     {
  764.         return $this->order_branch;
  765.     }
  766.     public function setOrderBranch(?Branches $order_branch): self
  767.     {
  768.         $this->order_branch $order_branch;
  769.         return $this;
  770.     }
  771.     public function getBranchDepartement(): ?BranchDepartements
  772.     {
  773.         return $this->branch_departement;
  774.     }
  775.     public function setBranchDepartement(?BranchDepartements $branch_departement): self
  776.     {
  777.         $this->branch_departement $branch_departement;
  778.         return $this;
  779.     }
  780.     /**
  781.      * @return Collection<int, WorkerActivities>
  782.      */
  783.     public function getAssignedWorkers(): Collection
  784.     {
  785.         return $this->assigned_workers;
  786.     }
  787.     public function addAssignedWorker(WorkerActivities $assignedWorker): self
  788.     {
  789.         if (!$this->assigned_workers->contains($assignedWorker)) {
  790.             $this->assigned_workers[] = $assignedWorker;
  791.         }
  792.         return $this;
  793.     }
  794.     public function removeAssignedWorker(WorkerActivities $assignedWorker): self
  795.     {
  796.         $this->assigned_workers->removeElement($assignedWorker);
  797.         return $this;
  798.     }
  799.     /**
  800.      * @return Collection<int, StockIssue>
  801.      */
  802.     public function getStockIssues(): Collection
  803.     {
  804.         return $this->stock_issues;
  805.     }
  806.     public function addStockIssue(StockIssue $stockIssue): self
  807.     {
  808.         if (!$this->stock_issues->contains($stockIssue)) {
  809.             $this->stock_issues[] = $stockIssue;
  810.             $stockIssue->setProjectOrder($this);
  811.         }
  812.         return $this;
  813.     }
  814.     public function removeStockIssue(StockIssue $stockIssue): self
  815.     {
  816.         if ($this->stock_issues->removeElement($stockIssue)) {
  817.             // set the owning side to null (unless already changed)
  818.             if ($stockIssue->getProjectOrder() === $this) {
  819.                 $stockIssue->setProjectOrder(null);
  820.             }
  821.         }
  822.         return $this;
  823.     }
  824.     /**
  825.      * @return Collection<int, StockTransactions>
  826.      */
  827.     public function getStockTransactions(): Collection
  828.     {
  829.         return $this->stock_transactions;
  830.     }
  831.     public function addStockTransaction(StockTransactions $stockTransaction): self
  832.     {
  833.         if (!$this->stock_transactions->contains($stockTransaction)) {
  834.             $this->stock_transactions[] = $stockTransaction;
  835.             $stockTransaction->setProjectOrder($this);
  836.         }
  837.         return $this;
  838.     }
  839.     public function removeStockTransaction(StockTransactions $stockTransaction): self
  840.     {
  841.         if ($this->stock_transactions->removeElement($stockTransaction)) {
  842.             // set the owning side to null (unless already changed)
  843.             if ($stockTransaction->getProjectOrder() === $this) {
  844.                 $stockTransaction->setProjectOrder(null);
  845.             }
  846.         }
  847.         return $this;
  848.     }
  849. }