{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Taxes rules'}{/block} {block name="check-resource"}admin.configuration.tax{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="taxes-rules.top" location="taxes_rules_top" }

{intl l="In order to manges your shop taxes you can manage"} {intl l="taxes"} {intl l="and"} {intl l="tax rules"}.

{intl l="Taxes define the amount of money which is added to a bought product."}

{intl l="Example :"}

- {intl l="French 19.6% VAT is a tax which add a 19.6% tax to the product price."}
- {intl l="Ecotax is a tax wich add a defined amount (throug a product feature) to the product price."}

{intl l="Tax rules are combination of different taxes."}

{intl l="Example :"}

- {intl l="French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount)."}

{intl l="you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not."}

{if $general_error}
{$general_error}
{/if}

{intl l="Taxes"} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.tax" access="CREATE"} {/loop}
{intl l="Name"} | {intl l="Description"} | {intl l="Actions"}
--- | --- | ---
{loop type="tax" name="taxes" backend_context="1"}
{loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.tax" access="UPDATE"} {$TITLE} {/loop} {elseloop rel="can_change"} {$TITLE} {/elseloop} | {$DESCRIPTION nofilter} | {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.tax" access="UPDATE"} {/loop} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.tax" access="UPDATE"} {/loop}
{/loop}

{intl l="Taxes rules"} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.tax" access="UPDATE"} {/loop}
{intl l="Name"} | {intl l="Description"} | {intl l="Default"} | {intl l="Actions"}
--- | --- | --- | ---
{loop type="tax-rule" name="taxes-rules" backend_context="1"}
{loop type="auth" name="can_change-tr" role="ADMIN" resource="admin.configuration.tax" access="UPDATE"} {$TITLE} {/loop} {elseloop rel="can_change-tr"} {$TITLE} {/elseloop} | {$DESCRIPTION nofilter} | {if $IS_DEFAULT == 1} {/if} | {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.tax" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.tax" access="DELETE"} {/loop}
{/loop}

{hook name="taxes-rules.bottom" location="taxes_rules_bottom" }
{* -- Add tax confirmation dialog ----------------------------------- *} {form name="thelia.admin.tax.add"} {if $form_error_message} {$taxCreateError = true} {else} {$taxCreateError = false} {/if} {* Capture the dialog body, to pass it to the generic dialog *} {capture "tax_create_dialog"} {form_hidden_fields exclude="locale"} {custom_render_form_field field="title"} {loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *} {form_field field='locale'} {/form_field}
{/loop} {/custom_render_form_field} {form_field field='type'}
{$label} :
{/form_field} {form_tagged_fields tag='requirements'}
{$label} {if $formType == 'choice'}
{/if} {if $formType == 'text'} {/if}
{/form_tagged_fields} {hook name="tax.create-form" location="tax_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "tax_create_dialog" dialog_title = {intl l="Create a new tax"} dialog_body = {$smarty.capture.tax_create_dialog nofilter} dialog_ok_label = {intl l="Create"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/taxes/add"} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Delete tax confirmation dialog ----------------------------------- *} {capture "tax_delete_dialog"} {hook name="tax.delete-form" location="tax_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "tax_delete_dialog" dialog_title = {intl l="Delete tax"} dialog_message = {intl l="Do you really want to delete this tax ?"} form_action = {token_url path='/admin/configuration/taxes/delete'} form_content = {$smarty.capture.tax_delete_dialog nofilter} } {* -- Add tax rule confirmation dialog ----------------------------------- *} {form name="thelia.admin.taxrule.add"} {if $form_error_message} {$taxRuleCreateError = true} {else} {$taxRuleCreateError = false} {/if} {* Capture the dialog body, to pass it to the generic dialog *} {capture "tax_rule_create_dialog"} {form_hidden_fields exclude="locale"} {if $form_error}
{$form_error_message}
{/if} {custom_render_form_field field="title"} {loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *} {form_field field='locale'} {/form_field}
{/loop} {/custom_render_form_field} {hook name="tax-rule.create-form" location="tax_rule_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "tax_rule_create_dialog" dialog_title = {intl l="Create a new tax rule"} dialog_body = {$smarty.capture.tax_rule_create_dialog nofilter} dialog_ok_label = {intl l="Create"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/taxes_rules/add"} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Delete tax rule confirmation dialog ----------------------------------- *} {capture "tax_rule_delete_dialog"} {hook name="tax-rule.delete-form" location="tax_rule_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "tax_rule_delete_dialog" dialog_title = {intl l="Delete tax rule"} dialog_message = {intl l="Do you really want to delete this tax rule ?"} form_action = {token_url path='/admin/configuration/taxes_rules/delete'} form_content = {$smarty.capture.tax_rule_delete_dialog nofilter} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="taxes-rules.js" location="taxes-rules-js" } {hook name="wysiwyg.js" location="wysiwyg-tax-rules-js" } {/block}