Payments - Category Overview

Ticket

https://openimis.atlassian.net/browse/OMT-322

Legacy stored procedure

uspSSRSPaymentCategoryOverview

 

Comments about the report

The legacy report had a region picker that was never used in the report. It was kept in order to easily select all districts from a region even if region-level values are not calculated.

 

How it works

 

This report fetches all Premium data, with the requested criteria, in two parts:

  • The first query fetches photo fees only, using the Premium is_photo_fee field

  • The second query fetches all the other Premiums, grouped on the district level. The goal is to calculate the following fields, in this order:

    • Registration fees: if there are any registration costs in the Product configuration, they should be paid first:

      • Either this is a one-time lump sum

      • Or this is a fee for each Family member in the Policy.

      • If the premium > the registration fees, then the registration fees are subtracted from the premiums and the remaining amount serves a base calculation for the next steps. Otherwise, the registration fees = the premiums and the other values = 0.

    • Assembly fees: if there is still a remaining amount and there are any assembly costs in the Product configuration, these should be paid second:

      • Either this is a one-time lump sum

      • Or this is a fee for each Family member in the Policy.

      • If the remaining amount > the assembly fees, then the assembly fees are subtracted from the remaining amount and the remaining amount serves a base calculation for the next steps. Otherwise, the assembly fees = the remaining amount and the other values = 0.

    • Contributions: if there is any remaining amount left here, then this amount is the contributions.

 

Overall totals are calculated, as well as district-level subtotals for each product.

 

Did you encounter a problem or do you have a suggestion?

Please contact our Service Desk



This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/