Skip to content

Commit

Permalink
blank spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
p-zamoroka committed Jul 17, 2017
1 parent fbd4309 commit 4370663
Show file tree
Hide file tree
Showing 56 changed files with 195 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected function _addColumns($columns)
);
}
}

return $this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function getHeaderText()
. $this->__('AvaTax Action Log Entry #%d', $this->getCurrentEvent()->getId())
. '</h3>';
}

return '<h3 class="icon-head" style="background-image:url('
. $this->getSkinUrl('images/fam_application_view_tile.gif') . ');">'
. $this->__('AvaTax Action Log Entry Details')
Expand All @@ -76,6 +77,7 @@ public function getCurrentEvent()
if (null === $this->_currentEevent) {
$this->_currentEevent = Mage::registry('current_event');
}

return $this->_currentEevent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ protected function _prepareColumns()
)
);

$this->addColumn('actions', array(
$this->addColumn(
'actions', array(
'header' => $this->__('Actions'),
'type' => 'action',
'getter' => 'getId',
Expand All @@ -95,7 +96,8 @@ protected function _prepareColumns()
'filter' => false,
'sortable' => false,
'renderer' => 'avatax/widget_grid_column_renderer_queueAction'
));
)
);

return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ protected function _htmlNotification()
if ($normalizeAddressDisabler) {
$checkboxDisabler = Mage::getBlockSingleton($this->_disablerBlockName)->toHtml();
}

if ($this->getAddress()->getAddressNormalized()) {
$notice = Mage::helper('avatax/config')->getOnepageNormalizeMessage(Mage::app()->getStore());
$notice .= $checkboxDisabler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function render(Varien_Object $row)
if ($row->getStatus() != OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED) {
return '';
}

return parent::render($row);
}
}
1 change: 1 addition & 0 deletions app/code/community/OnePica/AvaTax/Helper/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function getCustomerCode($object)
if ($object->getCustomerId()) {
$customer->load($object->getCustomerId());
}

// get store id from object or from quote
$storeId = $this->_getStoreIdFromSalesObject($object);

Expand Down
2 changes: 2 additions & 0 deletions app/code/community/OnePica/AvaTax/Helper/Errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function addErrorMessage($quote)
$error->setIdentifier(self::CALCULATE_ERROR_MESSAGE_IDENTIFIER);
$session->addMessage($error);
}

return $message;
}

Expand All @@ -83,6 +84,7 @@ public function removeErrorMessage()
/** @var Mage_Checkout_Model_Session $session */
$session = Mage::getSingleton('checkout/session');
}

/** @var Mage_Core_Model_Message_Collection $messages */
$messages = $session->getMessages();
$messages->deleteMessageByIdentifier(self::CALCULATE_ERROR_MESSAGE_IDENTIFIER);
Expand Down
4 changes: 4 additions & 0 deletions app/code/community/OnePica/AvaTax/Helper/Tax/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function getShippingTaxClass($store)
if (Mage::helper('avatax')->isServiceEnabled($store)) {
return self::AVATAX_SHIPPING_TAX_CLASS;
}

return parent::getShippingTaxClass($store);
}

Expand All @@ -54,6 +55,7 @@ public function getTaxBasedOn($store = null)
if (Mage::helper('avatax')->isServiceEnabled($store)) {
return 'shipping';
}

return parent::getTaxBasedOn($store);
}

Expand All @@ -68,6 +70,7 @@ public function applyTaxOnCustomPrice($store = null)
if (Mage::helper('avatax')->isServiceEnabled($store)) {
return true;
}

return parent::applyTaxOnCustomPrice($store);
}

Expand All @@ -82,6 +85,7 @@ public function applyTaxOnOriginalPrice($store = null)
if (Mage::helper('avatax')->isServiceEnabled($store)) {
return false;
}

return parent::applyTaxOnOriginalPrice($store);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public function getItemGiftTax($item)
if ($item->getParentItemId()) {
return 0;
}

$ratesData = $this->_getRates();
$id = $item->getId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function process($creditmemo, $queue)
'Collected: ' . $creditmemo->getTaxAmount() . ', Actual: ' . $totalTax
);
}

