Initial commit: Pos packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 95dfb9edb0
1301 changed files with 264148 additions and 0 deletions

View file

@ -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/app/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>

View file

@ -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>

View file

@ -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"/>
<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>