diff --git a/sales_incentive_calculation/README.rst b/sales_incentive_calculation/README.rst new file mode 100644 index 000000000..2900a5d0d --- /dev/null +++ b/sales_incentive_calculation/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-OPL--1-red.svg + :target: https://www.odoo.com/documentation/17.0/legal/licenses.html#odoo-apps + :alt: License: OPL-1 + +Sales Incentives +================ +Shows the Incentive Calculation + +Configuration +============= +* No additional configurations needed + +License +------- +Odoo Proprietary License v1.0 (OPL-1) +(https://www.odoo.com/documentation/user/12.0/legal/licenses/licenses.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V13) Nimisha Murali, + (V15) Neeraj, + (V16) Javid, + (V17) Aswin A K + Contact: odoo@cybrosys.com + +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 +========== +.. 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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/sales_incentive_calculation/__init__.py b/sales_incentive_calculation/__init__.py new file mode 100644 index 000000000..f27dedf09 --- /dev/null +++ b/sales_incentive_calculation/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import models diff --git a/sales_incentive_calculation/__manifest__.py b/sales_incentive_calculation/__manifest__.py new file mode 100644 index 000000000..975636e9d --- /dev/null +++ b/sales_incentive_calculation/__manifest__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +{ + 'name': 'Sales Incentives', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': "This module will calculate incentive for each salesperson" + " based on sale target in gamification", + 'description': "This module will calculate incentive for salesperson in " + "gamification,incentive version 17," + "salesman,extra salary,salesman commision," + " sale target,sale achievement,gamification,challenge," + " crm,incentive,goal achievement,goal,extra pay," + "sales target, rewards,target complete,employee,extra work," + " work salary, achievement", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://cybrosys.com', + 'depends': ['sale', 'crm', 'gamification', 'account'], + 'data': [ + 'security/ir.model.access.csv', + 'views/sales_incentive_views.xml', + 'views/incentive_approve_views.xml', + 'views/goal_views.xml', + 'views/gamification_challenge_views.xml', + 'report/incentive_report.xml', + 'views/calculate_incentive_views.xml', + 'views/sales_incentive_calculation_menus.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'OPL-1', + 'installable': True, + 'auto_install': False, + 'application': False, + 'price': 79, + 'currency': 'EUR', +} diff --git a/sales_incentive_calculation/doc/RELEASE_NOTES.md b/sales_incentive_calculation/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..976419708 --- /dev/null +++ b/sales_incentive_calculation/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 19.02.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Sales Incentives diff --git a/sales_incentive_calculation/models/__init__.py b/sales_incentive_calculation/models/__init__.py new file mode 100644 index 000000000..57a0c1f1b --- /dev/null +++ b/sales_incentive_calculation/models/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import calculate_incentive +from . import gamification_challenge +from . import goal +from . import incentive_approve +from . import sales_incentive +from . import select_incentive diff --git a/sales_incentive_calculation/models/calculate_incentive.py b/sales_incentive_calculation/models/calculate_incentive.py new file mode 100644 index 000000000..7746deffc --- /dev/null +++ b/sales_incentive_calculation/models/calculate_incentive.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import fields, models, _ +from odoo.exceptions import UserError + + +class CalculateIncentive(models.Model): + """ + This class represents the model for calculating and tracking sales + incentives. Each instance of this model corresponds to a specific + calculation of incentives for a salesperson based on their achieved goals. + """ + _name = 'calculate.incentive' + _description = 'Calculate Incentive' + + salesperson_id = fields.Many2one( + 'res.users', + string='Salesperson', + help='salesperson associated with the scheme' + ) + goal = fields.Float( + string='Target', + help='Target amount that the salesperson needs to achieve.' + ) + achieved = fields.Float( + string='Achievement', + help='Achieved amount by the salesperson.' + ) + achievement_percentage = fields.Float( + string='Achievement %', + help='Achievement in percentage.' + ) + incentive = fields.Float( + string='Incentive', + help='Total incentive earned by the salesperson.') + check = fields.Boolean(string="Check", + help="Used to check if it is paid or not") + start_date = fields.Date( + string='Start Date', + help='The start date for the period associated with the goal.' + ) + end_date = fields.Date( + string='End Date', + help='The end date for the period associated with the goal.' + ) + date_check = fields.Boolean( + compute='_compute_date_check', + help='Computed field indicating whether the dates meet end date.') + status = fields.Selection( + [('unpaid', 'Not Paid'), + ('submit', 'Submitted To Accountant'), ('paid', 'Paid'), + ('reject', 'Rejected')], string='State', default='unpaid', + help='Status of the record.' + ) + + def _compute_date_check(self): + """ + Compute the date check for each record. + This method iterates over the records and checks if the end date + is less than or equal to the current date. If true, it sets the + date_check field to True; otherwise, it sets it to False. + :return: None + """ + for rec in self: + rec.date_check = False + if rec.end_date <= fields.Date.today(): + rec.date_check = True + + def action_submit_to_accountant(self): + """ + Creates an 'approve.incentive' record for the calculated incentive + amount, and updates the status to 'Submitted To Accountant'. + If the incentive amount is 0.0, a UserError is raised. + """ + if self.incentive == 0.0: + raise UserError(_('Incentive amount is 0.0')) + data = { + 'salesperson_id': self.salesperson_id.id, + 'goal': self.goal, + 'achieved': self.achieved, + 'achievement_percentage': self.achievement_percentage, + 'incentive': self.incentive, + 'status': 'submit', + 'start_date': self.start_date, + 'end_date': self.end_date, + } + self.env['approve.incentive'].create(data) + self.check = True + self.status = 'submit' diff --git a/sales_incentive_calculation/models/gamification_challenge.py b/sales_incentive_calculation/models/gamification_challenge.py new file mode 100644 index 000000000..563f46d4b --- /dev/null +++ b/sales_incentive_calculation/models/gamification_challenge.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import api, fields, models, _ +from odoo.exceptions import UserError + + +class Challenge(models.Model): + """ + Extends the base 'gamification.challenge' model to include an additional + field 'incentive_calculation' that allows specifying whether the challenge + should be used in incentive calculations. + """ + _inherit = 'gamification.challenge' + + incentive_calculation = fields.Boolean( + string='Use in incentive calculation', copy=False) + + @api.onchange('incentive_calculation') + def _onchange_incentive_calculation(self): + """ + Checks if any gamification_challenge is + active for incentive_calculation + """ + if self.search([('incentive_calculation', '=', True)]): + if self.incentive_calculation: + raise UserError( + _('Another goal already active for incentive calculation')) diff --git a/sales_incentive_calculation/models/goal.py b/sales_incentive_calculation/models/goal.py new file mode 100644 index 000000000..e19cf71a3 --- /dev/null +++ b/sales_incentive_calculation/models/goal.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import fields, models + + +class Goals(models.Model): + """ + Extends the base 'gamification.goal' model to include additional fields + 'target_achievement_percentage' and 'incentive'. + The 'target_achievement_percentage' field is computed based on the current + and target goals, and 'incentive' represents the calculated incentive for + the goal. + """ + _inherit = 'gamification.goal' + + target_achievement_percentage = fields.Float( + string='percentage', + compute='_compute_target_achievement_percentage', + help='Target Achievement Percentage') + incentive = fields.Float(string='Incentive') + + def _compute_target_achievement_percentage(self): + """ + Calculates target_achievement_percentage + """ + for rec in self: + rec.target_achievement_percentage = False + if rec.target_goal != 0: + rec.target_achievement_percentage = ( + rec.current/rec.target_goal)*100 diff --git a/sales_incentive_calculation/models/incentive_approve.py b/sales_incentive_calculation/models/incentive_approve.py new file mode 100644 index 000000000..fe80f2453 --- /dev/null +++ b/sales_incentive_calculation/models/incentive_approve.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import fields, models, _ +from odoo.exceptions import UserError + + +class SalesIncentive(models.Model): + """ + This class represents the 'approve.incentive' model, which is used to + approve and manage sales incentives for salespersons. It includes fields for + tracking salesperson details, incentive information, and the approval + status. + """ + _name = 'approve.incentive' + _description = 'Approve Incentive' + _rec_name = 'salesperson_id' + + salesperson_id = fields.Many2one( + 'res.users', string='Salesperson', + help='Salesperson associated with the scheme.') + name = fields.Char(string='Name') + goal = fields.Float( + string='Target', + help='Target amount that the salesperson needs to achieve.') + achieved = fields.Float(string='Achievement', + help='Achieved amount by the salesperson.') + achievement_percentage = fields.Float(string='Achievement %', + help='Achievement in percentage.') + incentive = fields.Float(string='Incentive', + help='Total incentive earned by the salesperson.') + status = fields.Selection([('unpaid', 'Not Paid'), + ('submit', 'Submitted To Accountant'), + ('paid', 'Paid'), ('reject', 'Rejected')], + string='State', default='unpaid', + help='Status of the incentive.' + ) + journal_id = fields.Many2one('account.journal', + string='Journal', + help='Select the accounting journal.' + ) + check = fields.Boolean(string="Check", + help="Used to check if it is paid or not") + debit_account_id = fields.Many2one( + 'account.account', + domain=[('deprecated', '=', False)], + string='Debit account', + help='Select the debit account.' + ) + credit_account_id = fields.Many2one( + 'account.account', + domain=[('deprecated', '=', False)], + string='Credit account', + help='Select the credit account.' + ) + start_date = fields.Date( + string='Start Date', + help='The start date for the period associated with the scheme.') + end_date = fields.Date( + string='End Date', + help='The end date for the period associated with the scheme.' + ) + + def action_approve(self): + """ + Approves the incentive and creates account_move with the + corresponding values. Changes the state. + """ + if not (self.journal_id + and self.debit_account_id and self.credit_account_id): + raise UserError( + _('You must enter journal, debit account and credit account')) + lines = [fields.Command.create({ + 'account_id': self.credit_account_id.id, + 'partner_id': self.salesperson_id.partner_id.id, + 'credit': self.incentive, + 'name': 'Incentive' + }), fields.Command.create({ + 'account_id': self.debit_account_id.id, + 'partner_id': self.salesperson_id.partner_id.id, + 'debit': self.incentive + })] + val = { + 'date': fields.Date.today(), + 'journal_id': self.journal_id.id, + 'line_ids': lines + } + self.env['account.move'].create(val) + calc = self.env['calculate.incentive'].search( + [('salesperson_id', '=', self.salesperson_id.id), + ('start_date', '=', self.start_date), + ('end_date', '=', self.end_date), + ('status', '=', 'submit')]) + self.write({ + 'status': 'paid', + 'check': True + }) + calc.write({ + 'status': 'paid', + 'check': True + }) + + def action_rejected(self): + """ + Rejects the incentive request and changes the state. + """ + self.write({ + 'status': 'reject', + 'check': True + }) + calc = self.env['calculate.incentive'].search( + [('salesperson_id', '=', self.salesperson_id.id), + ('start_date', '=', self.start_date), + ('end_date', '=', self.end_date), + ('status', '=', 'submit')]) + calc.write({ + 'status': 'reject', + 'check': True + }) diff --git a/sales_incentive_calculation/models/sales_incentive.py b/sales_incentive_calculation/models/sales_incentive.py new file mode 100644 index 000000000..0c72fb0f9 --- /dev/null +++ b/sales_incentive_calculation/models/sales_incentive.py @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import api, fields, models, _ +from odoo.exceptions import UserError + + +class SalesIncentive(models.Model): + """ + This class represents the Sales Incentive model, which is used to configure + incentive schemes for sales personnel. It allows defining various parameters + such as the calculation method, incentive tiers, and activation status. + """ + _name = 'sales.incentive' + _description = 'Sales Incentive' + + name = fields.Char( + string='Name', + help='Enter the name for your record. This field is required.', + required=True) + calculation_method = fields.Selection( + [('linear', 'Linear'), ('step', 'Tiered Commission Plan')], + help='Tired : the amount of Incentive ' + 'increases as the sales person achieves more.', + string='Based On', default='linear') + select_incentive_ids = fields.One2many( + 'select.incentive', 'sales_incentive_id') + active_calculation = fields.Boolean( + string='Active', + copy=False, + help='This field controls whether the scheme is active or not.') + + @api.onchange('active_calculation') + def _onchange_active_calculation(self): + """ + Checks for any active_calculation, if any returns a user error. + """ + if self.search([('active_calculation', '=', True)]): + if self.active_calculation: + raise UserError( + _('Another scheme already active for incentive calculation') + ) + + def action_incentive_compute(self): + """ + Computes calculate_incentive and returns it. + """ + calc = self.env['calculate.incentive'].search([]) + challenge = self.env['gamification.challenge'].search( + [('incentive_calculation', '=', True)]) + docs = self.env['gamification.goal'].search( + [('challenge_id', 'in', challenge.ids)]) + self.send_warnings(challenge, docs) + unlink_date_list = self.filter_expired_calc_records(calc, docs) + self.unlink_expired_calc_records(unlink_date_list) + for goal in docs: + incentive = 0.0 + if self.calculation_method == 'linear': + incentive = self.calculate_linear_incentive(goal, incentive) + else: + incentive = self.calculate_tiered_incentive(goal) + data = { + 'salesperson_id': goal.user_id.id, + 'goal': goal.target_goal, + 'achieved': goal.current, + 'achievement_percentage': goal.target_achievement_percentage, + 'incentive': incentive, + 'start_date': goal.start_date, + 'end_date': goal.end_date, + 'status': 'unpaid', + } + self.env['calculate.incentive'].create(data) + return { + 'name': 'Incentive', + 'type': 'ir.actions.act_window', + 'view_mode': 'tree', + 'res_model': 'calculate.incentive', + 'target': 'current', + } + + def calculate_linear_incentive(self, goal, incentive, highest=0): + """Find the incentive by using linear method""" + for select_line in self.select_incentive_ids: + if ((goal.target_achievement_percentage >= + select_line.upto_percent) + and (select_line.upto_percent > highest)): + highest = select_line.upto_percent + if select_line.incentive_type == 'percent': + incentive = goal.current * ( + select_line.reward / 100) + else: + incentive = select_line.reward + goal.incentive = incentive + return incentive + + def send_warnings(self, challenge, docs): + """It is a method to raise warnings + :param1 challenge + :param2 docs that is goals of the challenge + """ + if not (challenge and docs): + raise UserError( + _('There is on active challenge and goal for calculation')) + if docs.filtered(lambda goal: not goal.end_date): + error_users = "'s, ".join(docs.mapped('user_id.name')) + raise UserError( + _(f"The goal {error_users}'s " + f"{docs[0].display_name} has no end date.")) + + def filter_expired_calc_records(self, calc, docs): + """ + Filter calculate_incentive records based on expiration date. + """ + unlink_date_list = [] + for record in calc: + if record.end_date >= (fields.Date.today()): + record.unlink() + elif docs[0].end_date == record.end_date: + unlink_date_list.append(record.id) + return unlink_date_list + + def unlink_expired_calc_records(self, unlink_date_list): + """ + Unlink expired calculate_incentive records. + """ + self.env['calculate.incentive'].search( + [('id', 'in', unlink_date_list)]).unlink() + + def calculate_tiered_incentive(self, goal): + """ + Calculate incentive for tiered commission plan. + """ + incentive = 0.0 + sum_value = 0.0 + old = 0.0 + final_incentive = 0.0 + + for select_line in self.select_incentive_ids.sorted( + lambda x: x.upto_percent): + if (goal.target_achievement_percentage + >= select_line.upto_percent): + new = (goal.target_goal * ( + select_line.upto_percent / 100)) - old + sum_value += new + if select_line.incentive_type == 'percent': + incentive += new * (select_line.reward / 100) + else: + incentive += select_line.reward + old = goal.target_goal * ( + select_line.upto_percent / 100) + elif sum_value < goal.current and sum_value != 0.0: + last_incentive = goal.current - sum_value + if select_line.incentive_type == 'percent': + final_incentive = last_incentive * ( + select_line.reward / 100) + else: + final_incentive = select_line.reward + sum_value += goal.current - sum_value + incentive += final_incentive + goal.incentive = incentive + return incentive diff --git a/sales_incentive_calculation/models/select_incentive.py b/sales_incentive_calculation/models/select_incentive.py new file mode 100644 index 000000000..314f86c48 --- /dev/null +++ b/sales_incentive_calculation/models/select_incentive.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: ASWIN A K (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 +# (OPL-1) It is forbidden to publish, distribute, sublicense, or sell +# copies of the Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import fields, models + + +class IncentiveSettings(models.Model): + """This model is used to handle incentive criteria""" + _name = 'select.incentive' + _description = 'Select Incentive Settings' + + upto_percent = fields.Float( + string='Achievement %', + help='This field represents the percentage of the achievement.') + reward = fields.Float(string='Reward', help='Specify the reward amount') + incentive_type = fields.Selection( + [('percent', 'Percentage'), + ('amount', 'Amount')], string='Type', default='percent', + help='Whether the reward is calculated as a percentage or an amount.') + sales_incentive_id = fields.Many2one( + 'sales.incentive', + 'Incentive', + help='This field establishes a link between the ' + 'current record and a specific sales incentive.') diff --git a/sales_incentive_calculation/report/incentive_report.xml b/sales_incentive_calculation/report/incentive_report.xml new file mode 100644 index 000000000..940507a33 --- /dev/null +++ b/sales_incentive_calculation/report/incentive_report.xml @@ -0,0 +1,41 @@ + + + + + Incentive Report + calculate.incentive + qweb-pdf + sales_incentive_calculation.report_incentive + sales_incentive_calculation.report_incentive + + report + + + + + + \ No newline at end of file diff --git a/sales_incentive_calculation/security/ir.model.access.csv b/sales_incentive_calculation/security/ir.model.access.csv new file mode 100644 index 000000000..3d6cde5b7 --- /dev/null +++ b/sales_incentive_calculation/security/ir.model.access.csv @@ -0,0 +1,14 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink + +access_sales_incentive_user,access.sales.incentive.user,model_sales_incentive,account.group_account_user,1,1,1,1 +access_sales_incentive_manager,access.sales.incentive.manager,model_sales_incentive,sales_team.group_sale_manager,1,1,1,1 + +access_select_incentive_user,access.select.incentive.user,model_select_incentive,account.group_account_user,1,1,1,1 +access_select_incentive_manager,access.select.incentive.manager,model_select_incentive,sales_team.group_sale_manager,1,1,1,1 + +access_calculate_incentive_user,access.calculate.incentive.user,model_calculate_incentive,account.group_account_user,1,1,1,1 +access_calculate_incentive_manager,access.calculate.incentive.manager,model_calculate_incentive,sales_team.group_sale_manager,1,1,1,1 + +access_approve_incentive_user,access.approve.incentive.user,model_approve_incentive,account.group_account_user,1,1,1,1 +access_approve_incentive_account_manager,access.approve.incentive.account.manager,model_approve_incentive,account.group_account_manager,1,1,1,1 +access_approve_incentive_sales_manager,access.approve.incentive.sales.manager,model_approve_incentive,sales_team.group_sale_manager,1,1,1,1 \ No newline at end of file diff --git a/sales_incentive_calculation/static/description/assets/icons/capture (1).png b/sales_incentive_calculation/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/capture (1).png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/check.png b/sales_incentive_calculation/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/check.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/chevron.png b/sales_incentive_calculation/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/chevron.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/cogs.png b/sales_incentive_calculation/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/cogs.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/consultation.png b/sales_incentive_calculation/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/consultation.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/ecom-black.png b/sales_incentive_calculation/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/ecom-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/education-black.png b/sales_incentive_calculation/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/education-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/hotel-black.png b/sales_incentive_calculation/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/hotel-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/img.png b/sales_incentive_calculation/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/img.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/license.png b/sales_incentive_calculation/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/license.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/lifebuoy.png b/sales_incentive_calculation/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/lifebuoy.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/manufacturing-black.png b/sales_incentive_calculation/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/manufacturing-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/photo-capture.png b/sales_incentive_calculation/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/photo-capture.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/pos-black.png b/sales_incentive_calculation/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/pos-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/puzzle.png b/sales_incentive_calculation/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/puzzle.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/restaurant-black.png b/sales_incentive_calculation/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/restaurant-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/service-black.png b/sales_incentive_calculation/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/service-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/trading-black.png b/sales_incentive_calculation/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/trading-black.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/training.png b/sales_incentive_calculation/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/training.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/update.png b/sales_incentive_calculation/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/update.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/user.png b/sales_incentive_calculation/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/user.png differ diff --git a/sales_incentive_calculation/static/description/assets/icons/wrench.png b/sales_incentive_calculation/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/icons/wrench.png differ diff --git a/sales_incentive_calculation/static/description/assets/misc/Cybrosys R.png b/sales_incentive_calculation/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/misc/Cybrosys R.png differ diff --git a/sales_incentive_calculation/static/description/assets/misc/email.svg b/sales_incentive_calculation/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sales_incentive_calculation/static/description/assets/misc/phone.svg b/sales_incentive_calculation/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/sales_incentive_calculation/static/description/assets/misc/star (1) 2.svg b/sales_incentive_calculation/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/sales_incentive_calculation/static/description/assets/misc/support (1) 1.svg b/sales_incentive_calculation/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/sales_incentive_calculation/static/description/assets/misc/support-email.svg b/sales_incentive_calculation/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/sales_incentive_calculation/static/description/assets/misc/tick-mark.svg b/sales_incentive_calculation/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/sales_incentive_calculation/static/description/assets/misc/whatsapp 1.svg b/sales_incentive_calculation/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/sales_incentive_calculation/static/description/assets/misc/whatsapp.svg b/sales_incentive_calculation/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/sales_incentive_calculation/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sales_incentive_calculation/static/description/assets/modules/1.png b/sales_incentive_calculation/static/description/assets/modules/1.png new file mode 100644 index 000000000..ba1058c42 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/modules/1.png differ diff --git a/sales_incentive_calculation/static/description/assets/modules/2.png b/sales_incentive_calculation/static/description/assets/modules/2.png new file mode 100644 index 000000000..6949185dd Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/modules/2.png differ diff --git a/sales_incentive_calculation/static/description/assets/modules/3.png b/sales_incentive_calculation/static/description/assets/modules/3.png new file mode 100644 index 000000000..4e506f79b Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/modules/3.png differ diff --git a/sales_incentive_calculation/static/description/assets/modules/4.png b/sales_incentive_calculation/static/description/assets/modules/4.png new file mode 100644 index 000000000..e78427938 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/modules/4.png differ diff --git a/sales_incentive_calculation/static/description/assets/modules/5.png b/sales_incentive_calculation/static/description/assets/modules/5.png new file mode 100644 index 000000000..272ec20f9 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/modules/5.png differ diff --git a/sales_incentive_calculation/static/description/assets/modules/6.png b/sales_incentive_calculation/static/description/assets/modules/6.png new file mode 100644 index 000000000..7d5c3154f Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/modules/6.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/1.png b/sales_incentive_calculation/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..eea20e6f5 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/1.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/10.png b/sales_incentive_calculation/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..21ff6ca15 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/10.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/11.png b/sales_incentive_calculation/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..e3691f190 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/11.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/2.png b/sales_incentive_calculation/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..a78464873 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/2.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/3.png b/sales_incentive_calculation/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..09f178f34 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/3.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/4.png b/sales_incentive_calculation/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..ac93e01e2 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/4.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/5.png b/sales_incentive_calculation/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..188efe14a Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/5.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/6.png b/sales_incentive_calculation/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..e4bb535ec Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/6.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/7.png b/sales_incentive_calculation/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..e21ad7f48 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/7.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/8.png b/sales_incentive_calculation/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..cd16af99e Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/8.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/9.png b/sales_incentive_calculation/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..79eae0a8a Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/9.png differ diff --git a/sales_incentive_calculation/static/description/assets/screenshots/hero-v17.gif b/sales_incentive_calculation/static/description/assets/screenshots/hero-v17.gif new file mode 100644 index 000000000..9fe886145 Binary files /dev/null and b/sales_incentive_calculation/static/description/assets/screenshots/hero-v17.gif differ diff --git a/sales_incentive_calculation/static/description/banner.jpg b/sales_incentive_calculation/static/description/banner.jpg new file mode 100644 index 000000000..539f9f72d Binary files /dev/null and b/sales_incentive_calculation/static/description/banner.jpg differ diff --git a/sales_incentive_calculation/static/description/icon.png b/sales_incentive_calculation/static/description/icon.png new file mode 100644 index 000000000..853377a9c Binary files /dev/null and b/sales_incentive_calculation/static/description/icon.png differ diff --git a/sales_incentive_calculation/static/description/images/checked.png b/sales_incentive_calculation/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/checked.png differ diff --git a/sales_incentive_calculation/static/description/images/cybrosys.png b/sales_incentive_calculation/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/sales_incentive_calculation/static/description/images/cybrosys.png differ diff --git a/sales_incentive_calculation/static/description/images/product1.png b/sales_incentive_calculation/static/description/images/product1.png new file mode 100644 index 000000000..f48cd6dff Binary files /dev/null and b/sales_incentive_calculation/static/description/images/product1.png differ diff --git a/sales_incentive_calculation/static/description/images/product2.png b/sales_incentive_calculation/static/description/images/product2.png new file mode 100644 index 000000000..040993d8a Binary files /dev/null and b/sales_incentive_calculation/static/description/images/product2.png differ diff --git a/sales_incentive_calculation/static/description/images/product3.gif b/sales_incentive_calculation/static/description/images/product3.gif new file mode 100644 index 000000000..b80a0bfc9 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/product3.gif differ diff --git a/sales_incentive_calculation/static/description/images/product4.png b/sales_incentive_calculation/static/description/images/product4.png new file mode 100644 index 000000000..018a91834 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/product4.png differ diff --git a/sales_incentive_calculation/static/description/images/product5.png b/sales_incentive_calculation/static/description/images/product5.png new file mode 100644 index 000000000..66bdf9a37 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/product5.png differ diff --git a/sales_incentive_calculation/static/description/images/product6.png b/sales_incentive_calculation/static/description/images/product6.png new file mode 100644 index 000000000..c856521e9 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/product6.png differ diff --git a/sales_incentive_calculation/static/description/images/sales-incentives-in-odoo-13.png b/sales_incentive_calculation/static/description/images/sales-incentives-in-odoo-13.png new file mode 100644 index 000000000..fb07116fd Binary files /dev/null and b/sales_incentive_calculation/static/description/images/sales-incentives-in-odoo-13.png differ diff --git a/sales_incentive_calculation/static/description/images/salesincentive.gif b/sales_incentive_calculation/static/description/images/salesincentive.gif new file mode 100644 index 000000000..ae2354a67 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/salesincentive.gif differ diff --git a/sales_incentive_calculation/static/description/images/screen1.png b/sales_incentive_calculation/static/description/images/screen1.png new file mode 100644 index 000000000..4b22bd66f Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen1.png differ diff --git a/sales_incentive_calculation/static/description/images/screen10.png b/sales_incentive_calculation/static/description/images/screen10.png new file mode 100644 index 000000000..d2780f33b Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen10.png differ diff --git a/sales_incentive_calculation/static/description/images/screen11.png b/sales_incentive_calculation/static/description/images/screen11.png new file mode 100644 index 000000000..10a0ac571 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen11.png differ diff --git a/sales_incentive_calculation/static/description/images/screen2.png b/sales_incentive_calculation/static/description/images/screen2.png new file mode 100644 index 000000000..c96014163 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen2.png differ diff --git a/sales_incentive_calculation/static/description/images/screen3.png b/sales_incentive_calculation/static/description/images/screen3.png new file mode 100644 index 000000000..ab367dffa Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen3.png differ diff --git a/sales_incentive_calculation/static/description/images/screen4.png b/sales_incentive_calculation/static/description/images/screen4.png new file mode 100644 index 000000000..e876d8013 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen4.png differ diff --git a/sales_incentive_calculation/static/description/images/screen5.png b/sales_incentive_calculation/static/description/images/screen5.png new file mode 100644 index 000000000..ee3cdc800 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen5.png differ diff --git a/sales_incentive_calculation/static/description/images/screen6.png b/sales_incentive_calculation/static/description/images/screen6.png new file mode 100644 index 000000000..ce5fef1c7 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen6.png differ diff --git a/sales_incentive_calculation/static/description/images/screen7.png b/sales_incentive_calculation/static/description/images/screen7.png new file mode 100644 index 000000000..c41185480 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen7.png differ diff --git a/sales_incentive_calculation/static/description/images/screen8.png b/sales_incentive_calculation/static/description/images/screen8.png new file mode 100644 index 000000000..68b6b8523 Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen8.png differ diff --git a/sales_incentive_calculation/static/description/images/screen9.png b/sales_incentive_calculation/static/description/images/screen9.png new file mode 100644 index 000000000..82f18901a Binary files /dev/null and b/sales_incentive_calculation/static/description/images/screen9.png differ diff --git a/sales_incentive_calculation/static/description/index.html b/sales_incentive_calculation/static/description/index.html new file mode 100644 index 000000000..616e887d2 --- /dev/null +++ b/sales_incentive_calculation/static/description/index.html @@ -0,0 +1,778 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Sales Incentives

+

+ Calculates incentive for salesperson based on sale target in gamification. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Linear Method.

+

Generates incentive for sale target given in gamification based on:-Linear Method. +

+
+
+
+
+
+
+ +
+
+

Tiered Commission Plan.

+

Generates incentive for sale target given in gamification based on:-Tiered Commission Plan. +

+
+
+
+
+
+
+ +
+
+

Percentage.

+

Calculates incentive based on:-Percentage. +

+
+
+
+
+
+
+ +
+
+

Fixed amount.

+

Calculates incentive based on:-Fixed amount. +

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

+ Configure +

+

+ Sales manager can set challenge for salesperson. Go to CRM --> Challenges --> Challenges and select sales challenge to be used for incentive calculation. + Select 'Use in incentive calculation' to use this challenge in incentive calculation. You can set periodicity as 'Monthly', 'weekly', 'yearly' and the + incentive will be calculated based on these dates. You can set the target value to reach. + The incentive calculation will be based on this target.

+
+
+
+
+
+
+ +
+
+

+ Challenge and Achievement +

+

+ Go to CRM --> Challenges --> Goals and you can see the target set for the challenge and + achievement made by each salesperson. Based on this target and achievement, + incentive can be calculated for each salesperson.

+
+
+
+
+
+
+ +
+
+

