Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function _saveShipment($shipment)
- {
- $shipment->getOrder()->setIsInProcess(true);
- $transactionSave = Mage::getModel('core/resource_transaction')
- ->addObject($shipment)
- ->addObject($shipment->getOrder())
- ->save();
- return $this;
- }
- /app/code/core/Mage/Sales/Model/Order
- $this->_setState(self::STATE_COMPLETE, true, '', $userNotification);
- protected function _checkState()
- {
- if (!$this->getId()) {
- return $this;
- }
- $userNotification = $this->hasCustomerNoteNotify() ? $this->getCustomerNoteNotify() : null;
- if (!$this->isCanceled()
- && !$this->canUnhold()
- && !$this->canInvoice()
- && !$this->canShip()) {
- if (0 == $this->getBaseGrandTotal() || $this->canCreditmemo()) {
- if ($this->getState() !== self::STATE_COMPLETE) {
- $this->_setState(self::STATE_COMPLETE, true, '', $userNotification);
- }
- }
- /**
- * Order can be closed just in case when we have refunded amount.
- * In case of "0" grand total order checking ForcedCanCreditmemo flag
- */
- elseif (floatval($this->getTotalRefunded()) || (!$this->getTotalRefunded()
- && $this->hasForcedCanCreditmemo())
- ) {
- if ($this->getState() !== self::STATE_CLOSED) {
- $this->_setState(self::STATE_CLOSED, true, '', $userNotification);
- }
- }
- }
- if ($this->getState() == self::STATE_NEW && $this->getIsInProcess()) {
- $this->setState(self::STATE_PROCESSING, true, '', $userNotification);
- }
- return $this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement