diff --git a/statement_report/README.rst b/statement_report/README.rst new file mode 100644 index 000000000..6415bbd70 --- /dev/null +++ b/statement_report/README.rst @@ -0,0 +1,49 @@ +.. 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 helps to generate Customer/Supplier Payment Statement Reports, automatically send monthly statements to customers, and provides the option to share Pdf and Excel reports. + +Configuration +============= +* No additional configuration is needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, v3.0 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developers: (V16) Ayisha Sumayya K, + (V17) Jumana Haseen, + (V18) Aysha Shalin, + Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/statement_report/__init__.py b/statement_report/__init__.py new file mode 100644 index 000000000..522d4e287 --- /dev/null +++ b/statement_report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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..d1d5ae327 --- /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: Aysha Shalin (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': '18.0.1.0.0', + 'category': 'Productivity', + 'summary': """This module is designed to generate Customer/Supplier Payment + Statement Reports.""", + 'description': """This module helps to generate Customer/Supplier Payment + Statement Reports, automatically send monthly statements to customers, and + provides the option to share Pdf and Excel reports.""", + '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', + 'installable': True, + 'auto_install': False, + 'application': False +} diff --git a/statement_report/controllers/__init__.py b/statement_report/controllers/__init__.py new file mode 100644 index 000000000..e9ae46223 --- /dev/null +++ b/statement_report/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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..b4b5c453d --- /dev/null +++ b/statement_report/controllers/statement_report.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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..3f5dbc231 --- /dev/null +++ b/statement_report/data/ir_cron_data.xml @@ -0,0 +1,28 @@ + + + + + + Weekly Statement Report + + code + model.auto_week_statement_report() + + 1 + weeks + + + + + + Monthly Statement Report + + code + model.auto_month_statement_report() + + 1 + months + + + + \ 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..60f6b1d86 --- /dev/null +++ b/statement_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 09.10.2024 +#### Version 18.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..2fe5490a3 --- /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: Aysha Shalin (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..6ad485b7d --- /dev/null +++ b/statement_report/models/res_partner.py @@ -0,0 +1,895 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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.json import json_default + + +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 customers """ + 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=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. """ + 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=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..266cb3342 --- /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 + + \ No newline at end of file diff --git a/statement_report/report/res_partner_templates.xml b/statement_report/report/res_partner_templates.xml new file mode 100644 index 000000000..334df5652 --- /dev/null +++ b/statement_report/report/res_partner_templates.xml @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/statement_report/static/description/assets/cybro-icon.png b/statement_report/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/statement_report/static/description/assets/cybro-icon.png differ diff --git a/statement_report/static/description/assets/cybro-odoo.png b/statement_report/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/statement_report/static/description/assets/cybro-odoo.png differ diff --git a/statement_report/static/description/assets/h2.png b/statement_report/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/statement_report/static/description/assets/h2.png differ diff --git a/statement_report/static/description/assets/icons/arrows-repeat.svg b/statement_report/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/statement_report/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/banner-1.png b/statement_report/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/statement_report/static/description/assets/icons/banner-1.png differ diff --git a/statement_report/static/description/assets/icons/banner-2.svg b/statement_report/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/statement_report/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/banner-bg.png b/statement_report/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/statement_report/static/description/assets/icons/banner-bg.png differ diff --git a/statement_report/static/description/assets/icons/banner-bg.svg b/statement_report/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/statement_report/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/banner-call.svg b/statement_report/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/statement_report/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/statement_report/static/description/assets/icons/banner-mail.svg b/statement_report/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/statement_report/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/statement_report/static/description/assets/icons/banner-pattern.svg b/statement_report/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/statement_report/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/banner-promo.svg b/statement_report/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/statement_report/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/brand-pair.svg b/statement_report/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/statement_report/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/close-icon.svg b/statement_report/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/statement_report/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + 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/collabarate-icon.svg b/statement_report/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/statement_report/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + 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/cybro-logo.png b/statement_report/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/statement_report/static/description/assets/icons/cybro-logo.png differ diff --git a/statement_report/static/description/assets/icons/down.svg b/statement_report/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/statement_report/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file 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/faq.png b/statement_report/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/statement_report/static/description/assets/icons/faq.png differ diff --git a/statement_report/static/description/assets/icons/feature-icon.svg b/statement_report/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/statement_report/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/feature.png b/statement_report/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/statement_report/static/description/assets/icons/feature.png differ diff --git a/statement_report/static/description/assets/icons/gear.svg b/statement_report/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/statement_report/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/hero.gif b/statement_report/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/statement_report/static/description/assets/icons/hero.gif differ diff --git a/statement_report/static/description/assets/icons/hire-odoo.svg b/statement_report/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/statement_report/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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/life-ring-icon.svg b/statement_report/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/statement_report/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + 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/mail.svg b/statement_report/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/statement_report/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + 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/notes.png b/statement_report/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/statement_report/static/description/assets/icons/notes.png differ diff --git a/statement_report/static/description/assets/icons/notification icon.svg b/statement_report/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/statement_report/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/odoo-consultancy.svg b/statement_report/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/statement_report/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/statement_report/static/description/assets/icons/odoo-licencing.svg b/statement_report/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/statement_report/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/statement_report/static/description/assets/icons/odoo-logo.png b/statement_report/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/statement_report/static/description/assets/icons/odoo-logo.png differ diff --git a/statement_report/static/description/assets/icons/patter.svg b/statement_report/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/statement_report/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/pattern1.png b/statement_report/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/statement_report/static/description/assets/icons/pattern1.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-piece-icon.svg b/statement_report/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/statement_report/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/replace-icon.svg b/statement_report/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/statement_report/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/screenshot-main.png b/statement_report/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/statement_report/static/description/assets/icons/screenshot-main.png differ diff --git a/statement_report/static/description/assets/icons/screenshot.png b/statement_report/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/statement_report/static/description/assets/icons/screenshot.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/skype-fill.svg b/statement_report/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/statement_report/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/skype.png b/statement_report/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/statement_report/static/description/assets/icons/skype.png differ diff --git a/statement_report/static/description/assets/icons/skype.svg b/statement_report/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/statement_report/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/statement_report/static/description/assets/icons/star-1.svg b/statement_report/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/statement_report/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/star-2.svg b/statement_report/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/statement_report/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/statement_report/static/description/assets/icons/support.png b/statement_report/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/statement_report/static/description/assets/icons/support.png differ diff --git a/statement_report/static/description/assets/icons/test-1 - Copy.png b/statement_report/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/statement_report/static/description/assets/icons/test-1 - Copy.png differ diff --git a/statement_report/static/description/assets/icons/test-1.png b/statement_report/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/statement_report/static/description/assets/icons/test-1.png differ diff --git a/statement_report/static/description/assets/icons/test-2.png b/statement_report/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/statement_report/static/description/assets/icons/test-2.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/translate.svg b/statement_report/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/statement_report/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/video.png b/statement_report/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/statement_report/static/description/assets/icons/video.png differ diff --git a/statement_report/static/description/assets/icons/whatsapp.png b/statement_report/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/statement_report/static/description/assets/icons/whatsapp.png differ diff --git a/statement_report/static/description/assets/icons/wrench-icon.svg b/statement_report/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/statement_report/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/modules/1.png b/statement_report/static/description/assets/modules/1.png new file mode 100644 index 000000000..e97ded8c0 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..0de59bc68 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..639d2c0c0 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..1e4e7314d 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..fb60da8f8 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..bf012a297 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..c45115a06 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/1.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..3caa1b6e2 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..389c464a3 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..d1335428a 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..defc72912 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..00afb0512 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..437ef6142 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/8.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..4f857b7b0 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/hero.gif differ diff --git a/statement_report/static/description/assets/y18.jpg b/statement_report/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/statement_report/static/description/assets/y18.jpg differ diff --git a/statement_report/static/description/banner.png b/statement_report/static/description/banner.png new file mode 100644 index 000000000..98b9ad696 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..c2cd75413 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..ec56f3dd1 --- /dev/null +++ b/statement_report/static/description/index.html @@ -0,0 +1,1172 @@ + + + + + + Customer/ Supplier Payment Statement Report + + + + + + + + + + +

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

+ This module is enabled to manage all customer and/or + supplier payment statement reports. +

+

Customer/ Supplier Payment Statement Report +

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

Key + Heighlights

+
+
+
+
+ +
+
+ Customer and Supplier Statement in Contacts. +
+
+
+
+
+
+ +
+
+ Auto Send Monthly Statement to Customers/Vendors. +
+
+
+
+
+
+ +
+
+ Enables the Option to Print & Share Pdf and Excel Reports. +
+
+
+
+
+ +
+
+
+ Customer/ Supplier Payment Statement Report +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Customer/ Supplier Payment Statement Report Pages. + +

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

+ Customer Payment Statements. + +

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

+ Supplier Payment Statements. + +

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

+ Options for Print and Share. + +

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

+ Customer Payment Statement PDF Report. + +

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

+ Customer Payment Statement Excel Report. + +

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

+ Share Reports via Email. + +

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

+ Automatic Actions for Sending Monthly and Weekly Statement Reports. + +

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

+ Monthly Statement Report Mail with Attachments. + +

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

+ Weekly Statement Report Mail with Attachments. + +

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

+ Customer/Supplier Payment Statement Reports.

+
+
+
+
+
+
+
+ +
+

+ Community & Enterprise Support.

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

+ While configuring a + backup, selecting + the Zip option will + include the + filestore in the + backup, while + choosing the Dump + option will create a + backup without the + filestore. +

+
+
+ +
+ +
+

+ Enable the "Remove + Old Backups" option + in the backup + creation view to + automatically delete + previous backups + based on the number + of days specified. +

+
+
+ +
+ +
+

+ Enable the "Notify + User" option and + specify a contact to + receive an email + containing a + detailed report with + the failure reason + and backup details. + This option will + also send an email + upon successful + backup. +

+
+
+ +
+ +
+

+ Select the backup + destination as local + storage and specify + a backup path to a + location on the + system to create + backups on your own + system. +

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

+ Latest Release 18.0.1.0.0 +

+ + 01st November, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit for Customer/ Supplier Payment Statement Report +
  • +
+
+
+
+
+
+
+
+
+
+ + + + + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + 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..1561907b8 --- /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..25f59541d --- /dev/null +++ b/statement_report/views/res_partner_views.xml @@ -0,0 +1,93 @@ + + + + + res.partner.view.form.inherit.statement.report + + res.partner + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + +
+
+ + + + + + + + + + + +
+
+
+
+
\ No newline at end of file