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

Calculate amount wrong #6

Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2023 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from decimal import Decimal

from datetime import datetime

from odoo import _, api, fields, models
Expand Down Expand Up @@ -818,7 +820,7 @@ def check_scb_execution_date(self):

def _get_amount_no_decimal(self, amount, digits=False):
if self.bank == "SICOTHBK":
return str(int(amount * 1000)).zfill(digits)
return str(int(Decimal(str(amount)) * 1000)).zfill(digits)
return super()._get_amount_no_decimal(amount, digits)

def _get_reference(self):
Expand Down
Loading