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


PHP Mage_Sales_Model_Order_Creditmemo::getOrder方法代码示例

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


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

示例1: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $creditmemo->setPaymentCharge(0);
     $creditmemo->setBasePaymentCharge(0);
     $paymentCharge = $creditmemo->getOrder()->getPaymentCharge();
     $basePaymentCharge = $creditmemo->getOrder()->getBasePaymentCharge();
     // we moeten de btw meenemen in de berekening
     $paymentMethod = $creditmemo->getOrder()->getPayment()->getMethod();
     $taxClass = Mage::helper('pay_payment')->getPaymentChargeTaxClass($paymentMethod);
     $storeId = Mage::app()->getStore()->getId();
     $taxCalculationModel = Mage::getSingleton('tax/calculation');
     $request = $taxCalculationModel->getRateRequest($creditmemo->getOrder()->getShippingAddress(), $creditmemo->getOrder()->getBillingAddress(), null, $storeId);
     $request->setStore(Mage::app()->getStore());
     $rate = $taxCalculationModel->getRate($request->setProductClassId($taxClass));
     if ($rate > 0) {
         $baseChargeTax = round($creditmemo->getBasePaymentCharge() / (1 + $rate / 100) * ($rate / 100), 2);
         $chargeTax = round($creditmemo->getPaymentCharge() / (1 + $rate / 100) * ($rate / 100), 2);
     } else {
         $baseChargeTax = 0;
         $chargeTax = 0;
     }
     $creditmemo->setPaymentCharge($paymentCharge);
     $creditmemo->setBasePaymentCharge($basePaymentCharge);
     $creditmemo->setBaseTaxAmount($creditmemo->getBaseTaxAmount() + $baseChargeTax);
     $creditmemo->setTaxAmount($creditmemo->getTaxAmount() + $chargeTax);
     $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $creditmemo->getPaymentCharge());
     $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $creditmemo->getBasePaymentCharge());
     return $this;
 }
开发者ID:paynl,项目名称:magento-plugin,代码行数:29,代码来源:Paymentcharge.php

示例2: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $shippingTaxAmount = 0;
     $baseShippingTaxAmount = 0;
     $totalTax = 0;
     $baseTotalTax = 0;
     foreach ($creditmemo->getAllItems() as $item) {
         if ($item->getOrderItem()->isDummy()) {
             continue;
         }
         $orderItemTax = $item->getOrderItem()->getTaxAmount();
         $baseOrderItemTax = $item->getOrderItem()->getBaseTaxAmount();
         $orderItemQty = $item->getOrderItem()->getQtyOrdered();
         if ($orderItemTax && $orderItemQty) {
             $tax = $orderItemTax * $item->getQty() / $orderItemQty;
             $baseTax = $baseOrderItemTax * $item->getQty() / $orderItemQty;
             $tax = $creditmemo->getStore()->roundPrice($tax);
             $baseTax = $creditmemo->getStore()->roundPrice($baseTax);
             $item->setTaxAmount($tax);
             $item->setBaseTaxAmount($baseTax);
             $totalTax += $tax;
             $baseTotalTax += $baseTax;
         }
     }
     if ($invoice = $creditmemo->getInvoice()) {
         $totalTax += $invoice->getShippingTaxAmount();
         $baseTotalTax += $invoice->getBaseShippingTaxAmount();
         $creditmemo->setShippingTaxAmount($invoice->getShippingTaxAmount());
         $creditmemo->setBaseShippingTaxAmount($invoice->getBaseShippingTaxAmount());
     } else {
         $shippingAmount = $creditmemo->getOrder()->getBaseShippingAmount();
         $shippingRefundedAmount = $creditmemo->getOrder()->getBaseShippingRefunded();
         $shippingTaxAmount = 0;
         $baseShippingTaxAmount = 0;
         if ($shippingAmount - $shippingRefundedAmount > $creditmemo->getShippingAmount()) {
             $shippingTaxAmount = $creditmemo->getShippingAmount() * ($creditmemo->getOrder()->getShippingTaxAmount() / $shippingAmount);
             $baseShippingTaxAmount = $creditmemo->getBaseShippingAmount() * ($creditmemo->getOrder()->getBaseShippingTaxAmount() / $shippingAmount);
             $shippingTaxAmount = $creditmemo->getStore()->roundPrice($shippingTaxAmount);
             $baseShippingTaxAmount = $creditmemo->getStore()->roundPrice($baseShippingTaxAmount);
         } elseif ($shippingAmount - $shippingRefundedAmount == $creditmemo->getShippingAmount()) {
             $shippingTaxAmount = $creditmemo->getOrder()->getShippingTaxAmount() - $creditmemo->getOrder()->getShippingTaxRefunded();
             $baseShippingTaxAmount = $creditmemo->getOrder()->getBaseShippingTaxAmount() - $creditmemo->getOrder()->getBaseShippingTaxRefunded();
         }
         $totalTax += $shippingTaxAmount;
         $baseTotalTax += $baseShippingTaxAmount;
     }
     $tmpBaseTotalTax = $baseTotalTax - ($creditmemo->getOrder()->getBaseTaxRefunded() - $creditmemo->getOrder()->getBaseShippingTaxRefunded());
     if ($tmpBaseTotalTax < 0) {
         $baseTotalTax = 0;
         $totalTax = 0;
     }
     $creditmemo->setTaxAmount($totalTax);
     $creditmemo->setBaseTaxAmount($baseTotalTax);
     $creditmemo->setShippingTaxAmount($shippingTaxAmount);
     $creditmemo->setBaseShippingTaxAmount($baseShippingTaxAmount);
     $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $totalTax);
     $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseTotalTax);
     return $this;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:59,代码来源:Order_Creditmemo_Total_Tax.php

