Files
yunzerwebsiteallinone/go/models/tenant_crm_payback_record.go
T
2026-09-14 16:15:44 +08:00

40 lines
2.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package models
import "time"
// TenantCrmPaybackRecord 回款记录(回款进度流水): yz_backend_crm_payback_record
//
// 说明:
// - 以「回款计划」为先导:payback_id 关联 yz_backend_crm_payback.id;
// contract_id 冗余存储,便于按合同直接查询进度列表;
// - 每次「新建回款」追加一条记录,构成回款进度(一笔笔实际到账),
// 与计划内的 items(计划分期)区分开:前者是实际发生,后者是计划安排;
// - 计划表 received_amount 由本表记录金额汇总回写(refreshPlanReceived);
// - item_seq / item_name 标记本笔回款对应的计划明细节点(进度 / 分期):
// item_seq 对应计划 items 中的 seq(1-based),0=未指定(按整单登记);
// item_name 为节点名称快照,便于明细节点被改动后仍可追溯。
type TenantCrmPaybackRecord struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
ContractID *uint64 `orm:"column(contract_id);null" json:"contract_id"` // 关联合同ID
PaybackID uint64 `orm:"column(payback_id)" json:"payback_id"` // 关联回款计划ID
ItemSeq int `orm:"column(item_seq);default(0)" json:"item_seq"` // 对应计划明细序号(1-based),0=未指定
ItemName string `orm:"column(item_name);size(50)" json:"item_name"` // 计划明细节点名称快照
Amount float64 `orm:"column(amount);digits(14);decimals(2);default(0)" json:"amount"` // 本次回款金额
ReceivedDate string `orm:"column(received_date);size(20)" json:"received_date"` // 回款日期 YYYY-MM-DD
PayMethod int8 `orm:"column(pay_method);default(1)" json:"pay_method"` // 回款方式:1对公/2网银/3现金/4支票/5支付宝/6微信/7其他
ReceiptURL string `orm:"column(receipt_url);size(512);null" json:"receipt_url"` // 流水回执文件地址
ReceiptName string `orm:"column(receipt_name);size(255);null" json:"receipt_name"` // 流水回执文件名
Remark string `orm:"column(remark);type(text);null" json:"remark"` // 备注
OwnerUserID string `orm:"column(owner_user_id);size(64)" json:"owner_user_id"`
OwnerUserName string `orm:"column(owner_user_name);size(128)" json:"owner_user_name"`
CreateUserID string `orm:"column(create_user_id);size(64)" json:"create_user_id"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
}
func (m *TenantCrmPaybackRecord) TableName() string {
return "yz_backend_crm_payback_record"
}