diff --git a/advanced_pos_reports/README.rst b/advanced_pos_reports/README.rst new file mode 100644 index 000000000..a86cebcb4 --- /dev/null +++ b/advanced_pos_reports/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Advanced POS Reports +============= +* Generates Various Reports From POS Screen and From Reporting Menu. + +Configuration +============= +* No additional configuration required + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, Version 3 (LGPL-3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (V17) Ashwin A +* Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/advanced_pos_reports/__init__.py b/advanced_pos_reports/__init__.py new file mode 100644 index 000000000..833f9d1f7 --- /dev/null +++ b/advanced_pos_reports/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models +from . import report +from . import wizard diff --git a/advanced_pos_reports/__manifest__.py b/advanced_pos_reports/__manifest__.py new file mode 100644 index 000000000..17131f855 --- /dev/null +++ b/advanced_pos_reports/__manifest__.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Advanced POS Reports', + 'version': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """Generates various reports from POS screen and reporting + menu""", + 'description': """Generates various reports like, top + selling products / categories / customers report, ongoing sessions report + under reporting menu.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale'], + 'data': [ + 'security/ir.model.access.csv', + 'wizard/advanced_pos_reports_wizard.xml', + 'wizard/pos_sale_ongoing_views.xml', + 'wizard/pos_sale_top_selling_views.xml', + 'report/advanced_pos_reports.xml', + 'report/pos_ongoing_session_templates.xml', + 'report/pos_top_selling_categories_templates.xml', + 'report/pos_top_selling_customers_templates.xml', + 'report/pos_top_selling_products_templates.xml', + ], + 'assets': { + 'point_of_sale._assets_pos': [ + 'advanced_pos_reports/static/src/js/Category.js', + 'advanced_pos_reports/static/src/js/CategoryPopup.js', + 'advanced_pos_reports/static/src/js/CategoryReceipt.js', + 'advanced_pos_reports/static/src/js/CategoryReceiptPopup.js', + 'advanced_pos_reports/static/src/xml/Category_templates.xml', + 'advanced_pos_reports/static/src/xml/CategoryPopup_templates.xml', + 'advanced_pos_reports/static/src/xml/CategoryReceipt_templates.xml', + 'advanced_pos_reports/static/src/xml/CategoryReceiptPopup_templates.xml', + 'advanced_pos_reports/static/src/js/Location.js', + 'advanced_pos_reports/static/src/js/LocationPopup.js', + 'advanced_pos_reports/static/src/js/LocationReceipt.js', + 'advanced_pos_reports/static/src/js/LocationReceiptPopup.js', + 'advanced_pos_reports/static/src/xml/Location_templates.xml', + 'advanced_pos_reports/static/src/xml/LocationPopup_templates.xml', + 'advanced_pos_reports/static/src/xml/LocationReceipt_templates.xml', + 'advanced_pos_reports/static/src/xml/LocationReceiptPopup_templates.xml', + 'advanced_pos_reports/static/src/js/Order.js', + 'advanced_pos_reports/static/src/js/OrderPopup.js', + 'advanced_pos_reports/static/src/js/OrderReceipt.js', + 'advanced_pos_reports/static/src/js/OrderReceiptPopup.js', + 'advanced_pos_reports/static/src/xml/Order_templates.xml', + 'advanced_pos_reports/static/src/xml/OrderPopup_templates.xml', + 'advanced_pos_reports/static/src/xml/OrderReceipt_templates.xml', + 'advanced_pos_reports/static/src/xml/OrderReceiptPopup_templates.xml', + 'advanced_pos_reports/static/src/js/Payment.js', + 'advanced_pos_reports/static/src/js/PaymentPopup.js', + 'advanced_pos_reports/static/src/js/PaymentReceipt.js', + 'advanced_pos_reports/static/src/js/PaymentReceiptPopup.js', + 'advanced_pos_reports/static/src/xml/Payment_templates.xml', + 'advanced_pos_reports/static/src/xml/PaymentPopup_templates.xml', + 'advanced_pos_reports/static/src/xml/PaymentReceipt_templates.xml', + 'advanced_pos_reports/static/src/xml/PaymentReceiptPopup_templates.xml', + 'advanced_pos_reports/static/src/js/Product.js', + 'advanced_pos_reports/static/src/js/ProductPopup.js', + 'advanced_pos_reports/static/src/js/ProductReceipt.js', + 'advanced_pos_reports/static/src/js/ProductReceiptPopup.js', + 'advanced_pos_reports/static/src/xml/Product_templates.xml', + 'advanced_pos_reports/static/src/xml/ProductPopup_templates.xml', + 'advanced_pos_reports/static/src/xml/ProductReceipt_templates.xml', + 'advanced_pos_reports/static/src/xml/ProductReceiptPopup_templates.xml' + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/advanced_pos_reports/doc/RELEASE_NOTES.md b/advanced_pos_reports/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..b03a19acc --- /dev/null +++ b/advanced_pos_reports/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.01.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial Commit for Advanced POS Reports diff --git a/advanced_pos_reports/models/__init__.py b/advanced_pos_reports/models/__init__.py new file mode 100644 index 000000000..d3002b916 --- /dev/null +++ b/advanced_pos_reports/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import pos_config +from . import pos_order +from . import pos_payment diff --git a/advanced_pos_reports/models/pos_config.py b/advanced_pos_reports/models/pos_config.py new file mode 100644 index 000000000..51bc54dac --- /dev/null +++ b/advanced_pos_reports/models/pos_config.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class PosConfig(models.Model): + """Inheriting pos config to get location summary""" + _inherit = 'pos.config' + + def get_location_summary(self, location_id): + """Function to get location details""" + location_quant = self.env['stock.quant'].search( + [('location_id', '=', int(location_id))]) + for quant in location_quant.filtered( + lambda x: x.product_id.available_in_pos): + location_summary = [ + { + 'product_id': quant.product_id.id, + 'product': quant.product_id.name, + 'quantity': quant.available_quantity, + } + ] + return location_summary diff --git a/advanced_pos_reports/models/pos_order.py b/advanced_pos_reports/models/pos_order.py new file mode 100644 index 000000000..3ddc0f94f --- /dev/null +++ b/advanced_pos_reports/models/pos_order.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class PosOrder(models.Model): + """Get details from pos order""" + _inherit = 'pos.order' + + def get_category_summary(self, order_ids): + """Function to get category details""" + categories = [] + if order_ids: + self.env.cr.execute("""SELECT category.name,category.id, 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_product_template_rel as categ ON product.product_tmpl_id = categ.product_template_id + INNER JOIN pos_category AS category ON categ.pos_category_id = category.id WHERE line.order_id IN %s GROUP BY category.name,category.id """, + (tuple(order_ids),)) + categories = self.env.cr.dictfetchall() + return categories + + def get_product_summary(self, order_ids): + """Function to get product details""" + product_summary = [] + if order_ids: + 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(order_ids),)) + product_summary = self.env.cr.dictfetchall() + return product_summary + + def get_order_summary(self, order_ids): + """Function to get order details""" + orders = self.env["pos.order"].browse(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.date(), + 'amount_total': order.amount_total}) + return order_summary diff --git a/advanced_pos_reports/models/pos_payment.py b/advanced_pos_reports/models/pos_payment.py new file mode 100644 index 000000000..6b26a7b2a --- /dev/null +++ b/advanced_pos_reports/models/pos_payment.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class PosPayment(models.Model): + """Get payment details of pos session""" + _inherit = 'pos.payment' + + def get_payment_summary(self, order_ids): + """Function to get payment details""" + payments_summary = [] + if order_ids: + self.env.cr.execute(""" + SELECT method.name,method.id, 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,method.id + """, (tuple(order_ids),)) + payments_summary = self.env.cr.dictfetchall() + return payments_summary diff --git a/advanced_pos_reports/report/__init__.py b/advanced_pos_reports/report/__init__.py new file mode 100644 index 000000000..ad979135b --- /dev/null +++ b/advanced_pos_reports/report/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import pos_ongoing_session_report +from . import pos_top_selling_categories_report +from . import pos_top_selling_customers_report +from . import pos_top_selling_products_report diff --git a/advanced_pos_reports/report/advanced_pos_reports.xml b/advanced_pos_reports/report/advanced_pos_reports.xml new file mode 100644 index 000000000..7c81d8a74 --- /dev/null +++ b/advanced_pos_reports/report/advanced_pos_reports.xml @@ -0,0 +1,31 @@ + + + + + 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 + + diff --git a/advanced_pos_reports/report/pos_ongoing_session_report.py b/advanced_pos_reports/report/pos_ongoing_session_report.py new file mode 100644 index 000000000..ec494f9e5 --- /dev/null +++ b/advanced_pos_reports/report/pos_ongoing_session_report.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class ReportPosOngoingSession(models.AbstractModel): + """Generate ongoing session report of pos""" + _name = 'report.advanced_pos_reports.report_pos_ongoing_session' + _description = "Ongoing POS Session Report" + + def get_ongoing_sessions_details(self, session_ids=False): + """Function to get ongoing session details""" + if session_ids: + sessions = self.env['pos.session'].search( + [('state', '=', 'opened'), + ('id', 'in', session_ids)]) + 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.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"].browse(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 + categories = [] + if order_ids: + self.env.cr.execute(""" + SELECT category.name, sum(price_subtotal_incl) as amount + 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_product_template_rel as categ ON product.product_tmpl_id = categ.product_template_id + INNER JOIN pos_category AS category ON categ.pos_category_id = category.id + WHERE 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): + """Get ongoing session report values""" + data = dict(data or {}) + data.update(self.get_ongoing_sessions_details(data['session_ids'])) + return data diff --git a/advanced_pos_reports/report/pos_ongoing_session_templates.xml b/advanced_pos_reports/report/pos_ongoing_session_templates.xml new file mode 100644 index 000000000..9197da795 --- /dev/null +++ b/advanced_pos_reports/report/pos_ongoing_session_templates.xml @@ -0,0 +1,134 @@ + + + + + diff --git a/advanced_pos_reports/report/pos_top_selling_categories_report.py b/advanced_pos_reports/report/pos_top_selling_categories_report.py new file mode 100644 index 000000000..99d22ae9c --- /dev/null +++ b/advanced_pos_reports/report/pos_top_selling_categories_report.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class ReportPosTopSellingCategories(models.AbstractModel): + """Generate top_selling categories report""" + _name = 'report.advanced_pos_reports.report_pos_top_selling_categories' + _description = "Report for Top Selling POS Categories" + + def get_top_selling_categories_details(self, no_of_categories=None, + start_date=False, end_date=False): + """Get top_selling categories details""" + order_ids = self.env["pos.order"].search( + [('date_order', '>=', start_date), + ('date_order', '<=', end_date), + ('state', 'in', ['paid', 'done', 'invoiced'])]) + if order_ids: + query = """ + SELECT category.name, sum(price_subtotal_incl) as amount + 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_product_template_rel as categ ON product.product_tmpl_id = categ.product_template_id + INNER JOIN pos_category AS category ON categ.pos_category_id = category.id WHERE line.order_id IN %s GROUP BY category.name ORDER BY amount DESC + """ + + if no_of_categories > 0: + query += " LIMIT %s" + self.env.cr.execute(query, + (tuple(order_ids.ids), no_of_categories)) + else: + self.env.cr.execute(query, (tuple(order_ids.ids),)) + 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): + """Get report values""" + data = dict(data or {}) + data.update( + self.get_top_selling_categories_details(data['no_of_categories'], + data['start_date'], + data['end_date'])) + return data diff --git a/advanced_pos_reports/report/pos_top_selling_categories_templates.xml b/advanced_pos_reports/report/pos_top_selling_categories_templates.xml new file mode 100644 index 000000000..87017afdc --- /dev/null +++ b/advanced_pos_reports/report/pos_top_selling_categories_templates.xml @@ -0,0 +1,65 @@ + + + + + diff --git a/advanced_pos_reports/report/pos_top_selling_customers_report.py b/advanced_pos_reports/report/pos_top_selling_customers_report.py new file mode 100644 index 000000000..eef636392 --- /dev/null +++ b/advanced_pos_reports/report/pos_top_selling_customers_report.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class ReportPosTopSellingCustomers(models.AbstractModel): + """Generate top_selling customers report of pos""" + _name = 'report.advanced_pos_reports.report_pos_top_selling_customers' + _description = "Report for Top Selling POS Customers" + + def get_top_selling_customers_details(self, no_of_customers=None, + start_date=False, end_date=False): + """Get top_selling customers details""" + order_ids = self.env["pos.order"].search([ + ('date_order', '>=', start_date), + ('date_order', '<=', end_date), + ('state', 'in', ['paid', 'done', 'invoiced'])]) + if order_ids: + query = """ + 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 + """ + if no_of_customers > 0: + query += " LIMIT %s" + self.env.cr.execute(query, + (tuple(order_ids.ids), no_of_customers)) + else: + self.env.cr.execute(query, (tuple(order_ids.ids),)) + 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): + """Get report values""" + 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/report/pos_top_selling_customers_templates.xml b/advanced_pos_reports/report/pos_top_selling_customers_templates.xml new file mode 100644 index 000000000..679f58676 --- /dev/null +++ b/advanced_pos_reports/report/pos_top_selling_customers_templates.xml @@ -0,0 +1,64 @@ + + + + + diff --git a/advanced_pos_reports/report/pos_top_selling_products_report.py b/advanced_pos_reports/report/pos_top_selling_products_report.py new file mode 100644 index 000000000..ee5ff22d5 --- /dev/null +++ b/advanced_pos_reports/report/pos_top_selling_products_report.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class ReportPosTopSellingProducts(models.AbstractModel): + """Generate top_selling products from pos""" + _name = 'report.advanced_pos_reports.report_pos_top_selling_products' + _description = "Report for POS Top Selling Products" + + def get_top_selling_products_details(self, + no_of_products=None, + start_date=False, end_date=False): + """Get top_selling products details""" + order_ids = self.env["pos.order"].search( + [('date_order', '>=', start_date), + ('date_order', '<=', end_date), + ('state', 'in', ['paid', 'done', 'invoiced'])]) + + if order_ids: + query = """ + 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 + """ + if no_of_products > 0: + query += " LIMIT %s" + self.env.cr.execute(query, + (tuple(order_ids.ids), no_of_products)) + else: + self.env.cr.execute(query, (tuple(order_ids.ids),)) + + 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): + """Get report values""" + data = dict(data or {}) + data.update( + self.get_top_selling_products_details(data['no_of_products'], + data['start_date'], + data['end_date'])) + return data diff --git a/advanced_pos_reports/report/pos_top_selling_products_templates.xml b/advanced_pos_reports/report/pos_top_selling_products_templates.xml new file mode 100644 index 000000000..42ca7e92d --- /dev/null +++ b/advanced_pos_reports/report/pos_top_selling_products_templates.xml @@ -0,0 +1,71 @@ + + + + + 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..85e937656 --- /dev/null +++ b/advanced_pos_reports/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pos_sale_top_selling_user,access.pos.sale.top.selling.user,model_pos_sale_top_selling,point_of_sale.group_pos_manager,1,1,1,0 +access_pos_sale_ongoing_user,access.pos.sale.ongoing.user,model_pos_sale_ongoing,point_of_sale.group_pos_manager,1,1,1,0 diff --git a/advanced_pos_reports/static/description/assets/icons/capture (1).png b/advanced_pos_reports/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/capture (1).png differ 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/img.png b/advanced_pos_reports/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/img.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/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/photo-capture.png b/advanced_pos_reports/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/icons/photo-capture.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/misc/Cybrosys R.png b/advanced_pos_reports/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/Cybrosys R.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/categories.png b/advanced_pos_reports/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/categories.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/check-box.png b/advanced_pos_reports/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/check-box.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/compass.png b/advanced_pos_reports/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/compass.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/corporate.png b/advanced_pos_reports/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/corporate.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/customer-support.png b/advanced_pos_reports/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/customer-support.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/cybrosys-logo.png b/advanced_pos_reports/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/cybrosys-logo.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/email.svg b/advanced_pos_reports/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advanced_pos_reports/static/description/assets/misc/features.png b/advanced_pos_reports/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/features.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/logo.png b/advanced_pos_reports/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/logo.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/phone.svg b/advanced_pos_reports/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/advanced_pos_reports/static/description/assets/misc/pictures.png b/advanced_pos_reports/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/pictures.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/pie-chart.png b/advanced_pos_reports/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/pie-chart.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/right-arrow.png b/advanced_pos_reports/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/right-arrow.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/star (1) 2.svg b/advanced_pos_reports/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_pos_reports/static/description/assets/misc/star.png b/advanced_pos_reports/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/star.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/support (1) 1.svg b/advanced_pos_reports/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_pos_reports/static/description/assets/misc/support-email.svg b/advanced_pos_reports/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/advanced_pos_reports/static/description/assets/misc/support.png b/advanced_pos_reports/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/support.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/tick-mark.svg b/advanced_pos_reports/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/advanced_pos_reports/static/description/assets/misc/whatsapp 1.svg b/advanced_pos_reports/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_pos_reports/static/description/assets/misc/whatsapp.png b/advanced_pos_reports/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/misc/whatsapp.png differ diff --git a/advanced_pos_reports/static/description/assets/misc/whatsapp.svg b/advanced_pos_reports/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/advanced_pos_reports/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advanced_pos_reports/static/description/assets/modules/1.png b/advanced_pos_reports/static/description/assets/modules/1.png new file mode 100644 index 000000000..e64a5b55c Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/1.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/2.png b/advanced_pos_reports/static/description/assets/modules/2.png new file mode 100644 index 000000000..2a27948da Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/2.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/3.png b/advanced_pos_reports/static/description/assets/modules/3.png new file mode 100644 index 000000000..d1d3775d6 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/3.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/4.png b/advanced_pos_reports/static/description/assets/modules/4.png new file mode 100755 index 000000000..a77027978 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/4.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/5.png b/advanced_pos_reports/static/description/assets/modules/5.png new file mode 100644 index 000000000..1714d7462 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/5.png differ diff --git a/advanced_pos_reports/static/description/assets/modules/6.jpg b/advanced_pos_reports/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..d79685570 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/modules/6.jpg differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/01.png b/advanced_pos_reports/static/description/assets/screenshots/01.png new file mode 100644 index 000000000..6b7731438 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/01.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/02.png b/advanced_pos_reports/static/description/assets/screenshots/02.png new file mode 100644 index 000000000..93a4b4896 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/02.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/03.png b/advanced_pos_reports/static/description/assets/screenshots/03.png new file mode 100644 index 000000000..3134e84bc Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/03.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/04.png b/advanced_pos_reports/static/description/assets/screenshots/04.png new file mode 100644 index 000000000..7e9c566e1 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/04.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/05.png b/advanced_pos_reports/static/description/assets/screenshots/05.png new file mode 100644 index 000000000..370ab1deb Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/05.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/06.png b/advanced_pos_reports/static/description/assets/screenshots/06.png new file mode 100644 index 000000000..ae8964e40 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/06.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/07.png b/advanced_pos_reports/static/description/assets/screenshots/07.png new file mode 100644 index 000000000..2569fcbed Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/07.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/08.png b/advanced_pos_reports/static/description/assets/screenshots/08.png new file mode 100644 index 000000000..c36cb4888 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/08.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/09.png b/advanced_pos_reports/static/description/assets/screenshots/09.png new file mode 100644 index 000000000..aedf1b20b Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/09.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/10.png b/advanced_pos_reports/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..7926284e6 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/10.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/11.png b/advanced_pos_reports/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..a807445d7 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/11.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/12.png b/advanced_pos_reports/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..e12708b95 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/12.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/13.png b/advanced_pos_reports/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..249fd997e Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/13.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/14.png b/advanced_pos_reports/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..3300a216e Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/14.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/15.png b/advanced_pos_reports/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..13b4ae22e Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/15.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/16.png b/advanced_pos_reports/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..d848a2100 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/16.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/17.png b/advanced_pos_reports/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..c8858dbad Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/17.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/18.png b/advanced_pos_reports/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..933ef43ec Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/18.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/19.png b/advanced_pos_reports/static/description/assets/screenshots/19.png new file mode 100644 index 000000000..47a49350c Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/19.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/20.png b/advanced_pos_reports/static/description/assets/screenshots/20.png new file mode 100644 index 000000000..26eaac0c8 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/20.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/21.png b/advanced_pos_reports/static/description/assets/screenshots/21.png new file mode 100644 index 000000000..d281b6aa6 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/21.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/22.png b/advanced_pos_reports/static/description/assets/screenshots/22.png new file mode 100644 index 000000000..ca0d25bd3 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/22.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/23.png b/advanced_pos_reports/static/description/assets/screenshots/23.png new file mode 100644 index 000000000..afac28f77 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/23.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/24.png b/advanced_pos_reports/static/description/assets/screenshots/24.png new file mode 100644 index 000000000..0df48a97a Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/24.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/25.png b/advanced_pos_reports/static/description/assets/screenshots/25.png new file mode 100644 index 000000000..b1bec0441 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/25.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/26.png b/advanced_pos_reports/static/description/assets/screenshots/26.png new file mode 100644 index 000000000..33e7c6165 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/26.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/27.png b/advanced_pos_reports/static/description/assets/screenshots/27.png new file mode 100644 index 000000000..df656803c Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/27.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/28.png b/advanced_pos_reports/static/description/assets/screenshots/28.png new file mode 100644 index 000000000..8feaf4116 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/28.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/29.png b/advanced_pos_reports/static/description/assets/screenshots/29.png new file mode 100644 index 000000000..43f53cec5 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/29.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/30.png b/advanced_pos_reports/static/description/assets/screenshots/30.png new file mode 100644 index 000000000..3f5532597 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/30.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/31.png b/advanced_pos_reports/static/description/assets/screenshots/31.png new file mode 100644 index 000000000..240bcd76f Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/31.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/32.png b/advanced_pos_reports/static/description/assets/screenshots/32.png new file mode 100644 index 000000000..f674dcce7 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/32.png differ diff --git a/advanced_pos_reports/static/description/assets/screenshots/hero.png b/advanced_pos_reports/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..0d2314779 Binary files /dev/null and b/advanced_pos_reports/static/description/assets/screenshots/hero.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..70c71b45b 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..0ddb54fb8 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..5a5fd9b9b --- /dev/null +++ b/advanced_pos_reports/static/description/index.html @@ -0,0 +1,1214 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

Advanced POS Reports

+

+ A Module for Printing Various POS Reports. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Top selling Report

+
+
+
+
+
+
+ +
+
+

+ Ongoing Session Report

+
+
+
+
+
+
+ +
+
+

+ Payment Summary Report

+
+
+
+
+
+
+ +
+
+

+ Order Summary Report

+
+
+
+
+
+
+ +
+
+

+ Category Summary Report

+
+
+
+
+
+
+ +
+
+

+ Location Summary Report

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

+ From Point of Sale --> Reporting, user can access the custom Reports like Top Selling and Ongoing Sessions.

+
+
+
+
+
+
+ +
+
+

+ Select the "Products" option from Top Selling field to get Top Selling Products Report. +

+
+
+
+
+
+
+ +
+
+

+ Top Selling Products Report.

+
+
+
+
+
+
+ +
+
+

+ Select the "Categories" option from Top Selling field to get Top Selling Categories Report.

+
+
+
+
+
+
+ +
+
+

+ Top Selling Categories Report.

+
+
+
+
+
+
+ +
+
+

+ Select the "Customers" option from Top Selling field to get Top Selling Customers Report. +

+
+
+
+
+
+
+ +
+
+

+ Top Selling Customers Report. +

+
+
+
+
+
+
+ +
+
+

