diff --git a/profit_and_loss_pdf_report/README.rst b/profit_and_loss_pdf_report/README.rst new file mode 100755 index 000000000..8d9848d83 --- /dev/null +++ b/profit_and_loss_pdf_report/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-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 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + + +Credits +------- +Developer: (V17) 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..a6c5a7748 --- /dev/null +++ b/profit_and_loss_pdf_report/__manifest__.py @@ -0,0 +1,47 @@ +# -*- 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": "17.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..485ad9042 --- /dev/null +++ b/profit_and_loss_pdf_report/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 22.04.2024 +#### Version 17.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..e9a66b157 --- /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/capture (1).png b/profit_and_loss_pdf_report/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/capture (1).png differ 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/img.png b/profit_and_loss_pdf_report/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/img.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/photo-capture.png b/profit_and_loss_pdf_report/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/icons/photo-capture.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/Cybrosys R.png b/profit_and_loss_pdf_report/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/misc/Cybrosys R.png differ diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/email.svg b/profit_and_loss_pdf_report/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/phone.svg b/profit_and_loss_pdf_report/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/star (1) 2.svg b/profit_and_loss_pdf_report/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/support (1) 1.svg b/profit_and_loss_pdf_report/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/support-email.svg b/profit_and_loss_pdf_report/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/tick-mark.svg b/profit_and_loss_pdf_report/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp 1.svg b/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp.svg b/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..5be12e731 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..d445c1ce0 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..382a381b5 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..6ac3c0623 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.png b/profit_and_loss_pdf_report/static/description/assets/modules/5.png new file mode 100644 index 000000000..58c25d09f Binary files /dev/null and b/profit_and_loss_pdf_report/static/description/assets/modules/5.png 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..f52018e60 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..9c6fb0633 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..23e92a881 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..641c9ca62 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..47ca58561 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..2682b3f9e 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..cc7361e04 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..4818a224f --- /dev/null +++ b/profit_and_loss_pdf_report/static/description/index.html @@ -0,0 +1,528 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+
+
+
+
+

+ Profit And Loss PDF Report

+

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

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Added a new menu for creating Profit and loss report. +

+
+
+
+
+
+
+ +
+
+

The User can generate a profit and loss report for a specific period between two dates. +

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

+ Invoicing -> Reporting -> Profit and Loss Report- New menu is added for printing Profit and Loss Report.

+
+
+
+
+
+
+ +
+
+

+ Wizard to choose Start Date and End Date.

+
+
+
+
+
+
+ +
+
+

+ Profit and Loss Report.

+
+
+
+
+
+
+
    +
  • + Profit and Loss PDF Report in community. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:22 April 2024 +
+

+ Initial Commit for Profit And Loss PDF Report

+
+
+
+
+
+
+
+

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/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..767bbc7b3 --- /dev/null +++ b/profit_and_loss_pdf_report/wizard/profit_loss_report.py @@ -0,0 +1,209 @@ +# -*- 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" + "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 ->> 'en_US' , + CONCAT(account_account.code, ' - ',account_account.name ->> 'en_US' ) + AS account_name,account_account.account_type, + sum(account_move_line.credit) + from account_move_line join account_account on account_account.id = + account_move_line.account_id + where account_type='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 ->> 'en_US' ," + "account_account.account_type" + ) + 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 ->> 'en_US' , + CONCAT(account_account.code, ' - ', account_account.name ->> 'en_US' ) AS + account_name,account_account.account_type,sum(account_move_line.credit) + from account_move_line join account_account on + account_account.id = account_move_line.account_id + where account_type='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 ->> 'en_US' ,account_account.account_type" + ) + 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 ->> 'en_US' , + CONCAT(account_account.code, ' - ',account_account.name ->> 'en_US' ) + AS account_name,account_account.account_type, + sum(account_move_line.credit) + from account_move_line join account_account on account_account.id = + account_move_line.account_id + where account_type='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 ->> 'en_US' ," + "account_account.account_type" + ) + 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 ->> 'en_US' , + CONCAT(account_account.code, ' - ', account_account.name ->> 'en_US' ) AS + account_name,account_account.account_type,sum(account_move_line.debit) + debit from account_move_line join account_account on account_account.id + = account_move_line.account_id where account_type='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 ->> 'en_US' ," + "account_account.account_type" + ) + 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 ->> 'en_US' , + CONCAT(account_account.code, ' - ', account_account.name ->> 'en_US' ) + AS account_name, account_account.account_type, + sum(account_move_line.credit) credit from account_move_line + join account_account on account_account.id = + account_move_line.account_id where account_type + ='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 ->> 'en_US' ,account_account.account_type" + ) + 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 + + + + +