定制 thelia/tax-rule-import-module 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thelia/tax-rule-import-module

最新稳定版本:1.0

Composer 安装命令:

composer require thelia/tax-rule-import-module

包简介

README 文档

README

This module add import and export for tax rules

/!\ Tax rule export filter will be available in Thelia 2.1.4 and 2.2.0-alpha2

Installation

Manually

  • Copy the module into <thelia_root>/local/modules/ directory and be sure that the name of the module is TaxRuleImport.
  • Activate it in your thelia administration panel

Composer

Add it in your main thelia composer.json file

composer require thelia/tax-rule-import-module:~1.0

Usage

With Thelia

First, create your tax rule with Thelia.

Then, to the export (or import) page and use the "Tax rule" export (or import)

Manually

If you want to create your tax rule file, you'll have to write an XML file.

The root tag is called tax-rules, then each tax rule go into a tax-rule.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<tax-rules>
    <tax-rule>
        ...
    </tax-rule>
    <tax-rule>
        ...
    </tax-rule>
    <!-- You can add as many tax rules as you want -->
</tax-rules>

Then, each tax rule must have two tags:

  • countries
  • descriptives

It can have a taxes tag too.

The <countries> tag

This tag must contain at least one country tag. This is the countries where the tax rules has to be applied.

The value of country can be the isoalpha2, isoalpha3 or isocode of the country.

Example:

...
<countries>
    <country>FRA</country>
    <country>USA</country>
</countries>
...

The <descriptives> tag

This tag must contain at least one descriptive tag, that has a mandatory attribute locale. Then, the descriptive tag can have two children:

  • <title> The tax rule title
  • <description> The tax rule description

Example:

<descriptives>
  <descriptive locale="en_US">
    <title>French 20% VAT</title>
  </descriptive>
  <descriptive locale="fr_FR">
    <title>TVA française à 20%</title>
  </descriptive>
</descriptives>

The <taxes> tag

This tag contains at least one tax tag, that has a mandatory attribute type.

The type attribute can be:

  • percent : this is a shortcut for Thelia\TaxEngine\TaxType\PricePercentTaxType
  • amount : this is a shortcut for Thelia\TaxEngine\TaxType\FixAmountTaxType
  • feature_percent : this is a shortcut for Thelia\TaxEngine\TaxType\FeatureFixAmountTaxType
  • Your own tax class

The tax tag can have two children:

  • <descriptives> This tag works exactly like tax-rule's one
  • <requirement> This tag has a mandatory attribute key that is the class's requirement name, and the value is the requirement's. You may add as many requirement tag as you want.

Example

<?xml version="1.0" encoding="UTF-8"?>
<tax-rules>
  <tax-rule>
    <countries>
      <country>FRA</country>
    </countries>
    <descriptives>
      <descriptive locale="en_US">
        <title>French 20% VAT</title>
      </descriptive>
      <descriptive locale="es_ES">
        <title/>
      </descriptive>
      <descriptive locale="fr_FR">
        <title>TVA française à 20%</title>
      </descriptive>
    </descriptives>
    <taxes>
      <tax type="percent">
        <descriptives>
          <descriptive locale="en_US">
            <title>French 20% VAT</title>
          </descriptive>
          <descriptive locale="es_ES">
            <title/>
          </descriptive>
          <descriptive locale="fr_FR">
            <title>TVA française à 20%</title>
          </descriptive>
        </descriptives>
        <requirement key="percent">20</requirement>
      </tax>
    </taxes>
  </tax-rule>
  <tax-rule>
    <countries>
      <country>FRA</country>
    </countries>
    <descriptives>
      <descriptive locale="en_US">
        <title>French 10% VAT</title>
      </descriptive>
      <descriptive locale="es_ES">
        <title/>
      </descriptive>
      <descriptive locale="fr_FR">
        <title>TVA française à 10%</title>
      </descriptive>
    </descriptives>
    <taxes>
      <tax type="percent">
        <descriptives>
          <descriptive locale="en_US">
            <title>French 10% VAT</title>
          </descriptive>
          <descriptive locale="es_ES">
            <title/>
          </descriptive>
          <descriptive locale="fr_FR">
            <title>TVA française à 10%</title>
          </descriptive>
        </descriptives>
        <requirement key="percent">10</requirement>
      </tax>
    </taxes>
  </tax-rule>
</tax-rules>

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2015-04-16