summaryrefslogtreecommitdiff
path: root/addons/pos_mercury/views
diff options
context:
space:
mode:
Diffstat (limited to 'addons/pos_mercury/views')
-rw-r--r--addons/pos_mercury/views/pos_config_setting_views.xml18
-rw-r--r--addons/pos_mercury/views/pos_mercury_templates.xml18
-rw-r--r--addons/pos_mercury/views/pos_mercury_transaction_templates.xml69
-rw-r--r--addons/pos_mercury/views/pos_mercury_views.xml96
4 files changed, 201 insertions, 0 deletions
diff --git a/addons/pos_mercury/views/pos_config_setting_views.xml b/addons/pos_mercury/views/pos_config_setting_views.xml
new file mode 100644
index 00000000..1e0e6f48
--- /dev/null
+++ b/addons/pos_mercury/views/pos_config_setting_views.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="res_config_settings_view_form_inherit_pos_mercury" model="ir.ui.view">
+ <field name="name">res.config.form.inherit.mercury</field>
+ <field name="model">res.config.settings</field>
+ <field name="inherit_id" ref="point_of_sale.res_config_settings_view_form"/>
+ <field name="arch" type="xml">
+ <div id="btn_use_pos_mercury" position="replace">
+ <div class="mt16">
+ <button name="%(pos_mercury.action_configuration_form)d" icon="fa-arrow-right" type="action" string="Vantiv Accounts" class="btn-link"/>
+ </div>
+ <div>
+ <a href="https://www.odoo.com/page/point-of-sale-hardware#part_8" target="_blank"><i class="fa fa-fw fa-arrow-right"/>Buy a card reader</a>
+ </div>
+ </div>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/pos_mercury/views/pos_mercury_templates.xml b/addons/pos_mercury/views/pos_mercury_templates.xml
new file mode 100644
index 00000000..4233cda5
--- /dev/null
+++ b/addons/pos_mercury/views/pos_mercury_templates.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data>
+
+ <template id="assets" inherit_id="point_of_sale.assets">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/pos_mercury/static/src/js/pos_mercury.js"></script>
+ <script type="text/javascript" src="/pos_mercury/static/src/js/OrderReceipt.js"></script>
+ <script type="text/javascript" src="/pos_mercury/static/src/js/PaymentScreen.js"></script>
+ <script type="text/javascript" src="/pos_mercury/static/src/js/PaymentScreenPaymentLines.js"></script>
+ <script type="text/javascript" src="/pos_mercury/static/src/js/PaymentTransactionPopup.js"></script>
+ <script type="text/javascript" src="/pos_mercury/static/src/js/ProductScreen.js"></script>
+ <link rel="stylesheet" href="/pos_mercury/static/src/css/pos_mercury.css"/>
+ </xpath>
+ </template>
+
+ </data>
+</odoo>
diff --git a/addons/pos_mercury/views/pos_mercury_transaction_templates.xml b/addons/pos_mercury/views/pos_mercury_transaction_templates.xml
new file mode 100644
index 00000000..41e268c9
--- /dev/null
+++ b/addons/pos_mercury/views/pos_mercury_transaction_templates.xml
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='utf-8'?>
+<odoo>
+ <data>
+ <template id='mercury_common'>
+ <MerchantID><t t-esc='merchant_id'/></MerchantID>
+ <TranType><t t-esc='transaction_type'/></TranType>
+ <TranCode><t t-esc='transaction_code'/></TranCode>
+ <InvoiceNo><t t-esc='invoice_no'/></InvoiceNo>
+ <Frequency t-translation="off">OneTime</Frequency>
+ </template>
+
+ <template id='mercury_transaction'>
+ <TStream t-translation="off">
+ <Transaction>
+ <t t-call='pos_mercury.mercury_common'/>
+ <OperatorID><t t-esc='operator_id'/></OperatorID>
+ <RecordNo>RecordNumberRequested</RecordNo>
+ <PartialAuth>Allow</PartialAuth>
+ <Memo><t t-esc='memo'/></Memo>
+ <Account>
+ <AccountSource>Swiped</AccountSource>
+ <EncryptedBlock><t t-esc='encrypted_block'/></EncryptedBlock>
+ <EncryptedKey><t t-esc='encrypted_key'/></EncryptedKey>
+ <EncryptedFormat>MagneSafe</EncryptedFormat>
+ </Account>
+ <Amount>
+ <Purchase><t t-esc='"%.2f" % purchase'/></Purchase> <!-- format required by Vantiv -->
+ </Amount>
+ </Transaction>
+ </TStream>
+ </template>
+
+ <template id='mercury_voidsale'>
+ <TStream t-translation="off">
+ <Transaction>
+ <t t-call='pos_mercury.mercury_common'/>
+ <RefNo><t t-esc='ref_no'/></RefNo>
+ <RecordNo><t t-esc='record_no'/></RecordNo>
+ <Memo><t t-esc='memo'/></Memo>
+ <Amount>
+ <Purchase><t t-esc='"%.2f" % authorize'/></Purchase> <!-- format required by Vantiv -->
+ </Amount>
+ <TranInfo>
+ <AuthCode><t t-esc='auth_code'/></AuthCode>
+ <t t-if='not is_voidsale'>
+ <AcqRefData><t t-esc='acq_ref_data'/></AcqRefData>
+ <ProcessData><t t-esc='process_data'/></ProcessData>
+ </t>
+ </TranInfo>
+ </Transaction>
+ </TStream>
+ </template>
+
+ <template id='mercury_return'>
+ <TStream t-translation="off">
+ <Transaction>
+ <t t-call='pos_mercury.mercury_common'/>
+ <OperatorID><t t-esc='operator_id'/></OperatorID>
+ <PartialAuth>Allow</PartialAuth>
+ <RefNo><t t-esc='ref_no'/></RefNo>
+ <RecordNo><t t-esc='record_no'/></RecordNo>
+ <Amount>
+ <Purchase><t t-esc='"%.2f" % purchase'/></Purchase>
+ </Amount>
+ </Transaction>
+ </TStream>
+ </template>
+ </data>
+</odoo>
diff --git a/addons/pos_mercury/views/pos_mercury_views.xml b/addons/pos_mercury/views/pos_mercury_views.xml
new file mode 100644
index 00000000..2ba576e3
--- /dev/null
+++ b/addons/pos_mercury/views/pos_mercury_views.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<odoo>
+ <data>
+ <record id="view_pos_mercury_configuration_form" model="ir.ui.view" >
+ <field name="name">Vantiv Configurations</field>
+ <field name="model">pos_mercury.configuration</field>
+ <field name="arch" type="xml">
+ <form string="Card Reader">
+ <sheet>
+ <div class="oe_title">
+ <label for="name" class="oe_edit_only"/>
+ <h1><field name="name"/></h1>
+ </div>
+ <div>
+ <p>
+ <i>Vantiv Configurations</i> define what Vantiv account will be used when
+ processing credit card transactions in the Point Of Sale. Setting up a Vantiv
+ configuration will enable you to allow payments with various credit cards
+ (eg. Visa, MasterCard, Discovery, American Express, ...). After setting up this
+ configuration you should associate it with a Point Of Sale payment method.
+ </p><p>
+ We currently support the MagTek Dynamag card reader device. It can be connected
+ directly to the Point Of Sale device or it can be connected to the IoTBox.
+ </p><p>
+ Using the Vantiv integration in the Point Of Sale is easy: just press the
+ associated payment method. After that the amount can be adjusted (eg. for cashback)
+ just like on any other payment line. Whenever the payment line is set up, a card
+ can be swiped through the card reader device.
+ </p><p>
+ For quickly handling orders: just swiping a credit card when on the payment screen
+ (without having pressed anything else) will charge the full amount of the order to
+ the card.
+ </p><p>
+ If you don't already have a Vantiv account, contact Vantiv at +1 (800) 846-4472
+ to create one.
+ </p>
+ </div>
+ <group col="2">
+ <field name="merchant_id"/>
+ <field name="merchant_pwd"/>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_pos_mercury_configuration_tree" model="ir.ui.view">
+ <field name="name">Vantiv Configurations</field>
+ <field name="model">pos_mercury.configuration</field>
+ <field name="arch" type="xml">
+ <tree string="Card Reader">
+ <field name="name"/>
+ <field name="merchant_id"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="action_configuration_form" model="ir.actions.act_window">
+ <field name="name">Vantiv Configurations</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos_mercury.configuration</field>
+ <field name="view_mode">tree,kanban,form</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Configure your card reader
+ </p>
+ </field>
+ </record>
+
+ <record id="pos_payment_method_view_form" model="ir.ui.view">
+ <field name="name">Payment Method</field>
+ <field name="model">pos.payment.method</field>
+ <field name="inherit_id" ref="point_of_sale.pos_payment_method_view_form"></field>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='use_payment_terminal']" position="after">
+ <field name="pos_mercury_config_id" attrs="{'invisible': [('use_payment_terminal', '!=', 'mercury')], 'required': [('use_payment_terminal', '=', 'mercury')]}"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_pos_order" model="ir.ui.view">
+ <field name="name">POS orders</field>
+ <field name="model">pos.order</field>
+ <field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='amount']" position="before">
+ <field name="mercury_prefixed_card_number" string="Card Number"/>
+ <field name="mercury_card_brand"/>
+ <field name="mercury_card_owner_name"/>
+ </xpath>
+ </field>
+ </record>
+
+ <menuitem parent="point_of_sale.menu_point_config_product" action="pos_mercury.action_configuration_form" id="menu_pos_pos_mercury_config" groups="base.group_no_one" sequence="35"/>
+ </data>
+</odoo>