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