+ Compute Incentive +

+

+ You can create the method of incentive calculation in CRM --> Challenges --> Incentive Scheme. + Select 'linear or Tiered Commission Plan' as the method for calculation. + In the 'achievement%' column, you can give the minimum achievement percentage to be reached for getting incentive. + In the 'reward' column, specify the reward when this achievement% is reached. + If the 'Type' column is selected as 'percentage', then reward column will be considered as percentage of amount to be given for this achievement. + If 'Type' is 'amount', then reward will be the amount specified in the reward column. + Click on 'compute incentive' button to calculate incentive based on the given settings.

+
+
+
+
+
+
+ +
+
+

+ Linear Method +

+

+ If the selected method is 'linear', then 'compute incentive' will calculate incentive based on linear method. + For example, if the target is 10,00,000 and the achievement is 6,90,000, that is 69%, incentive for this will be calculated in the 50% slab. + So, Incentive for upto 50% achievement is 2%, so incentive will be 2% of achievement(690,000). + i,e.13800. If type is given as amount, then that amount will be given as incentive. + In 70% slab, incentive is given as amount 10,000. So, for 89% achievement, incentive will be 10,000 as given in the slab settings. + The lowest achievement% given in slab settings will be considered as minimum achievement percentage. + You can set the amount to be given for each achievement in the settings.

+
+
+
+
+
+
+ +
+
+

+ Tiered Commission Plan Method +

+

+ If the selected method is 'Tiered Commission Plan', then 'compute incentive' will calculate incentive based on incremental basis. + For example, Consider target is 10,00,000 and achievement is 6,90,000. The reward for 50% in slab is 2% and reward for 70% in slab is 10,000. + Target is 10,00,000 so, we take 50% of target ,that is 5,00,000 and give 2% reward for 5,00,000. that is 10,000. + Remaining 19% will be given reward of next achievement% specified in the slab settings. + Considering 70% as next achievement specified in slab settings and reward for 70% is 10,000 and type is amount. + So incentive for the remaining achievement of 19% will be 10,000. Total incentive becomes 20,000. + If type selected is percentage, then incentive will be reward for remaining percentage.

+
+
+
+
+
+
+ +
+
+

+ Incentives Approval +

+

+ You can submit the incentives for approval when the end date is reached. + If incentive is calculated on monthly basis, then it can be submitted for approval at the end of the month. + Refresh the challenge to get the next month calculations and to submit previous month incentives for approval. + To refresh challenge, go to CRM --> Challenges --> Challenges and select the challenge used in incentive calculation, click on 'refresh challenge' button. + Now when you compute the incentive again, you can submit the previous month incentives by clicking on 'Submit for approval'.

