- 添加 dict 包,包含字体、分类和字典相关结构体与方法 - 实现分类的增删改查接口 - 实现字典的增删改查接口 - 在 receivable.go 中扩展字段支持汇率、部门、业务员等信息 - 新增 payment.go 文件,实现付款单保存功能 - 引入 time 和 decimal 包以支持日期和金额类型字段
46 lines
1.4 KiB
Go
46 lines
1.4 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
|
|
Number string // 编码
|
|
CustomNumber string // 客户编码
|
|
CurrencyNumber string // 币种
|
|
DepartmentNumber string // 部门
|
|
StaffXsyNumber string // 业务员
|
|
Products []ReceivableProductItem // 商品
|
|
Rate decimal.Decimal // 汇率
|
|
Date time.Time // 日期
|
|
}
|
|
|
|
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 // 不含税金额
|
|
}
|
|
|
|
// 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
|
|
}
|