当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Sales_Model_Order_Creditmemo::getId方法代码示例

本文整理汇总了PHP中Mage_Sales_Model_Order_Creditmemo::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Creditmemo::getId方法的具体用法?PHP Mage_Sales_Model_Order_Creditmemo::getId怎么用?PHP Mage_Sales_Model_Order_Creditmemo::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Sales_Model_Order_Creditmemo的用法示例。


在下文中一共展示了Mage_Sales_Model_Order_Creditmemo::getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setEntity

 /**
  * Set entity
  *
  * @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
  * @return $this
  */
 public function setEntity($object)
 {
     $this->setEntityId($object->getId());
     $this->setEntityIncrementId($object->getIncrementId());
     $this->setStoreId($object->getStoreId());
     return $this;
 }
开发者ID:onepica,项目名称:avatax,代码行数:13,代码来源:Queue.php

示例2: isProcessedRefund

 /**
  * Check is processed refund
  * 
  * @param \Mage_Sales_Model_Order_Creditmemo $creditmemo
  * @param string $itemId
  * @return boolean
  */
 public function isProcessedRefund($creditmemo, $itemId)
 {
     $whRefund = Mage::getModel('inventoryplus/warehouse_refund')->loadByCreditmemoId($creditmemo->getId())->addFieldToFilter('item_id', $itemId)->getFirstItem();
     if ($whRefund->getId()) {
         return true;
     }
     return false;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:15,代码来源:Refund.php

示例3: _attachTotals

 protected function _attachTotals(Mage_Sales_Model_Order_Creditmemo $creditMemo, $mode)
 {
     $total = $creditMemo->getGrandTotal();
     $baseTotal = $creditMemo->getBaseGrandTotal();
     $order = $creditMemo->getOrder();
     $order->setForcedCanCreditmemo(false);
     if ($mode == AW_Giftcard_Model_Source_Giftcard_Config_Refund::ALLOW_AFTER_REAL_MONEY_VALUE || $mode == AW_Giftcard_Model_Source_Giftcard_Config_Refund::NOT_ALLOW_VALUE) {
         $_needBaseMoneyToRefund = abs($order->getBaseTotalPaid() - $order->getBaseTotalRefunded());
         $_needMoneyToRefund = abs($order->getTotalPaid() - $order->getTotalRefunded());
         $total = $creditMemo->getGrandTotal() - $_needMoneyToRefund;
         $baseTotal = $creditMemo->getBaseGrandTotal() - $_needBaseMoneyToRefund;
     }
     if ($total <= 0 || $baseTotal <= 0) {
         return $this;
     }
     $baseTotalGiftcardAmount = 0;
     $totalGiftcardAmount = 0;
     $creditmemoGiftCards = array();
     if (null === $creditMemo->getId()) {
         $invoiceGiftCards = Mage::helper('aw_giftcard/totals')->getInvoicedGiftCardsByOrderId($creditMemo->getOrder()->getId());
         foreach ($invoiceGiftCards as $invoiceCard) {
             $_baseGiftcardAmount = $invoiceCard->getBaseGiftcardAmount();
             $_giftcardAmount = $invoiceCard->getGiftcardAmount();
             $creditmemoItems = Mage::helper('aw_giftcard/totals')->getAllCreditmemoForGiftCard($creditMemo->getOrder()->getId(), $invoiceCard->getGiftcardId());
             if (count($creditmemoItems) > 0) {
                 foreach ($creditmemoItems as $creditmemoGiftcard) {
                     $_baseGiftcardAmount -= $creditmemoGiftcard->getBaseGiftcardAmount();
                     $_giftcardAmount -= $creditmemoGiftcard->getGiftcardAmount();
                 }
             }
             $baseCardUsedAmount = $_baseGiftcardAmount;
             if ($_baseGiftcardAmount >= $baseTotal) {
                 $baseCardUsedAmount = $baseTotal;
             }
             $baseTotal -= $baseCardUsedAmount;
             $cardUsedAmount = $_giftcardAmount;
             if ($_giftcardAmount >= $total) {
                 $cardUsedAmount = $total;
             }
             $total -= $cardUsedAmount;
             $_baseGiftcardAmount = round($baseCardUsedAmount, 4);
             $_giftcardAmount = round($cardUsedAmount, 4);
             $baseTotalGiftcardAmount += $_baseGiftcardAmount;
             $totalGiftcardAmount += $_giftcardAmount;
             $_creditmemoCard = new Varien_Object($invoiceCard->getData());
             $_creditmemoCard->setBaseGiftcardAmount($_baseGiftcardAmount)->setGiftcardAmount($_giftcardAmount);
             array_push($creditmemoGiftCards, $_creditmemoCard);
         }
     }
     if (null !== $creditMemo->getId() && $creditMemo->getAwGiftCards()) {
         $creditmemoGiftCards = $creditMemo->getAwGiftCards();
         foreach ($creditmemoGiftCards as $creditmemoCard) {
             $baseTotalGiftcardAmount += $creditmemoCard->getBaseGiftcardAmount();
             $totalGiftcardAmount += $creditmemoCard->getGiftcardAmount();
         }
     }
     if (count($creditmemoGiftCards) > 0) {
         $creditMemo->setAllowZeroGrandTotal(true);
     }
     $creditMemo->setAwGiftCards($creditmemoGiftCards)->setBaseAwGiftCardsAmount($baseTotalGiftcardAmount)->setAwGiftCardsAmount($totalGiftcardAmount)->setBaseGrandTotal($creditMemo->getBaseGrandTotal() - $baseTotalGiftcardAmount)->setGrandTotal($creditMemo->getGrandTotal() - $totalGiftcardAmount);
     return $this;
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:62,代码来源:Creditmemo.php


注:本文中的Mage_Sales_Model_Order_Creditmemo::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。