src/AppBundle/MainBundle/Entity/Orders_Suppliers_Transfer.php line 744

Open in your IDE?
  1. <?php
  2. namespace App\AppBundle\MainBundle\Entity;
  3. use App\AppBundle\MainBundle\Entity\Orders;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use JsonSerializable;
  9. use PetstoreIO\Order;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12.  * AddOns
  13.  *
  14.  * @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\Orders_Suppliers_TransferRepository")
  15.  * @ORM\Table(name="orders_suppliers_transfer")
  16.  * @ORM\HasLifecycleCallbacks()
  17.  */
  18. class Orders_Suppliers_Transfer implements JsonSerializable
  19. {
  20.     /**
  21.      * @ORM\Column(type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var Orders
  28.      * @ORM\ManyToOne(targetEntity="Orders", inversedBy="order_supplier_transfer")
  29.      * @ORM\JoinColumn(name="order_id", referencedColumnName="id", nullable=true)
  30.      */
  31.     private $order;
  32.     /**
  33.      * @var Orders_Suppliers_Transfers_Payout
  34.      * @ORM\ManyToOne(targetEntity="Orders_Suppliers_Transfers_Payout", inversedBy="order_supplier_transfers")
  35.      * @ORM\JoinColumn(name="order_supplier_transfers_payout_id", referencedColumnName="id", nullable=true)
  36.      */
  37.     private $orders_suppliers_transfers_payout;
  38.     /**
  39.      * @var Orders_Monthly
  40.      * @ORM\OneToOne(targetEntity="Orders_Monthly", inversedBy="order_supplier_transfer")
  41.      * @ORM\JoinColumn(name="order_monthly_id", referencedColumnName="id", nullable=true)
  42.      */
  43.     private $order_monthly;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity="Orders_Suppliers_Transfers_Status", mappedBy="order_supplier_transfer")
  46.      */
  47.     private $order_supplier_transfers_status;
  48.     /**
  49.      * @ORM\Column(type="decimal", precision=10, scale=2)
  50.      * @Assert\NotBlank()
  51.      */
  52.     private $transfer_amount;
  53.     /**
  54.      * @ORM\Column(type="decimal", precision=10, scale=2)
  55.      * @Assert\NotBlank()
  56.      */
  57.     private $total_amount;
  58.     /**
  59.      * @ORM\Column(type="decimal", precision=10, scale=2)
  60.      * @Assert\NotBlank()
  61.      */
  62.     private $commission_amount;
  63.     /**
  64.      * @ORM\Column(type="string", nullable=true)
  65.      * @Assert\NotBlank()
  66.      */
  67.     private $transfer_comment;
  68.     /**
  69.      * @ORM\Column(type="string", nullable=true)
  70.      * @Assert\NotBlank()
  71.      */
  72.     private $transfer_status;//BookingStatus Constants for Refund Status
  73.     /**
  74.      * @ORM\Column(type="string", nullable=true)
  75.      * @Assert\NotBlank()
  76.      */
  77.     private $transfer_stripe_id;
  78.     /**
  79.      * @var DateTime
  80.      * @ORM\Column(type="datetime", nullable=true)
  81.      * @Assert\NotBlank()
  82.      */
  83.     private $transfer_processed_date;
  84.     /**
  85.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  86.      * @Assert\NotBlank()
  87.      */
  88.     private $hold_transfer false;
  89.     /**
  90.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  91.      */
  92.     private $stripe_total_amount;
  93.     /**
  94.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  95.      */
  96.     private $stripe_fee_amount;
  97.     /**
  98.      * @var string
  99.      * @ORM\Column(type="string", nullable=true)
  100.      */
  101.     private $stripe_currency;
  102.     /**
  103.      * @var string
  104.      * @ORM\Column(type="string", nullable=true)
  105.      */
  106.     private $stripe_exchange_rate;
  107.     /**
  108.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  109.      */
  110.     private $stripe_net_amount;
  111.     /**
  112.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  113.      * @Assert\NotBlank()
  114.      */
  115.     private $total_amount_exchanged_rate;
  116.     /**
  117.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  118.      * @Assert\NotBlank()
  119.      */
  120.     private $commission_amount_exchanged_rate;
  121.     /**
  122.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  123.      * @Assert\NotBlank()
  124.      */
  125.     private $transfer_amount_exchanged_rate;
  126.     /**
  127.      * @ORM\Column(type="decimal", precision=10, scale=2)
  128.      */
  129.     private $service_fee 0;
  130.     /**
  131.      * @ORM\Column(type="decimal", precision=10, scale=2)
  132.      */
  133.     private $service_fee_exchanged_rate 0;
  134.     /**
  135.      * @ORM\Column(type="decimal", precision=10, scale=2)
  136.      */
  137.     private $commission_percentage 0;
  138.     /**
  139.      * @ORM\Column(type="decimal", precision=10, scale=2)
  140.      */
  141.     private $vat 0;
  142.     /**
  143.      * @ORM\Column(type="decimal", precision=10, scale=2)
  144.      */
  145.     private $vat_exchanged_rate 0;
  146.     /**
  147.      * @ORM\Column(type="decimal", precision=10, scale=2)
  148.      */
  149.     private $vat_percentage 7.70;
  150.     /**
  151.      * @var DateTime
  152.      * @ORM\Column(type="datetime", nullable=true)
  153.      */
  154.     private $transfer_available_for_payout_date;
  155.     /**
  156.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  157.      */
  158.     private $wp_stripe_final_amount_exchanged_rate 0;
  159.     /**
  160.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  161.      */
  162.     private $wp_stripe_final_amount_with_vat_exchanged_rate 0;
  163.     /**
  164.      * @return mixed
  165.      */
  166.     public function getId()
  167.     {
  168.         return $this->id;
  169.     }
  170.     /**
  171.      * @return Orders
  172.      */
  173.     public function getOrder()
  174.     {
  175.         return $this->order;
  176.     }
  177.     /**
  178.      * @param Orders $order
  179.      */
  180.     public function setOrder(Orders $order)
  181.     {
  182.         $this->order $order;
  183.     }
  184.     /**
  185.      * @return mixed
  186.      */
  187.     public function getTransferAmount()
  188.     {
  189.         return $this->transfer_amount;
  190.     }
  191.     /**
  192.      * @param mixed $transfer_amount
  193.      */
  194.     public function setTransferAmount($transfer_amount)
  195.     {
  196.         $this->transfer_amount $transfer_amount;
  197.     }
  198.     /**
  199.      * @return mixed
  200.      */
  201.     public function getTransferComment()
  202.     {
  203.         return $this->transfer_comment;
  204.     }
  205.     /**
  206.      * @param mixed $transfer_comment
  207.      */
  208.     public function setTransferComment($transfer_comment)
  209.     {
  210.         $this->transfer_comment $transfer_comment;
  211.     }
  212.     /**
  213.      * @return mixed
  214.      */
  215.     public function getTransferStatus()
  216.     {
  217.         return $this->transfer_status;
  218.     }
  219.     /**
  220.      * @param mixed $transfer_status
  221.      */
  222.     public function setTransferStatus($transfer_status)
  223.     {
  224.         $this->transfer_status $transfer_status;
  225.     }
  226.     /**
  227.      * @return mixed
  228.      */
  229.     public function getTransferStripeId()
  230.     {
  231.         return $this->transfer_stripe_id;
  232.     }
  233.     /**
  234.      * @param mixed $transfer_stripe_id
  235.      */
  236.     public function setTransferStripeId($transfer_stripe_id)
  237.     {
  238.         $this->transfer_stripe_id $transfer_stripe_id;
  239.     }
  240.     /**
  241.      * @return DateTime
  242.      */
  243.     public function getTransferProcessedDate()
  244.     {
  245.         return $this->transfer_processed_date;
  246.     }
  247.     /**
  248.      * @param DateTime $transfer_processed_date
  249.      */
  250.     public function setTransferProcessedDate(DateTime $transfer_processed_date)
  251.     {
  252.         $this->transfer_processed_date $transfer_processed_date;
  253.     }
  254.     /**
  255.      * @return mixed
  256.      */
  257.     public function getHoldTransfer()
  258.     {
  259.         return $this->hold_transfer;
  260.     }
  261.     /**
  262.      * @param mixed $hold_transfer
  263.      */
  264.     public function setHoldTransfer($hold_transfer)
  265.     {
  266.         $this->hold_transfer $hold_transfer;
  267.     }
  268.     /**
  269.      * @return Orders_Monthly
  270.      */
  271.     public function getOrderMonthly()
  272.     {
  273.         return $this->order_monthly;
  274.     }
  275.     /**
  276.      * @param Orders_Monthly $order_monthly
  277.      */
  278.     public function setOrderMonthly(Orders_Monthly $order_monthly)
  279.     {
  280.         $this->order_monthly $order_monthly;
  281.     }
  282.     /**
  283.      * @return ArrayCollection
  284.      */
  285.     public function getOrderSupplierTransfersStatus()
  286.     {
  287.         return $this->order_supplier_transfers_status;
  288.     }
  289.     /**
  290.      * @param mixed $order_supplier_transfers_status
  291.      */
  292.     public function setOrderSupplierTransfersStatus($order_supplier_transfers_status)
  293.     {
  294.         $this->order_supplier_transfers_status $order_supplier_transfers_status;
  295.     }
  296.     /**
  297.      * @return Orders_Suppliers_Transfers_Payout
  298.      */
  299.     public function getOrdersSuppliersTransfersPayout()
  300.     {
  301.         return $this->orders_suppliers_transfers_payout;
  302.     }
  303.     /**
  304.      * @param Orders_Suppliers_Transfers_Payout $orders_suppliers_transfers_payout
  305.      */
  306.     public function setOrdersSuppliersTransfersPayout(Orders_Suppliers_Transfers_Payout $orders_suppliers_transfers_payout)
  307.     {
  308.         $this->orders_suppliers_transfers_payout $orders_suppliers_transfers_payout;
  309.     }
  310.     /**
  311.      * @return mixed
  312.      */
  313.     public function getTotalAmount()
  314.     {
  315.         return $this->total_amount;
  316.     }
  317.     /**
  318.      * @param mixed $total_amount
  319.      */
  320.     public function setTotalAmount($total_amount)
  321.     {
  322.         $this->total_amount $total_amount;
  323.     }
  324.     /**
  325.      * @return mixed
  326.      */
  327.     public function getCommissionAmount()
  328.     {
  329.         return $this->commission_amount;
  330.     }
  331.     /**
  332.      * @param mixed $commission_amount
  333.      */
  334.     public function setCommissionAmount($commission_amount)
  335.     {
  336.         $this->commission_amount $commission_amount;
  337.     }
  338.     /**
  339.      * @return mixed
  340.      */
  341.     public function getStripeTotalAmount()
  342.     {
  343.         return $this->stripe_total_amount;
  344.     }
  345.     /**
  346.      * @param mixed $stripe_total_amount
  347.      */
  348.     public function setStripeTotalAmount($stripe_total_amount)
  349.     {
  350.         $this->stripe_total_amount $stripe_total_amount;
  351.     }
  352.     /**
  353.      * @return mixed
  354.      */
  355.     public function getStripeFeeAmount()
  356.     {
  357.         return $this->stripe_fee_amount;
  358.     }
  359.     /**
  360.      * @param mixed $stripe_fee_amount
  361.      */
  362.     public function setStripeFeeAmount($stripe_fee_amount)
  363.     {
  364.         $this->stripe_fee_amount $stripe_fee_amount;
  365.     }
  366.     /**
  367.      * @return string
  368.      */
  369.     public function getStripeCurrency()
  370.     {
  371.         return $this->stripe_currency;
  372.     }
  373.     /**
  374.      * @param string $stripe_currency
  375.      */
  376.     public function setStripeCurrency($stripe_currency)
  377.     {
  378.         $this->stripe_currency $stripe_currency;
  379.     }
  380.     /**
  381.      * @return string
  382.      */
  383.     public function getStripeExchangeRate()
  384.     {
  385.         return $this->stripe_exchange_rate;
  386.     }
  387.     /**
  388.      * @param string $stripe_exchange_rate
  389.      */
  390.     public function setStripeExchangeRate($stripe_exchange_rate)
  391.     {
  392.         $this->stripe_exchange_rate $stripe_exchange_rate;
  393.     }
  394.     /**
  395.      * @return mixed
  396.      */
  397.     public function getStripeNetAmount()
  398.     {
  399.         return $this->stripe_net_amount;
  400.     }
  401.     /**
  402.      * @param mixed $stripe_net_amount
  403.      */
  404.     public function setStripeNetAmount($stripe_net_amount)
  405.     {
  406.         $this->stripe_net_amount $stripe_net_amount;
  407.     }
  408.     /**
  409.      * @return mixed
  410.      */
  411.     public function getTotalAmountExchangedRate()
  412.     {
  413.         return $this->total_amount_exchanged_rate;
  414.     }
  415.     /**
  416.      * @param mixed $total_amount_exchanged_rate
  417.      */
  418.     public function setTotalAmountExchangedRate($total_amount_exchanged_rate)
  419.     {
  420.         $this->total_amount_exchanged_rate $total_amount_exchanged_rate;
  421.     }
  422.     /**
  423.      * @return mixed
  424.      */
  425.     public function getCommissionAmountExchangedRate()
  426.     {
  427.         return $this->commission_amount_exchanged_rate;
  428.     }
  429.     /**
  430.      * @param mixed $commission_amount_exchanged_rate
  431.      */
  432.     public function setCommissionAmountExchangedRate($commission_amount_exchanged_rate)
  433.     {
  434.         $this->commission_amount_exchanged_rate $commission_amount_exchanged_rate;
  435.     }
  436.     /**
  437.      * @return mixed
  438.      */
  439.     public function getTransferAmountExchangedRate()
  440.     {
  441.         return $this->transfer_amount_exchanged_rate;
  442.     }
  443.     /**
  444.      * @param mixed $transfer_amount_exchanged_rate
  445.      */
  446.     public function setTransferAmountExchangedRate($transfer_amount_exchanged_rate)
  447.     {
  448.         $this->transfer_amount_exchanged_rate $transfer_amount_exchanged_rate;
  449.     }
  450.     /**
  451.      * @return mixed
  452.      */
  453.     public function getServiceFee()
  454.     {
  455.         return $this->service_fee;
  456.     }
  457.     /**
  458.      * @param mixed $service_fee
  459.      */
  460.     public function setServiceFee($service_fee)
  461.     {
  462.         $this->service_fee $service_fee;
  463.     }
  464.     /**
  465.      * @return mixed
  466.      */
  467.     public function getServiceFeeExchangedRate()
  468.     {
  469.         return $this->service_fee_exchanged_rate;
  470.     }
  471.     /**
  472.      * @param mixed $service_fee_exchanged_rate
  473.      */
  474.     public function setServiceFeeExchangedRate($service_fee_exchanged_rate)
  475.     {
  476.         $this->service_fee_exchanged_rate $service_fee_exchanged_rate;
  477.     }
  478.     /**
  479.      * @return mixed
  480.      */
  481.     public function getCommissionPercentage()
  482.     {
  483.         return $this->commission_percentage;
  484.     }
  485.     /**
  486.      * @param mixed $commission_percentage
  487.      */
  488.     public function setCommissionPercentage($commission_percentage)
  489.     {
  490.         $this->commission_percentage $commission_percentage;
  491.     }
  492.     /**
  493.      * @return mixed
  494.      */
  495.     public function getVat()
  496.     {
  497.         return $this->vat;
  498.     }
  499.     /**
  500.      * @param mixed $vat
  501.      */
  502.     public function setVat($vat)
  503.     {
  504.         $this->vat $vat;
  505.     }
  506.     /**
  507.      * @return mixed
  508.      */
  509.     public function getVatExchangedRate()
  510.     {
  511.         return $this->vat_exchanged_rate;
  512.     }
  513.     /**
  514.      * @param mixed $vat_exchanged_rate
  515.      */
  516.     public function setVatExchangedRate($vat_exchanged_rate)
  517.     {
  518.         $this->vat_exchanged_rate $vat_exchanged_rate;
  519.     }
  520.     /**
  521.      * @return mixed
  522.      */
  523.     public function getVatPercentage()
  524.     {
  525.         return $this->vat_percentage;
  526.     }
  527.     /**
  528.      * @param mixed $vat_percentage
  529.      */
  530.     public function setVatPercentage($vat_percentage)
  531.     {
  532.         $this->vat_percentage $vat_percentage;
  533.     }
  534.     /**
  535.      * @return DateTime
  536.      */
  537.     public function getTransferAvailableForPayoutDate()
  538.     {
  539.         return $this->transfer_available_for_payout_date;
  540.     }
  541.     /**
  542.      * @param DateTime $transfer_available_for_payout_date
  543.      */
  544.     public function setTransferAvailableForPayoutDate($transfer_available_for_payout_date)
  545.     {
  546.         $this->transfer_available_for_payout_date $transfer_available_for_payout_date;
  547.     }
  548.     /**
  549.      * @return mixed
  550.      */
  551.     public function getWpStripeFinalAmountExchangedRate()
  552.     {
  553.         return $this->wp_stripe_final_amount_exchanged_rate;
  554.     }
  555.     /**
  556.      * @param mixed $wp_stripe_final_amount_exchanged_rate
  557.      */
  558.     public function setWpStripeFinalAmountExchangedRate($wp_stripe_final_amount_exchanged_rate)
  559.     {
  560.         $this->wp_stripe_final_amount_exchanged_rate $wp_stripe_final_amount_exchanged_rate;
  561.     }
  562.     /**
  563.      * @return mixed
  564.      */
  565.     public function getWpStripeFinalAmountWithVatExchangedRate()
  566.     {
  567.         return $this->wp_stripe_final_amount_with_vat_exchanged_rate;
  568.     }
  569.     /**
  570.      * @param mixed $wp_stripe_final_amount_with_vat_exchanged_rate
  571.      */
  572.     public function setWpStripeFinalAmountWithVatExchangedRate($wp_stripe_final_amount_with_vat_exchanged_rate)
  573.     {
  574.         $this->wp_stripe_final_amount_with_vat_exchanged_rate $wp_stripe_final_amount_with_vat_exchanged_rate;
  575.     }
  576.     public function jsonSerialize()
  577.     {
  578.         return array(
  579.             'id' => $this->id,
  580.             'order_id' => $this->order->getId(),
  581.             'order_monthly_id' => $this->getOrderMonthly() != NULL $this->getOrderMonthly()->getId() : NULL,
  582.             'transfer_amount' => $this->transfer_amount,
  583.             'booking_type' => $this->getOrder()->getBookingType(),
  584.             'total_amount' => $this->total_amount,
  585.             'commission_amount' => $this->commission_amount,
  586.             'transfer_comment' => $this->transfer_comment,
  587.             'transfer_status' => $this->transfer_status,
  588.             'transfer_stripe_id' => $this->transfer_stripe_id,
  589.             'hold_transfer' => $this->hold_transfer,
  590.             'stripe_net_amount' => $this->stripe_net_amount,
  591.             'stripe_total_amount' => $this->stripe_total_amount,
  592.             'stripe_fee_amount' => $this->stripe_fee_amount,
  593.             'stripe_exchange_rate' => $this->stripe_exchange_rate,
  594.             'stripe_currency' => $this->stripe_currency,
  595.             'commission_amount_exchanged_rate' => $this->commission_amount_exchanged_rate,
  596.             'total_amount_exchanged_rate' => $this->total_amount_exchanged_rate,
  597.             'transfer_amount_exchanged_rate' => $this->transfer_amount_exchanged_rate,
  598.             'service_fee' => $this->service_fee,
  599.             'service_fee_exchanged_rate' => $this->service_fee_exchanged_rate,
  600.             'commission_percentage' => $this->commission_percentage,
  601.             'wp_stripe_final_amount_exchanged_rate' => $this->wp_stripe_final_amount_exchanged_rate,
  602.             'wp_stripe_final_amount_with_vat_exchanged_rate' => $this->wp_stripe_final_amount_with_vat_exchanged_rate,
  603.             'vat' => $this->vat,
  604.             'vat_exchanged_rate' => $this->vat_exchanged_rate,
  605.             'vat_percentage' => $this->vat_percentage,
  606.             'transfer_processed_date' => $this->transfer_processed_date->format('Y-m-d H:i:s'),
  607.             'created' => $this->createdAt->format('Y-m-d H:i:s'),
  608.             'updated' => $this->updatedAt->format('Y-m-d H:i:s'),
  609.             'order_supplier_transfers_status' => $this->getOrderSupplierTransfersStatus(),
  610.             'transfer_available_for_payout_date' => $this->transfer_available_for_payout_date != NULL $this->transfer_available_for_payout_date->format('Y-m-d H:i:s') : '',
  611.         );
  612.     }
  613.     /**
  614.      * @var DateTime $created
  615.      *
  616.      * @ORM\Column(type="datetime", nullable=false)
  617.      */
  618.     protected $createdAt;
  619.     /**
  620.      * @var DateTime $updated
  621.      *
  622.      * @ORM\Column(type="datetime", nullable=false)
  623.      */
  624.     protected $updatedAt;
  625.     /**
  626.      * @return DateTime
  627.      */
  628.     public function getCreatedAt()
  629.     {
  630.         return $this->createdAt;
  631.     }
  632.     /**
  633.      * @return DateTime
  634.      */
  635.     public function getUpdatedAt()
  636.     {
  637.         return $this->updatedAt;
  638.     }
  639.     public function setUpdatedAt($updatedAt)
  640.     {
  641.         $this->updatedAt $updatedAt;
  642.         return $this;
  643.     }
  644.     /**
  645.      * @ORM\PrePersist
  646.      */
  647.     public function setCreatedAt()
  648.     {
  649.         $this->createdAt = new DateTime();
  650.         $this->updatedAt = new DateTime();
  651.         return $this;
  652.     }
  653.     /**
  654.      * @ORM\PreUpdate
  655.      */
  656.     public function setUpdatedAtValue() {
  657.         $this->updatedAt = new DateTime();
  658.     }
  659.     public function __construct() {
  660.     }
  661. }