diff --git a/statement_report/README.rst b/statement_report/README.rst new file mode 100644 index 000000000..bac060b20 --- /dev/null +++ b/statement_report/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/opl-1.0-standalone.html + :alt: License: LGPL-3 + +Customer/ Supplier Payment Statement Report +======================= +This module allow to view and send payment statement report in pdf and xlsx format, for both invoices and bills. + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: Ayisha Sumayya K @cybrosys, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html) + +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/statement_report/__init__.py b/statement_report/__init__.py new file mode 100644 index 000000000..0869530ac --- /dev/null +++ b/statement_report/__init__.py @@ -0,0 +1,24 @@ +""" init file for statement report module """ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayisha Sumayya K (odoo@cybrosys.com) +# +# 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 controllers +from . import models diff --git a/statement_report/__manifest__.py b/statement_report/__manifest__.py new file mode 100644 index 000000000..cf19c7a23 --- /dev/null +++ b/statement_report/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayisha Sumayya K (odoo@cybrosys.com) +# +# 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': 'Customer/ Supplier Payment Statement Report', + 'version': '16.0.1.0.0', + 'category': 'Productivity', + 'summary': """Customer/ Supplier Payment Statement Report for Odoo 16""", + 'description': """ This module help you to get Customer/ Supplier + Payment Statement Report """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'account', 'contacts'], + 'data': [ + 'data/ir_cron_data.xml', + 'views/res_partner_views.xml', + 'report/report_template.xml', + ], + 'assets': { + 'web.assets_backend': [ + '/statement_report/static/src/js/action_manager.js', + ] + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'auto_install': False, + 'installable': True, + 'application': False +} diff --git a/statement_report/controllers/__init__.py b/statement_report/controllers/__init__.py new file mode 100644 index 000000000..d96fb44cc --- /dev/null +++ b/statement_report/controllers/__init__.py @@ -0,0 +1,23 @@ +""" init file for controller """ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayisha Sumayya K (odoo@cybrosys.com) +# +# 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 statement_report diff --git a/statement_report/controllers/statement_report.py b/statement_report/controllers/statement_report.py new file mode 100644 index 000000000..7de56da20 --- /dev/null +++ b/statement_report/controllers/statement_report.py @@ -0,0 +1,56 @@ +""" controller for xlsx report """ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayisha Sumayya K (odoo@cybrosys.com) +# +# 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 . +# +############################################################################# +import json +from odoo import http +from odoo.http import content_disposition, request +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """ controller for xlsx report """ + + @http.route('/xlsx_report', type='http', auth='user', methods=['POST'], + csrf=False) + def get_report_xlsx(self, model, options, output_format, report_name): + """ get xlsx report data """ + + report_obj = request.env[model].sudo() + options = json.loads(options) + try: + if output_format == 'xlsx': + response = request.make_response( + None, headers=[ + ('Content-Type', 'application/vnd.ms-excel'), + ('Content-Disposition', content_disposition( + report_name + '.xlsx'))]) + report_obj.get_xlsx_report(options, response) + response.set_cookie('fileToken', 'dummy token') + return response + except Exception as event: + serialize = http.serialize_exception(event) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': serialize + } + return request.make_response(html_escape(json.dumps(error))) diff --git a/statement_report/data/ir_cron_data.xml b/statement_report/data/ir_cron_data.xml new file mode 100644 index 000000000..dca153614 --- /dev/null +++ b/statement_report/data/ir_cron_data.xml @@ -0,0 +1,32 @@ + + + + + + Weekly Statement Report + + code + model.auto_week_statement_report() + + 1 + weeks + + -1 + + + + + + Monthly Statement Report + + code + model.auto_month_statement_report() + + 1 + months + + -1 + + + + \ No newline at end of file diff --git a/statement_report/doc/RELEASE_NOTES.md b/statement_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..acd24de3e --- /dev/null +++ b/statement_report/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 16.02.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for Customer/ Supplier Payment Statement Report diff --git a/statement_report/models/__init__.py b/statement_report/models/__init__.py new file mode 100644 index 000000000..5f46cee82 --- /dev/null +++ b/statement_report/models/__init__.py @@ -0,0 +1,23 @@ +""" init file for models """ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayisha Sumayya K (odoo@cybrosys.com) +# +# 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 res_partner diff --git a/statement_report/models/res_partner.py b/statement_report/models/res_partner.py new file mode 100644 index 000000000..771ae7738 --- /dev/null +++ b/statement_report/models/res_partner.py @@ -0,0 +1,914 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Ayisha Sumayya K (odoo@cybrosys.com) +# +# 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 . +# +############################################################################# +import base64 +import io +import json +import xlsxwriter +from odoo import fields, models +from odoo.exceptions import ValidationError +from odoo.tools import date_utils + + +class Partner(models.Model): + """ class for adding report options in 'res.partner' """ + _inherit = 'res.partner' + + customer_report_ids = fields.Many2many( + 'account.move', + compute='_compute_customer_report_ids', + help='partner invoices') + vendor_statement_ids = fields.Many2many( + 'account.move', + compute='_compute_vendor_statement_ids', + help='partner bills') + currency_id = fields.Many2one( + 'res.currency', + default=lambda self: self.env.company.currency_id.id, + help="currency" + ) + + def _compute_customer_report_ids(self): + """ for computing 'invoices' of partner""" + inv_ids = self.env['account.move'].search( + [('partner_id', '=', self.id), + ('move_type', '=', 'out_invoice'), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]).ids + self.customer_report_ids = inv_ids + + def _compute_vendor_statement_ids(self): + """ for computing 'bills' of partner """ + bill_ids = self.env['account.move'].search( + [('partner_id', '=', self.id), + ('move_type', '=', 'in_invoice'), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]).ids + self.vendor_statement_ids = bill_ids + + def main_query(self): + """return select query""" + query = """SELECT name , invoice_date, invoice_date_due, + amount_total_signed AS sub_total, + amount_residual_signed AS amount_due , + amount_residual AS balance + FROM account_move WHERE payment_state != 'paid' + AND state ='posted' AND partner_id= '%s' + AND company_id = '%s' """ % (self.id, self.env.company.id) + return query + + def amount_query(self): + """return query for calculating total amount""" + amount_query = """ SELECT SUM(amount_total_signed) AS total, + SUM(amount_residual) AS balance + FROM account_move WHERE payment_state != 'paid' + AND state ='posted' AND partner_id= '%s' + AND company_id = '%s' """ % (self.id, self.env.company.id) + return amount_query + + def action_share_pdf(self): + """ action for sharing customer pdf report""" + if self.customer_report_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('out_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('out_invoice')""" + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + report = self.env[ + 'ir.actions.report' + ].sudo()._render_qweb_pdf( + 'statement_report.res_partner_action', + self, data=data) + data_record = base64.b64encode(report[0]) + ir_values = { + 'name': 'Statement Report', + 'type': 'binary', + 'datas': data_record, + 'mimetype': 'application/pdf', + 'res_model': 'res.partner' + } + attachment = self.env['ir.attachment'].sudo().create(ir_values) + email_values = { + 'email_to': self.email, + 'subject': 'Payment Statement Report', + 'body_html': '

Dear Mr/Miss. ' + self.name + + '

We have attached your ' + 'payment statement. Please check

' + '

Best regards,

' + self.env.user.name, + 'attachment_ids': [attachment.id], + } + mail = self.env['mail.mail'].sudo().create(email_values) + mail.send() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': 'Email Sent Successfully', + 'type': 'success', + 'sticky': False + } + } + else: + raise ValidationError('There is no statement to send') + + def action_print_pdf(self): + """ action for printing pdf report""" + if self.customer_report_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('out_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('out_invoice')""" + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + return self.env.ref('statement_report.res_partner_action' + ).report_action(self, data=data) + else: + raise ValidationError('There is no statement to print') + + def action_print_xlsx(self): + """ action for printing xlsx report of customer """ + if self.customer_report_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('out_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('out_invoice')""" + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + return { + 'type': 'ir.actions.report', + 'data': { + 'model': 'res.partner', + 'options': json.dumps(data, + default=date_utils.json_default), + 'output_format': 'xlsx', + 'report_name': 'Payment Statement Report' + }, + 'report_type': 'xlsx', + } + else: + raise ValidationError('There is no statement to print') + + def get_xlsx_report(self, data, response): + """ get xlsx report data """ + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format_with_color = workbook.add_format({ + 'font_size': '14px', 'bold': True, + 'bg_color': 'yellow', 'border': 1}) + cell_format = workbook.add_format({'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + txt_border = workbook.add_format({'font_size': '13px', 'border': 1}) + head = workbook.add_format({'align': 'center', 'bold': True, + 'font_size': '22px'}) + sheet.merge_range('B2:Q4', 'Payment Statement Report', head) + + if data['customer']: + sheet.merge_range('B7:D7', 'Customer/Supplier : ', cell_format) + sheet.merge_range('E7:H7', data['customer'], txt) + sheet.merge_range('B9:C9', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], ) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + + sheet.merge_range('B15:C15', 'Date', cell_format_with_color) + sheet.merge_range('D15:G15', 'Invoice/Bill Number', + cell_format_with_color) + sheet.merge_range('H15:I15', 'Due Date', cell_format_with_color) + sheet.merge_range('J15:L15', 'Invoices/Debit', cell_format_with_color) + sheet.merge_range('M15:O15', 'Amount Due', cell_format_with_color) + sheet.merge_range('P15:R15', 'Balance Due', cell_format_with_color) + + row = 15 + column = 0 + for record in data['my_data']: + sub_total = data['currency'] + str(record['sub_total']) + amount_due = data['currency'] + str(record['amount_due']) + balance = data['currency'] + str(record['balance']) + total = data['currency'] + str(data['total']) + remain_balance = data['currency'] + str(data['balance']) + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], txt_border) + sheet.merge_range(row, column + 3, row, column + 6, + record['name'], txt_border) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], txt_border) + sheet.merge_range(row, column + 9, row, column + 11, + sub_total, txt_border) + sheet.merge_range(row, column + 12, row, column + 14, + amount_due, txt_border) + sheet.merge_range(row, column + 15, row, column + 17, + balance, txt_border) + row = row + 1 + sheet.write(row + 2, column + 1, 'Total Amount: ', cell_format) + sheet.merge_range(row + 2, column + 3, row + 2, column + 4, + total, txt) + sheet.write(row + 4, column + 1, 'Balance Due: ', cell_format) + sheet.merge_range(row + 4, column + 3, row + 4, column + 4, + remain_balance, txt) + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() + + def action_share_xlsx(self): + """ action for sharing xlsx report via email""" + if self.customer_report_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('out_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('out_invoice')""" + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format({ + 'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '22px'}) + sheet.merge_range('B2:P4', 'Payment Statement Report', head) + date_style = workbook.add_format( + {'text_wrap': True, 'align': 'center', + 'num_format': 'yyyy-mm-dd'}) + + if data['customer']: + sheet.write('B7:C7', 'Customer : ', cell_format) + sheet.merge_range('D7:G7', data['customer'], txt) + sheet.write('B9:C7', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], txt) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + sheet.write('B15', 'Date', cell_format) + sheet.write('D15', 'Invoice/Bill Number', cell_format) + sheet.write('H15', 'Due Date', cell_format) + sheet.write('J15', 'Invoices/Debit', cell_format) + sheet.write('M15', 'Amount Due', cell_format) + sheet.write('P15', 'Balance Due', cell_format) + row = 16 + column = 0 + for record in data['my_data']: + sub_total = data['currency'] + str(record['sub_total']) + amount_due = data['currency'] + str(record['amount_due']) + balance = data['currency'] + str(record['balance']) + total = data['currency'] + str(data['total']) + remain_balance = data['currency'] + str(data['balance']) + + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], date_style) + sheet.merge_range(row, column + 3, row, column + 5, + record['name'], txt) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], date_style) + sheet.merge_range(row, column + 9, row, column + 10, + sub_total, txt) + sheet.merge_range(row, column + 12, row, column + 13, + amount_due, txt) + sheet.merge_range(row, column + 15, row, column + 16, + balance, txt) + row = row + 1 + sheet.write(row + 2, column + 1, 'Total Amount : ', cell_format) + sheet.merge_range(row + 2, column + 4, row + 2, column + 5, + total, txt) + sheet.write(row + 4, column + 1, 'Balance Due : ', cell_format) + sheet.merge_range(row + 4, column + 4, row + 4, column + 5, + remain_balance, txt) + workbook.close() + output.seek(0) + xlsx = base64.b64encode(output.read()) + output.close() + ir_values = { + 'name': "Statement Report", + 'type': 'binary', + 'datas': xlsx, + 'store_fname': xlsx, + } + attachment = self.env['ir.attachment'].sudo().create(ir_values) + email_values = { + 'email_to': self.email, + 'subject': 'Payment Statement Report', + 'body_html': '

Dear Mr/Miss. ' + self.name + + '

We have attached your' + ' payment statement. Please check

' + '

Best regards,

' + self.env.user.name, + 'attachment_ids': [attachment.id], + } + mail = self.env['mail.mail'].sudo().create(email_values) + mail.send() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': 'Email Sent Successfully', + 'type': 'success', + 'sticky': False + } + } + else: + raise ValidationError('There is no statement to send') + + def auto_week_statement_report(self): + """ action for sending automatic weekly statement + of both pdf and xlsx report """ + + partner = [] + invoice = self.env['account.move'].search( + [('move_type', 'in', ['out_invoice', 'in_invoice']), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]) + + for inv in invoice: + if inv.partner_id not in partner: + partner.append(inv.partner_id) + + for rec in partner: + if rec.id: + main_query = """ SELECT name , invoice_date, invoice_date_due, + amount_total_signed AS sub_total, + amount_residual_signed AS amount_due , + amount_residual AS balance + FROM account_move WHERE move_type + IN ('out_invoice', 'in_invoice') + AND state ='posted' AND payment_state != 'paid' + AND company_id = '%s' AND partner_id = '%s' + GROUP BY name, invoice_date, invoice_date_due, + amount_total_signed, amount_residual_signed, + amount_residual + ORDER by name DESC""" % (self.env.company.id, rec.id) + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + data = { + 'customer': rec.display_name, + 'street': rec.street, + 'street2': rec.street2, + 'city': rec.city, + 'state': rec.state_id.name, + 'zip': rec.zip, + 'my_data': main, + } + report = self.env['ir.actions.report']._render_qweb_pdf( + 'statement_report.res_partner_action', + self, data=data) + data_record = base64.b64encode(report[0]) + ir_values = { + 'name': 'Statement Report', + 'type': 'binary', + 'datas': data_record, + 'mimetype': 'application/pdf', + 'res_model': 'res.partner', + } + attachment1 = self.env[ + 'ir.attachment'].sudo().create(ir_values) + + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format( + {'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '22px'}) + sheet.merge_range('B2:P4', 'Payment Statement Report', head) + date_style = workbook.add_format( + {'text_wrap': True, 'align': 'center', + 'num_format': 'yyyy-mm-dd'}) + + if data['customer']: + sheet.write('B7:D7', 'Customer/Supplier : ', cell_format) + sheet.merge_range('E7:H7', data['customer'], txt) + sheet.write('B9:C7', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], txt) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + + sheet.write('B15', 'Date', cell_format) + sheet.write('D15', 'Invoice/Bill Number', cell_format) + sheet.write('H15', 'Due Date', cell_format) + sheet.write('J15', 'Invoices/Debit', cell_format) + sheet.write('M15', 'Amount Due', cell_format) + sheet.write('P15', 'Balance Due', cell_format) + + row = 16 + column = 0 + + for record in data['my_data']: + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], date_style) + sheet.merge_range(row, column + 3, row, column + 5, + record['name'], txt) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], date_style) + sheet.merge_range(row, column + 9, row, column + 10, + record['sub_total'], txt) + sheet.merge_range(row, column + 12, row, column + 13, + record['amount_due'], txt) + sheet.merge_range(row, column + 15, row, column + 16, + record['balance'], txt) + row = row + 1 + workbook.close() + output.seek(0) + xlsx = base64.b64encode(output.read()) + output.close() + ir_values = { + 'name': "Statement Report", + 'type': 'binary', + 'datas': xlsx, + 'store_fname': xlsx, + } + attachment2 = self.env['ir.attachment'].sudo().create( + ir_values) + email_values = { + 'email_to': rec.email, + 'subject': 'Weekly Payment Statement Report', + 'body_html': '

Dear Mr/Miss. ' + rec.name + + '

We have attached your ' + 'payment statement. Please check

' + 'Best regards,

' + self.env.user.name, + 'attachment_ids': [attachment1.id, attachment2.id] + } + mail = self.env['mail.mail'].sudo().create(email_values) + mail.send() + + def auto_month_statement_report(self): + """ action for sending automatic monthly statement report + of both pdf and xlsx report""" + + partner = [] + invoice = self.env['account.move'].search( + [('move_type', 'in', ['out_invoice', 'in_invoice']), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]) + + for inv in invoice: + if inv.partner_id not in partner: + partner.append(inv.partner_id) + + for rec in partner: + if rec.id: + main_query = """SELECT name , invoice_date, invoice_date_due, + amount_total_signed AS sub_total, + amount_residual_signed AS amount_due , + amount_residual AS balance + FROM account_move WHERE move_type + IN ('out_invoice', 'in_invoice') + AND state ='posted' + AND payment_state != 'paid' + AND company_id = '%s' AND partner_id = '%s' + GROUP BY name, invoice_date, invoice_date_due, + amount_total_signed, amount_residual_signed, + amount_residual + ORDER by name DESC""" % (self.env.company.id, rec.id) + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + data = { + 'customer': rec.display_name, + 'street': rec.street, + 'street2': rec.street2, + 'city': rec.city, + 'state': rec.state_id.name, + 'zip': rec.zip, + 'my_data': main, + } + report = self.env['ir.actions.report']._render_qweb_pdf( + 'statement_report.res_partner_action', + self, data=data) + data_record = base64.b64encode(report[0]) + ir_values = { + 'name': 'Statement Report', + 'type': 'binary', + 'datas': data_record, + 'mimetype': 'application/pdf', + 'res_model': 'res.partner', + } + attachment1 = self.env['ir.attachment'].sudo().create( + ir_values) + # FOR XLSX + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format( + {'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '22px'}) + sheet.merge_range('B2:P4', 'Payment Statement Report', head) + date_style = workbook.add_format( + {'text_wrap': True, 'align': 'center', + 'num_format': 'yyyy-mm-dd'}) + + if data['customer']: + sheet.write('B7:D7', 'Customer/Supplier : ', cell_format) + sheet.merge_range('E7:H7', data['customer'], txt) + sheet.write('B9:C7', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], txt) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + + sheet.write('B15', 'Date', cell_format) + sheet.write('D15', 'Invoice/Bill Number', cell_format) + sheet.write('H15', 'Due Date', cell_format) + sheet.write('J15', 'Invoices/Debit', cell_format) + sheet.write('M15', 'Amount Due', cell_format) + sheet.write('P15', 'Balance Due', cell_format) + + row = 16 + column = 0 + + for record in data['my_data']: + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], date_style) + sheet.merge_range(row, column + 3, row, column + 5, + record['name'], txt) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], date_style) + sheet.merge_range(row, column + 9, row, column + 10, + record['sub_total'], txt) + sheet.merge_range(row, column + 12, row, column + 13, + record['amount_due'], txt) + sheet.merge_range(row, column + 15, row, column + 16, + record['balance'], txt) + row = row + 1 + workbook.close() + output.seek(0) + xlsx = base64.b64encode(output.read()) + output.close() + ir_values = { + 'name': "Statement Report", + 'type': 'binary', + 'datas': xlsx, + 'store_fname': xlsx, + } + attachment2 = self.env['ir.attachment'].sudo().create( + ir_values) + email_values = { + 'email_to': rec.email, + 'subject': 'Monthly Payment Statement Report', + 'body_html': '

Dear Mr/Miss. ' + rec.name + + '

We have attached your ' + 'payment statement. ' + 'Please check

Best regards,' + '

' + self.env.user.name, + 'attachment_ids': [attachment1.id, attachment2.id] + } + mail = self.env['mail.mail'].sudo().create(email_values) + mail.send() + + def action_vendor_print_pdf(self): + """ action for printing vendor pdf report """ + if self.vendor_statement_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('in_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('in_invoice')""" + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + return self.env.ref( + 'statement_report.res_partner_action').report_action( + self, data=data) + else: + raise ValidationError('There is no statement to print') + + def action_vendor_share_pdf(self): + """ action for sharing pdf report of vendor via email """ + if self.vendor_statement_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('in_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('in_invoice')""" + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + report = self.env['ir.actions.report'].sudo()._render_qweb_pdf( + 'statement_report.res_partner_action', self, data=data) + data_record = base64.b64encode(report[0]) + ir_values = { + 'name': 'Statement Report', + 'type': 'binary', + 'datas': data_record, + 'mimetype': 'application/pdf', + 'res_model': 'res.partner' + } + attachment = self.env['ir.attachment'].sudo().create(ir_values) + + email_values = { + 'email_to': self.email, + 'subject': 'Payment Statement Report', + 'body_html': '

Dear Mr/Miss. ' + self.name + + '

We have attached' + ' your payment statement. Please check

' + '

Best regards,

' + self.env.user.name, + 'attachment_ids': [attachment.id], + } + mail = self.env['mail.mail'].sudo().create(email_values) + mail.send() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': 'Email Sent Successfully', + 'type': 'success', + 'sticky': False + } + } + else: + raise ValidationError('There is no statement to send') + + def action_vendor_print_xlsx(self): + """ action for printing xlsx report of vendor """ + if self.vendor_statement_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('in_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('in_invoice')""" + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + return { + 'type': 'ir.actions.report', + 'data': { + 'model': 'res.partner', + 'options': json.dumps(data, + default=date_utils.json_default), + 'output_format': 'xlsx', + 'report_name': 'Payment Statement Report' + }, + 'report_type': 'xlsx', + } + else: + raise ValidationError('There is no statement to print') + + def action_vendor_share_xlsx(self): + """ action for sharing vendor xlsx report via email """ + if self.vendor_statement_ids: + main_query = self.main_query() + main_query += """ AND move_type IN ('in_invoice')""" + amount = self.amount_query() + amount += """ AND move_type IN ('in_invoice')""" + + self.env.cr.execute(main_query) + main = self.env.cr.dictfetchall() + self.env.cr.execute(amount) + amount = self.env.cr.dictfetchall() + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format({ + 'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '22px'}) + sheet.merge_range('B2:P4', 'Payment Statement Report', head) + date_style = workbook.add_format({ + 'text_wrap': True, 'align': 'center', + 'num_format': 'yyyy-mm-dd'}) + if data['customer']: + sheet.write('B7:C7', 'Supplier : ', cell_format) + sheet.merge_range('D7:G7', data['customer'], txt) + sheet.write('B9:C7', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], txt) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + sheet.write('B15', 'Date', cell_format) + sheet.write('D15', 'Invoice/Bill Number', cell_format) + sheet.write('H15', 'Due Date', cell_format) + sheet.write('J15', 'Invoices/Debit', cell_format) + sheet.write('M15', 'Amount Due', cell_format) + sheet.write('P15', 'Balance Due', cell_format) + + row = 16 + column = 0 + for record in data['my_data']: + sub_total = data['currency'] + str(record['sub_total']) + amount_due = data['currency'] + str(record['amount_due']) + balance = data['currency'] + str(record['balance']) + total = data['currency'] + str(data['total']) + remain_balance = data['currency'] + str(data['balance']) + + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], date_style) + sheet.merge_range(row, column + 3, row, column + 5, + record['name'], txt) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], date_style) + sheet.merge_range(row, column + 9, row, column + 10, + sub_total, txt) + sheet.merge_range(row, column + 12, row, column + 13, + amount_due, txt) + sheet.merge_range(row, column + 15, row, column + 16, + balance, txt) + row = row + 1 + + sheet.write(row + 2, column + 1, 'Total Amount : ', cell_format) + sheet.merge_range(row + 2, column + 4, row + 2, column + 5, + total, txt) + sheet.write(row + 4, column + 1, 'Balance Due : ', cell_format) + sheet.merge_range(row + 4, column + 4, row + 4, column + 5, + remain_balance, txt) + + workbook.close() + output.seek(0) + xlsx = base64.b64encode(output.read()) + output.close() + ir_values = { + 'name': "Statement Report", + 'type': 'binary', + 'datas': xlsx, + 'store_fname': xlsx, + } + attachment = self.env['ir.attachment'].sudo().create(ir_values) + + email_values = { + 'email_to': self.email, + 'subject': 'Payment Statement Report', + 'body_html': '

Dear Mr/Miss. ' + self.name + + '

We have attached your ' + 'payment statement. Please check

' + '

Best regards,

' + self.env.user.name, + 'attachment_ids': [attachment.id], + } + mail = self.env['mail.mail'].sudo().create(email_values) + mail.send() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': 'Email Sent Successfully', + 'type': 'success', + 'sticky': False + } + } + else: + raise ValidationError('There is no statement to send') diff --git a/statement_report/report/report_template.xml b/statement_report/report/report_template.xml new file mode 100644 index 000000000..bd6a5082b --- /dev/null +++ b/statement_report/report/report_template.xml @@ -0,0 +1,88 @@ + + + + + Statement Report + res.partner + qweb-pdf + statement_report.res_partner_statement_report_template + statement_report.res_partner_statement_report_template + 'Statement Report- %s' %(object.name) + + report + + + + + \ No newline at end of file diff --git a/statement_report/static/description/assets/icons/check.png b/statement_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/statement_report/static/description/assets/icons/check.png differ diff --git a/statement_report/static/description/assets/icons/chevron.png b/statement_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/statement_report/static/description/assets/icons/chevron.png differ diff --git a/statement_report/static/description/assets/icons/cogs.png b/statement_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/statement_report/static/description/assets/icons/cogs.png differ diff --git a/statement_report/static/description/assets/icons/consultation.png b/statement_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/statement_report/static/description/assets/icons/consultation.png differ diff --git a/statement_report/static/description/assets/icons/ecom-black.png b/statement_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/statement_report/static/description/assets/icons/ecom-black.png differ diff --git a/statement_report/static/description/assets/icons/education-black.png b/statement_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/statement_report/static/description/assets/icons/education-black.png differ diff --git a/statement_report/static/description/assets/icons/hotel-black.png b/statement_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/statement_report/static/description/assets/icons/hotel-black.png differ diff --git a/statement_report/static/description/assets/icons/license.png b/statement_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/statement_report/static/description/assets/icons/license.png differ diff --git a/statement_report/static/description/assets/icons/lifebuoy.png b/statement_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/statement_report/static/description/assets/icons/lifebuoy.png differ diff --git a/statement_report/static/description/assets/icons/manufacturing-black.png b/statement_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/statement_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/statement_report/static/description/assets/icons/pos-black.png b/statement_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/statement_report/static/description/assets/icons/pos-black.png differ diff --git a/statement_report/static/description/assets/icons/puzzle.png b/statement_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/statement_report/static/description/assets/icons/puzzle.png differ diff --git a/statement_report/static/description/assets/icons/restaurant-black.png b/statement_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/statement_report/static/description/assets/icons/restaurant-black.png differ diff --git a/statement_report/static/description/assets/icons/service-black.png b/statement_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/statement_report/static/description/assets/icons/service-black.png differ diff --git a/statement_report/static/description/assets/icons/trading-black.png b/statement_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/statement_report/static/description/assets/icons/trading-black.png differ diff --git a/statement_report/static/description/assets/icons/training.png b/statement_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/statement_report/static/description/assets/icons/training.png differ diff --git a/statement_report/static/description/assets/icons/update.png b/statement_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/statement_report/static/description/assets/icons/update.png differ diff --git a/statement_report/static/description/assets/icons/user.png b/statement_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/statement_report/static/description/assets/icons/user.png differ diff --git a/statement_report/static/description/assets/icons/wrench.png b/statement_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/statement_report/static/description/assets/icons/wrench.png differ diff --git a/statement_report/static/description/assets/misc/categories.png b/statement_report/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/statement_report/static/description/assets/misc/categories.png differ diff --git a/statement_report/static/description/assets/misc/check-box.png b/statement_report/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/statement_report/static/description/assets/misc/check-box.png differ diff --git a/statement_report/static/description/assets/misc/compass.png b/statement_report/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/statement_report/static/description/assets/misc/compass.png differ diff --git a/statement_report/static/description/assets/misc/corporate.png b/statement_report/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/statement_report/static/description/assets/misc/corporate.png differ diff --git a/statement_report/static/description/assets/misc/customer-support.png b/statement_report/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/statement_report/static/description/assets/misc/customer-support.png differ diff --git a/statement_report/static/description/assets/misc/cybrosys-logo.png b/statement_report/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/statement_report/static/description/assets/misc/cybrosys-logo.png differ diff --git a/statement_report/static/description/assets/misc/features.png b/statement_report/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/statement_report/static/description/assets/misc/features.png differ diff --git a/statement_report/static/description/assets/misc/logo.png b/statement_report/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/statement_report/static/description/assets/misc/logo.png differ diff --git a/statement_report/static/description/assets/misc/pictures.png b/statement_report/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/statement_report/static/description/assets/misc/pictures.png differ diff --git a/statement_report/static/description/assets/misc/pie-chart.png b/statement_report/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/statement_report/static/description/assets/misc/pie-chart.png differ diff --git a/statement_report/static/description/assets/misc/right-arrow.png b/statement_report/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/statement_report/static/description/assets/misc/right-arrow.png differ diff --git a/statement_report/static/description/assets/misc/star.png b/statement_report/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/statement_report/static/description/assets/misc/star.png differ diff --git a/statement_report/static/description/assets/misc/support.png b/statement_report/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/statement_report/static/description/assets/misc/support.png differ diff --git a/statement_report/static/description/assets/misc/whatsapp.png b/statement_report/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/statement_report/static/description/assets/misc/whatsapp.png differ diff --git a/statement_report/static/description/assets/modules/module_image.gif b/statement_report/static/description/assets/modules/module_image.gif new file mode 100644 index 000000000..8f40aab85 Binary files /dev/null and b/statement_report/static/description/assets/modules/module_image.gif differ diff --git a/statement_report/static/description/assets/modules/w1.png b/statement_report/static/description/assets/modules/w1.png new file mode 100644 index 000000000..9f212d091 Binary files /dev/null and b/statement_report/static/description/assets/modules/w1.png differ diff --git a/statement_report/static/description/assets/modules/w2 - Copy.png b/statement_report/static/description/assets/modules/w2 - Copy.png new file mode 100644 index 000000000..11994cc96 Binary files /dev/null and b/statement_report/static/description/assets/modules/w2 - Copy.png differ diff --git a/statement_report/static/description/assets/modules/w3.png b/statement_report/static/description/assets/modules/w3.png new file mode 100644 index 000000000..077cada55 Binary files /dev/null and b/statement_report/static/description/assets/modules/w3.png differ diff --git a/statement_report/static/description/assets/modules/w4.png b/statement_report/static/description/assets/modules/w4.png new file mode 100644 index 000000000..682689163 Binary files /dev/null and b/statement_report/static/description/assets/modules/w4.png differ diff --git a/statement_report/static/description/assets/modules/w5.png b/statement_report/static/description/assets/modules/w5.png new file mode 100644 index 000000000..8cb8bf634 Binary files /dev/null and b/statement_report/static/description/assets/modules/w5.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot1.png b/statement_report/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..d380fc62b Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot1.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot10.png b/statement_report/static/description/assets/screenshots/Screenshot10.png new file mode 100644 index 000000000..ff3fea6f0 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot10.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot11.png b/statement_report/static/description/assets/screenshots/Screenshot11.png new file mode 100644 index 000000000..6f46c2df8 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot11.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot12.png b/statement_report/static/description/assets/screenshots/Screenshot12.png new file mode 100644 index 000000000..4c4ccb701 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot12.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot13.png b/statement_report/static/description/assets/screenshots/Screenshot13.png new file mode 100644 index 000000000..6d656ad37 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot13.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot14.png b/statement_report/static/description/assets/screenshots/Screenshot14.png new file mode 100644 index 000000000..706f3bb36 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot14.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot15.png b/statement_report/static/description/assets/screenshots/Screenshot15.png new file mode 100644 index 000000000..4a48915aa Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot15.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot2.png b/statement_report/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..46aa0f1cd Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot2.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot3.png b/statement_report/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..7a1ef420a Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot3.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot4.png b/statement_report/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..78841503d Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot4.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot5.png b/statement_report/static/description/assets/screenshots/Screenshot5.png new file mode 100644 index 000000000..292dd0216 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot5.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot6.png b/statement_report/static/description/assets/screenshots/Screenshot6.png new file mode 100644 index 000000000..7365c7fb7 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot6.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot7.png b/statement_report/static/description/assets/screenshots/Screenshot7.png new file mode 100644 index 000000000..19974c5ac Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot7.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot8.png b/statement_report/static/description/assets/screenshots/Screenshot8.png new file mode 100644 index 000000000..e596b8a66 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot8.png differ diff --git a/statement_report/static/description/assets/screenshots/Screenshot9.png b/statement_report/static/description/assets/screenshots/Screenshot9.png new file mode 100644 index 000000000..781b4f67c Binary files /dev/null and b/statement_report/static/description/assets/screenshots/Screenshot9.png differ diff --git a/statement_report/static/description/assets/screenshots/v16-hero.gif b/statement_report/static/description/assets/screenshots/v16-hero.gif new file mode 100644 index 000000000..1b91fd431 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/v16-hero.gif differ diff --git a/statement_report/static/description/banner.png b/statement_report/static/description/banner.png new file mode 100644 index 000000000..f5a45dac9 Binary files /dev/null and b/statement_report/static/description/banner.png differ diff --git a/statement_report/static/description/icon.png b/statement_report/static/description/icon.png new file mode 100644 index 000000000..56d29f0ad Binary files /dev/null and b/statement_report/static/description/icon.png differ diff --git a/statement_report/static/description/index.html b/statement_report/static/description/index.html new file mode 100644 index 000000000..ada0735d4 --- /dev/null +++ b/statement_report/static/description/index.html @@ -0,0 +1,634 @@ +

