Files
gzth/yuthon_purchase/report/purchase_workflow_templates.xml
T
2025-09-24 20:07:20 +08:00

358 lines
18 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_purchaseworkflow">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<style type="text/css">
td {
border:1px solid #000000;
padding:8px;
}
.title {
text-align:center;
font-weight:bold;
font-size:16px;
margin:15px 0;
}
.main-title {
font-weight:bold;
font-size:18px;
text-align:center;
margin:20px 0;
}
table {
border-collapse: collapse;
}
.content-wrap {
white-space: pre-wrap;
line-height: 1.5;
}
.attachment-name {
margin: 2px 0;
display: block;
}
/* 明细标题盒子样式:带边框、字体居中 */
.detail-title-box {
width: 100%;
border-collapse: collapse;
margin: 15px 0 5px 0; /* 与上方间距15px,与下方明细表格间距5px */
}
.detail-title-box td {
text-align: center;
font-weight: bold;
font-size: 16px;
border:1px solid #000000;
padding: 5px 8px;
}
</style>
<div class="main-title">采购审批单</div>
<!-- 编号 + 供应商 -->
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>编号:</strong></td>
<td width="35%"><span t-field="o.code"/></td>
<td width="15%"><strong>供应商:</strong></td>
<td width="35%">
<span t-if="o.partner_id"><span t-field="o.partner_id.name"/></span>
<span t-if="not o.partner_id">未设置</span>
</td>
</tr>
</table>
<!-- 标题 + 采购类型 -->
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>标题:</strong></td>
<td width="35%"><span t-field="o.name"/></td>
<td width="15%"><strong>采购类型:</strong></td>
<td width="35%">
<span t-if="o.purchase_type == 'fixed'">固定资产</span>
<span t-if="o.purchase_type == 'low'">低值易耗</span>
<span t-if="o.purchase_type == 'service'">服务</span>
</td>
</tr>
</table>
<!-- 申请人 + 付款方式 -->
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>申请人:</strong></td>
<td width="35%">
<span t-if="o.user_id"><span t-field="o.user_id.name"/></span>
<span t-if="not o.user_id">未知</span>
</td>
<td width="15%"><strong>付款方式:</strong></td>
<td width="35%">
<span t-if="o.pay_way == 'onetime'">一次性</span>
<span t-if="o.pay_way == 'installment'">分期</span>
</td>
</tr>
</table>
<!-- 申请日期 -->
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>申请日期:</strong></td>
<td width="85%"><span t-field="o.start_date"/></td>
</tr>
</table>
<!-- 合计金额 -->
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>合计金额:</strong></td>
<td width="85%"><span t-field="o.total"/></td>
</tr>
</table>
<!-- 申请事由 -->
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>申请事由:</strong></td>
<td width="85%" class="content-wrap">
<t t-if="o.reason_text">
<pre t-field="o.reason_text"/>
</t>
<t t-if="not o.reason_text">
<span>无</span>
</t>
</td>
</tr>
</table>
<!-- 固定资产特有字段 -->
<t t-if="o.purchase_type == 'fixed'">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>预计到货日期:</strong></td>
<td width="85%"><span t-field="o.date_planned"/></td>
</tr>
</table>
</t>
<!-- 服务特有字段 -->
<t t-if="o.purchase_type == 'service'">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>服务开始日期:</strong></td>
<td width="85%"><span t-field="o.service_start_date"/></td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>服务结束日期:</strong></td>
<td width="85%"><span t-field="o.service_end_date"/></td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>服务年限:</strong></td>
<td width="85%"><span t-field="o.service_year"/></td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>营业执照:</strong></td>
<td width="85%">
<span t-if="o.license_id"><span t-field="o.license_id.name"/></span>
<span t-if="not o.license_id">无</span>
</td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>资质:</strong></td>
<td width="85%">
<span t-if="o.aptitude_id"><span t-field="o.aptitude_id.name"/></span>
<span t-if="not o.aptitude_id">无</span>
</td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>合同:</strong></td>
<td width="85%">
<span t-if="o.contract_id"><span t-field="o.contract_id.name"/></span>
<span t-if="not o.contract_id">无</span>
</td>
</tr>
</table>
</t>
<t t-if="o.purchase_type == 'fixed'">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="100%" style="text-align:center;">固定资产明细</td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<thead>
<tr>
<td width="15%"><strong>物品名称</strong></td>
<td width="10%"><strong>品牌</strong></td>
<td width="10%"><strong>规格</strong></td>
<td width="10%"><strong>数量</strong></td>
<td width="10%"><strong>单位</strong></td>
<td width="15%"><strong>单价</strong></td>
<td width="20%"><strong>合计</strong></td>
</tr>
</thead>
<tbody>
<t t-foreach="o.fixed_line_ids" t-as="line">
<tr>
<td><span t-field="line.product_id.name"/></td>
<td><span t-field="line.brand"/></td>
<td><span t-field="line.specs"/></td>
<td><span t-field="line.number"/></td>
<td><span t-field="line.unit_id.name"/></td>
<td><span t-field="line.price_unit"/></td>
<td><span t-field="line.total"/></td>
</tr>
</t>
</tbody>
</table>
</t>
<t t-if="o.purchase_type == 'low'">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="100%" style="text-align:center;">低值易耗明细</td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<thead>
<tr>
<td width="15%"><strong>物品名称</strong></td>
<td width="10%"><strong>品牌</strong></td>
<td width="10%"><strong>规格</strong></td>
<td width="10%"><strong>数量</strong></td>
<td width="10%"><strong>单位</strong></td>
<td width="15%"><strong>单价</strong></td>
<td width="20%"><strong>合计</strong></td>
</tr>
</thead>
<tbody>
<t t-foreach="o.low_line_ids" t-as="line">
<tr>
<td><span t-field="line.product_id.name"/></td>
<td><span t-field="line.brand"/></td>
<td><span t-field="line.specs"/></td>
<td><span t-field="line.number"/></td>
<td><span t-field="line.unit_id.name"/></td>
<td><span t-field="line.price"/></td>
<td><span t-field="line.total"/></td>
</tr>
</t>
</tbody>
</table>
</t>
<t t-if="o.purchase_type == 'service'">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="100%" style="text-align:center;">服务明细</td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<thead>
<tr>
<td width="20%"><strong>服务项目</strong></td>
<td width="10%"><strong>频次</strong></td>
<td width="15%"><strong>费用</strong></td>
<td width="10%"><strong>单位</strong></td>
<td width="15%"><strong>单价</strong></td>
<td width="20%"><strong>合计</strong></td>
</tr>
</thead>
<tbody>
<t t-foreach="o.service_line_ids" t-as="line">
<tr>
<td><span t-field="line.product_id.name"/></td>
<td><span t-field="line.frequency"/></td>
<td><span t-field="line.fee"/></td>
<td><span t-field="line.unit_id.name"/></td>
<td><span t-field="line.price"/></td>
<td><span t-field="line.total"/></td>
</tr>
</t>
</tbody>
</table>
</t>
<t t-if="o.pay_way == 'installment'">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="100%" style="text-align:center;">付款详情</td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<thead>
<tr>
<td width="20%"><strong>付款阶段</strong></td>
<td width="20%"><strong>比例/金额</strong></td>
<td width="30%"><strong>付款日期</strong></td>
<td width="30%"><strong>条件</strong></td>
</tr>
</thead>
<tbody>
<t t-foreach="o.pay_line_ids" t-as="line">
<tr>
<td><span t-field="line.payment_stage"/></td>
<td><span t-field="line.amount"/></td>
<td><span t-field="line.payment_date"/></td>
<td><span t-field="line.remake"/></td>
</tr>
</t>
</tbody>
</table>
</t>
<!-- 附件 -->
<t t-if="o.document_ids">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="15%"><strong>附件:</strong></td>
<td width="85%">
<t t-foreach="o.document_ids" t-as="doc">
<div class="attachment-name"><span t-field="doc.name"/></div>
</t>
</td>
</tr>
</table>
</t>
<t t-if="o.log_ids">
<table width="100%" style="table-layout:fixed;">
<tr>
<td width="100%" style="text-align:center;">审批明细</td>
</tr>
</table>
<table width="100%" style="table-layout:fixed;">
<thead>
<tr>
<td width="20%"><strong>节点</strong></td>
<td width="30%"><strong>意见</strong></td>
<td width="20%"><strong>审批人</strong></td>
<td width="30%"><strong>操作时间</strong></td>
</tr>
</thead>
<tbody>
<t t-foreach="o.log_ids" t-as="log">
<tr>
<td><span t-field="log.name"/></td>
<td><span t-field="log.comment"/></td>
<td><span t-field="log.done_by"/></td>
<td><span t-field="log.date_create"/></td>
</tr>
</t>
</tbody>
</table>
</t>
</t>
</t>
</t>
</template>
</odoo>