diff --git a/profit_and_loss_pdf_report/README.rst b/profit_and_loss_pdf_report/README.rst new file mode 100755 index 000000000..21f72ac03 --- /dev/null +++ b/profit_and_loss_pdf_report/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 + +Profit And Loss PDF Report +----------------------------- +This module helps you to print profit and loss pdf report in community Edition. + +Configuration +============= +* No Additional configuration is needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + + +Credits +------- +Developer: (V15) Ammu Raj, 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/profit_and_loss_pdf_report/__init__.py b/profit_and_loss_pdf_report/__init__.py new file mode 100644 index 000000000..edd45111b --- /dev/null +++ b/profit_and_loss_pdf_report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ammu Raj() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from . import wizard diff --git a/profit_and_loss_pdf_report/__manifest__.py b/profit_and_loss_pdf_report/__manifest__.py new file mode 100644 index 000000000..386104aec --- /dev/null +++ b/profit_and_loss_pdf_report/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ammu Raj() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +{ + "name": "Profit And Loss PDF Report", + "version": "15.0.1.0.0", + "category": "Accounting", + "summary": """Profit and Loss PDF Report in community""", + "description": "This app, designed for use within the community edition" + "offers a valuable solution for businesses and individuals" + "seeking to efficiently generate and print profit and loss" + "reports in PDF format.""", + "author": "Cybrosys Techno Solutions", + "company": "Cybrosys Techno Solutions", + "maintainer": "Cybrosys Techno Solutions", + "website": "http://www.cybrosys.com", + "depends": ["account", "sale", "account_check_printing", + "base_account_budget", "analytic"], + "data": [ + "security/ir.model.access.csv", + "wizard/profit_loss_report_views.xml", + "report/profit_loss_pdf_templates.xml", + "report/profit_loss_pdf_reports.xml", + ], + "images": ["static/description/banner.png"], + "license": "AGPL-3", + "installable": True, + "auto_install": False, + "application": False, +} diff --git a/profit_and_loss_pdf_report/doc/RELEASE_NOTES.md b/profit_and_loss_pdf_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..06301f626 --- /dev/null +++ b/profit_and_loss_pdf_report/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 04.05.2024 +#### Version 15.0.1.0.0 +#### ADD + +- Initial Commit for Profit And Loss PDF Report diff --git a/profit_and_loss_pdf_report/report/profit_loss_pdf_reports.xml b/profit_and_loss_pdf_report/report/profit_loss_pdf_reports.xml new file mode 100644 index 000000000..7761ffda0 --- /dev/null +++ b/profit_and_loss_pdf_report/report/profit_loss_pdf_reports.xml @@ -0,0 +1,13 @@ + + + + + profit_loss_pdf + profit.loss.report + qweb-pdf + profit_and_loss_pdf_report.pl_report_temp + profit_and_loss_pdf_report.pl_report_temp + + report + + diff --git a/profit_and_loss_pdf_report/report/profit_loss_pdf_templates.xml b/profit_and_loss_pdf_report/report/profit_loss_pdf_templates.xml new file mode 100644 index 000000000..e0e90b9d6 --- /dev/null +++ b/profit_and_loss_pdf_report/report/profit_loss_pdf_templates.xml @@ -0,0 +1,123 @@ + + + + + diff --git a/profit_and_loss_pdf_report/security/ir.model.access.csv b/profit_and_loss_pdf_report/security/ir.model.access.csv new file mode 100644 index 000000000..d8e55fb65 --- /dev/null +++ b/profit_and_loss_pdf_report/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_profit_loss_report_user,access.profit.loss.report.user,model_profit_loss_report,base.group_user,1,1,1,1 diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/check.png b/profit_and_loss_pdf_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/check.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/chevron.png b/profit_and_loss_pdf_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/chevron.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/cogs.png b/profit_and_loss_pdf_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/cogs.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/consultation.png b/profit_and_loss_pdf_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/consultation.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/ecom-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/ecom-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/education-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/education-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/hotel-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/hotel-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/license.png b/profit_and_loss_pdf_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/license.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/lifebuoy.png b/profit_and_loss_pdf_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/lifebuoy.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/manufacturing-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/pos-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/pos-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/puzzle.png b/profit_and_loss_pdf_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/puzzle.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/restaurant-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/restaurant-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/service-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/service-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/trading-black.png b/profit_and_loss_pdf_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/trading-black.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/training.png b/profit_and_loss_pdf_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/training.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/update.png b/profit_and_loss_pdf_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/update.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/user.png b/profit_and_loss_pdf_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/user.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/icons/wrench.png b/profit_and_loss_pdf_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/wrench.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/categories.png b/profit_and_loss_pdf_report/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/categories.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/check-box.png b/profit_and_loss_pdf_report/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/check-box.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/compass.png b/profit_and_loss_pdf_report/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/compass.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/corporate.png b/profit_and_loss_pdf_report/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/corporate.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/customer-support.png b/profit_and_loss_pdf_report/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/customer-support.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/cybrosys-logo.png b/profit_and_loss_pdf_report/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/cybrosys-logo.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/features.png b/profit_and_loss_pdf_report/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/features.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/logo.png b/profit_and_loss_pdf_report/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/logo.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/pictures.png b/profit_and_loss_pdf_report/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/pictures.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/pie-chart.png b/profit_and_loss_pdf_report/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/pie-chart.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/right-arrow.png b/profit_and_loss_pdf_report/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/right-arrow.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/star.png b/profit_and_loss_pdf_report/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/star.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/support.png b/profit_and_loss_pdf_report/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/support.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp.png b/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/modules/1.png b/profit_and_loss_pdf_report/static/description/assets/modules/1.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/modules/1.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/modules/2.png b/profit_and_loss_pdf_report/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/modules/2.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/modules/3.png b/profit_and_loss_pdf_report/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/modules/3.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/modules/4.png b/profit_and_loss_pdf_report/static/description/assets/modules/4.png new file mode 100644 index 000000000..3fae4631e Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/modules/4.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/modules/5.gif b/profit_and_loss_pdf_report/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/modules/5.gif differ diff --git a/profit_and_loss_pdf_report/static/description/assets/modules/6.png b/profit_and_loss_pdf_report/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/modules/6.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/screenshots/1.png b/profit_and_loss_pdf_report/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..17aa0152a Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/screenshots/1.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/screenshots/2.png b/profit_and_loss_pdf_report/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..42fa9f8f4 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/screenshots/2.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/screenshots/3.png b/profit_and_loss_pdf_report/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..cbde81801 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/screenshots/3.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/screenshots/hero.gif b/profit_and_loss_pdf_report/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..211e27b36 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/screenshots/hero.gif differ diff --git a/profit_and_loss_pdf_report/static/description/banner.png b/profit_and_loss_pdf_report/static/description/banner.png new file mode 100644 index 000000000..30f6da6c9 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/banner.png differ diff --git a/profit_and_loss_pdf_report/static/description/icon.png b/profit_and_loss_pdf_report/static/description/icon.png new file mode 100644 index 000000000..155a3fb8e Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/icon.png differ diff --git a/profit_and_loss_pdf_report/static/description/index.html b/profit_and_loss_pdf_report/static/description/index.html new file mode 100644 index 000000000..51d12dc42 --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/index.html @@ -0,0 +1,541 @@ +
+ +
+ +
+
+ Community +
+
+
+ +
+
+
+ +

