diff --git a/account_payment_instalment/README.rst b/account_payment_instalment/README.rst new file mode 100644 index 000000000..6978b8115 --- /dev/null +++ b/account_payment_instalment/README.rst @@ -0,0 +1,45 @@ +Instalment in Payment Terms +=========================== +This module will help you to manage the payment terms with instalments. + +Features +======== + +* Instalment option in the payment term will helps to manage the payments of customer in instalments. + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: + Tintuk Tomin + +Contacts +-------- +* Mail Contact : odoo@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 +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/account_payment_instalment/__init__.py b/account_payment_instalment/__init__.py new file mode 100644 index 000000000..9a29485da --- /dev/null +++ b/account_payment_instalment/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Tintuk Tomin() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models diff --git a/account_payment_instalment/__manifest__.py b/account_payment_instalment/__manifest__.py new file mode 100644 index 000000000..841cc7f75 --- /dev/null +++ b/account_payment_instalment/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Tintuk Tomin() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Instalment in Payment Terms", + 'version': '12.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Accounting', + 'summary': 'Instalment in Payment Terms"', + 'description': """ + New type 'Instalment' in Odoo payment terms, Instalment in Payment Terms,Installment + """, + 'depends': ['account'], + 'data': [ + 'views/account_payment_term_view.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, +} diff --git a/account_payment_instalment/doc/RELEASE_NOTES.md b/account_payment_instalment/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..b46e354b9 --- /dev/null +++ b/account_payment_instalment/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 10.09.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit diff --git a/account_payment_instalment/models/__init__.py b/account_payment_instalment/models/__init__.py new file mode 100644 index 000000000..f8e984a77 --- /dev/null +++ b/account_payment_instalment/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Tintuk Tomin() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import account_payment_term + + diff --git a/account_payment_instalment/models/account_payment_term.py b/account_payment_instalment/models/account_payment_term.py new file mode 100644 index 000000000..70a650352 --- /dev/null +++ b/account_payment_instalment/models/account_payment_term.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Tintuk Tomin() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import api, fields, models, _ +from dateutil.relativedelta import relativedelta +from odoo.exceptions import ValidationError + + + +class AccountPaymentTermLine(models.Model): + _inherit = "account.payment.term.line" + + value = fields.Selection([ + ('balance', 'Balance'), + ('percent', 'Percent'), + ('fixed', 'Fixed Amount'), + ('instalment', 'Instalment') + ], string='Type', required=True, default='balance', + help="Select here the kind of valuation related to this payment term line.") + period_type = fields.Selection([ + ('daily', 'Day(s)'), + ('weekly', 'Week(s)'), + ('monthly', 'Month(s)'), + ('yearly', 'Year(s)'), + ], string='Period Type', default='monthly') + period_count = fields.Integer('Number of instalments', default=1) + + +class AccountPaymentTerm(models.Model): + _inherit = "account.payment.term" + + @api.constrains('line_ids') + @api.one + def _check_lines(self): + payment_term_lines = self.line_ids.sorted() + if payment_term_lines and payment_term_lines[-1].value not in ['balance', 'instalment']: + raise ValidationError(_('A Payment Term should have its last line of type Balance/Instalment.')) + lines = self.line_ids.filtered(lambda r: r.value == 'balance') or [] + if len(lines) > 1: + raise ValidationError(_('A Payment Term should have only one line of type Balance.')) + lines = self.line_ids.filtered(lambda r: r.value == 'instalment') or [] + if len(lines) > 1: + raise ValidationError(_('A Payment Term should have only one line of type Instalment.')) + lines = self.line_ids.filtered(lambda r: r.value in ['balance', 'instalment']) or [] + if len(lines) > 1: + raise ValidationError(_('A Payment Term should have only one of type Balance and Instalment.')) + lines = self.line_ids.filtered(lambda r: r.value == 'instalment') or [] + for line in lines: + if line.period_count == 0: + raise ValidationError(_('A Payment Term of type Instalment should have number of instalments more than 0.')) + + @api.one + def compute(self, value, date_ref=False): + date_ref = date_ref or fields.Date.today() + amount = value + sign = value < 0 and -1 or 1 + result = [] + if self.env.context.get('currency_id'): + currency = self.env['res.currency'].browse(self.env.context['currency_id']) + else: + currency = self.env.user.company_id.currency_id + # prec = currency.decimal_places + for line in self.line_ids: + if line.value == 'fixed': + amt = sign * currency.round(line.value_amount) + elif line.value == 'percent': + amt = currency.round(value * (line.value_amount / 100.0)) + elif line.value in ['balance', 'instalment']: + amt = currency.round(amount) + if line.value != 'instalment' and amt: + next_date = fields.Date.from_string(date_ref) + if line.option == 'day_after_invoice_date': + next_date += relativedelta(days=line.days) + elif line.option == 'fix_day_following_month': + next_first_date = next_date + relativedelta(day=1, months=1) # Getting 1st of next month + next_date = next_first_date + relativedelta(days=line.days - 1) + elif line.option == 'last_day_following_month': + next_date += relativedelta(day=31, months=1) # Getting last day of next month + elif line.option == 'last_day_current_month': + next_date += relativedelta(day=31, months=0) # Getting last day of next month + result.append((fields.Date.to_string(next_date), amt)) + amount -= amt + elif line.value == 'instalment' and amt: + count = line.period_count + instalment_amount = amt/count + while count > 0: + next_date = fields.Date.from_string(date_ref) + if line.period_type == 'daily': + next_date += relativedelta(days=count) + elif line.period_type == 'weekly': + next_date += relativedelta(weeks=count) + elif line.period_type == 'monthly': + next_date += relativedelta(months=count) + else: + next_date += relativedelta(years=count) + result.append((fields.Date.to_string(next_date), instalment_amount)) + count -= 1 + amount -= amt + amount = sum(amt for _, amt in result) + dist = currency.round(value - amount) + if dist: + last_date = result and result[-1][0] or fields.Date.today() + result.append((last_date, dist)) + return result diff --git a/account_payment_instalment/static/description/banner.png b/account_payment_instalment/static/description/banner.png new file mode 100644 index 000000000..10f7d69db Binary files /dev/null and b/account_payment_instalment/static/description/banner.png differ diff --git a/account_payment_instalment/static/description/cybro_logo.png b/account_payment_instalment/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/account_payment_instalment/static/description/cybro_logo.png differ diff --git a/account_payment_instalment/static/description/icon.png b/account_payment_instalment/static/description/icon.png new file mode 100644 index 000000000..01123a07f Binary files /dev/null and b/account_payment_instalment/static/description/icon.png differ diff --git a/account_payment_instalment/static/description/images/Installment-Payment-in-Odoo-1.png b/account_payment_instalment/static/description/images/Installment-Payment-in-Odoo-1.png new file mode 100644 index 000000000..cfb1c62d4 Binary files /dev/null and b/account_payment_instalment/static/description/images/Installment-Payment-in-Odoo-1.png differ diff --git a/account_payment_instalment/static/description/images/banner_account_reports_xlsx.jpg b/account_payment_instalment/static/description/images/banner_account_reports_xlsx.jpg new file mode 100644 index 000000000..b3ce5bdcc Binary files /dev/null and b/account_payment_instalment/static/description/images/banner_account_reports_xlsx.jpg differ diff --git a/account_payment_instalment/static/description/images/banner_accounting_dynamic_reports.gif b/account_payment_instalment/static/description/images/banner_accounting_dynamic_reports.gif new file mode 100644 index 000000000..d4530e466 Binary files /dev/null and b/account_payment_instalment/static/description/images/banner_accounting_dynamic_reports.gif differ diff --git a/account_payment_instalment/static/description/images/banner_bank_book_dynamic_reports.png b/account_payment_instalment/static/description/images/banner_bank_book_dynamic_reports.png new file mode 100644 index 000000000..d74daba97 Binary files /dev/null and b/account_payment_instalment/static/description/images/banner_bank_book_dynamic_reports.png differ diff --git a/account_payment_instalment/static/description/images/banner_custom_gantt_view.gif b/account_payment_instalment/static/description/images/banner_custom_gantt_view.gif new file mode 100644 index 000000000..a5ee254f9 Binary files /dev/null and b/account_payment_instalment/static/description/images/banner_custom_gantt_view.gif differ diff --git a/account_payment_instalment/static/description/images/banner_dynamic_reports_pdf.png b/account_payment_instalment/static/description/images/banner_dynamic_reports_pdf.png new file mode 100644 index 000000000..16745e06c Binary files /dev/null and b/account_payment_instalment/static/description/images/banner_dynamic_reports_pdf.png differ diff --git a/account_payment_instalment/static/description/images/banner_report_maker.gif b/account_payment_instalment/static/description/images/banner_report_maker.gif new file mode 100644 index 000000000..db6305f39 Binary files /dev/null and b/account_payment_instalment/static/description/images/banner_report_maker.gif differ diff --git a/account_payment_instalment/static/description/images/checked.png b/account_payment_instalment/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/account_payment_instalment/static/description/images/checked.png differ diff --git a/account_payment_instalment/static/description/images/cybrosys.png b/account_payment_instalment/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/account_payment_instalment/static/description/images/cybrosys.png differ diff --git a/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-1.png b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-1.png new file mode 100644 index 000000000..683af5f99 Binary files /dev/null and b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-1.png differ diff --git a/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-2.png b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-2.png new file mode 100644 index 000000000..99c6ebc6d Binary files /dev/null and b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-2.png differ diff --git a/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-3.png b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-3.png new file mode 100644 index 000000000..087766985 Binary files /dev/null and b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-3.png differ diff --git a/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-4.png b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-4.png new file mode 100644 index 000000000..f3caa138d Binary files /dev/null and b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-4.png differ diff --git a/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-5.png b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-5.png new file mode 100644 index 000000000..ce9c67b22 Binary files /dev/null and b/account_payment_instalment/static/description/images/instalment-payment-term-cybrosys-5.png differ diff --git a/account_payment_instalment/static/description/index.html b/account_payment_instalment/static/description/index.html new file mode 100644 index 000000000..4cda132a7 --- /dev/null +++ b/account_payment_instalment/static/description/index.html @@ -0,0 +1,566 @@ +
+ cybrosys-logo
+ +
+
+
+