示例3: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $creditmemo->setWebposGiftwrapAmount(0);
     $orderGiftwrapAmount = $creditmemo->getOrder()->getWebposGiftwrapAmount();
     $baseOrderShippingAmount = $creditmemo->getOrder()->getWebposGiftwrapAmount();
     if ($orderGiftwrapAmount) {
         $creditmemo->setWebposGiftwrapAmount($orderGiftwrapAmount);
         $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $orderGiftwrapAmount);
         $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $orderGiftwrapAmount);
     }
     return $this;
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:12,代码来源:Giftwrap.php

示例4: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $creditmemo->setPaymentCharge(0);
     $creditmemo->setBasePaymentCharge(0);
     $amount = $creditmemo->getOrder()->getPaymentCharge();
     $creditmemo->setPaymentCharge($amount);
     $amount = $creditmemo->getOrder()->getBasePaymentCharge();
     $creditmemo->setBasePaymentCharge($amount);
     $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $creditmemo->getPaymentCharge());
     $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $creditmemo->getBasePaymentCharge());
     return $this;
 }
开发者ID:Rukhsar,项目名称:magento-paypal-charging-fee,代码行数:12,代码来源:Paymentcharge.php

示例5: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     if (!$creditmemo->getInvoice() || !$creditmemo->getInvoice()->getId()) {
         return;
     }
     $order = $creditmemo->getOrder();
     if ($order->getWebposCash() < 0.0001 || $order->getGrandTotal() < 0.0001) {
         return;
     }
     $ratio = $creditmemo->getGrandTotal() / $order->getGrandTotal();
     $cash = $order->getWebposCash() * $ratio;
     $baseCash = $order->getWebposBaseCash() * $ratio;
     $maxcash = $order->getWebposCash();
     $maxbaseCash = $order->getWebposBaseCash();
     foreach ($order->getCreditmemosCollection() as $existedCreditmemo) {
         if ($maxcash > 0.0001) {
             $maxcash -= $existedCreditmemo->getWebposCash();
             $maxbaseCash -= $existedCreditmemo->getWebposBaseCash();
         }
     }
     if ($cash > $maxcash) {
         $cash = $maxcash;
         $baseCash = $maxbaseCash;
     }
     if ($cash > 0.0001) {
         $creditmemo->setWebposCash($cash)->setWebposBaseCash($baseCash);
         if ($creditmemo->getGrandTotal() <= $cash) {
             $creditmemo->setBaseGrandTotal(0.0)->setGrandTotal(0.0);
         } else {
             $creditmemo->setGrandTotal($creditmemo->getGrandTotal() - $cash)->setBaseGrandTotal($creditmemo->getBaseGrandTotal() - $baseCash);
         }
     }
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:33,代码来源:Cash.php