+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +

Customer/ Supplier Payment Statement Report

+

This system is designed to manage all customer and/or supplier payment statement reports.

+ + + +
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This system is designed to manage all customer and/or supplier payment statement reports. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ +
+ Available in Community and Enterprise + +
+
+
+ +
+ Customer and Supplier Statement in Contacts + +
+
+
+ +
+ Enable option to share Pdf and Excel Report + +
+
+
+ +
+ Enable an option to print Pdf and Excel Reports + +
+
+ + +
+ +
+ Auto send weekly statement to customer + +
+
+
+ +
+ Auto send monthly statement to customer + +
+
+ +
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Customer/ Supplier Payment Statement Report Pages

+

+ +
+ +
+

Customer Payment Statements

+

+ +
+ +
+

Supplier Payment Statements

+

+ +
+ +
+

Print and Share Options

+

+ +
+ +
+

Customer Payment Statement PDF Report

+

+ +
+
+

Customer Payment Statement Excel Report

+

+ +
+
+

Share PDF report via Email

+

+ +
+
+

Share Excel report via Email

+

+ +
+
+

Status of Report Sharing

+

+ +
+ +
+

Automatic Actions

+

Two Options, Weekly and Monthly.

+ +
+
+

Monthly Statement Report Action

+

+ +
+
+

