diff --git a/statement_report/README.rst b/statement_report/README.rst new file mode 100644 index 000000000..ad476e518 --- /dev/null +++ b/statement_report/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +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: + (V16) Ayisha Sumayya K + (V17) Jumana Haseen +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.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..42fb638f5 --- /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) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (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..74ba374b9 --- /dev/null +++ b/statement_report/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (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': '17.0.1.0.0', + 'category': 'Productivity', + 'summary': """Customer/ Supplier Payment Statement Report is designed to + manage all customer and/or supplier payment statement reports.""", + 'description': """ This module help you to get Customer/ Supplier + Payment Statement Report, auto send monthly statement to customer and + enables option to share pdf and excel 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/res_partner_reports.xml', + 'report/res_partner_templates.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..c7225c0d0 --- /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) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (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..a50357375 --- /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) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (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..3c8fbf010 --- /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 + + + + diff --git a/statement_report/doc/RELEASE_NOTES.md b/statement_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..abdf1745a --- /dev/null +++ b/statement_report/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 16.01.2024 +#### Version 17.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..e04915053 --- /dev/null +++ b/statement_report/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (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..b7495f69f --- /dev/null +++ b/statement_report/models/res_partner.py @@ -0,0 +1,916 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Haseen (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 related to Customer') + vendor_statement_ids = fields.Many2many( + 'account.move', + compute='_compute_vendor_statement_ids', + help='Partner Bills related to Vendor') + currency_id = fields.Many2one( + 'res.currency', + default=lambda self: self.env.company.currency_id.id, + help="currency related to Customer or Vendor" + ) + + def _compute_customer_report_ids(self): + """ For computing 'invoices' of partner""" + for rec in self: + inv_ids = self.env['account.move'].search( + [('partner_id', '=', rec.id), + ('move_type', '=', 'out_invoice'), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]) + rec.customer_report_ids = inv_ids + + def _compute_vendor_statement_ids(self): + """ For computing 'bills' of partner """ + for rec in self: + bills = self.env['account.move'].search( + [('partner_id', '=', rec.id), + ('move_type', '=', 'in_invoice'), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]) + rec.vendor_statement_ids = bills + + 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.xlsx", + '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) + # 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.xlsx", + '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.xlsx", + '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/res_partner_reports.xml b/statement_report/report/res_partner_reports.xml new file mode 100644 index 000000000..82c9a10c6 --- /dev/null +++ b/statement_report/report/res_partner_reports.xml @@ -0,0 +1,14 @@ + + + + + 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 + + diff --git a/statement_report/report/res_partner_templates.xml b/statement_report/report/res_partner_templates.xml new file mode 100644 index 000000000..6402c461d --- /dev/null +++ b/statement_report/report/res_partner_templates.xml @@ -0,0 +1,76 @@ + + + + + diff --git a/statement_report/static/description/assets/icons/capture (1).png b/statement_report/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/statement_report/static/description/assets/icons/capture (1).png differ 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/img.png b/statement_report/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/statement_report/static/description/assets/icons/img.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/photo-capture.png b/statement_report/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/statement_report/static/description/assets/icons/photo-capture.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/Cybrosys R.png b/statement_report/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/statement_report/static/description/assets/misc/Cybrosys R.png differ diff --git a/statement_report/static/description/assets/misc/email.svg b/statement_report/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/statement_report/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statement_report/static/description/assets/misc/phone.svg b/statement_report/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/statement_report/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/statement_report/static/description/assets/misc/star (1) 2.svg b/statement_report/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/statement_report/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/statement_report/static/description/assets/misc/support (1) 1.svg b/statement_report/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/statement_report/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/statement_report/static/description/assets/misc/support-email.svg b/statement_report/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/statement_report/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/statement_report/static/description/assets/misc/tick-mark.svg b/statement_report/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/statement_report/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/statement_report/static/description/assets/misc/whatsapp 1.svg b/statement_report/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/statement_report/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/statement_report/static/description/assets/misc/whatsapp.svg b/statement_report/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/statement_report/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statement_report/static/description/assets/modules/1.png b/statement_report/static/description/assets/modules/1.png new file mode 100644 index 000000000..cf1276896 Binary files /dev/null and b/statement_report/static/description/assets/modules/1.png differ diff --git a/statement_report/static/description/assets/modules/2.png b/statement_report/static/description/assets/modules/2.png new file mode 100644 index 000000000..c4e850c44 Binary files /dev/null and b/statement_report/static/description/assets/modules/2.png differ diff --git a/statement_report/static/description/assets/modules/3.png b/statement_report/static/description/assets/modules/3.png new file mode 100644 index 000000000..050dd742c Binary files /dev/null and b/statement_report/static/description/assets/modules/3.png differ diff --git a/statement_report/static/description/assets/modules/4.png b/statement_report/static/description/assets/modules/4.png new file mode 100644 index 000000000..e2e5aaddb Binary files /dev/null and b/statement_report/static/description/assets/modules/4.png differ diff --git a/statement_report/static/description/assets/modules/5.png b/statement_report/static/description/assets/modules/5.png new file mode 100644 index 000000000..39c200706 Binary files /dev/null and b/statement_report/static/description/assets/modules/5.png differ diff --git a/statement_report/static/description/assets/modules/6.png b/statement_report/static/description/assets/modules/6.png new file mode 100644 index 000000000..10a60604f Binary files /dev/null and b/statement_report/static/description/assets/modules/6.png differ diff --git a/statement_report/static/description/assets/screenshots/1.png b/statement_report/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..50bdae05a Binary files /dev/null and b/statement_report/static/description/assets/screenshots/1.png differ diff --git a/statement_report/static/description/assets/screenshots/10.png b/statement_report/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..3acf085ec Binary files /dev/null and b/statement_report/static/description/assets/screenshots/10.png differ diff --git a/statement_report/static/description/assets/screenshots/11.png b/statement_report/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..1f875b330 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/11.png differ diff --git a/statement_report/static/description/assets/screenshots/12.png b/statement_report/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..e1ee100ab Binary files /dev/null and b/statement_report/static/description/assets/screenshots/12.png differ diff --git a/statement_report/static/description/assets/screenshots/13.png b/statement_report/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..d50958236 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/13.png differ diff --git a/statement_report/static/description/assets/screenshots/14.png b/statement_report/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..178646296 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/14.png differ diff --git a/statement_report/static/description/assets/screenshots/2.png b/statement_report/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..405e28f1a Binary files /dev/null and b/statement_report/static/description/assets/screenshots/2.png differ diff --git a/statement_report/static/description/assets/screenshots/3.png b/statement_report/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..3a6622229 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/3.png differ diff --git a/statement_report/static/description/assets/screenshots/4.png b/statement_report/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..d829bd42b Binary files /dev/null and b/statement_report/static/description/assets/screenshots/4.png differ diff --git a/statement_report/static/description/assets/screenshots/5.png b/statement_report/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..d69be7d6b Binary files /dev/null and b/statement_report/static/description/assets/screenshots/5.png differ diff --git a/statement_report/static/description/assets/screenshots/6.png b/statement_report/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..33460aa94 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/6.png differ diff --git a/statement_report/static/description/assets/screenshots/7.png b/statement_report/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..75fb63f08 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/7.png differ diff --git a/statement_report/static/description/assets/screenshots/8.png b/statement_report/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..a8d3cd4eb Binary files /dev/null and b/statement_report/static/description/assets/screenshots/8.png differ diff --git a/statement_report/static/description/assets/screenshots/9.png b/statement_report/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..bb319e891 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/9.png differ diff --git a/statement_report/static/description/assets/screenshots/hero.gif b/statement_report/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..316169b9a Binary files /dev/null and b/statement_report/static/description/assets/screenshots/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..6f6063ea9 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..355722b3e 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..94b23bca2 --- /dev/null +++ b/statement_report/static/description/index.html @@ -0,0 +1,905 @@ + + + + + + Odoo App 3 Index + + + + + + + + +

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

+ Customer/ Supplier Payment Statement Report

+

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

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Customer and Supplier Statement in + Contacts.

+
+
+
+
+
+
+ +
+
+

+ Auto send monthly statement to customer.

+
+
+
+
+
+
+ +
+
+

+ Auto send monthly statement to customer.

+
+
+
+
+
+
+ +
+
+

+ Enable option to share Pdf and Excel + Report.

+
+
+
+
+
+
+ +
+
+

+ Enable an option to print Pdf and Excel Reports.

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

+ 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.

+
+
+
+
+
+
+
    +
  • + Available in Community and Enterprise +
  • +
  • + Customer/ Supplier Payment Statement Report Pages. +
  • +
  • + Customer/ Supplier Payment Statement Report +
      +
    • This system is designed to manage all customer and/or supplier payment statement reports. +
    • +
    +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:16th January 2024 +
+

+ Initial Commit for Customer/ Supplier Payment Statement 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/statement_report/static/src/js/action_manager.js b/statement_report/static/src/js/action_manager.js new file mode 100644 index 000000000..6e95e8cfa --- /dev/null +++ b/statement_report/static/src/js/action_manager.js @@ -0,0 +1,16 @@ +/** @odoo-module*/ +import {registry} from "@web/core/registry"; +import {download} from "@web/core/network/download"; +import { BlockUI, unblockUI } from "@web/core/ui/block_ui"; +//Action manager for xlsx report +registry.category('ir.actions.report handlers').add('xlsx', async (action) => { + if (action.report_type === 'xlsx'){ + BlockUI; +await download({ + url : '/xlsx_report', + data : action.data, + error : (error) => self.call('crash_manager', 'rpc_error', error), + complete: () => unblockUI, + }); + } +}) diff --git a/statement_report/views/res_partner_views.xml b/statement_report/views/res_partner_views.xml new file mode 100644 index 000000000..658a0877c --- /dev/null +++ b/statement_report/views/res_partner_views.xml @@ -0,0 +1,93 @@ + + + + + res.partner.view.form.inherit.statement.report + + res.partner + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + +
+
+ + + + + + + + + + + +
+
+
+
+