My scripts for this are here:
ListPayrolls.groovy
/*
* Helper script to determine the "payrollId" parameter - fill in the rest of
* config.groovy first, then run this script to list your payrolls and copy
* the relevant ID into the config for use by ProcessPayroll.groovy.
*/
import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
println "Loading config"
def config = new ConfigSlurper().parse(new URL("file:config.groovy"))
This file has been truncated. show original
ProcessPayroll.groovy
/*
* Main script to process a payroll run and create a journal and (optional)
* bank payment transactions in QuickFile. Expects one parameter for the
* week or month number to process, the rest of the parameters are set in
* config.groovy.
*/
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
This file has been truncated. show original
README.md
# MyPAYE -> QuickFile integration
This is a Groovy script to pull payroll data from [MyPAYE](https://www.mypaye.co.uk) and use
it to create a journal and optionally a set of bank transactions in the
[QuickFile](https://www.quickfile.co.uk) accounting package. The MyPAYE API is documented
[here](https://www.mypaye.co.uk/Secure/Help/XMLWebServices/XMLWebServices.pdf) (PDF),
it's fairly straightforward if a bit clunky, and has a couple of weird things (like the payload
you `POST` has to be XML but the `Content-Type` has to be form-urlencoded...) but it wasn't
too difficult for me to get working.
This file has been truncated. show original
There are more than three files. show original
I’m a programmer in my “day job” so I tend to prototype things as command line applications (as these are the simplest type to write when starting out on a new project) and only add a GUI or deeper integration with other things when I have reason to go beyond the prototype. So this “integration” is actually a command-line script written in Groovy. I’ve just updated the README file to hopefully explain it all step by step but feel free to PM me if you have problems with it.
2 Likes