Weekly Statement Report Action

+

+ +
+
+

Monthly Statement Report Mail with Attachments

+

+ +
+
+

Weekly Statement Report Mail with Attachments

+

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

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

+
+
+
+
+
+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/statement_report/static/src/js/action_manager.js b/statement_report/static/src/js/action_manager.js new file mode 100644 index 000000000..f97058c8b --- /dev/null +++ b/statement_report/static/src/js/action_manager.js @@ -0,0 +1,22 @@ +/** @odoo-module*/ +import {registry} from "@web/core/registry"; +import {download} from "@web/core/network/download"; + +var framework = require('web.framework') +var session = require('web.session') + +//action manager for xlsx report +registry.category('ir.actions.report handlers').add('xlsx', async (action) => { + if (action.report_type === 'xlsx'){ + framework.blockUI(); + var def = $.Deferred(); + session.get_file({ + url : '/xlsx_report', + data : action.data, + success : def.resolve.bind(def), + error : (error) => this.call('crash_manager', 'rpc_error', error), + complete : framework.unblockUI, + }); + return def; + } +}) diff --git a/statement_report/views/res_partner_views.xml b/statement_report/views/res_partner_views.xml new file mode 100644 index 000000000..cf77a49d8 --- /dev/null +++ b/statement_report/views/res_partner_views.xml @@ -0,0 +1,94 @@ + + + + + + res.partner.inherit.statement.report + res.partner + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + +
+
+ + + + + + + + + + + +
+
+
+
+
+