feat:合图新增debug模块
This commit is contained in:
@@ -365,11 +365,15 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
|
||||
var city string
|
||||
var street string
|
||||
var state string
|
||||
var suite string
|
||||
var zipCode string
|
||||
if ress.OrderDetail.DeliveryAddress != nil {
|
||||
name = fmt.Sprintf("%s %s", ress.OrderDetail.DeliveryAddress.FirstName, ress.OrderDetail.DeliveryAddress.LastName)
|
||||
street = ress.OrderDetail.DeliveryAddress.Street
|
||||
city = ress.OrderDetail.DeliveryAddress.City
|
||||
state = ress.OrderDetail.DeliveryAddress.State
|
||||
suite = ress.OrderDetail.DeliveryAddress.Suite
|
||||
zipCode = ress.OrderDetail.DeliveryAddress.ZipCode
|
||||
}
|
||||
|
||||
var products string
|
||||
@@ -380,7 +384,7 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
|
||||
var productsInfo = fmt.Sprintf(model00301, orderProduct.ProductName, price, orderProduct.PurchaseQuantity.Current, priceTotal)
|
||||
products = products + productsInfo
|
||||
}
|
||||
model003 = fmt.Sprintf(constants.INVOICE_TEMPLATE_03, "", products)
|
||||
model003 = fmt.Sprintf(constants.INVOICE_TEMPLATE_03, products)
|
||||
|
||||
var subtotal = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentCurrency)], ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentAmount.(string))
|
||||
var taxStr = "0.00"
|
||||
@@ -396,22 +400,16 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
|
||||
|
||||
// 生成收据发票--首款
|
||||
if receiptSnsDeposit != "" {
|
||||
v1 := receiptSnsDeposit
|
||||
v2 := name
|
||||
v3 := ctimeDate
|
||||
v4 := street
|
||||
v5 := city
|
||||
v6 := state
|
||||
model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, "", v1, v2, v3, v4, v5, v6)
|
||||
model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode)
|
||||
|
||||
v7 := "Deposit Requested"
|
||||
v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentCurrency)], ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentAmount.(string))
|
||||
v9 := "Deposit Due"
|
||||
v10 := v8
|
||||
model004 = fmt.Sprintf(constants.INVOICE_TEMPLATE_04, "", subtotal, tax, total, v7, v8, v9, v10)
|
||||
model004 = fmt.Sprintf(constants.INVOICE_TEMPLATE_04, subtotal, tax, total, v7, v8, v9, v10)
|
||||
|
||||
cardSn := "****" + *orderTradeDeposit.CardSn
|
||||
model005 = fmt.Sprintf(constants.INVOICE_TEMPLATE_05, "", *orderTradeDeposit.CardBrand, cardSn)
|
||||
model005 = fmt.Sprintf(constants.INVOICE_TEMPLATE_05, *orderTradeDeposit.CardBrand, cardSn)
|
||||
|
||||
var content = model001 + model002 + model003 + model004 + model005 + model006
|
||||
|
||||
@@ -456,22 +454,16 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
|
||||
|
||||
// 生成收据发票--尾款
|
||||
if receiptSnsFinal != "" {
|
||||
v1 := receiptSnsFinal
|
||||
v2 := name
|
||||
v3 := ctimeDate
|
||||
v4 := street
|
||||
v5 := city
|
||||
v6 := state
|
||||
model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, "", v1, v2, v3, v4, v5, v6)
|
||||
model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode)
|
||||
|
||||
v7 := "Balance Requested"
|
||||
v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentCurrency)], ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentAmount.(string))
|
||||
v9 := "Balance Due"
|
||||
v10 := v8
|
||||
model004 = fmt.Sprintf(constants.INVOICE_TEMPLATE_04, "", subtotal, tax, total, v7, v8, v9, v10)
|
||||
model004 = fmt.Sprintf(constants.INVOICE_TEMPLATE_04, subtotal, tax, total, v7, v8, v9, v10)
|
||||
|
||||
cardSn := "****" + *orderTradeFinal.CardSn
|
||||
model005 = fmt.Sprintf(constants.INVOICE_TEMPLATE_05, "", *orderTradeDeposit.CardBrand, cardSn)
|
||||
model005 = fmt.Sprintf(constants.INVOICE_TEMPLATE_05, *orderTradeDeposit.CardBrand, cardSn)
|
||||
var content = model001 + model002 + model003 + model004 + model005 + model006
|
||||
base64, err := pdf.HtmlToPdfBase64(content, "html")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user