You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ims/app/models/payment_plan.go

40 lines
1.9 KiB

package models
import (
"ims/util/db/dts"
"time"
"github.com/shopspring/decimal"
"gorm.io/gorm"
)
const (
PaymentForPurchase = "purchase" // 采购
PaymentForSale = "sale" // 销售
)
// PaymentPlan 收付款计划
type PaymentPlan struct {
ID uint `json:"id" gorm:"primaryKey"` // 审核ID
OwnerID uint `json:"owner_id"` // 所属者编号
OwnerType string `json:"owner_type"` // 所属者类型
BatchID uint `json:"batch_id"` // 收款批次
Ratio decimal.Decimal `json:"ratio"` //收款比例 %
Amount decimal.Decimal `json:"amount"` //收款金额/元
PaymentTypeID uint `json:"payment_type_id"` //收款方式
Date dts.Date `json:"date"` //计划收款日期
Remark string `json:"remark"` //备注
Batch *Tag `json:"batch,omitempty" gorm:"foreignKey:BatchID"`
CreatedBy uint `json:"created_by"` // 创建者(员工编号)
CreatedAt time.Time `json:"created_at"` // 创建时间
UpdatedBy dts.NullUint `json:"updated_by"` // 创建者(员工编号)
UpdatedAt dts.NullTime `json:"updated_at" gorm:"autoUpdateTime:false"` // 上次操作时间
DeletedBy dts.NullUint `json:"deleted_by"` // 删除者(员工编号)
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` // 删除数据时间
Creator *Employee `json:"creator,omitempty" gorm:"foreignKey:CreatedBy"` // 创建数据的员工
Updater *Employee `json:"updater,omitempty" gorm:"foreignKey:UpdatedBy"` // 上次更新数据的员工
Deleter *Employee `json:"deleter,omitempty" gorm:"foreignKey:DeletedBy"` // 删除数据的员工
}