diff --git a/advanced_pos_reports/__init__.py b/advanced_pos_reports/__init__.py new file mode 100644 index 000000000..12a4cc229 --- /dev/null +++ b/advanced_pos_reports/__init__.py @@ -0,0 +1,2 @@ +from . import wizard +from . import models \ No newline at end of file diff --git a/advanced_pos_reports/__manifest__.py b/advanced_pos_reports/__manifest__.py new file mode 100644 index 000000000..32d82cbe2 --- /dev/null +++ b/advanced_pos_reports/__manifest__.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +{ + 'name': 'Advanced POS Reports', + 'version': '15.0.1.0.0', + 'summary': """Generates Various Reports From POS Screen and From Reporting Menu""", + 'description': """Generates various reports like Sales summary, top selling products / categories / + customers report, ongoing sessions report, posted sessions report under reporting menu, """, + 'category': 'Sale', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['point_of_sale', 'pos_sale'], + 'website': 'https://www.cybrosys.com', + 'data': [ + 'security/ir.model.access.csv', + 'wizard/pos_sale_details.xml', + 'wizard/top_selling.xml', + 'wizard/ongoing_session.xml', + 'wizard/posted_session.xml', + 'wizard/top_selling.xml', + 'views/reports.xml', + 'views/report_pos_saledetails.xml', + 'views/report_pos_posted_session.xml', + 'views/report_pos_ongoing_session.xml', + 'views/report_pos_top_selling_products.xml', + 'views/report_pos_top_selling_categories.xml', + 'views/report_pos_top_selling_customers.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + 'advanced_pos_reports/static/src/js/ControlButtons/PaymentSummaryButton.js', + 'advanced_pos_reports/static/src/js/ControlButtons/ProductSummaryButton.js', + 'advanced_pos_reports/static/src/js/ControlButtons/CategorySummaryButton.js', + 'advanced_pos_reports/static/src/js/ControlButtons/LocationSummaryButton.js', + 'advanced_pos_reports/static/src/js/ControlButtons/OrderSummaryButton.js', + 'advanced_pos_reports/static/src/js/ControlButtons/SessionSummaryButton.js', + 'advanced_pos_reports/static/src/js/Popups/LocationSummaryPopup.js', + 'advanced_pos_reports/static/src/js/Popups/CategorySummaryPopup.js', + 'advanced_pos_reports/static/src/js/Popups/OrderSummaryPopup.js', + 'advanced_pos_reports/static/src/js/Popups/PaymentSummaryPopup.js', + 'advanced_pos_reports/static/src/js/Popups/ProductSummaryPopup.js', + 'advanced_pos_reports/static/src/js/Popups/SessionSummaryPopup.js', + 'advanced_pos_reports/static/src/js/ReceiptScreen/LocationSummaryReceiptScreen.js', + 'advanced_pos_reports/static/src/js/ReceiptScreen/CategorySummaryReceiptScreen.js', + 'advanced_pos_reports/static/src/js/ReceiptScreen/OrderSummaryReceiptScreen.js', + 'advanced_pos_reports/static/src/js/ReceiptScreen/PaymentSummaryReceiptScreen.js', + 'advanced_pos_reports/static/src/js/ReceiptScreen/ProductSummaryReceiptScreen.js', + 'advanced_pos_reports/static/src/js/ReceiptScreen/SessionSummaryReceiptScreen.js', + 'advanced_pos_reports/static/src/js/Receipts/OrderSummaryReceipt.js', + 'advanced_pos_reports/static/src/js/Receipts/PaymentSummaryReceipt.js', + 'advanced_pos_reports/static/src/js/Receipts/ProductSummaryReceipt.js', + 'advanced_pos_reports/static/src/js/Receipts/CategorySummaryReceipt.js', + 'advanced_pos_reports/static/src/js/Receipts/SessionSummaryReceipt.js', + 'advanced_pos_reports/static/src/js/Receipts/LocationSummaryReceipt.js', + 'advanced_pos_reports/static/src/css/advanced_report.css', + ], + 'web.assets_qweb': [ + 'advanced_pos_reports/static/src/xml/**/*', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'OPL-1', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/advanced_pos_reports/models/__init__.py b/advanced_pos_reports/models/__init__.py new file mode 100644 index 000000000..ea59196a0 --- /dev/null +++ b/advanced_pos_reports/models/__init__.py @@ -0,0 +1,8 @@ +from . import pos_sale_report +from . import pos_posted_session_report +from . import pos_ongoing_session_report +from . import pos_order +from . import pos_top_selling_products +from . import pos_top_selling_categories +from . import pos_top_selling_customers + diff --git a/advanced_pos_reports/models/pos_ongoing_session_report.py b/advanced_pos_reports/models/pos_ongoing_session_report.py new file mode 100644 index 000000000..3b00ba570 --- /dev/null +++ b/advanced_pos_reports/models/pos_ongoing_session_report.py @@ -0,0 +1,79 @@ +from odoo import api, fields, models +from odoo.osv.expression import AND + + +class ReportPosOngoing(models.AbstractModel): + _name = 'report.advanced_pos_reports.report_pos_ongoing_session' + + def get_ongoing_sessions_details(self, session_ids=False): + domain = [('state', '=', 'opened')] + if session_ids: + domain = AND([domain, [('id', 'in', session_ids)]]) + sessions = self.env['pos.session'].search(domain) + amount_total_without_tax = 0 + amount_total_tax = 0 + amount_total_return = 0 + orders = [] + for session in sessions: + for order in session.order_ids.filtered(lambda x:x.state in ['paid', 'done', 'invoiced']): + orders.append(order.id) + currency = order.pricelist_id.currency_id + amount_tax = currency.round(sum(order._amount_line_tax(line, order.fiscal_position_id) for line in order.lines)) + amount_untaxed = currency.round(sum(line.price_subtotal for line in order.lines)) + amount_return = sum(payment.amount < 0 and payment.amount or 0 for payment in order.payment_ids) + amount_total_without_tax += amount_untaxed + amount_total_tax += amount_tax + amount_total_return += amount_return + order_ids = self.env["pos.order"].search([('id', 'in', orders)]) + user_currency = self.env.company.currency_id + + total = 0.0 + for order in order_ids: + if user_currency != order.pricelist_id.currency_id: + total += order.pricelist_id.currency_id._convert( + order.amount_total, user_currency, order.company_id, order.date_order or fields.Date.today()) + else: + total += order.amount_total + currency = order.session_id.currency_id + + categories = [] + if order_ids: + self.env.cr.execute("""SELECT category.name, + sum(price_subtotal_incl) as amount FROM pos_order_line AS line, + pos_category AS category, product_product AS product INNER JOIN + product_template AS template ON product.product_tmpl_id = template.id WHERE line.product_id = product.id + AND template.pos_categ_id = category.id + AND line.order_id IN %s GROUP BY category.name """, (tuple(order_ids.ids),)) + categories = self.env.cr.dictfetchall() + + payment_ids = self.env["pos.payment"].search([('pos_order_id', 'in', order_ids.ids)]).ids + if payment_ids: + self.env.cr.execute(""" + SELECT method.name, sum(amount) total + FROM pos_payment AS payment, + pos_payment_method AS method + WHERE payment.payment_method_id = method.id + AND payment.id IN %s + GROUP BY method.name + """, (tuple(payment_ids),)) + payments = self.env.cr.dictfetchall() + else: + payments = [] + amount_total = amount_total_without_tax + amount_tax + return { + 'sessions': sessions, + 'categories': categories, + 'today': fields.Datetime.now(), + 'total_paid': user_currency.round(total), + 'amount_total_without_tax': amount_total_without_tax, + 'amount_total_tax': amount_total_tax, + 'amount_return': amount_total_return, + 'amount_total': total, + 'payments': payments + } + + @api.model + def _get_report_values(self, docids, data=None): + data = dict(data or {}) + data.update(self.get_ongoing_sessions_details(data['session_ids'])) + return data \ No newline at end of file diff --git a/advanced_pos_reports/models/pos_order.py b/advanced_pos_reports/models/pos_order.py new file mode 100644 index 000000000..b3259e83e --- /dev/null +++ b/advanced_pos_reports/models/pos_order.py @@ -0,0 +1,129 @@ +import logging +from odoo import models + +_logger = logging.getLogger(__name__) + + +class PosOrder(models.Model): + _inherit = 'pos.order' + + def get_category_summary(self, order_ids): + orders = self.env['pos.order'].search([('id', 'in', order_ids)]) + categories = [] + if orders: + self.env.cr.execute("""SELECT category.name, sum(price_subtotal_incl) as amount, + sum(qty) as qty FROM pos_order_line AS line INNER JOIN + product_product AS product ON line.product_id = product.id INNER JOIN + product_template AS template ON product.product_tmpl_id = template.id + INNER JOIN pos_category as category ON template.pos_categ_id = category.id + WHERE line.order_id IN %s GROUP BY category.name """, (tuple(orders.ids),)) + categories = self.env.cr.dictfetchall() + return categories + + def get_product_summary(self, order_ids): + orders = self.env['pos.order'].search([('id', 'in', order_ids)]) + if orders: + self.env.cr.execute(""" + SELECT product.id, template.name, product.default_code as code, sum(qty) as qty + FROM product_product AS product, + pos_order_line AS line, product_template AS template + WHERE product.id = line.product_id AND template.id = product.product_tmpl_id + AND line.order_id IN %s + GROUP BY product.id, template.name, template.default_code + """, (tuple(orders.ids),)) + product_summary = self.env.cr.dictfetchall() + else: + product_summary = [] + return product_summary + + def get_order_summary(self, order_ids): + orders = self.env['pos.order'].search([('id', 'in', order_ids)]) + order_summary = [] + for order in orders: + order_summary.append( + {'order_name': order.name, 'state': dict(self._fields['state'].selection).get(order.state), + 'date_order': order.date_order, 'amount_total': order.amount_total}) + return order_summary + + +class PosPayment(models.Model): + _inherit = 'pos.payment' + + def get_payment_summary(self, order_ids): + orders = self.env['pos.order'].search([('id', 'in', order_ids)]) + payment_ids = self.env["pos.payment"].search([('pos_order_id', 'in', orders.ids)]).ids + if payment_ids: + self.env.cr.execute(""" + SELECT method.name, sum(amount) total + FROM pos_payment AS payment, + pos_payment_method AS method + WHERE payment.payment_method_id = method.id + AND payment.id IN %s + GROUP BY method.name + """, (tuple(payment_ids),)) + payments_summary = self.env.cr.dictfetchall() + else: + payments_summary = [] + return payments_summary + + +class PosSession(models.Model): + _inherit = 'pos.session' + + def get_session_summary(self, session): + if session: + session = self.env['pos.session'].search([('id', '=', session)]) + order_ids = session.order_ids + if order_ids: + self.env.cr.execute(""" + SELECT product.id, template.name, product.default_code as code, sum(qty) as qty, sum(line.price_subtotal_incl) as total + FROM product_product AS product, + pos_order_line AS line, product_template AS template + WHERE product.id = line.product_id AND template.id = product.product_tmpl_id + AND line.order_id IN %s + GROUP BY product.id, template.name, template.default_code + """, (tuple(order_ids.ids),)) + product_summary = self.env.cr.dictfetchall() + payment_ids = self.env["pos.payment"].search([('pos_order_id', 'in', order_ids.ids)]).ids + if payment_ids: + self.env.cr.execute(""" + SELECT method.name, sum(amount) total + FROM pos_payment AS payment, + pos_payment_method AS method + WHERE payment.payment_method_id = method.id + AND payment.id IN %s + GROUP BY method.name + """, (tuple(payment_ids),)) + payments_summary = self.env.cr.dictfetchall() + else: + payments_summary = [] + else: + product_summary = [] + payments_summary = [] + session_summary = { + 'session_name': session.name, + 'start_date': session.start_at, + 'end_date': session.stop_at, + 'opening_balance': session.cash_register_balance_start, + 'closing_balance': session.cash_register_balance_end_real, + 'product_summary': product_summary, + 'payments_summary': payments_summary + } + return session_summary + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + def get_location_summary(self, location_id): + location_quant = self.env['stock.quant'].search( + [('location_id', '=', int(location_id))]) + location_summary = [] + for quant in location_quant.filtered(lambda x: x.product_id.available_in_pos): + values = { + 'product_id': quant.product_id.id, + 'product': quant.product_id.name, + 'quantity': quant.available_quantity, + } + location_summary.append(values) + return location_summary diff --git a/advanced_pos_reports/models/pos_posted_session_report.py b/advanced_pos_reports/models/pos_posted_session_report.py new file mode 100644 index 000000000..b365c02dc --- /dev/null +++ b/advanced_pos_reports/models/pos_posted_session_report.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- + + +from odoo import api, fields, models, tools, _ + +from odoo.osv.expression import AND + + +class ReportPosPosted(models.AbstractModel): + _name = 'report.advanced_pos_reports.report_pos_posted_session' + + def get_posted_sessions_details(self, session_ids=False): + domain = [('state', '=', 'closed')] + if session_ids: + domain = AND([domain, [('id', 'in', session_ids)]]) + sessions = self.env['pos.session'].search(domain) + amount_total_without_tax = 0 + amount_total_tax = 0 + amount_total_return = 0 + orders = [] + for session in sessions: + for order in session.order_ids.filtered(lambda x: x.state in ['paid', 'done', 'invoiced']): + orders.append(order.id) + currency = order.pricelist_id.currency_id + amount_tax = currency.round( + sum(order._amount_line_tax(line, order.fiscal_position_id) for line in order.lines)) + amount_untaxed = currency.round(sum(line.price_subtotal for line in order.lines)) + amount_return = sum(payment.amount < 0 and payment.amount or 0 for payment in order.payment_ids) + amount_total_without_tax += amount_untaxed + amount_total_tax += amount_tax + amount_total_return += amount_return + order_ids = self.env["pos.order"].search([('id', 'in', orders)]) + user_currency = self.env.company.currency_id + + total = 0.0 + for order in order_ids: + if user_currency != order.pricelist_id.currency_id: + total += order.pricelist_id.currency_id._convert( + order.amount_total, user_currency, order.company_id, order.date_order or fields.Date.today()) + else: + total += order.amount_total + currency = order.session_id.currency_id + + categories = [] + if order_ids: + self.env.cr.execute("""SELECT category.name, + sum(price_subtotal_incl) as amount FROM pos_order_line AS line, + pos_category AS category, product_product AS product INNER JOIN + product_template AS template ON product.product_tmpl_id = template.id WHERE line.product_id = product.id + AND template.pos_categ_id = category.id + AND line.order_id IN %s GROUP BY category.name """, (tuple(order_ids.ids),)) + categories = self.env.cr.dictfetchall() + + payment_ids = self.env["pos.payment"].search([('pos_order_id', 'in', order_ids.ids)]).ids + if payment_ids: + self.env.cr.execute(""" + SELECT method.name, sum(amount) total + FROM pos_payment AS payment, + pos_payment_method AS method + WHERE payment.payment_method_id = method.id + AND payment.id IN %s + GROUP BY method.name + """, (tuple(payment_ids),)) + payments = self.env.cr.dictfetchall() + else: + payments = [] + + return { + 'sessions': sessions, + 'categories': categories, + 'today': fields.Datetime.now(), + 'total_paid': user_currency.round(total), + 'amount_total_without_tax': amount_total_without_tax, + 'amount_total_tax': amount_total_tax, + 'amount_return': amount_total_return, + 'amount_total': total, + 'payments': payments + } + + @api.model + def _get_report_values(self, docids, data=None): + data = dict(data or {}) + data.update(self.get_posted_sessions_details(data['session_ids'])) + return data diff --git a/advanced_pos_reports/models/pos_sale_report.py b/advanced_pos_reports/models/pos_sale_report.py new file mode 100644 index 000000000..0030d8c6f --- /dev/null +++ b/advanced_pos_reports/models/pos_sale_report.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +import logging +from datetime import timedelta +from functools import partial +from itertools import groupby + +import psycopg2 +import pytz +import re + +from odoo import api, fields, models, tools, _ +from odoo.tools import float_is_zero, float_round, float_repr, float_compare +from odoo.exceptions import ValidationError, UserError +from odoo.http import request +from odoo.osv.expression import AND +import base64 + +_logger = logging.getLogger(__name__) + + +class ReportSaleDetails(models.AbstractModel): + _name = 'report.advanced_pos_reports.report_pos_saledetails' + _description = 'Point of Sale Details' + + @api.model + def get_sale_details(self, date_start=False, date_stop=False, user_ids=False): + domain = [('state', 'in', ['paid', 'invoiced', 'done'])] + + if date_start: + date_start = fields.Datetime.from_string(date_start) + else: + user_tz = pytz.timezone(self.env.context.get('tz') or self.env.user.tz or 'UTC') + today = user_tz.localize(fields.Datetime.from_string(fields.Date.context_today(self))) + date_start = today.astimezone(pytz.timezone('UTC')) + + if date_stop: + date_stop = fields.Datetime.from_string(date_stop) + if (date_stop < date_start): + date_stop = date_start + timedelta(days=1, seconds=-1) + else: + date_stop = date_start + timedelta(days=1, seconds=-1) + + domain = AND([domain, + [('date_order', '>=', fields.Datetime.to_string(date_start)), + ('date_order', '<=', fields.Datetime.to_string(date_stop))] + ]) + + orders = self.env['pos.order'].search(domain) + orders_summary = [] + amount_total = 0 + amount_tax = 0 + for user in user_ids: + total_sales = 0 + total_tax = 0 + orders_list = [] + payments = [] + categories = [] + for order in orders.filtered(lambda x:x.user_id.id == user.id): + total_sales += order.amount_total + total_tax += order.amount_tax + amount_total += order.amount_total + amount_tax += order.amount_tax + orders_list.append(order.id) + if orders_list: + payment_ids = self.env["pos.payment"].search([('pos_order_id', 'in', orders_list)]).ids + if payment_ids: + self.env.cr.execute(""" + SELECT method.name, sum(amount) total + FROM pos_payment AS payment, + pos_payment_method AS method + WHERE payment.payment_method_id = method.id + AND payment.id IN %s + GROUP BY method.name + """, (tuple(payment_ids),)) + payments = self.env.cr.dictfetchall() + else: + payments = [] + categ = self.env.cr.execute("""SELECT category.name, + sum(price_subtotal_incl) as amount FROM pos_order_line AS line, + pos_category AS category, product_product AS product INNER JOIN + product_template AS template ON product.product_tmpl_id = template.id + WHERE line.product_id = product.id + AND template.pos_categ_id = category.id + AND line.order_id IN %s + GROUP BY category.name ORDER BY amount DESC + """, (tuple(orders_list),)) + categories = self.env.cr.dictfetchall() + orders_summary.append({'user': user.name, 'total_sales': total_sales, 'tax': total_tax, + 'gross_total': total_sales, 'payments': payments, 'categories': categories}) + user_currency = self.env.company.currency_id + + return { + 'currency_precision': user_currency.decimal_places, + 'order_summary': orders_summary, + 'users': user_ids, + 'company_name': self.env.company.name, + 'amount_total_without_tax': amount_total - amount_tax, + 'amount_tax': amount_tax + } + + @api.model + def _get_report_values(self, docids, data=None): + data = dict(data or {}) + users = self.env['res.users'].browse(data['user_ids']) + data.update(self.get_sale_details(data['date_start'], data['date_stop'], users)) + return data diff --git a/advanced_pos_reports/models/pos_top_selling_categories.py b/advanced_pos_reports/models/pos_top_selling_categories.py new file mode 100644 index 000000000..5fca58fbb --- /dev/null +++ b/advanced_pos_reports/models/pos_top_selling_categories.py @@ -0,0 +1,34 @@ +from odoo import api, fields, models, tools, _ +from odoo.osv.expression import AND + + +class ReportPosCategories(models.AbstractModel): + _name = 'report.advanced_pos_reports.report_pos_top_selling_categories' + + def get_top_selling_categories_details(self, no_of_categories=False, start_date=False, end_date=False): + order_ids = self.env["pos.order"].search([('date_order', '>=', start_date), + ('date_order', '<=', end_date), ('state', 'in', ['paid', 'done', 'invoiced'])]) + user_currency = self.env.company.currency_id + if order_ids: + self.env.cr.execute("""SELECT category.name, + sum(price_subtotal_incl) as amount FROM pos_order_line AS line, + pos_category AS category, product_product AS product INNER JOIN + product_template AS template ON product.product_tmpl_id = template.id WHERE line.product_id = product.id + AND template.pos_categ_id = category.id + AND line.order_id IN %s + GROUP BY category.name ORDER BY amount DESC LIMIT %s + """, (tuple(order_ids.ids), no_of_categories)) + categories = self.env.cr.dictfetchall() + return { + 'categories': categories or [], + 'today': fields.Datetime.now(), + 'start_date': start_date, + 'end_date': end_date + } + + @api.model + def _get_report_values(self, docids, data=None): + data = dict(data or {}) + data.update(self.get_top_selling_categories_details(data['no_of_categories'], data['start_date'], + data['end_date'])) + return data \ No newline at end of file diff --git a/advanced_pos_reports/models/pos_top_selling_customers.py b/advanced_pos_reports/models/pos_top_selling_customers.py new file mode 100644 index 000000000..387ed664d --- /dev/null +++ b/advanced_pos_reports/models/pos_top_selling_customers.py @@ -0,0 +1,31 @@ +from odoo import api, fields, models + + +class ReportPosCustomers(models.AbstractModel): + _name = 'report.advanced_pos_reports.report_pos_top_selling_customers' + + def get_top_selling_customers_details(self, no_of_customers=False, start_date=False, end_date=False): + order_ids = self.env["pos.order"].search([('date_order', '>=', start_date), + ('date_order', '<=', end_date), + ('state', 'in', ['paid', 'done', 'invoiced'])]) + user_currency = self.env.company.currency_id + if order_ids: + self.env.cr.execute("""SELECT partner.id, partner.name, + sum(amount_total) as amount FROM pos_order, res_partner AS partner + WHERE partner.id= pos_order.partner_id AND pos_order.id IN %s + GROUP BY partner.id, partner.name ORDER BY amount DESC LIMIT %s + """, (tuple(order_ids.ids), no_of_customers)) + customers = self.env.cr.dictfetchall() + return { + 'customers': customers or [], + 'today': fields.Datetime.now(), + 'start_date': start_date, + 'end_date': end_date + } + + @api.model + def _get_report_values(self, docids, data=None): + data = dict(data or {}) + data.update(self.get_top_selling_customers_details(data['no_of_customers'], data['start_date'], + data['end_date'])) + return data diff --git a/advanced_pos_reports/models/pos_top_selling_products.py b/advanced_pos_reports/models/pos_top_selling_products.py new file mode 100644 index 000000000..3ce3cef6e --- /dev/null +++ b/advanced_pos_reports/models/pos_top_selling_products.py @@ -0,0 +1,35 @@ +from odoo import api, fields, models, tools, _ +from odoo.osv.expression import AND + + +class ReportPosProducts(models.AbstractModel): + _name = 'report.advanced_pos_reports.report_pos_top_selling_products' + + def get_top_selling_products_details(self, no_of_products=False, start_date=False, end_date=False): + order_ids = self.env["pos.order"].search([('date_order', '>=', start_date), + ('date_order', '<=', end_date), ('state', 'in', ['paid', 'done', 'invoiced'])]) + user_currency = self.env.company.currency_id + categories = [] + if order_ids: + self.env.cr.execute(""" + SELECT product.id, template.name, uom.name AS uom, product.default_code as code, sum(qty) as qty, sum(line.price_subtotal_incl) as total + FROM product_product AS product, + pos_order_line AS line, product_template AS template , uom_uom AS uom + WHERE product.id = line.product_id AND template.id = product.product_tmpl_id AND uom.id = template.uom_id + AND line.order_id IN %s + GROUP BY product.id, template.name, template.default_code, uom.name ORDER BY qty DESC LIMIT %s + """, (tuple(order_ids.ids), no_of_products)) + product_summary = self.env.cr.dictfetchall() + return { + 'products': product_summary, + 'today': fields.Datetime.now(), + 'start_date': start_date, + 'end_date': end_date + } + + @api.model + def _get_report_values(self, docids, data=None): + data = dict(data or {}) + data.update(self.get_top_selling_products_details(data['no_of_products'], data['start_date'], + data['end_date'])) + return data \ No newline at end of file diff --git a/advanced_pos_reports/security/ir.model.access.csv b/advanced_pos_reports/security/ir.model.access.csv new file mode 100644 index 000000000..0c20834dc --- /dev/null +++ b/advanced_pos_reports/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pos_sale_details_wizard,access.pos.sale.details.wizard,model_pos_sale_details_wizard,point_of_sale.group_pos_manager,1,1,1,0 +access_pos_sale_top_selling_wizard,access.pos.sale.top.selling.wizard,model_pos_sale_top_selling,point_of_sale.group_pos_manager,1,1,1,0 +access_pos_sale_ongoing,access.pos.sale.ongoing.wizard,model_pos_sale_ongoing_wizard,point_of_sale.group_pos_manager,1,1,1,0 +access_pos_sale_posted,access.pos.sale.posted.wizard,model_pos_sale_posted_wizard,point_of_sale.group_pos_manager,1,1,1,0 diff --git a/advanced_pos_reports/static/description/assets/icons/check.png b/advanced_pos_reports/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/check.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/chevron.png b/advanced_pos_reports/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/chevron.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/cogs.png b/advanced_pos_reports/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/cogs.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/consultation.png b/advanced_pos_reports/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/consultation.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/ecom-black.png b/advanced_pos_reports/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/ecom-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/education-black.png b/advanced_pos_reports/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/education-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/hotel-black.png b/advanced_pos_reports/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/hotel-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/license.png b/advanced_pos_reports/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/license.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/lifebuoy.png b/advanced_pos_reports/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/lifebuoy.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/logo.png b/advanced_pos_reports/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/logo.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/manufacturing-black.png b/advanced_pos_reports/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/manufacturing-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/pos-black.png b/advanced_pos_reports/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/pos-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/puzzle.png b/advanced_pos_reports/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/puzzle.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/restaurant-black.png b/advanced_pos_reports/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/restaurant-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/service-black.png b/advanced_pos_reports/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/service-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/trading-black.png b/advanced_pos_reports/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/trading-black.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/training.png b/advanced_pos_reports/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/training.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/update.png b/advanced_pos_reports/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/update.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/user.png b/advanced_pos_reports/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/user.png differ diff --git a/advanced_pos_reports/static/description/assets/icons/wrench.png b/advanced_pos_reports/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/wrench.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/budget_image.png b/advanced_pos_reports/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/budget_image.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/credit_image.png b/advanced_pos_reports/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/credit_image.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/employee_image.png b/advanced_pos_reports/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/employee_image.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/export_image.png b/advanced_pos_reports/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/export_image.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/gantt_image.png b/advanced_pos_reports/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/gantt_image.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/quotation_image.png b/advanced_pos_reports/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/quotation_image.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/hero.gif b/advanced_pos_reports/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..4ef216bb1 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/hero.gif differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_1.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_1.png new file mode 100644 index 000000000..1074c22c6 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_1.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_10.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_10.png new file mode 100644 index 000000000..031853d2f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_10.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_11.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_11.png new file mode 100644 index 000000000..980750a50 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_11.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_12.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_12.png new file mode 100644 index 000000000..188862c00 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_12.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_13.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_13.png new file mode 100644 index 000000000..913196ef4 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_13.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_14.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_14.png new file mode 100644 index 000000000..b1fb34f80 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_14.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_14_1.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_14_1.png new file mode 100644 index 000000000..859af1d94 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_14_1.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_16.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_16.png new file mode 100644 index 000000000..3acf3765e Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_16.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_17.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_17.png new file mode 100644 index 000000000..5419f0adf Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_17.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_18.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_18.png new file mode 100644 index 000000000..acb0750cb Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_18.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_19.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_19.png new file mode 100644 index 000000000..c748ce255 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_19.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_2.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_2.png new file mode 100644 index 000000000..cf1f7c792 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_2.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_20.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_20.png new file mode 100644 index 000000000..64cb4989f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_20.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_21.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_21.png new file mode 100644 index 000000000..7a388a542 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_21.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_22.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_22.png new file mode 100644 index 000000000..8ea3b6d17 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_22.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_23.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_23.png new file mode 100644 index 000000000..03c52005f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_23.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_24.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_24.png new file mode 100644 index 000000000..57651cfa8 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_24.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_25.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_25.png new file mode 100644 index 000000000..9207ff5d6 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_25.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_26.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_26.png new file mode 100644 index 000000000..b18c2f425 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_26.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_27.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_27.png new file mode 100644 index 000000000..e3d39181a Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_27.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_28.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_28.png new file mode 100644 index 000000000..8bd05e271 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_28.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_29.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_29.png new file mode 100644 index 000000000..26b0408da Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_29.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_3.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_3.png new file mode 100644 index 000000000..441bf2d1b Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_3.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_30.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_30.png new file mode 100644 index 000000000..f5857d31a Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_30.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_31.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_31.png new file mode 100644 index 000000000..4abe42f3d Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_31.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_32.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_32.png new file mode 100644 index 000000000..a96d674a2 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_32.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_33.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_33.png new file mode 100644 index 000000000..c9fff5500 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_33.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_34.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_34.png new file mode 100644 index 000000000..a147baf16 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_34.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_35.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_35.png new file mode 100644 index 000000000..0e6e76b26 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_35.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_4.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_4.png new file mode 100644 index 000000000..0d4aa9133 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_4.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_5.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_5.png new file mode 100644 index 000000000..8f6b53c6c Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_5.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_6.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_6.png new file mode 100644 index 000000000..20a768f3d Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_6.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_7.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_7.png new file mode 100644 index 000000000..a40812d48 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_7.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_8.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_8.png new file mode 100644 index 000000000..2c34f3379 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_8.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/pos_report_9.png b/advanced_pos_reports/static/description/assets/screenshots/pos_report_9.png new file mode 100644 index 000000000..1e0042f15 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/pos_report_9.png differ diff --git a/advanced_pos_reports/static/description/banner.png b/advanced_pos_reports/static/description/banner.png new file mode 100644 index 000000000..d2c084f41 Binary files /dev/null and b/advanced_pos_reports/static/description/banner.png differ diff --git a/advanced_pos_reports/static/description/icon.png b/advanced_pos_reports/static/description/icon.png new file mode 100644 index 000000000..d62bfda3e Binary files /dev/null and b/advanced_pos_reports/static/description/icon.png differ diff --git a/advanced_pos_reports/static/description/index.html b/advanced_pos_reports/static/description/index.html new file mode 100644 index 000000000..64da9c7ea --- /dev/null +++ b/advanced_pos_reports/static/description/index.html @@ -0,0 +1,850 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Advanced POS Reports

+

+ A Module for printing various POS Reports +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ In the Advanced POS Reports app, can print various reports like Location Summary, Session Summary, Category Summary,etc. from POS Screen. Sales summary, Top Selling products/ categories / customers report, Ongoing Sessions Report, Posted Sessions Report from the reporting menu.

+
+

+ +
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Sale Summary report prints user wise sales details

+
+
+ +
+
+ +
+
+

+ Ongoing session report gives a summary of ongoing sessions

+
+
+ +
+
+ +
+
+

+ Posted session report summarizes the posted sessions de +

+
+
+ +
+
+ +
+
+

+ Top selling Products / Categories / Customers Reports

+
+
+ +
+
+ +
+
+

+ Payment Summary from POS Screen to get payment details of current session/ All sessions within a period +

+
+
+ +
+
+ +
+
+

+ Order Summary from POS Screen to get all order details of current session/ All sessions within a period +

+
+
+ +
+
+ +
+
+

+ Category from POS Screen to get category wise sale details current session/ All sessions within a period +

+
+
+ +
+ +
+
+

+ Screenshots +

+
+ +
+

+ Payment Summary from POS Screen

+ +
+ +
+

+ Payment Summary of Selected dates

+ +
+ +
+

+ Payment Summary of current session

+ +
+ +
+ +
+ +
+

+ Category Summary from POS Screen

+ +
+ +
+

+ Category Summary of Selected dates

+ +
+ +
+

+ Category Summary of current session

+ +
+ +
+ +
+ +
+

+ Reporting Menu

+

+ The list of custom reports

+ +
+ +
+

+ Sales summary

+

+ User can print user wise sales summary within a period. +

+ +
+ +
+

+ Sales summary Report

+ +
+ +
+ +
+ +
+

+ Top Selling Products

+ +
+ +
+

+ Generated Report

+ +
+ +
+

+ Top Selling Categories

+ +
+ +
+

+ Generated Report

+ +
+ + +
+

+ Top Selling Customers

+ +
+ +
+

+ Generated Report

+ +
+ + +
+

+ Ongoing Sessions Report

+ +
+ +
+

+ Generated Ongoing Sessions report

+ +
+ +
+

+ Posted Sessions report

+ +
+ +
+

+ Generated Posted Sessions report

+ +
+ +
+ +
+ +
+

+ Products Summary

+ +
+ +
+

+ Products Summary of Selected dates

+ +
+ +
+

+ Products Summary of current session

+ +
+ +
+ +
+ +
+

+ Order Summary

+ +
+
+

+ Order Summary of Selected dates

+ +
+ +
+

+ Order Summary of current session

+ +
+ +
+ +
+ +
+

+ Location Summary

+ +
+
+

+ Generated Location Summary

+ +
+ +
+

+ Sessions Summary

+ +
+ +
+

+ Generated Sessions Summary

+ +
+ +
+ +
+
+

Suggested Products

+
+ + +
+
+ + + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+ +
+
+ + + + + +
+
+
+

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/css/advanced_report.css b/advanced_pos_reports/static/src/css/advanced_report.css new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/advanced_pos_reports/static/src/css/advanced_report.css @@ -0,0 +1 @@ + diff --git a/advanced_pos_reports/static/src/js/ControlButtons/CategorySummaryButton.js b/advanced_pos_reports/static/src/js/ControlButtons/CategorySummaryButton.js new file mode 100644 index 000000000..b50a1b465 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ControlButtons/CategorySummaryButton.js @@ -0,0 +1,30 @@ +odoo.define('advanced_pos_reports.CategorySummaryButton', function (require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const { useListener } = require('web.custom_hooks'); + + class CategorySummaryButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this._onClick); + } + _onClick() { + this.showPopup('CategorySummaryPopup', { title: 'Category Summary', }); + } + } + CategorySummaryButton.template = 'advanced_pos_reports.CategorySummaryButton'; + + ProductScreen.addControlButton({ + component: CategorySummaryButton, + condition: function () { + return true; + }, + }); + + Registries.Component.add(CategorySummaryButton); + + return CategorySummaryButton; +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/ControlButtons/LocationSummaryButton.js b/advanced_pos_reports/static/src/js/ControlButtons/LocationSummaryButton.js new file mode 100644 index 000000000..4b58f37c9 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ControlButtons/LocationSummaryButton.js @@ -0,0 +1,35 @@ +odoo.define('advanced_pos_reports.LocationSummaryButton', function (require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const { useListener } = require('web.custom_hooks'); + + class LocationSummaryButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this._onClick); + } + async _onClick() { + var locations = await this.rpc({ + model: 'stock.location', + method: 'search_read', + args: [[['usage', '=', 'internal']]], + }); + this.showPopup('LocationSummaryPopup', { title: 'Location Summary', locations: locations }); + } + } + LocationSummaryButton.template = 'advanced_pos_reports.LocationSummaryButton'; + + ProductScreen.addControlButton({ + component: LocationSummaryButton, + condition: function () { + return true; + }, + }); + + Registries.Component.add(LocationSummaryButton); + + return LocationSummaryButton; +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/ControlButtons/OrderSummaryButton.js b/advanced_pos_reports/static/src/js/ControlButtons/OrderSummaryButton.js new file mode 100644 index 000000000..4e02a1a85 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ControlButtons/OrderSummaryButton.js @@ -0,0 +1,37 @@ +odoo.define('advanced_pos_reports.OrderSummaryButton', function (require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const { useListener } = require('web.custom_hooks'); + + class OrderSummaryButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this._onClick); + } + _onClick() { + this.showPopup('OrderSummaryPopup', { title: 'Order Summary', }); +// const customer = this.env.pos.get_order().get_client(); +// const searchDetails = customer ? { fieldName: 'CUSTOMER', searchTerm: customer.name } : {}; +// this.trigger('close-popup'); +// this.showScreen('TicketScreen', { +// ui: { filter: 'SYNCED', searchDetails }, +// destinationOrder: this.env.pos.get_order(), +// }); + } + } + OrderSummaryButton.template = 'advanced_pos_reports.OrderSummaryButton'; + + ProductScreen.addControlButton({ + component: OrderSummaryButton, + condition: function () { + return true; + }, + }); + + Registries.Component.add(OrderSummaryButton); + + return OrderSummaryButton; +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/ControlButtons/PaymentSummaryButton.js b/advanced_pos_reports/static/src/js/ControlButtons/PaymentSummaryButton.js new file mode 100644 index 000000000..1590407f9 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ControlButtons/PaymentSummaryButton.js @@ -0,0 +1,30 @@ +odoo.define('advanced_pos_reports.PaymentSummaryButton', function (require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const { useListener } = require('web.custom_hooks'); + + class PaymentSummaryButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this._onClick); + } + _onClick() { + this.showPopup('PaymentSummaryPopup', { title: 'Payment Summary', }); + } + } + PaymentSummaryButton.template = 'advanced_pos_reports.PaymentSummaryButton'; + + ProductScreen.addControlButton({ + component: PaymentSummaryButton, + condition: function () { + return true; + }, + }); + + Registries.Component.add(PaymentSummaryButton); + + return PaymentSummaryButton; +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/ControlButtons/ProductSummaryButton.js b/advanced_pos_reports/static/src/js/ControlButtons/ProductSummaryButton.js new file mode 100644 index 000000000..2cc06c1dd --- /dev/null +++ b/advanced_pos_reports/static/src/js/ControlButtons/ProductSummaryButton.js @@ -0,0 +1,37 @@ +odoo.define('advanced_pos_reports.ProductSummaryButton', function (require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const { useListener } = require('web.custom_hooks'); + + class ProductSummaryButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this._onClick); + } + _onClick() { + this.showPopup('ProductSummaryPopup', { title: 'Product Summary', }); +// const customer = this.env.pos.get_order().get_client(); +// const searchDetails = customer ? { fieldName: 'CUSTOMER', searchTerm: customer.name } : {}; +// this.trigger('close-popup'); +// this.showScreen('TicketScreen', { +// ui: { filter: 'SYNCED', searchDetails }, +// destinationOrder: this.env.pos.get_order(), +// }); + } + } + ProductSummaryButton.template = 'advanced_pos_reports.ProductSummaryButton'; + + ProductScreen.addControlButton({ + component: ProductSummaryButton, + condition: function () { + return true; + }, + }); + + Registries.Component.add(ProductSummaryButton); + + return ProductSummaryButton; +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/ControlButtons/SessionSummaryButton.js b/advanced_pos_reports/static/src/js/ControlButtons/SessionSummaryButton.js new file mode 100644 index 000000000..4d10e8611 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ControlButtons/SessionSummaryButton.js @@ -0,0 +1,35 @@ +odoo.define('advanced_pos_reports.SessionSummaryButton', function (require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const { useListener } = require('web.custom_hooks'); + + class SessionSummaryButton extends PosComponent { + constructor() { + super(...arguments); + useListener('click', this._onClick); + } + async _onClick() { + var sessions = await this.rpc({ + model: 'pos.session', + method: 'search_read', + args: [[]], + }); + this.showPopup('SessionSummaryPopup', { title: 'Session Summary', sessions: sessions}); + } + } + SessionSummaryButton.template = 'advanced_pos_reports.SessionSummaryButton'; + + ProductScreen.addControlButton({ + component: SessionSummaryButton, + condition: function () { + return true; + }, + }); + + Registries.Component.add(SessionSummaryButton); + + return SessionSummaryButton; +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/Popups/CategorySummaryPopup.js b/advanced_pos_reports/static/src/js/Popups/CategorySummaryPopup.js new file mode 100644 index 000000000..d152dff72 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Popups/CategorySummaryPopup.js @@ -0,0 +1,68 @@ +odoo.define('advanced_pos_reports.CategorySummaryPopup', function(require) { + 'use strict'; + + const { useState } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { _lt } = require('@web/core/l10n/translation'); + + class CategorySummaryPopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + this.state = useState({ + current_session: false, + start_date: "", + end_date: "", + }); + } + click_is_session(){ + var is_session = $('#is_current_session').is(':checked'); + if(is_session){ + $("#date_section").hide(); + } + else{ + $("#date_section").show(); + } + } + async confirm(event) { + var is_session = this.state.current_session; + var start_date = this.state.start_date || ''; + var end_date = this.state.end_date || ''; + var order = this.env.pos.get_order()['sequence_number'] + var domain = [] + if(is_session){ + domain = [['session_id', '=', this.env.pos.pos_session.id]] + } + else{ + domain = [['date_order', '>=', start_date + ' 00:00:00'], ['date_order', '<=', end_date + ' 23:59:59']] + } + var orders = await this.rpc({ + model: 'pos.order', + method: 'search', + args: [domain], + }); + var order_ids = [] + $.each(orders,function(index,value){ + order_ids.push(value) + }); + var categories = await this.rpc({ + model: 'pos.order', + method: 'get_category_summary', + args: [order, order_ids], + }); + this.showScreen('CategorySummaryReceiptScreen', { categories: categories, start_date: start_date, end_date: end_date}); + super.confirm(); + } + } + CategorySummaryPopup.template = 'CategorySummaryPopup'; + CategorySummaryPopup.defaultProps = { + confirmText: _lt('Print'), + cancelText: _lt('Cancel'), + array: [], + isSingleItem: false, + }; + + Registries.Component.add(CategorySummaryPopup); + + return CategorySummaryPopup; +}); diff --git a/advanced_pos_reports/static/src/js/Popups/LocationSummaryPopup.js b/advanced_pos_reports/static/src/js/Popups/LocationSummaryPopup.js new file mode 100644 index 000000000..aa6eada9e --- /dev/null +++ b/advanced_pos_reports/static/src/js/Popups/LocationSummaryPopup.js @@ -0,0 +1,38 @@ +odoo.define('advanced_pos_reports.LocationSummaryPopup', function(require) { + 'use strict'; + + const { useState } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { _lt } = require('@web/core/l10n/translation'); + + class LocationSummaryPopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + this.state = useState({ + selected_value: '' + }); + } + async confirm(event) { + var location = this.state.selected_value; + var locations = await this.rpc({ + model: 'pos.config', + method: 'get_location_summary', + args: [this.config_id, location], + }); + this.showScreen('LocationSummaryReceiptScreen', { locations: locations}); + super.confirm(); + } + } + LocationSummaryPopup.template = 'LocationSummaryPopup'; + LocationSummaryPopup.defaultProps = { + confirmText: _lt('Print'), + cancelText: _lt('Cancel'), + array: [], + isSingleItem: false, + }; + + Registries.Component.add(LocationSummaryPopup); + + return LocationSummaryPopup; +}); diff --git a/advanced_pos_reports/static/src/js/Popups/OrderSummaryPopup.js b/advanced_pos_reports/static/src/js/Popups/OrderSummaryPopup.js new file mode 100644 index 000000000..31a761b4f --- /dev/null +++ b/advanced_pos_reports/static/src/js/Popups/OrderSummaryPopup.js @@ -0,0 +1,79 @@ +odoo.define('advanced_pos_reports.OrderSummaryPopup', function(require) { + 'use strict'; + + const { useState, useRef } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { _lt } = require('@web/core/l10n/translation'); + + class OrderSummaryPopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + this.state = useState({ + current_session: false, + start_date: "", + end_date: "", + status: '' || 'draft' || 'paid' || 'done' || 'invoiced' || 'cancel', + }); + } + click_is_session(){ + var is_session = $('#is_current_session').is(':checked'); + if(is_session){ + $("#date_section").hide(); + } + else{ + $("#date_section").show(); + } + } + async confirm(event) { + var is_session = this.state.current_session; + var start_date = this.state.start_date || ''; + var end_date = this.state.end_date || ''; + var status = this.state.status; + var order = this.env.pos.get_order()['sequence_number'] + var domain = [] + if(is_session){ + domain = [['session_id', '=', this.env.pos.pos_session.id]] + if(status){ + domain = [['session_id', '=', this.env.pos.pos_session.id], ['state', '=', status]] + } + } + else{ + domain = [['date_order', '>=', start_date + ' 00:00:00'], + ['date_order', '<=', end_date + ' 23:59:59']] + if(status){ + domain = [['date_order', '>=', start_date + ' 00:00:00'], + ['date_order', '<=', end_date + ' 23:59:59'], + ['state', '=', status]] + } + } + var orders_ids = await this.rpc({ + model: 'pos.order', + method: 'search', + args: [domain], + }); + var order_ids = [] + $.each(orders_ids,function(index,value){ + order_ids.push(value) + }); + var orders = await this.rpc({ + model: 'pos.order', + method: 'get_order_summary', + args: [order, order_ids], + }); + this.showScreen('OrderSummaryReceiptScreen', { orders: orders, start_date: start_date, end_date: end_date}); + super.confirm(); + } + } + OrderSummaryPopup.template = 'OrderSummaryPopup'; + OrderSummaryPopup.defaultProps = { + confirmText: _lt('Print'), + cancelText: _lt('Cancel'), + array: [], + isSingleItem: false, + }; + + Registries.Component.add(OrderSummaryPopup); + + return OrderSummaryPopup; +}); diff --git a/advanced_pos_reports/static/src/js/Popups/PaymentSummaryPopup.js b/advanced_pos_reports/static/src/js/Popups/PaymentSummaryPopup.js new file mode 100644 index 000000000..01a286fe5 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Popups/PaymentSummaryPopup.js @@ -0,0 +1,84 @@ +odoo.define('advanced_pos_reports.PaymentSummaryPopup', function(require) { + 'use strict'; + + const { useState } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { _lt } = require('@web/core/l10n/translation'); + + class PaymentSummaryPopup extends AbstractAwaitablePopup { + + constructor() { + super(...arguments); + this.state = useState({ + current_session: false, + start_date: "", + end_date: "", + summary: '' || 'sales_person' || 'journal', + }); + } + click_is_session(){ + var is_session = $('#is_current_session').is(':checked'); + if(is_session){ + $("#date_section").hide(); + } + else{ + $("#date_section").show(); + } + } + async confirm(event) { + var is_session = this.state.current_session; + var start_date = this.state.start_date || ''; + var end_date = this.state.end_date || ''; + var summary_type = this.state.summary; + var order = this.env.pos.get_order()['sequence_number'] + var is_user = false; + if(summary_type === 'sales_person'){ + is_user = true + } + var domain = [] + if(is_session){ + domain = [['session_id', '=', this.env.pos.pos_session.id]] + if(summary_type == 'sales_person'){ + domain = [['session_id', '=', this.env.pos.pos_session.id], ['user_id', '=', this.env.pos.user.id]] + } + } + else{ + domain = [['date_order', '>=', start_date + ' 00:00:00'], + ['date_order', '<=', end_date + ' 23:59:59']] + if(summary_type == 'sales_person'){ + domain = [['date_order', '>=', start_date + ' 00:00:00'], + ['date_order', '<=', end_date + ' 23:59:59'], + ['user_id', '=', this.env.pos.user.id]] + } + } + var orders = await this.rpc({ + model: 'pos.order', + method: 'search', + args: [domain], + }); + var order_ids = [] + $.each(orders,function(index,value){ + order_ids.push(value) + }); + var payment_summary = await this.rpc({ + model: 'pos.payment', + method: 'get_payment_summary', + args: [order, order_ids], + }); + this.showScreen('PaymentSummaryReceiptScreen', { payment_summary: payment_summary, start_date: start_date, end_date: end_date, is_user: is_user }); + super.confirm(); + } + } + PaymentSummaryPopup.template = 'PaymentSummaryPopup'; + PaymentSummaryPopup.defaultProps = { + confirmText: _lt('Print'), + cancelText: _lt('Cancel'), + array: [], + isSingleItem: false, + }; + + Registries.Component.add(PaymentSummaryPopup); + + return PaymentSummaryPopup; +}); diff --git a/advanced_pos_reports/static/src/js/Popups/ProductSummaryPopup.js b/advanced_pos_reports/static/src/js/Popups/ProductSummaryPopup.js new file mode 100644 index 000000000..1af845d0c --- /dev/null +++ b/advanced_pos_reports/static/src/js/Popups/ProductSummaryPopup.js @@ -0,0 +1,69 @@ +odoo.define('advanced_pos_reports.ProductSummaryPopup', function(require) { + 'use strict'; + + const { useState } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { _lt } = require('@web/core/l10n/translation'); + + class ProductSummaryPopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + this.state = useState({ + current_session: false, + start_date: "", + end_date: "" + }); + } + click_is_session(){ + var is_session = $('#is_current_session').is(':checked'); + if(is_session){ + $("#date_section").hide(); + } + else{ + $("#date_section").show(); + } + } + async confirm(event) { + var is_session = this.state.current_session; + var start_date = this.state.start_date || ''; + var end_date = this.state.end_date || ''; + var order = this.env.pos.get_order()['sequence_number'] + var domain = [] + if(is_session){ + domain = [['session_id', '=', this.env.pos.pos_session.id]] + } + else{ + domain = [['date_order', '>=', start_date + ' 00:00:00'], + ['date_order', '<=', end_date + ' 23:59:59']] + } + var orders = await this.rpc({ + model: 'pos.order', + method: 'search', + args: [domain], + }); + var order_ids = [] + $.each(orders,function(index,value){ + order_ids.push(value) + }); + var products = await this.rpc({ + model: 'pos.order', + method: 'get_product_summary', + args: [order, order_ids], + }); + this.showScreen('ProductSummaryReceiptScreen', { products: products, start_date: start_date, end_date: end_date}); + super.confirm(); + } + } + ProductSummaryPopup.template = 'ProductSummaryPopup'; + ProductSummaryPopup.defaultProps = { + confirmText: _lt('Print'), + cancelText: _lt('Cancel'), + array: [], + isSingleItem: false, + }; + + Registries.Component.add(ProductSummaryPopup); + + return ProductSummaryPopup; +}); diff --git a/advanced_pos_reports/static/src/js/Popups/SessionSummaryPopup.js b/advanced_pos_reports/static/src/js/Popups/SessionSummaryPopup.js new file mode 100644 index 000000000..39cba27f9 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Popups/SessionSummaryPopup.js @@ -0,0 +1,39 @@ +odoo.define('advanced_pos_reports.SessionSummaryPopup', function(require) { + 'use strict'; + + const { useState } = owl.hooks; + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { useAutoFocusToLast } = require('point_of_sale.custom_hooks'); + const { _lt } = require('@web/core/l10n/translation'); + + class SessionSummaryPopup extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + this.state = useState({ + selected_value: '' + }); + } + async confirm(event) { + var session = this.state.selected_value; + var session_summary = await this.rpc({ + model: 'pos.session', + method: 'get_session_summary', + args: [this.env.pos.pos_session.id, session], + }); + this.showScreen('SessionSummaryReceiptScreen', { session_summary: session_summary}); + super.confirm(); + } + } + SessionSummaryPopup.template = 'SessionSummaryPopup'; + SessionSummaryPopup.defaultProps = { + confirmText: _lt('Print'), + cancelText: _lt('Cancel'), + array: [], + isSingleItem: false, + }; + + Registries.Component.add(SessionSummaryPopup); + + return SessionSummaryPopup; +}); diff --git a/advanced_pos_reports/static/src/js/ReceiptScreen/CategorySummaryReceiptScreen.js b/advanced_pos_reports/static/src/js/ReceiptScreen/CategorySummaryReceiptScreen.js new file mode 100644 index 000000000..8c666937c --- /dev/null +++ b/advanced_pos_reports/static/src/js/ReceiptScreen/CategorySummaryReceiptScreen.js @@ -0,0 +1,32 @@ +odoo.define('advanced_pos_reports.CategorySummaryReceiptScreen', function (require) { + 'use strict'; + + const { Printer } = require('point_of_sale.Printer'); + const { is_email } = require('web.utils'); + const { useRef, useContext } = owl.hooks; + const { useErrorHandlers, onChangeOrder } = require('point_of_sale.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const AbstractReceiptScreen = require('point_of_sale.AbstractReceiptScreen'); + + const CategorySummaryReceiptScreen = (AbstractReceiptScreen) => { + class CategorySummaryReceiptScreen extends AbstractReceiptScreen { + constructor() { + super(...arguments); + this.categorySummary = useRef('category-summary'); + } + confirm() { + this.showScreen('ProductScreen'); + } + async printSummary() { + await this._printReceipt(); + } + + } + CategorySummaryReceiptScreen.template = 'CategorySummaryReceiptScreen'; + return CategorySummaryReceiptScreen; + }; + + Registries.Component.addByExtending(CategorySummaryReceiptScreen, AbstractReceiptScreen); + + return CategorySummaryReceiptScreen; +}); diff --git a/advanced_pos_reports/static/src/js/ReceiptScreen/LocationSummaryReceiptScreen.js b/advanced_pos_reports/static/src/js/ReceiptScreen/LocationSummaryReceiptScreen.js new file mode 100644 index 000000000..d808ee79d --- /dev/null +++ b/advanced_pos_reports/static/src/js/ReceiptScreen/LocationSummaryReceiptScreen.js @@ -0,0 +1,32 @@ +odoo.define('advanced_pos_reports.LocationSummaryReceiptScreen', function (require) { + 'use strict'; + + const { Printer } = require('point_of_sale.Printer'); + const { is_email } = require('web.utils'); + const { useRef, useContext } = owl.hooks; + const { useErrorHandlers, onChangeOrder } = require('point_of_sale.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const AbstractReceiptScreen = require('point_of_sale.AbstractReceiptScreen'); + + const LocationSummaryReceiptScreen = (AbstractReceiptScreen) => { + class LocationSummaryReceiptScreen extends AbstractReceiptScreen { + constructor() { + super(...arguments); + this.locationSummary = useRef('location-summary'); + } + confirm() { + this.showScreen('ProductScreen'); + } + async printSummary() { + await this._printReceipt(); + } + + } + LocationSummaryReceiptScreen.template = 'LocationSummaryReceiptScreen'; + return LocationSummaryReceiptScreen; + }; + + Registries.Component.addByExtending(LocationSummaryReceiptScreen, AbstractReceiptScreen); + + return LocationSummaryReceiptScreen; +}); diff --git a/advanced_pos_reports/static/src/js/ReceiptScreen/OrderSummaryReceiptScreen.js b/advanced_pos_reports/static/src/js/ReceiptScreen/OrderSummaryReceiptScreen.js new file mode 100644 index 000000000..5f89a7bcb --- /dev/null +++ b/advanced_pos_reports/static/src/js/ReceiptScreen/OrderSummaryReceiptScreen.js @@ -0,0 +1,32 @@ +odoo.define('advanced_pos_reports.OrderSummaryReceiptScreen', function (require) { + 'use strict'; + + const { Printer } = require('point_of_sale.Printer'); + const { is_email } = require('web.utils'); + const { useRef, useContext } = owl.hooks; + const { useErrorHandlers, onChangeOrder } = require('point_of_sale.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const AbstractReceiptScreen = require('point_of_sale.AbstractReceiptScreen'); + + const OrderSummaryReceiptScreen = (AbstractReceiptScreen) => { + class OrderSummaryReceiptScreen extends AbstractReceiptScreen { + constructor() { + super(...arguments); + this.orderSummary = useRef('order-summary'); + } + confirm() { + this.showScreen('ProductScreen'); + } + async printSummary() { + await this._printReceipt(); + } + + } + OrderSummaryReceiptScreen.template = 'OrderSummaryReceiptScreen'; + return OrderSummaryReceiptScreen; + }; + + Registries.Component.addByExtending(OrderSummaryReceiptScreen, AbstractReceiptScreen); + + return OrderSummaryReceiptScreen; +}); diff --git a/advanced_pos_reports/static/src/js/ReceiptScreen/PaymentSummaryReceiptScreen.js b/advanced_pos_reports/static/src/js/ReceiptScreen/PaymentSummaryReceiptScreen.js new file mode 100644 index 000000000..71832e413 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ReceiptScreen/PaymentSummaryReceiptScreen.js @@ -0,0 +1,31 @@ +odoo.define('advanced_pos_reports.PaymentSummaryReceiptScreen', function (require) { + 'use strict'; + + const { Printer } = require('point_of_sale.Printer'); + const { is_email } = require('web.utils'); + const { useRef, useContext } = owl.hooks; + const { useErrorHandlers, onChangeOrder } = require('point_of_sale.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const AbstractReceiptScreen = require('point_of_sale.AbstractReceiptScreen'); + + const PaymentSummaryReceiptScreen = (AbstractReceiptScreen) => { + class PaymentSummaryReceiptScreen extends AbstractReceiptScreen { + constructor() { + super(...arguments); + this.paymentSummary = useRef('payment-summary'); + } + confirm() { + this.showScreen('ProductScreen'); + } + async printSummary() { + await this._printReceipt(); + } + } + PaymentSummaryReceiptScreen.template = 'PaymentSummaryReceiptScreen'; + return PaymentSummaryReceiptScreen; + }; + + Registries.Component.addByExtending(PaymentSummaryReceiptScreen, AbstractReceiptScreen); + + return PaymentSummaryReceiptScreen; +}); diff --git a/advanced_pos_reports/static/src/js/ReceiptScreen/ProductSummaryReceiptScreen.js b/advanced_pos_reports/static/src/js/ReceiptScreen/ProductSummaryReceiptScreen.js new file mode 100644 index 000000000..ab0c30d0e --- /dev/null +++ b/advanced_pos_reports/static/src/js/ReceiptScreen/ProductSummaryReceiptScreen.js @@ -0,0 +1,31 @@ +odoo.define('advanced_pos_reports.ProductSummaryReceiptScreen', function (require) { + 'use strict'; + + const { Printer } = require('point_of_sale.Printer'); + const { is_email } = require('web.utils'); + const { useRef, useContext } = owl.hooks; + const { useErrorHandlers, onChangeOrder } = require('point_of_sale.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const AbstractReceiptScreen = require('point_of_sale.AbstractReceiptScreen'); + + const ProductSummaryReceiptScreen = (AbstractReceiptScreen) => { + class ProductSummaryReceiptScreen extends AbstractReceiptScreen { + constructor() { + super(...arguments); + this.paymentSummary = useRef('product-summary'); + } + confirm() { + this.showScreen('ProductScreen'); + } + async printSummary() { + await this._printReceipt(); + } + } + ProductSummaryReceiptScreen.template = 'ProductSummaryReceiptScreen'; + return ProductSummaryReceiptScreen; + }; + + Registries.Component.addByExtending(ProductSummaryReceiptScreen, AbstractReceiptScreen); + + return ProductSummaryReceiptScreen; +}); diff --git a/advanced_pos_reports/static/src/js/ReceiptScreen/SessionSummaryReceiptScreen.js b/advanced_pos_reports/static/src/js/ReceiptScreen/SessionSummaryReceiptScreen.js new file mode 100644 index 000000000..37f91728b --- /dev/null +++ b/advanced_pos_reports/static/src/js/ReceiptScreen/SessionSummaryReceiptScreen.js @@ -0,0 +1,31 @@ +odoo.define('advanced_pos_reports.SessionSummaryReceiptScreen', function (require) { + 'use strict'; + + const { Printer } = require('point_of_sale.Printer'); + const { is_email } = require('web.utils'); + const { useRef, useContext } = owl.hooks; + const { useErrorHandlers, onChangeOrder } = require('point_of_sale.custom_hooks'); + const Registries = require('point_of_sale.Registries'); + const AbstractReceiptScreen = require('point_of_sale.AbstractReceiptScreen'); + + const SessionSummaryReceiptScreen = (AbstractReceiptScreen) => { + class SessionSummaryReceiptScreen extends AbstractReceiptScreen { + constructor() { + super(...arguments); + this.paymentSummary = useRef('product-summary'); + } + confirm() { + this.showScreen('ProductScreen'); + } + async printSummary() { + await this._printReceipt(); + } + } + SessionSummaryReceiptScreen.template = 'SessionSummaryReceiptScreen'; + return SessionSummaryReceiptScreen; + }; + + Registries.Component.addByExtending(SessionSummaryReceiptScreen, AbstractReceiptScreen); + + return SessionSummaryReceiptScreen; +}); diff --git a/advanced_pos_reports/static/src/js/Receipts/CategorySummaryReceipt.js b/advanced_pos_reports/static/src/js/Receipts/CategorySummaryReceipt.js new file mode 100644 index 000000000..4f42710a0 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Receipts/CategorySummaryReceipt.js @@ -0,0 +1,27 @@ +odoo.define('advanced_pos_reports.CategorySummaryReceipt', function(require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + + class CategorySummaryReceipt extends PosComponent { + constructor() { + super(...arguments); + this._categorySummaryEnv = this.props.categories + } + get categories() { + return this._categorySummaryEnv; + } + get company() { + return this.env.pos.company; + } + get cashier() { + return this.env.pos.get_cashier(); + } + } + CategorySummaryReceipt.template = 'CategorySummaryReceipt'; + + Registries.Component.add(CategorySummaryReceipt); + + return CategorySummaryReceipt; +}); diff --git a/advanced_pos_reports/static/src/js/Receipts/LocationSummaryReceipt.js b/advanced_pos_reports/static/src/js/Receipts/LocationSummaryReceipt.js new file mode 100644 index 000000000..60695e1ac --- /dev/null +++ b/advanced_pos_reports/static/src/js/Receipts/LocationSummaryReceipt.js @@ -0,0 +1,27 @@ +odoo.define('advanced_pos_reports.LocationSummaryReceipt', function(require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + + class LocationSummaryReceipt extends PosComponent { + constructor() { + super(...arguments); + this._locationSummaryEnv = this.props.locations + } + get locations() { + return this._locationSummaryEnv; + } + get company() { + return this.env.pos.company; + } + get cashier() { + return this.env.pos.get_cashier(); + } + } + LocationSummaryReceipt.template = 'LocationSummaryReceipt'; + + Registries.Component.add(LocationSummaryReceipt); + + return LocationSummaryReceipt; +}); diff --git a/advanced_pos_reports/static/src/js/Receipts/OrderSummaryReceipt.js b/advanced_pos_reports/static/src/js/Receipts/OrderSummaryReceipt.js new file mode 100644 index 000000000..1465e7fbd --- /dev/null +++ b/advanced_pos_reports/static/src/js/Receipts/OrderSummaryReceipt.js @@ -0,0 +1,30 @@ +odoo.define('advanced_pos_reports.OrderSummaryReceipt', function(require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + + class OrderSummaryReceipt extends PosComponent { + constructor() { + super(...arguments); + this._orderSummaryEnv = this.props.orders + } + get orders() { + return this._orderSummaryEnv; + } + get company() { + return this.env.pos.company; + } + get cashier() { + return this.env.pos.get_cashier(); + } + getDate(order) { + return moment(order.date_order).format('MM-DD-YYYY'); + } + } + OrderSummaryReceipt.template = 'OrderSummaryReceipt'; + + Registries.Component.add(OrderSummaryReceipt); + + return OrderSummaryReceipt; +}); diff --git a/advanced_pos_reports/static/src/js/Receipts/PaymentSummaryReceipt.js b/advanced_pos_reports/static/src/js/Receipts/PaymentSummaryReceipt.js new file mode 100644 index 000000000..115d5f41b --- /dev/null +++ b/advanced_pos_reports/static/src/js/Receipts/PaymentSummaryReceipt.js @@ -0,0 +1,30 @@ +odoo.define('advanced_pos_reports.PaymentSummaryReceipt', function(require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + + class PaymentSummaryReceipt extends PosComponent { + constructor() { + super(...arguments); + this._paymentSummaryEnv = this.props.payment_summary + } + get payment_summary() { + return this._paymentSummaryEnv; + } + get company() { + return this.env.pos.company; + } + get cashier() { + return this.env.pos.get_cashier(); + } +// getDate(order) { +// return moment(order.date_order).format('MM-DD-YYYY'); +// } + } + PaymentSummaryReceipt.template = 'PaymentSummaryReceipt'; + + Registries.Component.add(PaymentSummaryReceipt); + + return PaymentSummaryReceipt; +}); diff --git a/advanced_pos_reports/static/src/js/Receipts/ProductSummaryReceipt.js b/advanced_pos_reports/static/src/js/Receipts/ProductSummaryReceipt.js new file mode 100644 index 000000000..c45fd6714 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Receipts/ProductSummaryReceipt.js @@ -0,0 +1,27 @@ +odoo.define('advanced_pos_reports.ProductSummaryReceipt', function(require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + + class ProductSummaryReceipt extends PosComponent { + constructor() { + super(...arguments); + this._productSummaryEnv = this.props.products + } + get products() { + return this._productSummaryEnv; + } + get company() { + return this.env.pos.company; + } + get cashier() { + return this.env.pos.get_cashier(); + } + } + ProductSummaryReceipt.template = 'ProductSummaryReceipt'; + + Registries.Component.add(ProductSummaryReceipt); + + return ProductSummaryReceipt; +}); diff --git a/advanced_pos_reports/static/src/js/Receipts/SessionSummaryReceipt.js b/advanced_pos_reports/static/src/js/Receipts/SessionSummaryReceipt.js new file mode 100644 index 000000000..a2f10c042 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Receipts/SessionSummaryReceipt.js @@ -0,0 +1,27 @@ +odoo.define('advanced_pos_reports.SessionSummaryReceipt', function(require) { + 'use strict'; + + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + + class SessionSummaryReceipt extends PosComponent { + constructor() { + super(...arguments); + this._sessionSummaryEnv = this.props.session_summary + } + get session_summary() { + return this._sessionSummaryEnv; + } + get company() { + return this.env.pos.company; + } + get cashier() { + return this.env.pos.get_cashier(); + } + } + SessionSummaryReceipt.template = 'SessionSummaryReceipt'; + + Registries.Component.add(SessionSummaryReceipt); + + return SessionSummaryReceipt; +}); diff --git a/advanced_pos_reports/static/src/xml/ControlButtons/CategorySummaryButton.xml b/advanced_pos_reports/static/src/xml/ControlButtons/CategorySummaryButton.xml new file mode 100644 index 000000000..da477cabd --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ControlButtons/CategorySummaryButton.xml @@ -0,0 +1,11 @@ + + + + +
+ + Category Summary +
+
+ +
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/ControlButtons/LocationSummaryButton.xml b/advanced_pos_reports/static/src/xml/ControlButtons/LocationSummaryButton.xml new file mode 100644 index 000000000..6fcbe4406 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ControlButtons/LocationSummaryButton.xml @@ -0,0 +1,11 @@ + + + + +
+ + Location Summary +
+
+ +
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/ControlButtons/OrderSummaryButton.xml b/advanced_pos_reports/static/src/xml/ControlButtons/OrderSummaryButton.xml new file mode 100644 index 000000000..0e0bf0d44 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ControlButtons/OrderSummaryButton.xml @@ -0,0 +1,11 @@ + + + + +
+ + Order Summary +
+
+ +
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/ControlButtons/PaymentSummaryButton.xml b/advanced_pos_reports/static/src/xml/ControlButtons/PaymentSummaryButton.xml new file mode 100644 index 000000000..6963b14fe --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ControlButtons/PaymentSummaryButton.xml @@ -0,0 +1,11 @@ + + + + +
+ + Payment Summary +
+
+ +
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/ControlButtons/ProductSummaryButton.xml b/advanced_pos_reports/static/src/xml/ControlButtons/ProductSummaryButton.xml new file mode 100644 index 000000000..1926b19d5 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ControlButtons/ProductSummaryButton.xml @@ -0,0 +1,11 @@ + + + + +
+ + Product Summary +
+
+ +
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/ControlButtons/SessionSummaryButton.xml b/advanced_pos_reports/static/src/xml/ControlButtons/SessionSummaryButton.xml new file mode 100644 index 000000000..5570f53c4 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ControlButtons/SessionSummaryButton.xml @@ -0,0 +1,11 @@ + + + + +
+ + Session Summary +
+
+ +
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/Popups/CategorySummaryPopup.xml b/advanced_pos_reports/static/src/xml/Popups/CategorySummaryPopup.xml new file mode 100644 index 000000000..1608f9cdd --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Popups/CategorySummaryPopup.xml @@ -0,0 +1,51 @@ + + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/Popups/LocationSummaryPopup.xml b/advanced_pos_reports/static/src/xml/Popups/LocationSummaryPopup.xml new file mode 100644 index 000000000..9b91d9efa --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Popups/LocationSummaryPopup.xml @@ -0,0 +1,36 @@ + + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/Popups/OrderSummaryPopup.xml b/advanced_pos_reports/static/src/xml/Popups/OrderSummaryPopup.xml new file mode 100644 index 000000000..f46ab73b3 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Popups/OrderSummaryPopup.xml @@ -0,0 +1,62 @@ + + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/Popups/PaymentSummaryPopup.xml b/advanced_pos_reports/static/src/xml/Popups/PaymentSummaryPopup.xml new file mode 100644 index 000000000..ea7c42fd3 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Popups/PaymentSummaryPopup.xml @@ -0,0 +1,59 @@ + + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/Popups/ProductSummaryPopup.xml b/advanced_pos_reports/static/src/xml/Popups/ProductSummaryPopup.xml new file mode 100644 index 000000000..ecec61588 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Popups/ProductSummaryPopup.xml @@ -0,0 +1,51 @@ + + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/Popups/SessionSummaryPopup.xml b/advanced_pos_reports/static/src/xml/Popups/SessionSummaryPopup.xml new file mode 100644 index 000000000..04e1567c1 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Popups/SessionSummaryPopup.xml @@ -0,0 +1,37 @@ + + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/ReceiptScreen/CategorySummaryReceiptScreen.xml b/advanced_pos_reports/static/src/xml/ReceiptScreen/CategorySummaryReceiptScreen.xml new file mode 100644 index 000000000..469c32c2d --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ReceiptScreen/CategorySummaryReceiptScreen.xml @@ -0,0 +1,26 @@ + + + + +
+
+
+ + + + Back + +
+
+
+ Print Category Summary +
+
+ +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/ReceiptScreen/LocationSummaryReceiptScreen.xml b/advanced_pos_reports/static/src/xml/ReceiptScreen/LocationSummaryReceiptScreen.xml new file mode 100644 index 000000000..4c521d5ce --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ReceiptScreen/LocationSummaryReceiptScreen.xml @@ -0,0 +1,26 @@ + + + + +
+
+
+ + + + Back + +
+
+
+ Print Location Summary +
+
+ +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/ReceiptScreen/OrderSummaryReceiptScreen.xml b/advanced_pos_reports/static/src/xml/ReceiptScreen/OrderSummaryReceiptScreen.xml new file mode 100644 index 000000000..b90d8fb6f --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ReceiptScreen/OrderSummaryReceiptScreen.xml @@ -0,0 +1,26 @@ + + + + +
+
+
+ + + + Back + +
+
+
+ Print Order Summary +
+
+ +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/ReceiptScreen/PaymentSummaryReceiptScreen.xml b/advanced_pos_reports/static/src/xml/ReceiptScreen/PaymentSummaryReceiptScreen.xml new file mode 100644 index 000000000..498f0e1d8 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ReceiptScreen/PaymentSummaryReceiptScreen.xml @@ -0,0 +1,27 @@ + + + + +
+
+
+ + + + Back + +
+
+
+ Print Payment Summary +
+
+ +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/ReceiptScreen/ProductSummaryReceiptSreen.xml b/advanced_pos_reports/static/src/xml/ReceiptScreen/ProductSummaryReceiptSreen.xml new file mode 100644 index 000000000..2e404d3c1 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ReceiptScreen/ProductSummaryReceiptSreen.xml @@ -0,0 +1,26 @@ + + + + +
+
+
+ + + + Back + +
+
+
+ Print Product Summary +
+
+ +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/ReceiptScreen/SessionSummaryReceiptScreen.xml b/advanced_pos_reports/static/src/xml/ReceiptScreen/SessionSummaryReceiptScreen.xml new file mode 100644 index 000000000..4a0147829 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ReceiptScreen/SessionSummaryReceiptScreen.xml @@ -0,0 +1,26 @@ + + + + +
+
+
+ + + + Back + +
+
+
+ Print Session Summary +
+
+ +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/Receipts/CategorySummaryReceipt.xml b/advanced_pos_reports/static/src/xml/Receipts/CategorySummaryReceipt.xml new file mode 100644 index 000000000..1e5df7343 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Receipts/CategorySummaryReceipt.xml @@ -0,0 +1,96 @@ + + + + +
+ + +
+
+ +

+ +

+
+
+
+ +
+
+ +
Tel:
+
+ +
:
+
+ +
+
+ +
+
+ + +
+
--------------------------------
+
Served by
+
+
+
+
+ +

+ Category Summary +

+ + + + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + +
CategoryQuantityTotal
+ + + + + +
Total: + +
+
+ +
+ +
diff --git a/advanced_pos_reports/static/src/xml/Receipts/LocationSummaryReceipt.xml b/advanced_pos_reports/static/src/xml/Receipts/LocationSummaryReceipt.xml new file mode 100644 index 000000000..74d52abe0 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Receipts/LocationSummaryReceipt.xml @@ -0,0 +1,76 @@ + + + + +
+ + +
+
+ +

+ +

+
+
+
+ +
+
+ +
Tel:
+
+ +
:
+
+ +
+
+ +
+
+ + +
+
--------------------------------
+
Served by
+
+
+
+
+ +

+ Location Summary +

+ + + + + + + + + + + + + + + +
+ + + + + +
ProductQuantity
+ + + +
Total: + +
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/Receipts/OrderSummaryReceipt.xml b/advanced_pos_reports/static/src/xml/Receipts/OrderSummaryReceipt.xml new file mode 100644 index 000000000..cfad64225 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Receipts/OrderSummaryReceipt.xml @@ -0,0 +1,98 @@ + + + + +
+ + +
+
+ +

+ +

+
+
+
+ +
+
+ +
Tel:
+
+ +
:
+
+ +
+
+ +
+
+ + +
+
--------------------------------
+
Served by
+
+
+
+
+ +

+ Order Summary +

+ + + + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
Order RefStatusDateTotal
+ + + + +
+
+ +
Total: + +
+
+
+ +
diff --git a/advanced_pos_reports/static/src/xml/Receipts/PaymentSummaryReceipt.xml b/advanced_pos_reports/static/src/xml/Receipts/PaymentSummaryReceipt.xml new file mode 100644 index 000000000..3331292a7 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Receipts/PaymentSummaryReceipt.xml @@ -0,0 +1,99 @@ + + + + +
+ + +
+
+ +

+ +

+
+
+
+ +
+
+ +
Tel:
+
+ +
:
+
+ +
+
+ +
+
+ + +
+
--------------------------------
+
Served by
+
+
+
+
+ +

+ Payment Summary +

+ + +
+
Salesperson:
+
+
+ + + + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
Payment MethodAmount
+ + + +
Total: + +
+
+ +
+ +
diff --git a/advanced_pos_reports/static/src/xml/Receipts/ProductSummaryReceipt.xml b/advanced_pos_reports/static/src/xml/Receipts/ProductSummaryReceipt.xml new file mode 100644 index 000000000..86a41dd71 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Receipts/ProductSummaryReceipt.xml @@ -0,0 +1,94 @@ + + + + +
+ + +
+
+ +

+ +

+
+
+
+ +
+
+ +
Tel:
+
+ +
:
+
+ +
+
+ +
+
+ + +
+
--------------------------------
+
Served by
+
+
+
+
+ +

+ Product Summary +

+ + + + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
ProductQuantity
+ [] + + +
Total: + +
+ +
+ +
+ +
diff --git a/advanced_pos_reports/static/src/xml/Receipts/SessionSummaryReceipt.xml b/advanced_pos_reports/static/src/xml/Receipts/SessionSummaryReceipt.xml new file mode 100644 index 000000000..139748463 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Receipts/SessionSummaryReceipt.xml @@ -0,0 +1,154 @@ + + + + +
+ + +
+
+ +

+ +

+
+
+
+ +
+
+ +
Tel:
+
+ +
:
+
+ +
+
+ +
+
+ + +
+
--------------------------------
+
Served by
+
+
+
+
+ +

+ Session Summary +

+ + + + + + + + + + + + + + + + + + + + + + + +
Session
Opening Date
Closing Date
Opening Balance
Closing Balance
+ +

+ Products +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
ProductQuantityTotal
+ [] + + + + +
Total: + + + +
+ +

+ Payments +

+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
Payment MethodAmount
+ + + +
Total: + +
+
+
+ +
diff --git a/advanced_pos_reports/views/report_pos_ongoing_session.xml b/advanced_pos_reports/views/report_pos_ongoing_session.xml new file mode 100644 index 000000000..c562d5b14 --- /dev/null +++ b/advanced_pos_reports/views/report_pos_ongoing_session.xml @@ -0,0 +1,116 @@ + + + + \ No newline at end of file diff --git a/advanced_pos_reports/views/report_pos_posted_session.xml b/advanced_pos_reports/views/report_pos_posted_session.xml new file mode 100644 index 000000000..f5fc9404b --- /dev/null +++ b/advanced_pos_reports/views/report_pos_posted_session.xml @@ -0,0 +1,135 @@ + + + + \ No newline at end of file diff --git a/advanced_pos_reports/views/report_pos_saledetails.xml b/advanced_pos_reports/views/report_pos_saledetails.xml new file mode 100644 index 000000000..7df7e002d --- /dev/null +++ b/advanced_pos_reports/views/report_pos_saledetails.xml @@ -0,0 +1,78 @@ + + + + + + diff --git a/advanced_pos_reports/views/report_pos_top_selling_categories.xml b/advanced_pos_reports/views/report_pos_top_selling_categories.xml new file mode 100644 index 000000000..999e32ae2 --- /dev/null +++ b/advanced_pos_reports/views/report_pos_top_selling_categories.xml @@ -0,0 +1,69 @@ + + + + + + diff --git a/advanced_pos_reports/views/report_pos_top_selling_customers.xml b/advanced_pos_reports/views/report_pos_top_selling_customers.xml new file mode 100644 index 000000000..d9aba4315 --- /dev/null +++ b/advanced_pos_reports/views/report_pos_top_selling_customers.xml @@ -0,0 +1,68 @@ + + + + + + diff --git a/advanced_pos_reports/views/report_pos_top_selling_products.xml b/advanced_pos_reports/views/report_pos_top_selling_products.xml new file mode 100644 index 000000000..10c2b409d --- /dev/null +++ b/advanced_pos_reports/views/report_pos_top_selling_products.xml @@ -0,0 +1,72 @@ + + + + + + diff --git a/advanced_pos_reports/views/reports.xml b/advanced_pos_reports/views/reports.xml new file mode 100644 index 000000000..d9e045273 --- /dev/null +++ b/advanced_pos_reports/views/reports.xml @@ -0,0 +1,78 @@ + + + + Sales Summary + pos.sale.details.wizard + form + new + + + + Top Selling + pos.sale.top.selling + form + new + + + + Ongoing Sessions Report + pos.sale.ongoing.wizard + form + new + + + + Posted Sessions Report + pos.sale.posted.wizard + form + new + + + + + + + + + Sales Summary + report.advanced_pos_reports.report_pos_saledetails + qweb-pdf + advanced_pos_reports.report_pos_saledetails + + + + Posted Sessions + report.advanced_pos_reports.report_pos_posted_session + qweb-pdf + advanced_pos_reports.report_pos_posted_session + + + + Ongoing Sessions + report.advanced_pos_reports.report_pos_ongoing_session + qweb-pdf + advanced_pos_reports.report_pos_ongoing_session + + + + Top Selling Products Report + report.advanced_pos_reports.report_pos_top_selling_products + qweb-pdf + advanced_pos_reports.report_pos_top_selling_products + + + + Top Selling Categories Report + report.advanced_pos_reports.report_pos_top_selling_categories + qweb-pdf + advanced_pos_reports.report_pos_top_selling_categories + + + + Top Selling Customers Report + report.advanced_pos_reports.report_pos_top_selling_customers + qweb-pdf + advanced_pos_reports.report_pos_top_selling_customers + + + \ No newline at end of file diff --git a/advanced_pos_reports/wizard/__init__.py b/advanced_pos_reports/wizard/__init__.py new file mode 100644 index 000000000..cd369862a --- /dev/null +++ b/advanced_pos_reports/wizard/__init__.py @@ -0,0 +1,4 @@ +from . import pos_sale_details +from . import top_selling +from . import ongoing_session +from . import posted_session \ No newline at end of file diff --git a/advanced_pos_reports/wizard/ongoing_session.py b/advanced_pos_reports/wizard/ongoing_session.py new file mode 100644 index 000000000..acd7e1e09 --- /dev/null +++ b/advanced_pos_reports/wizard/ongoing_session.py @@ -0,0 +1,14 @@ + +from odoo import api, fields, models, _ + + +class OngoingSession(models.TransientModel): + _name = 'pos.sale.ongoing.wizard' + _description = 'Point of Sale Ongoing Session Report' + + session_ids = fields.Many2many('pos.session', string='POS Sessions', domain=[('state', '=', 'opened')]) + + def generate_report(self): + data = {'session_ids': self.session_ids.ids} + return self.env.ref('advanced_pos_reports.pos_ongoing_session_report').report_action([], data=data) + diff --git a/advanced_pos_reports/wizard/ongoing_session.xml b/advanced_pos_reports/wizard/ongoing_session.xml new file mode 100644 index 000000000..5dceb9ae1 --- /dev/null +++ b/advanced_pos_reports/wizard/ongoing_session.xml @@ -0,0 +1,19 @@ + + + + pos.sale.ongoing.session.wizard.form + pos.sale.ongoing.wizard + +
+ + + +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/wizard/pos_sale_details.py b/advanced_pos_reports/wizard/pos_sale_details.py new file mode 100644 index 000000000..5c670665e --- /dev/null +++ b/advanced_pos_reports/wizard/pos_sale_details.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, fields, models, _ + + +class PosDetails(models.TransientModel): + _name = 'pos.sale.details.wizard' + _description = 'Point of Sale Details User Report' + + def _default_start_date(self): + """ Find the earliest start_date of the latests sessions """ + # restrict to configs available to the user + config_ids = self.env['pos.config'].search([]).ids + # exclude configs has not been opened for 2 days + self.env.cr.execute(""" + SELECT + max(start_at) as start, + config_id + FROM pos_session + WHERE config_id = ANY(%s) + AND start_at > (NOW() - INTERVAL '2 DAYS') + GROUP BY config_id + """, (config_ids,)) + latest_start_dates = [res['start'] for res in self.env.cr.dictfetchall()] + # earliest of the latest sessions + return latest_start_dates and min(latest_start_dates) or fields.Datetime.now() + + def generate_report(self): + data = {'date_start': self.start_date, 'date_stop': self.end_date, 'user_ids': self.user_ids.ids} + return self.env.ref('advanced_pos_reports.pos_sale_details_report').report_action([], data=data) + + start_date = fields.Datetime(required=True, default=_default_start_date) + end_date = fields.Datetime(required=True, default=fields.Datetime.now) + user_ids = fields.Many2many('res.users', default=lambda s: s.env['pos.session'].search([]).mapped('user_id')) + + @api.onchange('start_date') + def _onchange_start_date(self): + if self.start_date and self.end_date and self.end_date < self.start_date: + self.end_date = self.start_date + + @api.onchange('end_date') + def _onchange_end_date(self): + if self.end_date and self.end_date < self.start_date: + self.start_date = self.end_date diff --git a/advanced_pos_reports/wizard/pos_sale_details.xml b/advanced_pos_reports/wizard/pos_sale_details.xml new file mode 100644 index 000000000..c3e173bef --- /dev/null +++ b/advanced_pos_reports/wizard/pos_sale_details.xml @@ -0,0 +1,23 @@ + + + + pos.sale.details.wizard.form + pos.sale.details.wizard + +
+ + + + + + + +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/wizard/posted_session.py b/advanced_pos_reports/wizard/posted_session.py new file mode 100644 index 000000000..ef7f21655 --- /dev/null +++ b/advanced_pos_reports/wizard/posted_session.py @@ -0,0 +1,13 @@ + +from odoo import api, fields, models, _ + + +class OngoingSession(models.TransientModel): + _name = 'pos.sale.posted.wizard' + _description = 'Point of Sale Posted Session Report' + + session_ids = fields.Many2many('pos.session', string='POS Sessions', domain=[('state', '=', 'closed')]) + + def generate_report(self): + data = {'session_ids': self.session_ids.ids} + return self.env.ref('advanced_pos_reports.pos_posted_sessions_report').report_action([], data=data) \ No newline at end of file diff --git a/advanced_pos_reports/wizard/posted_session.xml b/advanced_pos_reports/wizard/posted_session.xml new file mode 100644 index 000000000..cda692e32 --- /dev/null +++ b/advanced_pos_reports/wizard/posted_session.xml @@ -0,0 +1,19 @@ + + + + pos.sale.posted.session.wizard.form + pos.sale.posted.wizard + +
+ + + +
+
+
+
+
+ +
diff --git a/advanced_pos_reports/wizard/top_selling.py b/advanced_pos_reports/wizard/top_selling.py new file mode 100644 index 000000000..3f881205e --- /dev/null +++ b/advanced_pos_reports/wizard/top_selling.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, fields, models, _ + + +class PosTopSelling(models.TransientModel): + _name = 'pos.sale.top.selling' + _description = 'Point of Sale Top Selling Product/Category/Customer Report' + + start_date = fields.Datetime() + end_date = fields.Datetime() + top_selling = fields.Selection([('products', 'Products'), ('category', 'Categories'), ('customers', 'Customers')], + string='Top Selling', default='products') + no_of_products = fields.Integer() + no_of_categories = fields.Integer() + no_of_customers = fields.Integer() + + def generate_report(self): + data = {'start_date': self.start_date, 'end_date': self.end_date, 'top_selling': self.top_selling} + if self.top_selling == 'products': + data['no_of_products'] = self.no_of_products + return self.env.ref('advanced_pos_reports.pos_top_selling_products_report').report_action([], data=data) + elif self.top_selling == 'category': + data['no_of_categories'] = self.no_of_categories + return self.env.ref('advanced_pos_reports.pos_top_selling_category_report').report_action([], data=data) + elif self.top_selling == 'customers': + data['no_of_customers'] = self.no_of_customers + return self.env.ref('advanced_pos_reports.pos_top_selling_customer_report').report_action([], data=data) \ No newline at end of file diff --git a/advanced_pos_reports/wizard/top_selling.xml b/advanced_pos_reports/wizard/top_selling.xml new file mode 100644 index 000000000..fe86b1c7e --- /dev/null +++ b/advanced_pos_reports/wizard/top_selling.xml @@ -0,0 +1,28 @@ + + + + pos.sale.top.selling.wizard.form + pos.sale.top.selling + +
+ + + + + + + + + + + + + +
+
+
+ +