Files
Odoo-Modules/fusion_clock/views/portal_payslip_templates.xml
gsinghpal 85cdecddea fix(fusion_clock): keep inline nav bars instead of a shared template
A shared portal_employee_navbar template broke fusion_planning, which
xpath-inherits each clock page's inline fclk-nav-bar to inject its
Schedule tab (anchored on a[@href='/my/clock/timesheets']). Revert to the
original inline-nav pattern on all four pages and append the Payslips item
to each — zero changes needed in fusion_planning.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 21:56:54 -04:00

192 lines
11 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Payslip List -->
<template id="portal_payslip_list_page" name="Fusion Clock Payslips">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="False"/>
<t t-set="no_breadcrumbs" t-value="True"/>
<t t-set="no_header" t-value="True"/>
<div class="fclk-app">
<div class="fclk-reports-container">
<div class="fclk-ts-header" style="margin-bottom:24px;">
<h2>Payslips</h2>
</div>
<t t-if="payslips">
<t t-foreach="payslips" t-as="payslip">
<a t-attf-href="/my/clock/payslips/#{payslip.id}"
class="fclk-report-item fclk-payslip-item">
<div class="fclk-report-info">
<h4>
<t t-esc="payslip.date_from.strftime('%b %d')"/> -
<t t-esc="payslip.date_to.strftime('%b %d, %Y')"/>
</h4>
<p>
Net
<span t-field="payslip.net_wage"
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
</p>
</div>
<span t-attf-class="fclk-payslip-status fclk-payslip-status--#{payslip.state}">
<t t-if="payslip.state == 'paid'">Paid</t>
<t t-else="">Done</t>
</span>
</a>
</t>
</t>
<t t-else="">
<div class="fclk-empty-state">
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#6b7280" stroke-width="1.5">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
</svg>
<p>No payslips available yet.</p>
<p style="font-size:12px; margin-top:4px;">Finalized pay slips will appear here after each pay run.</p>
</div>
</t>
<div class="fclk-nav-bar">
<a href="/my/clock" class="fclk-nav-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
<span>Clock</span>
</a>
<a href="/my/clock/timesheets" class="fclk-nav-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
<line x1="16" y1="2" x2="16" y2="6"/>
<line x1="8" y1="2" x2="8" y2="6"/>
<line x1="3" y1="10" x2="21" y2="10"/>
</svg>
<span>Timesheets</span>
</a>
<a href="/my/clock/reports" class="fclk-nav-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
</svg>
<span>Reports</span>
</a>
<a href="/my/clock/payslips" class="fclk-nav-item fclk-nav-active">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="5" width="20" height="14" rx="2"/>
<line x1="2" y1="10" x2="22" y2="10"/>
</svg>
<span>Payslips</span>
</a>
</div>
</div>
</div>
</t>
</template>
<!-- Payslip Detail — inline paystub -->
<template id="portal_payslip_detail_page" name="Fusion Clock Payslip Detail">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="False"/>
<t t-set="no_breadcrumbs" t-value="True"/>
<t t-set="no_header" t-value="True"/>
<div class="fclk-app">
<div class="fclk-reports-container">
<div class="fclk-ts-header fclk-payslip-detail-header" style="margin-bottom:16px;">
<a href="/my/clock/payslips" class="fclk-payslip-back">&#8592; Payslips</a>
<h2>
<t t-esc="payslip.date_from.strftime('%b %d')"/> -
<t t-esc="payslip.date_to.strftime('%b %d, %Y')"/>
</h2>
</div>
<!-- Net pay highlight -->
<div class="fclk-status-card fclk-payslip-net">
<span class="fclk-payslip-net-label">Net Pay</span>
<span class="fclk-payslip-net-value"
t-field="payslip.net_wage"
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
</div>
<!-- Breakdown — iterate the payslip's computed lines so this
works for any payroll provider (enterprise hr_payroll or
the custom fusion_payroll), independent of one field schema. -->
<div class="fclk-status-card fclk-payslip-section">
<h4 class="fclk-payslip-section-title">Breakdown</h4>
<t t-foreach="payslip.line_ids" t-as="line">
<div t-attf-class="fclk-payslip-row#{' fclk-payslip-row--total' if line.code == 'NET' else ''}">
<span t-esc="line.name"/>
<span t-field="line.total"
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
</div>
</t>
<t t-if="not payslip.line_ids">
<div class="fclk-payslip-row">
<span>Gross</span>
<span t-field="payslip.gross_wage"
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
</div>
<div class="fclk-payslip-row fclk-payslip-row--total">
<span>Net</span>
<span t-field="payslip.net_wage"
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
</div>
</t>
</div>
<t t-if="has_pdf">
<a t-attf-href="/my/clock/payslips/#{payslip.id}/pdf"
class="fclk-payslip-pdf-btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="vertical-align:middle; margin-right:6px;">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
<polyline points="7 10 12 15 17 10"/>
<line x1="12" y1="15" x2="12" y2="3"/>
</svg>
Download PDF
</a>
</t>
<div class="fclk-nav-bar">
<a href="/my/clock" class="fclk-nav-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
<span>Clock</span>
</a>
<a href="/my/clock/timesheets" class="fclk-nav-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
<line x1="16" y1="2" x2="16" y2="6"/>
<line x1="8" y1="2" x2="8" y2="6"/>
<line x1="3" y1="10" x2="21" y2="10"/>
</svg>
<span>Timesheets</span>
</a>
<a href="/my/clock/reports" class="fclk-nav-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
</svg>
<span>Reports</span>
</a>
<a href="/my/clock/payslips" class="fclk-nav-item fclk-nav-active">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="5" width="20" height="14" rx="2"/>
<line x1="2" y1="10" x2="22" y2="10"/>
</svg>
<span>Payslips</span>
</a>
</div>
</div>
</div>
</t>
</template>
</odoo>