Skip to content

Instantly share code, notes, and snippets.

@jayshields
Created September 28, 2016 13:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayshields/860cf454a408740449209f6ec0c7f549 to your computer and use it in GitHub Desktop.
Save jayshields/860cf454a408740449209f6ec0c7f549 to your computer and use it in GitHub Desktop.
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
Copy link
Author

jayshields 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