diff --git a/statement_report/README.rst b/statement_report/README.rst new file mode 100644 index 000000000..538e80fa2 --- /dev/null +++ b/statement_report/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/opl-1.0-standalone.html + :alt: License: LGPL-3 + +Customer/ Supplier Payment Statement Report +=========================================== +This module allow to view and send payment statement report in pdf and xlsx format, for both invoices and bills. + +Configuration +============= +-No additional Configuration needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/opl-1.0-standalone.html) + +Credits +------- +Developer: (V14)Mohamed Muzammil VP, 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..e5ec2384e --- /dev/null +++ b/statement_report/__init__.py @@ -0,0 +1,24 @@ +""" init file for statement report module """ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohamed Muzammil VP (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..3100d4fc9 --- /dev/null +++ b/statement_report/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohamed Muzammil VP (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': '14.0.1.0.0', + 'category': 'Productivity', + 'summary': 'The module offers a comprehensive summary of all payment ' + 'transactions', + 'description': 'This module help you to get Customer/ Supplier Payment ' + 'Statement Report. Users can download PDF,XLSX reports, ' + 'can mail the statements, and also can set scheduled ' + 'actions for monthly and weekly', + '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/assets.xml', + 'views/res_partner_views.xml', + 'report/res_partner_reports.xml', + 'report/res_partner_templates.xml', + ], + 'images': ['static/description/banner.jpg'], + '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..96e70ebc8 --- /dev/null +++ b/statement_report/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohamed Muzammil VP (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..0f4264b89 --- /dev/null +++ b/statement_report/controllers/statement_report.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohamed Muzammil VP (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..21f00fba1 --- /dev/null +++ b/statement_report/data/ir_cron_data.xml @@ -0,0 +1,31 @@ + + + + + + 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..886158dfd --- /dev/null +++ b/statement_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 08.01.2024 +#### Version 14.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..865c4826e --- /dev/null +++ b/statement_report/models/__init__.py @@ -0,0 +1,23 @@ +""" init file for models """ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohamed Muzammil VP (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..a8eeefdb4 --- /dev/null +++ b/statement_report/models/res_partner.py @@ -0,0 +1,870 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohamed Muzammil VP (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 ResPartner(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', + string="Customer reports", + help='partner invoices') + vendor_statement_ids = fields.Many2many( + 'account.move', + compute='_compute_vendor_statement_ids', + string="Vendor statement", + help='partner bills') + currency_id = fields.Many2one( + 'res.currency', + default=lambda self: self.env.company.currency_id.id, + string="Amount", + help="currency" + ) + + def _compute_customer_report_ids(self): + """ For computing 'invoices' of partner""" + for rec in self: + inv_ids = rec.env['account.move'].search( + [('partner_id', '=', rec.id), + ('move_type', '=', 'out_invoice'), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]).ids + rec.customer_report_ids = inv_ids + + def _compute_vendor_statement_ids(self): + """ For computing 'bills' of partner """ + for rec in self: + bill_ids = rec.env['account.move'].search( + [('partner_id', '=', rec.id), + ('move_type', '=', 'in_invoice'), + ('payment_state', '!=', 'paid'), + ('state', '=', 'posted')]).ids + rec.vendor_statement_ids = bill_ids + + def main_query(self): + """Return select query""" + return """ + 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) + + def amount_query(self): + """Return query for calculating total amount""" + return """ + 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) + + def action_share_pdf(self): + """ Action for sharing the customer pdf report""" + if self.customer_report_ids: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('out_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('out_invoice')""") + 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.ref('statement_report.res_partner_action')\ + .sudo()._render_qweb_pdf(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': f'

Dear ' + f'Mr/Miss. {self.name}

' + f'

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

' + f'

Best regards,

' + f'

{self.env.user.name}

', + 'attachment_ids': [attachment.id], + } + + self.env['mail.mail'].sudo().create(email_values).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: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('out_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('out_invoice')""") + 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: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('out_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('out_invoice')""") + 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: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('out_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('out_invoice')""") + amount = self.env.cr.dictfetchall() + data = { + 'customer': self.display_name, + 'street': self.street, + 'street2': self.street2, + 'city': self.city, + 'state': self.state_id.name, + 'zip': self.zip, + 'my_data': main, + 'total': amount[0]['total'], + 'balance': amount[0]['balance'], + 'currency': self.currency_id.symbol, + } + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format({ + 'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '22px'}) + sheet.merge_range('B2:P4', 'Payment Statement Report', head) + date_style = workbook.add_format( + {'text_wrap': True, 'align': 'center', + 'num_format': 'yyyy-mm-dd'}) + if data['customer']: + sheet.write('B7:C7', 'Customer : ', cell_format) + sheet.merge_range('D7:G7', data['customer'], txt) + sheet.write('B9:C7', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], txt) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + sheet.write('B15', 'Date', cell_format) + sheet.write('D15', 'Invoice/Bill Number', cell_format) + sheet.write('H15', 'Due Date', cell_format) + sheet.write('J15', 'Invoices/Debit', cell_format) + sheet.write('M15', 'Amount Due', cell_format) + sheet.write('P15', 'Balance Due', cell_format) + row = 16 + column = 0 + for record in data['my_data']: + sub_total = data['currency'] + str(record['sub_total']) + amount_due = data['currency'] + str(record['amount_due']) + balance = data['currency'] + str(record['balance']) + total = data['currency'] + str(data['total']) + remain_balance = data['currency'] + str(data['balance']) + + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], date_style) + sheet.merge_range(row, column + 3, row, column + 5, + record['name'], txt) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], date_style) + sheet.merge_range(row, column + 9, row, column + 10, + sub_total, txt) + sheet.merge_range(row, column + 12, row, column + 13, + amount_due, txt) + sheet.merge_range(row, column + 15, row, column + 16, + balance, txt) + row = row + 1 + sheet.write(row + 2, column + 1, 'Total Amount : ', + cell_format) + sheet.merge_range(row + 2, column + 4, row + 2, column + 5, + total, txt) + sheet.write(row + 4, column + 1, 'Balance Due : ', cell_format) + sheet.merge_range(row + 4, column + 4, row + 4, column + 5, + remain_balance, txt) + workbook.close() + output.seek(0) + xlsx = base64.b64encode(output.read()) + output.close() + ir_values = { + 'name': "Statement Report", + 'type': 'binary', + 'datas': xlsx, + 'store_fname': xlsx, + } + attachment = self.env['ir.attachment'].sudo().create(ir_values) + email_values = { + 'email_to': self.email, + 'subject': 'Payment Statement Report', + 'body_html': f'

Dear ' + f'Mr/Miss. {self.name}

' + f'

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

' + f'

Best regards,

' + f'

{self.env.user.name}

', + 'attachment_ids': [attachment.id], + } + self.env['mail.mail'].sudo().create(email_values).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'), + ('company_id', '=', self.env.company.id)]) + 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.ref('statement_report.res_partner_action')\ + .sudo()._render_qweb_pdf(self, data=data) + data_record = base64.b64encode(report[0]) + ir_values = { + 'name': 'Statement Report', + 'type': 'binary', + 'datas': data_record, + 'mimetype': 'application/pdf', + 'res_model': 'res.partner', + } + attachment1 = self.env[ + 'ir.attachment'].sudo().create(ir_values) + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format( + {'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '22px'}) + sheet.merge_range('B2:P4', 'Payment Statement Report', head) + date_style = workbook.add_format( + {'text_wrap': True, 'align': 'center', + 'num_format': 'yyyy-mm-dd'}) + if data['customer']: + sheet.write('B7:D7', 'Customer/Supplier : ', cell_format) + sheet.merge_range('E7:H7', data['customer'], txt) + sheet.write('B9:C7', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], txt) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + sheet.write('B15', 'Date', cell_format) + sheet.write('D15', 'Invoice/Bill Number', cell_format) + sheet.write('H15', 'Due Date', cell_format) + sheet.write('J15', 'Invoices/Debit', cell_format) + sheet.write('M15', 'Amount Due', cell_format) + sheet.write('P15', 'Balance Due', cell_format) + row = 16 + column = 0 + for record in data['my_data']: + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], date_style) + sheet.merge_range(row, column + 3, row, column + 5, + record['name'], txt) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], date_style) + sheet.merge_range(row, column + 9, row, column + 10, + record['sub_total'], txt) + sheet.merge_range(row, column + 12, row, column + 13, + record['amount_due'], txt) + sheet.merge_range(row, column + 15, row, column + 16, + record['balance'], txt) + row = row + 1 + workbook.close() + output.seek(0) + xlsx = base64.b64encode(output.read()) + output.close() + ir_values = { + 'name': "Statement Report", + 'type': 'binary', + 'datas': xlsx, + 'store_fname': xlsx, + } + attachment2 = self.env['ir.attachment'].sudo().create( + ir_values) + email_values = { + 'email_to': rec.email, + 'subject': 'Weekly Payment Statement Report', + 'body_html': '

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

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

' + 'Best regards,

' + self.env.user.name, + 'attachment_ids': [attachment1.id, attachment2.id] + } + self.env['mail.mail'].sudo().create(email_values).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'), + ('company_id', '=', self.env.company.id)]) + 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.ref('statement_report.res_partner_action')\ + .sudo()._render_qweb_pdf(self, data=data) + data_record = base64.b64encode(report[0]) + ir_values = { + 'name': 'Statement Report', + 'type': 'binary', + 'datas': data_record, + 'mimetype': 'application/pdf', + 'res_model': 'res.partner', + } + attachment1 = self.env['ir.attachment'].sudo().create( + ir_values) + # FOR XLSX + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + cell_format = workbook.add_format( + {'font_size': '14px', 'bold': True}) + txt = workbook.add_format({'font_size': '13px'}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '22px'}) + sheet.merge_range('B2:P4', 'Payment Statement Report', head) + date_style = workbook.add_format( + {'text_wrap': True, 'align': 'center', + 'num_format': 'yyyy-mm-dd'}) + if data['customer']: + sheet.write('B7:D7', 'Customer/Supplier : ', cell_format) + sheet.merge_range('E7:H7', data['customer'], txt) + sheet.write('B9:C7', 'Address : ', cell_format) + if data['street']: + sheet.merge_range('D9:F9', data['street'], txt) + if data['street2']: + sheet.merge_range('D10:F10', data['street2'], txt) + if data['city']: + sheet.merge_range('D11:F11', data['city'], txt) + if data['state']: + sheet.merge_range('D12:F12', data['state'], txt) + if data['zip']: + sheet.merge_range('D13:F13', data['zip'], txt) + sheet.write('B15', 'Date', cell_format) + sheet.write('D15', 'Invoice/Bill Number', cell_format) + sheet.write('H15', 'Due Date', cell_format) + sheet.write('J15', 'Invoices/Debit', cell_format) + sheet.write('M15', 'Amount Due', cell_format) + sheet.write('P15', 'Balance Due', cell_format) + row = 16 + column = 0 + for record in data['my_data']: + sheet.merge_range(row, column + 1, row, column + 2, + record['invoice_date'], date_style) + sheet.merge_range(row, column + 3, row, column + 5, + record['name'], txt) + sheet.merge_range(row, column + 7, row, column + 8, + record['invoice_date_due'], date_style) + sheet.merge_range(row, column + 9, row, column + 10, + record['sub_total'], txt) + sheet.merge_range(row, column + 12, row, column + 13, + record['amount_due'], txt) + sheet.merge_range(row, column + 15, row, column + 16, + record['balance'], txt) + row = row + 1 + workbook.close() + output.seek(0) + xlsx = base64.b64encode(output.read()) + output.close() + ir_values = { + 'name': "Statement Report", + 'type': 'binary', + 'datas': xlsx, + 'store_fname': xlsx, + } + attachment2 = self.env['ir.attachment'].sudo().create( + ir_values) + email_values = { + 'email_to': rec.email, + 'subject': 'Monthly Payment Statement Report', + 'body_html': '

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

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

