1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Don't show clients w/o names

This commit is contained in:
Hillel Coren 2016-07-18 22:53:54 +03:00
parent 7cb797fcc2
commit 60982deb08
2 changed files with 12 additions and 4 deletions

View File

@ -30395,7 +30395,11 @@ function populateInvoiceComboboxes(clientId, invoiceId) {
$clientSelect.append(new Option('', ''));
for (var i=0; i<clients.length; i++) {
var client = clients[i];
$clientSelect.append(new Option(getClientDisplayName(client), client.public_id));
var clientName = getClientDisplayName(client);
if (!clientName) {
continue;
}
$clientSelect.append(new Option(clientName, client.public_id));
}
if (clientId) {
@ -30419,7 +30423,7 @@ function populateInvoiceComboboxes(clientId, invoiceId) {
for (var i=0; i<list.length; i++) {
var invoice = list[i];
var client = clientMap[invoice.client.public_id];
if (!client) continue; // client is deleted/archived
if (!client || !getClientDisplayName(client)) continue; // client is deleted/archived
$invoiceCombobox.append(new Option(invoice.invoice_number + ' - ' + invoice.invoice_status.name + ' - ' +
getClientDisplayName(client) + ' - ' + formatMoneyInvoice(invoice.amount, invoice) + ' | ' +
formatMoneyInvoice(invoice.balance, invoice), invoice.public_id));

View File

@ -501,7 +501,11 @@ function populateInvoiceComboboxes(clientId, invoiceId) {
$clientSelect.append(new Option('', ''));
for (var i=0; i<clients.length; i++) {
var client = clients[i];
$clientSelect.append(new Option(getClientDisplayName(client), client.public_id));
var clientName = getClientDisplayName(client);
if (!clientName) {
continue;
}
$clientSelect.append(new Option(clientName, client.public_id));
}
if (clientId) {
@ -525,7 +529,7 @@ function populateInvoiceComboboxes(clientId, invoiceId) {
for (var i=0; i<list.length; i++) {
var invoice = list[i];
var client = clientMap[invoice.client.public_id];
if (!client) continue; // client is deleted/archived
if (!client || !getClientDisplayName(client)) continue; // client is deleted/archived
$invoiceCombobox.append(new Option(invoice.invoice_number + ' - ' + invoice.invoice_status.name + ' - ' +
getClientDisplayName(client) + ' - ' + formatMoneyInvoice(invoice.amount, invoice) + ' | ' +
formatMoneyInvoice(invoice.balance, invoice), invoice.public_id));