Method GetLeaveTransactions

Type: FusionOSServices.Controllers.PYLeaveController

Summary

REST service that returns information about LeaveTransactions. Each transaction will contain the name of the leave, the type of transaction and the number of hours. Additional information can be request via paramaters.

Example

GET https://fusion.superion.com/FusionOSServices/v1/ONESolution/Payroll/LeaveTransactions/E01010?fields=hrpeid,trnsdate,numcd&ReportBegin=1/1/2015

Parameters

TypeDescription
System.String If supplied, the response will be limited to just those transactions associated with the given employee.

Sample Code

using System.Net;

public void MethodName(parms){
    string uri = "https://fusion.superion.com/FusionOSServices/v1/ONESolution/Payroll/LeaveTransactions/E01010?fields=hrpeid,trnsdate,numcd&ReportBegin=1/1/2015";
    WebClient wc = new WebClient();
    Common.SetResponseType(wc, "json");
    Common.SetLicenseKey(wc);
    string stringResult = wc.DownloadString(new Uri(uri));
    
    JObject response = JObject.Parse(stringResult);
    string error = response["OutputParms"]["ErrorCode"].ToString();
    if (error != "0000")
    {
       // TODO
    }
}

$.get('https://fusion.superion.com/FusionOSServices/v1/ONESolution/Payroll/LeaveTransactions/E01010?fields=hrpeid,trnsdate,numcd&ReportBegin=1/1/2015', function(response) {
    $('#resultDiv).html(response); 
 });

Sample Responses


                        
            {
              "RequestResponse": {
                "Count": "4",
                "DATA": {
                  "Transaction": [
                    {
                      "LeaveType": "Sick Leave",
                      "Description": "SICK ACCRUAL",
                      "Hours": "8.00000",
                      "HRPEID": "E01010",
                      "TRNSDATE": "2/28/2015 12:00:00 AM",
                      "NUMCD": "2235"
                    },
                    {
                      "LeaveType": "Sick Leave",
                      "Description": "SICK ACCRUAL",
                      "Hours": "8.00000",
                      "HRPEID": "E01010",
                      "TRNSDATE": "12/31/2015 12:00:00 AM",
                      "NUMCD": "2242"
                    },
                    {
                      "LeaveType": "Vacation",
                      "Description": "VACATION ACCRUAL",
                      "Hours": "40.00000",
                      "HRPEID": "E01010",
                      "TRNSDATE": "1/31/2016 12:00:00 AM",
                      "NUMCD": "2243"
                    },
                    {
                      "LeaveType": "Vacation",
                      "Description": "VACATION USED",
                      "Hours": "-61.00000",
                      "HRPEID": "E01010",
                      "TRNSDATE": "1/31/2016 12:00:00 AM",
                      "NUMCD": "2243"
                    }
                  ]
                }
              }
            }
        

Remarks

Allowed values for the Fields paramater include: hrpeid (employee ID), pyppercc (pay period number), checkno (pay check or EFT statement number), cdhno (the hour number), amount (the dollar amount associated with the transaction) and numcd (the payroll num cd). these values can also be use as filters, for example, "?trnsdate=1/1/2017" would limit the response to just those transaction occuring on January 1st, 2017. Query string options SkipRows: The number of rows at the begining of the query to not report. TakeRows: The number of rows from the query to report. If left blank the default is 1000. ?TakeRows=10 results in only 10 rows being returned. ?SkipRows=10 results in all rows after row 10 being returned. ?SkipRows=10&TakeRows=10 results in rows 11 through 20 being returned. Fields: A list of table columns to be included in the query. If this is included in the query string then only the listed columns will be reported. (note that the examples below are for HREmpmstr, but similar ideas can be applied to any table) ?fields=fname,lname results in only the first and last name being reported. Columns can be renamed by appending the new name after the default name. ?fields=fname+FirstName,lname+LastName Filters: Any column name can be added to the query string as a filter. For example ?fname=Dan ?hdt=1/1/2017 By default the filter comparison is equality. Other comparison are available and can be appended to the filter "?fname=Dan+like " will select Dan, Daniel and Dannie "?hdt=1/1/2017+gt" will include all dates after 1/1/2017 Available comparisons are: "ge", greater than or equal to (>=) "gt", greater than (>) "isnotnull", is not null "isnull", is null "le", less than or equal to (<=) "like", like "lt", less than (<) "ne", not equal (!= , <>) "notlike", not like