From d3a35713cdce847937e15fe672425194219883db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 15 May 2023 11:42:19 +0800 Subject: [PATCH] 1 --- business/partner/purchase/jx/localjx/order.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index 59a2ff9cc..6c8db1282 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -422,7 +422,7 @@ func Pay4User(ctx *jxcontext.Context, thingID int, vendorOrderID string, payType } } case model.PayTypeTL_BrandBillCharge: // 品牌账户充值 - brandOrder := &model.BrandOrder{ + brandOrder := &model.StoreAcctOrder{ VendorOrderID: vendorOrderID, } if err = dao.GetEntity(db, brandOrder, "VendorOrderID"); err == nil && brandOrder.ID != 0 { @@ -606,14 +606,15 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) { partner.CurStoreAcctManager.InsertStoreAcctIncomeAndUpdateStoreAcctBalance(jxcontext.AdminCtx, jxutils.GetSaleStoreIDFromOrder(order), storeOrder.ActualPayPrice, partner.StoreAcctTypeIncomePay, order.VendorOrderID, order.VendorWaybillID, 0) } case model.PayTypeTL_BrandBillCharge: // 品牌充值入账 - brandOrder := &model.BrandOrder{ + brandOrder := &model.StoreAcctOrder{ VendorOrderID: orderPay.VendorOrderID, } if err = dao.GetEntity(db, brandOrder, "VendorOrderID"); err == nil && brandOrder.ID != 0 { brandOrder.OrderFinishedAt = time.Now() brandOrder.Status = model.OrderStatusFinished if _, err = dao.UpdateEntity(db, brandOrder, "OrderFinishedAt", "Status"); err == nil { - partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, brandOrder.BrandID, brandOrder.ActualPayPrice, model.BrandBillTypeIncome, model.BrandBillFeeTypeCharge, orderPay.VendorOrderID, "") + store, _ := dao.GetStoreDetail(db, brandOrder.StoreID, 0, "") + partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, brandOrder.ActualPayPrice, model.BrandBillTypeIncome, model.BrandBillFeeTypeCharge, orderPay.VendorOrderID, "") } } default: @@ -840,7 +841,7 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64 if jxOrder.OrderType != model.OrderTypeMatter || (jxOrder.OrderType == model.OrderTypeMatter && fromStoreID == -1) { outJxOrder.Skus = append(outJxOrder.Skus, jxSku) outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice - } else { //以下else为物料订单袋子金额和数量处理 + } else { //以下else为物料订单袋子金额和数量处理 if !result.Flag { //只要flag是false就按原价申请,是true再按订单量 outJxOrder.Skus = append(outJxOrder.Skus, jxSku) outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice