feat: invoice, estimate and receipt printing.

This commit is contained in:
a.bouhuolia
2021-08-17 10:47:04 +02:00
parent 70939c5741
commit 160b8b6a1b
50 changed files with 3607 additions and 120 deletions

View File

@@ -0,0 +1,67 @@
extends ../PaperTemplateLayout.pug
block head
style
include ../../css/modules/estimate.css
block content
div.estimate
div.estimate__header
div.organization
h3.title #{organizationName}
if organizationEmail
span.email #{organizationEmail}
div.paper
h1.title #{__("estimate.paper.estimate")}
span.email #{saleEstimate.estimateNumber}
div.estimate__meta
div.estimate__meta-item.estimate__meta-item--amount
span.label #{__('estimate.paper.due_amount')}
span.value #{saleEstimate.formattedAmount}
div.estimate__meta-item.estimate__meta-item--billed-to
span.label #{__("estimate.paper.billed_to")}
span.value #{saleEstimate.customer.displayName}
div.estimate__meta-item.estimate__meta-item--estimate-date
span.label #{__("estimate.paper.estimate_date")}
span.value #{saleEstimate.formattedEstimateDate}
if saleEstimate.estimateNumber
div.estimate__meta-item.estimate__meta-item--estimate-number
span.label #{__("estimate.paper.estimate_number")}
span.value #{saleEstimate.estimateNumber}
div.estimate__meta-item.estimate__meta-item--due-date
span.label #{__("estimate.paper.expiration_date")}
span.value #{saleEstimate.formattedExpirationDate}
div.estimate__table
table
thead
tr
th.item #{__("item_entry.paper.item_name")}
th.rate #{__("item_entry.paper.rate")}
th.quantity #{__("item_entry.paper.quantity")}
th.total #{__("item_entry.paper.total")}
tbody
each entry in saleEstimate.entries
tr
td.item
div.title=entry.item.name
span.description=entry.description
td.rate=entry.rate
td.quantity=entry.quantity
td.total=entry.amount
if saleEstimate.termsConditions
div.estimate__conditions
h3 #{__("estimate.paper.conditions_title")}
p #{saleEstimate.termsConditions}
if saleEstimate.note
div.estimate__notes
h3 #{__("estimate.paper.notes_title")}
p #{saleEstimate.note}

View File

@@ -0,0 +1,68 @@
extends ../PaperTemplateLayout.pug
block head
style
include ../../css/modules/invoice.css
block content
div.invoice
div.invoice__header
div.organization
h3.title #{organizationName}
if organizationEmail
span.email #{organizationEmail}
div.paper
h1.title #{__("invoice.paper.invoice")}
if saleInvoice.invoiceNo
span.email #{saleInvoice.invoiceNo}
div.invoice__meta
div.invoice__meta-item.invoice__meta-item--amount
span.label #{__('estimate.paper.due_amount')}
span.value #{saleInvoice.formattedAmount}
div.invoice__meta-item.invoice__meta-item--billed-to
span.label #{__("invoice.paper.billed_to")}
span.value #{saleInvoice.customer.displayName}
div.invoice__meta-item.invoice__meta-item--invoice-date
span.label #{__("invoice.paper.invoice_date")}
span.value #{saleInvoice.formattedInvoiceDate}
if saleInvoice.invoiceNo
div.invoice__meta-item.invoice__meta-item--invoice-number
span.label #{__("invoice.paper.invoice_number")}
span.value #{saleInvoice.invoiceNo}
div.invoice__meta-item.invoice__meta-item--due-date
span.label #{__("invoice.paper.due_date")}
span.value #{saleInvoice.formattedDueDate}
div.invoice__table
table
thead
tr
th.item #{__("item_entry.paper.item_name")}
th.rate #{__("item_entry.paper.rate")}
th.quantity #{__("item_entry.paper.quantity")}
th.total #{__("item_entry.paper.total")}
tbody
each entry in saleInvoice.entries
tr
td.item
div.title=entry.item.name
span.description=entry.description
td.rate=entry.rate
td.quantity=entry.quantity
td.total=entry.amount
if saleInvoice.termsConditions
div.invoice__conditions
h3 #{__("invoice.paper.conditions_title")}
p #{saleInvoice.termsConditions}
if saleInvoice.invoiceMessage
div.invoice__notes
h3 #{__("invoice.paper.notes_title")}
p #{saleInvoice.invoiceMessage}

View File

@@ -0,0 +1,61 @@
extends ../PaperTemplateLayout.pug
block head
style
include ../../css/modules/receipt.css
block content
div.receipt
div.receipt__header
div.organization
h3.title #{organizationName}
if organizationEmail
span.email #{organizationEmail}
div.paper
h1.title #{__("receipt.paper.receipt")}
span.email #{saleReceipt.receiptNumber}
div.receipt__meta
div.receipt__meta-item.receipt__meta-item--amount
span.label #{__('receipt.paper.receipt_amount')}
span.value #{saleReceipt.formattedAmount}
div.receipt__meta-item.receipt__meta-item--billed-to
span.label #{__("receipt.paper.billed_to")}
span.value #{saleReceipt.customer.displayName}
div.receipt__meta-item.receipt__meta-item--invoice-date
span.label #{__("receipt.paper.receipt_date")}
span.value #{saleReceipt.formattedReceiptDate}
if saleReceipt.receiptNumber
div.receipt__meta-item.receipt__meta-item--invoice-number
span.label #{__("receipt.paper.receipt_number")}
span.value #{saleReceipt.receiptNumber}
div.receipt__table
table
thead
tr
th.item #{__("item_entry.paper.item_name")}
th.rate #{__("item_entry.paper.rate")}
th.quantity #{__("item_entry.paper.quantity")}
th.total #{__("item_entry.paper.total")}
tbody
each entry in saleReceipt.entries
tr
td.item=entry.item.name
td.rate=entry.rate
td.quantity=entry.quantity
td.total=entry.amount
if saleReceipt.statement
div.receipt__conditions
h3 #{__("receipt.paper.statement_title")}
p #{saleReceipt.statement}
if saleReceipt.receiptMessage
div.receipt__notes
h3 #{__("receipt.paper.notes_title")}
p #{saleReceipt.receiptMessage}