示例6: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $order = $creditmemo->getOrder();
     $allowedAmount = $order->getShippingAmount() - $order->getShippingRefunded();
     $baseAllowedAmount = $order->getBaseShippingAmount() - $order->getBaseShippingRefunded();
     /**
      * Check if shipping amount was specified (from invoice or another source).
      * Using has magic method to allow setting 0 as shipping amount.
      */
     if ($creditmemo->hasBaseShippingAmount()) {
         $baseShippingAmount = Mage::app()->getStore()->roundPrice($creditmemo->getBaseShippingAmount());
         if ($baseShippingAmount < $baseAllowedAmount) {
             $shippingAmount = $allowedAmount * $baseShippingAmount / $baseAllowedAmount;
             $shippingAmount = Mage::app()->getStore()->roundPrice($shippingAmount);
         } elseif ($baseShippingAmount == $baseAllowedAmount) {
             $shippingAmount = $allowedAmount;
         } else {
             $baseAllowedAmount = $order->formatBasePrice($baseAllowedAmount);
             Mage::throwException(Mage::helper('sales')->__('Maximum shipping amount allowed to refound is: %s', $baseAllowedAmount));
         }
     } else {
         $baseShippingAmount = $baseAllowedAmount;
         $shippingAmount = $allowedAmount;
     }
     $creditmemo->setShippingAmount($shippingAmount);
     $creditmemo->setBaseShippingAmount($baseShippingAmount);
     $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $shippingAmount);
     $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseShippingAmount);
     return $this;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:30,代码来源:Shipping.php

示例7: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $creditmemo->setGomageGiftWrapAmount(0);
     $creditmemo->setBaseGomageGiftWrapAmount(0);
     $order = $creditmemo->getOrder();
     $totalGomageGiftWrapAmount = 0;
     $baseTotalGomageGiftWrapAmount = 0;
     foreach ($creditmemo->getAllItems() as $item) {
         if ($item->getOrderItem()->isDummy()) {
             continue;
         }
         $orderItemGomageGiftWrap = (double) $item->getOrderItem()->getGomageGiftWrapAmount();
         $baseOrderItemGomageGiftWrap = (double) $item->getOrderItem()->getBaseGomageGiftWrapAmount();
         $orderItemQty = $item->getOrderItem()->getQtyOrdered();
         if ($orderItemGomageGiftWrap && $orderItemQty) {
             $GomageGiftWrap = $orderItemGomageGiftWrap * $item->getQty() / $orderItemQty;
             $baseGomageGiftWrap = $baseOrderItemGomageGiftWrap * $item->getQty() / $orderItemQty;
             $GomageGiftWrap = $creditmemo->getStore()->roundPrice($GomageGiftWrap);
             $baseGomageGiftWrap = $creditmemo->getStore()->roundPrice($baseGomageGiftWrap);
             $item->setGomageGiftWrapAmount($GomageGiftWrap);
             $item->setBaseGomageGiftWrapAmount($baseGomageGiftWrap);
             $totalGomageGiftWrapAmount += $GomageGiftWrap;
             $baseTotalGomageGiftWrapAmount += $baseGomageGiftWrap;
         }
     }
     $creditmemo->setGomageGiftWrapAmount($totalGomageGiftWrapAmount);
     $creditmemo->setBaseGomageGiftWrapAmount($baseTotalGomageGiftWrapAmount);
     $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $totalGomageGiftWrapAmount);
     $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseTotalGomageGiftWrapAmount);
     return $this;
 }
开发者ID:jpedro21,项目名称:comerciodoboi,代码行数:31,代码来源:Giftwrap.php

