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


PHP Mage_Sales_Model_Order_Shipment::getOrder方法代码示例

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


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

示例1: _addShipmentWithTrack

 /**
  * Adds shipment with specified tracking number
  *
  * @param Mage_Sales_Model_Order_Shipment $shipment
  * @param Mage_Sales_Model_Order_Shipment_Track $track
  */
 private function _addShipmentWithTrack(Mage_Sales_Model_Order_Shipment $shipment, Mage_Sales_Model_Order_Shipment_Track $track = null)
 {
     $mageCarrierCode = $this->_getCarrierCodeFromOrder($shipment->getOrder());
     $carrierCode = $this->_getConfig()->getCarrierCode($mageCarrierCode);
     $otherCarrierName = $carrierCode == Mage_GoogleTrustedStore_Model_Config::CARRIER_CODE_OTHER ? $this->_getConfig()->getOtherCarrierName($mageCarrierCode) : '';
     $this->_addRow(array($shipment->getOrder()->getIncrementId(), trim($track ? $track->getNumber() : ''), $carrierCode, $otherCarrierName, $shipment->getCreatedAtDate()->toString('yyyy-MM-dd')));
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:13,代码来源:Shipment.php

示例2: getPgAddressHtml

 /**
  * Get html for the PGaddress
  *
  * @return string
  */
 public function getPgAddressHtml()
 {
     $res = array();
     $pgAddress = Mage::helper('tig_myparcel')->getPgAddress($this->_shipment->getOrder());
     if ($pgAddress) {
         $res = array($pgAddress->getCompany(), implode(' ', $pgAddress->getStreet()), $pgAddress->getPostcode() . ' ' . $pgAddress->getCity() . ' (' . $pgAddress->getCountry() . ')');
     }
     return empty($res) ? '' : '<p>' . implode('<br/>', $res) . '</p>';
 }
开发者ID:myparcelnl,项目名称:magento1,代码行数:14,代码来源:ShippingInfo.php

示例3: mustShipInOneParcel

 /**
  * True is returned if we transport the shipment in a single package.
  *
  * @param Mage_Sales_Model_Order_Shipment $shipment
  *
  * @return boolean
  */
 public function mustShipInOneParcel(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $carrier = $shipment->getOrder()->getShippingCarrier();
     if ($carrier instanceof Zitec_PackedShipment_Model_Carrier_Interface) {
         $shippingMethod = $shipment->getOrder()->getShippingMethod();
         return $carrier->shippingMethodRequiresShipmentsOfOnlyOneParcel($shippingMethod);
     }
     return true;
 }
开发者ID:GabrielCC,项目名称:zitec-dpd-master,代码行数:16,代码来源:Data.php

示例4: buildMap

 /**
  * @param Mage_Sales_Model_Order_Shipment $shipment
  * @return array
  */
 public function buildMap(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $map = array('packingslip_id_label' => $this->getSalesHelper()->__('Packingslip # '), 'order_id_label' => $this->getSalesHelper()->__('Order # '), 'order_date_label' => $this->getSalesHelper()->__('Order Date: '), 'billing_address_label' => $this->getSalesHelper()->__('Sold to:'), 'shipping_address_label' => $this->getSalesHelper()->__('Ship to:'), 'payment_method_label' => $this->getSalesHelper()->__('Payment Method:'), 'shipping_method_label' => $this->getSalesHelper()->__('Shipping Method:'), 'products_qty_label' => $this->getSalesHelper()->__('Qty'), 'products_label' => $this->getSalesHelper()->__('Products'), 'products_sku_label' => $this->getSalesHelper()->__('SKU'));
     $order = $shipment->getOrder();
     $billingAddress = $order->getBillingAddress();
     $map['packingslip_id'] = $shipment->getIncrementId();
     $map['order_id'] = Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Shipment::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId()) ? $order->getRealOrderId() : 'N/A';
     $map['order_date'] = $this->getCoreHelper()->formatDate($order->getCreatedAtStoreDate(), 'medium', false);
     $map['billing_name'] = $billingAddress->getFirstname() . ' ' . $billingAddress->getLastname();
     $map['billing_street'] = $billingAddress->getStreetFull();
     $map['billing_city'] = $billingAddress->getCity();
     $map['billing_zip'] = $billingAddress->getPostcode();
     $map['billing_country'] = $billingAddress->getCountryModel()->getIso2Code();
     $map['billing_phone'] = $billingAddress->getTelephone();
     $shippingAddress = $order->getShippingAddress();
     $map['shipping_name'] = $shippingAddress->getFirstname() . ' ' . $shippingAddress->getLastname();
     $map['shipping_street'] = $shippingAddress->getStreetFull();
     $map['shipping_city'] = $shippingAddress->getCity();
     $map['shipping_zip'] = $shippingAddress->getPostcode();
     $map['shipping_country'] = $shippingAddress->getCountry();
     $map['shipping_phone'] = $shippingAddress->getTelephone();
     $map['payment_method'] = $paymentInfo = $this->getPaymentHelper()->getInfoBlock($order->getPayment())->setIsSecureMode(true)->toHtml();
     $map['shipping_method'] = $order->getShippingDescription();
     $map['shipping_charges'] = '(' . $this->getSalesHelper()->__('Total Shipping Charges') . ' ' . $order->formatPriceTxt($order->getShippingAmount()) . ')';
     $map['products_data'] = '';
     foreach ($shipment->getAllItems() as $item) {
         if ($item->getOrderItem()->getParentItem()) {
             continue;
         }
         $map['products_data'] .= $this->drawItem($item, $order);
     }
     return $map;
 }