+
+
+
+
+
+
+ +
+
+

+ Submitted to Accountant +

+

+ Then status will become 'submitted to accountant' and the submitted incentives will be send for approval.

+
+
+
+
+
+
+ +
+
+

+ Submitted Incentives +

+

+ Accountant can see the submitted incentives in Invoicing --> Customers --> Approvals --> Incentives to Approve

+
+
+
+ +
+
+
+ +
+
+

+ Approve or Reject +

+

+ Accountant can approve or reject the submitted incentives.

+
+
+
+
+
+
+ +
+
+

+ After Approval or Rejection +

+

+ If approved, then state changes to paid and journal entry will be created for this incentive in draft state. + If rejected, then status changes to rejected.

+
+
+
+
+
+
+ +
+
+

+ Approved Entry in the Journal +

+

+ Approved incentives will have an entry in the journal as draft.

+
+
+
+
+
+
+
    +
  • + Generates incentive for sale target given in gamification based on:-Linear Method. +
  • +
  • + Generates incentive for sale target given in gamification based on:-Tiered Commission Plan. +
  • +
  • + Calculates incentive based on:-Percentage. + +
  • +
  • + Calculates incentive based on:-Fixed amount. + +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:20th Dec 2023 +
+

+ + Initial commit for Sales Incentives.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/sales_incentive_calculation/views/calculate_incentive_views.xml b/sales_incentive_calculation/views/calculate_incentive_views.xml new file mode 100644 index 000000000..3689ec16e --- /dev/null +++ b/sales_incentive_calculation/views/calculate_incentive_views.xml @@ -0,0 +1,70 @@ + + + + + + calculate.incentive.view.tree.sales_incentive_calculation + + calculate.incentive + + + + + + + + + + + + +