示例8: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $baseDiscount = 0;
     $discount = 0;
     foreach ($creditmemo->getAllItems() as $item) {
         if ($item->getOrderItem()->isDummy()) {
             continue;
         }
         $orderItem = $item->getOrderItem();
         $orderItemDiscount = (double) $orderItem->getAffiliateplusAmount();
         $baseOrderItemDiscount = (double) $orderItem->getBaseAffiliateplusAmount();
         $orderItemQty = $orderItem->getQtyOrdered();
         if ($orderItemDiscount && $orderItemQty) {
             $discount -= $orderItemDiscount * $item->getQty() / $orderItemQty;
             $baseDiscount -= $baseOrderItemDiscount * $item->getQty() / $orderItemQty;
         }
     }
     if (!floatval($baseDiscount)) {
         $order = $creditmemo->getOrder();
         $baseDiscount = $order->getBaseAffiliateplusDiscount();
         $discount = $order->getAffiliateplusDiscount();
     }
     if (floatval($baseDiscount)) {
         $baseDiscount = Mage::app()->getStore()->roundPrice($baseDiscount);
         $discount = Mage::app()->getStore()->roundPrice($discount);
         $creditmemo->setBaseAffiliateplusDiscount($baseDiscount);
         $creditmemo->setAffiliateplusDiscount($discount);
         $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseDiscount);
         $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $discount);
     }
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:32,代码来源:Affiliateplus.php

示例9: collect

 /**
  * Collect reward totals for credit memo
  *
  * @param Mage_Sales_Model_Order_Creditmemo $creditmemo
  * @return Enterprise_Reward_Model_Total_Creditmemo_Reward
  */
 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $order = $creditmemo->getOrder();
     $rewardCurrecnyAmountLeft = $order->getRewardCurrencyAmountInvoiced() - $order->getRewardCurrencyAmountRefunded();
     $baseRewardCurrecnyAmountLeft = $order->getBaseRewardCurrencyAmountInvoiced() - $order->getBaseRewardCurrencyAmountRefunded();
     if ($order->getBaseRewardCurrencyAmount() && $baseRewardCurrecnyAmountLeft > 0) {
         if ($baseRewardCurrecnyAmountLeft >= $creditmemo->getBaseGrandTotal()) {
             $rewardCurrecnyAmountLeft = $creditmemo->getGrandTotal();
             $baseRewardCurrecnyAmountLeft = $creditmemo->getBaseGrandTotal();
             $creditmemo->setGrandTotal(0);
             $creditmemo->setBaseGrandTotal(0);
             $creditmemo->setAllowZeroGrandTotal(true);
         } else {
             $creditmemo->setGrandTotal($creditmemo->getGrandTotal() - $rewardCurrecnyAmountLeft);
             $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() - $baseRewardCurrecnyAmountLeft);
         }
         $pointValue = $order->getRewardPointsBalance() / $order->getBaseRewardCurrencyAmount();
         $rewardPointsBalance = $baseRewardCurrecnyAmountLeft * ceil($pointValue);
         $rewardPointsBalanceLeft = $order->getRewardPointsBalance() - $order->getRewardPointsBalanceRefunded();
         if ($rewardPointsBalance > $rewardPointsBalanceLeft) {
             $rewardPointsBalance = $rewardPointsBalanceLeft;
         }
         $creditmemo->setRewardPointsBalance($rewardPointsBalance);
         $creditmemo->setRewardCurrencyAmount($rewardCurrecnyAmountLeft);
         $creditmemo->setBaseRewardCurrencyAmount($baseRewardCurrecnyAmountLeft);
     }
     return $this;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:34,代码来源:Reward.php

示例10: collect

 /**
  * Collect snap gift card account totals for credit memo
  *
  * @param Mage_Sales_Model_Order_Creditmemo $creditmemo
  * @return $this
  */
 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $order = $creditmemo->getOrder();
     if ($order->getBaseSnapCardsAmount() && $order->getBaseSnapCardsInvoiced() != 0) {
         $gcaLeft = $order->getBaseSnapCardsInvoiced() - $order->getBaseSnapCardsRefunded();
         $used = 0;
         $baseUsed = 0;
         if ($gcaLeft >= $creditmemo->getBaseGrandTotal()) {
             $baseUsed = $creditmemo->getBaseGrandTotal();
             $used = $creditmemo->getGrandTotal();
             $creditmemo->setBaseGrandTotal(0);
             $creditmemo->setGrandTotal(0);
             $creditmemo->setAllowZeroGrandTotal(true);
         } else {
             $baseUsed = $order->getBaseSnapCardsInvoiced() - $order->getBaseSnapCardsRefunded();
             $used = $order->getSnapCardsInvoiced() - $order->getSnapCardsRefunded();
             $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() - $baseUsed);
             $creditmemo->setGrandTotal($creditmemo->getGrandTotal() - $used);
         }
         $creditmemo->setBaseSnapCardsAmount($baseUsed);
         $creditmemo->setSnapCardsAmount($used);
     }
     $creditmemo->setBaseCustomerBalanceReturnMax($creditmemo->getBaseCustomerBalanceReturnMax() + $creditmemo->getBaseSnapCardsAmount());
     $creditmemo->setCustomerBalanceReturnMax($creditmemo->getCustomerBalanceReturnMax() + $creditmemo->getSnapCardsAmount());
     $creditmemo->setCustomerBalanceReturnMax($creditmemo->getCustomerBalanceReturnMax() + $creditmemo->getGrandTotal());
     return $this;
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:33,代码来源:Card.php