开发者ID:swisspost-yellowcube,项目名称:magento-yellowcube,代码行数:37,代码来源:Shipment.php

示例5: generateShipmentArray

 public function generateShipmentArray(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $address = $shipment->getShippingAddress();
     $trackingMethods = $shipment->getAllTracks();
     $primaryTrack = count($trackingMethods) ? $trackingMethods[0] : false;
     $array = array('@context' => 'http://schema.org', '@type' => 'ParcelDelivery', 'deliveryAddress' => array('@type' => 'PostalAddress', 'streetAddress' => $address->getStreetFull(), 'addressLocality' => $address->getCity(), 'addressRegion' => $address->getRegionCode(), 'addressCountry' => $address->getCountry(), 'postalCode' => $address->getPostcode()), 'partOfOrder' => $this->generateOrderArray($shipment->getOrder()), "expectedArrivalUntil" => date("c", time() + 60 * 60 * 24 * 365.25));
     if (count($trackingMethods)) {
         $array['carrier'] = $primaryTrack->getTitle();
         $array['trackingNumber'] = $primaryTrack->getNumber();
         $array['trackingUrl'] = $this->helper('shipping')->getTrackingPopUpUrlByTrackId($primaryTrack->getId());
     }
     return $array;
 }
开发者ID:salsero35,项目名称:gmailactions,代码行数:13,代码来源:Shipment.php

示例6: saveShipment

 /**
  * Save shipment
  *
  * @param Mage_Sales_Model_Order_Shipment $shipment
  * @param array $data
  * @return bool
  */
 public function saveShipment($shipment, $data)
 {
     $result = false;
     $carrierCode = $shipment->getOrder()->getShippingCarrier()->getCarrierCode();
     switch (true) {
         case Mage::getModel('shippingcore/carrier_aramex')->isUsed($carrierCode):
             $result = Mage::getModel('shippingcore/carrier_aramex')->saveShipment($shipment, $data);
             break;
         case Mage::getModel('shippingcore/carrier_skynet')->isUsed($carrierCode):
             $result = Mage::getModel('shippingcore/carrier_skynet')->saveShipment($shipment, $data);
             break;
     }
     return $result;
 }
开发者ID:amr-z,项目名称:shipping-core,代码行数:21,代码来源:Core.php

