<?php
namespace App\AppBundle\MainBundle\Entity;
use App\AppBundle\MainBundle\Entity\Orders;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use JsonSerializable;
use PetstoreIO\Order;
use Symfony\Component\Validator\Constraints as Assert;
/**
* AddOns
*
* @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\Orders_Suppliers_TransferRepository")
* @ORM\Table(name="orders_suppliers_transfer")
* @ORM\HasLifecycleCallbacks()
*/
class Orders_Suppliers_Transfer implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var Orders
* @ORM\ManyToOne(targetEntity="Orders", inversedBy="order_supplier_transfer")
* @ORM\JoinColumn(name="order_id", referencedColumnName="id", nullable=true)
*/
private $order;
/**
* @var Orders_Suppliers_Transfers_Payout
* @ORM\ManyToOne(targetEntity="Orders_Suppliers_Transfers_Payout", inversedBy="order_supplier_transfers")
* @ORM\JoinColumn(name="order_supplier_transfers_payout_id", referencedColumnName="id", nullable=true)
*/
private $orders_suppliers_transfers_payout;
/**
* @var Orders_Monthly
* @ORM\OneToOne(targetEntity="Orders_Monthly", inversedBy="order_supplier_transfer")
* @ORM\JoinColumn(name="order_monthly_id", referencedColumnName="id", nullable=true)
*/
private $order_monthly;
/**
* @ORM\OneToMany(targetEntity="Orders_Suppliers_Transfers_Status", mappedBy="order_supplier_transfer")
*/
private $order_supplier_transfers_status;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $transfer_amount;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $total_amount;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $commission_amount;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $transfer_comment;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $transfer_status;//BookingStatus Constants for Refund Status
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $transfer_stripe_id;
/**
* @var DateTime
* @ORM\Column(type="datetime", nullable=true)
* @Assert\NotBlank()
*/
private $transfer_processed_date;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
* @Assert\NotBlank()
*/
private $hold_transfer = false;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $stripe_total_amount;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $stripe_fee_amount;
/**
* @var string
* @ORM\Column(type="string", nullable=true)
*/
private $stripe_currency;
/**
* @var string
* @ORM\Column(type="string", nullable=true)
*/
private $stripe_exchange_rate;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $stripe_net_amount;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
* @Assert\NotBlank()
*/
private $total_amount_exchanged_rate;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
* @Assert\NotBlank()
*/
private $commission_amount_exchanged_rate;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
* @Assert\NotBlank()
*/
private $transfer_amount_exchanged_rate;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $service_fee = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $service_fee_exchanged_rate = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $commission_percentage = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $vat = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $vat_exchanged_rate = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
*/
private $vat_percentage = 7.70;
/**
* @var DateTime
* @ORM\Column(type="datetime", nullable=true)
*/
private $transfer_available_for_payout_date;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $wp_stripe_final_amount_exchanged_rate = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $wp_stripe_final_amount_with_vat_exchanged_rate = 0;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return Orders
*/
public function getOrder()
{
return $this->order;
}
/**
* @param Orders $order
*/
public function setOrder(Orders $order)
{
$this->order = $order;
}
/**
* @return mixed
*/
public function getTransferAmount()
{
return $this->transfer_amount;
}
/**
* @param mixed $transfer_amount
*/
public function setTransferAmount($transfer_amount)
{
$this->transfer_amount = $transfer_amount;
}
/**
* @return mixed
*/
public function getTransferComment()
{
return $this->transfer_comment;
}
/**
* @param mixed $transfer_comment
*/
public function setTransferComment($transfer_comment)
{
$this->transfer_comment = $transfer_comment;
}
/**
* @return mixed
*/
public function getTransferStatus()
{
return $this->transfer_status;
}
/**
* @param mixed $transfer_status
*/
public function setTransferStatus($transfer_status)
{
$this->transfer_status = $transfer_status;
}
/**
* @return mixed
*/
public function getTransferStripeId()
{
return $this->transfer_stripe_id;
}
/**
* @param mixed $transfer_stripe_id
*/
public function setTransferStripeId($transfer_stripe_id)
{
$this->transfer_stripe_id = $transfer_stripe_id;
}
/**
* @return DateTime
*/
public function getTransferProcessedDate()
{
return $this->transfer_processed_date;
}
/**
* @param DateTime $transfer_processed_date
*/
public function setTransferProcessedDate(DateTime $transfer_processed_date)
{
$this->transfer_processed_date = $transfer_processed_date;
}
/**
* @return mixed
*/
public function getHoldTransfer()
{
return $this->hold_transfer;
}
/**
* @param mixed $hold_transfer
*/
public function setHoldTransfer($hold_transfer)
{
$this->hold_transfer = $hold_transfer;
}
/**
* @return Orders_Monthly
*/
public function getOrderMonthly()
{
return $this->order_monthly;
}
/**
* @param Orders_Monthly $order_monthly
*/
public function setOrderMonthly(Orders_Monthly $order_monthly)
{
$this->order_monthly = $order_monthly;
}
/**
* @return ArrayCollection
*/
public function getOrderSupplierTransfersStatus()
{
return $this->order_supplier_transfers_status;
}
/**
* @param mixed $order_supplier_transfers_status
*/
public function setOrderSupplierTransfersStatus($order_supplier_transfers_status)
{
$this->order_supplier_transfers_status = $order_supplier_transfers_status;
}
/**
* @return Orders_Suppliers_Transfers_Payout
*/
public function getOrdersSuppliersTransfersPayout()
{
return $this->orders_suppliers_transfers_payout;
}
/**
* @param Orders_Suppliers_Transfers_Payout $orders_suppliers_transfers_payout
*/
public function setOrdersSuppliersTransfersPayout(Orders_Suppliers_Transfers_Payout $orders_suppliers_transfers_payout)
{
$this->orders_suppliers_transfers_payout = $orders_suppliers_transfers_payout;
}
/**
* @return mixed
*/
public function getTotalAmount()
{
return $this->total_amount;
}
/**
* @param mixed $total_amount
*/
public function setTotalAmount($total_amount)
{
$this->total_amount = $total_amount;
}
/**
* @return mixed
*/
public function getCommissionAmount()
{
return $this->commission_amount;
}
/**
* @param mixed $commission_amount
*/
public function setCommissionAmount($commission_amount)
{
$this->commission_amount = $commission_amount;
}
/**
* @return mixed
*/
public function getStripeTotalAmount()
{
return $this->stripe_total_amount;
}
/**
* @param mixed $stripe_total_amount
*/
public function setStripeTotalAmount($stripe_total_amount)
{
$this->stripe_total_amount = $stripe_total_amount;
}
/**
* @return mixed
*/
public function getStripeFeeAmount()
{
return $this->stripe_fee_amount;
}
/**
* @param mixed $stripe_fee_amount
*/
public function setStripeFeeAmount($stripe_fee_amount)
{
$this->stripe_fee_amount = $stripe_fee_amount;
}
/**
* @return string
*/
public function getStripeCurrency()
{
return $this->stripe_currency;
}
/**
* @param string $stripe_currency
*/
public function setStripeCurrency($stripe_currency)
{
$this->stripe_currency = $stripe_currency;
}
/**
* @return string
*/
public function getStripeExchangeRate()
{
return $this->stripe_exchange_rate;
}
/**
* @param string $stripe_exchange_rate
*/
public function setStripeExchangeRate($stripe_exchange_rate)
{
$this->stripe_exchange_rate = $stripe_exchange_rate;
}
/**
* @return mixed
*/
public function getStripeNetAmount()
{
return $this->stripe_net_amount;
}
/**
* @param mixed $stripe_net_amount
*/
public function setStripeNetAmount($stripe_net_amount)
{
$this->stripe_net_amount = $stripe_net_amount;
}
/**
* @return mixed
*/
public function getTotalAmountExchangedRate()
{
return $this->total_amount_exchanged_rate;
}
/**
* @param mixed $total_amount_exchanged_rate
*/
public function setTotalAmountExchangedRate($total_amount_exchanged_rate)
{
$this->total_amount_exchanged_rate = $total_amount_exchanged_rate;
}
/**
* @return mixed
*/
public function getCommissionAmountExchangedRate()
{
return $this->commission_amount_exchanged_rate;
}
/**
* @param mixed $commission_amount_exchanged_rate
*/
public function setCommissionAmountExchangedRate($commission_amount_exchanged_rate)
{
$this->commission_amount_exchanged_rate = $commission_amount_exchanged_rate;
}
/**
* @return mixed
*/
public function getTransferAmountExchangedRate()
{
return $this->transfer_amount_exchanged_rate;
}
/**
* @param mixed $transfer_amount_exchanged_rate
*/
public function setTransferAmountExchangedRate($transfer_amount_exchanged_rate)
{
$this->transfer_amount_exchanged_rate = $transfer_amount_exchanged_rate;
}
/**
* @return mixed
*/
public function getServiceFee()
{
return $this->service_fee;
}
/**
* @param mixed $service_fee
*/
public function setServiceFee($service_fee)
{
$this->service_fee = $service_fee;
}
/**
* @return mixed
*/
public function getServiceFeeExchangedRate()
{
return $this->service_fee_exchanged_rate;
}
/**
* @param mixed $service_fee_exchanged_rate
*/
public function setServiceFeeExchangedRate($service_fee_exchanged_rate)
{
$this->service_fee_exchanged_rate = $service_fee_exchanged_rate;
}
/**
* @return mixed
*/
public function getCommissionPercentage()
{
return $this->commission_percentage;
}
/**
* @param mixed $commission_percentage
*/
public function setCommissionPercentage($commission_percentage)
{
$this->commission_percentage = $commission_percentage;
}
/**
* @return mixed
*/
public function getVat()
{
return $this->vat;
}
/**
* @param mixed $vat
*/
public function setVat($vat)
{
$this->vat = $vat;
}
/**
* @return mixed
*/
public function getVatExchangedRate()
{
return $this->vat_exchanged_rate;
}
/**
* @param mixed $vat_exchanged_rate
*/
public function setVatExchangedRate($vat_exchanged_rate)
{
$this->vat_exchanged_rate = $vat_exchanged_rate;
}
/**
* @return mixed
*/
public function getVatPercentage()
{
return $this->vat_percentage;
}
/**
* @param mixed $vat_percentage
*/
public function setVatPercentage($vat_percentage)
{
$this->vat_percentage = $vat_percentage;
}
/**
* @return DateTime
*/
public function getTransferAvailableForPayoutDate()
{
return $this->transfer_available_for_payout_date;
}
/**
* @param DateTime $transfer_available_for_payout_date
*/
public function setTransferAvailableForPayoutDate($transfer_available_for_payout_date)
{
$this->transfer_available_for_payout_date = $transfer_available_for_payout_date;
}
/**
* @return mixed
*/
public function getWpStripeFinalAmountExchangedRate()
{
return $this->wp_stripe_final_amount_exchanged_rate;
}
/**
* @param mixed $wp_stripe_final_amount_exchanged_rate
*/
public function setWpStripeFinalAmountExchangedRate($wp_stripe_final_amount_exchanged_rate)
{
$this->wp_stripe_final_amount_exchanged_rate = $wp_stripe_final_amount_exchanged_rate;
}
/**
* @return mixed
*/
public function getWpStripeFinalAmountWithVatExchangedRate()
{
return $this->wp_stripe_final_amount_with_vat_exchanged_rate;
}
/**
* @param mixed $wp_stripe_final_amount_with_vat_exchanged_rate
*/
public function setWpStripeFinalAmountWithVatExchangedRate($wp_stripe_final_amount_with_vat_exchanged_rate)
{
$this->wp_stripe_final_amount_with_vat_exchanged_rate = $wp_stripe_final_amount_with_vat_exchanged_rate;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'order_id' => $this->order->getId(),
'order_monthly_id' => $this->getOrderMonthly() != NULL ? $this->getOrderMonthly()->getId() : NULL,
'transfer_amount' => $this->transfer_amount,
'booking_type' => $this->getOrder()->getBookingType(),
'total_amount' => $this->total_amount,
'commission_amount' => $this->commission_amount,
'transfer_comment' => $this->transfer_comment,
'transfer_status' => $this->transfer_status,
'transfer_stripe_id' => $this->transfer_stripe_id,
'hold_transfer' => $this->hold_transfer,
'stripe_net_amount' => $this->stripe_net_amount,
'stripe_total_amount' => $this->stripe_total_amount,
'stripe_fee_amount' => $this->stripe_fee_amount,
'stripe_exchange_rate' => $this->stripe_exchange_rate,
'stripe_currency' => $this->stripe_currency,
'commission_amount_exchanged_rate' => $this->commission_amount_exchanged_rate,
'total_amount_exchanged_rate' => $this->total_amount_exchanged_rate,
'transfer_amount_exchanged_rate' => $this->transfer_amount_exchanged_rate,
'service_fee' => $this->service_fee,
'service_fee_exchanged_rate' => $this->service_fee_exchanged_rate,
'commission_percentage' => $this->commission_percentage,
'wp_stripe_final_amount_exchanged_rate' => $this->wp_stripe_final_amount_exchanged_rate,
'wp_stripe_final_amount_with_vat_exchanged_rate' => $this->wp_stripe_final_amount_with_vat_exchanged_rate,
'vat' => $this->vat,
'vat_exchanged_rate' => $this->vat_exchanged_rate,
'vat_percentage' => $this->vat_percentage,
'transfer_processed_date' => $this->transfer_processed_date->format('Y-m-d H:i:s'),
'created' => $this->createdAt->format('Y-m-d H:i:s'),
'updated' => $this->updatedAt->format('Y-m-d H:i:s'),
'order_supplier_transfers_status' => $this->getOrderSupplierTransfersStatus(),
'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') : '',
);
}
/**
* @var DateTime $created
*
* @ORM\Column(type="datetime", nullable=false)
*/
protected $createdAt;
/**
* @var DateTime $updated
*
* @ORM\Column(type="datetime", nullable=false)
*/
protected $updatedAt;
/**
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAt()
{
$this->createdAt = new DateTime();
$this->updatedAt = new DateTime();
return $this;
}
/**
* @ORM\PreUpdate
*/
public function setUpdatedAtValue() {
$this->updatedAt = new DateTime();
}
public function __construct() {
}
}