Files
service/ik3cloud/receivable.go
kanade eb4c3e3241 feat(ik3cloud): 新增收款单功能并完善作废接口
- 新增收款单常量定义及映射配置
- 新增收款单类型枚举定义
- 新增收款单服务模块,支持保存和作废操作
- 在应付、应收、付款模块中补充作废接口实现
- 定义收款单保存参数结构体及费用明细结构体
2025-12-19 16:31:29 +08:00

63 lines
2.0 KiB
Go

package ik3cloud
import (
"context"
"time"
"git.kumo.work/shama/service/client"
"github.com/shopspring/decimal"
)
type receivable struct {
}
type ArgsReceivableSave struct {
ReceivableId int64 // 应收单id
InvoiceSerial string // 发票号
Number string // 编码
CustomNumber string // 客户编码
CurrencyNumber string // 币种
DepartmentNumber string // 部门
StaffXsyNumber string // 业务员
Products []ReceivableProductItem // 商品
Rate decimal.Decimal // 汇率
Date time.Time // 日期
DomesticShippingCost decimal.Decimal // 国内运费
ForeignShippingCost decimal.Decimal // 国外运费
ForeignCommission decimal.Decimal // 出口佣金
}
type ReceivableProductItem struct {
Number string // 商品编码
Name string // 商品名称
Count int64 // 数量
UnitPrice decimal.Decimal // 含税单价
AddTaxRate decimal.Decimal // 税率
ExTaxUnitPrice decimal.Decimal // 不含税单价
TaxAmount decimal.Decimal // 税额
UnitAmount decimal.Decimal // 含税金额
ExTaxUnitAmount decimal.Decimal // 不含税金额
ExportCost decimal.Decimal // 外销成本
MinusTaxRate decimal.Decimal // 退税率
MinusTaxAmount decimal.Decimal // 退税额
}
// Save @TITLE 保存应收
func (r *receivable) Save(ctx context.Context, args ArgsReceivableSave) (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 *receivable) 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)
}