Instalment in Payment Types

+

Instalment feature in the payment terms of invoice

+
+

Key Highlights

+
    +
  • check + Instalment payment method for customers. +
  • +
  • check + Different types of instalments. +
  • +
  • check + Post journal entries with due dates. +
  • +
+ +
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ Did you ever search for the provision to make the customer payment as instalments? + Here is the solution. You can configure a new payment term with the feature of instalment. +

+
+ +
+ +

Instalment in Payments

+
+
    + +
  • + check + Provision for instalment in the payment terms. +
  • + +
  • + check + Instalment by days, months and years. +
  • + +
  • + check + Period type and number of instalments in the payment lines. + +
  • + + + +
+
+ + + +
+ +
+

Screenshots

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

Video

+
+

Intalment in payment terms

+ +
+ Cybrosys Cover Video +
+ +
+
+ + +
+
    +
+
+
+
+
+
+ +
+

Suggested Products

+
+ +
+ + +
+

Our Service

+
+ +
+ +
+
+

Our Industries

+
+ +
+
+
+
+ Odoo Industry
+
+
+

+ + Trading

+

+ Easily procure and sell your products.

+
+
+
+
+
+ Odoo Industry +
+
+
+

+ + Manufacturing

+

+ Plan, track and schedule your operations.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Restaurant