//if not successful
} else {
$messages = $creditmemoResult->getErrors();
Expand Down
1 change: 1 addition & 0 deletions app/code/community/OnePica/AvaTax/Model/Action/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function process($invoice, $queue)
'Collected: ' . $invoice->getBaseTaxAmount() . ', Actual: ' . $totalTax
);
}

//if not successful
} else {
$messages = $invoiceResult->getErrors();
Expand Down
3 changes: 3 additions & 0 deletions app/code/community/OnePica/AvaTax/Model/Action/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ public function validate($address)
if (!$isAddressValidationOn && !$isAddressNormalizationOn && !$isAddressActionable) {
return true;
}

if ($address->getPostcode() && $address->getPostcode() != '-') {
$checkFieldsResult = $this->_checkFields($quote->getStoreId());
if ($checkFieldsResult) {
return $checkFieldsResult;
}

$this->setStoreId($quote->getStoreId());
/** @var OnePica_AvaTax_Model_Service_Result_AddressValidate $result */
$result = $this->_getService()->validate($address);
Expand Down Expand Up @@ -197,6 +199,7 @@ protected function _checkFields($storeId = null)
$requiredFlag = 1;
}
}

if ($requiredFlag) {
$errors = array();
$errors[] = $this->__('Invalid ') . $this->__($field);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ public function setShippingAddress($address)
if ($this->getQuote()->getIsVirtual()) {
return $this;
}

if (!$this->_isAjaxRequest()) {
$this->_validateShippingAddress();
}

return $this;
}

Expand All @@ -61,6 +63,7 @@ protected function _validateShippingAddress()
if (!$this->_getDataHelper()->isServiceEnabled()) {
return $this;
}

$result = $this->getShippingAddress()->validate();
if ($result !== true) {
throw new OnePica_AvaTax_Exception(implode('<br />', $result));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ protected function _getExportQueries()
$content .= "\n" . implode(",\n", $chunk);
$content .= ";\n\n";
}

return $content;
}

Expand All @@ -115,8 +116,10 @@ protected function _getInsertValues()
foreach ($this->_getColumns() as $column) {
$values[] = $this->getCollection()->getResource()->getReadConnection()->quote($item->getData($column));
}

$rows[] = "(" . implode(", ", $values) . ")";
}

return $rows;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function getCollection()
if ($this->_collection === null) {
$this->_collection = $this->_getCollection();
}

return $this->_collection;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ protected function _handleTaxEstimationOnOrderPlace($quote)
if ($helper->fullStopOnError($quote)) {
throw new OnePica_AvaTax_Exception($helper->getErrorMessage());
}

return $this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ protected function _checkSslSupport()
if (isset($errors[$key])) {
unset($errors[$key]);
}

$errors[] = Mage::helper('avatax')->__(
'SSL must be enabled in PHP to use this extension. Typically, OpenSSL is used but it is not enabled on your server. This may not be a problem if you have some other form of SSL in place. For more information about OpenSSL, see %s.',
'<a href="http://www.php.net/manual/en/book.openssl.php" target="_blank">http://www.php.net/manual/en/book.openssl.php</a>'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ class OnePica_AvaTax_Model_Observer_ControllerActionPostdispatchCheckoutOnepageS
* @param Varien_Event_Observer $observer
* @return $this
*/
public function execute(Varien_Event_Observer $observer) {
public function execute(Varien_Event_Observer $observer)
{
if ($this->_getErrorsHelper()->fullStopOnError($this->_getQuote())) {
Mage::app()
->getResponse()
->setBody($this->_getResponseErrorMessage());
}

return $this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function execute(Varien_Event_Observer $observer)
if ($address->validate() !== true) {
$errors[] = sprintf($message, $address->format('oneline'));
}

if ($address->getAddressNormalized()) {
$notice = Mage::getStoreConfig('tax/avatax/multiaddress_normalize_message', $storeId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function execute(Varien_Event_Observer $observer)
->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_PENDING)
->save();
}

return $this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function execute(Varien_Event_Observer $observer)
if (Mage::registry('avatax_store_id')) {
Mage::unregister('avatax_store_id');
}

Mage::register('avatax_store_id', $storeId);
return $this;
}
Expand Down
1 change: 1 addition & 0 deletions app/code/community/OnePica/AvaTax/Model/Records/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function setAdditional($value = null)
print_r($value, true)
);
}

