feat(ik3cloud): 新增收款单功能并完善作废接口

- 新增收款单常量定义及映射配置
- 新增收款单类型枚举定义
- 新增收款单服务模块,支持保存和作废操作
- 在应付、应收、付款模块中补充作废接口实现
- 定义收款单保存参数结构体及费用明细结构体
This commit is contained in:
2025-12-19 16:31:29 +08:00
parent d44f208a84
commit eb4c3e3241
6 changed files with 93 additions and 0 deletions

52
ik3cloud/receipt.go Normal file
View File

@@ -0,0 +1,52 @@
package ik3cloud
import (
"context"
"time"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/ik3cloud/constant"
"github.com/shopspring/decimal"
)
type receipt struct {
}
type ArgsReceiptSave struct {
ReceiptId int64 // 收款单ID
Number string // 单据编号
ReceiptType constant.ReceiptType // 收款单类型
Date time.Time // 收款单日期
DepartmentNumber string // 部门编号
StaffXsyNumber string // 业务员编号
CurrencyNumber string // 币种编号
Rate decimal.Decimal // 汇率
Remarks string // 备注
Costs []ReceiptCost // 费用明细
}
type ReceiptCost struct {
InvoiceSerial string // 发票号
DepartmentNumber string // 部门编号
Amount decimal.Decimal // 金额
Remarks string // 备注
}
// Save @TITLE 保存收款单
func (r *receipt) Save(ctx context.Context, args ArgsReceiptSave) (entity Entity, err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
err = xClient.Call(ctx, "Save", args, &entity)
return
}
// Cancel @TITLE 作废
func (r *receipt) Cancel(ctx context.Context, args Unique) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", args, &reply)
}