Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Active Collab invoice total bookmarklet
$('[ng-repeat="invoices in grouped_invoices"]').each(function(){
var total = 0;
$(this).find('.invoice_card_amount_number').each(function(){
total += parseInt($(this).text().replace(',','').replace('.00',''));
});
$(this).find('h2.lighter').text($(this).find('h2.lighter').text()+''+total+')');
});
@jayshields

This comment has been minimized.

Copy link
Owner Author

commented Sep 28, 2016

Just create a new bookmark and set the page to:

javascript:$('[ng-repeat="invoices in grouped_invoices"]').each(function(){ var total = 0; $(this).find('.invoice_card_amount_number').each(function(){ total += parseInt($(this).text().replace(',','').replace('.00','')); }); $(this).find('h2.lighter').text($(this).find('h2.lighter').text()+' (£'+total+')'); });

Then click the bookmark whenever you're on the Invoices page in Active Collab, and it'll give you a sum total in the headers of the grouped invoices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.