From 76a6af8b23079a8b182f9225b9bcc626d97d295c Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Mon, 22 Jun 2015 16:25:23 +0200 Subject: [PATCH] [ADD] POS with tax addon --- pos_with_tax/README.rst | 38 ++++++ pos_with_tax/__init__.py | 24 ++++ pos_with_tax/__openerp__.py | 43 ++++++ pos_with_tax/i18n/es.po | 38 ++++++ pos_with_tax/i18n/pos_with_tax.pot | 38 ++++++ pos_with_tax/static/description/icon.png | Bin 0 -> 12986 bytes pos_with_tax/static/src/js/main.js | 148 +++++++++++++++++++++ pos_with_tax/static/src/xml/pos.xml | 20 +++ pos_with_tax/views/pos_template.xml | 13 ++ pos_with_tax/views/report_receipt_view.xml | 12 ++ 10 files changed, 374 insertions(+) create mode 100644 pos_with_tax/README.rst create mode 100644 pos_with_tax/__init__.py create mode 100644 pos_with_tax/__openerp__.py create mode 100644 pos_with_tax/i18n/es.po create mode 100644 pos_with_tax/i18n/pos_with_tax.pot create mode 100644 pos_with_tax/static/description/icon.png create mode 100644 pos_with_tax/static/src/js/main.js create mode 100644 pos_with_tax/static/src/xml/pos.xml create mode 100644 pos_with_tax/views/pos_template.xml create mode 100644 pos_with_tax/views/report_receipt_view.xml diff --git a/pos_with_tax/README.rst b/pos_with_tax/README.rst new file mode 100644 index 00000000..6476aa3d --- /dev/null +++ b/pos_with_tax/README.rst @@ -0,0 +1,38 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: AGPLv3 License + +Point of sale with tax +====================== + +Include tax in price on POS. + +This addons takes care of tax configuration: price_include, showing prices +with tax included even price_include == True or price_include == False + +This helps to shop owner because he can set product prices with taxes +or without taxes, but prices are always shown in POS with taxes + + +Credits +======= + +Contributors +------------ + +* Antonio Espinosa +* Endika Iglesias + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/pos_with_tax/__init__.py b/pos_with_tax/__init__.py new file mode 100644 index 00000000..f3ebd3ec --- /dev/null +++ b/pos_with_tax/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright : +# (c) 2014 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com) +# Endika Iglesias +# Antonio Espinosa +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/pos_with_tax/__openerp__.py b/pos_with_tax/__openerp__.py new file mode 100644 index 00000000..423acdde --- /dev/null +++ b/pos_with_tax/__openerp__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright : +# (c) 2014 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com) +# Endika Iglesias +# Antonio Espinosa +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + 'name': 'Point of sale with tax', + 'category': 'Point Of Sale', + 'version': '1.0', + 'depends': [ + 'point_of_sale', + ], + 'data': [ + 'views/pos_template.xml', + 'views/report_receipt_view.xml', + ], + 'qweb': [ + 'static/src/xml/pos.xml', + ], + 'author': 'Antiun Ingenieria S.L.', + 'website': 'http://www.antiun.com', + 'license': 'AGPL-3', + 'installable': True, +} diff --git a/pos_with_tax/i18n/es.po b/pos_with_tax/i18n/es.po new file mode 100644 index 00000000..ba48c99e --- /dev/null +++ b/pos_with_tax/i18n/es.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_with_tax +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-08 11:11+0000\n" +"PO-Revision-Date: 2015-06-08 11:11+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_with_tax +#. openerp-web +#: code:addons/pos_with_tax/static/src/js/models.js:98 +#, python-format +msgid "Connecting to the PosBox" +msgstr "Conectando a PosBox" + +#. module: pos_with_tax +#. openerp-web +#: code:addons/pos_with_tax/static/src/js/models.js:240 +#, python-format +msgid "Error: The Point of Sale User must belong to the same company as the Point of Sale. You are probably trying to load the point of sale as an administrator in a multi-company setup, with the administrator account set to the wrong company." +msgstr "Error: El Usuario del terminal de punto de venta debe pertenecer a la misma empresa que el punto de venta. Usted probablemente está intentando cargar el punto de venta como administrador en una configuración multi-empresa, con la cuenta de administrador se establece en la compañía equivocada." + +#. module: pos_with_tax +#. openerp-web +#: code:addons/pos_with_tax/static/src/js/models.js:120 +#: code:addons/pos_with_tax/static/src/js/models.js:403 +#, python-format +msgid "Loading" +msgstr "Cargando" \ No newline at end of file diff --git a/pos_with_tax/i18n/pos_with_tax.pot b/pos_with_tax/i18n/pos_with_tax.pot new file mode 100644 index 00000000..5f8492e4 --- /dev/null +++ b/pos_with_tax/i18n/pos_with_tax.pot @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_with_tax +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-08 11:11+0000\n" +"PO-Revision-Date: 2015-06-08 11:11+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_with_tax +#. openerp-web +#: code:addons/pos_with_tax/static/src/js/models.js:98 +#, python-format +msgid "Connecting to the PosBox" +msgstr "Connecting to the PosBox" + +#. module: pos_with_tax +#. openerp-web +#: code:addons/pos_with_tax/static/src/js/models.js:240 +#, python-format +msgid "Error: The Point of Sale User must belong to the same company as the Point of Sale. You are probably trying to load the point of sale as an administrator in a multi-company setup, with the administrator account set to the wrong company." +msgstr "Error: The Point of Sale User must belong to the same company as the Point of Sale. You are probably trying to load the point of sale as an administrator in a multi-company setup, with the administrator account set to the wrong company." + +#. module: pos_with_tax +#. openerp-web +#: code:addons/pos_with_tax/static/src/js/models.js:120 +#: code:addons/pos_with_tax/static/src/js/models.js:403 +#, python-format +msgid "Loading" +msgstr "Loading" \ No newline at end of file diff --git a/pos_with_tax/static/description/icon.png b/pos_with_tax/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..89cd1bfeb52362c7194028473472b3003653939f GIT binary patch literal 12986 zcmXY21ymeMlpQP(oS?xiKyY_=m*DP@;4Z-luEE`d%^(4S1_pNz79sipoqr))9vGS=2#;w4)bX2hb1#m z=Hj2OyS0ER=uU3YzK!aO?E4znN}*Bcf3m2Hj{)$*a11`~e%#<7oxlhB^z|)iJuaBA`aM~*=n-gU zOhbh_`>;B?8Lh-EWUTEy zquHV7kf2ax5!X;BB&G%h5eTH_FjNRWoo!~pVFzp|P_MSS`cnGeTgJzjy{zmPiI{8; z{Toh9Q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FBODkR9tqp_*HJn}QIYA3C{a6y6N02;E%)+|~^#)S~Xj5&jZ zjLiD0U9OjKA{53vq)IY;f?P;+Z)OwdcW^OGbw`wW$c70JP_I{Opv#-|$^6!{ef;F%efj3_Ppm{r^l9)^V2X0(c@TuudMJU5gLLyylJow#;Z|;c zz2-|c#wCLhAk@kI;juyUpZO2&Lx_<3rR)!Xcb*0VOvqif5`A_~4nq+KV26BIDCwMy zd_S+eIAq6F{N*CjQca)(1>gsP26oU^9S+xInDfZ5ByN*56M-BOQ!s`Er^)CvawIp} zcXy^ZG@At80|4u=`)wD~KjxL#5;RsFfS)VTDHMZM + * # Endika Iglesias + * # + * # This program is free software: you can redistribute it and/or modify + * # it under the terms of the GNU Affero General Public License as + * # published by the Free Software Foundation, either version 3 of the + * # License, or (at your option) any later version. + * # + * # This program is distributed in the hope that it will be useful, + * # but WITHOUT ANY WARRANTY; without even the implied warranty of + * # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * # GNU Affero General Public License for more details. + * # + * # You should have received a copy of the GNU Affero General Public License + * # along with this program. If not, see . + * # + * ############################################################################## + */ + +// Check jQuery available +if (typeof jQuery === 'undefined') { throw new Error('POS with tax Addon requires jQuery') } + ++function ($) { + 'use strict'; + + openerp.pos_with_tax = function (instance) { + var _t = instance.web._t, + _lt = instance.web._lt; + var QWeb = instance.web.qweb; + + var round_pr = instance.web.round_precision; + + instance.point_of_sale.ProductListWidget.include({ + compute_all: function(taxes, price_unit) { + var self = this; + var res = []; + var tmp = 0; + var data = {}; + var currency_rounding = this.pos.currency.rounding; + if (this.pos.company.tax_calculation_rounding_method == "round_globally"){ + currency_rounding = currency_rounding * 0.00001; + } + var base = price_unit; + _(taxes).each(function(tax) { + if (tax.price_include) { + if (tax.type === "percent") { + tmp = round_pr(base - round_pr(base / (1 + tax.amount),currency_rounding),currency_rounding); + data = {amount:tmp, price_include:true, id: tax.id}; + res.push(data); + } else if (tax.type === "fixed") { + tmp = round_pr(tax.amount * self.get_quantity(),currency_rounding); + data = {amount:tmp, price_include:true, id: tax.id}; + res.push(data); + } else { + throw "This type of tax is not supported by the point of sale: " + tax.type; + } + } else { + if (tax.type === "percent") { + tmp = round_pr(tax.amount * base, currency_rounding); + data = {amount:tmp, price_include:false, id: tax.id}; + res.push(data); + } else if (tax.type === "fixed") { + tmp = round_pr(tax.amount * self.get_quantity(), currency_rounding); + data = {amount:tmp, price_include:false, id: tax.id}; + res.push(data); + } else { + throw "This type of tax is not supported by the point of sale: " + tax.type; + } + + var base_amount = data.amount; + var child_amount = 0.0; + if (tax.child_depend) { + res.pop(); // do not use parent tax + child_tax = self.compute_all(tax.child_taxes, base_amount); + res.push(child_tax); + _(child_tax).each(function(child) { + child_amount += child.amount; + }); + } + if (tax.include_base_amount) { + base += base_amount + child_amount; + } + } + }); + return res; + }, + get_product_price_without_tax: function(product){ + return this.get_product_all_prices(product).priceWithoutTax; + }, + get_product_price_with_tax: function(product){ + return this.get_product_all_prices(product).priceWithTax; + }, + get_product_all_prices: function(product){ + var base = round_pr(product.price, this.pos.currency.rounding); + var totalTax = base; + var totalNoTax = base; + var taxtotal = 0; + var taxdetail = {}; + + var taxes_ids = product.taxes_id; + var taxes = this.pos.taxes; + var product_taxes = []; + + _(taxes_ids).each(function(el){ + product_taxes.push(_.detect(taxes, function(t){ + return t.id === el; + })); + }); + + var all_taxes = _(this.compute_all(product_taxes, base)).flatten(); + + _(all_taxes).each(function(tax) { + if (tax.price_include) { + totalNoTax -= tax.amount; + } else { + totalTax += tax.amount; + } + taxtotal += tax.amount; + taxdetail[tax.id] = tax.amount; + }); + + return { + "priceWithTax": totalTax, + "priceWithoutTax": totalNoTax, + "tax": taxtotal, + "taxDetails": taxdetail, + }; + }, + }); + + instance.point_of_sale.Orderline = instance.point_of_sale.Orderline.extend({ + // Show order line prices with taxes included + get_display_price: function(){ + return this.get_price_with_tax(); + }, + }); + + }; + + +}(jQuery); diff --git a/pos_with_tax/static/src/xml/pos.xml b/pos_with_tax/static/src/xml/pos.xml new file mode 100644 index 00000000..54704ea6 --- /dev/null +++ b/pos_with_tax/static/src/xml/pos.xml @@ -0,0 +1,20 @@ + + + + +

+ + + + + + + + + + + +
+ + + diff --git a/pos_with_tax/views/pos_template.xml b/pos_with_tax/views/pos_template.xml new file mode 100644 index 00000000..4a7f8986 --- /dev/null +++ b/pos_with_tax/views/pos_template.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/pos_with_tax/views/report_receipt_view.xml b/pos_with_tax/views/report_receipt_view.xml new file mode 100644 index 00000000..f10775cf --- /dev/null +++ b/pos_with_tax/views/report_receipt_view.xml @@ -0,0 +1,12 @@ + + + + + +