콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
5412 화면

HI,

I Make Invoice Amount Total Rounding Code for invoice,

Untaxed Amount :2240.80 Tax Amount : 148.45

Amount Total : 2389.00 instead of 2389.25

if last decimal amount is greater 0.50 it add next value if less 0.50 then it's subtract that part.

I have Created This Code.

Just goto the Account > Account_invoice.py find def _compute_amount(self):

and put below code like,


def _compute_amount(self):

self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line)

self.amount_tax = sum(line.amount for line in self.tax_line)

self.amount_total = self.amount_untaxed + self.amount_tax

if int(self.amount_total) > 0:

amounttotaldiff = self.amount_total - int(self.amount_total)

taxdetail = self.amount_tax - int(self.amount_tax)

c = 1 - amounttotaldiff

e = 1 - taxdetail

if (amounttotaldiff < 0.50):

d = self.amount_total - amounttotaldiff

if (amounttotaldiff > 0.50):

d = self.amount_total + c

self.amount_total = d

 

아바타
취소

In you case when you validate the invoice are you getting the new amount or the old one because I did some change on the amount_total and when I validate I'm getting the old amount also when I need to pay that invoice it will be false about credit and debit

관련 게시물 답글 화면 활동
0
10월 22
2914
4
4월 20
11187
1
3월 15
5922
1
7월 25
1203
2
7월 25
1421