示例7: sendVendorComment

 /**
  * Send vendor comment to store owner
  *
  * @param Mage_Sales_Model_Order_Shipment $shipment
  * @param string $comment
  */
 public function sendVendorComment($shipment, $comment)
 {
     $order = $shipment->getOrder();
     $store = $order->getStore();
     $to = $store->getConfig('udropship/admin/vendor_comments_receiver');
     $subject = $store->getConfig('udropship/admin/vendor_comments_subject');
     $template = $store->getConfig('udropship/admin/vendor_comments_template');
     $vendor = $this->getVendor($shipment->getUdropshipVendor());
     $ahlp = Mage::getModel('adminhtml/url');
     if ($subject && $template && $vendor->getId()) {
         $toEmail = $store->getConfig('trans_email/ident_' . $to . '/email');
         $toName = $store->getConfig('trans_email/ident_' . $to . '/name');
         $data = array('vendor_name' => $vendor->getVendorName(), 'order_id' => $order->getIncrementId(), 'shipment_id' => $shipment->getIncrementId(), 'vendor_url' => $ahlp->getUrl('udropship/adminhtml_vendor/edit', array('id' => $vendor->getId())), 'order_url' => $ahlp->getUrl('adminhtml/sales_order/view', array('order_id' => $order->getId())), 'shipment_url' => $ahlp->getUrl('adminhtml/sales_order_shipment/view', array('shipment_id' => $shipment->getId(), 'order_id' => $order->getId())), 'comment' => $comment);
         if ($this->isUdpoActive() && ($po = Mage::helper('udpo')->getShipmentPo($shipment))) {
             $data['po_id'] = $po->getIncrementId();
             $data['po_url'] = $ahlp->getUrl('udpoadmin/order_po/view', array('udpo_id' => $po->getId(), 'order_id' => $order->getId()));
             $template = preg_replace('/{{isPoAvailable}}(.*?){{\\/isPoAvailable}}/s', '\\1', $template);
         } else {
             $template = preg_replace('/{{isPoAvailable}}.*?{{\\/isPoAvailable}}/s', '', $template);
         }
         foreach ($data as $k => $v) {
             $subject = str_replace('{{' . $k . '}}', $v, $subject);
             $template = str_replace('{{' . $k . '}}', $v, $template);
         }
         $mail = Mage::getModel('core/email')->setFromEmail($vendor->getEmail())->setFromName($vendor->getVendorName())->setToEmail($toEmail)->setToName($toName)->setSubject($subject)->setBody($template)->send();
         //mail('"'.$toName.'" <'.$toEmail.'>', $subject, $template, 'From: "'.$vendor->getVendorName().'" <'.$vendor->getEmail().'>');
     }
     Mage::helper('udropship')->addShipmentComment($shipment, $this->__($vendor->getVendorName() . ': ' . $comment));
     $shipment->getCommentsCollection()->save();
     return $this;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:37,代码来源:Data.php

示例8: _createShipmentInfo

 protected function _createShipmentInfo(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $result = array('shipmentId' => $shipment->getIncrementId(), 'shippingFees' => array('amount' => '0', 'code' => Mage::app()->getStore()->getBaseCurrencyCode()), 'discountAmount' => null, 'discounts' => null, 'additionalCost' => null, 'packagingHandlingCost' => null, 'surcharge' => null, 'trackingDetails' => $this->_createTrackingInfo($shipment->getAllTracks()), 'shippingMethod' => $shipment->getOrder()->getShippingDescription(), 'deliveryWindow' => null, 'shippingWindow' => null, 'shippingMessage' => null);
     return $result;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:5,代码来源:Marketplaceshipment.php

示例9: _saveShipment

 /**
  * Saves the Shipment changes in the Order
  *
  * @param $shipment Mage_Sales_Model_Order_Shipment
  * @param $order Mage_Sales_Model_Order
  * @param $customerEmailComments string
  */
 protected function _saveShipment(Mage_Sales_Model_Order_Shipment $shipment, Mage_Sales_Model_Order $order, $customerEmailComments = '')
 {
     $shipment->getOrder()->setIsInProcess(true);
     $transactionSave = Mage::getModel('core/resource_transaction')->addObject($shipment)->addObject($order)->save();
     $emailSentStatus = $shipment->getData('email_sent');
     if (!is_null($customerEmail) && !$emailSentStatus) {
         $shipment->sendEmail(true, $customerEmailComments);
         $shipment->setEmailSent(true);
     }
     return $this;
 }
开发者ID:Jonathonbyrd,项目名称:Optimized-Magento-1.9.x,代码行数:18,代码来源:Data.php

示例10: generateDocuments

 public static function generateDocuments(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $result = array();
     if ($shipment->getDcOrderId() && Mage::getStoreConfig('dc_charge_extension/dccharge/create-documents')) {
         $helper = Mage::helper('dccharge');
         $params = array();
         $params['calculation_id'] = $shipment->getDcOrderId();
         $params['output_currency'] = $shipment->getOrder()->getOrderCurrencyCode();
         $params['seller_first_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-first-name');
         $params['seller_last_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-last-name');
         $params['seller_country'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-country');
         $params['seller_address_line_1'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-address-line');
         $params['seller_city'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-city');
         $params['seller_zip'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-postcode');
         $params['seller_phone'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-phone');
         $params['shipment_invoice_no'] = $shipment->getIncrementId();
         $params['shipment_date'] = $shipment->getCreatedAt();
         $params['shipment_number_parcels'] = 1;
         $params['shipment_total_actual_weight'] = 0;
         foreach ($shipment->getAllItems() as $item) {
             $orderItem = $item->getOrderItem();
             $product = Mage::getModel('catalog/product')->load($orderItem->getProductId());
             if ($orderItem->getParentItemId() || !$orderItem->getQuoteItemId() || $product->isVirtual()) {
                 continue;
             }
             $itemWeightInKG = 0;
             if ($item->getWeight()) {
                 $weigthUnit = Mage::getStoreConfig('dc_charge_extension/dccharge/weight-unit');
                 $weight = Mage::getStoreConfig('dc_charge_extension/dccharge/allow-override-products-weight') ? Mage::getStoreConfig('dc_charge_extension/dccharge/overridden-products-weight') : $item->getWeight();
                 if ($weigthUnit == 'lb') {
                     $itemWeightInKG = round($weight * 0.45359237, 2);
                 } else {
                     $itemWeightInKG = $weight;
                 }
             }
             $params['shipment_total_actual_weight'] += $itemWeightInKG * $item->getQty();
         }
         $params['shipment_currency_sale'] = $shipment->getOrder()->getOrderCurrencyCode();
         if ($shipment->getDeliveryDutyType() == Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDP) {
             $params['shipment_incoterms'] = 'DDP';
         } elseif ($shipment->getDeliveryDutyType() == Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU) {
             $params['shipment_incoterms'] = 'DAP';
         } else {
             $params['shipment_incoterms'] = '';
         }
         $shippingAddress = $shipment->getShippingAddress();
         $billingAddress = $shipment->getBillingAddress();
         $params['shipto_first_name'] = $shippingAddress->getFirstname();
         $params['shipto_last_name'] = $shippingAddress->getLastname();
         $params['shipto_address_line_1'] = $shippingAddress->getStreet(-1);
         $params['shipto_city'] = $shippingAddress->getCity();
         $params['shipto_zip'] = $shippingAddress->getPostcode();
         $params['shipto_country'] = $shippingAddress->getCountryId();
         $params['shipto_phone'] = $shippingAddress->getTelephone();
         $params['soldto_first_name'] = $billingAddress->getFirstname();
         $params['soldto_last_name'] = $billingAddress->getLastname();
         $params['soldto_address_line_1'] = $billingAddress->getStreet(-1);
         $params['soldto_city'] = $billingAddress->getCity();
         $params['soldto_zip'] = $billingAddress->getPostcode();
         $params['soldto_country'] = $billingAddress->getCountryId();
         $params['soldto_phone'] = $billingAddress->getTelephone();
         $params['print_first_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-first-name');
         $params['print_last_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-last-name');
         $params['print_date'] = date('Y-m-d');
         $rawXml = $helper->sendRequest('documents', $params);
         try {
             if (stripos($rawXml, '<?xml') === false) {
                 throw new Exception($rawXml);
             }
             $answer = new SimpleXMLElement($rawXml);
             $commercialInvoice = current($answer->xpath('commercial-invoice'));
             $packingList = current($answer->xpath('packing-list'));
             $result['commercial_invoice_url'] = (string) $commercialInvoice->url;
             $result['packing_list_url'] = (string) $packingList->url;
         } catch (Exception $ex) {
             Mage::logException($ex);
         }
     }
     return $result;
 }
开发者ID:Fishead-Communications,项目名称:dutycalculator_charge_import_duty,代码行数:80,代码来源:Importdutytaxes.php

示例11: _filterShipmentItems

 /**
  * @param Mage_Sales_Model_Order_Shipment $shipment
  *
  * @return String                          containing HTML for shipment items and tracking numbers
  */
 protected function _filterShipmentItems(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $order = $shipment->getOrder();
     $layout = Mage::getSingleton('core/layout');
     /* @var $items Mage_Sales_Block_Items_Abstract */
     $items = $layout->createBlock('sales/order_email_shipment_items', 'items');
     $items->setTemplate('email/order/shipment/items.phtml');
     $items->setOrder($order);
     $items->setShipment($shipment);
     // Setup templates to use for products
     $items->addItemRender('default', 'sales/order_email_items_order_default', 'email/order/items/shipment/default.phtml');
     $items->addItemRender('grouped', 'sales/order_email_items_order_grouped', 'email/order/items/shipment/default.phtml');
     $items->addItemRender('bundle', 'bundle/sales_order_items_renderer', 'bundle/email/order/items/shipment/default.phtml');
     // When emailing from the admin, we need to ensure that we're using templates from the frontend
     Mage::getDesign()->setArea('frontend');
     return $items->toHtml();
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:22,代码来源:Filter.php

示例12: _saveShipment

 /**
  * Save shipment and order in one transaction
  * @param Mage_Sales_Model_Order_Shipment $shipment
  */
 protected function _saveShipment($shipment)
 {
     $shipment->getOrder()->setIsInProcess(true);
     $transactionSave = Mage::getModel('core/resource_transaction')->addObject($shipment)->addObject($shipment->getOrder())->save();
     return $this;
 }
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:10,代码来源:ShipmentController.php

示例13: getDefaultWeight

 /**
  * Get default weight.
  *
  * @param  Mage_Sales_Model_Order_Shipment  $shipment
  * @return float                            $weight
  */
 public function getDefaultWeight(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $weight = 0;
     if (true === $this->getConfig()->useProductWeightAsDefault()) {
         /* @var $item Mage_Sales_Model_Order_Item */
         foreach ($shipment->getOrder()->getItemsCollection() as $item) {
             if (false === Mage::helper('intraship')->isAllowedProductTypeForWeightCalculation($item->getProductType())) {
                 continue;
             }
             $weight += Mage::helper('intraship')->convertWeight((double) $item->getWeight() * (double) $item->getQtyOrdered());
         }
     } else {
         $weight = $this->getConfig()->getWeightDefault($shipment->getShippingAddress()->getCountryId());
     }
     return (double) $weight;
 }
开发者ID:igorvasiliev4,项目名称:magento_code,代码行数:22,代码来源:Autocreate.php

示例14: isCancelledWithDpd

 /**
  *
  * @param Mage_Sales_Model_Order_Shipment $shipment
  *
  * @return boolean
  */
 public function isCancelledWithDpd(Mage_Sales_Model_Order_Shipment $shipment)
 {
     return $this->isShippingMethodDpd($shipment->getOrder()->getShippingMethod()) && !$shipment->getShippingLabel();
 }
开发者ID:GabrielCC,项目名称:zitec-dpd-master,代码行数:10,代码来源:Data.php

示例15: _prepareItems

 /**
  * prepare item information 
  * 
  * @param Mage_Sales_Model_Order_Shipment $mOrderShipment 
  */
 private function _prepareItems($mOrderShipment)
 {
     $key = 0;
     $aOrderItem['nfe.total']['nfe.ICMSTot']['nfe.vProd'] = '0';
     $aOrderItem['nfe.total']['nfe.ICMSTot']['nfe.vNF'] = '0';
     /**
      * assign shipping values to items 
      */
     $nItems = count($mOrderShipment->getOrder()->getAllItems());
     if ($mOrderShipment->getOrder()->getShippingAmount()) {
         $vFrete = (string) number_format($mOrderShipment->getOrder()->getShippingAmount(), 2, '.', '');
         $vFreteParcial = number_format($vFrete / $nItems, 2, '.', '');
         for ($i = 0; $i < $nItems; $i++) {
             $arrFreteParcial[$i] = $vFreteParcial;
         }
         if ($vFreteParcial * $nItems < $vFrete) {
             $arrFreteParcial[0] += $vFrete - $vFreteParcial * $nItems;
         }
         if ($vFreteParcial * $nItems > $vFrete) {
             $arrFreteParcial[0] += $vFreteParcial * $nItems - $vFrete;
         }
         /**
          * format elements
          */
         for ($i = 0; $i < $nItems; $i++) {
             $arrFreteParcial[$i] = number_format($arrFreteParcial[$i], 2, '.', '');
         }
     }
     foreach ($mOrderShipment->getAllItems() as $_shipmentItem) {
         /**
          * load order item
          */
         $mOrderItem = Mage::getModel('sales/order_item')->load($_shipmentItem->getOrderItemId());
         $mProduct = Mage::getModel('catalog/product')->load($mOrderItem->getProductId());
         $cKey = $key;
         $aOrderItem[$cKey]['@nItem'] = ++$key;
         $aOrderItem[$cKey]['nfe.prod']['nfe.cProd'] = $_shipmentItem->getSku();
         $aOrderItem[$cKey]['nfe.prod']['nfe.cEAN'] = '';
         $aOrderItem[$cKey]['nfe.prod']['nfe.cEANTrib'] = '';
         $aOrderItem[$cKey]['nfe.prod']['nfe.xProd'] = trim($_shipmentItem->getName());
         $productPrice = $_shipmentItem->getPrice();
         $dDescTotal = 0;
         if ($mOrderItem->getDiscountAmount() > 0) {
             $dDescTotal = number_format($mOrderItem->getDiscountAmount() * ($_shipmentItem->getQty() / $mOrderItem->getQtyOrdered()), 2, '.', '');
         }
         $aOrderItem[$cKey]['nfe.prod']['nfe.vDesc'] = $dDescTotal;
         $diff = $mOrderShipment->getOrder()->getTotalPaid() - $mOrderShipment->getOrder()->getGrandTotal();
         $percent = $diff / $mOrderShipment->getOrder()->getGrandTotal();
         $productPrice = $productPrice * (1 + $percent);
         $aOrderItem[$cKey]['nfe.prod']['nfe.vProd'] = (string) number_format($productPrice * $_shipmentItem->getQty(), 2, '.', '');
         $aOrderItem[$cKey]['nfe.prod']['nfe.indTot'] = '1';
         /**
          * check CFOP code
          */
         $aOrderItem[$cKey]['nfe.prod']['nfe.CFOP'] = $this->getCustomerUf($mOrderShipment) == Mage::getStoreConfig('easynfe_nfe/emit/cuf') ? '5102' : '6108';
         $aOrderItem[$cKey]['nfe.prod']['nfe.NCM'] = (string) ($_shipmentItem->getNfeNcm() ? $_shipmentItem->getNfeNcm() : $mProduct->getNfeNcm());
         $aOrderItem[$cKey]['nfe.prod']['nfe.uCom'] = (string) ($_shipmentItem->getNfeUcom() ? $_shipmentItem->getNfeUcom() : $mProduct->getNfeUcom());
         $aOrderItem[$cKey]['nfe.prod']['nfe.qCom'] = (int) $_shipmentItem->getQty();
         $aOrderItem[$cKey]['nfe.prod']['nfe.vUnCom'] = (string) number_format($productPrice, 2, '.', '');
         $aOrderItem[$cKey]['nfe.prod']['nfe.uTrib'] = (string) ($_shipmentItem->getNfeUcom() ? $_shipmentItem->getNfeUcom() : $mProduct->getNfeUcom());
         $aOrderItem[$cKey]['nfe.prod']['nfe.qTrib'] = (int) $_shipmentItem->getQty();
         $aOrderItem[$cKey]['nfe.prod']['nfe.vUnTrib'] = (string) number_format($productPrice, 2, '.', '');
         $vFrete = 0;
         if ($arrFreteParcial[$cKey] > 0) {
             $vFrete = $arrFreteParcial[$cKey] * ($_shipmentItem->getQty() / $mOrderItem->getQtyOrdered()) * (1 + $percent);
             $aOrderItem[$cKey]['nfe.prod']['nfe.vFrete'] = (string) number_format($vFrete, 2, '.', '');
         }
         $vTotal = number_format($productPrice * $_shipmentItem->getQty(), 2, '.', '');
         /**
          * ICMS
          */
         $aOrderItem[$cKey]['nfe.imposto']['nfe.ICMS']['nfe.ICMSSN102']['nfe.orig'] = (string) ($_shipmentItem->getNfeOrig() ? $_shipmentItem->getNfeOrig() : '0');
         $aOrderItem[$cKey]['nfe.imposto']['nfe.ICMS']['nfe.ICMSSN102']['nfe.CSOSN'] = '102';
         /**
          * COFINS CST 99
          */
         $aOrderItem[$cKey]['nfe.imposto']['nfe.COFINS']['nfe.COFINSOutr']['nfe.CST'] = '99';
         $aOrderItem[$cKey]['nfe.imposto']['nfe.COFINS']['nfe.COFINSOutr']['nfe.vBC'] = '0';
         $aOrderItem[$cKey]['nfe.imposto']['nfe.COFINS']['nfe.COFINSOutr']['nfe.pCOFINS'] = '0';
         $aOrderItem[$cKey]['nfe.imposto']['nfe.COFINS']['nfe.COFINSOutr']['nfe.vCOFINS'] = '0';
         /**
          * PIS CST 99
          */
         $aOrderItem[$cKey]['nfe.imposto']['nfe.PIS']['nfe.PISOutr']['nfe.CST'] = '99';
         $aOrderItem[$cKey]['nfe.imposto']['nfe.PIS']['nfe.PISOutr']['nfe.vBC'] = '0';
         $aOrderItem[$cKey]['nfe.imposto']['nfe.PIS']['nfe.PISOutr']['nfe.pPIS'] = '0';
         $aOrderItem[$cKey]['nfe.imposto']['nfe.PIS']['nfe.PISOutr']['nfe.vPIS'] = '0';
         /**
          * sum items
          */
         $aOrderItem['nfe.total']['nfe.ICMSTot']['nfe.vProd'] += $vTotal;
         $aOrderItem['nfe.total']['nfe.ICMSTot']['nfe.vNF'] += $vTotal + $vFrete - $dDescTotal;
         $aOrderItem['nfe.total']['nfe.ICMSTot']['nfe.vDesc'] += $dDescTotal;
         if ($vFrete > 0) {
             $aOrderItem['nfe.total']['nfe.ICMSTot']['nfe.vFrete'] += $vFrete;
//.........这里部分代码省略.........
开发者ID:D12s11,项目名称:magento-easy-nfe-module,代码行数:101,代码来源:Nfe.php


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