122 \
Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
124 \
Magento\Sales\Model\OrderFactory $orderFactory,
143 $this->_orderFactory = $orderFactory;
168 $item->setHasChildren(
true);
169 $item->addChildItem($this);
236 return max(round($qty, 8), 0);
251 return max(round($qty, 8), 0);
276 return max($qtyToCancel, 0);
299 if ($this->_order ===
null && ($orderId = $this->
getOrderId())) {
300 $order = $this->_orderFactory->create();
317 if (!$backordered && $this->getHasChildren()) {
326 $actuallyOrdered = $ordered - $canceled - $refunded;
328 if (!$invoiced && !$shipped && !$refunded && !$canceled && !$backordered) {
331 if ($shipped && $invoiced && $actuallyOrdered == $shipped) {
335 if ($invoiced && !$shipped && $actuallyOrdered == $invoiced) {
339 if ($backordered && $actuallyOrdered == $backordered) {
343 if ($refunded && $ordered == $refunded) {
347 if ($canceled && $ordered == $canceled) {
351 if (max($shipped, $invoiced) < $actuallyOrdered) {
366 foreach ($this->_children as $childItem) {
367 $backordered += (double)$childItem->getQtyBackordered();
391 if (self::$_statuses ===
null) {
394 if (isset(self::$_statuses[$statusId])) {
395 return self::$_statuses[$statusId];
397 return __(
'Unknown Status');
407 if ($this->
getStatusId() !== self::STATUS_CANCELED) {
408 $this->_eventManager->dispatch(
'sales_order_item_cancel', [
'item' => $this]);
428 if (self::$_statuses ===
null) {
430 self::STATUS_PENDING =>
__(
'Ordered'),
431 self::STATUS_SHIPPED =>
__(
'Shipped'),
432 self::STATUS_INVOICED =>
__(
'Invoiced'),
433 self::STATUS_BACKORDERED =>
__(
'Backordered'),
434 self::STATUS_RETURNED =>
__(
'Returned'),
435 self::STATUS_REFUNDED =>
__(
'Refunded'),
436 self::STATUS_CANCELED =>
__(
'Canceled'),
437 self::STATUS_PARTIAL =>
__(
'Partial'),
438 self::STATUS_MIXED =>
__(
'Mixed'),
478 if (is_string(
$data)) {
479 $data = $this->serializer->unserialize(
$data);
495 if (
$code ===
null) {
527 $this->_children[] =
$item;
529 $this->_children = array_merge($this->_children,
$item);
552 $options = $parentItem->getProductOptions();
559 ) &&
$options[
'product_calculations'] == \
Magento\Catalog\Model\Product\Type\AbstractType::CALCULATE_CHILD
580 return $product->getTypeInstance()->getForceApplyDiscountToParentItem();
592 $options = $parentItem->getProductOptions();
599 ) &&
$options[
'shipment_type'] == \
Magento\Catalog\Model\Product\Type\AbstractType::SHIPMENT_SEPARATELY
678 if (!$this->
hasData(
'product')) {
686 return $this->
getData(
'product');
698 return $this->_storeManager->getStore(
$storeId);
700 return $this->_storeManager->getStore();
2086 $baseDiscountTaxCompensationInvoiced
2105 $baseDiscountTaxCompensationRefunded
2362 return $this->
getData(self::KEY_PRODUCT_OPTION);
setLockedDoInvoice($flag)
getProductOptionByCode($code=null)
getBaseDiscountTaxCompensationInvoiced()
setDiscountInvoiced($discountInvoiced)
const DISCOUNT_TAX_COMPENSATION_INVOICED
setBaseDiscountAmount($amount)
setGwBasePriceInvoiced($gwBasePriceInvoiced)
setQtyReturned($qtyReturned)
getWeeeTaxAppliedRowAmount()
setWeeeTaxApplied($weeeTaxApplied)
setExtensionAttributes(\Magento\Sales\Api\Data\OrderItemExtensionInterface $extensionAttributes)
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[], \Magento\Framework\Serialize\Serializer\Json $serializer=null)
setGwBaseTaxAmountRefunded($gwBaseTaxAmountRefunded)
_getExtensionAttributes()
setDiscountTaxCompensationCanceled($discountTaxCompensationCanceled)
elseif(isset( $params[ 'redirect_parent']))
setWeeeTaxAppliedRowAmount($amount)
const DISCOUNT_TAX_COMPENSATION_CANCELED
const GW_TAX_AMOUNT_REFUNDED
setAmountRefunded($amountRefunded)
setBaseTaxRefunded($baseTaxRefunded)
setGwTaxAmountRefunded($gwTaxAmountRefunded)
setWeeeTaxDisposition($weeeTaxDisposition)
_getQtyChildrenBackordered()
setQtyRefunded($qtyRefunded)
const BASE_WEEE_TAX_DISPOSITION
getBaseWeeeTaxDisposition()
const BASE_WEEE_TAX_ROW_DISPOSITION
setDiscountTaxCompensationAmount($amount)
setDiscountRefunded($discountRefunded)
setBaseDiscountTaxCompensationInvoiced($baseDiscountTaxCompensationInvoiced)
getBaseDiscountInvoiced()
const BASE_ROW_TOTAL_INCL_TAX
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
setDescription($description)
getBaseDiscountTaxCompensationRefunded()
const GW_BASE_TAX_AMOUNT_REFUNDED
const DISCOUNT_TAX_COMPENSATION_REFUNDED
getDiscountTaxCompensationRefunded()
setDiscountAmount($amount)
const WEEE_TAX_APPLIED_AMOUNT
getBaseTaxBeforeDiscount()
const BASE_ORIGINAL_PRICE
const GW_BASE_PRICE_INVOICED
setIsQtyDecimal($isQtyDecimal)
setTaxBeforeDiscount($taxBeforeDiscount)
getBaseDiscountRefunded()
setProductOption(\Magento\Catalog\Api\Data\ProductOptionInterface $productOption)
setGwBaseTaxAmount($amount)
setBaseWeeeTaxRowDisposition($baseWeeeTaxRowDisposition)
setBaseTaxBeforeDiscount($baseTaxBeforeDiscount)
setBaseWeeeTaxDisposition($baseWeeeTaxDisposition)
getBaseWeeeTaxAppliedRowAmnt()
setDiscountPercent($discountPercent)
setBaseRowTotalInclTax($amount)
const BASE_DISCOUNT_TAX_COMPENSATION_INVOICED
getForceApplyDiscountToParentItem()
getDiscountTaxCompensationAmount()
setGwTaxAmountInvoiced($gwTaxAmountInvoiced)
setAppliedRuleIds($appliedRuleIds)
static getStatusName($statusId)
getGwBaseTaxAmountInvoiced()
const GW_BASE_PRICE_REFUNDED
setQtyCanceled($qtyCanceled)
setRowInvoiced($rowInvoiced)
getGwBaseTaxAmountRefunded()
setAdditionalData($additionalData)
const GW_BASE_TAX_AMOUNT_INVOICED
setBaseDiscountTaxCompensationRefunded($baseDiscountTaxCompensationRefunded)
setNoDiscount($noDiscount)
setBaseDiscountInvoiced($baseDiscountInvoiced)
setProductType($productType)
setGwPriceInvoiced($gwPriceInvoiced)
setBaseTaxInvoiced($baseTaxInvoiced)
const GW_TAX_AMOUNT_INVOICED
getBaseWeeeTaxRowDisposition()
const BASE_AMOUNT_REFUNDED
setBaseOriginalPrice($price)
setBaseRowInvoiced($baseRowInvoiced)
setDiscountTaxCompensationRefunded($discountTaxCompensationRefunded)
setOrder(\Magento\Sales\Model\Order $order)
setTaxInvoiced($taxInvoiced)
setRowTotalInclTax($amount)
setBaseDiscountRefunded($baseDiscountRefunded)
getWeeeTaxAppliedAmount()
setGwPriceRefunded($gwPriceRefunded)
const BASE_DISCOUNT_INVOICED
setDiscountTaxCompensationInvoiced($discountTaxCompensationInvoiced)
setQtyBackordered($qtyBackordered)
foreach($product->getExtensionAttributes() ->getBundleProductOptions() as $option) $buyRequest
setFreeShipping($freeShipping)
setBaseDiscountTaxCompensationAmount($amount)
const WEEE_TAX_DISPOSITION
getDiscountTaxCompensationInvoiced()
setProductOptions(array $options=null)
getDiscountTaxCompensationCanceled()
setWeeeTaxRowDisposition($weeeTaxRowDisposition)
const BASE_DISCOUNT_TAX_COMPENSATION_REFUNDED
const BASE_PRICE_INCL_TAX
const DISCOUNT_TAX_COMPENSATION_AMOUNT
getData($key='', $index=null)
getWeeeTaxRowDisposition()
setGwBasePriceRefunded($gwBasePriceRefunded)
const WEEE_TAX_ROW_DISPOSITION
const WEEE_TAX_APPLIED_ROW_AMOUNT
setWeeeTaxAppliedAmount($amount)
setGwBaseTaxAmountInvoiced($gwBaseTaxAmountInvoiced)
const BASE_DISCOUNT_TAX_COMPENSATION_AMOUNT
const BASE_DISCOUNT_AMOUNT
setData($key, $value=null)
setQtyInvoiced($qtyInvoiced)
setTaxPercent($taxPercent)
const BASE_DISCOUNT_REFUNDED
setBaseTaxAmount($amount)
const BASE_WEEE_TAX_APPLIED_ROW_AMNT
const BASE_TAX_BEFORE_DISCOUNT
setBaseAmountRefunded($baseAmountRefunded)
setTaxCanceled($taxCanceled)
getBaseWeeeTaxAppliedAmount()
setQtyOrdered($qtyOrdered)
getBaseDiscountTaxCompensationAmount()
setBasePriceInclTax($amount)
foreach($order->getItems() as $orderItem) $shipment
setQtyShipped($qtyShipped)
setTaxRefunded($taxRefunded)
const TAX_BEFORE_DISCOUNT
setBaseWeeeTaxAppliedRowAmnt($amnt)
const BASE_WEEE_TAX_APPLIED_AMOUNT
setBaseWeeeTaxAppliedAmount($amount)
if(!isset($_GET['name'])) $name