配送和发消息品牌余额限制
This commit is contained in:
@@ -166,9 +166,10 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
|
||||
// }
|
||||
// }
|
||||
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), jxutils.GetSaleStoreIDFromOrder(order), order.VendorID, order.VendorOrgCode)
|
||||
balance, _ := partner.CurStoreAcctManager.GetBrandBalance(storeDetail.BrandID)
|
||||
handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID)
|
||||
if handlerInfo != nil && handlerInfo.Use4CreateWaybill {
|
||||
if model.DeliveryBrandMarkMap[platformVendorID]&storeDetail.BrandIsOpen != 0 {
|
||||
if model.DeliveryBrandMarkMap[platformVendorID]&storeDetail.BrandIsOpen != 0 && balance >= model.BrandBalanceLimit {
|
||||
if c.IsReallyCallPlatformAPI {
|
||||
bill, err = handlerInfo.Handler.CreateWaybill(order, maxDeliveryFee)
|
||||
if err != nil {
|
||||
|
||||
@@ -1371,7 +1371,7 @@ func (s *DefScheduler) updateStoreAccount(order *model.GoodsOrder, bill *model.W
|
||||
func (s *DefScheduler) updateBrandAccount(store *dao.StoreDetail, bill *model.Waybill) {
|
||||
realDesiredFee := bill.DesiredFee
|
||||
if balance, err := partner.CurStoreAcctManager.GetBrandBalance(store.BrandID); err == nil {
|
||||
|
||||
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, balance-int(realDesiredFee), model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, bill.VendorOrderID, "")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user