Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] account_banking_ach_discount #118

Open
wants to merge 20 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
581e8f3
[MIG][14.0] account_banking_ach_discount.
Murtaza-SerpentCS Feb 24, 2021
15be18d
[FIX] account_banking_ach_discount: Missing required field 'communica…
max3903 Mar 8, 2021
a7ea731
[FIX] account_banking_ach_discount
max3903 Mar 11, 2021
b809493
[FIX] account_banking_ach_discount
max3903 Mar 12, 2021
7bcbd42
[FIX] account_banking_ach_discount
max3903 Mar 13, 2021
f2ffdb9
[FIX] Fixed issued of a reconcie functionlity.
AmmarOfficewalaSerpentCS Jul 9, 2021
12c1e7c
[FIX] account_banking_ach_discount: Comparing apples and oranges
Sep 24, 2021
79c5b96
[FIX] Fix the issue allowed tho pay non ACH IN/OUT payment.
Murtaza-OSI Sep 30, 2021
944a392
[FIX] account_banking_ach_discount
murtuzasaleh Mar 2, 2022
fcd4a3b
[FIX]account_banking_ach_discount: fix manual discount case
Mar 2, 2022
5a4cd8f
[FIX] Improved code.
murtuzasaleh Mar 9, 2022
dba533e
[UPD] Update account_banking_ach_discount.pot
oca-travis Nov 15, 2022
ff4efc0
[UPD] README.rst
OCA-git-bot Nov 15, 2022
59b5770
[UPD] README.rst
OCA-git-bot Sep 3, 2023
b22cabf
[IMP] account_banking_ach_discount: black, isort, prettier
JasminSForgeFlow Oct 18, 2023
6f39d22
[MIG] account_banking_ach_discount: Migration to 16.0
JasminSForgeFlow Oct 20, 2023
addbce2
[FIX] account_banking_ach_discount: Only generate write-off if
JordiBForgeFlow Jun 28, 2024
daf4f02
[FIX] account_banking_ach_discount: decide grouping criteria
JordiBForgeFlow Jun 28, 2024
c10b3a3
[IMP] account_banking_ach_discount: added test
JasminSForgeFlow Jul 2, 2024
e632ef2
[FIX] account_banking_ach_discount: Expected singleton
BernatPForgeFlow Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions account_banking_ach_discount/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
==============================
Discount on ACH batch payments
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:49de557183014de2a8dba5fce829d24e0fd04061b538c048a3553c6f835b02b9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--usa-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-usa/tree/16.0/account_banking_ach_discount
:alt: OCA/l10n-usa
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-usa-16-0/l10n-usa-16-0-account_banking_ach_discount
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-usa&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module will add support for discount in ACH and batch ACH workflow.

**Table of contents**

.. contents::
:local:

Configuration
=============

Payment Terms
~~~~~~~~~~~~~

* Go to *Accounting > Configuration > Payment Terms*
* Create or select a payment term
* Activate the discounts options
* On a line, set the discount percentage and number of days

Payment Modes
~~~~~~~~~~~~~

* Go to *Accounting > Configuration > Payment Modes*
* Create or select a payment mode
* Link it to an ACH payment method

Vendors
~~~~~~~

* Go *Contacts* or *Accounting > Vendors > Vendors*
* Create or select a vendor
* On the Sales and Purchase tab, set the supplier payment mode
* On the Accounting tab, set their bank information (account number, bank, routing number)

Usage
=====

* Go to *Accounting > Customers > Invoices* or *Accounting > Vendors > Bills*
* Select or create various records in the state posted with ACH and discounts
* In the Action menu, click on Batch Payments
* Review the payment information provided by default
* Click on Make Payments
* Review the payment order, confirm it and generate the ACH file
* Go to your bank's website to upload the file
* Come back to Odoo and confirm the upload to the bank was successful

Changelog
=========

12.0.1.0.0
~~~~~~~~~~

- ACH Payment, Automatic Discount and Batch Payment Partial Pay Integration

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-usa/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-usa/issues/new?body=module:%20account_banking_ach_discount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Open Source Integrators

Contributors
~~~~~~~~~~~~

* Open Source Integrators <https://www.opensourceintegrators.com>

* Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>

* ForgeFlow <https://www.forgeflow.com>
* Jasmin Solanki <jasmin.solanki@forgeflow.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-bodedra| image:: https://github.com/bodedra.png?size=40px
:target: https://github.com/bodedra
:alt: bodedra

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-bodedra|

