I run a commercial cleaning company. Some of my clients have multiple locations. For example: I have a pharmacy client with 21 different branches.
In the past, when I was manually creating invoice documents in MS Word, I had the Billing Address and then the Location Address for the branch where service was rendered. What’s the best way to accomplish the same thing in Invoice Ninja? (Initially I thought “Shipping Address” might be the solution, but it doesn’t look like I can have more than one per client.)
My invoice numbers are {$client_number}{$client_counter}. So the pharmacy client a specific number as a prefix for all of its invoices, as does each of my clients. I also need all of the pharmacy client’s invoices to have a shared counter. So I suspect Option 1 would not be possible because of these requirements. If I’m wrong and there is a way around it, please let me know.
As for Option 2: are you referring to Settings > Advanced > Custom Fields > Clients? There appears to only be 4 configurable Contact fields there - yet I need to accommodate 20 different addresses. Should I be looking elsewhere?
Summarizing for anyone else that might have this need.
I created a Location Address field in Settings > Advanced > Custom Fields > Contact Field 1.
For any clients I have with multiple locations I either edited an existing contact or or added a new one. The contact details field will now have a Location Address field. Add as many addresses as needed.
When creating a new invoice there will be a checkbox in the upper left to select the applicable contact.
In your custom invoice template, add the $contact.custom1 variable where needed. I added it to the location-details div in the template body, below billing-details:
I needed the City, State, and Zip on a separate line from the Street Address, so I added this script to the Footer section that splits the address at the first comma (this assumes you entered a Location Address in your contact info with a comma after the street address):
//Code generated with ChatGPT
<script>
document.addEventListener('DOMContentLoaded', () => {
const addressElement = document.querySelector('p[data-ref="client_details-location-address"]');
if (addressElement) {
const address = addressElement.textContent;
const parts = address.split(','); // split the address at the comma
if (parts.length > 1) {
addressElement.innerHTML = parts[0] + '<br>' + parts.slice(1).join(',');
}
}
});
</script>