|
|
|
@ -64,19 +64,20 @@ type GoodsDetail struct {
|
|
|
|
|
IsClosed int `gorm:"is_closed" json:"isClosed"`
|
|
|
|
|
RStatus string `gorm:"-" json:"rStatus"`
|
|
|
|
|
DetailInfo string
|
|
|
|
|
Bill int `gorm:"bill" json:"bill"` //是否开发票0代表未开1处理中2已成功3失败
|
|
|
|
|
Fpqqlsh string `gorm:"fpqqlsh" json:"fpqqlsh"` //流水号
|
|
|
|
|
IsExport int `gorm:"is_export" json:"is_export"` //舶茂的是否导出
|
|
|
|
|
BomaoNo string `gorm:"bomao_no" json:"bomao_no"` //舶茂的订单编号
|
|
|
|
|
EvaluatedId int `gorm:"evaluated_id" json:"evaluated_id"` //评价id
|
|
|
|
|
ReportMsg string `gorm:"report_msg" json:"reportMsg"`
|
|
|
|
|
Report int `gorm:"report" json:"report"`
|
|
|
|
|
IsImport int `gorm:"column:is_import" json:"isImport"` //是否进口商品
|
|
|
|
|
Storehouse int `gorm:"column:storehouse" json:"storehouse"` //进口商品仓库
|
|
|
|
|
IsFerme int `gorm:"column:is_ferme" json:"isFerme"` //是否包税
|
|
|
|
|
ActivityStatus uint `gorm:"column:activity_status" json:"activity_status"`
|
|
|
|
|
ActivityId uint `gorm:"column:activity_id" json:"activity_id"` //活动id
|
|
|
|
|
MakeUpStatus uint `json:"make_up_status"`
|
|
|
|
|
Bill int `gorm:"bill" json:"bill"` //是否开发票0代表未开1处理中2已成功3失败
|
|
|
|
|
Fpqqlsh string `gorm:"fpqqlsh" json:"fpqqlsh"` //流水号
|
|
|
|
|
IsExport int `gorm:"is_export" json:"is_export"` //舶茂的是否导出
|
|
|
|
|
BomaoNo string `gorm:"bomao_no" json:"bomao_no"` //舶茂的订单编号
|
|
|
|
|
EvaluatedId int `gorm:"evaluated_id" json:"evaluated_id"` //评价id
|
|
|
|
|
ReportMsg string `gorm:"report_msg" json:"reportMsg"`
|
|
|
|
|
Report int `gorm:"report" json:"report"`
|
|
|
|
|
IsImport int `gorm:"column:is_import" json:"isImport"` //是否进口商品
|
|
|
|
|
Storehouse int `gorm:"column:storehouse" json:"storehouse"` //进口商品仓库
|
|
|
|
|
IsFerme int `gorm:"column:is_ferme" json:"isFerme"` //是否包税
|
|
|
|
|
ActivityStatus uint `gorm:"column:activity_status" json:"activity_status"`
|
|
|
|
|
ActivityId uint `gorm:"column:activity_id" json:"activity_id"` //活动id
|
|
|
|
|
MakeUpStatus uint `json:"make_up_status"`
|
|
|
|
|
ExtraPrice decimal.Decimal `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName sets the insert table name for this struct type
|
|
|
|
@ -86,6 +87,9 @@ func (r *GoodsDetail) TableName() string {
|
|
|
|
|
|
|
|
|
|
func (r *GoodsDetail) GetBase() decimal.Decimal {
|
|
|
|
|
cost := r.PurchasePrice.Mul(decimal.NewFromFloat(1.03))
|
|
|
|
|
if !r.ExtraPrice.IsZero() {
|
|
|
|
|
cost = r.PurchasePrice.Add(r.ExtraPrice)
|
|
|
|
|
}
|
|
|
|
|
base := r.UnitPrice.Sub(cost).Mul(decimal.NewFromFloat32(define.Coefficient))
|
|
|
|
|
return base.Round(2)
|
|
|
|
|
}
|
|
|
|
@ -157,6 +161,7 @@ func (*GoodsDetail) Reflect(r *order_preview.GoodsDetail, o *Information) *Goods
|
|
|
|
|
IsImport: r.IsImport,
|
|
|
|
|
Storehouse: r.Storehouse,
|
|
|
|
|
IsFerme: r.IsFerme,
|
|
|
|
|
ExtraPrice: r.ExtraPrice,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|