Files
Odoo-Modules/fusion_poynt/views/poynt_settlement_views.xml
gsinghpal 3cc93b8783 changes
2026-04-04 15:37:16 -04:00

240 lines
12 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ==================== SETTLEMENT BATCH ==================== -->
<!-- Tree View -->
<record id="poynt_settlement_batch_view_list" model="ir.ui.view">
<field name="name">poynt.settlement.batch.list</field>
<field name="model">poynt.settlement.batch</field>
<field name="arch" type="xml">
<list decoration-info="state == 'draft'" decoration-success="state == 'reconciled'" decoration-warning="state == 'matched'" decoration-danger="state == 'error'">
<field name="name"/>
<field name="transaction_date"/>
<field name="settlement_date"/>
<field name="sale_count"/>
<field name="refund_count"/>
<field name="poynt_total" sum="Total"/>
<field name="elavon_deposit" sum="Total"/>
<field name="fee_amount" sum="Total"/>
<field name="matched_count"/>
<field name="state" widget="badge"
decoration-info="state == 'draft'"
decoration-success="state == 'reconciled'"
decoration-warning="state == 'matched'"
decoration-danger="state == 'error'"/>
</list>
</field>
</record>
<!-- Form View -->
<record id="poynt_settlement_batch_view_form" model="ir.ui.view">
<field name="name">poynt.settlement.batch.form</field>
<field name="model">poynt.settlement.batch</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_fetch_transactions" type="object"
string="Fetch Transactions" class="btn-primary"
invisible="line_ids or state != 'draft'"/>
<button name="action_match_deposit" type="object"
string="Match Bank Deposit" class="btn-primary"
invisible="state != 'draft' or not line_ids"/>
<button name="action_match_existing_payments" type="object"
string="Match Existing Payments" class="btn-secondary"
invisible="state not in ('draft', 'matched')"/>
<button name="action_reset_to_draft" type="object"
string="Reset to Draft" class="btn-secondary"
invisible="state in ('draft', 'reconciled')"/>
<field name="state" widget="statusbar" statusbar_visible="draft,matched,reconciled"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_payments" type="object"
class="oe_stat_button" icon="fa-money"
invisible="payment_count == 0">
<field name="payment_count" string="Payments" widget="statinfo"/>
</button>
<button name="action_view_invoices" type="object"
class="oe_stat_button" icon="fa-pencil-square-o"
invisible="invoice_count == 0">
<field name="invoice_count" string="Invoices" widget="statinfo"/>
</button>
</div>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="transaction_date"/>
<field name="settlement_date"/>
<field name="provider_id"/>
</group>
<group>
<field name="poynt_total"/>
<field name="elavon_deposit"/>
<field name="fee_amount"/>
<field name="currency_id" invisible="1"/>
<field name="bank_statement_line_id"/>
</group>
</group>
<group>
<group>
<field name="sale_count"/>
<field name="refund_count"/>
<field name="matched_count"/>
</group>
</group>
<notebook>
<page string="Transaction Lines" name="lines">
<field name="line_ids">
<list editable="bottom"
decoration-success="state == 'matched'"
decoration-muted="state == 'no_match'"
decoration-danger="state == 'error'">
<field name="transaction_date"/>
<field name="action"/>
<field name="amount" sum="Total"/>
<field name="card_brand"/>
<field name="card_last4"/>
<field name="card_holder_name"/>
<field name="partner_id"/>
<field name="existing_payment_id" string="Staff Payment"/>
<field name="existing_invoice_id" string="Invoice"/>
<field name="match_method"/>
<field name="state" widget="badge"
decoration-success="state == 'matched'"
decoration-muted="state == 'no_match'"
decoration-danger="state == 'error'"/>
<field name="currency_id" column_invisible="1"/>
</list>
</field>
</page>
<page string="Notes" name="notes">
<field name="notes"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Search View -->
<record id="poynt_settlement_batch_view_search" model="ir.ui.view">
<field name="name">poynt.settlement.batch.search</field>
<field name="model">poynt.settlement.batch</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="transaction_date"/>
<field name="settlement_date"/>
<filter name="filter_draft" string="Draft" domain="[('state', '=', 'draft')]"/>
<filter name="filter_matched" string="Matched" domain="[('state', '=', 'matched')]"/>
<filter name="filter_reconciled" string="Reconciled" domain="[('state', '=', 'reconciled')]"/>
<filter name="filter_error" string="Errors" domain="[('state', '=', 'error')]"/>
<separator/>
<filter name="group_state" string="Status" context="{'group_by': 'state'}" domain="[]"/>
<filter name="group_settlement_date" string="Settlement Date" context="{'group_by': 'settlement_date:month'}" domain="[]"/>
</search>
</field>
</record>
<!-- Action -->
<record id="action_poynt_settlement_batch" model="ir.actions.act_window">
<field name="name">Settlement Batches</field>
<field name="res_model">poynt.settlement.batch</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="poynt_settlement_batch_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No settlement batches yet
</p>
<p>
Settlement batches are created automatically by the daily cron job,
or you can create one manually to fetch Poynt terminal transactions
for a specific date.
</p>
</field>
</record>
<!-- ==================== SETTLEMENT LINE ==================== -->
<!-- Tree View (standalone) -->
<record id="poynt_settlement_line_view_list" model="ir.ui.view">
<field name="name">poynt.settlement.line.list</field>
<field name="model">poynt.settlement.line</field>
<field name="arch" type="xml">
<list decoration-success="state == 'matched'" decoration-muted="state == 'no_match'" decoration-danger="state == 'error'">
<field name="batch_id"/>
<field name="transaction_date"/>
<field name="action"/>
<field name="amount" sum="Total"/>
<field name="card_brand"/>
<field name="card_last4"/>
<field name="card_holder_name"/>
<field name="partner_id"/>
<field name="existing_payment_id" string="Staff Payment"/>
<field name="existing_invoice_id" string="Invoice"/>
<field name="match_method"/>
<field name="state" widget="badge"
decoration-success="state == 'matched'"
decoration-muted="state == 'no_match'"
decoration-danger="state == 'error'"/>
</list>
</field>
</record>
<!-- Search View -->
<record id="poynt_settlement_line_view_search" model="ir.ui.view">
<field name="name">poynt.settlement.line.search</field>
<field name="model">poynt.settlement.line</field>
<field name="arch" type="xml">
<search>
<field name="card_holder_name"/>
<field name="card_last4"/>
<field name="partner_id"/>
<field name="poynt_transaction_id"/>
<filter name="filter_unmatched" string="No Payment Found" domain="[('state', '=', 'no_match')]"/>
<filter name="filter_matched" string="Matched to Payment" domain="[('state', '=', 'matched')]"/>
<filter name="filter_fetched" string="Pending Match" domain="[('state', '=', 'fetched')]"/>
<filter name="filter_errors" string="Errors" domain="[('state', '=', 'error')]"/>
<separator/>
<filter name="group_batch" string="Batch" context="{'group_by': 'batch_id'}" domain="[]"/>
<filter name="group_partner" string="Customer" context="{'group_by': 'partner_id'}" domain="[]"/>
<filter name="group_card_brand" string="Card Brand" context="{'group_by': 'card_brand'}" domain="[]"/>
<filter name="group_state" string="Status" context="{'group_by': 'state'}" domain="[]"/>
</search>
</field>
</record>
<!-- Action -->
<record id="action_poynt_settlement_line" model="ir.actions.act_window">
<field name="name">Settlement Transactions</field>
<field name="res_model">poynt.settlement.line</field>
<field name="view_mode">list</field>
<field name="search_view_id" ref="poynt_settlement_line_view_search"/>
</record>
<!-- ==================== MENUS ==================== -->
<menuitem id="menu_poynt_settlement_root"
name="Settlements"
parent="account.root_payment_menu"
sequence="30"/>
<menuitem id="menu_poynt_settlement_batches"
name="Settlement Batches"
parent="menu_poynt_settlement_root"
action="action_poynt_settlement_batch"
sequence="10"/>
<menuitem id="menu_poynt_settlement_lines"
name="All Transactions"
parent="menu_poynt_settlement_root"
action="action_poynt_settlement_line"
sequence="20"/>
</odoo>