diff --git a/packages/server/resources/locales/en.json b/packages/server/resources/locales/en.json index 293186e9e..120aed816 100644 --- a/packages/server/resources/locales/en.json +++ b/packages/server/resources/locales/en.json @@ -176,6 +176,7 @@ "invoice.paper.conditions_title": "Conditions & terms", "invoice.paper.notes_title": "Notes", "invoice.paper.total": "Total", + "invoice.paper.subtotal": "Subtotal", "invoice.paper.payment_amount": "Payment Amount", "invoice.paper.balance_due": "Balance Due", diff --git a/packages/server/resources/scss/modules/invoice.scss b/packages/server/resources/scss/modules/invoice.scss index 98d8dd1a7..c5b84f8fb 100644 --- a/packages/server/resources/scss/modules/invoice.scss +++ b/packages/server/resources/scss/modules/invoice.scss @@ -137,10 +137,14 @@ tbody tr.payment-amount td:last-child { color: red } - tbody tr.blanace-due td { + tbody tr.blanace-due td{ border-top: 3px double #666; font-weight: bold; } + tbody tr.total td { + border-top: 1px solid #666; + font-weight: bold; + } } } diff --git a/packages/server/resources/views/modules/invoice-regular.pug b/packages/server/resources/views/modules/invoice-regular.pug index 00416b97c..edddcaf9c 100644 --- a/packages/server/resources/views/modules/invoice-regular.pug +++ b/packages/server/resources/views/modules/invoice-regular.pug @@ -22,12 +22,12 @@ block content div.invoice__due-amount div.label #{__('invoice.paper.invoice_amount')} - div.amount #{saleInvoice.formattedAmount} + div.amount #{saleInvoice.totalFormatted} div.invoice__meta div.invoice__meta-item.invoice__meta-item--amount span.label #{__('invoice.paper.due_amount')} - span.value #{saleInvoice.formattedDueAmount} + span.value #{saleInvoice.dueAmountFormatted} div.invoice__meta-item.invoice__meta-item--billed-to span.label #{__("invoice.paper.billed_to")} @@ -35,11 +35,11 @@ block content div.invoice__meta-item.invoice__meta-item--invoice-date span.label #{__("invoice.paper.invoice_date")} - span.value #{saleInvoice.formattedInvoiceDate} + span.value #{saleInvoice.invoiceDateFormatted} div.invoice__meta-item.invoice__meta-item--due-date span.label #{__("invoice.paper.due_date")} - span.value #{saleInvoice.formattedDueDate} + span.value #{saleInvoice.dueDateFormatted} div.invoice__table table @@ -63,15 +63,22 @@ block content div.invoice__table-total table tbody + tr.subtotal + td #{__('invoice.paper.subtotal')} + td #{saleInvoice.subtotalFormatted} + each tax in saleInvoice.taxes + tr.tax_line + td #{tax.name} [#{tax.taxRate}%] + td #{tax.taxRateAmountFormatted} tr.total td #{__('invoice.paper.total')} - td #{saleInvoice.formattedAmount} + td #{saleInvoice.totalFormatted} tr.payment-amount td #{__('invoice.paper.payment_amount')} - td #{saleInvoice.formattedPaymentAmount} + td #{saleInvoice.paymentAmountFormatted} tr.blanace-due td #{__('invoice.paper.balance_due')} - td #{saleInvoice.formattedDueAmount} + td #{saleInvoice.dueAmountFormatted} div.invoice__footer if saleInvoice.termsConditions diff --git a/packages/server/resources/views/modules/payment-receive-standard.pug b/packages/server/resources/views/modules/payment-receive-standard.pug index b3aa1fe26..ee415b768 100644 --- a/packages/server/resources/views/modules/payment-receive-standard.pug +++ b/packages/server/resources/views/modules/payment-receive-standard.pug @@ -45,9 +45,9 @@ block content each entry in paymentReceive.entries tr td.item=entry.invoice.invoiceNo - td.date=entry.invoice.formattedInvoiceDate - td.invoiceAmount=entry.invoice.formattedAmount - td.paymentAmount=entry.invoice.formattedPaymentAmount + td.date=entry.invoice.invoiceDateFormatted + td.invoiceAmount=entry.invoice.totalFormatted + td.paymentAmount=entry.invoice.paymentAmountFormatted div.payment__table-after div.payment__table-total diff --git a/packages/server/src/services/Sales/Invoices/CommandSaleInvoiceValidators.ts b/packages/server/src/services/Sales/Invoices/CommandSaleInvoiceValidators.ts index 983abcc6f..c0786ad4b 100644 --- a/packages/server/src/services/Sales/Invoices/CommandSaleInvoiceValidators.ts +++ b/packages/server/src/services/Sales/Invoices/CommandSaleInvoiceValidators.ts @@ -21,6 +21,9 @@ export class CommandSaleInvoiceValidators { /** * Validate whether sale invoice number unqiue on the storage. + * @param {number} tenantId - + * @param {string} invoiceNumber - + * @param {number} notInvoiceId - */ public async validateInvoiceNumberUnique( tenantId: number,