├── .gitignore ├── docs ├── images │ ├── avatax_queue.png │ ├── avatax_sales_invoice.png │ ├── avatax_sales_numbers.png │ ├── document-management-backend.jpg │ ├── address_validation_with_choice.png │ ├── document-management-features.jpg │ ├── screenshot_tax_requests_guest.jpg │ ├── screenshot_tax_requests_customer.jpg │ ├── address_validation_without_choice.png │ ├── configuration_screenshot_2.0.0-rc1.png │ ├── address_validation_unable_to_validate.png │ ├── address_validation_admin_order_creation.png │ ├── address_validation_backend_edit_address.png │ ├── address_validation_customer_edit_address.png │ ├── AvaTax_Logs__Taxes__Stores__Magento_Admin_2017-09-03_20-48-18.png │ ├── 2017-08-01_130753__Taxes__Stores__Magento_Admin_2017-09-03_21-01-04.png │ ├── Configuration__Settings__Stores__Magento_Admin_2017-09-03_20-45-22.png │ ├── Veronica_Costello__Customers__Customers__Magento_Admin_2017-04-26_10-08-51.png │ └── 2017-08-01_130753__Taxes__Stores__Magento_Admin_2017-09-03_20-52-04.png_1423792_2017-09-03_20-58-22.png └── files │ └── env.php ├── .github └── ISSUE_TEMPLATE.md ├── composer.json ├── view ├── frontend │ ├── web │ │ ├── css │ │ │ └── source │ │ │ │ └── _module.less │ │ ├── template │ │ │ ├── ReviewPayment.html │ │ │ └── checkoutValidateAddress.html │ │ └── js │ │ │ ├── addressValidation.js │ │ │ ├── model │ │ │ ├── url-builder.js │ │ │ └── address-converter.js │ │ │ ├── view │ │ │ └── update-address.js │ │ │ └── action │ │ │ └── set-customer-address.js │ ├── layout │ │ └── customer_address_form.xml │ ├── requirejs-config.js │ └── templates │ │ └── init_validation_modal.phtml ├── adminhtml │ ├── layout │ │ ├── customer_index_edit.xml │ │ ├── sales_order_create_load_block_billing_address.xml │ │ ├── sales_order_create_load_block_shipping_address.xml │ │ ├── avatax_tax_classes_product_index.xml │ │ ├── avatax_tax_classes_customer_index.xml │ │ ├── avatax_log_view.xml │ │ ├── avatax_tax_classes_product_edit.xml │ │ ├── avatax_tax_classes_customer_edit.xml │ │ ├── avatax_tax_classes_product_newclass.xml │ │ ├── avatax_tax_classes_customer_newclass.xml │ │ ├── avatax_log_index.xml │ │ ├── avatax_queue_index.xml │ │ ├── sales_order_create_index.xml │ │ ├── sales_order_create_load_block_data.xml │ │ ├── avatax_order_create_billing_address.xml │ │ └── avatax_order_create_shipping_address.xml │ ├── web │ │ ├── template │ │ │ └── form │ │ │ │ └── element │ │ │ │ ├── adminValidateAddress.html │ │ │ │ └── button.html │ │ ├── js │ │ │ ├── model │ │ │ │ └── region-model.js │ │ │ ├── action │ │ │ │ └── validate-address-request.js │ │ │ ├── view │ │ │ │ ├── validation-response-handler.js │ │ │ │ └── address-validation-form-admin.js │ │ │ ├── form │ │ │ │ └── element │ │ │ │ │ └── validationForm.js │ │ │ └── lib │ │ │ │ └── event.simulate.js │ │ └── css │ │ │ └── source │ │ │ └── _module.less │ ├── templates │ │ ├── customer │ │ │ └── edit │ │ │ │ └── region.phtml │ │ ├── order │ │ │ └── create │ │ │ │ └── address_validation_modal.phtml │ │ ├── log │ │ │ └── summary.phtml │ │ └── queue │ │ │ └── summary.phtml │ └── ui_component │ │ └── customer_form.xml └── base │ ├── requirejs-config.js │ └── web │ ├── js │ ├── model │ │ └── address-model.js │ └── lib │ │ └── serialize-form.js │ ├── template │ └── baseValidateAddress.html │ └── css │ └── source │ └── _address-validation.less ├── Model ├── Logger │ ├── AvaTaxLogger.php │ ├── AvaTaxProcessor.php │ └── FileFormatter.php ├── ResourceModel │ ├── Invoice.php │ ├── CreditMemo.php │ ├── Tax │ │ └── Classes │ │ │ ├── Product.php │ │ │ ├── Customer.php │ │ │ ├── Product │ │ │ └── Collection.php │ │ │ └── Customer │ │ │ └── Collection.php │ └── Log.php ├── Config │ └── Source │ │ ├── Mode.php │ │ ├── LogFileMode.php │ │ ├── LogDetail.php │ │ ├── TaxCalculationCountries.php │ │ ├── ErrorAction.php │ │ ├── TaxMode.php │ │ ├── AddressValidationCountries.php │ │ ├── AvaTaxCustomerUsageType.php │ │ ├── Product │ │ └── Attributes.php │ │ └── LogLevel.php ├── Invoice.php ├── CreditMemo.php ├── Tax │ └── Calculation │ │ └── GrandTotalRates.php ├── Log.php └── ValidAddressManagement.php ├── Exception ├── TaxCalculationException.php └── AddressValidateException.php ├── Framework ├── Interaction │ ├── MetaData │ │ ├── ValidationException.php │ │ ├── DoubleType.php │ │ ├── IntegerType.php │ │ ├── BooleanType.php │ │ └── MetaDataObjectFactory.php │ └── Tax │ │ └── Get │ │ └── Response.php └── AppInterface.php ├── etc ├── adminhtml │ ├── routes.xml │ ├── events.xml │ ├── menu.xml │ └── di.xml ├── acl.xml ├── frontend │ └── di.xml ├── events.xml ├── module.xml ├── cron_groups.xml ├── crontab.xml └── webapi.xml ├── registration.php ├── Api ├── Data │ ├── GrandTotalDetailsInterface.php │ ├── GrandTotalRatesInterface.php │ └── GetTaxResponseInterface.php └── ValidAddressManagementInterface.php ├── Controller └── Adminhtml │ ├── Tax │ ├── Classes │ │ ├── Product │ │ │ ├── Save.php │ │ │ ├── Edit.php │ │ │ ├── Index.php │ │ │ ├── Delete.php │ │ │ └── Newclass.php │ │ ├── Customer │ │ │ ├── Save.php │ │ │ ├── Edit.php │ │ │ ├── Delete.php │ │ │ ├── Index.php │ │ │ └── Newclass.php │ │ └── Base │ │ │ ├── Index.php │ │ │ ├── Newclass.php │ │ │ └── Delete.php │ ├── Classes.php │ └── IgnoreTaxRuleNotification.php │ ├── Log.php │ ├── Queue.php │ ├── Log │ └── Index.php │ ├── Queue │ └── Index.php │ └── Address │ └── Region.php ├── Block ├── Adminhtml │ ├── Tax │ │ └── Classes │ │ │ ├── Product │ │ │ ├── Edit.php │ │ │ ├── NewClass.php │ │ │ ├── Edit │ │ │ │ └── Form.php │ │ │ └── NewClass │ │ │ │ └── Form.php │ │ │ ├── Customer │ │ │ ├── Edit.php │ │ │ ├── NewClass.php │ │ │ ├── Edit │ │ │ │ └── Form.php │ │ │ └── NewClass │ │ │ │ └── Form.php │ │ │ └── Base │ │ │ ├── Edit.php │ │ │ ├── Edit │ │ │ └── Form.php │ │ │ └── NewClass.php │ ├── Customer │ │ └── Edit │ │ │ └── Region.php │ ├── Log │ │ ├── ClearButton.php │ │ ├── View.php │ │ └── Summary.php │ └── Queue │ │ └── ClearButton.php └── Tax │ └── Adminhtml │ └── Rule │ └── Edit │ └── Form.php ├── Tests └── Integration │ ├── credentials.php.dist │ └── _files │ ├── tax_calculation_data_aggregated.php │ └── scenarios │ ├── customer_tax_class.php │ ├── tax_before_discount_only_applies_to_taxable_amount.php │ └── product_tax_classes.php ├── Plugin ├── Sales │ ├── Admin │ │ └── Order │ │ │ └── Create │ │ │ └── Form │ │ │ └── Account.php │ └── Total │ │ └── Quote │ │ └── CommonTaxCollector.php ├── Quote │ └── Model │ │ └── Quote │ │ └── Config.php └── Tax │ └── Model │ └── Sales │ └── Total │ └── Quote │ └── Subtotal.php ├── Observer └── PreventOrderPlaceObserver.php └── Ui └── Component └── Listing └── Columns ├── LogActions.php ├── TaxClassesProductActions.php └── TaxClassesCustomerActions.php /.gitignore: -------------------------------------------------------------------------------- 1 | /Tests/Integration/credentials.php 2 | -------------------------------------------------------------------------------- /docs/images/avatax_queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/avatax_queue.png -------------------------------------------------------------------------------- /docs/images/avatax_sales_invoice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/avatax_sales_invoice.png -------------------------------------------------------------------------------- /docs/images/avatax_sales_numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/avatax_sales_numbers.png -------------------------------------------------------------------------------- /docs/images/document-management-backend.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/document-management-backend.jpg -------------------------------------------------------------------------------- /docs/images/address_validation_with_choice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/address_validation_with_choice.png -------------------------------------------------------------------------------- /docs/images/document-management-features.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/document-management-features.jpg -------------------------------------------------------------------------------- /docs/images/screenshot_tax_requests_guest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/screenshot_tax_requests_guest.jpg -------------------------------------------------------------------------------- /docs/images/screenshot_tax_requests_customer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/screenshot_tax_requests_customer.jpg -------------------------------------------------------------------------------- /docs/images/address_validation_without_choice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/address_validation_without_choice.png -------------------------------------------------------------------------------- /docs/images/configuration_screenshot_2.0.0-rc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/configuration_screenshot_2.0.0-rc1.png -------------------------------------------------------------------------------- /docs/images/address_validation_unable_to_validate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/address_validation_unable_to_validate.png -------------------------------------------------------------------------------- /docs/images/address_validation_admin_order_creation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/address_validation_admin_order_creation.png -------------------------------------------------------------------------------- /docs/images/address_validation_backend_edit_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/address_validation_backend_edit_address.png -------------------------------------------------------------------------------- /docs/images/address_validation_customer_edit_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/address_validation_customer_edit_address.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Avalara has shifted how they are handling support for this extension and are no longer providing support via Github issues. For support, please contact support@avalara.com 2 | -------------------------------------------------------------------------------- /docs/images/AvaTax_Logs__Taxes__Stores__Magento_Admin_2017-09-03_20-48-18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/AvaTax_Logs__Taxes__Stores__Magento_Admin_2017-09-03_20-48-18.png -------------------------------------------------------------------------------- /docs/images/2017-08-01_130753__Taxes__Stores__Magento_Admin_2017-09-03_21-01-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/2017-08-01_130753__Taxes__Stores__Magento_Admin_2017-09-03_21-01-04.png -------------------------------------------------------------------------------- /docs/images/Configuration__Settings__Stores__Magento_Admin_2017-09-03_20-45-22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/Configuration__Settings__Stores__Magento_Admin_2017-09-03_20-45-22.png -------------------------------------------------------------------------------- /docs/images/Veronica_Costello__Customers__Customers__Magento_Admin_2017-04-26_10-08-51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/Veronica_Costello__Customers__Customers__Magento_Admin_2017-04-26_10-08-51.png -------------------------------------------------------------------------------- /docs/images/2017-08-01_130753__Taxes__Stores__Magento_Admin_2017-09-03_20-52-04.png_1423792_2017-09-03_20-58-22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/classyllama/ClassyLlama_AvaTax/HEAD/docs/images/2017-08-01_130753__Taxes__Stores__Magento_Admin_2017-09-03_20-52-04.png_1423792_2017-09-03_20-58-22.png -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "classyllama/module-avatax", 3 | "type": "magento2-module", 4 | "version": "1.5.3", 5 | "license": "OSL-3.0", 6 | "require": { 7 | "magento/framework": "^100.1.0|101.0.*|^102.0.0", 8 | "avalara/avatax": "^15.5.2.0" 9 | }, 10 | "autoload": { 11 | "files": [ "registration.php" ], 12 | "psr-4": { 13 | "ClassyLlama\\AvaTax\\": "" 14 | } 15 | }, 16 | "abandoned": "avalara/avatax-magento" 17 | } 18 | -------------------------------------------------------------------------------- /view/frontend/web/css/source/_module.less: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | @import '_address-validation.less'; 15 | -------------------------------------------------------------------------------- /view/adminhtml/layout/customer_index_edit.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Model/Logger/AvaTaxLogger.php: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 |
19 | -------------------------------------------------------------------------------- /view/base/requirejs-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | var config = { 15 | map: { 16 | '*': { 17 | addressValidationModal: 'ClassyLlama_AvaTax/js/view/address-validation-modal' 18 | } 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /Exception/TaxCalculationException.php: -------------------------------------------------------------------------------- 1 | _init('avatax_sales_invoice', 'entity_id'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Model/ResourceModel/CreditMemo.php: -------------------------------------------------------------------------------- 1 | _init('avatax_sales_creditmemo', 'entity_id'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /view/adminhtml/web/template/form/element/button.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /view/frontend/web/template/ReviewPayment.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Exception/AddressValidateException.php: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /etc/adminhtml/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 1, 'label' => __('Production')], ['value' => 0, 'label' => __('Development')]]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /view/adminhtml/web/js/model/region-model.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @category ClassyLlama 3 | * @copyright Copyright (c) 2018 Classy Llama Studios, LLC 4 | */ 5 | define( 6 | [ 7 | 'jquery' 8 | ], 9 | function( 10 | $ 11 | ) { 12 | 'use strict'; 13 | 14 | return { 15 | /** 16 | * Get list of regions 17 | * @returns {Object} 18 | */ 19 | regions: null, 20 | setRegions: function(url) { 21 | this.regions = $.ajax({ 22 | showLoader: false, 23 | url: url, 24 | type: "POST", 25 | dataType: 'json', 26 | success: function (response) { 27 | return response; 28 | } 29 | }); 30 | } 31 | }; 32 | } 33 | ); 34 | -------------------------------------------------------------------------------- /Api/Data/GrandTotalDetailsInterface.php: -------------------------------------------------------------------------------- 1 | 16 | isAddressValidationEnabled()): ?> 17 | 24 | 25 | -------------------------------------------------------------------------------- /etc/adminhtml/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Tax/Classes/Product/Save.php: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Product/Edit.php: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Customer/Edit.php: -------------------------------------------------------------------------------- 1 | 16 | 22 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Tax/Classes/Product/Edit.php: -------------------------------------------------------------------------------- 1 | _init('tax_class', 'class_id'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Tax/Classes/Customer/Delete.php: -------------------------------------------------------------------------------- 1 | _init('tax_class', 'class_id'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Tax/Classes/Customer/Newclass.php: -------------------------------------------------------------------------------- 1 | _authorization->isAllowed('ClassyLlama_AvaTax::manage_avatax'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Queue.php: -------------------------------------------------------------------------------- 1 | _authorization->isAllowed('ClassyLlama_AvaTax::manage_avatax'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Tax/Classes.php: -------------------------------------------------------------------------------- 1 | _authorization->isAllowed('ClassyLlama_AvaTax::manage_avatax'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Tests/Integration/credentials.php.dist: -------------------------------------------------------------------------------- 1 | 1, 20 | Config::XML_PATH_AVATAX_LIVE_MODE => 0, 21 | Config::XML_PATH_AVATAX_DEVELOPMENT_COMPANY_CODE => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 22 | Config::XML_PATH_AVATAX_DEVELOPMENT_ACCOUNT_NUMBER => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 23 | Config::XML_PATH_AVATAX_DEVELOPMENT_LICENSE_KEY => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 24 | ]; 25 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_log_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_tax_classes_product_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_tax_classes_customer_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_tax_classes_product_newclass.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_tax_classes_customer_newclass.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/frontend/layout/customer_address_form.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Api/ValidAddressManagementInterface.php: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Product/Edit/Form.php: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Customer/Edit/Form.php: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 21 | 22 | ClassyLlama\AvaTax\Block\Checkout\LayoutProcessor 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_queue_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Model/ResourceModel/Log.php: -------------------------------------------------------------------------------- 1 | _init('avatax_log', 'log_id'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /etc/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Model/Config/Source/LogFileMode.php: -------------------------------------------------------------------------------- 1 | self::COMBINED, 'label' => __('Combined With Magento Log Files')], 32 | ['value' => self::SEPARATE, 'label' => __('Separate AvaTax Log File')], 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /view/adminhtml/web/js/action/validate-address-request.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | define( 15 | [ 16 | 'jquery', 17 | 'ClassyLlama_AvaTax/js/model/address-model' 18 | ], 19 | function ( 20 | $, 21 | addressModel 22 | ) { 23 | 'use strict'; 24 | return function(url) { 25 | var payload = { 26 | address: addressModel.originalAddress() 27 | }; 28 | return $.ajax({ 29 | url: url, 30 | type: 'post', 31 | dataType: 'json', 32 | data: payload 33 | }); 34 | } 35 | } 36 | ); 37 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Model/ResourceModel/Tax/Classes/Product/Collection.php: -------------------------------------------------------------------------------- 1 | addFieldToFilter('class_type', \Magento\Tax\Model\ClassModel::TAX_CLASS_TYPE_PRODUCT); 34 | return $this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/Config/Source/LogDetail.php: -------------------------------------------------------------------------------- 1 | self::MINIMAL, 'label' => __('Minimal')], 33 | ['value' => self::NORMAL, 'label' => __('Normal')], 34 | ['value' => self::EXTRA, 'label' => __('Extra')], 35 | ]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Model/ResourceModel/Tax/Classes/Customer/Collection.php: -------------------------------------------------------------------------------- 1 | addFieldToFilter('class_type', \Magento\Tax\Model\ClassModel::TAX_CLASS_TYPE_CUSTOMER); 34 | return $this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/Config/Source/TaxCalculationCountries.php: -------------------------------------------------------------------------------- 1 | _init('ClassyLlama\AvaTax\Model\ResourceModel\Invoice'); 28 | } 29 | 30 | /** 31 | * @return array 32 | */ 33 | public function getIdentities() 34 | { 35 | return [self::CACHE_TAG . '_' . $this->getId()]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Model/Config/Source/ErrorAction.php: -------------------------------------------------------------------------------- 1 | Config::ERROR_ACTION_DISABLE_CHECKOUT, 'label' => __('Disable checkout & show error message')], 29 | ['value' => Config::ERROR_ACTION_ALLOW_CHECKOUT_NATIVE_TAX, 'label' => __('Allow checkout & fall back to native Magento tax calculation (no error message)')], 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_create_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /view/adminhtml/templates/order/create/address_validation_modal.phtml: -------------------------------------------------------------------------------- 1 | 16 | isValidationEnabled()): ?> 17 | 30 | 31 | -------------------------------------------------------------------------------- /view/adminhtml/templates/log/summary.phtml: -------------------------------------------------------------------------------- 1 | getSummaryData(); 18 | ?> 19 |
20 | Summary 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 |
29 |
30 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_create_load_block_data.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /etc/cron_groups.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 5 20 | 20 21 | 20 22 | 10 23 | 60 24 | 600 25 | 0 26 | 27 | 28 | -------------------------------------------------------------------------------- /Model/Config/Source/TaxMode.php: -------------------------------------------------------------------------------- 1 | Config::TAX_MODE_NO_ESTIMATE_OR_SUBMIT, 'label' => __('Disabled')], 29 | ['value' => Config::TAX_MODE_ESTIMATE_ONLY, 'label' => __('Estimate Tax')], 30 | ['value' => Config::TAX_MODE_ESTIMATE_AND_SUBMIT, 'label' => __('Estimate Tax & Submit Transactions to AvaTax (default)')], 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Model/CreditMemo.php: -------------------------------------------------------------------------------- 1 | _init('ClassyLlama\AvaTax\Model\ResourceModel\CreditMemo'); 28 | } 29 | 30 | /** 31 | * @return array 32 | */ 33 | public function getIdentities() 34 | { 35 | return [self::CACHE_TAG . '_' . $this->getId()]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_order_create_billing_address.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | ClassyLlama_AvaTax::order/create/form/address.phtml 22 | 23 | 24 | billing 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /view/adminhtml/layout/avatax_order_create_shipping_address.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | ClassyLlama_AvaTax::order/create/form/address.phtml 22 | 23 | 24 | shipping 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /view/adminhtml/templates/queue/summary.phtml: -------------------------------------------------------------------------------- 1 | getQueueSummaryLastUpdatedAt(); 18 | $count = $block->getQueueSummaryCount(); 19 | ?> 20 |
21 |
22 | to avoid race conditions during order processing.', (\ClassyLlama\AvaTax\Model\Queue\Task::QUEUE_PROCESSING_DELAY / 60), 'https://github.com/classyllama/ClassyLlama_AvaTax/issues/170') ?> 23 |
24 | -------------------------------------------------------------------------------- /Model/Tax/Calculation/GrandTotalRates.php: -------------------------------------------------------------------------------- 1 | _get(ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY); 23 | } 24 | 25 | /** 26 | * {@inheritdoc} 27 | * 28 | * @param \ClassyLlama\AvaTax\Api\Data\GrandTotalRatesExtensionInterface $extensionAttributes 29 | * @return $this 30 | */ 31 | public function setExtensionAttributes( 32 | \ClassyLlama\AvaTax\Api\Data\GrandTotalRatesExtensionInterface $extensionAttributes 33 | ) { 34 | $this->_data[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY] = $extensionAttributes; 35 | return $this; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Log/Index.php: -------------------------------------------------------------------------------- 1 | resultFactory->create(ResultFactory::TYPE_PAGE); 33 | $pageResult->setActiveMenu('ClassyLlama_AvaTax::avatax_log'); 34 | $pageResult->getConfig()->getTitle()->prepend(__('AvaTax Logs')); 35 | return $pageResult; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Queue/Index.php: -------------------------------------------------------------------------------- 1 | resultFactory->create(ResultFactory::TYPE_PAGE); 33 | $pageResult->setActiveMenu('ClassyLlama_AvaTax::avatax_queue'); 34 | $pageResult->getConfig()->getTitle()->prepend(__('AvaTax Queue')); 35 | return $pageResult; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /etc/crontab.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | */5 * * * * 21 | 22 | 23 | 2 0 */1 * * 24 | 25 | 26 | 2 0 */1 * * 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /etc/webapi.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Model/Log.php: -------------------------------------------------------------------------------- 1 | _init('ClassyLlama\AvaTax\Model\ResourceModel\Log'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /view/adminhtml/web/css/source/_module.less: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | @import '_address-validation.less'; 15 | 16 | 17 | .admin__avatax-log-summary { 18 | span { 19 | float: left; 20 | } 21 | .avatax-summary-list { 22 | float: left; 23 | } 24 | .avatax-log-summary-level { 25 | float: left; 26 | margin: 0 0 0 2em; 27 | padding: 0; 28 | } 29 | .avatax-log-summary-level-label { 30 | margin: 0; 31 | padding-right: 0.5em; 32 | text-align: right; 33 | border-right-color: @color-black; 34 | border-right-style: solid; 35 | border-right-width: thin; 36 | } 37 | .avatax-log-summary-count { 38 | padding-left: 0.5em; 39 | margin: 0; 40 | } 41 | } 42 | 43 | pre.admin__avatax-log-text { 44 | white-space: pre-wrap; 45 | } 46 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Base/Edit.php: -------------------------------------------------------------------------------- 1 | _mode = 'edit'; 39 | } 40 | 41 | /** 42 | * Retrieve text for header element depending on loaded page 43 | * 44 | * @return \Magento\Framework\Phrase 45 | */ 46 | public function getHeaderText() 47 | { 48 | return __('Edit Tax Class'); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Framework/Interaction/MetaData/DoubleType.php: -------------------------------------------------------------------------------- 1 | validateSimpleType($value); 41 | $value = $this->validateOptions($value); 42 | 43 | return $value; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Framework/Interaction/MetaData/IntegerType.php: -------------------------------------------------------------------------------- 1 | validateSimpleType($value); 41 | $value = $this->validateOptions($value); 42 | 43 | return $value; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Model/Config/Source/AddressValidationCountries.php: -------------------------------------------------------------------------------- 1 | 'US', 'label' => __('United States')], 32 | ['value' => 'CA', 'label' => __('Canada')] 33 | ]; 34 | 35 | return $options; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Base/Edit/Form.php: -------------------------------------------------------------------------------- 1 | getForm(); 34 | $form->getElement('base_fieldset')->removeField('is_new'); 35 | $form->setAction( 36 | $this->getUrl('avatax/tax_classes_' . \strtolower($this->classType) . '/save', ['id' => $this->getRequest()->getParam('id')]) 37 | ); 38 | return $this; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /view/frontend/requirejs-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | 15 | var config = { 16 | map: { 17 | '*': { 18 | "Magento_Checkout/js/model/shipping-save-processor/gift-registry": 'ClassyLlama_AvaTax/js/model/shipping-save-processor/gift-registry', 19 | "Magento_Tax/template/checkout/cart/totals/tax": 'ClassyLlama_AvaTax/template/checkout/cart/totals/tax', 20 | "Magento_Tax/template/checkout/summary/tax": 'ClassyLlama_AvaTax/template/checkout/summary/tax', 21 | // Add the following alias to provide compatibility with Magento 2.2 22 | addressValidation: 'ClassyLlama_AvaTax/js/addressValidation' 23 | } 24 | }, 25 | config: { 26 | mixins: { 27 | 'Magento_Checkout/js/model/shipping-save-processor/default': { 28 | 'ClassyLlama_AvaTax/js/model/shipping-save-processor/default': true 29 | } 30 | } 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /view/base/web/js/model/address-model.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | define( 15 | ['ko'], 16 | function (ko) { 17 | 'use strict'; 18 | var originalAddress = ko.observable(null); 19 | var validAddress = ko.observable(null); 20 | var selectedAddress = ko.observable(null); 21 | var error = ko.observable(null); 22 | var isDifferent = ko.observable(null); 23 | return { 24 | originalAddress: originalAddress, 25 | validAddress: validAddress, 26 | selectedAddress: selectedAddress, 27 | error: error, 28 | isDifferent: isDifferent, 29 | resetValues: function () { 30 | this.originalAddress(null); 31 | this.validAddress(null); 32 | this.selectedAddress(null); 33 | this.error(null); 34 | this.isDifferent(null); 35 | } 36 | }; 37 | } 38 | ); 39 | -------------------------------------------------------------------------------- /view/frontend/web/js/addressValidation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @category ClassyLlama 3 | * @copyright Copyright (c) 2017 Classy Llama Studios, LLC 4 | */ 5 | define([ 6 | 'jquery', 7 | 'jquery/ui', 8 | 'validation' 9 | ], function ($) { 10 | 'use strict'; 11 | 12 | $.widget('mage.addressValidation', { 13 | options: { 14 | selectors: { 15 | button: '[data-action=save-address]' 16 | } 17 | }, 18 | 19 | /** 20 | * Validation creation 21 | * @protected 22 | */ 23 | _create: function () { 24 | var button = $(this.options.selectors.button, this.element); 25 | 26 | this.element.validation({ 27 | 28 | /** 29 | * Submit Handler 30 | * @param {Element} form - address form 31 | */ 32 | submitHandler: function (form) { 33 | 34 | button.attr('disabled', true); 35 | // BEGIN EDIT - Add conditional to form submit 36 | if (!$(form).data('avataxAddressValidationEnabled')) { 37 | // Store is not using AvaTax address validation, submit form natively 38 | form.submit(); 39 | } 40 | // END EDIT 41 | } 42 | }); 43 | } 44 | }); 45 | 46 | return $.mage.addressValidation; 47 | }); 48 | -------------------------------------------------------------------------------- /Block/Adminhtml/Customer/Edit/Region.php: -------------------------------------------------------------------------------- 1 | backendUrl = $backendUrl; 33 | $this->configHelper = $configHelper; 34 | parent::__construct($context); 35 | } 36 | 37 | /** 38 | * @return string 39 | */ 40 | public function getRegionUrl() 41 | { 42 | return $url = $this->backendUrl->getUrl('avatax/address/region'); 43 | } 44 | 45 | /** 46 | * @return mixed 47 | */ 48 | public function isAddressValidationEnabled() 49 | { 50 | return $this->configHelper->isAddressValidationEnabled($this->_storeManager->getStore()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Model/Logger/AvaTaxProcessor.php: -------------------------------------------------------------------------------- 1 | storeManager = $storeManager; 37 | } 38 | 39 | /** 40 | * Retrieves the current Store ID from Magento and adds it to the record 41 | * 42 | * @param array $record 43 | * @return array 44 | */ 45 | public function __invoke(array $record) 46 | { 47 | // get the store_id and add it to the record 48 | $store = $this->storeManager->getStore(); 49 | $record['extra']['store_id'] = $store->getId(); 50 | 51 | return $record; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Framework/Interaction/Tax/Get/Response.php: -------------------------------------------------------------------------------- 1 | getData(self::IS_UNBALANCED); 28 | } 29 | 30 | /** 31 | * {@inheritDoc} 32 | */ 33 | public function setIsUnbalanced($unbalanced) 34 | { 35 | $this->setData(self::IS_UNBALANCED, $unbalanced); 36 | return $this; 37 | } 38 | 39 | /** 40 | * {@inheritDoc} 41 | */ 42 | public function getBaseAvataxTaxAmount() { 43 | return $this->getData(self::BASE_AVATAX_TAX_AMOUNT); 44 | } 45 | 46 | /** 47 | * {@inheritDoc} 48 | */ 49 | public function setBaseAvataxTaxAmount($amount) { 50 | $this->setData(self::BASE_AVATAX_TAX_AMOUNT, $amount); 51 | return $this; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Tax/Classes/Base/Index.php: -------------------------------------------------------------------------------- 1 | resultFactory->create(ResultFactory::TYPE_PAGE); 44 | $pageResult->setActiveMenu('ClassyLlama_AvaTax::avatax_tax_classes_' . \strtolower($this->classType)); 45 | $pageResult->getConfig()->getTitle()->prepend(__(\ucfirst(\strtolower($this->classType)) . ' Tax Classes')); 46 | return $pageResult; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Base/NewClass.php: -------------------------------------------------------------------------------- 1 | _objectId = 'id'; 38 | $this->_controller = 'adminhtml_tax_classes_' . \strtolower($this->classType); 39 | $this->_blockGroup = 'ClassyLlama_AvaTax'; 40 | $this->_mode = 'newClass'; 41 | 42 | parent::_construct(); 43 | $this->buttonList->update('save', 'label', __('Save Tax Class')); 44 | } 45 | 46 | /** 47 | * Retrieve text for header element depending on loaded page 48 | * 49 | * @return \Magento\Framework\Phrase 50 | */ 51 | public function getHeaderText() 52 | { 53 | return __('New Tax Class'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Tax/Classes/Base/Newclass.php: -------------------------------------------------------------------------------- 1 | resultFactory->create(ResultFactory::TYPE_PAGE); 44 | $pageResult->setActiveMenu('ClassyLlama_AvaTax::avatax_tax_classes_' . \strtolower($this->classType)); 45 | $pageResult->getConfig()->getTitle()->prepend(__('New ' . \ucfirst(\strtolower($this->classType)) . ' Tax Class')); 46 | return $pageResult; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Plugin/Sales/Admin/Order/Create/Form/Account.php: -------------------------------------------------------------------------------- 1 | avaTaxConfigHelper = $avaTaxConfigHelper; 30 | } 31 | 32 | public function afterToHtml(\Magento\Sales\Block\Adminhtml\Order\Create\Form\Account $subject, $result) 33 | { 34 | if ($this->avaTaxConfigHelper->isModuleEnabled()) { 35 | $html = '
'; 36 | $html .= __('If you are changing a customer group that affects tax calculation, please see this readme for how to ensure the appropriate taxes are calculated.'); 37 | $html .= '
'; 38 | 39 | $result .= $html; 40 | } 41 | 42 | return $result; 43 | } 44 | } -------------------------------------------------------------------------------- /etc/adminhtml/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /view/frontend/web/js/model/url-builder.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | define( 15 | ['jquery'], 16 | function($) { 17 | return { 18 | method: "rest", 19 | storeCode: window.avaTaxStoreCode, 20 | version: 'V1', 21 | serviceUrl: ':method/:storeCode/:version', 22 | 23 | createUrl: function(url, params) { 24 | var completeUrl = this.serviceUrl + url; 25 | return this.bindParams(completeUrl, params); 26 | }, 27 | bindParams: function(url, params) { 28 | params.method = this.method; 29 | params.storeCode = this.storeCode; 30 | params.version = this.version; 31 | 32 | var urlParts = url.split("/"); 33 | urlParts = urlParts.filter(Boolean); 34 | 35 | $.each(urlParts, function(key, part) { 36 | part = part.replace(':', ''); 37 | if (params[part] != undefined) { 38 | urlParts[key] = params[part]; 39 | } 40 | }); 41 | return urlParts.join('/'); 42 | } 43 | }; 44 | } 45 | ); 46 | -------------------------------------------------------------------------------- /Api/Data/GetTaxResponseInterface.php: -------------------------------------------------------------------------------- 1 | 16 | 29 | 41 | 44 | -------------------------------------------------------------------------------- /Block/Adminhtml/Tax/Classes/Product/NewClass/Form.php: -------------------------------------------------------------------------------- 1 | addField( 38 | 'avatax_code', 39 | 'text', 40 | [ 41 | 'name' => 'avatax_code', 42 | 'label' => __('AvaTax Tax Code'), 43 | 'note' => __('Optional. AvaTax system Tax Code or custom Tax Code. See AvaTax documentation for more details.', \ClassyLlama\AvaTax\Helper\Config::AVATAX_DOCUMENTATION_TAX_CODE_LINK), 44 | 'class' => 'validate-length maximum-length-25', 45 | ] 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Block/Tax/Adminhtml/Rule/Edit/Form.php: -------------------------------------------------------------------------------- 1 | getForm()->getElement('base_fieldset')->getContainer(); 32 | $fieldset->getElement('tax_customer_class')->setNote( 33 | __( 34 | 'Go to Customer Tax Classes to add AvaTax Customer Usage Types to tax classes.', 35 | $this->_urlBuilder->getUrl('avatax/tax_classes_customer') 36 | ) 37 | ); 38 | $fieldset->getElement('tax_product_class')->setNote( 39 | __( 40 | 'Go to Product Tax Classes to add AvaTax Tax Codes to tax classes.', 41 | $this->_urlBuilder->getUrl('avatax/tax_classes_product') 42 | ) 43 | ); 44 | return $return; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Framework/Interaction/MetaData/BooleanType.php: -------------------------------------------------------------------------------- 1 | validateSimpleType($value); 54 | 55 | return $value; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /view/base/web/js/lib/serialize-form.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery serializeObject 3 | * @copyright 2014, macek 4 | * @link https://github.com/macek/jquery-serialize-object 5 | * @license BSD 6 | * @version 2.5.0 7 | */ 8 | !function(e,i){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(e,r){return i(e,r)});else if("undefined"!=typeof exports){var r=require("jquery");i(exports,r)}else i(e,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,i){function r(e,r){function n(e,i,r){return e[i]=r,e}function a(e,i){for(var r,a=e.match(t.key);void 0!==(r=a.pop());)if(t.push.test(r)){var u=s(e.replace(/\[\]$/,""));i=n([],u,i)}else t.fixed.test(r)?i=n([],r,i):t.named.test(r)&&(i=n({},r,i));return i}function s(e){return void 0===h[e]&&(h[e]=0),h[e]++}function u(e){switch(i('[name="'+e.name+'"]',r).attr("type")){case"checkbox":return"on"===e.value?!0:e.value;default:return e.value}}function f(i){if(!t.validate.test(i.name))return this;var r=a(i.name,u(i));return l=e.extend(!0,l,r),this}function d(i){if(!e.isArray(i))throw new Error("formSerializer.addPairs expects an Array");for(var r=0,t=i.length;t>r;r++)this.addPair(i[r]);return this}function o(){return l}function c(){return JSON.stringify(o())}var l={},h={};this.addPair=f,this.addPairs=d,this.serialize=o,this.serializeJSON=c}var t={validate:/^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,key:/[a-z0-9_]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_]+$/i};return r.patterns=t,r.serializeObject=function(){return new r(i,this).addPairs(this.serializeArray()).serialize()},r.serializeJSON=function(){return new r(i,this).addPairs(this.serializeArray()).serializeJSON()},"undefined"!=typeof i.fn&&(i.fn.serializeObject=r.serializeObject,i.fn.serializeJSON=r.serializeJSON),e.FormSerializer=r,r}); 9 | -------------------------------------------------------------------------------- /Tests/Integration/_files/tax_calculation_data_aggregated.php: -------------------------------------------------------------------------------- 1 | addField( 38 | 'avatax_code', 39 | 'select', 40 | [ 41 | 'name' => 'avatax_code', 42 | 'label' => __('AvaTax Customer Usage Type'), 43 | 'note' => __('Optional. The AvaTax Customer Usage Type (or Entity Use Code). Refer to the AvaTax documentation for more information.', 'https://help.avalara.com/kb/001/What_are_the_exemption_reasons_for_each_Entity_Use_Code_used_for_Avalara_AvaTax%3F'), 44 | 'values' => $this->avaTaxCustomerUsageType->toOptionArray() 45 | ] 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /etc/adminhtml/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | ClassyLlama\AvaTax\Model\Message\QueueNotification 22 | ClassyLlama\AvaTax\Model\Message\QueueFailureNotification 23 | ClassyLlama\AvaTax\Model\Message\QueueDisabledNotification 24 | ClassyLlama\AvaTax\Model\Message\ConfigNotification 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /view/frontend/web/js/action/set-customer-address.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | define( 15 | [ 16 | 'jquery', 17 | 'mage/storage', 18 | 'Magento_Ui/js/modal/alert', 19 | 'ClassyLlama_AvaTax/js/model/address-model', 20 | 'ClassyLlama_AvaTax/js/model/url-builder' 21 | ], 22 | function ( 23 | $, 24 | storage, 25 | alert, 26 | addressModel, 27 | urlBuilder 28 | ) { 29 | 'use strict'; 30 | return function () { 31 | var serviceUrl; 32 | var payload = { 33 | address: addressModel.originalAddress() 34 | }; 35 | 36 | serviceUrl = urlBuilder.createUrl('/carts/mine/validate-address', {}); 37 | 38 | return storage.post( 39 | serviceUrl, 40 | JSON.stringify(payload) 41 | ).done( 42 | function (response) { 43 | return response; 44 | } 45 | ).fail( 46 | function (response) { 47 | var messageObject = JSON.parse(response.responseText); 48 | alert({ 49 | title: $.mage.__('Error'), 50 | content: messageObject.message 51 | }); 52 | } 53 | ); 54 | } 55 | } 56 | ); 57 | -------------------------------------------------------------------------------- /view/adminhtml/web/js/view/validation-response-handler.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | define( 15 | [ 16 | 'jquery', 17 | 'Magento_Ui/js/modal/alert', 18 | 'ClassyLlama_AvaTax/js/model/address-model', 19 | 'ClassyLlama_AvaTax/js/view/address-validation-form-admin' 20 | ], 21 | function ( 22 | $, 23 | alert, 24 | addressModel, 25 | addressValidationForm 26 | ) { 27 | 'use strict'; 28 | 29 | return { 30 | validationResponseHandler: function (response, settings, form) { 31 | addressModel.error(null); 32 | if (typeof response !== 'undefined') { 33 | if (typeof response === 'string') { 34 | addressModel.error(response); 35 | } else { 36 | addressModel.validAddress(response); 37 | } 38 | addressValidationForm.fillValidateForm(form, settings); 39 | if (addressModel.error() == null && !addressModel.isDifferent()) { 40 | alert({ 41 | title: $.mage.__('Success'), 42 | content: $.mage.__('This address is already valid.') 43 | }); 44 | } 45 | } 46 | } 47 | }; 48 | } 49 | ); 50 | -------------------------------------------------------------------------------- /Plugin/Quote/Model/Quote/Config.php: -------------------------------------------------------------------------------- 1 | config = $config; 36 | } 37 | 38 | /** 39 | * Append attributes to the list of attributes loaded on the quote_items collection 40 | * 41 | * @param QuoteConfig $config 42 | * @param $attributes 43 | * @return array 44 | */ 45 | public function afterGetProductAttributes(QuoteConfig $config, $attributes) 46 | { 47 | if ($this->config->getRef1Attribute()) { 48 | $attributes[] = $this->config->getRef1Attribute(); 49 | } 50 | if ($this->config->getRef2Attribute()) { 51 | $attributes[] = $this->config->getRef2Attribute(); 52 | } 53 | if ($this->config->getUpcAttribute()) { 54 | $attributes[] = $this->config->getUpcAttribute(); 55 | } 56 | return array_unique($attributes); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /view/adminhtml/web/js/form/element/validationForm.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ClassyLlama_AvaTax 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @copyright Copyright (c) 2016 Avalara, Inc. 12 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | */ 14 | define([ 15 | 'jquery', 16 | 'Magento_Ui/js/form/element/abstract' 17 | ], function ( 18 | $, 19 | Abstract 20 | ) { 21 | 'use strict'; 22 | 23 | return Abstract.extend({ 24 | defaults: { 25 | links: { 26 | value: '' 27 | }, 28 | template: 'ClassyLlama_AvaTax/form/element/adminValidateAddress' 29 | }, 30 | baseTemplate: 'ClassyLlama_AvaTax/baseValidateAddress', 31 | choice: 1, 32 | 33 | initialize: function () { 34 | this._super() 35 | .initFormId(); 36 | $(document).on('click', '.validateAddressForm .instructions[data-uid="' + this.uid + '"] .edit-address', function () { 37 | $('html, body').animate({scrollTop: $("#container").offset().top}, 1000); 38 | }); 39 | 40 | return this; 41 | }, 42 | 43 | initFormId: function () { 44 | var namespace; 45 | 46 | if (this.formId) { 47 | return this; 48 | } 49 | 50 | namespace = this.name.split('.'); 51 | this.formId = namespace[0]; 52 | 53 | return this; 54 | }, 55 | 56 | getBaseValidateAddressTemplate: function () { 57 | return this.baseTemplate; 58 | } 59 | }); 60 | }); 61 | -------------------------------------------------------------------------------- /Block/Adminhtml/Log/ClearButton.php: -------------------------------------------------------------------------------- 1 | urlBuilder = $context->getUrlBuilder(); 41 | } 42 | 43 | /** 44 | * Get button data 45 | * 46 | * @return array 47 | */ 48 | public function getButtonData() 49 | { 50 | $message = __( 51 | 'This will clear any logs that are older than the lifetime set in configuration. ' . 52 | 'Do you want to continue?' 53 | ); 54 | return [ 55 | 'label' => __('Clear Logs Now'), 56 | 'on_click' => "confirmSetLocation('{$message}', '{$this->getButtonUrl()}')" 57 | ]; 58 | } 59 | 60 | /** 61 | * Get URL for back (reset) button 62 | * 63 | * @return string 64 | */ 65 | protected function getButtonUrl() 66 | { 67 | return $this->urlBuilder->getUrl('*/*/clear'); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /view/base/web/template/baseValidateAddress.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 |
19 |
20 |
21 | 22 |
23 |