compucorp / uk.co.compucorp.membershipextras

Membership Extras for CiviCRM
Other
5 stars 8 forks source link

IO-139: Add Instalment line item(s) to schedule #358

Closed erawat closed 3 years ago

erawat commented 3 years ago

Overview

Total amount and tax amount on currently screen is confusing. This PR adds line item(s) as sub table on each instalment to visualize financial type, quantity, unit price, sub total, tax amount as total amount similar to CiviCRM contribution line item.

Line items table works with

Before

Peek 2021-03-04 10-27

After

Peek 2021-03-04 10-16

Technical Details

Previously, the instalments display was generated each time by rewriting DOM, this method was expensive especially when we need to rewrite the DOM with nested table each time and the display is not reusable.

Since, we need a complex table for displaying instalments, the CiviCRM page for displaying the content is created and the membership form is loading the instalments table by using CRM.loadPage() function that provided by CiviCRM to inject the page into the membership form. This method is widely used in CiviCRM in many pages.

Finally, we have also changed the way to display instalments schedule, the API format has also been updated to remove formatting like currency symbol, status label, so the API will return raw data and the page will handle the display format. This way makes the API result more flexible to reuse in other systems or a module like webform.

jamienovick commented 3 years ago

Since we have changed the way to display instalments schedule, the API format has also been updated to remove formatting like currency symbol, status label, so the API will return raw data and the page will handle the display format. This way makes the API result more flexible to reuse in other systems or a module like webform.

Can we just confirm that this works with sites that use Euros or other currencies i.e. for FEMS or WHF?

erawat commented 3 years ago

Since we have changed the way to display instalments schedule, the API format has also been updated to remove formatting like currency symbol, status label, so the API will return raw data and the page will handle the display format. This way makes the API result more flexible to reuse in other systems or a module like webform.

Can we just confirm that this works with sites that use Euros or other currencies i.e. for FEMS or WHF?

@jamienovick This will work with any currency as the template is using default currency symbol and date format from civicrm localisation settings.