+

+ Run your bar or restaurant methodical.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + POS

+

+ Easy configuring and convivial selling.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + E-commerce & Website

+

+ Mobile friendly, awe-inspiring product pages.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Hotel Management

+

+ An all-inclusive hotel management application.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Education

+

+ A Collaborative platform for educational management.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + Service Management

+

+ Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+ +

If you have anything to share with us based on your use of this module, + please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+ +
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+ +
+
+
+
+
+ +
+ + + + + + + + +
+
+
+
+ diff --git a/account_payment_instalment/views/account_payment_term_view.xml b/account_payment_instalment/views/account_payment_term_view.xml new file mode 100644 index 000000000..3ec66ad1f --- /dev/null +++ b/account_payment_instalment/views/account_payment_term_view.xml @@ -0,0 +1,60 @@ + + + + + account.payment.term.line.tree + account.payment.term.line + + + + + + + + + + + account.payment.term.form + account.payment.term + + +

+ The last line's computation type should be "Balance or Instalment" to ensure that the whole amount will be allocated. +

+
+
+ + + az.account.payment.term.line.form + account.payment.term.line + + + + {'invisible':[('value','in',['balance','instalment'])]} + + + {'invisible':[('value','in',['balance','instalment'])]} + + + {'invisible':[('value','=','instalment')]} + + + {'invisible':[('value','=','instalment')]} + + + {'invisible':[('value','=','instalment')]} + + + {'invisible':['|',('option','!=', 'day_after_invoice_date'),('value','=','instalment')]} + + + + + + + + + + +
+
\ No newline at end of file