0

Effective way of marking multiple tasks as not invoiceable

Jaime Zuniga 2 years ago in Home Portal / Classic Projects updated by Juan (Comunica Translations) 2 years ago 5

I have projects with hundreds of tasks and many of these tasks will not be invoiced to the client so they contain no receivables, however, in order for me to close the project I must either add a receivable in the task (which in this case is not needed), or mark the task as not invoiceable.

I don't see the option of doing a multiple change on tasks for marking them as not invoiceable. Does anyone have any effective workarounds for this?

Hi, Jaime. I recently created a macro for this (Groovy). Here's my code:

import com.radzisz.xtrf.model.project.Task

class SetAsUninvoiceable {
def list
def params
// VelocityTagUtils utils = new VelocityTagUtils()

SetAsUninvoiceable(list, params) {
this.list = list
this.params = params
}

def runMacro() {
list.each {Task task ->
task.setInvoiceable(false) }
return 0
}
}

new SetAsUninvoiceable(list, params).runMacro()

You will need to make sure that the "Macro Generates Output" is unticked and that the "Macro Modifies Model Data" is ticked.

Then you can run it from any Tasks view.

Thanks Thomas, I'm 'stealing' this one too! I had the same macro in Velocity and this one was still on the list to rewrite to Groovy. You just saved me the work :-D

Thanks a bunch, Thomas. Tested it and it works as expected. A real time saver...

Much appreciated :clap

Thanks a lot for shring the code.