mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
@@ -2,7 +2,12 @@
|
||||
<odoo>
|
||||
<template id="report_folio_document">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" />
|
||||
<t t-if="doc">
|
||||
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" />
|
||||
</t>
|
||||
<t t-if="folio">
|
||||
<t t-set="doc" t-value="folio" />
|
||||
</t>
|
||||
<t t-set="address">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
</t>
|
||||
<!-- main content-->
|
||||
<div t-attf-class="card col-8 p-3" id="portal_folio_content">
|
||||
<div t-call="pms.folio_portal_content" />
|
||||
<div t-call="pms.report_folio_document" />
|
||||
</div>
|
||||
<!-- chatter -->
|
||||
<div class="col-3" />
|
||||
@@ -288,310 +288,4 @@
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="folio_portal_content" name="Folio Portal Content">
|
||||
<t t-call="web.external_layout" />
|
||||
<t t-set="address">
|
||||
<div
|
||||
class="row pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}"
|
||||
>
|
||||
<div class="col-xs-6">
|
||||
<t
|
||||
t-if="folio.partner_invoice_ids and folio.partner_invoice_ids[0] != folio.partner_id"
|
||||
>
|
||||
<div
|
||||
t-esc="folio.partner_invoice_ids[0]"
|
||||
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'
|
||||
/>
|
||||
</t>
|
||||
</div>
|
||||
<div class="col-xs-5 col-xs-offset-1">
|
||||
<t t-if="folio.partner_id">
|
||||
<div
|
||||
t-field="folio.partner_id"
|
||||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'
|
||||
/>
|
||||
<p t-if="folio.partner_id.vat">
|
||||
<t
|
||||
t-esc="folio.company_id.country_id.vat_label or 'TIN'"
|
||||
/>
|
||||
:
|
||||
<span t-field="folio.partner_id.vat" />
|
||||
</p>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div t-field="folio.partner_name" />
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<div class="page">
|
||||
<div class="oe_structure" />
|
||||
|
||||
<h2 class="mt16">
|
||||
<span t-if="folio.state not in ['draft','sent']">Order #</span>
|
||||
<span t-if="folio.state in ['draft','sent']">Quotation #</span>
|
||||
<span t-field="folio.name" />
|
||||
</h2>
|
||||
|
||||
<div class="row mt32 mb32" id="informations">
|
||||
<div t-if="folio.client_order_ref" class="mb-3 col-6">
|
||||
<strong>Your Reference:</strong>
|
||||
<p class="m-0" t-field="folio.client_order_ref" />
|
||||
</div>
|
||||
<div
|
||||
t-if="folio.date_order and folio.state not in ['draft','sent']"
|
||||
class="mb-3 col-6"
|
||||
>
|
||||
<strong>Order Date:</strong>
|
||||
<p class="m-0" t-field="folio.date_order" />
|
||||
</div>
|
||||
<div
|
||||
t-if="folio.date_order and folio.state in ['draft','sent']"
|
||||
class="mb-3 col-6"
|
||||
>
|
||||
<strong>Quotation Date:</strong>
|
||||
<p
|
||||
class="mb-3 col-6"
|
||||
t-field="folio.date_order"
|
||||
t-options='{"widget": "date"}'
|
||||
/>
|
||||
</div>
|
||||
<!-- <div t-if="folio.user_id.name" class="mb-3 col-6">
|
||||
<strong>Salesperson:</strong>
|
||||
<p class="m-0" t-field="folio.user_id" />
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- Is there a discount on at least one line? -->
|
||||
<t
|
||||
t-set="display_discount"
|
||||
t-value="any(l.discount for l in folio.sale_line_ids)"
|
||||
/>
|
||||
|
||||
<table class="table table-sm o_main_table">
|
||||
<!-- In case we want to repeat the header, remove "display: table-row-group" -->
|
||||
<thead style="display: table-row-group">
|
||||
<tr>
|
||||
<th name="th_description" class="text-left">Description</th>
|
||||
<th name="th_quantity" class="text-right">Quantity</th>
|
||||
<th name="th_priceunit" class="text-right">Unit Price</th>
|
||||
<th
|
||||
name="th_discount"
|
||||
t-if="display_discount"
|
||||
class="text-right"
|
||||
>
|
||||
<span>Disc.%</span>
|
||||
</th>
|
||||
<th name="th_taxes" class="text-right">Taxes</th>
|
||||
<th name="th_subtotal" class="text-right">
|
||||
<span
|
||||
groups="account.group_show_line_subtotals_tax_excluded"
|
||||
>Amount</span>
|
||||
<span
|
||||
groups="account.group_show_line_subtotals_tax_included"
|
||||
>Total Price</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sale_tbody">
|
||||
|
||||
<t t-set="current_subtotal" t-value="0" />
|
||||
|
||||
<t t-foreach="folio.sale_line_ids" t-as="line">
|
||||
|
||||
<t
|
||||
t-set="current_subtotal"
|
||||
t-value="current_subtotal + line.price_subtotal"
|
||||
groups="account.group_show_line_subtotals_tax_excluded"
|
||||
/>
|
||||
<t
|
||||
t-set="current_subtotal"
|
||||
t-value="current_subtotal + line.price_total"
|
||||
groups="account.group_show_line_subtotals_tax_included"
|
||||
/>
|
||||
|
||||
<tr
|
||||
t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''"
|
||||
>
|
||||
<t t-if="not line.display_type">
|
||||
<t t-set="price" t-value="line.price_unit" />
|
||||
|
||||
<t t-if="line.reservation_id">
|
||||
<t
|
||||
t-set="print_board_service"
|
||||
t-value="line.reservation_id.board_service_room_id.pms_board_service_id.show_detail_report"
|
||||
/>
|
||||
<t t-if="not print_board_service">
|
||||
<t
|
||||
t-foreach="line.reservation_id.service_ids"
|
||||
t-as="service"
|
||||
>
|
||||
<t t-if="service.is_board_service">
|
||||
<t
|
||||
t-set="price"
|
||||
t-value="service.product_qty/line.price_total*(1-(service.reservation_id.discount or 0.0)*0.01) + price"
|
||||
/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
<t
|
||||
t-if="not(not print_board_service and line.service_id.is_board_service)"
|
||||
>
|
||||
<td name="td_name"><span
|
||||
t-field="line.name"
|
||||
/></td>
|
||||
<td name="td_quantity" class="text-right">
|
||||
<span t-field="line.product_uom_qty" />
|
||||
<span
|
||||
t-field="line.product_uom"
|
||||
groups="uom.group_uom"
|
||||
/>
|
||||
</td>
|
||||
|
||||
<td name="td_priceunit" class="text-right">
|
||||
<span
|
||||
t-esc="price"
|
||||
t-options='{"widget": "monetary", "display_currency": folio.pricelist_id.currency_id}'
|
||||
/>
|
||||
</td>
|
||||
<td t-if="display_discount" class="text-right">
|
||||
<span t-field="line.discount" />
|
||||
</td>
|
||||
<td name="td_taxes" class="text-right">
|
||||
<span
|
||||
t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))"
|
||||
/>
|
||||
</td>
|
||||
<td
|
||||
name="td_subtotal"
|
||||
class="text-right o_price_total"
|
||||
>
|
||||
<span
|
||||
t-esc="price*(1-(line.discount or 0.0)*0.01)* line.product_uom_qty"
|
||||
groups="account.group_show_line_subtotals_tax_excluded"
|
||||
t-options='{"widget": "monetary", "display_currency": folio.pricelist_id.currency_id}'
|
||||
/>
|
||||
<span
|
||||
t-esc="price *(1-(line.discount or 0.0)*0.01)* line.product_uom_qty"
|
||||
groups="account.group_show_line_subtotals_tax_included"
|
||||
t-options='{"widget": "monetary", "display_currency": folio.pricelist_id.currency_id}'
|
||||
/>
|
||||
</td>
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="line.display_type == 'line_section'">
|
||||
<td name="td_section_line" colspan="99">
|
||||
<span t-field="line.name" />
|
||||
</td>
|
||||
<t t-set="current_section" t-value="line" />
|
||||
<t t-set="current_subtotal" t-value="0" />
|
||||
</t>
|
||||
|
||||
<t t-if="line.display_type == 'line_note'">
|
||||
<td name="td_note_line" colspan="99">
|
||||
<span t-field="line.name" />
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
|
||||
<t
|
||||
t-if="current_section and (line_last or folio.sale_line_ids[line_index+1].display_type == 'line_section')"
|
||||
>
|
||||
<tr class="is-subtotal text-right">
|
||||
<td name="td_section_subtotal" colspan="99">
|
||||
<strong class="mr16">Subtotal</strong>
|
||||
<span
|
||||
t-esc="current_subtotal"
|
||||
t-options='{"widget": "monetary", "display_currency": folio.pricelist_id.currency_id}'
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="clearfix" name="so_total_summary">
|
||||
<div id="total" class="row" name="total">
|
||||
<div
|
||||
t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto"
|
||||
>
|
||||
<table class="table table-sm">
|
||||
<tr class="border-black o_subtotal" style="">
|
||||
<td name="td_amount_untaxed_label"><strong
|
||||
>Subtotal</strong></td>
|
||||
<td name="td_amount_untaxed" class="text-right">
|
||||
<span t-field="folio.amount_untaxed" />
|
||||
</td>
|
||||
</tr>
|
||||
<t
|
||||
t-foreach="folio._get_tax_amount_by_group()"
|
||||
t-as="amount_by_group"
|
||||
>
|
||||
<tr style="">
|
||||
<t
|
||||
t-if="amount_by_group[3] == 1 and folio.amount_untaxed == amount_by_group[2]"
|
||||
>
|
||||
<td name="td_amount_by_group_label_3">
|
||||
<span t-esc="amount_by_group[0]" />
|
||||
<span>&nbsp;<span>on</span>&nbsp;<t
|
||||
t-esc="amount_by_group[2]"
|
||||
t-options='{"widget": "monetary", "display_currency": folio.pricelist_id.currency_id}'
|
||||
/></span>
|
||||
</td>
|
||||
<td
|
||||
name="td_amount_by_group_3"
|
||||
class="text-right o_price_total"
|
||||
>
|
||||
<span
|
||||
t-esc="amount_by_group[1]"
|
||||
t-options='{"widget": "monetary", "display_currency": folio.pricelist_id.currency_id}'
|
||||
/>
|
||||
</td>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<td name="td_amount_by_group_label">
|
||||
<span t-esc="amount_by_group[0]" />
|
||||
</td>
|
||||
<td
|
||||
name="td_amount_by_group"
|
||||
class="text-right o_price_total"
|
||||
>
|
||||
<span
|
||||
t-esc="amount_by_group[1]"
|
||||
t-options='{"widget": "monetary", "display_currency": folio.pricelist_id.currency_id}'
|
||||
/>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
</t>
|
||||
<tr class="border-black o_total">
|
||||
<td name="td_amount_total_label"><strong
|
||||
>Total</strong></td>
|
||||
<td name="td_amount_total" class="text-right">
|
||||
<span t-field="folio.amount_total" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="oe_structure" />
|
||||
|
||||
<p t-field="folio.note" />
|
||||
<p t-if="folio.payment_term_id.note">
|
||||
<span t-field="folio.payment_term_id.note" />
|
||||
</p>
|
||||
<p
|
||||
id="fiscal_position_remark"
|
||||
t-if="folio.fiscal_position_id and folio.fiscal_position_id.sudo().note"
|
||||
>
|
||||
<strong>Fiscal Position Remark:</strong>
|
||||
<span t-field="folio.fiscal_position_id.sudo().note" />
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user