xero-php icon indicating copy to clipboard operation
xero-php copied to clipboard

fromStringArray removing PayTemplate.LeaveLines (+ SuperLines)

Open alys-dext opened this issue 3 years ago • 1 comments

When calling loadByGUID() the LeaveLines are always empty.

I can see that in the original API response within loadByGUID(), the LeaveLines and SuperLines are populated, and it's just after being passed through fromStringArray() that they are removed.

For example, $request->getResponse()->getElements() returns:

[
    {
    ...
        "PayTemplate":{
            "EarningsLines":[
                {
                    "EarningsRateID":"6c4ff208-d143-421f-9721-89c00ee9cc07",
                    "CalculationType":"ENTEREARNINGSRATE",
                    "RatePerUnit":"21.000000",
                    "NormalNumberOfUnits":"35.0000"
                }
            ],
            "DeductionLines":"",
            "SuperLines":[
                {
                    "SuperMembershipID":"b7a7deda-1355-4de0-bba3-ce30b6266e4b",
                    "ContributionType":"SGC",
                    "CalculationType":"PERCENTAGEOFEARNINGS",
                    "MinimumMonthlyEarnings":"450.00",
                    "ExpenseAccountCode":"478",
                    "LiabilityAccountCode":"826",
                    "Percentage":"9.0000"
                }
            ],
            "ReimbursementLines":"",
            "LeaveLines":[
                {
                    "LeaveTypeID":"4538a804-a23f-4b5a-a77b-943a9ea57829",
                    "CalculationType":"BASEDONORDINARYEARNINGS",
                    "AnnualNumberOfUnits":"152.0000",
                    "FullTimeNumberOfUnitsPerPeriod":"76.0000"
                },
                {
                    "LeaveTypeID":"930a0778-b753-4e97-8357-e299d73192ea",
                    "CalculationType":"FIXEDAMOUNTEACHPERIOD",
                    "AnnualNumberOfUnits":"75.0000",
                    "EntitlementFinalPayPayoutType":"NOTPAIDOUT"
                },
                {
                    "LeaveTypeID":"fca4a2aa-60df-4d79-96fc-abbb8b9f1933",
                    "CalculationType":"FIXEDAMOUNTEACHPERIOD",
                    "AnnualNumberOfUnits":"24.0000",
                    "EntitlementFinalPayPayoutType":"NOTPAIDOUT"
                },
                {
                    "LeaveTypeID":"c4a02ceb-b044-4a63-8cf5-380402e9533a",
                    "CalculationType":"FIXEDAMOUNTEACHPERIOD",
                    "AnnualNumberOfUnits":"23.0000",
                    "EntitlementFinalPayPayoutType":"NOTPAIDOUT"
                }
            ]
        },
    ...
    }
]

VS what is returned from loadByGUID():

{
...
    "PayTemplate":{
        "EarningsLines":[
            {
                "EarningsRateID":"6c4ff208-d143-421f-9721-89c00ee9cc07",
                "CalculationType":"ENTEREARNINGSRATE",
                "RatePerUnit":"21",
                "NormalNumberOfUnits":"35"
            }
        ],
        "SuperLines":[
            
        ],
        "LeaveLines":[
            
        ]
    },
...
}

I haven't managed to drill down into it and figure out exactly what's going wrong, is this something you're able to look into?

alys-dext avatar Jan 27 '22 16:01 alys-dext

@alys-dext I suspect it relates to the code around Remote/Model.php#L215, but I haven't got an easy way to test this at the moment.

Which payroll country are you using?

calcinai avatar Jan 27 '22 18:01 calcinai