forked from OCA/l10n-usa
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
159 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* Open Source Integrators <https://www.opensourceintegrators.com> | ||
|
||
* Bhavesh Odedra <[email protected]> | ||
* Maxime Chambreuil <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module will add support for discount in ACH and batch ACH workflow. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
12.0.1.0.0 | ||
~~~~~~~~~~ | ||
|
||
- ACH Payment, Automatic Discount and Batch Payment Partial Pay Integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# Copyright (C) 2019 Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import account_register_payments | ||
from . import account_payment_register |
62 changes: 62 additions & 0 deletions
62
account_banking_ach_discount/wizard/account_payment_register.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright (C) 2019 Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from odoo import models | ||
|
||
|
||
class AccountPaymentRegister(models.TransientModel): | ||
_inherit = "account.payment.register" | ||
|
||
def make_payments(self): | ||
if self.payment_method_id and self.payment_method_id.code in ( | ||
"ACH-In", | ||
"ACH-Out", | ||
): | ||
action = False | ||
payment_mode = self.env["account.payment.mode"].search( | ||
[ | ||
("payment_type", "=", self.payment_type), | ||
("payment_method_id", "=", self.payment_method_id.id), | ||
("payment_order_ok", "=", True), | ||
], | ||
limit=1, | ||
) | ||
payment_line_pool = self.env["account.payment.line"] | ||
# Update invoice with Payment mode | ||
if payment_mode: | ||
for line in self.invoice_payments: | ||
invoice_id = line.invoice_id | ||
# updated discount logic | ||
discount = invoice_id.discount_taken | ||
# discount should not be consider for open invoices | ||
if line.payment_difference_handling != "open": | ||
discount = invoice_id.discount_taken + line.payment_difference | ||
invoice_id.write( | ||
{ | ||
"payment_mode_id": payment_mode.id, | ||
"discount_taken": discount, | ||
} | ||
) | ||
invoice_id.line_ids.write({"payment_mode_id": payment_mode.id}) | ||
action = invoice_id.with_context( | ||
payment_date=self.payment_date, | ||
payment_line_state=line.payment_difference_handling, | ||
).create_account_payment_line() | ||
# Find related ACH transaction line | ||
domain = [("move_id", "=", invoice_id.id), ("state", "=", "draft")] | ||
ach_lines = payment_line_pool.search(domain) | ||
if ach_lines: | ||
ach_lines.write( | ||
{ | ||
"payment_difference_handling": line.payment_difference_handling, | ||
"writeoff_account_id": line.writeoff_account_id.id, | ||
"reason_code": line.reason_code.id, | ||
"note": line.note, | ||
"communication": "Payment of invoice %s" | ||
% line.invoice_id.name, | ||
"communication_type": "normal", | ||
"amount_currency": line.amount, | ||
"payment_difference": line.payment_difference, | ||
} | ||
) | ||
return action | ||
return super().make_payments() |
Oops, something went wrong.