...
|
...
|
@@ -143,31 +143,31 @@ func (order *OrderBase) Compute() error { |
|
|
partnerBonusExpense = partnerBonusExpense.Add(decimal.NewFromFloat(order.Goods[i].GoodCompute.PartnerBonusExpense))
|
|
|
}
|
|
|
//汇总赋值
|
|
|
order.OrderCompute.PartnerBonusExpense, _ = partnerBonusExpense.Round(2).Float64()
|
|
|
order.OrderCompute.PartnerBonusHas, _ = partnerBonusHas.Round(2).Float64()
|
|
|
order.OrderCompute.PartnerBonusNot, _ = partnerBonusNot.Round(2).Float64()
|
|
|
order.OrderCompute.PlanPartnerBonus, _ = planPartnerBonus.Round(2).Float64()
|
|
|
order.OrderCompute.PlanOrderAmount, _ = planOrderAmount.Round(2).Float64()
|
|
|
order.OrderCompute.PartnerBonusExpense, _ = partnerBonusExpense.Round(2).BigFloat().Float64()
|
|
|
order.OrderCompute.PartnerBonusHas, _ = partnerBonusHas.Round(2).BigFloat().Float64()
|
|
|
order.OrderCompute.PartnerBonusNot, _ = partnerBonusNot.Round(2).BigFloat().Float64()
|
|
|
order.OrderCompute.PlanPartnerBonus, _ = planPartnerBonus.Round(2).BigFloat().Float64()
|
|
|
order.OrderCompute.PlanOrderAmount, _ = planOrderAmount.Round(2).BigFloat().Float64()
|
|
|
order.OrderCompute.PlanOrderCount = planOrderCount
|
|
|
|
|
|
if hasUsePartnerBonus {
|
|
|
order.OrderCompute.UsePartnerBonus, _ = usePartnerBonus.Round(2).Float64()
|
|
|
order.OrderCompute.UsePartnerBonus, _ = usePartnerBonus.Round(2).BigFloat().Float64()
|
|
|
} else {
|
|
|
order.OrderCompute.UsePartnerBonus = -1
|
|
|
}
|
|
|
if hasUseOrderAmount {
|
|
|
order.OrderCompute.UseOrderAmount, _ = useOrderAmount.Round(2).Float64()
|
|
|
order.OrderCompute.UseOrderAmount, _ = useOrderAmount.Round(2).BigFloat().Float64()
|
|
|
//计算业务员的抽成
|
|
|
order.OrderCompute.SalesmanBonus, _ = useOrderAmount.
|
|
|
Mul(decimal.NewFromFloat(order.SalesmanBonusPercent)).
|
|
|
Div(decimal.NewFromInt(100)).
|
|
|
Round(2).Float64()
|
|
|
Round(2).BigFloat().Float64()
|
|
|
} else {
|
|
|
order.OrderCompute.UseOrderAmount = -1
|
|
|
order.OrderCompute.SalesmanBonus, _ = planOrderAmount.
|
|
|
Mul(decimal.NewFromFloat(order.SalesmanBonusPercent)).
|
|
|
Div(decimal.NewFromInt(100)).
|
|
|
Round(2).Float64()
|
|
|
Round(2).BigFloat().Float64()
|
|
|
}
|
|
|
if HasUseOrderCount {
|
|
|
order.OrderCompute.UseOrderCount = useOrderCount
|
...
|
...
|
|