lbx-invoice
Version:
Provides functionality around generating invoices.
16 lines • 719 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCustomerName = void 0;
/**
* Gets the name of the customer from the given invoice.
* @param invoice - The invoice to get the customers name from.
* @returns The company name if the customer is a company or first name and last name otherwise.
*/
function getCustomerName(invoice) {
if (invoice.customerAddressData.company && invoice.customerAddressData.companyName) {
return invoice.customerAddressData.companyName;
}
return `${invoice.customerAddressData.firstName} ${invoice.customerAddressData.lastName}`;
}
exports.getCustomerName = getCustomerName;
//# sourceMappingURL=get-customer-name.function.js.map