This module is part of the `OCA/l10n-usa <https://github.com/OCA/l10n-usa/tree/16.0/account_banking_ach_discount>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions account_banking_ach_discount/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizard
24 changes: 24 additions & 0 deletions account_banking_ach_discount/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Discount on ACH batch payments",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"category": "Accounting",
"maintainer": "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-usa",
"development_status": "Beta",
"maintainers": ["bodedra"],
"depends": [
"account_payment_term_discount",
"account_payment_batch_process",
"account_payment_order",
"account_banking_ach_credit_transfer",
"account_banking_ach_direct_debit",
],
"data": [
"views/account_payment_view.xml",
],
}
148 changes: 148 additions & 0 deletions account_banking_ach_discount/i18n/account_banking_ach_discount.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_ach_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__writeoff_account_id
msgid "Account"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__payment_difference_handling
msgid "Action"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model,name:account_banking_ach_discount.model_bank_payment_line
msgid "Bank Payment Lines"
msgstr ""

#. module: account_banking_ach_discount
#: model_terms:ir.ui.view,arch_db:account_banking_ach_discount.account_payment_line_discount_amount_form
#: model_terms:ir.ui.view,arch_db:account_banking_ach_discount.account_payment_line_discount_amount_tree
msgid "Discount Account"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__discount_amount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_bank_payment_line__discount_amount
msgid "Discount Amount"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_move__display_name
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_move_line__display_name
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment__display_name
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__display_name
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_order__display_name
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_register__display_name
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_bank_payment_line__display_name
msgid "Display Name"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_move__id
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_move_line__id
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment__id
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__id
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_order__id
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_register__id
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_bank_payment_line__id
msgid "ID"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model,name:account_banking_ach_discount.model_account_move
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__move_id
msgid "Journal Entry"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model,name:account_banking_ach_discount.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields.selection,name:account_banking_ach_discount.selection__account_payment_line__payment_difference_handling__open
msgid "Keep open"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_move____last_update
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_move_line____last_update
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment____last_update
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line____last_update
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_order____last_update
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_register____last_update
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_bank_payment_line____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields.selection,name:account_banking_ach_discount.selection__account_payment_line__payment_difference_handling__reconcile
msgid "Mark invoice as fully paid"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__note
msgid "Note"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__payment_difference
msgid "Payment Difference"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model,name:account_banking_ach_discount.model_account_payment_line
msgid "Payment Lines"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model,name:account_banking_ach_discount.model_account_payment_order
msgid "Payment Order"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model,name:account_banking_ach_discount.model_account_payment
msgid "Payments"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__reason_code
msgid "Reason Code"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model,name:account_banking_ach_discount.model_account_payment_register
msgid "Register Payment"
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,help:account_banking_ach_discount.field_account_payment_line__move_id
msgid "The move of this entry line."
msgstr ""

#. module: account_banking_ach_discount
#: code:addons/account_banking_ach_discount/models/account_payment.py:0
#, python-format
msgid ""
"This method should only be called to process a single invoice's payment."
msgstr ""

#. module: account_banking_ach_discount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_account_payment_line__total_amount
#: model:ir.model.fields,field_description:account_banking_ach_discount.field_bank_payment_line__total_amount
msgid "Total Amount"
msgstr ""
6 changes: 6 additions & 0 deletions account_banking_ach_discount/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import account_payment
from . import account_move_line
from . import account_move
from . import account_payment_line
48 changes: 48 additions & 0 deletions account_banking_ach_discount/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models


class AccountMove(models.Model):
_inherit = "account.move"

def _compute_payments_widget_reconciled_info(self):
res = super(AccountMove, self)._compute_payments_widget_reconciled_info()
for move in self:
if move.invoice_payments_widget:
inv_number = move.name
flag = False
payment_lines = set()
for line in move.line_ids:
payment_lines.update(
line.mapped("matched_credit_ids.credit_move_id.id")
)
payment_lines.update(
line.mapped("matched_debit_ids.debit_move_id.id")
)
payment_move_line_ids = (
self.env["account.move.line"].browse(list(payment_lines)).sorted()
)

for mvl in payment_move_line_ids:
for item in move.invoice_payments_widget["content"]:
# get payment line
if mvl.payment_id.id == item["account_payment_id"]:
for pay_li in mvl.payment_id.line_ids.filtered(
lambda line: not line.reconciled
):
# Get related payment line ref
if inv_number in pay_li.name:
item["amount"] = abs(pay_li.amount_currency)
# for non-ach payment
# Deduct the discount only for the related payment.
# Discount is applied on the last payment (i.e. fully reconciled).
if (
mvl.payment_id
and mvl.move_id.id == move.id
and item["account_payment_id"] == mvl.payment_id.id
):
if mvl.full_reconcile_id and not flag:
item["amount"] = item["amount"] - move.discount_taken
flag = True
return res
Loading
Loading