Version Notes
- Added support for Canadian addresses
- Deliveryterm SUP added for Canadian addresses
- Added ability to set International company address at the System->Configuration->Tax
- Tax Jurisdiction request used only for addresses from USA
- Added country field for each request
Please select your country after extension updated at the System->Configuration->Tax->VertexSMB Company Information
Download this release
Release Info
| Developer | Vertex SMB |
| Extension | VertexSMB_TaxCE |
| Version | 1.1.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.5 to 1.1.6
- app/code/local/VertexSMB/TaxCE/Helper/Config.php +1 -1
- app/code/local/VertexSMB/TaxCE/Helper/Data.php +36 -7
- app/code/local/VertexSMB/TaxCE/Model/RequestItem.php +13 -5
- app/code/local/VertexSMB/TaxCE/Model/Source/Usregions.php +0 -50
- app/code/local/VertexSMB/TaxCE/Model/Tax/Sales/Total/Quote/Tax.php +1 -1
- app/code/local/VertexSMB/TaxCE/Model/VertexSMB.php +2 -1
- app/code/local/VertexSMB/TaxCE/controllers/OnepageController.php +7 -0
- app/code/local/VertexSMB/TaxCE/controllers/VertexSMBController.php +7 -0
- app/code/local/VertexSMB/TaxCE/etc/config.xml +1 -1
- app/code/local/VertexSMB/TaxCE/etc/system.xml +16 -6
- package.xml +11 -5
app/code/local/VertexSMB/TaxCE/Helper/Config.php
CHANGED
|
@@ -39,7 +39,7 @@ class VertexSMB_TaxCE_Helper_Config extends Mage_Core_Helper_Abstract {
|
|
| 39 |
const VERTEX_PRINTED_GIFTCARD_CODE='tax/classes/printed_giftcard_code';
|
| 40 |
const CONFIG_XML_PATH_VERTEX_ALLOW_CART_QUOTE = 'tax/vertexsmb_settings/allow_cart_request';
|
| 41 |
const CONFIG_XML_PATH_VERTEX_SHOW_MANUAL_BUTTON = 'tax/vertexsmb_settings/show_manual_button';
|
| 42 |
-
|
| 43 |
|
| 44 |
public function getQuoteAllowedControllers(){
|
| 45 |
$_quote_allowed_controllers=array('onepage','multishipping','sales_order_create');
|
| 39 |
const VERTEX_PRINTED_GIFTCARD_CODE='tax/classes/printed_giftcard_code';
|
| 40 |
const CONFIG_XML_PATH_VERTEX_ALLOW_CART_QUOTE = 'tax/vertexsmb_settings/allow_cart_request';
|
| 41 |
const CONFIG_XML_PATH_VERTEX_SHOW_MANUAL_BUTTON = 'tax/vertexsmb_settings/show_manual_button';
|
| 42 |
+
const CONFIG_XML_PATH_VERTEX_SHOW_POPUP= 'tax/vertexsmb_settings/show_tarequest_popup';
|
| 43 |
|
| 44 |
public function getQuoteAllowedControllers(){
|
| 45 |
$_quote_allowed_controllers=array('onepage','multishipping','sales_order_create');
|
app/code/local/VertexSMB/TaxCE/Helper/Data.php
CHANGED
|
@@ -27,6 +27,9 @@ class VertexSMB_TaxCE_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 27 |
public function getCompanyCity(){
|
| 28 |
return Mage::getStoreConfig(VertexSMB_TaxCE_Helper_Config::CONFIG_XML_PATH_VERTEX_CITY, Mage::app()->getStore()->getId());
|
| 29 |
}
|
|
|
|
|
|
|
|
|
|
| 30 |
public function getCompanyRegionId(){
|
| 31 |
return Mage::getStoreConfig(VertexSMB_TaxCE_Helper_Config::CONFIG_XML_PATH_VERTEX_REGION, Mage::app()->getStore()->getId());
|
| 32 |
}
|
|
@@ -167,7 +170,9 @@ class VertexSMB_TaxCE_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 167 |
return "Not Valid: Missing Trusted Id";
|
| 168 |
if (!$this->getCompanyRegionId())
|
| 169 |
return "Not Valid: Missing Company State";
|
| 170 |
-
if (!$this->
|
|
|
|
|
|
|
| 171 |
return "Not Valid: Missing Company Street Address";
|
| 172 |
if (!$this->getCompanyCity())
|
| 173 |
return "Not Valid: Missing Company City";
|
|
@@ -175,8 +180,15 @@ class VertexSMB_TaxCE_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 175 |
return "Not Valid: Missing Company Postal Code";
|
| 176 |
|
| 177 |
$region_id=$this->getCompanyRegionId();
|
| 178 |
-
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
/*Admin API verification*/
|
| 182 |
$address=new Varien_Object();
|
|
@@ -186,7 +198,9 @@ class VertexSMB_TaxCE_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 186 |
$address->setRegionCode($company_state);
|
| 187 |
$address->setPostcode($this->getCompanyPostalCode());
|
| 188 |
|
| 189 |
-
|
|
|
|
|
|
|
| 190 |
$request_result=Mage::getModel('taxce/TaxAreaRequest')->prepareRequest($address)->taxAreaLookup();
|
| 191 |
if ($request_result instanceof Exception) {
|
| 192 |
return "Address Validation Error: Please check settings";
|
|
@@ -199,9 +213,16 @@ class VertexSMB_TaxCE_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 199 |
public function AddSellerInformation($data){
|
| 200 |
|
| 201 |
$region_id=$this->getCompanyRegionId();
|
| 202 |
-
|
| 203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
|
|
|
|
|
|
|
|
|
| 205 |
$data['location_code']=$this->getLocationCode();
|
| 206 |
$data['transaction_type']=$this->getTransactionType();
|
| 207 |
$data['company_id']=$this->getCompanyCode();
|
|
@@ -210,6 +231,9 @@ class VertexSMB_TaxCE_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 210 |
$data['company_city']=$this->getCompanyCity();
|
| 211 |
$data['company_state']=$company_state;
|
| 212 |
$data['company_postcode']=$this->getCompanyPostalCode();
|
|
|
|
|
|
|
|
|
|
| 213 |
$data['trusted_id']= $this->getTrustedId();
|
| 214 |
|
| 215 |
return $data;
|
|
@@ -220,7 +244,12 @@ class VertexSMB_TaxCE_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 220 |
$data['customer_street2'] = $address->getStreet2();
|
| 221 |
$data['customer_city'] = $address->getCity();
|
| 222 |
$data['customer_region'] = $address->getRegionCode();
|
| 223 |
-
$data['customer_postcode'] = $address->getPostcode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
$data['tax_area_id'] = $address->getTaxAreaId();
|
| 225 |
return $data;
|
| 226 |
}
|
| 27 |
public function getCompanyCity(){
|
| 28 |
return Mage::getStoreConfig(VertexSMB_TaxCE_Helper_Config::CONFIG_XML_PATH_VERTEX_CITY, Mage::app()->getStore()->getId());
|
| 29 |
}
|
| 30 |
+
public function getCompanyCountry(){
|
| 31 |
+
return Mage::getStoreConfig(VertexSMB_TaxCE_Helper_Config::CONFIG_XML_PATH_VERTEX_COUNTRY, Mage::app()->getStore()->getId());
|
| 32 |
+
}
|
| 33 |
public function getCompanyRegionId(){
|
| 34 |
return Mage::getStoreConfig(VertexSMB_TaxCE_Helper_Config::CONFIG_XML_PATH_VERTEX_REGION, Mage::app()->getStore()->getId());
|
| 35 |
}
|
| 170 |
return "Not Valid: Missing Trusted Id";
|
| 171 |
if (!$this->getCompanyRegionId())
|
| 172 |
return "Not Valid: Missing Company State";
|
| 173 |
+
if (!$this->getCompanyCountry())
|
| 174 |
+
return "Not Valid: Missing Company Country";
|
| 175 |
+
if (!$this->getCompanyStreet1())
|
| 176 |
return "Not Valid: Missing Company Street Address";
|
| 177 |
if (!$this->getCompanyCity())
|
| 178 |
return "Not Valid: Missing Company City";
|
| 180 |
return "Not Valid: Missing Company Postal Code";
|
| 181 |
|
| 182 |
$region_id=$this->getCompanyRegionId();
|
| 183 |
+
if (is_int($region_id)) {
|
| 184 |
+
$regionModel = Mage::getModel('directory/region')->load($region_id);
|
| 185 |
+
$company_state=$regionModel->getCode();
|
| 186 |
+
} else {
|
| 187 |
+
$company_state=$region_id;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
$countryModel=Mage::getModel('directory/country')->load($this->getCompanyCountry());
|
| 191 |
+
$countryName = $countryModel->getIso3Code();
|
| 192 |
|
| 193 |
/*Admin API verification*/
|
| 194 |
$address=new Varien_Object();
|
| 198 |
$address->setRegionCode($company_state);
|
| 199 |
$address->setPostcode($this->getCompanyPostalCode());
|
| 200 |
|
| 201 |
+
if ($countryName!='USA')
|
| 202 |
+
return "Valid";
|
| 203 |
+
|
| 204 |
$request_result=Mage::getModel('taxce/TaxAreaRequest')->prepareRequest($address)->taxAreaLookup();
|
| 205 |
if ($request_result instanceof Exception) {
|
| 206 |
return "Address Validation Error: Please check settings";
|
| 213 |
public function AddSellerInformation($data){
|
| 214 |
|
| 215 |
$region_id=$this->getCompanyRegionId();
|
| 216 |
+
if (is_int($region_id)) {
|
| 217 |
+
$regionModel = Mage::getModel('directory/region')->load($region_id);
|
| 218 |
+
$company_state=$regionModel->getCode();
|
| 219 |
+
} else {
|
| 220 |
+
$company_state=$region_id;
|
| 221 |
+
}
|
| 222 |
|
| 223 |
+
$countryModel=Mage::getModel('directory/country')->load($this->getCompanyCountry());
|
| 224 |
+
$countryName = $countryModel->getIso3Code();
|
| 225 |
+
|
| 226 |
$data['location_code']=$this->getLocationCode();
|
| 227 |
$data['transaction_type']=$this->getTransactionType();
|
| 228 |
$data['company_id']=$this->getCompanyCode();
|
| 231 |
$data['company_city']=$this->getCompanyCity();
|
| 232 |
$data['company_state']=$company_state;
|
| 233 |
$data['company_postcode']=$this->getCompanyPostalCode();
|
| 234 |
+
|
| 235 |
+
$data['company_country'] =$countryName;
|
| 236 |
+
|
| 237 |
$data['trusted_id']= $this->getTrustedId();
|
| 238 |
|
| 239 |
return $data;
|
| 244 |
$data['customer_street2'] = $address->getStreet2();
|
| 245 |
$data['customer_city'] = $address->getCity();
|
| 246 |
$data['customer_region'] = $address->getRegionCode();
|
| 247 |
+
$data['customer_postcode'] = $address->getPostcode();
|
| 248 |
+
|
| 249 |
+
$countryModel=Mage::getModel('directory/country')->load($address->getCountryId());
|
| 250 |
+
$countryName = $countryModel->getIso3Code();
|
| 251 |
+
$data['customer_country'] =$countryName;
|
| 252 |
+
|
| 253 |
$data['tax_area_id'] = $address->getTaxAreaId();
|
| 254 |
return $data;
|
| 255 |
}
|
app/code/local/VertexSMB/TaxCE/Model/RequestItem.php
CHANGED
|
@@ -29,10 +29,12 @@
|
|
| 29 |
'documentDate'=>$this->getDocumentDate(),
|
| 30 |
'postingDate'=>$this->getPostingDate(),
|
| 31 |
'transactionType'=>$this->getTransactionType(),
|
| 32 |
-
'documentNumber' => $this->getDocumentNumber(),
|
| 33 |
-
'LineItem'=> array()
|
|
|
|
| 34 |
)
|
| 35 |
);
|
|
|
|
| 36 |
if ($this->getDocumentNumber())
|
| 37 |
$request[$this->getRequestType()]['documentNumber']=$this->getDocumentNumber();
|
| 38 |
|
|
@@ -49,13 +51,14 @@
|
|
| 49 |
$i=1; /* lineItemNumber */
|
| 50 |
foreach($items as $key=>$item){
|
| 51 |
/* $key - quote_item_id */
|
| 52 |
-
$tmp_item=array('lineItemNumber'=>$i,'lineItemId'=>$key,
|
| 53 |
'Seller'=> array (
|
| 54 |
'Company'=> $this->getCompanyId(),
|
| 55 |
'PhysicalOrigin'=>array(
|
| 56 |
'StreetAddress1'=>$this->getData('company_street_1'),
|
| 57 |
'StreetAddress2'=>$this->getData('company_street_2'),
|
| 58 |
'City'=>$this->getCompanyCity(),
|
|
|
|
| 59 |
'MainDivision'=>$this->getCompanyState(),
|
| 60 |
'PostalCode'=>$this->getCompanyPostcode())
|
| 61 |
),
|
|
@@ -66,14 +69,19 @@
|
|
| 66 |
'StreetAddress2'=>$this->getCustomerStreet2(),
|
| 67 |
'City'=>$this->getCustomerCity(),
|
| 68 |
'MainDivision'=>$this->getCustomerRegion(),
|
| 69 |
-
'PostalCode'=>$this->getCustomerPostcode()
|
| 70 |
-
|
|
|
|
| 71 |
),
|
| 72 |
'Product' => array ('productClass'=>$item['product_class'],'_'=>$item['product_code']),
|
| 73 |
'UnitPrice' => array('_'=>$item['price']),
|
| 74 |
'Quantity' => array('_'=>$item['qty']),
|
| 75 |
'ExtendedPrice'=> array('_'=>$item['extended_price']),
|
| 76 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
if ($this->getTaxAreaId())
|
| 79 |
$tmp_item['Customer']['Destination']['taxAreaId']=$this->getTaxAreaId();
|
| 29 |
'documentDate'=>$this->getDocumentDate(),
|
| 30 |
'postingDate'=>$this->getPostingDate(),
|
| 31 |
'transactionType'=>$this->getTransactionType(),
|
| 32 |
+
'documentNumber' => $this->getDocumentNumber(),
|
| 33 |
+
'LineItem'=> array(),
|
| 34 |
+
|
| 35 |
)
|
| 36 |
);
|
| 37 |
+
|
| 38 |
if ($this->getDocumentNumber())
|
| 39 |
$request[$this->getRequestType()]['documentNumber']=$this->getDocumentNumber();
|
| 40 |
|
| 51 |
$i=1; /* lineItemNumber */
|
| 52 |
foreach($items as $key=>$item){
|
| 53 |
/* $key - quote_item_id */
|
| 54 |
+
$tmp_item=array('lineItemNumber'=>$i,'lineItemId'=>$key, 'locationCode'=>$this->getLocationCode(),
|
| 55 |
'Seller'=> array (
|
| 56 |
'Company'=> $this->getCompanyId(),
|
| 57 |
'PhysicalOrigin'=>array(
|
| 58 |
'StreetAddress1'=>$this->getData('company_street_1'),
|
| 59 |
'StreetAddress2'=>$this->getData('company_street_2'),
|
| 60 |
'City'=>$this->getCompanyCity(),
|
| 61 |
+
'Country'=>$this->getCompanyCountry(),
|
| 62 |
'MainDivision'=>$this->getCompanyState(),
|
| 63 |
'PostalCode'=>$this->getCompanyPostcode())
|
| 64 |
),
|
| 69 |
'StreetAddress2'=>$this->getCustomerStreet2(),
|
| 70 |
'City'=>$this->getCustomerCity(),
|
| 71 |
'MainDivision'=>$this->getCustomerRegion(),
|
| 72 |
+
'PostalCode'=>$this->getCustomerPostcode(),
|
| 73 |
+
'Country'=> $this->getCustomerCountry(),
|
| 74 |
+
),
|
| 75 |
),
|
| 76 |
'Product' => array ('productClass'=>$item['product_class'],'_'=>$item['product_code']),
|
| 77 |
'UnitPrice' => array('_'=>$item['price']),
|
| 78 |
'Quantity' => array('_'=>$item['qty']),
|
| 79 |
'ExtendedPrice'=> array('_'=>$item['extended_price']),
|
| 80 |
);
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
if ($this->getCustomerCountry()=='CAN')
|
| 84 |
+
$tmp_item['deliveryTerm']='SUP';
|
| 85 |
|
| 86 |
if ($this->getTaxAreaId())
|
| 87 |
$tmp_item['Customer']['Destination']['taxAreaId']=$this->getTaxAreaId();
|
app/code/local/VertexSMB/TaxCE/Model/Source/Usregions.php
DELETED
|
@@ -1,50 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* @package VertexSMB_TaxCE
|
| 4 |
-
* @license http://opensource.org/licenses/OSL-3.0 The Open Software License 3.0 (OSL 3.0)
|
| 5 |
-
* @author Alex Lukyanau
|
| 6 |
-
**/
|
| 7 |
-
|
| 8 |
-
class VertexSMB_TaxCE_Model_Source_Usregions {
|
| 9 |
-
|
| 10 |
-
protected $_countries;
|
| 11 |
-
protected $_options;
|
| 12 |
-
|
| 13 |
-
public function toOptionArray($isMultiselect=false)
|
| 14 |
-
{
|
| 15 |
-
if (!$this->_options) {
|
| 16 |
-
$countriesArray = Mage::getResourceModel('directory/country_collection')->addCountryIdFilter('US')->load()
|
| 17 |
-
->toOptionArray(false);
|
| 18 |
-
|
| 19 |
-
$this->_countries = array();
|
| 20 |
-
foreach ($countriesArray as $a) {
|
| 21 |
-
$this->_countries[$a['value']] = $a['label'];
|
| 22 |
-
}
|
| 23 |
-
|
| 24 |
-
$countryRegions = array();
|
| 25 |
-
$regionsCollection = Mage::getResourceModel('directory/region_collection')->addCountryFilter('US')->load();
|
| 26 |
-
foreach ($regionsCollection as $region) {
|
| 27 |
-
$countryRegions[$region->getCountryId()][$region->getId()] = $region->getDefaultName();
|
| 28 |
-
}
|
| 29 |
-
uksort($countryRegions, array($this, 'sortRegionCountries'));
|
| 30 |
-
|
| 31 |
-
$this->_options = array();
|
| 32 |
-
foreach ($countryRegions as $countryId=>$regions) {
|
| 33 |
-
$regionOptions = array();
|
| 34 |
-
foreach ($regions as $regionId=>$regionName) {
|
| 35 |
-
$regionOptions[] = array('label'=>$regionName, 'value'=>$regionId);
|
| 36 |
-
}
|
| 37 |
-
$this->_options[] = array('label'=>$this->_countries[$countryId], 'value'=>$regionOptions);
|
| 38 |
-
}
|
| 39 |
-
}
|
| 40 |
-
$options = $this->_options;
|
| 41 |
-
|
| 42 |
-
return $options;
|
| 43 |
-
}
|
| 44 |
-
|
| 45 |
-
public function sortRegionCountries($a, $b)
|
| 46 |
-
{
|
| 47 |
-
return strcmp($this->_countries[$a], $this->_countries[$b]);
|
| 48 |
-
}
|
| 49 |
-
|
| 50 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/VertexSMB/TaxCE/Model/Tax/Sales/Total/Quote/Tax.php
CHANGED
|
@@ -44,7 +44,7 @@ class VertexSMB_TaxCE_Model_Tax_Sales_Total_Quote_Tax extends Mage_Tax_Model_Sal
|
|
| 44 |
return $this;
|
| 45 |
}
|
| 46 |
|
| 47 |
-
if (!$address->getCountryId() || !$address->
|
| 48 |
Mage_Sales_Model_Quote_Address_Total_Abstract::collect($address);
|
| 49 |
Mage::log("Quote request was not sent. Address not specified. ", null, 'vertexsmb.log');
|
| 50 |
return $this;
|
| 44 |
return $this;
|
| 45 |
}
|
| 46 |
|
| 47 |
+
if (!$address->getCountryId() || !$address->getRegion() || !$address->getPostcode() || !count($address->getAllNonNominalItems())) {
|
| 48 |
Mage_Sales_Model_Quote_Address_Total_Abstract::collect($address);
|
| 49 |
Mage::log("Quote request was not sent. Address not specified. ", null, 'vertexsmb.log');
|
| 50 |
return $this;
|
app/code/local/VertexSMB/TaxCE/Model/VertexSMB.php
CHANGED
|
@@ -19,7 +19,7 @@ class VertexSMB_TaxCE_Model_VertexSMB extends Mage_Core_Model_Abstract {
|
|
| 19 |
* @return Exception|unknown
|
| 20 |
*/
|
| 21 |
public function SendApiRequest($request,$order=null, $type) {
|
| 22 |
-
|
| 23 |
$object_id=null;
|
| 24 |
if (strpos($type,'invoice')===0)
|
| 25 |
$object_id=$order->getId();
|
|
@@ -37,6 +37,7 @@ class VertexSMB_TaxCE_Model_VertexSMB extends Mage_Core_Model_Abstract {
|
|
| 37 |
|
| 38 |
$client = new SoapClient($api_url, array('connection_timeout' => 300,'trace' => true, 'soap_version' => SOAP_1_1));
|
| 39 |
|
|
|
|
| 40 |
if ($type=='tax_area_lookup')
|
| 41 |
$tax_request_result = $client->LookupTaxAreas60($request);
|
| 42 |
else
|
| 19 |
* @return Exception|unknown
|
| 20 |
*/
|
| 21 |
public function SendApiRequest($request,$order=null, $type) {
|
| 22 |
+
|
| 23 |
$object_id=null;
|
| 24 |
if (strpos($type,'invoice')===0)
|
| 25 |
$object_id=$order->getId();
|
| 37 |
|
| 38 |
$client = new SoapClient($api_url, array('connection_timeout' => 300,'trace' => true, 'soap_version' => SOAP_1_1));
|
| 39 |
|
| 40 |
+
|
| 41 |
if ($type=='tax_area_lookup')
|
| 42 |
$tax_request_result = $client->LookupTaxAreas60($request);
|
| 43 |
else
|
app/code/local/VertexSMB/TaxCE/controllers/OnepageController.php
CHANGED
|
@@ -162,6 +162,13 @@ class VertexSMB_TaxCE_OnepageController extends Mage_Checkout_OnepageController
|
|
| 162 |
}
|
| 163 |
|
| 164 |
public function saveTaxAreaId($address){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
$TaxAreaModel=Mage::getModel('taxce/TaxAreaRequest');
|
| 166 |
$request_result=$TaxAreaModel->prepareRequest($address)->taxAreaLookup();
|
| 167 |
$address_changed=false;
|
| 162 |
}
|
| 163 |
|
| 164 |
public function saveTaxAreaId($address){
|
| 165 |
+
|
| 166 |
+
/*Other Countries*/
|
| 167 |
+
if ($address->getCountryId()!='USA') {
|
| 168 |
+
return true;
|
| 169 |
+
}
|
| 170 |
+
/*Other Countries*/
|
| 171 |
+
|
| 172 |
$TaxAreaModel=Mage::getModel('taxce/TaxAreaRequest');
|
| 173 |
$request_result=$TaxAreaModel->prepareRequest($address)->taxAreaLookup();
|
| 174 |
$address_changed=false;
|
app/code/local/VertexSMB/TaxCE/controllers/VertexSMBController.php
CHANGED
|
@@ -62,6 +62,13 @@ class VertexSMB_TaxCE_VertexSMBController extends Mage_Adminhtml_Controller_Acti
|
|
| 62 |
|
| 63 |
$order_post=$this->getRequest()->getPost('order');
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
$TaxAreaModel=Mage::getModel('taxce/TaxAreaRequest');
|
| 66 |
$request_result=$TaxAreaModel->prepareRequest($address)->taxAreaLookup();
|
| 67 |
if ($request_result instanceof Exception) {
|
| 62 |
|
| 63 |
$order_post=$this->getRequest()->getPost('order');
|
| 64 |
|
| 65 |
+
/*Other Countries*/
|
| 66 |
+
if ($address->getCountryId()!='USA') {
|
| 67 |
+
$result['message']='not_usa_address';
|
| 68 |
+
echo Mage::app()->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
| 69 |
+
exit();
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
$TaxAreaModel=Mage::getModel('taxce/TaxAreaRequest');
|
| 73 |
$request_result=$TaxAreaModel->prepareRequest($address)->taxAreaLookup();
|
| 74 |
if ($request_result instanceof Exception) {
|
app/code/local/VertexSMB/TaxCE/etc/config.xml
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<config>
|
| 10 |
<modules>
|
| 11 |
<VertexSMB_TaxCE>
|
| 12 |
-
<version>1.1.
|
| 13 |
</VertexSMB_TaxCE>
|
| 14 |
</modules>
|
| 15 |
<global>
|
| 9 |
<config>
|
| 10 |
<modules>
|
| 11 |
<VertexSMB_TaxCE>
|
| 12 |
+
<version>1.1.6</version>
|
| 13 |
</VertexSMB_TaxCE>
|
| 14 |
</modules>
|
| 15 |
<global>
|
app/code/local/VertexSMB/TaxCE/etc/system.xml
CHANGED
|
@@ -196,21 +196,31 @@
|
|
| 196 |
<show_in_default>1</show_in_default>
|
| 197 |
<show_in_website>1</show_in_website>
|
| 198 |
<show_in_store>1</show_in_store>
|
| 199 |
-
</city>
|
| 200 |
-
<
|
| 201 |
-
<label>Company
|
| 202 |
<frontend_type>select</frontend_type>
|
| 203 |
-
<
|
|
|
|
| 204 |
<sort_order>60</sort_order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
<comment><![CDATA[The proper name or the postal abbreviation of the state, province, or territory used to determine Tax Jurisdiction(s)]]></comment>
|
| 206 |
<show_in_default>1</show_in_default>
|
| 207 |
<show_in_website>1</show_in_website>
|
| 208 |
<show_in_store>1</show_in_store>
|
| 209 |
-
</region_id>
|
| 210 |
<postalCode translate="label">
|
| 211 |
<label>Company Postal Code</label>
|
| 212 |
<frontend_type>text</frontend_type>
|
| 213 |
-
<sort_order>
|
| 214 |
<comment><![CDATA[The postal code used to determine Tax Jurisdiction(s)]]></comment>
|
| 215 |
<show_in_default>1</show_in_default>
|
| 216 |
<show_in_website>1</show_in_website>
|
| 196 |
<show_in_default>1</show_in_default>
|
| 197 |
<show_in_website>1</show_in_website>
|
| 198 |
<show_in_store>1</show_in_store>
|
| 199 |
+
</city>
|
| 200 |
+
<country_id translate="label">
|
| 201 |
+
<label>Company Country</label>
|
| 202 |
<frontend_type>select</frontend_type>
|
| 203 |
+
<frontend_class>countries</frontend_class>
|
| 204 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
| 205 |
<sort_order>60</sort_order>
|
| 206 |
+
<comment><![CDATA[The country used to determine the Tax Jurisdiction(s)]]></comment>
|
| 207 |
+
<show_in_default>1</show_in_default>
|
| 208 |
+
<show_in_website>1</show_in_website>
|
| 209 |
+
<show_in_store>1</show_in_store>
|
| 210 |
+
</country_id>
|
| 211 |
+
<region_id translate="label">
|
| 212 |
+
<label>Company State</label>
|
| 213 |
+
<frontend_type>text</frontend_type>
|
| 214 |
+
<sort_order>70</sort_order>
|
| 215 |
<comment><![CDATA[The proper name or the postal abbreviation of the state, province, or territory used to determine Tax Jurisdiction(s)]]></comment>
|
| 216 |
<show_in_default>1</show_in_default>
|
| 217 |
<show_in_website>1</show_in_website>
|
| 218 |
<show_in_store>1</show_in_store>
|
| 219 |
+
</region_id>
|
| 220 |
<postalCode translate="label">
|
| 221 |
<label>Company Postal Code</label>
|
| 222 |
<frontend_type>text</frontend_type>
|
| 223 |
+
<sort_order>80</sort_order>
|
| 224 |
<comment><![CDATA[The postal code used to determine Tax Jurisdiction(s)]]></comment>
|
| 225 |
<show_in_default>1</show_in_default>
|
| 226 |
<show_in_website>1</show_in_website>
|
package.xml
CHANGED
|
@@ -1,18 +1,24 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>VertexSMB_TaxCE</name>
|
| 4 |
-
<version>1.1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/OSL-3.0">OSL 3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Sales and Use Tax Automation</summary>
|
| 10 |
<description>Built on industry-leading Vertex software, Vertex SMB offers a proven, accurate, and simple sales and use tax solution for small to medium-sized businesses that integrates directly with Magento. This cloud-based, scalable solution allows customers to manage complex sales and use tax across multiple jurisdictions and states. Vertex SMB runs on a pay-as-you-go pricing model with no upfront fees, and provides tax calculations and returns in one comprehensive solution, resulting in signature-ready PDF returns at no additional charge.</description>
|
| 11 |
-
<notes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
<authors><author><name>Vertex SMB</name><user>VertexSMB</user><email>support@vertexSMB.com</email></author></authors>
|
| 13 |
-
<date>2015-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magelocal"><dir name="VertexSMB"><dir name="TaxCE"><dir name="Block"><dir name="Adminhtml"><dir name="Order"><file name="View.php" hash="4398798a0e8bb691b5355ed614775223"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="ShippingCodes.php" hash="e281a250118dbc5d0f3d9f68adbcafb5"/><file name="VertexSMBStatus.php" hash="9de3aa176e27f26af6348924ed871d21"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Config.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>VertexSMB_TaxCE</name>
|
| 4 |
+
<version>1.1.6</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/OSL-3.0">OSL 3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Sales and Use Tax Automation</summary>
|
| 10 |
<description>Built on industry-leading Vertex software, Vertex SMB offers a proven, accurate, and simple sales and use tax solution for small to medium-sized businesses that integrates directly with Magento. This cloud-based, scalable solution allows customers to manage complex sales and use tax across multiple jurisdictions and states. Vertex SMB runs on a pay-as-you-go pricing model with no upfront fees, and provides tax calculations and returns in one comprehensive solution, resulting in signature-ready PDF returns at no additional charge.</description>
|
| 11 |
+
<notes>- Added support for Canadian addresses
|
| 12 |
+
- Deliveryterm SUP added for Canadian addresses
|
| 13 |
+
- Added ability to set International company address at the System->Configuration->Tax
|
| 14 |
+
- Tax Jurisdiction request used only for addresses from USA
|
| 15 |
+
- Added country field for each request
|
| 16 |
+

|
| 17 |
+
Please select your country after extension updated at the System->Configuration->Tax->VertexSMB Company Information</notes>
|
| 18 |
<authors><author><name>Vertex SMB</name><user>VertexSMB</user><email>support@vertexSMB.com</email></author></authors>
|
| 19 |
+
<date>2015-11-09</date>
|
| 20 |
+
<time>22:05:20</time>
|
| 21 |
+
<contents><target name="magelocal"><dir name="VertexSMB"><dir name="TaxCE"><dir name="Block"><dir name="Adminhtml"><dir name="Order"><file name="View.php" hash="4398798a0e8bb691b5355ed614775223"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="ShippingCodes.php" hash="e281a250118dbc5d0f3d9f68adbcafb5"/><file name="VertexSMBStatus.php" hash="9de3aa176e27f26af6348924ed871d21"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Config.php" hash="2b9698375dfebfe7876a8e2f8b035c26"/><file name="Data.php" hash="5f28161dcadf694d48c4c9f7b27c2ce8"/></dir><dir name="Model"><file name="Observer.php" hash="b9353d3b287a751f76ddc2da1c327e9d"/><file name="RequestItem.php" hash="97ef05667534c99d48f38beaec8ba2b8"/><dir name="Resource"><file name="Setup.php" hash="704dac02b22a1e8c5ab29da4de4aeec0"/><dir name="TaxRequest"><file name="Collection.php" hash="13ad33ed10990a4def5a2e5ca375232a"/></dir><file name="TaxRequest.php" hash="d0ace8df43583036b656bccb31e9a86c"/></dir><dir name="Source"><file name="Taxinvoice.php" hash="ae36306cc712474eb24f9c7809710d70"/></dir><dir name="Tax"><dir name="Sales"><dir name="Total"><dir name="Quote"><file name="Tax.php" hash="7d53a3b3a3d3796a124f577ef9cb4132"/></dir></dir></dir></dir><file name="TaxAreaRequest.php" hash="aeef925be94c81eb329867798822d63c"/><file name="TaxAreaResponse.php" hash="3af622ec7c859f1898181758632a9846"/><file name="TaxInvoice.php" hash="aee7c25367baa70db7b6c4b42345f700"/><file name="TaxQuote.php" hash="464fc5b66d9acec5d8ab26d41ea998f7"/><file name="TaxQuoteResponse.php" hash="220bff64c4d40d8ad4a4b1450d05f51b"/><file name="TaxRequest.php" hash="cef4d43d7d4f34c253f834ff9c2e4300"/><file name="VertexSMB.php" hash="259a0fdc468962cfed9d3942a08b0883"/></dir><dir name="controllers"><file name="OnepageController.php" hash="db46e2fa5c3638dcaffc8399d6233a84"/><file name="VertexSMBController.php" hash="bbb4bbf1150b24d539861c7bb14afac3"/></dir><dir name="data"><dir name="taxce_setup"><file name="data-install-0.1.1.php" hash="3fdaa84edd5b8b2c4fee9c94238a9a0a"/><file name="data-upgrade-0.1.4-0.1.5.php" hash="7aa5fe2857bb2903cebcfa086ae31a92"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f71cfdfac25d0023ee3cbf1547322ef6"/><file name="config.xml" hash="2ac046e6eaf38caeaf6b4d4cc573c5ef"/><file name="system.xml" hash="1244fcd68c2ab5203b615d0e5d6f2529"/></dir><dir name="sql"><dir name="taxce_setup"><file name="mysql4-install-0.1.1.php" hash="f898612c40edbd0b0adf89c82985d37a"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="6c934924c36ae65434275ceee78a9a10"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="f34c5c681ed0514bcffb798267cbe596"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="cff2b3726daaeae0fb50ac3c99a9114c"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="e5fb1826eda6975e19aece9be5302ac6"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="VertexSMB_TaxCE.xml" hash="f4aeca6acb09d5666f5e0d5450a1bc03"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="vertexsmb.xml" hash="53772aad58b12196ccd043376f7883fb"/></dir><dir name="template"><dir name="vertexsmb"><file name="addresschange-popup-content.phtml" hash="25f39d390fcee2b2c1982ca4a9cbfcd8"/><file name="popup-content.phtml" hash="991723bfca8f11a3eab34162d8f97321"/><file name="popup.phtml" hash="bc05a25f9868445666b44cb7c290a91b"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="vertexsmb.xml" hash="3d1acd91ba402257f8ce2b4df89dce9f"/></dir><dir name="template"><dir name="vertexsmb"><file name="addresschange-popup-content.phtml" hash="69c05b7c70a9ec788e554f5eeae6edc4"/><file name="popup-content.phtml" hash="26252a6383a45dd7958c5f81bbb41431"/><file name="popup.phtml" hash="c6441cb7b74e14b2d6d60d830f2ad3a0"/></dir></dir></dir></dir></dir></target></contents>
|
| 22 |
<compatible/>
|
| 23 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 24 |
</package>
|
