diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/point_of_sale/static/src/xml/Screens/ReceiptScreen | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/point_of_sale/static/src/xml/Screens/ReceiptScreen')
3 files changed, 268 insertions, 0 deletions
diff --git a/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml new file mode 100644 index 00000000..379b360d --- /dev/null +++ b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates id="template" xml:space="preserve"> + + <t t-name="OrderReceipt" owl="1"> + <div class="pos-receipt"> + <t t-if="receipt.company.logo"> + <img class="pos-receipt-logo" t-att-src="receipt.company.logo" alt="Logo"/> + <br/> + </t> + <t t-if="!receipt.company.logo"> + <h2 class="pos-receipt-center-align"> + <t t-esc="receipt.company.name" /> + </h2> + <br/> + </t> + <div class="pos-receipt-contact"> + <t t-if="receipt.company.contact_address"> + <div><t t-esc="receipt.company.contact_address" /></div> + </t> + <t t-if="receipt.company.phone"> + <div>Tel:<t t-esc="receipt.company.phone" /></div> + </t> + <t t-if="receipt.company.vat"> + <div><t t-esc="receipt.company.vat_label"/>:<t t-esc="receipt.company.vat" /></div> + </t> + <t t-if="receipt.company.email"> + <div><t t-esc="receipt.company.email" /></div> + </t> + <t t-if="receipt.company.website"> + <div><t t-esc="receipt.company.website" /></div> + </t> + <t t-if="receipt.header_html"> + <t t-raw="receipt.header_html" /> + </t> + <t t-if="!receipt.header_html and receipt.header"> + <div style="white-space:pre-line"><t t-esc="receipt.header" /></div> + </t> + <t t-if="receipt.cashier"> + <div class="cashier"> + <div>--------------------------------</div> + <div>Served by <t t-esc="receipt.cashier" /></div> + </div> + </t> + </div> + <br /><br /> + + <!-- Orderlines --> + + <div class="orderlines"> + <t t-foreach="receipt.orderlines" t-as="line" t-key="line.id"> + <t t-if="isSimple(line)"> + <div> + <t t-esc="line.product_name_wrapped[0]" /> + <span t-esc="env.pos.format_currency_no_symbol(line.price_display)" class="price_display pos-receipt-right-align"/> + </div> + <WrappedProductNameLines line="line" /> + </t> + <t t-else=""> + <div t-esc="line.product_name_wrapped[0]" /> + <WrappedProductNameLines line="line" /> + <t t-if="line.display_discount_policy == 'without_discount' and line.price != line.price_lst"> + <div class="pos-receipt-left-padding"> + <t t-esc="env.pos.format_currency_no_symbol(line.price_lst)" /> + -> + <t t-esc="env.pos.format_currency_no_symbol(line.price)" /> + </div> + </t> + <t t-elif="line.discount !== 0"> + <div class="pos-receipt-left-padding"> + <t t-if="env.pos.config.iface_tax_included === 'total'"> + <t t-esc="env.pos.format_currency_no_symbol(line.price_with_tax_before_discount)"/> + </t> + <t t-else=""> + <t t-esc="env.pos.format_currency_no_symbol(line.price)"/> + </t> + </div> + </t> + <t t-if="line.discount !== 0"> + <div class="pos-receipt-left-padding"> + Discount: <t t-esc="line.discount" />% + </div> + </t> + <div class="pos-receipt-left-padding"> + <t t-esc="Math.round(line.quantity * Math.pow(10, env.pos.dp['Product Unit of Measure'])) / Math.pow(10, env.pos.dp['Product Unit of Measure'])"/> + <t t-if="!line.is_in_unit" t-esc="line.unit_name" /> + x + <t t-esc="env.pos.format_currency_no_symbol(line.price_display_one)" /> + <span class="price_display pos-receipt-right-align"> + <t t-esc="env.pos.format_currency_no_symbol(line.price_display)" /> + </span> + </div> + </t> + <t t-if="line.pack_lot_lines"> + <div class="pos-receipt-left-padding"> + <ul> + <t t-foreach="line.pack_lot_lines" t-as="lot" t-key="lot.cid"> + <li> + SN <t t-esc="lot.attributes['lot_name']"/> + </li> + </t> + </ul> + </div> + </t> + </t> + </div> + + <!-- Subtotal --> + + <t t-if="!isTaxIncluded"> + <div class="pos-receipt-right-align">--------</div> + <br/> + <div>Subtotal<span t-esc="env.pos.format_currency(receipt.subtotal)" class="pos-receipt-right-align"/></div> + <t t-foreach="receipt.tax_details" t-as="tax" t-key="tax.name"> + <div> + <t t-esc="tax.name" /> + <span t-esc='env.pos.format_currency_no_symbol(tax.amount)' class="pos-receipt-right-align"/> + </div> + </t> + </t> + + <!-- Total --> + <div class="pos-receipt-right-align">--------</div> + <br/> + <div class="pos-receipt-amount"> + TOTAL + <span t-esc="env.pos.format_currency(receipt.total_with_tax)" class="pos-receipt-right-align"/> + </div> + <t t-if="receipt.total_rounded != receipt.total_with_tax"> + <div class="pos-receipt-amount"> + Rounding + <span t-esc='env.pos.format_currency(receipt.rounding_applied)' class="pos-receipt-right-align"/> + </div> + <div class="pos-receipt-amount"> + To Pay + <span t-esc='env.pos.format_currency(receipt.total_rounded)' class="pos-receipt-right-align"/> + </div> + </t> + <br/><br/> + + <!-- Payment Lines --> + + <t t-foreach="receipt.paymentlines" t-as="line" t-key="line.cid"> + <div> + <t t-esc="line.name" /> + <span t-esc="env.pos.format_currency_no_symbol(line.amount)" class="pos-receipt-right-align"/> + </div> + </t> + <br/> + + <div class="pos-receipt-amount receipt-change"> + CHANGE + <span t-esc="env.pos.format_currency(receipt.change)" class="pos-receipt-right-align"/> + </div> + <br/> + + <!-- Extra Payment Info --> + + <t t-if="receipt.total_discount"> + <div> + Discounts + <span t-esc="env.pos.format_currency(receipt.total_discount)" class="pos-receipt-right-align"/> + </div> + </t> + <t t-if="isTaxIncluded"> + <t t-foreach="receipt.tax_details" t-as="tax" t-key="tax.name"> + <div> + <t t-esc="tax.name" /> + <span t-esc="env.pos.format_currency_no_symbol(tax.amount)" class="pos-receipt-right-align"/> + </div> + </t> + <div> + Total Taxes + <span t-esc="env.pos.format_currency(receipt.total_tax)" class="pos-receipt-right-align"/> + </div> + </t> + + <div class="before-footer" /> + + <!-- Footer --> + <div t-if="receipt.footer_html" class="pos-receipt-center-align"> + <t t-raw="receipt.footer_html" /> + </div> + + <div t-if="!receipt.footer_html and receipt.footer" class="pos-receipt-center-align" style="white-space:pre-line"> + <br/> + <t t-esc="receipt.footer" /> + <br/> + <br/> + </div> + + <div class="after-footer"> + <t t-foreach="receipt.paymentlines" t-as="line"> + <t t-if="line.ticket"> + <br /> + <div class="pos-payment-terminal-receipt"> + <t t-raw="line.ticket" /> + </div> + </t> + </t> + </div> + + <br/> + <div class="pos-receipt-order-data"> + <div><t t-esc="receipt.name" /></div> + <div><t t-esc="receipt.date.localestring" /></div> + </div> + + </div> + </t> + +</templates> diff --git a/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml new file mode 100644 index 00000000..8f0bd54a --- /dev/null +++ b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates id="template" xml:space="preserve"> + + <t t-name="ReceiptScreen" owl="1"> + <div class="receipt-screen screen"> + <div class="screen-content"> + <div class="top-content"> + <div class="top-content-center"> + <h1 t-if="!env.isMobile"> + <t t-esc="orderAmountPlusTip" /> + </h1> + </div> + <div class="button next" t-att-class="{ highlight: !locked }" + t-on-click="orderDone"> + New Order <i class="fa fa-angle-double-right"></i> + </div> + </div> + <div class="default-view"> + <div class="pos-receipt-container"> + <OrderReceipt order="currentOrder" t-ref="order-receipt" /> + </div> + <div class="actions"> + <h1>How would you like to receive your receipt?</h1> + <div class="buttons"> + <div class="button print" t-on-click="printReceipt"> + <i class="fa fa-print"></i> Print Receipt + </div> + </div> + <form t-on-submit.prevent="onSendEmail" class="send-email"> + <div class="email-icon"><i class="fa fa-envelope-o" aria-hidden="true"></i></div> + <div class="input-email"> + <input type="email" placeholder="Email Receipt" t-model="orderUiState.inputEmail" /> + <button class="send" t-att-class="{ highlight: is_email(orderUiState.inputEmail) }" type="submit">Send</button> + </div> + </form> + <t t-if="orderUiState.emailSuccessful !== null"> + <div class="notice" t-attf-class="{{ orderUiState.emailSuccessful ? 'successful' : 'failed' }}"> + <t t-esc="orderUiState.emailNotice"></t> + </div> + </t> + </div> + </div> + </div> + </div> + </t> + +</templates> diff --git a/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/WrappedProductNameLines.xml b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/WrappedProductNameLines.xml new file mode 100644 index 00000000..d49061a8 --- /dev/null +++ b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/WrappedProductNameLines.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates id="template" xml:space="preserve"> + + <t t-name="WrappedProductNameLines" owl="1"> + <span> + <t t-foreach="props.line.product_name_wrapped.slice(1)" t-as="wrapped_line"><t t-esc="wrapped_line"/></t> + </span> + </t> + +</templates> |
