I need help formulating how to calculate the total number of invoices shown below. I want the total number of invoices to display zero if the count only reflects resolved invoices, or if the number of resolved invoices exceeds the pending status and additional items.