326 lines
19 KiB
XML
326 lines
19 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="action_payroll_migration" model="ir.actions.act_window">
|
|
<field name="name">Import from QuickBooks</field>
|
|
<field name="res_model">fusion.payroll.migration</field>
|
|
<field name="view_mode">form,list</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Import your payroll data from QuickBooks
|
|
</p>
|
|
<p>Start a new migration to import employees, payslip history, and T4 records.</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="fusion_payroll_migration_form" model="ir.ui.view">
|
|
<field name="name">fusion.payroll.migration.form</field>
|
|
<field name="model">fusion.payroll.migration</field>
|
|
<field name="arch" type="xml">
|
|
<form string="QuickBooks Migration">
|
|
<header>
|
|
<field name="state" widget="statusbar"
|
|
statusbar_visible="setup,employees,payslips,ytd,t4,reconcile,done"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_title mb-3">
|
|
<h1><field name="name" placeholder="Migration Reference"/></h1>
|
|
</div>
|
|
|
|
<!-- ======== STEP 1: SETUP ======== -->
|
|
<div invisible="state != 'setup'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 1: Company Setup</strong> -- Confirm your company details and choose your migration type.
|
|
</div>
|
|
<group>
|
|
<group string="Company">
|
|
<field name="company_id"/>
|
|
<field name="pay_schedule"/>
|
|
</group>
|
|
<group string="Migration Settings">
|
|
<field name="migration_type" widget="radio"/>
|
|
<field name="cutoff_date"/>
|
|
</group>
|
|
</group>
|
|
<div class="text-center mt-4">
|
|
<button name="action_next_step" string="Next: Import Employees"
|
|
type="object" class="btn-primary btn-lg"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 2a: EMPLOYEE UPLOAD ======== -->
|
|
<div invisible="state != 'employees'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 2: Employee Import</strong> -- Download the sample template, prepare your CSV, then upload it.
|
|
</div>
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<h4>1. Download Sample Template</h4>
|
|
<p>See the expected format with sample Canadian employee data:</p>
|
|
<a href="/fusion_payroll/download_sample/employee"
|
|
class="btn btn-secondary">
|
|
<i class="fa fa-download"/> Download employee_import_sample.csv
|
|
</a>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h4>2. Upload Your Employee CSV</h4>
|
|
<field name="employee_csv" filename="employee_csv_filename"/>
|
|
<field name="employee_csv_filename" invisible="1"/>
|
|
</div>
|
|
</div>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_upload_employee_csv" string="Upload and Map Columns"
|
|
type="object" class="btn-primary"
|
|
invisible="not employee_csv"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 2b: EMPLOYEE COLUMN MAPPING ======== -->
|
|
<div invisible="state != 'employee_map'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 2b: Map Employee Columns</strong> -- Match your CSV columns to Fusion Payroll fields. Auto-matched columns are pre-filled.
|
|
</div>
|
|
<field name="employee_mapping_ids">
|
|
<list editable="bottom">
|
|
<field name="csv_column" readonly="1" string="Your CSV Column"/>
|
|
<field name="fusion_field" string="Maps To Fusion Field"/>
|
|
<field name="is_mapped" widget="boolean_toggle" string="Mapped"/>
|
|
<field name="is_skipped" widget="boolean_toggle" string="Skip"/>
|
|
<field name="mapping_type" column_invisible="1"/>
|
|
</list>
|
|
</field>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_preview_employees" string="Preview Import"
|
|
type="object" class="btn-primary"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 2c: EMPLOYEE PREVIEW ======== -->
|
|
<div invisible="state != 'employee_preview'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 2c: Preview Employees</strong> -- Review the data below. If it looks correct, click Import.
|
|
</div>
|
|
<field name="preview_html" class="o_field_html"/>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back to Mapping" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_import_employees" string="Import Employees"
|
|
type="object" class="btn-primary btn-lg" confirm="This will create employee records. Continue?"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 3a: PAYSLIP UPLOAD ======== -->
|
|
<div invisible="state != 'payslips'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 3: Payslip History Import</strong> -- Download the sample, prepare your payslip CSV, then upload.
|
|
</div>
|
|
<div class="alert alert-success" invisible="employee_count == 0">
|
|
<i class="fa fa-check"/> <field name="employee_count" readonly="1" class="d-inline"/> employees imported successfully.
|
|
</div>
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<h4>1. Download Sample Template</h4>
|
|
<a href="/fusion_payroll/download_sample/payslip"
|
|
class="btn btn-secondary">
|
|
<i class="fa fa-download"/> Download payslip_history_sample.csv
|
|
</a>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h4>2. Upload Payslip History CSV</h4>
|
|
<field name="payslip_csv" filename="payslip_csv_filename"/>
|
|
<field name="payslip_csv_filename" invisible="1"/>
|
|
</div>
|
|
</div>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_upload_payslip_csv" string="Upload and Map Columns"
|
|
type="object" class="btn-primary"
|
|
invisible="not payslip_csv"/>
|
|
<button name="action_skip_to_ytd" string="Skip (YTD Only)"
|
|
type="object" class="btn-link ms-3"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 3b: PAYSLIP COLUMN MAPPING ======== -->
|
|
<div invisible="state != 'payslip_map'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 3b: Map Payslip Columns</strong> -- Match CSV columns to salary rule codes (BASIC, CPP_EE, FED_TAX, etc.).
|
|
</div>
|
|
<field name="payslip_mapping_ids">
|
|
<list editable="bottom">
|
|
<field name="csv_column" readonly="1" string="Your CSV Column"/>
|
|
<field name="fusion_field" string="Maps To Rule Code"/>
|
|
<field name="is_mapped" widget="boolean_toggle"/>
|
|
<field name="is_skipped" widget="boolean_toggle"/>
|
|
<field name="mapping_type" column_invisible="1"/>
|
|
</list>
|
|
</field>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_preview_payslips" string="Preview Import"
|
|
type="object" class="btn-primary"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 3c: PAYSLIP PREVIEW ======== -->
|
|
<div invisible="state != 'payslip_preview'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 3c: Preview Payslips</strong> -- Review per-employee totals.
|
|
</div>
|
|
<field name="preview_html" class="o_field_html"/>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back to Mapping" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_import_payslips" string="Import Payslips"
|
|
type="object" class="btn-primary btn-lg" confirm="This will create payslip records. Continue?"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 4: YTD VERIFICATION ======== -->
|
|
<div invisible="state != 'ytd'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 4: YTD Verification</strong> -- Review year-to-date totals from imported data.
|
|
</div>
|
|
<div class="alert alert-success" invisible="payslip_count == 0">
|
|
<i class="fa fa-check"/> <field name="payslip_count" readonly="1" class="d-inline"/> payslips imported successfully.
|
|
</div>
|
|
|
|
<div invisible="migration_type != 'ytd_only'" class="mb-3">
|
|
<h4>Upload YTD Balances (for YTD-only migration)</h4>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<a href="/fusion_payroll/download_sample/ytd" class="btn btn-secondary mb-2">
|
|
<i class="fa fa-download"/> Download ytd_balances_sample.csv
|
|
</a>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<field name="ytd_csv" filename="ytd_csv_filename"/>
|
|
<field name="ytd_csv_filename" invisible="1"/>
|
|
</div>
|
|
</div>
|
|
<button name="action_import_ytd_balances" string="Import YTD Balances"
|
|
type="object" class="btn-primary mt-2"
|
|
invisible="not ytd_csv"/>
|
|
</div>
|
|
|
|
<button name="action_compute_ytd_preview" string="Compute YTD Totals"
|
|
type="object" class="btn-secondary mb-3"
|
|
invisible="migration_type == 'ytd_only' or payslip_count == 0"/>
|
|
|
|
<field name="preview_html" class="o_field_html" invisible="not preview_html"/>
|
|
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_confirm_ytd" string="Confirm YTD and Continue"
|
|
type="object" class="btn-primary"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 5: T4 IMPORT ======== -->
|
|
<div invisible="state != 't4'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 5: T4 Historical Import (Optional)</strong> -- Import prior-year T4 data, or skip this step.
|
|
</div>
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<a href="/fusion_payroll/download_sample/t4" class="btn btn-secondary">
|
|
<i class="fa fa-download"/> Download t4_history_sample.csv
|
|
</a>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<field name="t4_csv" filename="t4_csv_filename"/>
|
|
<field name="t4_csv_filename" invisible="1"/>
|
|
</div>
|
|
</div>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_upload_t4_csv" string="Upload and Map Columns"
|
|
type="object" class="btn-primary"
|
|
invisible="not t4_csv"/>
|
|
<button name="action_skip_t4" string="Skip T4 Import"
|
|
type="object" class="btn-link ms-3"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 5b: T4 COLUMN MAPPING ======== -->
|
|
<div invisible="state != 't4_map'">
|
|
<div class="alert alert-info">
|
|
<strong>Step 5b: Map T4 Columns</strong>
|
|
</div>
|
|
<field name="t4_mapping_ids">
|
|
<list editable="bottom">
|
|
<field name="csv_column" readonly="1"/>
|
|
<field name="fusion_field"/>
|
|
<field name="is_mapped" widget="boolean_toggle"/>
|
|
<field name="is_skipped" widget="boolean_toggle"/>
|
|
<field name="mapping_type" column_invisible="1"/>
|
|
</list>
|
|
</field>
|
|
<div class="text-center mt-3">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_import_t4" string="Import T4 Data"
|
|
type="object" class="btn-primary" confirm="Import T4 records?"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== STEP 6: RECONCILIATION ======== -->
|
|
<div invisible="state != 'reconcile'">
|
|
<div class="alert alert-success">
|
|
<strong>Step 6: Reconciliation</strong> -- Review your migration results below.
|
|
</div>
|
|
<field name="reconciliation_html" class="o_field_html"/>
|
|
<div class="text-center mt-4">
|
|
<button name="action_prev_step" string="Back" type="object" class="btn-secondary me-2"/>
|
|
<button name="action_complete" string="Complete Migration"
|
|
type="object" class="btn-success btn-lg"
|
|
confirm="Mark this migration as complete?"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== DONE ======== -->
|
|
<div invisible="state != 'done'">
|
|
<div class="alert alert-success text-center">
|
|
<h3><i class="fa fa-check-circle"/> Migration Complete!</h3>
|
|
<p>All data has been imported successfully.</p>
|
|
<field name="reconciliation_html" class="o_field_html"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ======== LOG (always visible) ======== -->
|
|
<notebook invisible="state == 'setup'">
|
|
<page string="Import Log" name="log">
|
|
<field name="log_ids" readonly="1">
|
|
<list>
|
|
<field name="create_date" string="Time"/>
|
|
<field name="level" decoration-danger="level == 'error'" decoration-warning="level == 'warning'"/>
|
|
<field name="row_number" string="Row"/>
|
|
<field name="message"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
</notebook>
|
|
|
|
</sheet>
|
|
<chatter/>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="fusion_payroll_migration_list" model="ir.ui.view">
|
|
<field name="name">fusion.payroll.migration.list</field>
|
|
<field name="model">fusion.payroll.migration</field>
|
|
<field name="arch" type="xml">
|
|
<list string="Migrations">
|
|
<field name="name"/>
|
|
<field name="company_id"/>
|
|
<field name="migration_type"/>
|
|
<field name="employee_count"/>
|
|
<field name="payslip_count"/>
|
|
<field name="state"/>
|
|
<field name="create_date"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|