示例11: process

 /**
  * Save order in AvaTax system
  *
  * @see OnePica_AvaTax_Model_Observer_SalesOrderCreditmemoSaveAfter::execute()
  * @param Mage_Sales_Model_Order_Creditmemo  $creditmemo
  * @param OnePica_AvaTax_Model_Records_Queue $queue
  * @return mixed
  * @throws OnePica_AvaTax_Exception
  * @throws OnePica_AvaTax_Model_Service_Exception_Commitfailure
  * @throws OnePica_AvaTax_Model_Service_Exception_Unbalanced
  */
 public function process($creditmemo, $queue)
 {
     $order = $creditmemo->getOrder();
     $storeId = $order->getStoreId();
     $this->setStoreId($storeId);
     $shippingAddress = $order->getShippingAddress() ? $order->getShippingAddress() : $order->getBillingAddress();
     if (!$shippingAddress) {
         throw new OnePica_AvaTax_Exception($this->_getHelper()->__('There is no address attached to this order'));
     }
     /** @var OnePica_AvaTax_Model_Service_Result_Creditmemo $creditmemoResult */
     $creditmemoResult = $this->_getService()->creditmemo($creditmemo, $queue);
     //if successful
     if (!$creditmemoResult->getHasError()) {
         $message = $this->_getHelper()->__('Credit memo #%s was saved to AvaTax', $creditmemoResult->getDocumentCode());
         $this->_getHelper()->addStatusHistoryComment($order, $message);
         $totalTax = $creditmemoResult->getTotalTax();
         if ($totalTax != $creditmemo->getBaseTaxAmount() * -1) {
             throw new OnePica_AvaTax_Model_Service_Exception_Unbalanced('Collected: ' . $creditmemo->getTaxAmount() . ', Actual: ' . $totalTax);
         }
         //if not successful
     } else {
         $messages = $creditmemoResult->getErrors();
         throw new OnePica_AvaTax_Model_Service_Exception_Commitfailure(implode(' // ', $messages));
     }
     return true;
 }
开发者ID:onepica,项目名称:avatax,代码行数:37,代码来源:Creditmemo.php

示例12: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $baseDiscount = 0;
     $discount = 0;
     $order = $creditmemo->getOrder();
     $baseOrderDiscount = $order->getBaseAffiliateCredit();
     $orderDiscount = $order->getAffiliateCredit();
     if ($creditmemo->getBaseGrandTotal() < 0.0001 || $baseOrderDiscount >= 0) {
         return $this;
     }
     $baseInvoicedDiscount = 0;
     $invoicedDiscount = 0;
     foreach ($order->getCreditmemosCollection() as $_creditmemo) {
         $baseInvoicedDiscount += $_creditmemo->getBaseAffiliateCredit();
         $invoicedDiscount += $_creditmemo->getAffiliateCredit();
     }
     $baseOrderTotal = $order->getBaseGrandTotal() - $baseOrderDiscount;
     $baseDiscount = $baseOrderDiscount * $creditmemo->getBaseGrandTotal() / $baseOrderTotal;
     $discount = $orderDiscount * $creditmemo->getBaseGrandTotal() / $baseOrderTotal;
     if ($baseDiscount < $baseOrderDiscount) {
         $baseDiscount = $baseOrderDiscount;
         $discount = $orderDiscount;
     }
     if ($baseDiscount) {
         $baseDiscount = Mage::app()->getStore()->roundPrice($baseDiscount);
         $discount = Mage::app()->getStore()->roundPrice($discount);
         $creditmemo->setBaseAffiliateCredit($baseDiscount);
         $creditmemo->setAffiliateCredit($discount);
         $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseDiscount);
         $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $discount);
         $creditmemo->setAllowZeroGrandTotal(true);
     }
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:34,代码来源:Credit.php

