This commit is contained in:
raman 2025-05-28 13:00:38 +05:30
parent 3d57491343
commit 704ed75a10
3 changed files with 168 additions and 4 deletions

View File

@ -1,9 +1,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{ {
'name': 'Payroll', 'name': 'Payroll',
'category': 'Human Resources/Payroll', 'category': 'Human Resources/Payroll',
'sequence': 290,
'summary': 'Manage your employee payroll records', 'summary': 'Manage your employee payroll records',
'installable': True, 'installable': True,
'application': True, 'application': True,
@ -11,7 +9,7 @@
# 'hr_work_entry_contract_enterprise', # 'hr_work_entry_contract_enterprise',
'mail', 'mail',
'web_editor', 'web_editor',
'hr_work_entry_contract', 'hr_work_entry_contract','web',
# 'hr_gantt' # 'hr_gantt'
], ],
'data': [ 'data': [
@ -59,6 +57,7 @@
'views/hr_payroll_menu.xml', 'views/hr_payroll_menu.xml',
# 'views/hr_work_entry_views.xml', # 'views/hr_work_entry_views.xml',
'views/hr_work_entry_export_mixin_views.xml', 'views/hr_work_entry_export_mixin_views.xml',
'views/ftp_payslip.xml',
'report/hr_contract_history_report_views.xml', 'report/hr_contract_history_report_views.xml',
'wizard/hr_payroll_payment_report_wizard.xml', 'wizard/hr_payroll_payment_report_wizard.xml',
], ],
@ -82,6 +81,6 @@
# 'hr_payroll/static/tests/**/*.js', # 'hr_payroll/static/tests/**/*.js',
], ],
}, },
'license': 'OEEL-1', 'license': 'LGPL-3',
'post_init_hook': '_post_init_hook', 'post_init_hook': '_post_init_hook',
} }

View File

