Fix for creating fees shedule with fee structure without amount variation #320
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.
This PR fixes an issue in the make_fee_schedule function where per_component_amount was not always properly formatted as a dictionary. The function now correctly handles cases where:
Fee_structure.py
per_component_amount is received as a JSON string.
per_component_amount is a list instead of a dictionary.
Changes Made
Ensured per_component_amount is converted to a dictionary if it is received as a JSON string or a list.
Added a missing field map for Fee Component during get_mapped_doc.
Ensured discount has a default value of 0 if not provided.
Corrected the calculation for amount using total and discount.
Impact
Fixes potential errors when per_component_amount is not formatted correctly.
Ensures accurate fee distribution based on the selected fee plan.
Improves data consistency when mapping fee components to the Fee Schedule.
Testing
Tested with different formats of per_component_amount (JSON string, list, dictionary).
Verified that the Fee Schedule is generated correctly for different fee plans.
Ensured no errors occur when processing discounts.
.
Fee_schedule.py
Refrence image:

Fee_structure:
Fee_schedule

In this the amount takes correctly what in fee_structure