This commit is contained in:
邹宗楠
2023-05-18 11:05:32 +08:00
parent 98eb7e1397
commit a94f54973c
2 changed files with 10 additions and 9 deletions

View File

@@ -559,16 +559,10 @@ func countWaybillSettleInfo(db *dao.DaoDB, order *model.GoodsOrder, bill *model.
return err return err
} }
//if deductFee != model.NO { if err = dao.UpdateWaybillActualFee(db, bill.VendorWaybillID, bill.VendorOrderID, deductFee, deductFee); err != nil {
// 更新运单实际扣除费用 globals.SugarLogger.Debugf("================ err := %v", err)
bill.ActualFee = deductFee return err
bill.DesiredFee = deductFee
globals.SugarLogger.Debugf("bill ======== %s", utils.Format4Output(bill, false))
if _, err = dao.UpdateEntity(db, bill, "ActualFee", "DesiredFee"); err != nil {
globals.SugarLogger.Errorf("更新门店配送信息错误:%d,%v", deductFee, err)
} }
//}
// 门店发单,支付运单违约金 // 门店发单,支付运单违约金
if store != nil && store.CreateDeliveryType == model.YES && deductFee != model.NO { if store != nil && store.CreateDeliveryType == model.YES && deductFee != model.NO {
err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(jxcontext.AdminCtx, store.ID, int(deductFee), partner.StoreAcctTypeExpendCreateWaybillDeductFee, bill.VendorOrderID, bill.VendorWaybillID, 0) err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(jxcontext.AdminCtx, store.ID, int(deductFee), partner.StoreAcctTypeExpendCreateWaybillDeductFee, bill.VendorOrderID, bill.VendorWaybillID, 0)

View File

@@ -1466,6 +1466,13 @@ func GetOrdersForJxPay(db *DaoDB, finishTimeBegin, finishTimeEnd time.Time) (goo
return goods, err return goods, err
} }
// UpdateWaybillActualFee 修改运单实际支付价格
func UpdateWaybillActualFee(db *DaoDB, vendorWaybillId, vendorOrderId string, actualFee, desiredFee int64) error {
sql := ` UPDATE waybill SET actual_fee = ? ,desired_fee = ? WHERE vendor_order_id = ? AND vendor_waybill_id = ?`
_, err := ExecuteSQL(db, sql, []interface{}{actualFee, desiredFee, vendorOrderId, vendorWaybillId}...)
return err
}
func GetWaybills(db *DaoDB, vendorOrderID string, vendors []int64) (waybills []*model.Waybill, err error) { func GetWaybills(db *DaoDB, vendorOrderID string, vendors []int64) (waybills []*model.Waybill, err error) {
sql := ` SELECT * sql := ` SELECT *
FROM waybill FROM waybill