diff --git a/invoice_payment_receipt/README.rst b/invoice_payment_receipt/README.rst new file mode 100644 index 000000000..c3a53d9ba --- /dev/null +++ b/invoice_payment_receipt/README.rst @@ -0,0 +1,12 @@ +Account Payment Receipt +======================= + + This module will print payment receipts with paid details + + +Credits +======= +Cybrosys Techno Solutions +Author +------ +* Cybrosys Techno Solutions diff --git a/invoice_payment_receipt/__init__.py b/invoice_payment_receipt/__init__.py new file mode 100644 index 000000000..be6313a49 --- /dev/null +++ b/invoice_payment_receipt/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import models diff --git a/invoice_payment_receipt/__manifest__.py b/invoice_payment_receipt/__manifest__.py new file mode 100644 index 000000000..24350a6a0 --- /dev/null +++ b/invoice_payment_receipt/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Account Payment Receipt', + 'summary': """Payment Receipt With Paid Details""", + 'version': '1.0', + 'description': """""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Reporting', + 'depends': ['base', 'account'], + 'license': 'AGPL-3', + 'data': [ + 'views/receipt_print_template.xml', + 'views/account_payment_print.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, + +} diff --git a/invoice_payment_receipt/models/__init__.py b/invoice_payment_receipt/models/__init__.py new file mode 100644 index 000000000..33720fea2 --- /dev/null +++ b/invoice_payment_receipt/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import account_receipt_parser diff --git a/invoice_payment_receipt/models/account_receipt_parser.py b/invoice_payment_receipt/models/account_receipt_parser.py new file mode 100644 index 000000000..35fd6d0bc --- /dev/null +++ b/invoice_payment_receipt/models/account_receipt_parser.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.report import report_sxw +from odoo.osv import osv +from odoo import api +from odoo.http import request +import json + + +class AccountReceiptParser(report_sxw.rml_parse): + + def __init__(self, cr, uid, name, context=None): + super(AccountReceiptParser, self).__init__(cr, uid, name, context=context) + self.localcontext.update({ + 'get_details': self.get_details, + 'get_details_invoice': self.get_details_invoice, + }) + self.context = context + + @api.multi + def get_details_invoice(self, doc): + lines = [] + acc_inv = request.env['account.invoice'] + acc_inv_rec = acc_inv.search([('number', '=', doc.number)]) + total_amount = acc_inv_rec.amount_total + if acc_inv_rec.state == 'draft': + balance_amount = total_amount + else: + balance_amount = acc_inv_rec.residual + paid = total_amount - balance_amount + vals = { + 'total_amount': total_amount, + 'balance_amount': balance_amount, + 'paid': paid, + } + lines.append(vals) + return lines + + @api.multi + def get_details(self, doc): + lines = [] + acc_inv = request.env['account.invoice'] + acc_inv_rec = acc_inv.search([('number', '=', doc.number)]) + d = json.loads(acc_inv_rec.payments_widget) + for payment in d['content']: + vals = { + 'memo': payment['name'], + 'amount': payment['amount'], + 'method': payment['journal_name'], + 'date': payment['date'], + } + lines.append(vals) + return lines + + +class PrintReport(osv.AbstractModel): + _name = 'report.invoice_payment_receipt.report_payment' + _inherit = 'report.abstract_report' + _template = 'invoice_payment_receipt.report_payment' + _wrapped_report_class = AccountReceiptParser + + diff --git a/invoice_payment_receipt/static/description/banner.jpg b/invoice_payment_receipt/static/description/banner.jpg new file mode 100644 index 000000000..d76cdd554 Binary files /dev/null and b/invoice_payment_receipt/static/description/banner.jpg differ diff --git a/invoice_payment_receipt/static/description/customer_invoice_form_view.png b/invoice_payment_receipt/static/description/customer_invoice_form_view.png new file mode 100644 index 000000000..0af91bed4 Binary files /dev/null and b/invoice_payment_receipt/static/description/customer_invoice_form_view.png differ diff --git a/invoice_payment_receipt/static/description/customer_receipt.png b/invoice_payment_receipt/static/description/customer_receipt.png new file mode 100644 index 000000000..7f0a34cb7 Binary files /dev/null and b/invoice_payment_receipt/static/description/customer_receipt.png differ diff --git a/invoice_payment_receipt/static/description/cybro_logo.png b/invoice_payment_receipt/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/invoice_payment_receipt/static/description/cybro_logo.png differ diff --git a/invoice_payment_receipt/static/description/icon.png b/invoice_payment_receipt/static/description/icon.png new file mode 100644 index 000000000..b646dbde0 Binary files /dev/null and b/invoice_payment_receipt/static/description/icon.png differ diff --git a/invoice_payment_receipt/static/description/index.html b/invoice_payment_receipt/static/description/index.html new file mode 100644 index 000000000..a072a26d5 --- /dev/null +++ b/invoice_payment_receipt/static/description/index.html @@ -0,0 +1,103 @@ +
+
+

Payment Receipt Report

+

Customer Receipts & Vendor Payment Report

+

Cybrosys Techno Solutions, www.cybrosys.com

+
+
+
+
+
+ ☀ Generate Customer invoice receipt with payment details.
+ ☀ Generate Vendor receipt with payment details.
+
+
+
+

Customer Invoice

+

Customer Invoice Form View

+
+

+
+

+
+ +
+
+
+
+

Customer Receipt Print

+
+

+
+

+
+ +
+
+
+
+

Customer Receipt Report

+
+

+
+

+
+ +
+
+
+
+
+
+

Vendor Bill

+

Vendor Bill Form View

+
+

+
+

+
+ +
+
+
+
+

Vendor Receipt Print

+
+

+
+

+
+ +
+
+
+
+

Vendor Receipt Report

+
+

+
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ + +
+ + diff --git a/invoice_payment_receipt/static/description/receipt_print_customer.png b/invoice_payment_receipt/static/description/receipt_print_customer.png new file mode 100644 index 000000000..68ac64059 Binary files /dev/null and b/invoice_payment_receipt/static/description/receipt_print_customer.png differ diff --git a/invoice_payment_receipt/static/description/vendor_invoice_form.png b/invoice_payment_receipt/static/description/vendor_invoice_form.png new file mode 100644 index 000000000..b61e73b09 Binary files /dev/null and b/invoice_payment_receipt/static/description/vendor_invoice_form.png differ diff --git a/invoice_payment_receipt/static/description/vendor_print_button.png b/invoice_payment_receipt/static/description/vendor_print_button.png new file mode 100644 index 000000000..15e38d4e7 Binary files /dev/null and b/invoice_payment_receipt/static/description/vendor_print_button.png differ diff --git a/invoice_payment_receipt/static/description/vendor_receipt.png b/invoice_payment_receipt/static/description/vendor_receipt.png new file mode 100644 index 000000000..8d0603df2 Binary files /dev/null and b/invoice_payment_receipt/static/description/vendor_receipt.png differ diff --git a/invoice_payment_receipt/views/account_payment_print.xml b/invoice_payment_receipt/views/account_payment_print.xml new file mode 100644 index 000000000..e5bdb5586 --- /dev/null +++ b/invoice_payment_receipt/views/account_payment_print.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/invoice_payment_receipt/views/receipt_print_template.xml b/invoice_payment_receipt/views/receipt_print_template.xml new file mode 100644 index 000000000..3be8f4271 --- /dev/null +++ b/invoice_payment_receipt/views/receipt_print_template.xml @@ -0,0 +1,82 @@ + + + +