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