From cd9a3c446cff66e589cdb26163c3e2baf4bc6a1e Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 30 八月 2023 13:37:19 +0800
Subject: [PATCH] fix
---
service/invoice.go | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/service/invoice.go b/service/invoice.go
index d1500f1..895c415 100644
--- a/service/invoice.go
+++ b/service/invoice.go
@@ -184,8 +184,9 @@
removedProductIds = append(removedProductIds, product.Id)
}
amountInvoiced = amountInvoiced.Round(2)
+ amountNotInvoiced = amountNotInvoiced.Round(2)
err = model.WithTransaction(func(db *gorm.DB) error {
- err = model.NewInvoiceSearch().SetId(invoice.Id).Save(invoice)
+ err = model.NewInvoiceSearch().SetId(invoice.Id).Update(invoice)
if err != nil {
return err
}
@@ -222,7 +223,7 @@
}
amountInvoiced = amountInvoiced.Round(2)
err = model.WithTransaction(func(db *gorm.DB) error {
- err = model.NewInvoiceSearch().SetId(invoice.Id).Save(invoice)
+ err = model.NewInvoiceSearch().SetId(invoice.Id).Update(invoice)
if err != nil {
return err
}
--
Gitblit v1.8.0