diff --git a/salon_report_pdf_xls/__init__.py b/salon_report_pdf_xls/__init__.py new file mode 100644 index 000000000..380a53289 --- /dev/null +++ b/salon_report_pdf_xls/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import models +import report diff --git a/salon_report_pdf_xls/__openerp__.py b/salon_report_pdf_xls/__openerp__.py new file mode 100644 index 000000000..8cbb1fd25 --- /dev/null +++ b/salon_report_pdf_xls/__openerp__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Beauty Spa PDF and XLS', + 'summary': """PDF and XLS Reports For Beauty Spa Management Module""", + 'version': '9.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + "category": "Industries", + 'depends': ['salon_management', 'report_xlsx'], + 'data': ['views/salon_report_pdf_view.xml', + 'views/salon_reports_initialization.xml', + 'views/salon_report_wizard.xml', + 'views/salon_report_menu.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False, +} \ No newline at end of file diff --git a/salon_report_pdf_xls/models/__init__.py b/salon_report_pdf_xls/models/__init__.py new file mode 100644 index 000000000..5cd169053 --- /dev/null +++ b/salon_report_pdf_xls/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import salon_report_wizard +import salon_reports_parsers diff --git a/salon_report_pdf_xls/models/salon_report_wizard.py b/salon_report_pdf_xls/models/salon_report_wizard.py new file mode 100644 index 000000000..73dacef3e --- /dev/null +++ b/salon_report_pdf_xls/models/salon_report_wizard.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from openerp import models, fields, api, _ + + +class SalonReportMenu(models.TransientModel): + + _name = 'wizard.salon.report' + + chair_select = fields.Many2many('salon.chair', string="Chair") + user_select = fields.Many2many('res.users', string="User") + stage_select = fields.Many2many('salon.stages', string="Stage") + + @api.multi + def print_salon_report_pdf(self): + record = self.env['salon.order'].search([]) + return self.env['report'].get_action(record, "salon_report_pdf_xls.salon_report_pdf_details") + + @api.multi + def print_salon_report_xls(self): + context = self._context + datas = {'ids': context.get('active_ids', [])} + datas['model'] = 'salon.order' + datas['form'] = self.read()[0] + for field in datas['form'].keys(): + if isinstance(datas['form'][field], tuple): + datas['form'][field] = datas['form'][field][0] + return {'type': 'ir.actions.report.xml', + 'report_name': 'salon_report_pdf_xls.salon_report_xls.xlsx', + 'datas': datas, + 'name': 'Salon Report', + } \ No newline at end of file diff --git a/salon_report_pdf_xls/models/salon_reports_parsers.py b/salon_report_pdf_xls/models/salon_reports_parsers.py new file mode 100644 index 000000000..bc778fbe9 --- /dev/null +++ b/salon_report_pdf_xls/models/salon_reports_parsers.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from openerp.report import report_sxw +from openerp.osv import osv +from openerp.http import request + + +class SalonReportParser(report_sxw.rml_parse): + + def __init__(self, cr, uid, name, context=None): + + super(SalonReportParser, self).__init__(cr, uid, name, context=context) + + self.localcontext.update({ + 'get_salon_order_model': self.get_filtered_order_model, + 'get_total': self.get_total_sum, + }) + self.context = context + + def get_filtered_order_model(self): + wizard_record = request.env['wizard.salon.report'].search([])[-1] + chairs = wizard_record.chair_select + stages = wizard_record.stage_select + users = wizard_record.user_select + chairs_selected = [] + user_selected = [] + stage_selected = [] + for records in chairs: + chairs_selected.append(records.id) + for records in stages: + stage_selected.append(records.id) + for records in users: + user_selected.append(records.id) + if len(stage_selected) == 0: + if len(user_selected) == 0: + if len(chairs_selected) == 0: + salon_orders = wizard_record.env['salon.order'].search([]) + else: + salon_orders = wizard_record.env['salon.order'].search([('chair_id', 'in', chairs_selected)]) + else: + if len(chairs_selected) == 0: + salon_orders = wizard_record.env['salon.order'].search([('chair_user', 'in', user_selected)]) + else: + salon_orders = wizard_record.env['salon.order'].search([('chair_id', 'in', chairs_selected), + ('chair_user', 'in', user_selected)]) + else: + if len(user_selected) == 0: + if len(chairs_selected) == 0: + salon_orders = wizard_record.env['salon.order'].search([('stage_id', 'in', stage_selected)]) + else: + salon_orders = wizard_record.env['salon.order'].search([('chair_id', 'in', chairs_selected), + ('stage_id', 'in', stage_selected)]) + else: + if len(chairs_selected) == 0: + salon_orders = wizard_record.env['salon.order'].search([('chair_user', 'in', user_selected), + ('stage_id', 'in', stage_selected)]) + else: + salon_orders = wizard_record.env['salon.order'].search([('chair_id', 'in', chairs_selected), + ('chair_user', 'in', user_selected), + ('stage_id', 'in', stage_selected)]) + return salon_orders + + def get_total_sum(self, salon_orders): + sum = 0.0 + for records in salon_orders: + sum += records.price_subtotal + return sum + + +class PrintReportProject(osv.AbstractModel): + + _name = 'report.salon_report_pdf_xls.salon_report_pdf_details' + _inherit = 'report.abstract_report' + _template = 'salon_report_pdf_xls.salon_report_pdf_details' + _wrapped_report_class = SalonReportParser + + diff --git a/salon_report_pdf_xls/report/__init__.py b/salon_report_pdf_xls/report/__init__.py new file mode 100644 index 000000000..3b6dc0b19 --- /dev/null +++ b/salon_report_pdf_xls/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import salon_report_xls \ No newline at end of file diff --git a/salon_report_pdf_xls/report/salon_report_xls.py b/salon_report_pdf_xls/report/salon_report_xls.py new file mode 100644 index 000000000..4d8a1fd37 --- /dev/null +++ b/salon_report_pdf_xls/report/salon_report_xls.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx + + +class SalonReportXls(ReportXlsx): + + def generate_xlsx_report(self, workbook, data, lines): + company_details = lines.env['res.company'].browse(1) + chairs_selected = data['form']['chair_select'] + user_selected = data['form']['user_select'] + stage_selected = data['form']['stage_select'] + if len(stage_selected) == 0: + if len(user_selected) == 0: + if len(chairs_selected) == 0: + salon_orders = lines.env['salon.order'].search([]) + else: + salon_orders = lines.env['salon.order'].search([('chair_id', 'in', chairs_selected)]) + else: + if len(chairs_selected) == 0: + salon_orders = lines.env['salon.order'].search([('chair_user', 'in', user_selected)]) + else: + salon_orders = lines.env['salon.order'].search([('chair_id', 'in', chairs_selected), + ('chair_user', 'in', user_selected)]) + else: + if len(user_selected) == 0: + if len(chairs_selected) == 0: + salon_orders = lines.env['salon.order'].search([('stage_id', 'in', stage_selected)]) + else: + salon_orders = lines.env['salon.order'].search([('chair_id', 'in', chairs_selected), + ('stage_id', 'in', stage_selected)]) + else: + if len(chairs_selected) == 0: + salon_orders = lines.env['salon.order'].search([('chair_user', 'in', user_selected), + ('stage_id', 'in', stage_selected)]) + else: + salon_orders = lines.env['salon.order'].search([('chair_id', 'in', chairs_selected), + ('chair_user', 'in', user_selected), + ('stage_id', 'in', stage_selected)]) + sheet = workbook.add_worksheet() + format1 = workbook.add_format({'font_size': 22, 'bold': True, 'bg_color': '#D3D3D3'}) + format2 = workbook.add_format({'font_size': 12, 'bold': True, 'bg_color': '#D3D3D3'}) + format3 = workbook.add_format({'font_size': 10}) + format5 = workbook.add_format({'font_size': 10, 'bg_color': '#FFFFFF'}) + format1.set_align('center') + sheet.merge_range('A1:B1', company_details.name, format5) + sheet.merge_range('A2:B2', company_details.street, format5) + sheet.write('A3', company_details.city, format5) + sheet.write('B3', company_details.zip, format5) + sheet.merge_range('A4:B4', company_details.state_id.name, format5) + sheet.merge_range('A5:B5', company_details.country_id.name, format5) + sheet.merge_range('G1:H1', company_details.rml_header1, format5) + sheet.merge_range(5, 0, 6, 7, "Salon Orders", format1) + sheet.merge_range(7, 0, 7, 7, "", format3) + sheet.merge_range(8, 0, 8, 1, "Order", format2) + sheet.write(8, 2, "Chair", format2) + sheet.merge_range(8, 3, 8, 4, "User", format2) + sheet.write(8, 5, "Stage", format2) + sheet.merge_range(8, 6, 8, 7, "Total", format2) + row_number = 8 + sum = 0.0 + for records in salon_orders: + sum += records.price_subtotal + row_number += 1 + sheet.merge_range(row_number, 0, row_number, 1, records.name, format3) + sheet.write(row_number, 2, records.chair_id.name, format3) + sheet.merge_range(row_number, 3, row_number, 4, records.chair_user.name, format3) + sheet.write(row_number, 5, records.stage_id.name, format3) + sheet.merge_range(row_number, 6, row_number, 7, records.price_subtotal, format3) + sheet.merge_range(row_number+1, 0, row_number+1, 7, "", format3) + sheet.merge_range(row_number+2, 0, row_number+3, 3, "", format3) + sheet.merge_range(row_number+2, 4, row_number+3, 5, "Total", format2) + sheet.merge_range(row_number+2, 6, row_number+3, 7, sum, format2) + sheet.merge_range(0, 2, 4, 5, "", format5) + sheet.merge_range(1, 6, 4, 7, "", format5) +SalonReportXls('report.salon_report_pdf_xls.salon_report_xls.xlsx', 'salon.order') + diff --git a/salon_report_pdf_xls/static/description/banner.jpg b/salon_report_pdf_xls/static/description/banner.jpg new file mode 100644 index 000000000..8aae71e10 Binary files /dev/null and b/salon_report_pdf_xls/static/description/banner.jpg differ diff --git a/salon_report_pdf_xls/static/description/cybro_logo.png b/salon_report_pdf_xls/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/salon_report_pdf_xls/static/description/cybro_logo.png differ diff --git a/salon_report_pdf_xls/static/description/icon.png b/salon_report_pdf_xls/static/description/icon.png new file mode 100644 index 000000000..e9af9effd Binary files /dev/null and b/salon_report_pdf_xls/static/description/icon.png differ diff --git a/salon_report_pdf_xls/static/description/index.html b/salon_report_pdf_xls/static/description/index.html new file mode 100644 index 000000000..0c54adc1b --- /dev/null +++ b/salon_report_pdf_xls/static/description/index.html @@ -0,0 +1,101 @@ +
+
+

Beauty Spa Report PDF and XLS

+

XLS and PDF reports for Beauty Spa Management System.

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+
+ +
+
+

Overview

+

+ Beauty Spa Report PDF and XLS module is an extension of the Beauty Spa Management module + developed by Cybrosys Technologies. Beauty Spa Report PDF and XLS completely depends on + the Beauty spa Management module. When you install Beauty Spa Report PDF and XLS, New Menu 'Reports' is + created under Salon menu. When you click the 'Report' Menu, A wizard will open. + You can filter your report by Chair, User, and Stages. +

+
+
+ +
+
+
+
+
+
+

PDF Report

+
+
+ +
+
+
+
+ +
+
+

XLS Report

+
+
+ +
+
+
+
+ +
+
+

Filtered XLS Report

+
+
+ +
+ ☛ Here you can see only the orders related to 'Chair-1' +
+
+
+ +
+
+
+

+ If you want to analyze the working of Beauty spa Management Module, Click Here:

+
+ +
+
+
+ +
+

Need Any Help?

+ +
+ + + diff --git a/salon_report_pdf_xls/static/description/screenshot_salon_report_1.png b/salon_report_pdf_xls/static/description/screenshot_salon_report_1.png new file mode 100644 index 000000000..7377bda21 Binary files /dev/null and b/salon_report_pdf_xls/static/description/screenshot_salon_report_1.png differ diff --git a/salon_report_pdf_xls/static/description/screenshot_salon_report_2.png b/salon_report_pdf_xls/static/description/screenshot_salon_report_2.png new file mode 100644 index 000000000..85c260871 Binary files /dev/null and b/salon_report_pdf_xls/static/description/screenshot_salon_report_2.png differ diff --git a/salon_report_pdf_xls/static/description/screenshot_salon_report_3.png b/salon_report_pdf_xls/static/description/screenshot_salon_report_3.png new file mode 100644 index 000000000..b9e9c8ca5 Binary files /dev/null and b/salon_report_pdf_xls/static/description/screenshot_salon_report_3.png differ diff --git a/salon_report_pdf_xls/static/description/screenshot_salon_report_4.png b/salon_report_pdf_xls/static/description/screenshot_salon_report_4.png new file mode 100644 index 000000000..8383ecfc0 Binary files /dev/null and b/salon_report_pdf_xls/static/description/screenshot_salon_report_4.png differ diff --git a/salon_report_pdf_xls/views/salon_report_menu.xml b/salon_report_pdf_xls/views/salon_report_menu.xml new file mode 100644 index 000000000..59218864c --- /dev/null +++ b/salon_report_pdf_xls/views/salon_report_menu.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/salon_report_pdf_xls/views/salon_report_pdf_view.xml b/salon_report_pdf_xls/views/salon_report_pdf_view.xml new file mode 100644 index 000000000..cad322216 --- /dev/null +++ b/salon_report_pdf_xls/views/salon_report_pdf_view.xml @@ -0,0 +1,69 @@ + + + + \ No newline at end of file diff --git a/salon_report_pdf_xls/views/salon_report_wizard.xml b/salon_report_pdf_xls/views/salon_report_wizard.xml new file mode 100644 index 000000000..5dcbc4f44 --- /dev/null +++ b/salon_report_pdf_xls/views/salon_report_wizard.xml @@ -0,0 +1,38 @@ + + + + + report_wizard_view_form.form + wizard.salon.report + +
+ + + + + + + + + + + +
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/salon_report_pdf_xls/views/salon_reports_initialization.xml b/salon_report_pdf_xls/views/salon_reports_initialization.xml new file mode 100644 index 000000000..d0094a2bb --- /dev/null +++ b/salon_report_pdf_xls/views/salon_reports_initialization.xml @@ -0,0 +1,24 @@ + + + + + + + + +