From b3c1e21ccfd95b0c0c6457f2710c4894990f0a95 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Mon, 30 Oct 2023 17:41:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=B8=8A=E4=BC=A0logo--debug=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index 642d05c5..121649cf 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -9,7 +9,6 @@ import ( "fusenapi/model/gmodel" "fusenapi/utils/basic" "fusenapi/utils/file" - "fusenapi/utils/format" "fusenapi/utils/handlers" "fusenapi/utils/hash" "fusenapi/utils/order" @@ -17,7 +16,6 @@ import ( "fusenapi/utils/pdf" "fusenapi/utils/queue" "math" - "strconv" "time" "github.com/aws/aws-sdk-go/aws/session" @@ -404,20 +402,20 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic for _, orderProduct := range ress.OrderDetail.OrderProduct { var model00301 = constants.INVOICE_TEMPLATE_0301 - var priceStr = format.NumToStringWithThousandthPercentile(orderProduct.ItemPrice.Current.CurrentAmount.(string)) + var priceStr = orderProduct.ItemPrice.Current.CurrentAmount.(string) var price = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(orderProduct.ItemPrice.Current.CurrentCurrency)], priceStr) - var priceTotalStr = format.NumToStringWithThousandthPercentile(orderProduct.TotalPrice.Current.CurrentAmount.(string)) + var priceTotalStr = orderProduct.TotalPrice.Current.CurrentAmount.(string) var priceTotal = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(orderProduct.TotalPrice.Current.CurrentCurrency)], priceTotalStr) - productNum := strconv.FormatFloat(orderProduct.PurchaseQuantity.Current.(float64), 'f', -1, 64) - var productNumStr = format.NumToStringWithThousandthPercentile(productNum) + productNum := orderProduct.PurchaseQuantity.Current.(string) + var productNumStr = productNum var productsInfo = fmt.Sprintf(model00301, orderProduct.ProductName, price, productNumStr, priceTotal) products = products + productsInfo } model003 = fmt.Sprintf(constants.INVOICE_TEMPLATE_03, products) - var subtotalStr = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentAmount.(string)) + var subtotalStr = ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentAmount.(string) var subtotal = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentCurrency)], subtotalStr) var taxStr = "0.00" if ress.OrderDetail.OrderAmount.Tax.Current.CurrentAmount != nil { @@ -428,14 +426,14 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic taxCurrency = constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Total.Current.CurrentCurrency)] } var tax = fmt.Sprintf("%s%s", taxCurrency, taxStr) - var totalStr = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.Total.Current.CurrentAmount.(string)) + var totalStr = ress.OrderDetail.OrderAmount.Total.Current.CurrentAmount.(string) var total = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Total.Current.CurrentCurrency)], totalStr) // 生成收据发票--首款 if receiptSnsDeposit != "" { model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode) - var payAmountStr01 = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentAmount.(string)) + var payAmountStr01 = ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentAmount.(string) v7 := "Deposit Requested" v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentCurrency)], payAmountStr01) v9 := "Deposit Due" @@ -489,7 +487,7 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic // 生成收据发票--尾款 if receiptSnsFinal != "" { model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode) - var payAmountStr02 = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentAmount.(string)) + var payAmountStr02 = ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentAmount.(string) v7 := "Balance Requested" v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentCurrency)], payAmountStr02) v9 := "Balance Due"