src/Diplix/KMGBundle/Entity/Accounting/Job.php line 16

Open in your IDE?
  1. <?php
  2. namespace Diplix\KMGBundle\Entity\Accounting;
  3. use Diplix\KMGBundle\Entity\Address;
  4. use Diplix\KMGBundle\Entity\BasicEntity;
  5. use Diplix\KMGBundle\Entity\Customer;
  6. use Diplix\KMGBundle\Entity\Order;
  7. use Diplix\KMGBundle\Repository\JobRepository;
  8. use Diplix\KMGBundle\Service\Accounting\PaymentCalculator;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11.  * @ORM\Table(name="acc_jobs", indexes={@ORM\Index(name="be_deleted",columns={"be_deleted"})})
  12.  * @ORM\Entity(repositoryClass="Diplix\KMGBundle\Repository\JobRepository")
  13.  */
  14. class Job extends BasicEntity
  15. {
  16.     const GENERATED 'generated';
  17.     const IMPORTED 'imported';
  18.     const UNKNOWN 'unknown';
  19.     public static $sourceMap = [
  20.         self::GENERATED => 'automatisch angelegt',
  21.         self::IMPORTED => 'importiert',
  22.         self::UNKNOWN => 'unbekannt'
  23.     ];
  24.     public const RS_MIETWAGEN 'm';
  25.     public const RS_TAXI 't';
  26.     public static $rsMap = [
  27.         self::RS_MIETWAGEN => "Mietwagen",
  28.         self::RS_TAXI => "Taxi"
  29.     ];
  30.     /**
  31.      * @ORM\Column(type="integer",name="id")
  32.      * @ORM\Id()
  33.      * @ORM\GeneratedValue(strategy="AUTO")
  34.      */
  35.     protected $id;
  36.     /**
  37.      * the tami order number
  38.      * @ORM\Column(type="string")
  39.      */
  40.     protected $orderNumber;
  41.     /**
  42.      * @ORM\Column(type="datetime")
  43.      */
  44.     protected $orderTime;
  45.     /**
  46.      * @ORM\Column(type="string")
  47.      */
  48.     protected $customerName;
  49.     /**
  50.      * @ORM\Column(type="string")
  51.      */
  52.     protected $originQuick;
  53.     /**
  54.      * @ORM\Column(type="string")
  55.      */
  56.     protected $originStreet;
  57.     /**
  58.      * @ORM\Column(type="string")
  59.      */
  60.     protected $originNumber;
  61.     /**
  62.      * @ORM\Column(type="string")
  63.      */
  64.     protected $originZip;
  65.     /**
  66.      * @ORM\Column(type="string")
  67.      */
  68.     protected $originCity;
  69.     /**
  70.      * @ORM\Column(type="string")
  71.      */
  72.     protected $destinationQuick;
  73.     /**
  74.      * @ORM\Column(type="string")
  75.      */
  76.     protected $destinationStreet;
  77.     /**
  78.      * @ORM\Column(type="string")
  79.      */
  80.     protected $destinationNumber;
  81.     /**
  82.      * @ORM\Column(type="string")
  83.      */
  84.     protected $destinationZip;
  85.     /**
  86.      * @ORM\Column(type="string")
  87.      */
  88.     protected $destinationCity;
  89.     /**
  90.      * @ORM\Column(type="integer")
  91.      */
  92.     protected $personCount;
  93.     /**
  94.      * @ORM\Column(type="decimal", nullable=false, precision=12, scale=2,options={"unsigned":true})
  95.      */
  96.     protected $distanceKm;
  97.     /**
  98.      * @ORM\Column(type="decimal", precision=12, scale=2,options={"unsigned":true})
  99.      */
  100.     protected $waitTime;
  101.     /**
  102.      * @ORM\Column(type="string")
  103.      */
  104.     protected $paymentType;
  105.     /**
  106.      * @ORM\Column(type="decimal", nullable=false, precision=12, scale=2,options={"unsigned":false})
  107.      */
  108.     protected $price;
  109.     /**
  110.      * @ORM\Column(type="integer")
  111.      */
  112.     protected $carId;
  113.     /**
  114.      * @ORM\Column(type="integer")
  115.      */
  116.     protected $driverId;
  117.     /**
  118.      * @ORM\Column(type="text")
  119.      */
  120.     protected $info;
  121.     /**
  122.      * @ORM\Column(type="string")
  123.      */
  124.     protected $costCenter;
  125.     /**
  126.      * @ORM\Column(type="datetime",nullable=true)
  127.      */
  128.     protected $jobReceivedTime;
  129.     /**
  130.      * @ORM\Column(type="datetime",nullable=true)
  131.      */
  132.     protected $jobStartTime;
  133.     /**
  134.      * @ORM\Column(type="datetime",nullable=true)
  135.      */
  136.     protected $jobDoneTime;
  137.     /**
  138.      * @ORM\Column(type="integer")
  139.      */
  140.     protected $jobDuration;
  141.     /**
  142.      * @ORM\Column(type="integer")
  143.      */
  144.     protected $relType;
  145.     /**
  146.      * @ORM\Column(type="string")
  147.      */
  148.     protected $relId='';
  149.     /**
  150.      * @ORM\Column(type="string")
  151.      */
  152.     protected $options '';
  153.     /**
  154.      * @ORM\Column(type="json")
  155.      */
  156.     protected $waypoints = [];
  157.     /**
  158.      * @ORM\Column(type="string")
  159.      */
  160.     protected $source self::UNKNOWN;
  161.     /////////////////////////////////////////////////////////////////////////////////////////////
  162.     /**
  163.      * @ORM\Column(type="boolean")
  164.      */
  165.     protected $approvedByDriver false;
  166.     /**
  167.      * @ORM\Column(type="boolean")
  168.      */
  169.     protected $approvedByPassenger false;
  170.     /**
  171.      * @ORM\Column(type="boolean")
  172.      */
  173.     protected $approvedByAccounting false;
  174.     /**
  175.      * @ORM\Column(type="string")
  176.      */
  177.     protected $confirmationPin '';
  178.     /**
  179.      * @ORM\Column(type="boolean")
  180.      */
  181.     protected $readyForBilling false;
  182.     /**
  183.      * @ORM\Column(type="json")
  184.      */
  185.     protected $lastReadyForBillingCheckResult = [];
  186.     /**
  187.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\BillingForMember", inversedBy="jobList", fetch="EAGER")
  188.      * @ORM\JoinColumn(nullable=true)
  189.      */
  190.     protected $billingForMember;
  191.     /**
  192.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\BillingForCustomer", inversedBy="jobList", fetch="EAGER")
  193.      * @ORM\JoinColumn(nullable=true)
  194.      */
  195.     protected $billingForCustomer;
  196.     /**
  197.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\CoopMember")
  198.      * @ORM\JoinColumn(nullable=true)
  199.      */
  200.     protected $member;
  201.     /**
  202.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Customer")
  203.      * @ORM\JoinColumn(nullable=true)
  204.      */
  205.     protected $customer;
  206.     /**
  207.      * @ORM\Column(type="time",nullable=true)
  208.      */
  209.     protected $flightOnPositionTime;
  210.     /**
  211.      * @ORM\Column(type="time", nullable=true)
  212.      */
  213.     protected $departureAtOriginTime;
  214.     /**
  215.      * @ORM\Column(type="time", nullable=true)
  216.      */
  217.     protected $arrivalAtDestinationTime;
  218.     /**
  219.      * @ORM\Column(type="text")
  220.      */
  221.     protected $extraCostName '';
  222.     /**
  223.      * @ORM\Column(type="decimal",precision=6, scale=2)
  224.      */
  225.     protected $extraCostPrice 0.0;
  226.     /**
  227.      * @ORM\Column(type="json")
  228.      */
  229.     protected $accMemberRates = [];
  230.     /**
  231.      * @ORM\Column(type="decimal",precision=6, scale=2)
  232.      */
  233.     protected $accMemberManualRate 0.0;
  234.     /**
  235.      * @ORM\Column(type="json")
  236.      */
  237.     protected $accCustomerRates = [];
  238.     /**
  239.      * @ORM\Column(type="decimal",precision=6, scale=2)
  240.      */
  241.     protected $accCustomerManualRate 0.0;
  242.     /**
  243.      * @ORM\OneToOne(targetEntity="Diplix\KMGBundle\Entity\Order", inversedBy="job")
  244.      * @ORM\JoinColumn(nullable=true)
  245.      * @var Order
  246.      */
  247.     protected $knownOrder;
  248.     /**
  249.      * @ORM\Column(type="string")
  250.      */
  251.     protected $detectedFFL PaymentCalculator::NONE;
  252.     /**
  253.      * @ORM\Column(type="integer")
  254.      */
  255.     protected $actualKm 0;
  256.     /**
  257.      * @ORM\Column(type="decimal", nullable=false, precision=7, scale=2,options={"unsigned":false})
  258.      */
  259.     protected $totalCustomerNet 0.0;
  260.     /**
  261.      * @ORM\Column(type="decimal", nullable=false, precision=7, scale=2,options={"unsigned":false})
  262.      */
  263.     protected $totalMemberNet 0.0;
  264.     /**
  265.      * @ORM\Column(type="json")
  266.      */
  267.     protected $customerCalculationItems = [];
  268.     /**
  269.      * @ORM\Column(type="json")
  270.      */
  271.     protected $memberCalculationItems = [];
  272.     /**
  273.      * @ORM\Column(type="decimal", nullable=true, precision=3, scale=2,options={"unsigned":false})
  274.      */
  275.     protected $memberCalcForceTaxRate null;
  276.     /**
  277.      * @ORM\Column(type="decimal", nullable=false, precision=7, scale=2,options={"unsigned":false})
  278.      */
  279.     protected $taxameter 0.0;
  280.     /**
  281.      * @ORM\Column(type="decimal", nullable=false, precision=3, scale=2,options={"unsigned":false})
  282.      */
  283.     protected $taxameterVat 0.07;  // 1 = 100%
  284.     /**
  285.      * @ORM\Column(type="boolean")
  286.      */
  287.     protected $passengerNotMet false;
  288.     /**
  289.      * @ORM\Column(type="boolean")
  290.      */
  291.     protected $fflCombinationRide false;
  292.     /**
  293.      * @ORM\Column(type="boolean")
  294.      */
  295.     protected $werksRundfahrt false;
  296.     /**
  297.      * @ORM\Column(type="boolean")
  298.      */
  299.     protected $discarded false;
  300.     /**
  301.      * @ORM\Column(type="boolean")
  302.      */
  303.     protected $extraWaitingTimeRide false;
  304.     /**
  305.      * @ORM\Column(type="integer")
  306.      * in minutes
  307.      */
  308.     protected $extraWaitingTime 0;
  309.     /**
  310.      * @ORM\Column(type="boolean")
  311.      */
  312.     protected $applicantTimeRide false;
  313.     /**
  314.      * @ORM\Column(type="integer")
  315.      * in minutes
  316.      */
  317.     protected $applicantTime 0;
  318.     /**
  319.      * @ORM\Column(type="boolean", options={"default":"0"})
  320.      */
  321.     protected $disablePricelistCalculation false;
  322.     /**
  323.      * @ORM\Column(type="boolean", options={"default":"0"})
  324.      */
  325.     protected $disableTaxameterForCustomer false;
  326.     /**
  327.      * @ORM\Column(type="boolean", options={"default":"0"})
  328.      */
  329.     protected $hasMemberExtraKm false;
  330.     /**
  331.      * @ORM\Column(type="integer")
  332.      */
  333.     protected $memberExtraKm 0;
  334.     /**
  335.      * @ORM\Column(type="datetime", nullable=true)
  336.      */
  337.     protected $lastChangeByMember null;
  338.     /**
  339.      * @ORM\Column(type="boolean", options={"default":"0"})
  340.      */
  341.     protected $instantRide false;
  342.     /**
  343.      * @ORM\Column(type="integer", options={"default":"0"})
  344.      */
  345.     protected $instantRideAdditionalWaitingTime 0;
  346.     /**
  347.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\File", fetch="EAGER")
  348.      * @ORM\JoinColumn(referencedColumnName="id",nullable=true)
  349.      */
  350.     protected $customerSignature;
  351.     /**
  352.      * @ORM\Column(type="integer",options={"default":"0"})
  353.      * @see Order::CM_xxxxxxx
  354.      */
  355.     protected $confirmedByCustomerThrough 0;
  356.     /**
  357.      * @ORM\Column(type="boolean", options={"default":"0"})
  358.      */
  359.     protected $ignoreForCustomer false;
  360.     /**
  361.      * @ORM\Column(type="boolean", options={"default":"0"})
  362.      */
  363.     protected $ignoreForMember false;
  364.     /**
  365.      * @ORM\Column(type="boolean", options={"default":"0"})
  366.      */
  367.     protected $recalculateCustomerPrice false;
  368.     /**
  369.      * @ORM\Column(type="string", options={"length":"1","default":"m"})
  370.      */
  371.     protected $rideStyle self::RS_MIETWAGEN;
  372.     /**
  373.      * @ORM\Column(type="json")
  374.      * @var array|string[]
  375.      */
  376.     protected $controlling = [];
  377.     /**
  378.      * @ORM\Column(type="boolean", options={"default":"0"})
  379.      */
  380.     protected $customerStorno false;
  381.     /**
  382.      * @ORM\Column(type="integer", options={"default":"0"})
  383.      */
  384.     protected $SLC 0// SoLei Chauffeur Serv
  385.     /**
  386.      * @ORM\Column(type="integer", options={"default":"0"})
  387.      */
  388.     protected $VVC 0// Vertrg Vorst Chauff
  389.     /**
  390.      * @ORM\OneToOne(targetEntity="Job", inversedBy="combiRideChild")
  391.      */
  392.     protected $combiRideParent// parent = ride which took place before self
  393.     /**
  394.      * @ORM\OneToOne(targetEntity="Job", mappedBy="combiRideParent")
  395.      */
  396.     protected $combiRideChild// child = ride which took place after self
  397.     public const CAS_NEW 0;
  398.     public const CAS_AUTO 1;
  399.     public const CAS_MANUAL 2;
  400.     /**
  401.      * @ORM\Column(type="integer", options={"default":"0"})
  402.      */
  403.     protected $combiAssignmentState self::CAS_NEW;
  404.     /**
  405.      * @ORM\Column(type="boolean", options={"default":"0"})
  406.      */
  407.     protected $optSubCustomerNet false;
  408.     /**
  409.      * @ORM\Column(type="boolean", options={"default":"0"})
  410.      */
  411.     protected $optNoExtrasForCustomer false;
  412.     /**
  413.      * @ORM\Column(type="boolean", options={"default":"0"})
  414.      */
  415.     protected $optAddChargeForCustomer false;
  416.     //////////////////////////////////////////////////////////////////////////////////////
  417.     /*
  418.      *  convert from array[] to JobCalcItem[]
  419.      */
  420.     public static function toJciArray(array $list)
  421.     {
  422.         $ro = [];
  423.         foreach ( $list as $row)
  424.         {
  425.             $ro[]= JobCalcItem::fromArray($row);
  426.         }
  427.         return $ro;
  428.     }
  429.     /**
  430.      * convert from JobCalcItem[] / Waypoint[] to array[]
  431.      * Note: fails with non-utf8 data
  432.      */
  433.     public static function fromObjectArray(array $list)
  434.     {
  435.         return json_decode(json_encode($list), true); // ugly way to convert array of object to array of assoc-array
  436.     }
  437.     /*
  438.      *  convert from array[] to Waypoint[]
  439.      */
  440.     public static function toWaypointArray(array $list)
  441.     {
  442.         $ro = [];
  443.         foreach ( $list as $row)
  444.         {
  445.             $ro[]= Waypoint::fromArray($row);
  446.         }
  447.         return $ro;
  448.     }
  449.     /**
  450.      * @param $date \DateTime|null
  451.      * @param $master \DateTime|null
  452.      * @return \DateTime|null
  453.      * @throws \Exception
  454.      * @deprecated
  455.      */
  456.     public static function ensureTimeWindow($date,$master)
  457.     {
  458.         if (($date===null)||($master===null)) return $date;
  459.         // a very plain way to ensure the right time window (time-only is initialized with 1.1.1970), we can safely ignore offsets/timezone
  460.         $diff abs($date->getTimestamp() - $master->getTimestamp());
  461.         if ($diff 86400// if date differs more then one day, fix it to same day
  462.         {
  463.             $date = new \DateTime($master->format('Y-m-d ')  .' '$date->format('H:i:s') );
  464.         }
  465.         return $date;
  466.     }
  467.     public function updateFromOrder(Order $order)
  468.     {
  469.         if ( ($this->knownOrder!==null)&& ($order->getId() !== $this->knownOrder->getId()) )
  470.             throw new \RuntimeException('Logic error');
  471.         // copy data
  472.         $job $this;
  473.         $job->setConfirmationPin($order->getConfirmationPin());
  474.         $job->setOrderNumber($order->getRemoteOrderId()); // the Job::orderNumber is the one from tami which is the same as Order::remoteOrderId
  475.         $job->setOrderTime($order->getOrderTime());
  476.         $job->setCustomer($order->getCustomer());
  477.         $job->setCustomerName($order->getCustomer() !== null $order->getCustomer()->getName() : '???' );
  478.         $adr $order->getAddressList()->toArray();
  479.         $adr array_filter($adr, function(Address $a) {
  480.            return !$a->getBeDeleted();
  481.         });
  482.         /** @var Address $origin */
  483.         $origin reset($adr);
  484.         /** @var Address $destination */
  485.         if (count($adr)<2)
  486.             throw new \Exception('Destination missing');
  487.         $destination end($adr);
  488.         $job->setWaypointsarray_valuesarray_map( function( Address $a) { return Waypoint::fromAddress($a); } , $adr) ) ); // need array_values for force re-indexing in correct order
  489.         $job->setOriginQuick($origin->getName());
  490.         $job->setOriginStreet($origin->getStreet());
  491.         $job->setOriginNumber($origin->getNumber());
  492.         $job->setOriginZip($origin->getZipCode());
  493.         $job->setOriginCity($origin->getCity());
  494.         $job->setDestinationQuick($destination->getName());
  495.         $job->setDestinationStreet($destination->getStreet());
  496.         $job->setDestinationNumber($destination->getNumber());
  497.         $job->setDestinationZip($destination->getZipCode());
  498.         $job->setDestinationCity($destination->getCity());
  499.         $job->setPersonCount($order->getPersonCount());
  500.         $job->setDistanceKm($order->getLastEstimatedDistance());
  501.         $job->setPrice($order->getLastEstimatedPrice());
  502.         $job->setPaymentType(  $order->getPaymentType()!==null $order->getPaymentType()->getName() : '');
  503.         $job->setInfo($order->getComment());
  504.         $job->setCostCenter($order->getCostCenter());
  505.         $job->setApplicantTimeRide($order->isApplicantTimeRide());
  506.         // ->setMember() is handled via OrderHandler::syncMemberFromOrderToJobIfRequired
  507.         // post-process
  508.         $job->setDetectedFFLPaymentCalculator::detectFFL($job) );
  509.         $job->setActualKm$job->getDistanceKm() );
  510.         $wrapper = [ $job ];
  511.         JobRepository::setupAssumptions$wrapper );
  512.     }
  513.     public static function createForOrder(Order $order)
  514.     {
  515.         $job = new Job(self::GENERATED);
  516.         $job->setCarId(0);
  517.         $job->setDriverId(0);
  518.         $job->setRelType(0);
  519.         $job->setJobDuration(0);
  520.         $job->setWaitTime(0);
  521.         $job->setKnownOrder($order);
  522.         $job->updateFromOrder($order);
  523.         return $job;
  524.     }
  525.     public function getTotalFor($audience)
  526.     {
  527.         if ($audience===Billing::TYPE_MEMBER)
  528.             return $this->getTotalMemberNet();
  529.         if ($audience===Billing::TYPE_CUSTOMER)
  530.             return $this->getTotalCustomerNet();
  531.         throw new \RuntimeException('Unknown audience');
  532.     }
  533.     /**
  534.      * Return net/vat parts as array [ vat*100 => [ 'net' => x, 'vat' => y ] ]
  535.      * @param $audience
  536.      * @return array
  537.      */
  538.     public function getVatPartsFor($audience)
  539.     {
  540.         $items $this->getCalcItemsFor($audience);
  541.         $parts = [];
  542.         $empty = ['net' => 0'vat' => 0];
  543.         /** @var JobCalcItem $it */
  544.         foreach ($items as $it)
  545.         {
  546.             $v = (int)($it->vat 100); // float array keys get truncated to int
  547.             if (!array_key_exists($v,$parts)) $parts[$v] = $empty;
  548.             $parts[$v] ['vat'] += $it->vat $it->totalNet;
  549.             $parts[$v] ['net'] += $it->totalNet;
  550.         }
  551.         return $parts;
  552.     }
  553.     /**
  554.      * @param $audience
  555.      * @return array|JobCalcItem[]
  556.      */
  557.     public function getCalcItemsFor($audience)
  558.     {
  559.         if ($audience===Billing::TYPE_MEMBER)
  560.             return $this->getMemberCalculationItems();
  561.         if ($audience===Billing::TYPE_CUSTOMER)
  562.             return $this->getCustomerCalculationItems();
  563.         throw new \RuntimeException('Unknown audience');
  564.     }
  565.     public function __construct($source self::UNKNOWN)
  566.     {
  567.         $this->confirmationPin Order::generatePin();
  568.         $this->source $source;
  569.     }
  570.     /*
  571.      * @return mixed
  572.      */
  573.     public function getId()
  574.     {
  575.         return $this->id;
  576.     }
  577.     /**
  578.      * @return mixed
  579.      */
  580.     public function getOrderNumber()
  581.     {
  582.         return $this->orderNumber;
  583.     }
  584.     /**
  585.      * @param mixed $orderNumber
  586.      */
  587.     public function setOrderNumber($orderNumber)
  588.     {
  589.         $this->orderNumber $orderNumber;
  590.     }
  591.     /**
  592.      * @return \DateTime
  593.      */
  594.     public function getOrderTime()
  595.     {
  596.         return $this->orderTime;
  597.     }
  598.     /**
  599.      * @param mixed $orderTime
  600.      */
  601.     public function setOrderTime($orderTime)
  602.     {
  603.         /** @noinspection TypeUnsafeComparisonInspection */
  604.         if ($orderTime != $this->orderTime)
  605.             $this->orderTime $orderTime;
  606.     }
  607.     /**
  608.      * @return mixed
  609.      */
  610.     public function getOriginQuick()
  611.     {
  612.         return $this->originQuick;
  613.     }
  614.     /**
  615.      * @param mixed $originQuick
  616.      */
  617.     public function setOriginQuick($originQuick)
  618.     {
  619.         $this->originQuick $originQuick;
  620.     }
  621.     /**
  622.      * @return mixed
  623.      */
  624.     public function getOriginStreet()
  625.     {
  626.         return $this->originStreet;
  627.     }
  628.     /**
  629.      * @param mixed $originStreet
  630.      */
  631.     public function setOriginStreet($originStreet)
  632.     {
  633.         $this->originStreet $originStreet;
  634.     }
  635.     /**
  636.      * @return mixed
  637.      */
  638.     public function getOriginNumber()
  639.     {
  640.         return $this->originNumber;
  641.     }
  642.     /**
  643.      * @param mixed $originNumber
  644.      */
  645.     public function setOriginNumber($originNumber)
  646.     {
  647.         $this->originNumber $originNumber;
  648.     }
  649.     /**
  650.      * @return mixed
  651.      */
  652.     public function getOriginZip()
  653.     {
  654.         return $this->originZip;
  655.     }
  656.     /**
  657.      * @param mixed $originZip
  658.      */
  659.     public function setOriginZip($originZip)
  660.     {
  661.         $this->originZip $originZip;
  662.     }
  663.     /**
  664.      * @return mixed
  665.      */
  666.     public function getOriginCity()
  667.     {
  668.         return $this->originCity;
  669.     }
  670.     /**
  671.      * @param mixed $originCity
  672.      */
  673.     public function setOriginCity($originCity)
  674.     {
  675.         $this->originCity $originCity;
  676.     }
  677.     /**
  678.      * @return mixed
  679.      */
  680.     public function getDestinationQuick()
  681.     {
  682.         return $this->destinationQuick;
  683.     }
  684.     /**
  685.      * @param mixed $destinationQuick
  686.      */
  687.     public function setDestinationQuick($destinationQuick)
  688.     {
  689.         $this->destinationQuick $destinationQuick;
  690.     }
  691.     /**
  692.      * @return mixed
  693.      */
  694.     public function getDestinationStreet()
  695.     {
  696.         return $this->destinationStreet;
  697.     }
  698.     /**
  699.      * @param mixed $destinationStreet
  700.      */
  701.     public function setDestinationStreet($destinationStreet)
  702.     {
  703.         $this->destinationStreet $destinationStreet;
  704.     }
  705.     /**
  706.      * @return mixed
  707.      */
  708.     public function getDestinationNumber()
  709.     {
  710.         return $this->destinationNumber;
  711.     }
  712.     /**
  713.      * @param mixed $destinationNumber
  714.      */
  715.     public function setDestinationNumber($destinationNumber)
  716.     {
  717.         $this->destinationNumber $destinationNumber;
  718.     }
  719.     /**
  720.      * @return mixed
  721.      */
  722.     public function getDestinationZip()
  723.     {
  724.         return $this->destinationZip;
  725.     }
  726.     /**
  727.      * @param mixed $destinationZip
  728.      */
  729.     public function setDestinationZip($destinationZip)
  730.     {
  731.         $this->destinationZip $destinationZip;
  732.     }
  733.     /**
  734.      * @return mixed
  735.      */
  736.     public function getDestinationCity()
  737.     {
  738.         return $this->destinationCity;
  739.     }
  740.     /**
  741.      * @param mixed $destinationCity
  742.      */
  743.     public function setDestinationCity($destinationCity)
  744.     {
  745.         $this->destinationCity $destinationCity;
  746.     }
  747.     /**
  748.      * @return mixed
  749.      */
  750.     public function getPersonCount()
  751.     {
  752.         return $this->personCount;
  753.     }
  754.     /**
  755.      * @param mixed $personCount
  756.      */
  757.     public function setPersonCount($personCount)
  758.     {
  759.         $this->personCount $personCount;
  760.     }
  761.     /**
  762.      * @return mixed
  763.      */
  764.     public function getDistanceKm()
  765.     {
  766.         return $this->distanceKm;
  767.     }
  768.     /**
  769.      * @param mixed $distanceKm
  770.      */
  771.     public function setDistanceKm($distanceKm)
  772.     {
  773.         $this->distanceKm $distanceKm;
  774.     }
  775.     /**
  776.      * @return mixed
  777.      */
  778.     public function getWaitTime()
  779.     {
  780.         return $this->waitTime;
  781.     }
  782.     /**
  783.      * @param mixed $waitTime
  784.      */
  785.     public function setWaitTime($waitTime)
  786.     {
  787.         $this->waitTime $waitTime;
  788.     }
  789.     /**
  790.      * @return mixed
  791.      */
  792.     public function getPaymentType()
  793.     {
  794.         return $this->paymentType;
  795.     }
  796.     /**
  797.      * @param mixed $paymentType
  798.      */
  799.     public function setPaymentType($paymentType)
  800.     {
  801.         $this->paymentType $paymentType;
  802.     }
  803.     /**
  804.      * @return mixed
  805.      */
  806.     public function getPrice()
  807.     {
  808.         return $this->price;
  809.     }
  810.     /**
  811.      * @param mixed $price
  812.      */
  813.     public function setPrice($price)
  814.     {
  815.         $this->price $price;
  816.     }
  817.     /**
  818.      * @return mixed
  819.      */
  820.     public function getCarId()
  821.     {
  822.         return $this->carId;
  823.     }
  824.     /**
  825.      * @param mixed $carId
  826.      */
  827.     public function setCarId($carId)
  828.     {
  829.         $this->carId $carId;
  830.     }
  831.     /**
  832.      * @return mixed
  833.      */
  834.     public function getDriverId()
  835.     {
  836.         return $this->driverId;
  837.     }
  838.     /**
  839.      * @param mixed $driverId
  840.      */
  841.     public function setDriverId($driverId)
  842.     {
  843.         $this->driverId $driverId;
  844.     }
  845.     /**
  846.      * @return mixed
  847.      */
  848.     public function getInfo()
  849.     {
  850.         return $this->info;
  851.     }
  852.     /**
  853.      * @param mixed $info
  854.      */
  855.     public function setInfo($info)
  856.     {
  857.         $this->info $info;
  858.     }
  859.     /**
  860.      * @return mixed
  861.      */
  862.     public function getCostCenter()
  863.     {
  864.         return $this->costCenter;
  865.     }
  866.     /**
  867.      * @param mixed $costCenter
  868.      */
  869.     public function setCostCenter($costCenter)
  870.     {
  871.         $this->costCenter $costCenter;
  872.     }
  873.     /**
  874.      * @return mixed
  875.      */
  876.     public function getJobReceivedTime()
  877.     {
  878.         return $this->jobReceivedTime;
  879.     }
  880.     /**
  881.      * @param mixed $jobReceivedTime
  882.      */
  883.     public function setJobReceivedTime($jobReceivedTime)
  884.     {
  885.         /** @noinspection TypeUnsafeComparisonInspection */
  886.         if ($jobReceivedTime != $this->jobReceivedTime// to prevent doctrine from updating when the date is the same but in a new instance
  887.             $this->jobReceivedTime $jobReceivedTime;
  888.     }
  889.     /**
  890.      * @return mixed
  891.      */
  892.     public function getJobStartTime()
  893.     {
  894.         return $this->jobStartTime;
  895.     }
  896.     /**
  897.      * @param mixed $jobStartTime
  898.      */
  899.     public function setJobStartTime($jobStartTime)
  900.     {
  901.         /** @noinspection TypeUnsafeComparisonInspection */
  902.         if ($jobStartTime != $this->jobStartTime)
  903.             $this->jobStartTime $jobStartTime;
  904.     }
  905.     /**
  906.      * @return mixed
  907.      */
  908.     public function getJobDoneTime()
  909.     {
  910.         return $this->jobDoneTime;
  911.     }
  912.     /**
  913.      * @param mixed $jobDoneTime
  914.      */
  915.     public function setJobDoneTime($jobDoneTime)
  916.     {
  917.         /** @noinspection TypeUnsafeComparisonInspection */
  918.         if ($jobDoneTime != $this->jobDoneTime)
  919.             $this->jobDoneTime $jobDoneTime;
  920.     }
  921.     /**
  922.      * @return mixed
  923.      */
  924.     public function getJobDuration()
  925.     {
  926.         return $this->jobDuration;
  927.     }
  928.     /**
  929.      * @param mixed $jobDuration
  930.      */
  931.     public function setJobDuration($jobDuration)
  932.     {
  933.         $this->jobDuration $jobDuration;
  934.     }
  935.     /**
  936.      * @return mixed
  937.      */
  938.     public function getRelType()
  939.     {
  940.         return $this->relType;
  941.     }
  942.     /**
  943.      * @param mixed $relType
  944.      */
  945.     public function setRelType($relType)
  946.     {
  947.         $this->relType $relType;
  948.     }
  949.     /**
  950.      * @return mixed
  951.      */
  952.     public function getRelId()
  953.     {
  954.         return $this->relId;
  955.     }
  956.     /**
  957.      * @param mixed $relId
  958.      */
  959.     public function setRelId($relId)
  960.     {
  961.         $this->relId $relId;
  962.     }
  963.     /**
  964.      * @return mixed
  965.      */
  966.     public function getCustomerName()
  967.     {
  968.         return $this->customerName;
  969.     }
  970.     /**
  971.      * @param mixed $customerName
  972.      */
  973.     public function setCustomerName($customerName)
  974.     {
  975.         $this->customerName $customerName;
  976.     }
  977.     /**
  978.      * @return mixed
  979.      */
  980.     public function getFlightOnPositionTime()
  981.     {
  982.         return $this->flightOnPositionTime;
  983.     }
  984.     /**
  985.      * @param mixed $flightOnPositionTime
  986.      */
  987.     public function setFlightOnPositionTime($flightOnPositionTime)
  988.     {
  989.         $this->flightOnPositionTime $flightOnPositionTime;
  990.     }
  991.     /**
  992.      * @return \DateTime|null
  993.      */
  994.     public function getDepartureAtOriginTime()
  995.     {
  996.         return $this->departureAtOriginTime;
  997.     }
  998.     /**
  999.      * @param mixed $departureAtOriginTime
  1000.      */
  1001.     public function setDepartureAtOriginTime($departureAtOriginTime)
  1002.     {
  1003.         $this->departureAtOriginTime $departureAtOriginTime;
  1004.     }
  1005.     /**
  1006.      * @return mixed
  1007.      */
  1008.     public function getExtraCostName()
  1009.     {
  1010.         return $this->extraCostName;
  1011.     }
  1012.     /**
  1013.      * @param mixed $extraCostName
  1014.      */
  1015.     public function setExtraCostName($extraCostName)
  1016.     {
  1017.         $this->extraCostName $extraCostName;
  1018.     }
  1019.     /**
  1020.      * @return mixed
  1021.      */
  1022.     public function getExtraCostPrice()
  1023.     {
  1024.         return $this->extraCostPrice;
  1025.     }
  1026.     /**
  1027.      * @param mixed $extraCostPrice
  1028.      */
  1029.     public function setExtraCostPrice($extraCostPrice)
  1030.     {
  1031.         $this->extraCostPrice $extraCostPrice;
  1032.     }
  1033.     /**
  1034.      * @param $audience string Billing::TYPE_CUSTOMER or Billing::TYPE_MEMBER
  1035.      * @return mixed
  1036.      */
  1037.     public function isBilled($audience)
  1038.     {
  1039.         if ($audience===Billing::TYPE_MEMBER)
  1040.             return ($this->billingForMember !== null);
  1041.         else
  1042.         if ($audience===Billing::TYPE_CUSTOMER)
  1043.             return ($this->billingForCustomer !== null);
  1044.         else
  1045.             throw new \RuntimeException('Unknown audience. has to be TYPE_MEMBER or TYPE_CUSTOMER');
  1046.     }
  1047.     /**
  1048.      * @return CoopMember|null
  1049.      */
  1050.     public function getMember()
  1051.     {
  1052.         return $this->member;
  1053.     }
  1054.     /**
  1055.      * @param mixed $member
  1056.      */
  1057.     public function setMember($member)
  1058.     {
  1059.         $this->member $member;
  1060.     }
  1061.     /**
  1062.      * @return \DateTime|null
  1063.      */
  1064.     public function getArrivalAtDestinationTime()
  1065.     {
  1066.         return $this->arrivalAtDestinationTime;
  1067.     }
  1068.     /**
  1069.      * @param mixed $arrivalAtDestinationTime
  1070.      */
  1071.     public function setArrivalAtDestinationTime($arrivalAtDestinationTime)
  1072.     {
  1073.         $this->arrivalAtDestinationTime $arrivalAtDestinationTime;
  1074.     }
  1075.     /**
  1076.      * @return Customer|null
  1077.      */
  1078.     public function getCustomer()
  1079.     {
  1080.         return $this->customer;
  1081.     }
  1082.     /**
  1083.      * @param mixed $customer
  1084.      */
  1085.     public function setCustomer($customer)
  1086.     {
  1087.         $this->customer $customer;
  1088.     }
  1089.     /**
  1090.      * @return array
  1091.      */
  1092.     public function getAccMemberRates()
  1093.     {
  1094.         if ($this->accMemberRates===null) return [];
  1095.         return $this->accMemberRates;
  1096.     }
  1097.     /**
  1098.      * @param array $accMemberRates
  1099.      */
  1100.     public function setAccMemberRates($accMemberRates)
  1101.     {
  1102.         $this->accMemberRates $accMemberRates;
  1103.     }
  1104.     /**
  1105.      * @return array
  1106.      */
  1107.     public function getAccCustomerRates()
  1108.     {
  1109.         if ($this->accCustomerRates===null) return [];
  1110.         return $this->accCustomerRates;
  1111.     }
  1112.     /**
  1113.      * @param array $accCustomerRates
  1114.      */
  1115.     public function setAccCustomerRates($accCustomerRates)
  1116.     {
  1117.         $this->accCustomerRates $accCustomerRates;
  1118.     }
  1119.     /**
  1120.      * @return string
  1121.      */
  1122.     public function getOptions()
  1123.     {
  1124.         return $this->options;
  1125.     }
  1126.     /**
  1127.      * @param string $options
  1128.      */
  1129.     public function setOptions($options)
  1130.     {
  1131.         $this->options $options;
  1132.     }
  1133.     /**
  1134.      * @return float
  1135.      */
  1136.     public function getAccMemberManualRate()
  1137.     {
  1138.         return $this->accMemberManualRate;
  1139.     }
  1140.     /**
  1141.      * @param float $accMemberManualRate
  1142.      */
  1143.     public function setAccMemberManualRate($accMemberManualRate)
  1144.     {
  1145.         $this->accMemberManualRate $accMemberManualRate;
  1146.     }
  1147.     /**
  1148.      * @return float
  1149.      */
  1150.     public function getAccCustomerManualRate()
  1151.     {
  1152.         return $this->accCustomerManualRate;
  1153.     }
  1154.     /**
  1155.      * @param float $accCustomerManualRate
  1156.      */
  1157.     public function setAccCustomerManualRate($accCustomerManualRate)
  1158.     {
  1159.         $this->accCustomerManualRate $accCustomerManualRate;
  1160.     }
  1161.     /**
  1162.      * @return null|Order
  1163.      */
  1164.     public function getKnownOrder()
  1165.     {
  1166.         return $this->knownOrder;
  1167.     }
  1168.     public function getKnownOrderId()
  1169.     {
  1170.         if ($this->knownOrder !== null)
  1171.             return $this->knownOrder->getOrderId();
  1172.         return null;
  1173.     }
  1174.     /**
  1175.      * @param Order|null $knownOrder
  1176.      */
  1177.     public function setKnownOrder($knownOrder)
  1178.     {
  1179.         $this->knownOrder $knownOrder;
  1180.         if ($knownOrder!==null$knownOrder->setJob($this);
  1181.     }
  1182.     /**
  1183.      * @return bool
  1184.      */
  1185.     public function isReadyForBilling()
  1186.     {
  1187.         return $this->readyForBilling;
  1188.     }
  1189.     /**
  1190.      * @param bool $readyForBilling
  1191.      */
  1192.     public function setReadyForBilling($readyForBilling)
  1193.     {
  1194.         $this->readyForBilling $readyForBilling;
  1195.     }
  1196.     /**
  1197.      * @return array
  1198.      */
  1199.     public function getLastReadyForBillingCheckResult(): array
  1200.     {
  1201.         if ($this->lastReadyForBillingCheckResult === null) return [];
  1202.         return $this->lastReadyForBillingCheckResult;
  1203.     }
  1204.     /**
  1205.      * @param array $lastReadyForBillingCheckResult
  1206.      */
  1207.     public function setLastReadyForBillingCheckResult(array $lastReadyForBillingCheckResult): void
  1208.     {
  1209.         $this->lastReadyForBillingCheckResult $lastReadyForBillingCheckResult;
  1210.     }
  1211.     /**
  1212.      * @return string
  1213.      */
  1214.     public function getDetectedFFL()
  1215.     {
  1216.         return $this->detectedFFL;
  1217.     }
  1218.     /**
  1219.      * @param string $detectedFFL
  1220.      */
  1221.     public function setDetectedFFL($detectedFFL)
  1222.     {
  1223.         $this->detectedFFL $detectedFFL;
  1224.     }
  1225.     /**
  1226.      * @return int
  1227.      */
  1228.     public function getActualKm()
  1229.     {
  1230.         return $this->actualKm;
  1231.     }
  1232.     /**
  1233.      * @param int $actualKm
  1234.      */
  1235.     public function setActualKm($actualKm)
  1236.     {
  1237.         $this->actualKm $actualKm;
  1238.     }
  1239.     /**
  1240.      * @param $audience
  1241.      * @return Billing
  1242.      */
  1243.     public function getBillingFor($audience)
  1244.     {
  1245.         if ($audience===Billing::TYPE_MEMBER)
  1246.             return $this->getBillingForMember();
  1247.         if ($audience===Billing::TYPE_CUSTOMER)
  1248.             return $this->getBillingForCustomer();
  1249.         throw new \RuntimeException('Unknown audience');
  1250.     }
  1251.     /**
  1252.      * @return BillingForMember
  1253.      */
  1254.     public function getBillingForMember()
  1255.     {
  1256.         return $this->billingForMember;
  1257.     }
  1258.     /**
  1259.      * @param mixed $billingForMember
  1260.      */
  1261.     public function setBillingForMember($billingForMember)
  1262.     {
  1263.         $this->billingForMember $billingForMember;
  1264.     }
  1265.     /**
  1266.      * @return BillingForCustomer
  1267.      */
  1268.     public function getBillingForCustomer()
  1269.     {
  1270.         return $this->billingForCustomer;
  1271.     }
  1272.     /**
  1273.      * @param mixed $billingForCustomer
  1274.      */
  1275.     public function setBillingForCustomer($billingForCustomer)
  1276.     {
  1277.         $this->billingForCustomer $billingForCustomer;
  1278.     }
  1279.     /**
  1280.      * @return float
  1281.      */
  1282.     public function getTotalCustomerNet()
  1283.     {
  1284.         return $this->totalCustomerNet;
  1285.     }
  1286.     /**
  1287.      * // called from setCustomerCalculationItems()
  1288.      * @param float $totalCustomerNet
  1289.      */
  1290.     private function setTotalCustomerNet($totalCustomerNet)
  1291.     {
  1292.         $this->totalCustomerNet $totalCustomerNet;
  1293.     }
  1294.     /**
  1295.      * @return float
  1296.      */
  1297.     public function getTotalMemberNet()
  1298.     {
  1299.         return $this->totalMemberNet;
  1300.     }
  1301.     /**
  1302.      * // called from setMemberCalculationItems()
  1303.      * @param float $totalMemberNet
  1304.      */
  1305.     private function setTotalMemberNet($totalMemberNet)
  1306.     {
  1307.         $this->totalMemberNet $totalMemberNet;
  1308.     }
  1309.     /**
  1310.      * @return array|JobCalcItem[]
  1311.      */
  1312.     public function getCustomerCalculationItems()
  1313.     {
  1314.         return self::toJciArray($this->customerCalculationItems);
  1315.     }
  1316.     /**
  1317.      * @param array $customerCalculationItems
  1318.      */
  1319.     public function setCustomerCalculationItems($customerCalculationItems)
  1320.     {
  1321.         $this->setTotalCustomerNetarray_sum(array_map(static function($e) { return $e->totalNet; }, $customerCalculationItems)) );
  1322.         $this->customerCalculationItems self::fromObjectArray($customerCalculationItems);
  1323.     }
  1324.     /**
  1325.      * @return array|JobCalcItem[]
  1326.      */
  1327.     public function getMemberCalculationItems()
  1328.     {
  1329.         return self::toJciArray($this->memberCalculationItems);
  1330.     }
  1331.     /**
  1332.      * @param array $memberCalculationItems
  1333.      */
  1334.     public function setMemberCalculationItems($memberCalculationItems)
  1335.     {
  1336.         $this->setTotalMemberNetarray_sum(array_map(static function($e) { return $e->totalNet; }, $memberCalculationItems)) );
  1337.         $this->memberCalculationItems self::fromObjectArray($memberCalculationItems);
  1338.     }
  1339.     /**
  1340.      * @return float
  1341.      */
  1342.     public function getTaxameter()
  1343.     {
  1344.         return $this->taxameter;
  1345.     }
  1346.     /**
  1347.      * @param float $taxameter
  1348.      */
  1349.     public function setTaxameter($taxameter)
  1350.     {
  1351.         $this->taxameter $taxameter;
  1352.     }
  1353.     /**
  1354.      * @return float
  1355.      */
  1356.     public function getTaxameterVat()
  1357.     {
  1358.         return $this->taxameterVat;
  1359.     }
  1360.     /**
  1361.      * @param float $taxameterVat
  1362.      */
  1363.     public function setTaxameterVat($taxameterVat)
  1364.     {
  1365.         $this->taxameterVat $taxameterVat;
  1366.     }
  1367.     /**
  1368.      * @return bool
  1369.      */
  1370.     public function getPassengerNotMet()
  1371.     {
  1372.         return $this->passengerNotMet;
  1373.     }
  1374.     /**
  1375.      * @param bool $passengerNotMet
  1376.      */
  1377.     public function setPassengerNotMet($passengerNotMet)
  1378.     {
  1379.         $this->passengerNotMet $passengerNotMet;
  1380.     }
  1381.     /**
  1382.      * @return bool
  1383.      */
  1384.     public function isFflCombinationRide()
  1385.     {
  1386.         return $this->fflCombinationRide;
  1387.     }
  1388.     /**
  1389.      * @param bool $fflCombinationRide
  1390.      */
  1391.     public function setFflCombinationRide($fflCombinationRide)
  1392.     {
  1393.         $this->fflCombinationRide $fflCombinationRide;
  1394.     }
  1395.     /**
  1396.      * @return bool
  1397.      */
  1398.     public function isDiscarded()
  1399.     {
  1400.         return $this->discarded;
  1401.     }
  1402.     /**
  1403.      * @param bool $discarded
  1404.      */
  1405.     public function setDiscarded($discarded)
  1406.     {
  1407.         $this->discarded $discarded;
  1408.     }
  1409.     /**
  1410.      * @return array|Waypoint[]
  1411.      */
  1412.     public function getWaypoints()
  1413.     {
  1414.         if ($this->waypoints === null) return [];
  1415.         return self::toWaypointArray($this->waypoints);
  1416.     }
  1417.     /**
  1418.      * @param array|Waypoint[] $waypoints
  1419.      */
  1420.     public function setWaypoints($waypoints)
  1421.     {
  1422.         $new self::fromObjectArray($waypoints);
  1423.         if ($new!=$this->waypoints// basic change detection
  1424.             $this->waypoints $new;
  1425.     }
  1426.     /**
  1427.      * @return bool
  1428.      */
  1429.     public function isExtraWaitingTimeRide()
  1430.     {
  1431.         return $this->extraWaitingTimeRide;
  1432.     }
  1433.     /**
  1434.      * @param bool $extraWaitingTimeRide
  1435.      */
  1436.     public function setExtraWaitingTimeRide($extraWaitingTimeRide)
  1437.     {
  1438.         $this->extraWaitingTimeRide $extraWaitingTimeRide;
  1439.     }
  1440.     /**
  1441.      * @return int
  1442.      */
  1443.     public function getExtraWaitingTime()
  1444.     {
  1445.         return $this->extraWaitingTime;
  1446.     }
  1447.     /**
  1448.      * @param int $extraWaitingTime
  1449.      */
  1450.     public function setExtraWaitingTime($extraWaitingTime)
  1451.     {
  1452.         $this->extraWaitingTime $extraWaitingTime;
  1453.     }
  1454.     /**
  1455.      * @return bool
  1456.      */
  1457.     public function isDisablePricelistCalculation()
  1458.     {
  1459.         return $this->disablePricelistCalculation;
  1460.     }
  1461.     /**
  1462.      * @param bool $disablePricelistCalculation
  1463.      */
  1464.     public function setDisablePricelistCalculation($disablePricelistCalculation)
  1465.     {
  1466.         $this->disablePricelistCalculation $disablePricelistCalculation;
  1467.     }
  1468.     /**
  1469.      * @return bool
  1470.      */
  1471.     public function isDisableTaxameterForCustomer(): bool
  1472.     {
  1473.         return $this->disableTaxameterForCustomer;
  1474.     }
  1475.     /**
  1476.      * @param bool $disableTaxameterForCustomer
  1477.      */
  1478.     public function setDisableTaxameterForCustomer(bool $disableTaxameterForCustomer): void
  1479.     {
  1480.         $this->disableTaxameterForCustomer $disableTaxameterForCustomer;
  1481.     }
  1482.     /**
  1483.      * @return bool
  1484.      */
  1485.     public function getHasMemberExtraKm(): bool
  1486.     {
  1487.         return $this->hasMemberExtraKm;
  1488.     }
  1489.     /**
  1490.      * @param bool $hasMemberExtraKm
  1491.      */
  1492.     public function setHasMemberExtraKm(bool $hasMemberExtraKm): void
  1493.     {
  1494.         $this->hasMemberExtraKm $hasMemberExtraKm;
  1495.     }
  1496.     /**
  1497.      * @return int
  1498.      */
  1499.     public function getMemberExtraKm(): int
  1500.     {
  1501.         return $this->memberExtraKm;
  1502.     }
  1503.     /**
  1504.      * @param int $memberExtraKm
  1505.      */
  1506.     public function setMemberExtraKm(int $memberExtraKm): void
  1507.     {
  1508.         $this->memberExtraKm $memberExtraKm;
  1509.     }
  1510.     /**
  1511.      * @return null|\DateTime
  1512.      */
  1513.     public function getLastChangeByMember()
  1514.     {
  1515.         return $this->lastChangeByMember;
  1516.     }
  1517.     /**
  1518.      * @param null|\DateTime $lastChangeByMember
  1519.      */
  1520.     public function setLastChangeByMember($lastChangeByMember): void
  1521.     {
  1522.         $this->lastChangeByMember $lastChangeByMember;
  1523.     }
  1524.     /**
  1525.      * @return bool
  1526.      */
  1527.     public function isInstantRide(): bool
  1528.     {
  1529.         return $this->instantRide;
  1530.     }
  1531.     /**
  1532.      * @param bool $instantRide
  1533.      */
  1534.     public function setInstantRide(bool $instantRide): void
  1535.     {
  1536.         $this->instantRide $instantRide;
  1537.     }
  1538.     /**
  1539.      * @return bool
  1540.      */
  1541.     public function isApprovedByDriver(): bool
  1542.     {
  1543.         return $this->approvedByDriver;
  1544.     }
  1545.     /**
  1546.      * @param bool $approvedByDriver
  1547.      */
  1548.     public function setApprovedByDriver(bool $approvedByDriver): void
  1549.     {
  1550.         $this->approvedByDriver $approvedByDriver;
  1551.     }
  1552.     /**
  1553.      * @return bool
  1554.      */
  1555.     public function isApprovedByPassenger(): bool
  1556.     {
  1557.         return $this->approvedByPassenger;
  1558.     }
  1559.     /**
  1560.      * @param bool $approvedByPassenger
  1561.      */
  1562.     public function setApprovedByPassenger(bool $approvedByPassenger): void
  1563.     {
  1564.         $this->approvedByPassenger $approvedByPassenger;
  1565.     }
  1566.     /**
  1567.      * @return bool
  1568.      */
  1569.     public function isApprovedByAccounting(): bool
  1570.     {
  1571.         return $this->approvedByAccounting;
  1572.     }
  1573.     /**
  1574.      * @param bool $approvedByAccounting
  1575.      */
  1576.     public function setApprovedByAccounting(bool $approvedByAccounting): void
  1577.     {
  1578.         $this->approvedByAccounting $approvedByAccounting;
  1579.     }
  1580.     public function getApprovalStatus()
  1581.     {
  1582.         $ret 0;
  1583.         if  ($this->isReadyForBilling()) $ret += 0x1;
  1584.         if  ($this->isApprovedByDriver()) $ret += 0x2;
  1585.         if  ($this->isApprovedByPassenger()) $ret += 0x4;
  1586.         if  ($this->isApprovedByAccounting()) $ret += 0x8;
  1587.         return $ret;
  1588.     }
  1589.     /**
  1590.      * @return string
  1591.      */
  1592.     public function getConfirmationPin(): string
  1593.     {
  1594.         return $this->confirmationPin;
  1595.     }
  1596.     /**
  1597.      * @param string $confirmationPin
  1598.      */
  1599.     public function setConfirmationPin(string $confirmationPin): void
  1600.     {
  1601.         $this->confirmationPin $confirmationPin;
  1602.     }
  1603.     /**
  1604.      * @return mixed
  1605.      */
  1606.     public function getCustomerSignature()
  1607.     {
  1608.         return $this->customerSignature;
  1609.     }
  1610.     /**
  1611.      * @param mixed $customerSignature
  1612.      */
  1613.     public function setCustomerSignature($customerSignature): void
  1614.     {
  1615.         $this->customerSignature $customerSignature;
  1616.     }
  1617.     /**
  1618.      * @return string
  1619.      */
  1620.     public function getSource(): string
  1621.     {
  1622.         return $this->source;
  1623.     }
  1624.     /**
  1625.      * @param string $source
  1626.      */
  1627.     public function setSource(string $source): void
  1628.     {
  1629.         $this->source $source;
  1630.     }
  1631.     /**
  1632.      * @return int
  1633.      */
  1634.     public function getInstantRideAdditionalWaitingTime(): int
  1635.     {
  1636.         return $this->instantRideAdditionalWaitingTime;
  1637.     }
  1638.     /**
  1639.      * @param int $instantRideAdditionalWaitingTime
  1640.      */
  1641.     public function setInstantRideAdditionalWaitingTime(int $instantRideAdditionalWaitingTime): void
  1642.     {
  1643.         $this->instantRideAdditionalWaitingTime $instantRideAdditionalWaitingTime;
  1644.     }
  1645.     /**
  1646.      * @return mixed
  1647.      */
  1648.     public function getConfirmedByCustomerThrough()
  1649.     {
  1650.         return $this->confirmedByCustomerThrough;
  1651.     }
  1652.     /**
  1653.      * @param mixed $confirmedByCustomerThrough
  1654.      */
  1655.     public function setConfirmedByCustomerThrough($confirmedByCustomerThrough): void
  1656.     {
  1657.         $this->confirmedByCustomerThrough $confirmedByCustomerThrough;
  1658.     }
  1659.     /**
  1660.      * @return bool
  1661.      */
  1662.     public function isIgnoreForCustomer(): bool
  1663.     {
  1664.         return $this->ignoreForCustomer;
  1665.     }
  1666.     /**
  1667.      * @param bool $ignoreForCustomer
  1668.      */
  1669.     public function setIgnoreForCustomer(bool $ignoreForCustomer): void
  1670.     {
  1671.         $this->ignoreForCustomer $ignoreForCustomer;
  1672.     }
  1673.     /**
  1674.      * @return mixed
  1675.      */
  1676.     public function getRecalculateCustomerPrice()
  1677.     {
  1678.         return $this->recalculateCustomerPrice;
  1679.     }
  1680.     /**
  1681.      * @param mixed $recalculateCustomerPrice
  1682.      */
  1683.     public function setRecalculateCustomerPrice($recalculateCustomerPrice): void
  1684.     {
  1685.         $this->recalculateCustomerPrice $recalculateCustomerPrice;
  1686.     }
  1687.     /**
  1688.      * @return bool
  1689.      */
  1690.     public function isIgnoreForMember(): bool
  1691.     {
  1692.         return $this->ignoreForMember;
  1693.     }
  1694.     /**
  1695.      * @param bool $ignoreForMember
  1696.      */
  1697.     public function setIgnoreForMember(bool $ignoreForMember): void
  1698.     {
  1699.         $this->ignoreForMember $ignoreForMember;
  1700.     }
  1701.     /**
  1702.      * @return string
  1703.      */
  1704.     public function getRideStyle(): string
  1705.     {
  1706.         return $this->rideStyle;
  1707.     }
  1708.     /**
  1709.      * @param string $rideStyle
  1710.      */
  1711.     public function setRideStyle(string $rideStyle): void
  1712.     {
  1713.         $this->rideStyle $rideStyle;
  1714.     }
  1715.     /**
  1716.      * @return bool
  1717.      */
  1718.     public function isWerksRundfahrt(): bool
  1719.     {
  1720.         return $this->werksRundfahrt;
  1721.     }
  1722.     /**
  1723.      * @param bool $werksRundfahrt
  1724.      */
  1725.     public function setWerksRundfahrt(bool $werksRundfahrt): void
  1726.     {
  1727.         $this->werksRundfahrt $werksRundfahrt;
  1728.     }
  1729.     /**
  1730.      * @return array|string[]
  1731.      */
  1732.     public function getControlling(): array
  1733.     {
  1734.         if ($this->controlling===null)
  1735.             return [];
  1736.         return $this->controlling;
  1737.     }
  1738.     /**
  1739.      * @param array|string[] $controlling
  1740.      */
  1741.     public function setControlling(array $controlling): void
  1742.     {
  1743.         $this->controlling array_values($controlling);
  1744.     }
  1745.     /**
  1746.      * @return bool
  1747.      */
  1748.     public function isCustomerStorno(): bool
  1749.     {
  1750.         return $this->customerStorno;
  1751.     }
  1752.     /**
  1753.      * @param bool $customerStorno
  1754.      */
  1755.     public function setCustomerStorno(bool $customerStorno): void
  1756.     {
  1757.         $this->customerStorno $customerStorno;
  1758.     }
  1759.     /**
  1760.      * @return int
  1761.      */
  1762.     public function getSLC(): int
  1763.     {
  1764.         return $this->SLC;
  1765.     }
  1766.     /**
  1767.      * @param int $SLC
  1768.      */
  1769.     public function setSLC(int $SLC): void
  1770.     {
  1771.         $this->SLC $SLC;
  1772.     }
  1773.     /**
  1774.      * @return int
  1775.      */
  1776.     public function getVVC(): int
  1777.     {
  1778.         return $this->VVC;
  1779.     }
  1780.     /**
  1781.      * @param int $VVC
  1782.      */
  1783.     public function setVVC(int $VVC): void
  1784.     {
  1785.         $this->VVC $VVC;
  1786.     }
  1787.     /**
  1788.      * @return ?float
  1789.      */
  1790.     public function getMemberCalcForceTaxRate(): ?float
  1791.     {
  1792.         return $this->memberCalcForceTaxRate;
  1793.     }
  1794.     /**
  1795.      * @param ?float $memberCalcForceTaxRate
  1796.      */
  1797.     public function setMemberCalcForceTaxRate(?float $memberCalcForceTaxRate): void
  1798.     {
  1799.         $this->memberCalcForceTaxRate $memberCalcForceTaxRate;
  1800.     }
  1801.     /**
  1802.      * @return Job|null
  1803.      */
  1804.     public function getCombiRideParent()
  1805.     {
  1806.         return $this->combiRideParent;
  1807.     }
  1808.     /**
  1809.      * @param Job|null $combiRideParent
  1810.      */
  1811.     public function setCombiRideParent($combiRideParent): void
  1812.     {
  1813.         $this->combiRideParent $combiRideParent;
  1814.     }
  1815.     /**
  1816.      * @return Job|null
  1817.      */
  1818.     public function getCombiRideChild()
  1819.     {
  1820.         return $this->combiRideChild;
  1821.     }
  1822.     /**
  1823.      * @param Job|null $combiRideChild
  1824.      */
  1825.     public function setCombiRideChild($combiRideChild): void
  1826.     {
  1827.         $this->combiRideChild $combiRideChild;
  1828.     }
  1829.     /**
  1830.      * @return int
  1831.      */
  1832.     public function getCombiAssignmentState(): int
  1833.     {
  1834.         return $this->combiAssignmentState;
  1835.     }
  1836.     /**
  1837.      * @param int $combiAssignmentState
  1838.      */
  1839.     public function setCombiAssignmentState(int $combiAssignmentState): void
  1840.     {
  1841.         $this->combiAssignmentState $combiAssignmentState;
  1842.     }
  1843.     /**
  1844.      * @return bool
  1845.      */
  1846.     public function isOptSubCustomerNet(): bool
  1847.     {
  1848.         return $this->optSubCustomerNet;
  1849.     }
  1850.     /**
  1851.      * @param bool $optSubCustomerNet
  1852.      */
  1853.     public function setOptSubCustomerNet(bool $optSubCustomerNet): void
  1854.     {
  1855.         $this->optSubCustomerNet $optSubCustomerNet;
  1856.     }
  1857.     /**
  1858.      * @return bool
  1859.      */
  1860.     public function isOptNoExtrasForCustomer(): bool
  1861.     {
  1862.         return $this->optNoExtrasForCustomer;
  1863.     }
  1864.     /**
  1865.      * @param bool $optNoExtrasForCustomer
  1866.      */
  1867.     public function setOptNoExtrasForCustomer(bool $optNoExtrasForCustomer): void
  1868.     {
  1869.         $this->optNoExtrasForCustomer $optNoExtrasForCustomer;
  1870.     }
  1871.     /**
  1872.      * @return bool
  1873.      */
  1874.     public function isOptAddChargeForCustomer(): bool
  1875.     {
  1876.         return $this->optAddChargeForCustomer;
  1877.     }
  1878.     /**
  1879.      * @param bool $optAddChargeForCustomer
  1880.      */
  1881.     public function setOptAddChargeForCustomer(bool $optAddChargeForCustomer): void
  1882.     {
  1883.         $this->optAddChargeForCustomer $optAddChargeForCustomer;
  1884.     }
  1885.     /**
  1886.      * @return bool
  1887.      */
  1888.     public function isApplicantTimeRide(): bool
  1889.     {
  1890.         return $this->applicantTimeRide;
  1891.     }
  1892.     /**
  1893.      * @param bool $applicantTimeRide
  1894.      */
  1895.     public function setApplicantTimeRide(bool $applicantTimeRide): void
  1896.     {
  1897.         $this->applicantTimeRide $applicantTimeRide;
  1898.     }
  1899.     /**
  1900.      * @return int
  1901.      */
  1902.     public function getApplicantTime(): int
  1903.     {
  1904.         return $this->applicantTime;
  1905.     }
  1906.     /**
  1907.      * @param int $applicantTime
  1908.      */
  1909.     public function setApplicantTime(int $applicantTime): void
  1910.     {
  1911.         $this->applicantTime $applicantTime;
  1912.     }
  1913. }