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.
back/internal/v2/model/finance/recookFinanceBillOrderSourc...

53 lines
2.3 KiB

package finance
import (
"github.com/shopspring/decimal"
"gorm.io/gorm"
"recook/internal/v2/model/gys"
"time"
)
const (
RecookFinanceBillOrderSourceTaxStatusUnUpload = 1 // 待上传
RecookFinanceBillOrderSourceTaxStatusUnConfirm = 2 // 待确认
RecookFinanceBillOrderSourceTaxStatusConfirm = 3 // 已确认
RecookFinanceBillOrderSourceTaxStatusFinish = 4 // 已打款
)
type RecookFinanceBillOrderSourceTax struct {
Id uint `gorm:"primaryKey"`
SourceId uint // 运营方id
Source gys.GysSourceModel `gorm:"foreignKey:SourceId"`
No string // 发票号
Date time.Time // 发票日期
Type uint // 发票类型 1=增值税专用发票(纸质) 2=增值税专用发票(电子) 3=增值税普通发票(纸质) 4=增值税普通发票(电子)
Amount decimal.Decimal // 开票金额
Status uint // 发票状态 1=待上传 2=待确认 3=已确认 4=已打款
SubmitTime time.Time // 提交时间
Liste string // 开票清单
Express RecookFinanceBillOrderSourceTaxTransferExpress `gorm:"foreignKey:OrderSourceTaxId"`
Electron RecookFinanceBillOrderSourceTaxTransferElectron `gorm:"foreignKey:OrderSourceTaxId"`
AuditTime time.Time // 审核时间
PayNo string // 付款编号
PayTime time.Time // 付款时间
PayImg string // 付款时间
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt
}
// GetTransferType 获取发票传送类型 0=未处理类型 1=快递 2=电子
func (r *RecookFinanceBillOrderSourceTax) GetTransferType(taxType uint) uint {
switch taxType {
case 1: // 增值税专用发票(纸质)
return 1
case 2: // 增值税专用发票(电子)
return 2
case 3: // 增值税普通发票(纸质)
return 1
case 4: // 增值税普通发票(电子)
return 2
}
return 0
}