From 659c1d7e151bf1d740cbd6b4d68bfbe830efdd53 Mon Sep 17 00:00:00 2001 From: BaoXuebin Date: Mon, 11 Apr 2022 21:25:34 +0800 Subject: [PATCH] =?UTF-8?q?fixbug:=20=E8=B4=A6=E6=88=B7=E5=B9=B3=E8=A1=A1?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=AF=BC=E8=87=B4=E6=96=B0=E5=A2=9E=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/transactions.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/service/transactions.go b/service/transactions.go index 4dddff5..21c5a52 100644 --- a/service/transactions.go +++ b/service/transactions.go @@ -82,7 +82,7 @@ func sum(entries []AddTransactionEntryForm, openingBalances string) decimal.Deci if entry.Account == openingBalances { return decimal.NewFromInt(0) } - if entry.Price.IntPart() == 0 { + if entry.Price.Exponent() == 0 { sumVal = entry.Number.Add(sumVal) } else { sumVal = entry.Number.Mul(entry.Price).Add(sumVal) @@ -138,7 +138,6 @@ func AddTransactions(c *gin.Context) { if err != nil { script.LogError(ledgerConfig.Mail, err.Error()) - InternalError(c, "failed to add transaction") return } OK(c, nil)