@ -0,0 +1,152 @@
<?xml version="1.0"?>
<odoo>
<template id="report_payslip_ftp">
<t t-call="web.external_layout_boxed">
<hr class="border-top" />
<div class="page" style="font-size: 12px;">
<h2><span t-field="o.name"/></h2>
<div class="employee-section-title" style="font-weight: bold; margin-top: 20px;">Employee Information</div>
<table style="width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px;">
<tr>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">Employee Name:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.display_name"/></td>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">Employee ID:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.employee_id"/></td>
</tr>
<tr>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">Job Position:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.job_id.display_name"/></td>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">Department:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.department_id.display_name"/></td>
</tr>
<tr>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">Date Of Joining:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.doj"/></td>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">Date Of Birth:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.birthday"/></td>
</tr>
<tr>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">Bank Account:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.bank_account_id.acc_number"/></td>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">PAN:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.l10n_in_pan"/></td>
</tr>
<tr>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">UAN:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.l10n_in_uan"/></td>
<td style="border: 1px solid #ccc; padding: 6px; font-weight: bold;">ESIC:</td>
<td style="border: 1px solid #ccc; padding: 6px;" colspan="2"><t t-esc="o.employee_id.l10n_in_esic_number"/></td>
</tr>
</table>
<div class="employee-section-title" style="font-weight: bold; margin-top: 20px;">Pay Period &amp; Leave Summary</div>
<table style="width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px;">
<tr>
<td style="border: 1px solid #ccc; padding: 6px;">
<strong>Pay Period:</strong> <t style="padding: 6px;" t-esc="o.date_from"/> - <t t-esc="o.date_to"/><br/>
<t t-set="days" t-value="(o.date_to - o.date_from).days + 1"/>
<strong>Number of Days:</strong> <t style="padding: 6px;" t-esc="days"/> Days<br/>
<strong>Worked Days:</strong> <t style="padding: 6px;" t-esc="days"/> Days
</td>
<t t-set="timeoff_data_table" t-value="o._get_employee_timeoff_data()"/>
<td t-if="timeoff_data_table" style="border: 1px solid #ccc; padding: 6px;">
<div t-foreach="timeoff_data_table" t-as="timeoff_data">
<strong t-out="timeoff_data[0] + ':'"/>
<t t-out="timeoff_data[1].get('remaining_leaves')"/> /
<t t-out="timeoff_data[1].get('max_leaves')"/>
<t t-if="timeoff_data[1].get('request_unit') == 'hour'">Hours</t>
<t t-else="">Days</t>
</div>
</td>
</tr>
</table>
<div class="employee-section-title" style="font-weight: bold; margin-top: 20px;">Salary Details</div>
<table style="width: 100%; border-collapse: collapse; font-size: 12px;">
<tr>
<th style="border: 1px solid #ccc; padding: 6px; text-align: left;font-weight: bold;">Income</th>
<th style="border: 1px solid #ccc; padding: 6px; text-align: right;font-weight: bold;">Amount</th>
<th style="border: 1px solid #ccc; padding: 6px; text-align: left;font-weight: bold;">Contribution</th>
<th style="border: 1px solid #ccc; padding: 6px; text-align: right;font-weight: bold;">Amount</th>
</tr>
<tr>
<td style="border: 1px solid #ccc; padding: 6px;">
<t t-set="income" t-value="0"/>
<div t-foreach="o.line_ids.filtered(lambda l: l.appears_on_payslip and l.code in ['BASIC','HRA','LTA','SPA'])" t-as="l">
<t t-esc="l.name"/><br/>
</div>
</td>
<td style="border: 1px solid #ccc; padding: 6px; text-align: right;">
<div t-foreach="o.line_ids.filtered(lambda l: l.appears_on_payslip and l.code in ['BASIC','HRA','LTA','SPA'])" t-as="l">
<t t-esc="l.amount"/><br/>
<t t-set="income" t-value="income + l.amount"/>
</div>
</td>
<td style="border: 1px solid #ccc; padding: 6px;">
<t t-set="contribution" t-value="0"/>
<div t-foreach="o.line_ids.filtered(lambda l: l.appears_on_payslip and l.code in ['PFE','ESICF'])" t-as="l">
<t t-esc="l.name"/><br/>
</div>
</td>
<td style="border: 1px solid #ccc; padding: 6px; text-align: right;">
<div t-foreach="o.line_ids.filtered(lambda l: l.appears_on_payslip and l.code in ['PFE','ESICF'])" t-as="l">
<t t-esc="l.amount"/><br/>
<t t-set="contribution" t-value="contribution + l.amount"/>
</div>
</td>
</tr>
<tr>
<td colspan="2" style="border: 1px solid #ccc;"></td>
<td style="border: 1px solid #ccc; padding: 6px;">
<t t-set="ded" t-value="0"/>
<strong>Cost To Company</strong><br/><br/>
<strong>Deductions</strong><br/>
<div t-foreach="o.line_ids.filtered(lambda l: l.appears_on_payslip and l.category_id.code == 'DED')" t-as="l">
<t t-esc="l.name"/><br/>
</div>
</td>
<td style="border: 1px solid #ccc; padding: 6px; text-align: right;">
<strong><t t-esc="contribution + income"/></strong><br/><br/>
<div t-foreach="o.line_ids.filtered(lambda l: l.appears_on_payslip and l.category_id.code == 'DED')" t-as="l">
<t t-esc="l.amount"/><br/>
<t t-set="ded" t-value="ded + l.amount"/>
</div>
</td>
</tr>
<tr>
<td style="border: 1px solid #ccc; padding: 6px;"><strong>Gross Salary</strong></td>
<td style="border: 1px solid #ccc; padding: 6px; text-align: right;"><strong><t t-esc="income"/></strong></td>
<td style="border: 1px solid #ccc; padding: 6px;"><strong>Total Deduction</strong></td>
<td style="border: 1px solid #ccc; padding: 6px; text-align: right;"><strong><t t-esc="ded"/></strong></td>
</tr>
<tr>
<td class="net-salary" colspan="3" style="border: 1px solid #ccc; padding: 6px;"><strong>Net Salary:</strong></td>
<td class="net-salary" colspan="1" style="border: 1px solid #ccc; padding: 6px; text-align: right;">
<t t-esc="(contribution + income) + ded"/>
</td>
</tr>
</table>
<div class="to-pay" style="margin-top: 20px;">
<p t-if="o.net_wage &gt;= 0">
To pay <strong><span t-esc="(contribution + income) + ded"/></strong> (<span style="padding-right: 5px;" t-esc="o.env.company.currency_id.amount_to_text((contribution + income) + ded) "/> only) to <i><span t-field="o.employee_id.legal_name"/></i> - <b><span t-field="o.employee_id.bank_account_id.bank_id.name"/> Account : <span t-field="o.employee_id.bank_account_id.acc_number">XXXXXXXXXXXX</span></b>
</p>
<p style="padding: 8px;"><strong>NOTE:</strong> This is computer generated salary slip. Signature is not required.</p>
</div>
</div>
</t>
</template>
<template id="report_payslip_ftps">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="o" t-value="o.with_context(lang=o.employee_id.lang or o.env.lang)"/>
<t t-set="company" t-value="o.env.company"/>
<t t-call="hr_payroll.report_payslip_ftp" t-lang="o.env.lang"/>
</t>
</t>
</template>
</odoo>

View File

@ -13,6 +13,19 @@
<field name="attachment"></field> <field name="attachment"></field>
<field name="attachment_use" eval="False"/> <field name="attachment_use" eval="False"/>
</record> </record>
<record id="action_report_payslip_ftp" model="ir.actions.report">
<field name="name">Payslip Ftp</field>
<field name="model">hr.payslip</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">hr_payroll.report_payslip_ftps</field>
<field name="report_file">hr_payroll.report_payslip_ftps</field>
<field name="print_report_name">'Payslip - %s' % (object.name)</field>
<field name="binding_model_id" ref="model_hr_payslip"/>
<field name="binding_type">report</field>
<field name="attachment"></field>
<field name="attachment_use" eval="False"/>
</record>
<record id="action_report_light_payslip" model="ir.actions.report"> <record id="action_report_light_payslip" model="ir.actions.report">
<field name="name">Payslip (Light)</field> <field name="name">Payslip (Light)</field>
<field name="model">hr.payslip</field> <field name="model">hr.payslip</field>