@ -0,0 +1,55 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
Interest for Overdue Invoice |
||||
|
============================ |
||||
|
* Easy to calculate Interest for Overdue invoices. |
||||
|
* It will manage journal items while you calculate amount in invoice. |
||||
|
* you can use different accounts for interest journal entries from payment terms menu |
||||
|
* Interest can be calculated for different period ratios (daily, weekly and monthly) |
||||
|
|
||||
|
Configuration |
||||
|
============ |
||||
|
No additional configurations needed |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configurations needed |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer: (V15) Naveen Krishna T, |
||||
|
(V16) Ayana KP, |
||||
|
(V18) Ammu Raj, Ayana KP, |
||||
|
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 <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,45 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Interest for Overdue Invoice', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Accounting', |
||||
|
'summary': """This module helps to manage Interest on Overdue Invoices.""", |
||||
|
'description': "This module helps to calculate daily, weekly or monthly" |
||||
|
"Interest for Overdue Invoices based on payment term" |
||||
|
"configuration.", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['sale', 'account'], |
||||
|
'data': [ |
||||
|
'views/account_payment_term_views.xml', |
||||
|
'views/account_move_views.xml', |
||||
|
'data/ir_cron_data.xml', |
||||
|
'views/report_invoice.xml' |
||||
|
], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Scheduled action for interest rate check --> |
||||
|
<data noupdate="1"> |
||||
|
<record id="ir_cron_daily_interest_compute" model="ir.cron"> |
||||
|
<field name="name">Account:Daily Invoice Interest check</field> |
||||
|
<field name="model_id" ref="account.model_account_move"/> |
||||
|
<field name="state">code</field> |
||||
|
<field name="code">model._get_interest_check()</field> |
||||
|
<field name="active" eval="False"/> |
||||
|
<field name="user_id" ref="base.user_root"/> |
||||
|
<field name="interval_number">1</field> |
||||
|
<field name="interval_type">days</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,6 @@ |
|||||
|
## Module <account_interest_on_overdue_invoice> |
||||
|
|
||||
|
#### 19.11.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial commit for Interest for Overdue Invoice. |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import account_move |
||||
|
from . import account_payment_term |
@ -0,0 +1,193 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import math |
||||
|
from dateutil import relativedelta |
||||
|
from odoo import api, fields, models, _ |
||||
|
from odoo.exceptions import ValidationError |
||||
|
|
||||
|
|
||||
|
class AccountMove(models.Model): |
||||
|
""" Extending model Invoice model to compute the interest amount for |
||||
|
overdue invoices based on the chosen payment term configurations.""" |
||||
|
|
||||
|
_inherit = "account.move" |
||||
|
|
||||
|
interest_amount = fields.Monetary(string='Interest Amount', readonly=True, |
||||
|
help='The amount of interest accrued.') |
||||
|
interest_overdue_act = fields.Boolean(related="invoice_payment_term_id" |
||||
|
".interest_overdue_act", |
||||
|
help='Flag indicating whether overdue interest is active.') |
||||
|
interest_calculated_period = fields.Char(string="Interest calculated date", |
||||
|
help='The date when interest was calculated.') |
||||
|
interest_type = fields.Selection(related="invoice_payment_term_id" |
||||
|
".interest_type", |
||||
|
help='The type of interest applied.') |
||||
|
interest_percentage = fields.Float(related="invoice_payment_term_id" |
||||
|
".interest_percentage", |
||||
|
help='The percentage rate of interest applied.') |
||||
|
|
||||
|
def get_period_time(self, today_date): |
||||
|
""" Compute period duration based on Interest duration type. """ |
||||
|
self.ensure_one() |
||||
|
r_obj = relativedelta. \ |
||||
|
relativedelta(today_date, self.invoice_date_due) |
||||
|
if self.invoice_payment_term_id.interest_type == 'monthly': |
||||
|
period = (r_obj.years * 12) + r_obj.months |
||||
|
if r_obj and r_obj.days > 0: |
||||
|
period = period + 1 |
||||
|
elif self.invoice_payment_term_id.interest_type == 'weekly': |
||||
|
period = math.ceil( |
||||
|
(today_date - self.invoice_date_due).days / 7) |
||||
|
else: |
||||
|
period = (today_date - self.invoice_date_due).days |
||||
|
return period |
||||
|
|
||||
|
def action_interest_compute(self): |
||||
|
""" Action for computing Interest amount based on the chosen payment |
||||
|
term configurations""" |
||||
|
today_date = fields.Date.today() |
||||
|
for rec in self: |
||||
|
if rec.invoice_date_due \ |
||||
|
and rec.invoice_date_due < fields.Date.today() \ |
||||
|
and rec.state == 'draft' \ |
||||
|
and rec.move_type == 'out_invoice' \ |
||||
|
and rec.interest_overdue_act \ |
||||
|
and rec.invoice_payment_term_id.interest_percentage > 0: |
||||
|
period = rec.get_period_time(today_date) |
||||
|
if rec.invoice_payment_term_id.interest_type == 'monthly': |
||||
|
if rec.interest_calculated_period \ |
||||
|
and rec.interest_calculated_period == str(period) \ |
||||
|
+ "-m": |
||||
|
raise ValidationError(_('Your payment term is ' |
||||
|
'monthly, and you can update ' |
||||
|
'it only once in a month.')) |
||||
|
rec.interest_calculated_period = str(period) + "-m" |
||||
|
elif rec.invoice_payment_term_id.interest_type == 'weekly': |
||||
|
if rec.interest_calculated_period \ |
||||
|
and rec.interest_calculated_period == str(period) \ |
||||
|
+ "-w": |
||||
|
raise ValidationError(_('Your payment term is weekly, ' |
||||
|
'and you can update it only ' |
||||
|
'once in a week.')) |
||||
|
rec.interest_calculated_period = str(period) + "-w" |
||||
|
else: |
||||
|
if rec.interest_calculated_period \ |
||||
|
and rec.interest_calculated_period == str(period) \ |
||||
|
+ "-d": |
||||
|
raise ValidationError(_('Your payment term is daily, ' |
||||
|
'and you can update it only ' |
||||
|
'once in a day.')) |
||||
|
rec.interest_calculated_period = str(period) + "-d" |
||||
|
interest_line = rec.invoice_line_ids.search( |
||||
|
[('name', '=', 'Interest Amount for Overdue'), |
||||
|
('move_id', '=', rec.id)], |
||||
|
limit=1) |
||||
|
if interest_line: |
||||
|
rec.invoice_line_ids = ([(2, interest_line.id, 0)]) |
||||
|
rec.interest_amount = rec.amount_total * rec \ |
||||
|
.invoice_payment_term_id.interest_percentage * period / 100 |
||||
|
vals = {'name': 'Interest Amount for Overdue', |
||||
|
'price_unit': rec.interest_amount, |
||||
|
'quantity': 1, |
||||
|
} |
||||
|
if rec.invoice_payment_term_id.interest_account_id: |
||||
|
vals.update({ |
||||
|
'account_id': rec.invoice_payment_term_id |
||||
|
.interest_account_id.id}) |
||||
|
if rec.interest_amount > 0: |
||||
|
rec.invoice_line_ids = ([(0, 0, vals)]) |
||||
|
elif rec.interest_amount > 0: |
||||
|
rec.action_interest_reset() |
||||
|
|
||||
|
def _get_interest_check(self): |
||||
|
""" Method for Interest computation via scheduled action """ |
||||
|
|
||||
|
today_date = fields.Date.today() |
||||
|
for rec in self.sudo().search([('state', '=', 'draft')]): |
||||
|
if rec.invoice_date_due and rec.invoice_date_due < today_date \ |
||||
|
and rec.state == 'draft' \ |
||||
|
and rec.move_type == 'out_invoice' \ |
||||
|
and rec.interest_overdue_act \ |
||||
|
and rec.invoice_payment_term_id.interest_percentage > 0: |
||||
|
period = rec.get_period_time(today_date) |
||||
|
if rec.invoice_payment_term_id.interest_type == 'monthly': |
||||
|
if rec.interest_calculated_period \ |
||||
|
and rec.interest_calculated_period == str(period) \ |
||||
|
+ "-m": |
||||
|
continue |
||||
|
rec.interest_calculated_period = str(period) + "-m" |
||||
|
elif rec.invoice_payment_term_id.interest_type == 'weekly': |
||||
|
if rec.interest_calculated_period \ |
||||
|
and rec.interest_calculated_period == str(period) \ |
||||
|
+ "-w": |
||||
|
continue |
||||
|
rec.interest_calculated_period = str(period) + "-w" |
||||
|
else: |
||||
|
if rec.interest_calculated_period \ |
||||
|
and rec.interest_calculated_period == str(period) \ |
||||
|
+ "-d": |
||||
|
continue |
||||
|
rec.interest_calculated_period = str(period) + "-d" |
||||
|
interest_line = rec.invoice_line_ids.search( |
||||
|
[('name', '=', 'Interest Amount for Overdue'), |
||||
|
('move_id', '=', rec.id)], limit=1) |
||||
|
if interest_line: |
||||
|
rec.invoice_line_ids = ([(2, interest_line.id, 0)]) |
||||
|
rec.interest_amount = rec.amount_total * rec \ |
||||
|
.invoice_payment_term_id.interest_percentage * period / 100 |
||||
|
vals = {'name': 'Interest Amount for Overdue', |
||||
|
'price_unit': rec.interest_amount, |
||||
|
'quantity': 1, |
||||
|
} |
||||
|
if rec.invoice_payment_term_id.interest_account_id: |
||||
|
vals.update({ |
||||
|
'account_id': rec.invoice_payment_term_id. |
||||
|
interest_account_id.id}) |
||||
|
if rec.interest_amount > 0: |
||||
|
rec.invoice_line_ids = ([(0, 0, vals)]) |
||||
|
elif rec.interest_amount > 0: |
||||
|
rec.action_interest_reset() |
||||
|
|
||||
|
def action_interest_reset(self): |
||||
|
"""Method for resetting the interest lines and Interest amount in |
||||
|
Invoice""" |
||||
|
self.interest_amount = 0 |
||||
|
interest_line = self.invoice_line_ids.search( |
||||
|
[('name', '=', 'Interest Amount for Overdue'), |
||||
|
('move_id', '=', self.id)], limit=1) |
||||
|
if interest_line: |
||||
|
self.invoice_line_ids = ([(2, interest_line.id, 0)]) |
||||
|
self.interest_calculated_period = False |
||||
|
|
||||
|
@api.onchange('invoice_payment_term_id', 'invoice_line_ids', |
||||
|
'invoice_date_due') |
||||
|
def _onchange_invoice_payment_term_id(self): |
||||
|
"""Method for removing interest from Invoice when user changes dependent |
||||
|
values of interest.""" |
||||
|
for rec in self: |
||||
|
if rec.move_type == 'out_invoice': |
||||
|
rec.interest_amount = 0 |
||||
|
interest_line = rec.invoice_line_ids.search( |
||||
|
[('name', '=', 'Interest Amount for Overdue')], limit=1) |
||||
|
if interest_line: |
||||
|
rec.invoice_line_ids = ([(2, interest_line.id, 0)]) |
||||
|
rec.interest_calculated_period = False |
||||
|
return |
@ -0,0 +1,57 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj(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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models, _ |
||||
|
from odoo.exceptions import ValidationError |
||||
|
|
||||
|
|
||||
|
class AccountPaymentTerms(models.Model): |
||||
|
""" Module for extending account.payment.term model to add interest |
||||
|
computation configuration features for computation of Interest in overdue |
||||
|
invoices.""" |
||||
|
_inherit = "account.payment.term" |
||||
|
|
||||
|
interest_overdue_act = fields.Boolean(string="Interest on Overdue Invoices") |
||||
|
interest_type = fields.Selection( |
||||
|
string='Interest Type', help="Base duration for interest calculation", |
||||
|
selection=[('daily', 'Daily'), |
||||
|
('weekly', 'Weekly'), |
||||
|
('monthly', 'Monthly')], default='daily', copy=False) |
||||
|
interest_percentage = fields.Float(string="Interest Percentage", |
||||
|
default="0", digits=(12, 6), |
||||
|
help="Interest percentage ratio per" |
||||
|
" selected Interest type duration.") |
||||
|
interest_account_id = fields.Many2one('account.account', |
||||
|
string='Account for Interest', |
||||
|
company_dependent=True, |
||||
|
domain="[('deprecated', '=', " |
||||
|
"False),('internal_group'," |
||||
|
"'=','income')]", |
||||
|
help="Account used for creating " |
||||
|
"accounting entries.") |
||||
|
|
||||
|
@api.constrains('interest_percentage') |
||||
|
def _check_interest_percentage(self): |
||||
|
""" check constrains for validating the interest rate in percentage |
||||
|
is not negative""" |
||||
|
for rec in self: |
||||
|
if rec.interest_overdue_act and rec.interest_percentage <= 0: |
||||
|
raise ValidationError(_('Enter Positive value as Interest ' |
||||
|
'percentage')) |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 212 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 736 KiB |
After Width: | Height: | Size: 38 KiB |
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Inheriting account.move for adding interest related fields --> |
||||
|
<record id="view_move_form" model="ir.ui.view"> |
||||
|
<field name="name">account.move.inherit.account.interest</field> |
||||
|
<field name="model">account.move</field> |
||||
|
<field name="inherit_id" ref="account.view_move_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='tax_totals']" position="before"> |
||||
|
<field name="interest_overdue_act" invisible="1"/> |
||||
|
<button name="action_interest_compute" |
||||
|
string='(Update Interest)' |
||||
|
type='object' groups="account.group_account_invoice" |
||||
|
invisible=" not interest_overdue_act or state in ('posted','cancel') or move_type != 'out_invoice'" |
||||
|
class="oe_edit_only"/> |
||||
|
<button name="action_interest_reset" string='(Reset)' |
||||
|
type='object' |
||||
|
groups="sales_team.group_sale_manager,account.group_account_invoice" |
||||
|
invisible=" not interest_overdue_act or state in ('posted','cancel') or move_type != 'out_invoice'" |
||||
|
class="oe_edit_only"/> |
||||
|
<field name="interest_amount" widget="monetary" |
||||
|
invisible=" not interest_overdue_act or state in ('posted','cancel') or move_type != 'out_invoice'"/> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,24 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Inheriting account.payment.term for adding interest related fields --> |
||||
|
<record id="view_payment_term_form" model="ir.ui.view"> |
||||
|
<field name="name">account.payment.term.inherit.account.interest</field> |
||||
|
<field name="model">account.payment.term</field> |
||||
|
<field name="inherit_id" ref="account.view_payment_term_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//group[1]" position="after"> |
||||
|
<group> |
||||
|
<field name="interest_overdue_act"/> |
||||
|
<field name="interest_type" |
||||
|
required="interest_overdue_act" |
||||
|
invisible="not interest_overdue_act"/> |
||||
|
<field name="interest_percentage" |
||||
|
required="interest_overdue_act" |
||||
|
invisible="not interest_overdue_act"/> |
||||
|
<field name="interest_account_id" |
||||
|
invisible="not interest_overdue_act"/> |
||||
|
</group> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Inheriting invoice template to add interest rate on invoice document --> |
||||
|
<template id="report_invoice_document_inherit_interest" |
||||
|
inherit_id="account.report_invoice_document"> |
||||
|
<xpath expr="//p[@name='payment_communication']" position="before"> |
||||
|
<t t-if="o.interest_amount != 0"> |
||||
|
<table border="0"> |
||||
|
<tr> |
||||
|
<td>Interest Type :</td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.interest_type"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>Interest Ratio :</td> |
||||
|
<td class="text-right"> |
||||
|
<span t-field="o.interest_percentage"/> |
||||
|
% |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</t> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |