This article contains instructions on how to make it mandatory to fill in the fields of all payer types:
- physical person;
- sole proprietor;
- legal entity.
Use case
Fields need to be made mandatory when creating or editing a payer.
There is no built-in option in BILLmanager to make some fields mandatory, for example, address parameters for a physical person (Actual address field). Particular fields can be made mandatory, but this setting does not cover all required parameters. The solution of adding a new field and making it mandatory is not suitable because it will lead to a duplicate field for the payer.
Solution
Check the built-in option to configure the mandatory filling:
- Enter Directories → Countries.
- Select the country.
- Click Parameters.
- Select the required parameter.
- Click Edit.
- Enable the Required parameter option.
- Click Ok.
If the required fields cannot be made mandatory through country settings, create a plugin:
- Connect to the server with the platform via SSH. For more information about connecting via SSH, see Workstation setup.
- Create a file in the /usr/local/mgr5/etc/xml directory named in the format billmgr_mod_<module_name>.xml (for example, billmgr_mod_required.xml).
- Add the following content to the file:
<mgrdata> <metadata name="profile.edit" type="form" mgr="billmgr"> <form> <page name="physical_address"> <field name="country_physical"> <select name="country_physical" required="yes"/> </field> <field name="state_physical"> <select depend="country_physical" sorted="asc" name="state_physical" required="yes"/> </field> <field name="postcode_physical"> <input type="text" name="postcode_physical" required="yes"/> </field> <field name="city_physical"> <input type="text" name="city_physical" required="yes"/> </field> <field name="address_physical"> <textarea rows="2" name="address_physical" required="yes"/> </field> </page> </form> </metadata> </mgrdata>
- Restart BILLmanager with cache clearance:
rm /usr/local/mgr5/var/.db.cache* -rf rm /usr/local/mgr5/var/.xmlcache/* -rf /usr/local/mgr5/sbin/mgrctl -m billmgr -R
Related topics:
The product roadmap includes an enhancement to enable built-in mandatory field validation for all payer fields. You can track the implementation progress in the BILLmanager Changelog.