feat 计算打折时的折扣
This commit is contained in:
parent
7957d28fe0
commit
53c6ee15ff
@ -106,6 +106,9 @@ func (p *Product) CalRate() {
|
|||||||
tmpPrice = discountPrice - 10
|
tmpPrice = discountPrice - 10
|
||||||
p.CNYPrice = tmpPrice*p.ExchangeRate + p.Freight
|
p.CNYPrice = tmpPrice*p.ExchangeRate + p.Freight
|
||||||
}
|
}
|
||||||
|
} else if p.Discount < 90 {
|
||||||
|
calculationProcess = append(calculationProcess, fmt.Sprintf("【打折扣】%.2f * %d%% * %.2f + %.2f = %.2f", p.USPrice, p.Discount, p.ExchangeRate, p.Freight, p.USPrice*float64(p.Discount)/100*p.ExchangeRate+p.Freight))
|
||||||
|
p.CNYPrice = p.USPrice*float64(p.Discount)/100*p.ExchangeRate + p.Freight
|
||||||
}
|
}
|
||||||
p.CalMark = strings.Join(calculationProcess, "\n")
|
p.CalMark = strings.Join(calculationProcess, "\n")
|
||||||
if p.DWPrice > 0 {
|
if p.DWPrice > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user