Best regards,' + '

' + self.env.user.name, + 'attachment_ids': [attachment1.id, attachment2.id] + } + self.env['mail.mail'].sudo().create(email_values).send() + + def action_vendor_print_pdf(self): + """ Action for printing vendor pdf report """ + if self.vendor_statement_ids: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('in_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('in_invoice')""") + 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: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('in_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('in_invoice')""") + 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.ref('statement_report.res_partner_action')\ + .sudo()._render_qweb_pdf(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': f'

Dear ' + f'Mr/Miss. {self.name}

' + f'

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

' + f'

Best regards,

' + f'

{self.env.user.name}

', + 'attachment_ids': [attachment.id], + } + self.env['mail.mail'].sudo().create(email_values).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: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('in_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('in_invoice')""") + 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: + self.env.cr.execute( + self.main_query() + """ AND move_type IN ('in_invoice')""") + main = self.env.cr.dictfetchall() + self.env.cr.execute( + self.amount_query() + """ AND move_type IN ('in_invoice')""") + 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': f'

Dear ' + f'Mr/Miss. {self.name}

' + f'

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

' + f'

Best regards,

' + f'

{self.env.user.name}

', + 'attachment_ids': [attachment.id], + } + self.env['mail.mail'].sudo().create(email_values).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..df67c8dac --- /dev/null +++ b/statement_report/report/res_partner_templates.xml @@ -0,0 +1,78 @@ + + + + + diff --git a/statement_report/static/description/assets/icons/check.png b/statement_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/statement_report/static/description/assets/icons/check.png differ diff --git a/statement_report/static/description/assets/icons/chevron.png b/statement_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/statement_report/static/description/assets/icons/chevron.png differ diff --git a/statement_report/static/description/assets/icons/cogs.png b/statement_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/statement_report/static/description/assets/icons/cogs.png differ diff --git a/statement_report/static/description/assets/icons/consultation.png b/statement_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/statement_report/static/description/assets/icons/consultation.png differ diff --git a/statement_report/static/description/assets/icons/ecom-black.png b/statement_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/statement_report/static/description/assets/icons/ecom-black.png differ diff --git a/statement_report/static/description/assets/icons/education-black.png b/statement_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/statement_report/static/description/assets/icons/education-black.png differ diff --git a/statement_report/static/description/assets/icons/hotel-black.png b/statement_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/statement_report/static/description/assets/icons/hotel-black.png differ diff --git a/statement_report/static/description/assets/icons/license.png b/statement_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/statement_report/static/description/assets/icons/license.png differ diff --git a/statement_report/static/description/assets/icons/lifebuoy.png b/statement_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/statement_report/static/description/assets/icons/lifebuoy.png differ diff --git a/statement_report/static/description/assets/icons/manufacturing-black.png b/statement_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/statement_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/statement_report/static/description/assets/icons/pos-black.png b/statement_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/statement_report/static/description/assets/icons/pos-black.png differ diff --git a/statement_report/static/description/assets/icons/puzzle.png b/statement_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/statement_report/static/description/assets/icons/puzzle.png differ diff --git a/statement_report/static/description/assets/icons/restaurant-black.png b/statement_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/statement_report/static/description/assets/icons/restaurant-black.png differ diff --git a/statement_report/static/description/assets/icons/service-black.png b/statement_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/statement_report/static/description/assets/icons/service-black.png differ diff --git a/statement_report/static/description/assets/icons/trading-black.png b/statement_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/statement_report/static/description/assets/icons/trading-black.png differ diff --git a/statement_report/static/description/assets/icons/training.png b/statement_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/statement_report/static/description/assets/icons/training.png differ diff --git a/statement_report/static/description/assets/icons/update.png b/statement_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/statement_report/static/description/assets/icons/update.png differ diff --git a/statement_report/static/description/assets/icons/user.png b/statement_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/statement_report/static/description/assets/icons/user.png differ diff --git a/statement_report/static/description/assets/icons/wrench.png b/statement_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/statement_report/static/description/assets/icons/wrench.png differ diff --git a/statement_report/static/description/assets/misc/categories.png b/statement_report/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/statement_report/static/description/assets/misc/categories.png differ diff --git a/statement_report/static/description/assets/misc/check-box.png b/statement_report/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/statement_report/static/description/assets/misc/check-box.png differ diff --git a/statement_report/static/description/assets/misc/compass.png b/statement_report/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/statement_report/static/description/assets/misc/compass.png differ diff --git a/statement_report/static/description/assets/misc/corporate.png b/statement_report/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/statement_report/static/description/assets/misc/corporate.png differ diff --git a/statement_report/static/description/assets/misc/customer-support.png b/statement_report/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/statement_report/static/description/assets/misc/customer-support.png differ diff --git a/statement_report/static/description/assets/misc/cybrosys-logo.png b/statement_report/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/statement_report/static/description/assets/misc/cybrosys-logo.png differ diff --git a/statement_report/static/description/assets/misc/features.png b/statement_report/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/statement_report/static/description/assets/misc/features.png differ diff --git a/statement_report/static/description/assets/misc/logo.png b/statement_report/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/statement_report/static/description/assets/misc/logo.png differ diff --git a/statement_report/static/description/assets/misc/pictures.png b/statement_report/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/statement_report/static/description/assets/misc/pictures.png differ diff --git a/statement_report/static/description/assets/misc/pie-chart.png b/statement_report/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/statement_report/static/description/assets/misc/pie-chart.png differ diff --git a/statement_report/static/description/assets/misc/right-arrow.png b/statement_report/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/statement_report/static/description/assets/misc/right-arrow.png differ diff --git a/statement_report/static/description/assets/misc/star.png b/statement_report/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/statement_report/static/description/assets/misc/star.png differ diff --git a/statement_report/static/description/assets/misc/support.png b/statement_report/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/statement_report/static/description/assets/misc/support.png differ diff --git a/statement_report/static/description/assets/misc/whatsapp.png b/statement_report/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/statement_report/static/description/assets/misc/whatsapp.png differ diff --git a/statement_report/static/description/assets/modules/1.png b/statement_report/static/description/assets/modules/1.png new file mode 100644 index 000000000..e29d7e316 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.jpg b/statement_report/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..de0c2ef12 Binary files /dev/null and b/statement_report/static/description/assets/modules/2.jpg 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..9599391fa 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..e6f4f6d66 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..43f1ab5c9 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..f55c47e0f 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..27f40b4a4 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..805919682 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..db0516385 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..a48723c36 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/12.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..ae47cea50 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..6b65e7fd7 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..c859fdb26 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..329e10106 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..92d147e59 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..82a1a3337 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..d56a012b7 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..19d30cbd0 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..dfd44b5f9 Binary files /dev/null and b/statement_report/static/description/assets/screenshots/hero.gif differ diff --git a/statement_report/static/description/banner.jpg b/statement_report/static/description/banner.jpg new file mode 100644 index 000000000..e87426417 Binary files /dev/null and b/statement_report/static/description/banner.jpg differ diff --git a/statement_report/static/description/icon.png b/statement_report/static/description/icon.png new file mode 100644 index 000000000..dd8766e70 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..18075467d --- /dev/null +++ b/statement_report/static/description/index.html @@ -0,0 +1,618 @@ +
+ +
+ +
+
+ Community +
+
+
+ +
+
+
+ +

Customer/ Supplier Payment Statement Report

+

This System is Designed to Manage all Customer and/or Supplier Payment Statement Reports.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

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

Features +

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

Screenshots +

+
+
+
+ +
+

Click --> Customer Statement

+

Options to Print PDF Report, Print XLSX Report, Send Report by Email

+ +
+ +
+

Click --> Supplier Statement

+

Options to Print PDF Report, Print XLSX Report, Send Report by Email

+ +
+ +
+

Statements

+

Customer Payment Statement - PDF

+ +
+ +
+

+

Customer Payment Statement - Excel

+ +
+
+

+

Supplier Payment Statement - PDF

+ +
+
+

+

Supplier Payment Statement - Excel

+ +
+
+

Share Payment Statement via Email

+

+ +
+
+

PDF Payment Statement Mail with Attachments

+

+ +
+ +
+

Excel Payment Statement Mail with Attachments

+

+ +
+
+

Scheduled Action

+

Two Options:-

+

1.Monthly Statement Report

+

2.Weekly Statement Report

+ +
+
+

Monthly Statement Report Mail with Attachments

+

+ +
+
+

Weekly Statement Report Mail with Attachments

+

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

Suggested + Products +

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

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/statement_report/static/src/js/action_manager.js b/statement_report/static/src/js/action_manager.js new file mode 100644 index 000000000..9363d720d --- /dev/null +++ b/statement_report/static/src/js/action_manager.js @@ -0,0 +1,30 @@ +odoo.define('statement_report.action_manager', function (require) { +"use strict"; +/** + * The purpose of this file is to add the actions of type + * 'ir_actions_xlsx_download' to the ActionManager. + */ +var ActionManager = require('web.ActionManager'); +var framework = require('web.framework'); +var session = require('web.session'); +ActionManager.include({ + _executexlsxReportDownloadAction: function (action) { + framework.blockUI(); + var def = $.Deferred(); + session.get_file({ + url: '/xlsx_report', + data: action.data, + success: def.resolve.bind(def), + error: (error) => this.call('crash_manager', 'rpc_error', error), + complete: framework.unblockUI, + }); + return def; + }, + _handleAction: function (action, options) { + if (action.report_type === 'xlsx') { + return this._executexlsxReportDownloadAction(action, options); + } + return this._super.apply(this, arguments); + }, + }); + }); \ No newline at end of file diff --git a/statement_report/views/assets.xml b/statement_report/views/assets.xml new file mode 100644 index 000000000..5abdb52b2 --- /dev/null +++ b/statement_report/views/assets.xml @@ -0,0 +1,11 @@ + + + +