diff --git a/public/built.js b/public/built.js index 057cb33087d5..ec12bb7b307b 100644 --- a/public/built.js +++ b/public/built.js @@ -46570,15 +46570,13 @@ function displayAccount(doc, invoice, x, y, layout) { return; } - var data = [ + var data1 = [ account.name, account.work_email, account.work_phone ]; - displayGrid(doc, invoice, data, x, y, layout, {hasHeader:true}); - - data = [ + var data2 = [ concatStrings(account.address1, account.address2), concatStrings(account.city, account.state, account.postal_code), account.country ? account.country.name : false, @@ -46586,13 +46584,21 @@ function displayAccount(doc, invoice, x, y, layout) { invoice.account.custom_value2 ? invoice.account['custom_label2'] + ' ' + invoice.account.custom_value2 : false, ]; - var nameWidth = account.name ? (doc.getStringUnitWidth(account.name) * doc.internal.getFontSize() * 1.1) : 0; - var emailWidth = account.work_email ? (doc.getStringUnitWidth(account.work_email) * doc.internal.getFontSize() * 1.1) : 0; - width = Math.max(emailWidth, nameWidth, 120); + if (layout.singleColumn) { - x += width; + displayGrid(doc, invoice, data1.concat(data2), x, y, layout, {hasHeader:true}); - displayGrid(doc, invoice, data, x, y, layout); + } else { + + displayGrid(doc, invoice, data1, x, y, layout, {hasHeader:true}); + + var nameWidth = account.name ? (doc.getStringUnitWidth(account.name) * doc.internal.getFontSize() * 1.1) : 0; + var emailWidth = account.work_email ? (doc.getStringUnitWidth(account.work_email) * doc.internal.getFontSize() * 1.1) : 0; + width = Math.max(emailWidth, nameWidth, 120); + x += width; + + displayGrid(doc, invoice, data2, x, y, layout); + } } @@ -46606,7 +46612,7 @@ function displayClient(doc, invoice, x, y, layout) { concatStrings(client.address1, client.address2), concatStrings(client.city, client.state, client.postal_code), client.country ? client.country.name : false, - client.contacts ? client.contacts[0].email : false, + client.contacts && getClientDisplayName(client) != client.contacts[0].email ? client.contacts[0].email : false, invoice.client.custom_value1 ? invoice.account['custom_client_label1'] + ' ' + invoice.client.custom_value1 : false, invoice.client.custom_value2 ? invoice.account['custom_client_label2'] + ' ' + invoice.client.custom_value2 : false, ]; @@ -46895,11 +46901,6 @@ function getInvoiceTaxRate(invoice) { function displayInvoiceHeader(doc, invoice, layout) { - var costX = layout.unitCostRight - (doc.getStringUnitWidth(invoiceLabels.unit_cost) * doc.internal.getFontSize()); - var qtyX = layout.qtyRight - (doc.getStringUnitWidth(invoiceLabels.quantity) * doc.internal.getFontSize()); - var taxX = layout.taxRight - (doc.getStringUnitWidth(invoiceLabels.tax) * doc.internal.getFontSize()); - var totalX = layout.lineTotalRight - (doc.getStringUnitWidth(invoiceLabels.line_total) * doc.internal.getFontSize()); - if (invoice.invoice_design_id == 6 || invoice.invoice_design_id == 8 || invoice.invoice_design_id == 10) { invoiceLabels.item = invoiceLabels.item.toUpperCase(); invoiceLabels.description = invoiceLabels.description.toUpperCase(); @@ -46909,6 +46910,11 @@ function displayInvoiceHeader(doc, invoice, layout) { invoiceLabels.tax = invoiceLabels.tax.toUpperCase(); } + var costX = layout.unitCostRight - (doc.getStringUnitWidth(invoiceLabels.unit_cost) * doc.internal.getFontSize()); + var qtyX = layout.qtyRight - (doc.getStringUnitWidth(invoiceLabels.quantity) * doc.internal.getFontSize()); + var taxX = layout.taxRight - (doc.getStringUnitWidth(invoiceLabels.tax) * doc.internal.getFontSize()); + var totalX = layout.lineTotalRight - (doc.getStringUnitWidth(invoiceLabels.line_total) * doc.internal.getFontSize()); + doc.text(layout.marginLeft, layout.tableTop, invoiceLabels.item); doc.text(layout.descriptionLeft, layout.tableTop, invoiceLabels.description); doc.text(costX, layout.tableTop, invoiceLabels.unit_cost); @@ -46937,6 +46943,23 @@ function displayInvoiceItems(doc, invoice, layout) { doc.setFontSize(8); for (var i=0; i