Files
service/erp/receipt.go
kanade 9f74a84866 feat(erp): 添加收款单认领状态和认领金额字段
- 在 ReceiptQuery 结构体中添加 ClaimStatus 字段用于标识认领状态
- 在 ReceiptItem 结构体中添加 ClaimAmount 字段用于记录认领金额
- 在 Receipt 结构体中添加 ClaimAmount 字段用于记录认领金额
2026-01-05 16:34:56 +08:00

171 lines
5.8 KiB
Go

package erp
import (
"context"
"time"
"git.kumo.work/shama/service/client"
receipt2 "git.kumo.work/shama/service/erp/receipt"
"git.kumo.work/shama/service/lib/bean"
"github.com/shopspring/decimal"
)
type receipt struct {
receipt2.Receipt
}
type ArgsReceiptList struct {
Page bean.Page
Search ReceiptSearch
}
type ReceiptSearch struct {
ReceiptSerial string // 收汇单号
CustomId int64 // 客户筛选
CustomName string // 客户筛选
PayCustomId int64 // 付款客户
PayCustomName string // 付款客户名称
BankName string // 结汇银行
ReceiptDateStart *time.Time // 创建开始时间
ReceiptDateEnd *time.Time // 创建结束时间
BanFlag int64 // 禁用标记 1=禁用 2=启用
ClaimStatus int64 // 认领状态 1=待认领 2=部分认领 3=已认领
}
type ReplyReceiptList struct {
List []ReceiptItem `json:"list"`
Total int64 `json:"total"`
}
type ReceiptItem struct {
Id int64 `json:"id"`
ReceiptSerial string `json:"receiptSerial"`
CustomId int64 `json:"customId"`
CustomName string `json:"customName"`
PayCustomId int64 `json:"payCustomId"`
PayCustomName string `json:"payCustomName"`
ReceiptDate time.Time `json:"receiptDate"`
Currency string `json:"currency"`
CurrencyName string `json:"currencyName"`
CurrencySymbol string `json:"currencySymbol"`
CurrencyRate decimal.Decimal `json:"currencyRate"`
BankName string `json:"bankName"`
EntryAmount decimal.Decimal `json:"entryAmount"`
ReceivableFxAmount decimal.Decimal `json:"receivableFxAmount"`
ClaimAmount decimal.Decimal `json:"claimAmount"`
CreatedStaffId int64 `json:"createdStaffId"`
BanFlag int64 `json:"banFlag"`
Ik3cloudStatus int64 `json:"ik3CloudStatus"`
Ik3cloudErrMsg string `json:"ik3CloudErrMsg"`
Ik3cloudUpdatedAt *time.Time `json:"ik3CloudUpdatedAt"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
}
// List @TITLE 列表
func (r *receipt) List(ctx context.Context, args ArgsReceiptList) (reply ReplyReceiptList, err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
err = xClient.Call(ctx, "List", args, &reply)
return
}
type ArgsReceiptAdd struct {
StaffId int64
ReceiptAdd
}
type ReceiptAdd struct {
ReceiptDate time.Time // 收汇日期
Currency string // 币种
CurrencyName string // 币种名称
CurrencySymbol string // 币种符号
CurrencyRate decimal.Decimal // 币种汇率
PayCustomId int64 // 付款客户id
BankName string // 结汇银行
EntryAmount decimal.Decimal // 外币入账金额
ForeignFee decimal.Decimal // 国外扣费
DomesticFee decimal.Decimal // 国内扣费
DomesticFeeType DomesticFeeType // 国内扣费类型 1=外币 2=人民币
}
// Add @TITLE 添加
func (r *receipt) Add(ctx context.Context, args ArgsReceiptAdd) (receiptId int64, err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
err = xClient.Call(ctx, "Add", args, &receiptId)
return
}
type ReplyReceiptInfo struct {
Id int64 `json:"id"`
ReceiptSerial string `json:"receiptSerial"`
ReceiptDate time.Time `json:"receiptDate"`
Currency string `json:"currency"`
CurrencyName string `json:"currencyName"`
CurrencySymbol string `json:"currencySymbol"`
CurrencyRate decimal.Decimal `json:"currencyRate"`
CustomId int64 `json:"customId"`
CustomName string `json:"customName"`
PayCustomId int64 `json:"payCustomId"`
PayCustomName string `json:"payCustomName"`
BankName string `json:"bankName"`
EntryAmount decimal.Decimal `json:"entryAmount"`
ForeignFee decimal.Decimal `json:"foreignFee"`
DomesticFee decimal.Decimal `json:"domesticFee"`
DomesticFeeType int64 `json:"domesticFeeType"`
ReceivableFxAmount decimal.Decimal `json:"receivableFxAmount"`
ClaimAmount decimal.Decimal `json:"claimAmount"`
CreatedStaffId int64 `json:"createdStaffId"`
BanFlag int64 `json:"banFlag"`
Ik3cloudStatus int64 `json:"ik3CloudStatus"`
Ik3cloudErrMsg string `json:"ik3CloudErrMsg"`
Ik3cloudUpdatedAt *time.Time `json:"ik3CloudUpdatedAt"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
}
// Info @TITLE 详情
func (r *receipt) Info(ctx context.Context, receiptId int64) (reply ReplyReceiptInfo, err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
err = xClient.Call(ctx, "Info", receiptId, &reply)
return
}
type ArgsReceiptEdit struct {
ReceiptId int64
ReceiptAdd
}
// Edit @TITLE 编辑
func (r *receipt) Edit(ctx context.Context, args ArgsReceiptEdit) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Edit", args, &reply)
}
// Ik3cloud @TITLE 金蝶同步
func (r *receipt) Ik3cloud(ctx context.Context, receiptId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Ik3cloud", receiptId, &reply)
}
// Cancel @TITLE 作废
func (r *receipt) Cancel(ctx context.Context, receiptId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", receiptId, &reply)
}