Issue Type: Dev Task Dev Task
Assignee: Michał Dudziński
Created: 19/Aug/12 7:36 PM
Description:

Michal,

Overview
--------
The overall picture is we want to be able to apply flat and % fees to loan products and loans. No recurring fees or fees based on ranges at the moment.

We've called the central table m_charge. The intention is that it handles fees, penalties and charges. This first implementation is focused on fees as that's all Grameen Kouta needs. As we move on to other MFI's and projects, we might find there should be separate table(s) to cover fees, penalties and charges and if that happens we'll change.

This Task
---------
This task is to update your recently created charge resources (get, post, put) to accommodate some extra fields and then to change the UI to show them.

Tech Note: apparently checkboxes are treated a bit strangely when serialising form data into json. I believe the serialising _javascript_ has been updated to cater for this. But its worth checking that any fields you post or put (and haven't entered checkbox values for) are getting sent as '0' e.g the is_active field.

1/ M_CHARGE TABLE
-----------------
A number of fields have been added to the m_charge table.
is_active:
flag to denote active or not. Only active charges can be added to loan products/loans

currency_code:
The charge can only be attached to a loan product or loan that has the same currency.

charge_applies_to_enum:
Currently, the functionality only relates to loans (and not savings for example). So, only one enum value (Loan).

charge_time_enum:
Currently, only one value - Disbursement

charge_calculation_enum:
current values (Flat, % Loan Amount, % Loan Amount + Interest, % Interest) - the "amount" field will contain whatever value is right for the enum picked

patch is mifosng-db\patches\patch-0009-charge-changes.sql but you may want to create a new database or restore the demo server data from mifosng-db\multi-tenant-demo-backups\backup_mifostenant-default.sql

Dealing With Enums in Get, Post and Put Requests
------------------------------------------------
If you look at the api to retrieve a loan "/loans/

{id}

" there are a number of examples of retrieving enum values e.g.

"repaymentFrequencyType":

{ "id": 1, "code": "repaymentFrequency.periodFrequencyType.weeks", "value": "Weeks" }

,

whereas the Post or Put only has the value

"repaymentFrequencyType": 2,

The "code" value which is used for translations is usually the java field name 'dot' value e.g. chargeAppliesTo.Loan - However, as you can see from this example this is not very strict and anything sensible will be okay

Project: Mifos X
Priority: Minor Minor
Reporter: johnwoodlock
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to