+ Profit And Loss PDF Report

+

Support to Print Profit and Loss PDF Report in Community Edition.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+This app, designed for use within the community edition, offers a valuable + solution for businesses and individuals seeking to efficiently generate and + print profit and loss reports in PDF format.""", +
+
+ + +
+
+ +
+

Features +

+
+
+
+
+ + Added a new menu for creating Profit and loss report. +
+
+ + The user is also able to generate a profit and loss + report for a specific period between two dates. +
+
+ + Supported in Odoo15 community edition. +
+
+
+ + +
+
+ +
+

Screenshots +

+
+
+
+
+

Invoicing -> Reporting -> Profit and Loss Report. +

+

Here a new menu is added for printing Profit and Loss Report.

+ +
+
+

Wizard to choose Start Date and End Date.

+ +
+
+

Profit and Loss Report. +

+ +
+
+
+ + +
+
+ +
+

Related + Products +

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

Our Services +

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

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/profit_and_loss_pdf_report/wizard/__init__.py b/profit_and_loss_pdf_report/wizard/__init__.py new file mode 100644 index 000000000..74b8bb600 --- /dev/null +++ b/profit_and_loss_pdf_report/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ammu Raj() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from . import profit_loss_report diff --git a/profit_and_loss_pdf_report/wizard/profit_loss_report.py b/profit_and_loss_pdf_report/wizard/profit_loss_report.py new file mode 100644 index 000000000..62957f8cb --- /dev/null +++ b/profit_and_loss_pdf_report/wizard/profit_loss_report.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ammu Raj() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class ProfitLossReport(models.TransientModel): + """Wizard class for printing report.""" + + _name = "profit.loss.report" + _description = "profit and loss PDF report" + + start_date = fields.Date( + string="Start date", help="From which date do you want to generate the" "report" + ) + end_date = fields.Date( + string="End date", help="To which date do you want to generate the" "report" + ) + + @api.constrains("start_date", "end_date") + def check_start_date(self): + """This function is used to validate the entered date""" + if self.start_date and self.end_date: + if self.start_date > self.end_date: + raise ValidationError(_("Please check the date that you " "provide")) + + def action_button_to_print_pdf(self): + """Print pdf report of profit and loss report""" + query = f""" + select account_account.code,account_account.name, + CONCAT(account_account.code, ' - ',account_account.name) + AS account_name,account_account.internal_group, + sum(account_move_line.credit) + from account_move_line join account_account on account_account.id = + account_move_line.account_id + where internal_group='income' + AND account_move_line.company_id = '{self.env.company.id}' + """ + if self.start_date: + query += f""" AND account_move_line.date >= '{self.start_date}' """ + if self.end_date: + query += f""" AND account_move_line.date <= '{self.end_date}' """ + query += ( + " group by account_account.code,account_account.name," + "account_account.internal_group" + ) + self.env.cr.execute(query, [self.start_date, self.end_date]) + op_income = self.env.cr.dictfetchall() + total_op_income = 0.0 + op_income_lst = [] + for op_inc in op_income: + net = op_inc["sum"] + op_income_lst.append(net) + total_op_income = sum(op_income_lst) + query_other_income = f""" + select account_account.code,account_account.name, + CONCAT(account_account.code, ' - ', account_account.name) AS + account_name,account_account.internal_group,sum(account_move_line.credit) + from account_move_line join account_account on + account_account.id = account_move_line.account_id + where internal_group='income_other' + AND account_move_line.company_id = '{self.env.company.id}' + """ + if self.start_date: + query_other_income += f""" AND account_move_line.date >= + '{self.start_date}' """ + if self.end_date: + query_other_income += f"""AND account_move_line.date <= + '{self.end_date}' """ + query_other_income += ( + " group by account_account.code" + ",account_account.name,account_account.internal_group" + ) + self.env.cr.execute(query_other_income) + other_income = self.env.cr.dictfetchall() + total_other_income = 0.0 + other_income_lst = [] + for o_income in other_income: + net = o_income["sum"] + other_income_lst.append(net) + total_other_income = sum(other_income_lst) + query_cor = f""" + select account_account.code,account_account.name, + CONCAT(account_account.code, ' - ',account_account.name) + AS account_name,account_account.internal_group, + sum(account_move_line.credit) + from account_move_line join account_account on account_account.id = + account_move_line.account_id + where internal_group='expense_direct_cost' AND + account_move_line.company_id = '{self.env.company.id}' + """ + if self.start_date: + query_cor += f""" AND account_move_line.date >= '{self.start_date}' + """ + if self.end_date: + query_cor += f""" AND account_move_line.date <= '{self.end_date}' + """ + query_cor += ( + " group by account_account.code,account_account.name," + "account_account.internal_group" + ) + self.env.cr.execute(query_cor) + cor = self.env.cr.dictfetchall() + total_cor = 0.0 + cor_lst = [] + for revenue in cor: + net = revenue["sum"] + cor_lst.append(net) + total_cor = sum(cor_lst) + query_expense = f""" + select account_account.code,account_account.name, + CONCAT(account_account.code, ' - ', account_account.name) AS + account_name,account_account.internal_group,sum(account_move_line.debit) + debit from account_move_line join account_account on account_account.id + = account_move_line.account_id where internal_group='expense' + AND account_move_line.company_id = '{self.env.company.id}' + """ + if self.start_date: + query_expense += f""" AND account_move_line.date >= + '{self.start_date}' """ + if self.end_date: + query_expense += f""" AND account_move_line.date <= + '{self.end_date}'""" + query_expense += ( + " group by account_account.code,account_account.name," + "account_account.internal_group" + ) + self.env.cr.execute(query_expense) + exp = self.env.cr.dictfetchall() + net_exp = 0.0 + total_exp = [] + for expense in exp: + net = expense["debit"] + total_exp.append(net) + net_exp = sum(total_exp) + query_depreciation = f""" + select account_account.code,account_account.name, + CONCAT(account_account.code, ' - ', account_account.name) + AS account_name, account_account.internal_group, + sum(account_move_line.credit) credit from account_move_line + join account_account on account_account.id = + account_move_line.account_id where internal_group + ='expense_depreciation' + AND account_move_line.company_id = '{self.env.company.id}' + """ + if self.start_date: + query_depreciation += f""" AND account_move_line.date >= + '{self.start_date}' """ + if self.end_date: + query_depreciation += f""" AND account_move_line.date <= + '{self.end_date}' """ + query_depreciation += ( + " group by account_account.code," + "account_account.name,account_account.internal_group" + ) + self.env.cr.execute(query_depreciation) + dep = self.env.cr.dictfetchall() + net_dep = 0.0 + total_dep = [] + for depreciation in dep: + net = depreciation["credit"] + total_dep.append(net) + net_dep = sum(total_dep) + net_profit = ( + (total_op_income + total_other_income) - total_cor - net_exp - net_dep + ) + total_expense = net_exp + net_dep + data = { + "start_date": self.start_date, + "end_date": self.end_date, + "net_profit": net_profit, + "income": total_op_income + total_other_income, + "gross_profit": total_op_income - total_cor, + "operating_income": op_income, + "total_op_income": total_op_income, + "cost_of_revenue": cor, + "total_cor": total_cor, + "other_income": other_income, + "total_other_income": total_other_income, + "net_expense": total_expense, + "expense": exp, + "total_expense": net_exp, + "depreciation": dep, + "total_depreciation": net_dep, + } + return self.env.ref("profit_and_loss_pdf_report.pl_report_pdf").report_action( + self, data=data + ) diff --git a/profit_and_loss_pdf_report/wizard/profit_loss_report_views.xml b/profit_and_loss_pdf_report/wizard/profit_loss_report_views.xml new file mode 100644 index 000000000..b434dd8b9 --- /dev/null +++ b/profit_and_loss_pdf_report/wizard/profit_loss_report_views.xml @@ -0,0 +1,39 @@ + + + + + profit.loss.report.view.form + profit.loss.report + +
+ + + + + + +
+
+
+
+
+ + + Profit Loss Report + profit.loss.report + list,form + + new + + + + +