示例13: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $cm)
 {
     $order = $cm->getOrder();
     if ($order->getPayment()->getMethodInstance()->getCode() != 'cashondelivery') {
         return $this;
     }
     $baseCmTotal = $cm->getBaseGrandTotal();
     $cmTotal = $cm->getGrandTotal();
     $baseCodFeeCredited = $order->getBaseCodFeeCredited();
     $codFeeCredited = $order->getCodFeeCredited();
     $baseCodFeeInvoiced = $order->getBaseCodFeeInvoiced();
     $codFeeInvoiced = $order->getCodFeeInvoiced();
     if ($cm->getInvoice()) {
         $invoice = $cm->getInvoice();
         $baseCodFeeToCredit = $invoice->getBaseCodFee();
         $codFeeToCredit = $invoice->getCodFee();
     } else {
         $baseCodFeeToCredit = $baseCodFeeInvoiced;
         $codFeeToCredit = $codFeeInvoiced;
     }
     if (!$baseCodFeeToCredit > 0) {
         return $this;
     }
     // Subtracting invoiced COD fee from Credit memo total
     //$cm->setBaseGrandTotal($baseCmTotal-$baseCodFeeToCredit);
     //$cm->setGrandTotal($cmTotal-$codFeeToCredit);
     //$cm->setBaseCodFee($baseCodFeeToCredit);
     //$cm->setCodFee($codFeeToCredit);
     //$order->setBaseCodFeeCredited($baseCodFeeCredited+$baseCodFeeToCredit);
     //$order->setCodFeeCredited($codFeeCredited+$baseCodFeeToCredit);
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:32,代码来源:Total.php

示例14: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $order = $creditmemo->getOrder();
     $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $order->getDesconto());
     $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $order->getBaseDesconto());
     return $this;
 }
开发者ID:TalissonBento,项目名称:Pharmacy,代码行数:7,代码来源:Desconto.php

示例15: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $order = $creditmemo->getOrder();
     $invoice = $order->getInvoiceCollection()->getFirstItem();
     $payment = $order->getPayment();
     $paymentMethod = $payment->getMethod();
     if ($this->getHelper()->isBillpayRatPayment($paymentMethod)) {
         $info = $payment->getMethodInstance()->getInfoInstance();
         // Temporary set creditmemo amount to current amount (will be overriden after partialCancel-request was successful)
         $creditmemo->setBillpayRateSurcharge($info->getBillpayRateSurcharge());
         $creditmemo->setBillpayRateFee($info->getBillpayRateFee());
         $creditmemo->setBillpayRateFeeNet($info->getBillpayRateFeeNet());
         $creditmemo->setBillpayRateTotalAmount($info->getBillpayRateTotalAmount());
         $creditmemo->setBillpayRateFeeTax($info->getBillpayRateFeeTax());
         // TODO: ...
         /*if ($diff < 0 && -$diff = $feeTaxAmount) {		// must be a full cancel
         			$creditmemo->setGrandTotal($creditmemo->getGrandTotal() - $feeTaxAmount);
         		}
         		else if ($diff == 0) {
         			$creditmemo->setTaxAmount($creditmemo->getTaxAmount() + $feeTaxAmount);
         		}
         		
         		$diffBase = $order->getBaseGrandTotal() - $order->getBaseTotalRefunded() - $creditmemo->getBaseGrandTotal();
         		if ($diffBase < 0 && -$diffBase = $feeTaxAmount) {		// must be a full cancel
         			$creditmemo->setBaseGrandTotal($creditmemo->getGrandTotal() - $feeTaxAmount);
         		}
         		else if ($diff == 0) {
         			$creditmemo->setBaseTaxAmount($creditmemo->getBaseTaxAmount() + $feeTaxAmount);
         		}*/
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:bilderrahmen,代码行数:32,代码来源:Surcharge.php


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