+ Ongoing Sessions Report. +

+
+
+
+
+
+
+ +
+
+

+ We can see the Pdf Report of Ongoing Sessions. +

+
+
+
+
+
+
+ +
+
+

+ Click Payment Summary from POS Screen. +

+
+
+
+
+
+
+ +
+
+

+ Condition for Getting Payment Summary Report. +

+
+
+
+
+
+
+ +
+
+

+ Payment Summary of Selected dates. +

+
+
+
+
+
+
+ +
+
+

+ Payment Summary of current session. +

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

+ Click Category Summary from POS Screen. +

+
+
+
+
+
+
+ +
+
+

+ Condition for Getting Category Summary Report. +

+
+
+
+
+
+
+ +
+
+

+ Category Summary of Selected dates. +

+
+
+
+
+
+
+ +
+
+

+ Category Summary of Current Session. +

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

+ Click Product Summary from POS Screen. +

+
+
+
+
+
+
+ +
+
+

+ Condition for Getting Product Summary Report. +

+
+
+
+
+
+
+ +
+
+

+ Product Summary of Selected dates. +

+
+
+
+
+
+
+ +
+
+

+ Product Summary of Current Session. +

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

+ Click Order Summary from POS Screen. +

+
+
+
+
+
+
+ +
+
+

+ Condition for Getting Order Summary Report. +

