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


PHP Mage_Sales_Model_Order_Creditmemo::getAdjustmentPositive方法代码示例

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


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

示例1: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $grandTotal = $creditmemo->getGrandTotal();
     $baseGrandTotal = $creditmemo->getBaseGrandTotal();
     $grandTotal += $creditmemo->getAdjustmentPositive();
     $baseGrandTotal += $creditmemo->getBaseAdjustmentPositive();
     $grandTotal -= $creditmemo->getAdjustmentNegative();
     $baseGrandTotal -= $creditmemo->getBaseAdjustmentNegative();
     $creditmemo->setGrandTotal($grandTotal);
     $creditmemo->setBaseGrandTotal($baseGrandTotal);
     $creditmemo->setAdjustment($creditmemo->getAdjustmentPositive() - $creditmemo->getAdjustmentNegative());
     $creditmemo->setBaseAdjustment($creditmemo->getBaseAdjustmentPositive() - $creditmemo->getBaseAdjustmentNegative());
     return $this;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:14,代码来源:Grand.php

示例2: collect

 public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $order = $creditmemo->getOrder();
     $orderTaxPerc = 0;
     $taxDetails = $order->getFullTaxInfo();
     if (count($taxDetails)) {
         $det = array_pop($taxDetails);
         $orderTaxPerc = $det['percent'];
     }
     // Adding adjustment tax amounts to total tax
     $totalAdjusment = $creditmemo->getAdjustmentPositive() - $creditmemo->getAdjustmentNegative();
     $baseTotalAdjusment = $creditmemo->getBaseAdjustmentPositive() - $creditmemo->getBaseAdjustmentNegative();
     // Adjustment values already include tax in my case. Modify calculation if you're entering values without tax
     $totalAdjusmentTax = $totalAdjusment - $totalAdjusment * 100 / (100 + $orderTaxPerc);
     $baseTotalAdjusmentTax = $baseTotalAdjusment - $baseTotalAdjusment * 100 / (100 + $orderTaxPerc);
     parent::collect($creditmemo);
     $creditmemo->setTaxAmount($creditmemo->getTaxAmount() + $totalAdjusmentTax);
     $creditmemo->setBaseTaxAmount($creditmemo->getBaseTaxAmount() + $baseTotalAdjusmentTax);
     return $this;
 }
开发者ID:becchius,项目名称:fiordivaniglia,代码行数:20,代码来源:Tax.php

示例3: isCreditmemoAllowed

 /**
  * Is the given creditmemo allowed
  *
  * @param Mage_Sales_Model_Order_Creditmemo
  */
 private function isCreditmemoAllowed(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     if ($creditmemo->getShippingAmount() < $creditmemo->getOrder()->getShippingAmount() && $creditmemo->getShippingAmount() > 0) {
         $this->_errorMessage = 'Only full return of shipping is possible.';
         return false;
     }
     if ($creditmemo->getAdjustmentPositive() > 0 && $this->_getItemCount($creditmemo) > 0) {
         $this->_errorMessage = 'Please create product returns and positive adjustments separately.';
         return false;
     }
     return true;
 }
开发者ID:kirchbergerknorr,项目名称:RatePAY_Ratepaypayment,代码行数:17,代码来源:Observer.php

示例4: mapAdjustmentPositiveAsItemByCreditmemo

 /**
  * @param Mage_Sales_Model_Order_Creditmemo $creditmemo
  * @return Payone_Api_Request_Parameter_Invoicing_Item
  *
  * used by Payone_Core_Model_Mapper_ApiRequest_Payment_Debit
  */
 protected function mapAdjustmentPositiveAsItemByCreditmemo(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $configMiscCreditmemo = $this->getConfigMisc()->getCreditmemo();
     $sku = $configMiscCreditmemo->getAdjustmentRefundSku();
     $name = $configMiscCreditmemo->getAdjustmentRefundName();
     if (empty($sku)) {
         $sku = $this->helper()->__(self::DEFAULT_ADJUSTMENT_POSITIVE_SKU);
     }
     if (empty($name)) {
         $name = $this->helper()->__(self::DEFAULT_ADJUSTMENT_POSITIVE_SKU);
     }
     $params['id'] = $sku;
     $params['de'] = $name;
     $params['no'] = 1;
     $params['pr'] = $creditmemo->getAdjustmentPositive();
     if ($this->getPaymentMethod()->mustTransmitInvoicingItemTypes()) {
         $params['it'] = Payone_Api_Enum_InvoicingItemType::VOUCHER;
     }
     $item = new Payone_Api_Request_Parameter_Invoicing_Item();
     $item->init($params);
     return $item;
 }
开发者ID:romfr,项目名称:payone-magento,代码行数:28,代码来源:Abstract.php

示例5: mapAdjustmentPositiveAsItemByCreditmemo

 /**
  * @param Mage_Sales_Model_Order_Creditmemo $creditmemo
  * @return Payone_Api_Request_Parameter_Invoicing_Item
  *
  * used by Payone_Core_Model_Mapper_ApiRequest_Payment_Debit
  */
 protected function mapAdjustmentPositiveAsItemByCreditmemo(Mage_Sales_Model_Order_Creditmemo $creditmemo)
 {
     $configMiscCreditmemo = $this->getConfigMisc()->getCreditmemo();
     $sku = $configMiscCreditmemo->getAdjustmentRefundSku();
     $name = $configMiscCreditmemo->getAdjustmentRefundName();
     if (empty($sku)) {
         $sku = $this->helper()->__(self::DEFAULT_ADJUSTMENT_POSITIVE_SKU);
     }
     if (empty($name)) {
         $name = $this->helper()->__(self::DEFAULT_ADJUSTMENT_POSITIVE_SKU);
     }
     $params['it'] = Payone_Api_Enum_InvoicingItemType::VOUCHER;
     $params['id'] = $sku;
     $params['de'] = $name;
     $params['no'] = 1;
     $params['pr'] = $creditmemo->getAdjustmentPositive();
     $params['va'] = round($this->getShippingTaxRate() * 100);
     // assuming that it has the same tax-rate as shipping - dont know from where to get the tax
     $item = new Payone_Api_Request_Parameter_Invoicing_Item();
     $item->init($params);
     return $item;
 }
开发者ID:kirchbergerknorr,项目名称:Payone_Core,代码行数:28,代码来源:Abstract.php


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