kingga/workflow-timesheet

Xero workflow weekly CSV parser.

1.0.0 2019-07-26 06:37 UTC

README

This small package parses the CSV export function from Xero's Workflow timesheet system into a set of container classes. The format will look something like this:

Week: [
    getStart() => DateTime
    getEnd() => DateTime
    getTotalTime() => Float
    getDays() => [
        Day: [
            getDate() => DateTime
            getDayName() => String [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]
            getTotalTime() => Float
            getEntries() => [
                Entry: [
                    getClient() => String
                    getJobId() => String
                    getJob() => String
                    getTask() => String
                    getTime() => Float
                ]
            ]
        ]
    ]
]

Installation

Run the command composer require kingga/workflow-timesheet.

Usage

$parser = new Kingga\WorkflowTimesheet\Parser;
$timesheet = $parser->parse(__DIR__ . '/Time-Sheet.csv');

dd($timesheet);

Testing

Run the command composer test.