+
+
+
+
+
+
+ +
+
+

+ Order Summary of Selected Dates. +

+
+
+
+
+
+
+ +
+
+

+ Order Summary of Current Session. +

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

+ Click Location Summary from POS Screen. +

+
+
+
+
+
+
+ +
+
+

+ Condition for Getting Location Summary Report. +

+
+
+
+
+
+
+ +
+
+
+ + +
+
+
+
    +
  • + Ongoing Session Report gives a summary of Ongoing Sessions +
  • +
  • + 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 Summary from POS Screen to get category wise sale details current session/ All sessions within a period + +
  • +
  • + Location Summary from POS Screen to get location wise details + +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on: 16th January 2024 +
+

+ + Initial Commit for Advanced POS Reports.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/advanced_pos_reports/static/src/js/Category.js b/advanced_pos_reports/static/src/js/Category.js new file mode 100644 index 000000000..fc41d75c0 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Category.js @@ -0,0 +1,27 @@ +/** @odoo-module **/ +import { Component } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { CategorySummaryPopup } from "./CategoryPopup"; + +export class CategorySummaryButton extends Component { +// Extending Component and Adding Class CategorySummaryButton + static template = "CategorySummaryButton"; + setup() { + super.setup(); + this.pos = usePos(); + } + async onClick() { +// Show category summary popup + const { confirmed } = await this.pos.popup.add(CategorySummaryPopup, + { title: 'Category Summary',} + ); + } +} +// Register the component +ProductScreen.addControlButton({ + component: CategorySummaryButton, + condition: function () { + return true; + }, +}); diff --git a/advanced_pos_reports/static/src/js/CategoryPopup.js b/advanced_pos_reports/static/src/js/CategoryPopup.js new file mode 100644 index 000000000..8f9014b01 --- /dev/null +++ b/advanced_pos_reports/static/src/js/CategoryPopup.js @@ -0,0 +1,77 @@ +/** @odoo-module **/ +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useState, useRef } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { CategorySummaryReceiptScreen } from "./CategoryReceiptPopup"; + + export class CategorySummaryPopup extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + static template = 'CategorySummaryPopup'; + setup() { + super.setup(); + this.pos = usePos(); + this.is_session = useRef("isSession") + this.date_section = useRef("dateSection") + this.orm = useService("orm"); + this.state = useState({ + current_session: false, + start_date: "", + end_date: "", + }); + } + async click_is_session(){ + //Check the current session is enabled or not + var is_session = this.is_session.el; + var date_section = this.date_section.el; + if(is_session.checked){ + date_section.style.display = "none"; + } + else{ + date_section.style.display = "block"; + } + } + async confirm(event) { + // Filter category summary + var is_session = this.state.current_session; + var start_date = this.state.start_date || ''; + var end_date = this.state.end_date || ''; + var order = this.pos.get_order()['sequence_number'] + var domain = [] + if(is_session){ + domain = [['session_id', '=', this.pos.pos_session.id]] + } + else{ + if (start_date.trim() === '' || end_date.trim() === '') { + return; + } + if (start_date > end_date) { + this.pos.popup.add(ErrorPopup, { + title: "Error", + body: "Start Date Greater than End Date .", + }); + return; + } + domain = [['date_order', '>=', start_date + ' 00:00:00'], + ['date_order', '<=', end_date + ' 23:59:59']] + } + var orders = await this.orm.call('pos.order', 'search', [domain]) + var order_ids = [] + orders.forEach(function(value, index) { + order_ids.push(value); + }); + + var categories = await this.orm.call('pos.order','get_category_summary',[order, order_ids]); + if (categories.length != 0) { + const { confirmed } = await this.pos.popup.add(CategorySummaryReceiptScreen, + {categories: categories, start_date: start_date, end_date: end_date, data: this.pos} + ); + }else { + await this.pos.popup.add(ErrorPopup, { + title: "No Data", + body: "No Data Available .", + }); + } + } + } diff --git a/advanced_pos_reports/static/src/js/CategoryReceipt.js b/advanced_pos_reports/static/src/js/CategoryReceipt.js new file mode 100644 index 000000000..32634c856 --- /dev/null +++ b/advanced_pos_reports/static/src/js/CategoryReceipt.js @@ -0,0 +1,10 @@ +/** @odoo-module **/ +import { Component } from "@odoo/owl"; + + export class CategorySummaryReceipt extends Component { + // Extending Component and Adding Class CategorySummaryReceipt + static template = 'CategorySummaryReceipt'; + setup() { + super.setup(); + } + } diff --git a/advanced_pos_reports/static/src/js/CategoryReceiptPopup.js b/advanced_pos_reports/static/src/js/CategoryReceiptPopup.js new file mode 100644 index 000000000..d5583bd6a --- /dev/null +++ b/advanced_pos_reports/static/src/js/CategoryReceiptPopup.js @@ -0,0 +1,18 @@ +/** @odoo-module **/ +import { useService } from "@web/core/utils/hooks"; +import { CategorySummaryReceipt } from "./CategoryReceipt"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; + + export class CategorySummaryReceiptScreen extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + static template = 'CategorySummaryReceiptScreen'; + setup() { + super.setup(); + this.printer = useService("printer"); + } + async printSummary() { + //Method to print the receipt + await this.printer.print(CategorySummaryReceipt , {data: this.props}, + { webPrintFallback: true }); + } + } diff --git a/advanced_pos_reports/static/src/js/Location.js b/advanced_pos_reports/static/src/js/Location.js new file mode 100644 index 000000000..5965ccaa4 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Location.js @@ -0,0 +1,30 @@ +/** @odoo-module **/ +import { Component } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { useService } from "@web/core/utils/hooks"; +import { LocationSummaryPopup } from "./LocationPopup"; + +export class LocationSummaryButton extends Component { +// Extending Component and Adding Class LocationSummaryButton + static template = "LocationSummaryButton"; + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + } + async onClick() { + // Function to get all the location through rpc + var locations = await this.orm.call('stock.location','search_read', [[['usage', '=', 'internal']]]); + const { confirmed } = await this.pos.popup.add(LocationSummaryPopup, + { title: 'Location Summary', + locations: locations} + ); + } + } +ProductScreen.addControlButton({ + component: LocationSummaryButton, + condition: function () { + return true; + }, +}); diff --git a/advanced_pos_reports/static/src/js/LocationPopup.js b/advanced_pos_reports/static/src/js/LocationPopup.js new file mode 100644 index 000000000..2103f98de --- /dev/null +++ b/advanced_pos_reports/static/src/js/LocationPopup.js @@ -0,0 +1,38 @@ +/** @odoo-module **/ +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { LocationSummaryReceiptScreen } from "./LocationReceiptPopup"; + +export class LocationSummaryPopup extends AbstractAwaitablePopup { +// Extending AbstractAwaitablePopup And Adding A Popup + static template = 'LocationSummaryPopup'; + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + this.state = useState({ + selected_value: '' + }); + } + async confirm() { +// Get location summary + var location = this.state.selected_value; + if (location) { + var locations = await this.orm.call('pos.config','get_location_summary', [this.config_id, location]); + if (locations) { + const { confirmed } = await this.pos.popup.add(LocationSummaryReceiptScreen, + {title: 'Location Receipt',locations: locations, data: this.pos} + ); + } + else { + await this.pos.popup.add(ErrorPopup, { + title: "No Data", + body: "No Data Available .", + }); + } + } + } +} \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/LocationReceipt.js b/advanced_pos_reports/static/src/js/LocationReceipt.js new file mode 100644 index 000000000..8ae9c631f --- /dev/null +++ b/advanced_pos_reports/static/src/js/LocationReceipt.js @@ -0,0 +1,10 @@ +/** @odoo-module **/ +import { Component } from "@odoo/owl"; + + export class LocationSummaryReceipt extends Component{ + // Extending Component and Adding Class LocationSummaryReceipt + static template = 'LocationSummaryReceipt'; + setup() { + super.setup(); + } + } \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/LocationReceiptPopup.js b/advanced_pos_reports/static/src/js/LocationReceiptPopup.js new file mode 100644 index 000000000..78e16f770 --- /dev/null +++ b/advanced_pos_reports/static/src/js/LocationReceiptPopup.js @@ -0,0 +1,18 @@ +/** @odoo-module **/ +import { useService } from "@web/core/utils/hooks"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { LocationSummaryReceipt } from "./LocationReceipt"; + +export class LocationSummaryReceiptScreen extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + static template = 'LocationSummaryReceiptScreen'; + setup() { + super.setup(); + this.printer = useService("printer"); + } + async printSummary() { + //Method to print the receipt + await this.printer.print(LocationSummaryReceipt , {data: this.props}, + { webPrintFallback: true }); + } + } diff --git a/advanced_pos_reports/static/src/js/Order.js b/advanced_pos_reports/static/src/js/Order.js new file mode 100644 index 000000000..f8d2725b4 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Order.js @@ -0,0 +1,26 @@ +/** @odoo-module **/ +import { Component } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { OrderSummaryPopup } from "./OrderPopup"; + +export class OrderSummaryButton extends Component { +// Extending Component and Adding Class OrderSummaryButton + static template = 'OrderSummaryButton'; + setup() { + super.setup(); + this.pos = usePos(); + } + async onClick() { + //Show order summary popup + const { confirmed } = await this.pos.popup.add(OrderSummaryPopup, + { title: 'Order Summary',} + ); + } + } +ProductScreen.addControlButton({ + component: OrderSummaryButton, + condition: function () { + return true; + }, +}); diff --git a/advanced_pos_reports/static/src/js/OrderPopup.js b/advanced_pos_reports/static/src/js/OrderPopup.js new file mode 100644 index 000000000..5e2c9ef29 --- /dev/null +++ b/advanced_pos_reports/static/src/js/OrderPopup.js @@ -0,0 +1,89 @@ +/** @odoo-module **/ +import { useState, useRef } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { OrderSummaryReceiptScreen } from "./OrderReceiptPopup"; + + export class OrderSummaryPopup extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + this.is_session = useRef("isSession"); + this.date_section = useRef("dateSection"); + this.state = useState({ + current_session: false, + start_date: "", + end_date: "", + status: '' || 'draft' || 'paid' || 'done' || 'invoiced' || 'cancel', + }); + } + async click_is_session(){ + // Check if the session is enabled or not + var is_session = this.is_session.el; + var date_section = this.date_section.el; + if(is_session.checked){ + date_section.style.display = "none"; + } + else{ + date_section.style.display = "block"; + } + } + async confirm(event) { + // Get order summary + 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 self = this; + var order = this.pos.get_order()['sequence_number'] + var domain = [] + if(is_session){ + domain = [['session_id', '=', this.pos.pos_session.id]] + if(status){ + domain = [['session_id', '=', this.pos.pos_session.id], ['state', '=', status]] + } + } + else{ + if (start_date.trim() === '' || end_date.trim() === '') { + return; + } + if (start_date > end_date) { + this.pos.popup.add(ErrorPopup, { + title: "Error", + body: "Start Date Greater than End Date .", + }); + return; + } + 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.orm.call('pos.order','search', [domain]); + var order_ids = [] + orders_ids.forEach(function(value, index) { + order_ids.push(value); + }); + var orders = await this.orm.call('pos.order', 'get_order_summary', [order, order_ids]); + if (orders.length != 0){ + const { confirmed } = await this.pos.popup.add(OrderSummaryReceiptScreen, + {orders: orders, start_date: start_date, end_date: end_date, data: this.pos} + ); + } + else { + await this.pos.popup.add(ErrorPopup, { + title: "No Data", + body: "No Data Available .", + }); + } + + } + } +OrderSummaryPopup.template = 'OrderSummaryPopup'; diff --git a/advanced_pos_reports/static/src/js/OrderReceipt.js b/advanced_pos_reports/static/src/js/OrderReceipt.js new file mode 100644 index 000000000..c58d41de4 --- /dev/null +++ b/advanced_pos_reports/static/src/js/OrderReceipt.js @@ -0,0 +1,10 @@ +/** @odoo-module */ +import { Component } from "@odoo/owl"; + + export class OrderSummaryReceipt extends Component { + // Extending Component and Adding Class OrderSummaryReceipt + static template = 'OrderSummaryReceipt'; + setup() { + super.setup(); + } + } \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/OrderReceiptPopup.js b/advanced_pos_reports/static/src/js/OrderReceiptPopup.js new file mode 100644 index 000000000..570dcd1d0 --- /dev/null +++ b/advanced_pos_reports/static/src/js/OrderReceiptPopup.js @@ -0,0 +1,19 @@ +/** @odoo-module **/ +import { useService } from "@web/core/utils/hooks"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { OrderSummaryReceipt } from "./OrderReceipt"; + + export class OrderSummaryReceiptScreen extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + static template = 'OrderSummaryReceiptScreen'; + setup() { + super.setup(); + this.printer = useService("printer"); + } + async printSummary() { + await this.printer.print(OrderSummaryReceipt , {data: this.props}, + { webPrintFallback: true }); + + } + } + diff --git a/advanced_pos_reports/static/src/js/Payment.js b/advanced_pos_reports/static/src/js/Payment.js new file mode 100644 index 000000000..57af03804 --- /dev/null +++ b/advanced_pos_reports/static/src/js/Payment.js @@ -0,0 +1,26 @@ +/** @odoo-module **/ +import { Component } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { PaymentSummaryPopup } from "./PaymentPopup"; + +export class PaymentSummaryButton extends Component { +// Extending Component and Adding Class CategorySummaryButton + static template = 'PaymentSummaryButton'; + setup() { + super.setup(); + this.pos = usePos(); + } + async onClick() { + //Show payment summary popup + const { confirmed } = await this.pos.popup.add(PaymentSummaryPopup, + { title: 'Payment Summary',} + ); + } + } +ProductScreen.addControlButton({ +component: PaymentSummaryButton, +condition: function () { + return true; +}, +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/PaymentPopup.js b/advanced_pos_reports/static/src/js/PaymentPopup.js new file mode 100644 index 000000000..5e0ec6840 --- /dev/null +++ b/advanced_pos_reports/static/src/js/PaymentPopup.js @@ -0,0 +1,91 @@ +/** @odoo-module **/ +import { useState, useRef } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { PaymentSummaryReceiptScreen } from "./PaymentReceiptPopup"; + + export class PaymentSummaryPopup extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + this.is_session = useRef("isSession") + this.date_section = useRef("dateSection") + this.state = useState({ + current_session: false, + start_date: "", + end_date: "", + summary: '' || 'sales_person' || 'journal', + }); + } + async click_is_session(){ + //Check if the current session is enabled or not + var is_session = this.is_session.el; + var date_section = this.date_section.el; + if(is_session.checked){ + date_section.style.display = "none"; + } + else{ + date_section.style.display = "block"; + } + } + async confirm(event) { + // Get payment summary + 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.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.pos.pos_session.id]] + if(summary_type == 'sales_person'){ + domain = [['session_id', '=', this.pos.pos_session.id], ['user_id', '=', this.pos.user.id]] + } + } + else{ + if (start_date.trim() === '' || end_date.trim() === '') { + return; + } + if (start_date > end_date) { + this.pos.popup.add(ErrorPopup, { + title: "Error", + body: "Start Date Greater than End Date .", + }); + return; + } + 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.pos.user.id]] + } + } + var orders = await this.orm.call('pos.order', 'search', [domain]); + var order_ids = [] + orders.forEach(function(value, index) { + order_ids.push(value); + }); + var payment_summary = await this.orm.call('pos.payment', 'get_payment_summary', [order, order_ids]); + if (payment_summary.length != 0){ + const { confirmed } = await this.pos.popup.add(PaymentSummaryReceiptScreen, + {payment_summary: payment_summary, start_date: start_date, end_date: end_date, is_user: is_user, data: this.pos} + ); + } + else { + await this.pos.popup.add(ErrorPopup, { + title: "No Data", + body: "No Data Available .", + }); + } + } + } +PaymentSummaryPopup.template = 'PaymentSummaryPopup'; diff --git a/advanced_pos_reports/static/src/js/PaymentReceipt.js b/advanced_pos_reports/static/src/js/PaymentReceipt.js new file mode 100644 index 000000000..2f5548b2f --- /dev/null +++ b/advanced_pos_reports/static/src/js/PaymentReceipt.js @@ -0,0 +1,11 @@ +/** @odoo-module */ +import { Component } from "@odoo/owl"; + + export class PaymentSummaryReceipt extends Component { + // Extending Component and Adding Class PaymentSummaryReceipt + static template = 'PaymentSummaryReceipt'; + setup() { + super.setup(); + } + + } \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/PaymentReceiptPopup.js b/advanced_pos_reports/static/src/js/PaymentReceiptPopup.js new file mode 100644 index 000000000..13b7206e7 --- /dev/null +++ b/advanced_pos_reports/static/src/js/PaymentReceiptPopup.js @@ -0,0 +1,18 @@ +/** @odoo-module **/ +import { useService } from "@web/core/utils/hooks"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { PaymentSummaryReceipt } from "./PaymentReceipt"; + + export class PaymentSummaryReceiptScreen extends PaymentSummaryReceipt { + // Extending AbstractAwaitablePopup And Adding A Popup + static template = 'PaymentSummaryReceiptScreen'; + setup() { + super.setup(); + this.printer = useService("printer"); + } + async printSummary() { + //Method to print the receipt + await this.printer.print(PaymentSummaryReceipt , {data: this.props},{ webPrintFallback: true } + ); + } + } diff --git a/advanced_pos_reports/static/src/js/Product.js b/advanced_pos_reports/static/src/js/Product.js new file mode 100644 index 000000000..29f58a38c --- /dev/null +++ b/advanced_pos_reports/static/src/js/Product.js @@ -0,0 +1,26 @@ +/** @odoo-module **/ +import { Component } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { ProductSummaryPopup } from "./ProductPopup"; + +export class ProductSummaryButton extends Component { +// Extending Component and Adding Class ProductSummaryButton + static template = 'ProductSummaryButton'; + setup() { + super.setup(); + this.pos = usePos(); + } + async onClick() { + //Show payment summary popup + const { confirmed } = await this.pos.popup.add(ProductSummaryPopup, + { title: 'Product Summary',} + ); + } + } +ProductScreen.addControlButton({ +component: ProductSummaryButton, +condition: function () { + return true; +}, +}); \ No newline at end of file diff --git a/advanced_pos_reports/static/src/js/ProductPopup.js b/advanced_pos_reports/static/src/js/ProductPopup.js new file mode 100644 index 000000000..26f76fb14 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ProductPopup.js @@ -0,0 +1,77 @@ +/** @odoo-module **/ +import { useState, useRef } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { ProductSummaryReceiptScreen } from "./ProductReceiptPopup"; + + export class ProductSummaryPopup extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + this.is_session = useRef("isSession") + this.date_section = useRef("dateSection") + this.state = useState({ + current_session: false, + start_date: "", + end_date: "" + }); + } + async click_is_session(){ + //Check if the current session is enabled or not + var is_session = this.is_session.el; + var date_section = this.date_section.el; + if(is_session.checked){ + date_section.style.display = "none"; + } + else{ + date_section.style.display = "block"; + } + } + async confirm(event) { + // Get product summary + var is_session = this.state.current_session; + var start_date = this.state.start_date || ''; + var end_date = this.state.end_date || ''; + var order = this.pos.get_order()['sequence_number'] + var domain = [] + if(is_session){ + domain = [['session_id', '=', this.pos.pos_session.id]] + } + else{ + if (start_date.trim() === '' || end_date.trim() === '') { + return; + } + if (start_date > end_date) { + this.pos.popup.add(ErrorPopup, { + title: "Error", + body: "Start Date Greater than End Date .", + }); + return; + } + domain = [['date_order', '>=', start_date + ' 00:00:00'], + ['date_order', '<=', end_date + ' 23:59:59']] + } + var orders = await this.orm.call('pos.order', 'search', [domain],); + var order_ids = [] + orders.forEach(function(value, index) { + order_ids.push(value); + }); + var products = await this.orm.call('pos.order', 'get_product_summary', [order, order_ids]); + if (products.length != 0){ + const { confirmed } = await this.pos.popup.add(ProductSummaryReceiptScreen, + {products: products, start_date: start_date, end_date: end_date, data: this.pos} + ); + } + else { + await this.pos.popup.add(ErrorPopup, { + title: "No Data", + body: "No Data Available .", + }); + } + } + } +ProductSummaryPopup.template = 'ProductSummaryPopup'; diff --git a/advanced_pos_reports/static/src/js/ProductReceipt.js b/advanced_pos_reports/static/src/js/ProductReceipt.js new file mode 100644 index 000000000..298b82951 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ProductReceipt.js @@ -0,0 +1,11 @@ +/** @odoo-module */ +import { Component } from "@odoo/owl"; + + export class ProductSummaryReceipt extends Component { + // Extending Component and Adding Class CategorySummaryReceipt + static template = 'ProductSummaryReceipt'; + setup() { + super.setup(); + } + + } diff --git a/advanced_pos_reports/static/src/js/ProductReceiptPopup.js b/advanced_pos_reports/static/src/js/ProductReceiptPopup.js new file mode 100644 index 000000000..b8890fe39 --- /dev/null +++ b/advanced_pos_reports/static/src/js/ProductReceiptPopup.js @@ -0,0 +1,19 @@ +/** @odoo-module **/ +import { useService } from "@web/core/utils/hooks"; +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { ProductSummaryReceipt } from "./ProductReceipt"; + + export class ProductSummaryReceiptScreen extends AbstractAwaitablePopup { + // Extending AbstractAwaitablePopup And Adding A Popup + static template = 'ProductSummaryReceiptScreen'; + setup() { + super.setup(); + this.printer = useService("printer"); + } + async printSummary() { + //Method to print the receipt + await this.printer.print(ProductSummaryReceipt , {data: this.props}, + { webPrintFallback: true }); + } + + } diff --git a/advanced_pos_reports/static/src/xml/CategoryPopup_templates.xml b/advanced_pos_reports/static/src/xml/CategoryPopup_templates.xml new file mode 100644 index 000000000..dcd60f949 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/CategoryPopup_templates.xml @@ -0,0 +1,57 @@ + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/CategoryReceiptPopup_templates.xml b/advanced_pos_reports/static/src/xml/CategoryReceiptPopup_templates.xml new file mode 100644 index 000000000..168d7d4d9 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/CategoryReceiptPopup_templates.xml @@ -0,0 +1,107 @@ + + + + +
+
+
+ + +
+
+ +

+ +

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

+ Category Summary +

+ + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + +
+ + + + + + +
CategoryQuantityTotal
+ + + + + +
Total: + + + +
+
+
+
+ + Print Category Summary +
+
+ Cancel +
+
+
+
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/CategoryReceipt_templates.xml b/advanced_pos_reports/static/src/xml/CategoryReceipt_templates.xml new file mode 100644 index 000000000..8375f99cc --- /dev/null +++ b/advanced_pos_reports/static/src/xml/CategoryReceipt_templates.xml @@ -0,0 +1,95 @@ + + + + +
+
+ + +
+
+ +

+ +

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

+ Category Summary +

+ + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + +
+ + + + + + +
CategoryQuantityTotal
+ + + + + +
Total: + + + +
+
+
+
+
diff --git a/advanced_pos_reports/static/src/xml/Category_templates.xml b/advanced_pos_reports/static/src/xml/Category_templates.xml new file mode 100644 index 000000000..04e5c89fd --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Category_templates.xml @@ -0,0 +1,12 @@ + + + + +
+ + Category Summary +
+
+
diff --git a/advanced_pos_reports/static/src/xml/LocationPopup_templates.xml b/advanced_pos_reports/static/src/xml/LocationPopup_templates.xml new file mode 100644 index 000000000..4285d509f --- /dev/null +++ b/advanced_pos_reports/static/src/xml/LocationPopup_templates.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/LocationReceiptPopup_templates.xml b/advanced_pos_reports/static/src/xml/LocationReceiptPopup_templates.xml new file mode 100644 index 000000000..1eff4a4e3 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/LocationReceiptPopup_templates.xml @@ -0,0 +1,81 @@ + + + + +
+
+
+ + +
+
+ +

+ +

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

+ Location Summary +

+
+ + + + + + + + + + + + + + +
+ + + + + +
ProductQuantity
+ + + +
Total: + +
+
+
+
+
+ Print Location Summary +
+
+ Cancel +
+
+
+
diff --git a/advanced_pos_reports/static/src/xml/LocationReceipt_templates.xml b/advanced_pos_reports/static/src/xml/LocationReceipt_templates.xml new file mode 100644 index 000000000..1a88ed344 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/LocationReceipt_templates.xml @@ -0,0 +1,70 @@ + + + + +
+
+ + +
+
+ +

+ +

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

+ Location Summary +

+ + + + + + + + + + + + + + +
+ + + + + +
ProductQuantity
+ + + +
Total: + +
+
+
+
+
diff --git a/advanced_pos_reports/static/src/xml/Location_templates.xml b/advanced_pos_reports/static/src/xml/Location_templates.xml new file mode 100644 index 000000000..26f92645d --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Location_templates.xml @@ -0,0 +1,11 @@ + + + + +
+ + Location Summary +
+
+
diff --git a/advanced_pos_reports/static/src/xml/OrderPopup_templates.xml b/advanced_pos_reports/static/src/xml/OrderPopup_templates.xml new file mode 100644 index 000000000..ce12924bc --- /dev/null +++ b/advanced_pos_reports/static/src/xml/OrderPopup_templates.xml @@ -0,0 +1,73 @@ + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/OrderReceiptPopup_templates.xml b/advanced_pos_reports/static/src/xml/OrderReceiptPopup_templates.xml new file mode 100644 index 000000000..5d2fbc44c --- /dev/null +++ b/advanced_pos_reports/static/src/xml/OrderReceiptPopup_templates.xml @@ -0,0 +1,102 @@ + + + + +
+
+
+ + +
+
+ +

+ +

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

+ Order Summary +

+ + + + + + + + + +
Start Date:
End Date:
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
Order RefStatusDateTotal
+ + + + +
+
+ +
Total: + + + +
+
+
+
+
+ Print Order Summary +
+
+ Cancel +
+
+
+
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/OrderReceipt_templates.xml b/advanced_pos_reports/static/src/xml/OrderReceipt_templates.xml new file mode 100644 index 000000000..cfebc0aa3 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/OrderReceipt_templates.xml @@ -0,0 +1,91 @@ + + + + +
+
+ + +
+
+ +

+ +

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

+ Order Summary +

+ + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
Order RefStatusDateTotal
+ + + + +
+
+ +
Total: + + + +
+
+
+
+
diff --git a/advanced_pos_reports/static/src/xml/Order_templates.xml b/advanced_pos_reports/static/src/xml/Order_templates.xml new file mode 100644 index 000000000..7d3d37e31 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Order_templates.xml @@ -0,0 +1,12 @@ + + + + +
+ + Order Summary +
+
+
diff --git a/advanced_pos_reports/static/src/xml/PaymentPopup_templates.xml b/advanced_pos_reports/static/src/xml/PaymentPopup_templates.xml new file mode 100644 index 000000000..c0a811400 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/PaymentPopup_templates.xml @@ -0,0 +1,67 @@ + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/PaymentReceiptPopup_templates.xml b/advanced_pos_reports/static/src/xml/PaymentReceiptPopup_templates.xml new file mode 100644 index 000000000..f68ea487e --- /dev/null +++ b/advanced_pos_reports/static/src/xml/PaymentReceiptPopup_templates.xml @@ -0,0 +1,109 @@ + + + + +
+
+
+ + +
+
+ +

+ +

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

+ Payment Summary +

+ +
+
Salesperson:
+
+
+ + + + + + + + + +
Start Date:
End Date:
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + +
Payment MethodAmount
+ + + +
Total: + +
+
+
+
+
+ + Print Payment Summary +
+
+ Cancel +
+
+
+
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/PaymentReceipt_templates.xml b/advanced_pos_reports/static/src/xml/PaymentReceipt_templates.xml new file mode 100644 index 000000000..52f0754ad --- /dev/null +++ b/advanced_pos_reports/static/src/xml/PaymentReceipt_templates.xml @@ -0,0 +1,96 @@ + + + + +
+
+ + +
+
+ +

+ +

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

+ Payment Summary +

+ +
+
Salesperson:
+
+
+ + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + +
+
+ + + + + +
Payment MethodAmount
+ + + +
Total: + +
+ +
+
+
+
diff --git a/advanced_pos_reports/static/src/xml/Payment_templates.xml b/advanced_pos_reports/static/src/xml/Payment_templates.xml new file mode 100644 index 000000000..2842ca8b0 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Payment_templates.xml @@ -0,0 +1,11 @@ + + + + +
+ + Payment Summary +
+
+
diff --git a/advanced_pos_reports/static/src/xml/ProductPopup_templates.xml b/advanced_pos_reports/static/src/xml/ProductPopup_templates.xml new file mode 100644 index 000000000..9d67fc4da --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ProductPopup_templates.xml @@ -0,0 +1,60 @@ + + + + + + + diff --git a/advanced_pos_reports/static/src/xml/ProductReceiptPopup_templates.xml b/advanced_pos_reports/static/src/xml/ProductReceiptPopup_templates.xml new file mode 100644 index 000000000..7213e4a62 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ProductReceiptPopup_templates.xml @@ -0,0 +1,110 @@ + + + + +
+
+
+ + +
+
+ +

+ +

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

+ Product Summary +

+ + + + + + + + + + +
Start Date:
End Date:
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
ProductQuantity
+ [] + + + +
Total: + +
+
+ +
+
+
+ + Print Product Summary +
+ +
+ Cancel +
+
+ +
+
\ No newline at end of file diff --git a/advanced_pos_reports/static/src/xml/ProductReceipt_templates.xml b/advanced_pos_reports/static/src/xml/ProductReceipt_templates.xml new file mode 100644 index 000000000..1ad0f469a --- /dev/null +++ b/advanced_pos_reports/static/src/xml/ProductReceipt_templates.xml @@ -0,0 +1,93 @@ + + + + +
+
+ + +
+
+ +

+ +

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

+ Product Summary +

+ + + + + + + + + +
Start Date:
End Date:
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
ProductQuantity
+ [] + + + +
Total: + +
+ +
+
+
+
diff --git a/advanced_pos_reports/static/src/xml/Product_templates.xml b/advanced_pos_reports/static/src/xml/Product_templates.xml new file mode 100644 index 000000000..a8237d257 --- /dev/null +++ b/advanced_pos_reports/static/src/xml/Product_templates.xml @@ -0,0 +1,11 @@ + + + + +
+ + Product Summary +
+
+
diff --git a/advanced_pos_reports/wizard/__init__.py b/advanced_pos_reports/wizard/__init__.py new file mode 100644 index 000000000..06a427154 --- /dev/null +++ b/advanced_pos_reports/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import pos_sale_ongoing +from . import pos_sale_top_selling diff --git a/advanced_pos_reports/wizard/advanced_pos_reports_wizard.xml b/advanced_pos_reports/wizard/advanced_pos_reports_wizard.xml new file mode 100644 index 000000000..0f7211ddd --- /dev/null +++ b/advanced_pos_reports/wizard/advanced_pos_reports_wizard.xml @@ -0,0 +1,23 @@ + + + + + Top Selling + pos.sale.top.selling + form + new + + + + Ongoing Sessions Report + pos.sale.ongoing + form + new + + + + diff --git a/advanced_pos_reports/wizard/pos_sale_ongoing.py b/advanced_pos_reports/wizard/pos_sale_ongoing.py new file mode 100644 index 000000000..d4f2edbd1 --- /dev/null +++ b/advanced_pos_reports/wizard/pos_sale_ongoing.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PosSaleOngoing(models.TransientModel): + """Generate wizard for generate ongoing session report""" + _name = 'pos.sale.ongoing' + _description = 'Point of Sale Ongoing Session Report' + + session_ids = fields.Many2many('pos.session', + string='POS Ongoing Sessions', + required=True, + help="Currently ongoing sessions", + domain=[('state', '=', 'opened')]) + + def action_generate_report(self): + """Function to generate ongoing session report""" + 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/pos_sale_ongoing_views.xml b/advanced_pos_reports/wizard/pos_sale_ongoing_views.xml new file mode 100644 index 000000000..1254674db --- /dev/null +++ b/advanced_pos_reports/wizard/pos_sale_ongoing_views.xml @@ -0,0 +1,23 @@ + + + + + pos.sale.ongoing.view.form + pos.sale.ongoing + +
+ + + +
+
+
+
+
+
diff --git a/advanced_pos_reports/wizard/pos_sale_top_selling.py b/advanced_pos_reports/wizard/pos_sale_top_selling.py new file mode 100644 index 000000000..22de0d41f --- /dev/null +++ b/advanced_pos_reports/wizard/pos_sale_top_selling.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, _ +from odoo.exceptions import ValidationError + + +class PosSaleTopSelling(models.TransientModel): + """Get top_selling product,category,customer from pos""" + _name = 'pos.sale.top.selling' + _description = 'Point of Sale Top Selling Product/Category/Customer Report' + + start_date = fields.Datetime(string="Start Date", + required=True, + help="Starting date") + end_date = fields.Datetime(string="End Date", + required=True, + help="Ending date") + top_selling = fields.Selection( + [('products', 'Products'), ('category', 'Categories'), + ('customers', 'Customers')], + string='Top Selling', default='products', + help="Select Top selling categories, products and customers") + no_of_products = fields.Integer(string="Number of Products", + help="Number of products") + no_of_categories = fields.Integer(string="No of Categories", + help="Number of categories") + no_of_customers = fields.Integer(string="Number of Customers", + help="Number of customers") + + def action_generate_report(self): + """Generate top_selling product,category,customer report from pos""" + if self.start_date > self.end_date: + raise ValidationError(_("The End Date must be greater than the " + "Start Date")) + 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) diff --git a/advanced_pos_reports/wizard/pos_sale_top_selling_views.xml b/advanced_pos_reports/wizard/pos_sale_top_selling_views.xml new file mode 100644 index 000000000..1044d0ead --- /dev/null +++ b/advanced_pos_reports/wizard/pos_sale_top_selling_views.xml @@ -0,0 +1,31 @@ + + + + + pos.sale.top.selling.view.form + pos.sale.top.selling + +
+ + + + + + + + + + + + + +
+
+
+