Open
Conversation
|
@JustShah I see some tests failing can you check? |
71c9856 to
65e99c9
Compare
1efe6c8 to
30b9a6d
Compare
e3e231d to
95d6b16
Compare
30b9a6d to
c81aace
Compare
fdd1a75 to
1bccaea
Compare
95d6b16 to
23a48b0
Compare
1bccaea to
1be1631
Compare
1be1631 to
0963b8e
Compare
2797ee0 to
47e1410
Compare
…specs Introduce the `tax_reverse_charge_mode` enum to the `Spree::TaxCategory` model, with values `disabled`, `loose`, and `strict`. The change includes a migration to add the `tax_reverse_charge_mode` column to the `spree_tax_categories` table, with a default value of `0` (disabled). Additionally, the English locale file has been updated to include translations for the new enum values. The `tax_reverse_charge_mode` enum allows for more granular control over tax applicability based on the reverse charge status of an address. This enhancement improves the flexibility and accuracy of tax calculations by enabling different tax handling modes.
Includes updates to the admin interface to allow users to select the `tax_reverse_charge_mode` when creating or editing tax categories. The permitted parameters in the `TaxCategoriesController` have been updated to include `tax_reverse_charge_mode`. The admin views and components have been updated to display the `tax_reverse_charge_mode` in the tax categories index and form views. This ensures that users can easily manage and view the reverse charge mode for each tax category.
Enhanced the tax applicability logic by introducing the `tax_applicable?` method in the `Spree::Tax::TaxHelpers` module. The method determines if tax is applicable based on the `tax_reverse_charge_mode` of the tax category and the `reverse_charge_status` of the address. The `rates_for_item` method has been updated to use this new logic, ensuring that only applicable tax rates are selected. The `tax_applicable?` method supports three modes: - **strict**: Tax applies only if the address is not enabled. - **loose**: Tax applies only if the address is explicitly disabled. - **disabled**: Tax always applies.
47e1410 to
fa4d7a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces enhancements to the tax applicability logic and updates the admin interface to support the new functionality.
Changes:
Tax Applicability Logic:
tax_applicable?method in theSpree::Tax::TaxHelpersmodule. This method determines if tax is applicable based on thetax_reverse_charge_modeof the tax category and thereverse_charge_statusof the address. Therates_for_itemmethod has been updated to use this new logic, ensuring that only applicable tax rates are selected.tax_applicable?method supports three modes:Admin Interface Updates:
tax_reverse_charge_modewhen creating or editing tax categories. The permitted parameters in theTaxCategoriesControllerhave been updated to includetax_reverse_charge_mode.tax_reverse_charge_modein the tax categories index and form views. This ensures that users can easily manage and view the reverse charge mode for each tax category.Model and Spec Updates:
tax_reverse_charge_modeenum to theSpree::TaxCategorymodel, with valuesdisabled,loose, andstrict. This change includes a migration to add thetax_reverse_charge_modecolumn to thespree_tax_categoriestable, with a default value of0(disabled). Additionally, the English locale file has been updated to include translations for the new enum values.tax_reverse_charge_modeis correctly validated and applied.The
tax_reverse_charge_modeenum allows for more granular control over tax applicability based on the reverse charge status of an address. This enhancement improves the flexibility and accuracy of tax calculations by enabling different tax handling modes. The updates to the admin interface ensure that users can easily manage and view the reverse charge mode for each tax category, providing a better user experience.