$this->setData('additional', $value);

return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object)
if ($object->getLevel() != OnePica_AvaTax_Model_Records_Log::LOG_LEVEL_SUCCESS) {
$object->setLevel(OnePica_AvaTax_Model_Records_Log::LOG_LEVEL_ERROR);
}

return $this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object)
if (!$object->hasCreatedAt()) {
$object->setCreatedAt($this->_getDateModel()->gmtDate('Y-m-d H:i:s'));
}

$object->setUpdatedAt($this->_getDateModel()->gmtDate('Y-m-d H:i:s'));
return $this;
}
Expand Down Expand Up @@ -104,6 +105,7 @@ protected function _logAction(Mage_Core_Model_Abstract $object, $result)
->save();
}
}

return $this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected function _getStoresWithEnabledQueueSubmit()
$stores[] = $store->getStoreId();
}
}

$this->_storesWithEnabledQueueSubmit = $stores;
}

Expand Down Expand Up @@ -206,6 +207,7 @@ protected function _parseInvoices()
if ($invoice->getId()) {
$invoiceAction->process($invoice, $item);
}

$item->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE)->setMessage(null)->save();
} catch (OnePica_AvaTax_Model_Service_Exception_Unbalanced $e) {
$item->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_UNBALANCED)
Expand Down Expand Up @@ -250,6 +252,7 @@ protected function _parseCreditMemos()
if ($creditmemo->getId()) {
$creditmemoAction->process($creditmemo, $item);
}

$item->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE)
->setMessage(null)
->save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function getCacheHashKey()
if (!$this->getData('cache_hash_key')) {
$this->setData('cache_hash_key', hash('md4', $this->format('text')));
}

return $this->getData('cache_hash_key');
}
/**
Expand Down Expand Up @@ -137,6 +138,7 @@ public function setTotalAmount($code, $amount)
if ($code != 'subtotal') {
$code = $code . '_amount';
}

$this->setData($code, $amount);
return $this;
}
Expand All @@ -154,6 +156,7 @@ public function setBaseTotalAmount($code, $amount)
if ($code != 'subtotal') {
$code = $code . '_amount';
}

$this->setData('base_' . $code, $amount);
return $this;
}
Expand All @@ -169,6 +172,7 @@ public function getTotalAmount($code)
if (isset($this->_totalAmounts[$code])) {
return $this->_totalAmounts[$code];
}

return 0;
}

Expand All @@ -183,6 +187,7 @@ public function getBaseTotalAmount($code)
if (isset($this->_baseTotalAmounts[$code])) {
return $this->_baseTotalAmounts[$code];
}

return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ protected function _setTaxForItems(Mage_Sales_Model_Quote_Address $address, $ite
if ($address->getQuote()->getTaxesForItems()) {
$itemTaxGroups += $address->getQuote()->getTaxesForItems();
}

$address->getQuote()->setTaxesForItems($itemTaxGroups);

return $this;
Expand Down Expand Up @@ -495,7 +496,8 @@ protected function _addSubtotalAmount(Mage_Sales_Model_Quote_Address $address, $
$address->setBaseTotalAmount('subtotal', $address->getBaseTotalAmount('subtotal') + $baseSubTotal);
} else {
$address->setTotalAmount('subtotal', $address->getTotalAmount('subtotal') + $item->getRowTotal());
$address->setBaseTotalAmount('subtotal',
$address->setBaseTotalAmount(
'subtotal',
$address->getBaseTotalAmount('subtotal') + $item->getBaseRowTotal()
);
}
Expand Down
2 changes: 2 additions & 0 deletions app/code/community/OnePica/AvaTax/Model/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public function factory($service, array $options = array())
if (!$service) {
throw new OnePica_AvaTax_Exception('Service name is not defined.');
}

$model = $this->getSingleton(self::XML_PATH_INDEX_INDEX_MODEL . $service, $options);
if (!$model) {
throw new OnePica_AvaTax_Exception('Could not found service model ' . $service);
}

return $model;
}
}
Loading

0 comments on commit 4370663

Please sign in to comment.