OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Shared.MPersonnel.Calculations Class Reference

Contains functions to be used by the Server and the Client that perform certain calculations - specific for the Personnel Module. More...

Static Public Member Functions

static string DeterminePersonsNationalities (TGetCacheableDataTableFromCache ACacheRetriever, PmPassportDetailsTable APassportDetailsDT)
 Determines a PERSON's Nationalities (deduced from its passports). More...
 
static string DeterminePassportNationality (TGetCacheableDataTableFromCache ACacheRetriever, PmPassportDetailsRow APassportDR)
 Returns the 'nationality' of a passport and marks expired passports up. More...
 

Static Public Attributes

static readonly String PASSPORT_EXPIRED = " (" + Catalog.GetString("exp.") + ")"
 Passport expired More...
 
static readonly String PASSPORTMAIN_EXPIRED = " (" + Catalog.GetString("exp.") + " " + Catalog.GetString("MAIN") + "!)"
 Main passport expired More...
 

Detailed Description

Contains functions to be used by the Server and the Client that perform certain calculations - specific for the Personnel Module.

Member Function Documentation

◆ DeterminePassportNationality()

static string Ict.Petra.Shared.MPersonnel.Calculations.DeterminePassportNationality ( TGetCacheableDataTableFromCache  ACacheRetriever,
PmPassportDetailsRow  APassportDR 
)
inlinestatic

Returns the 'nationality' of a passport and marks expired passports up.

Parameters
ACacheRetrieverDelegate that returns the specified DataTable from the data cache (client- or serverside). Delegate Method needs to be for the MPartner Cache (that is, it needs to work with the TCacheableCommonTablesEnum Enum!
APassportDRDataRow containing information about a passport.
Returns
Country name that goes with the passport's Nationality Code, except for the case where no country name is found for the Nationality Code, then the Nationality Code is returned. If a passport is expired, the string " (exp.)" (potentially translated) is added as a postfix.

◆ DeterminePersonsNationalities()

static string Ict.Petra.Shared.MPersonnel.Calculations.DeterminePersonsNationalities ( TGetCacheableDataTableFromCache  ACacheRetriever,
PmPassportDetailsTable  APassportDetailsDT 
)
inlinestatic

Determines a PERSON's Nationalities (deduced from its passports).

Algorithm:

  1. Check pm_main_passport_l flag
    1. if null, don't do anything special (Note: Partner Import does not write to this field, it stays null if it isn't found in the import file [which will be the case for Petra 2.x])
    2. if false, do likewise
    3. if true, list as FIRST Country

Order by pm_date_of_issue_d

  1. order Countries by pm_date_of_issue_d DESC, except for the FIRST Country
    1. in case there are several FIRST Countries (which in theory should not happen), they are ordered by pm_date_of_issue_d DESC in themselves at the beginning of the list of Countries.

Check for passport expiration

  1. If a passport's expiry date is set and it is in the past
    1. show the Country + " (exp.)".

Elimination of duplicate listings

  1. If a country of issue comes up twice
    1. eliminate the duplicate, except if the Country is listed once by its name and one with the exp. postfix.

Additionally, a warning text " MAIN!)" to the postfix " (exp." is added if the expired passport is the 'Main Passport' (pm_main_passport_l=true) of the PERSON.

Parameters
ACacheRetrieverDelegate that returns the specified DataTable from the data cache (client- or serverside). Delegate Method needs to be for the MPartner Cache (that is, it needs to work with the TCacheableCommonTablesEnum Enum!
APassportDetailsDT
Returns

Member Data Documentation

◆ PASSPORT_EXPIRED

readonly String Ict.Petra.Shared.MPersonnel.Calculations.PASSPORT_EXPIRED = " (" + Catalog.GetString("exp.") + ")"
static

Passport expired

◆ PASSPORTMAIN_EXPIRED

readonly String Ict.Petra.Shared.MPersonnel.Calculations.PASSPORTMAIN_EXPIRED = " (" + Catalog.GetString("exp.") + " " + Catalog.GetString("MAIN") + "!)"
static

Main passport expired


The documentation for this class was generated from the following file: