FINANCIAL_PAYROLL_PAY_PROCESS FINANCIAL Endpoint
  /rpc/financial/?method=FINANCIAL_PAYROLL_PAY_PROCESS  
  Code provided as-is, see https://github.com/ibcom-lab/entityos-sdk-payroll for code logic.  
  This method allows for the calculation of a Payroll Period, and then, if necessary, for recalculations after modifications.
  The main parameter is "type" which indicates the type of processing
  Uses Profile Setting 58 to determine whether or not to create expenses (default Y)
  Uses Profile Setting 74 to determine the contact business for created super records
  Uses Profile Setting 75 to determine the contact business for created tax records
  Uses Profile Setting 97 to determine the financial account for PAYG expenses
  Uses Profile Setting 223 to determine if a standard amount should be added to Pay Rates
  Uses Profile Setting 257 to determine the superannuation threshhold, ie monthly income required before Superannuation needs to be calculated. Defaults to $450.00
  more...
   
  TYPE=1 - Full Calculation [Default]
  Notes:   1. This is the most commonly used Type. It creates the appropriate Pay Period, Pay Record, Pay Record Item, and Pay Leave records
       
  Additional Parameters:    
  Frequency Numeric 1=Weekly,2=Fortnightly,3=Monthly,4=BiMonthly. If not passed, it defaults to your profile setting (Profile Item 21). If this is not set, it defaults to 2 (Fortnightly). When processing it only includes employees who have a matching Pay Frequency
  Area Numeric If passed, only employees in the Area will be included
       
  Returns:    
  Period Numeric  
       
  Processing:   1. Calculate the appropriate dates for the Pay Period, based on previous runs, for the same Frequency. If this is your first run, it assumes Today. You can modify this if required via FINANCIAL_PAYROLL_PAY_PERIOD_MANAGE
      2. Creates the FINANCIAL_PAYROLL_PAY_PERIOD_MANAGE record
      3. Continues processing as per "TYPE=2 - Create All Records" below
  TYPE=2 - Create All Records
  Notes:   1. You would use this Type if you already have the Pay Period record that you want to use
       
  Additional Parameters:    
  Period Numeric Mandatory
       
  Returns:    
       
  Processing:   1. Deletes all Pay Record, Pay Record Item, and automatically created Pay Leave records (if any)
      2. Finds all active employees who were employed as at the Pay Period's StartDate, and in the same Area
      3. Continues processing as per "TYPE=3 - Create Single Record" below
  TYPE=3 - Create Single Record
  Notes:   1. You would use this Type if you already have just added a new employee, or want to reset an employee's pay
       
  Additional Parameters:    
  Period Numeric Mandatory
  Employee Numeric Mandatory
       
  Returns:    
  Record Numeric  
       
  Processing:   1. Deletes the Pay Record, Pay Record Item, and automatically created Pay Leave records (if any)
      2. Creates the default Pay Record, Pay Record Item, and Pay Leave records based on their Employee details
      3. Continues processing as per "TYPE=4 - Update Single Record" below
  TYPE=4 - Update Single Record
  Notes:   1. You would use this Type if you already update the Employee's details, and want it to recalculate their Gross Salary, Tax etc
       
  Additional Parameters:    
  Record Numeric Mandatory
       
  Returns:    
       
  Processing:   1. Based on the Employee's details, and the Pay Record Items, this calculates Salary, Tax, Leave, Superannuation etc
      2. Updates Pay Record with the results
Help!