feat(erp): 新增字典和分类管理功能

- 添加 dict 包,包含字体、分类和字典相关结构体与方法
- 实现分类的增删改查接口
- 实现字典的增删改查接口
- 在 receivable.go 中扩展字段支持汇率、部门、业务员等信息
- 新增 payment.go 文件,实现付款单保存功能
- 引入 time 和 decimal 包以支持日期和金额类型字段
This commit is contained in:
2025-12-16 15:03:34 +08:00
parent 81492da604
commit c1ff46e933
9 changed files with 342 additions and 5 deletions

View File

@@ -11,12 +11,14 @@ const (
ActionFactory Action = "BD_Supplier" // 工厂
ActionContact Action = "BD_CommonContact" // 联系人
ActionCustom Action = "BD_Customer" // 客户
ActionReceivable Action = "AR_receivable" // 付款
ActionPayable Action = "AP_Payable" // 付
ActionReceivable Action = "AR_receivable" // 应收
ActionPayable Action = "AP_Payable" // 付单
ActionProduct Action = "BD_MATERIAL" // 物料
ActionCurrency Action = "BD_Currency" // 币种
ActionSettleType Action = "BD_SETTLETYPE" // 结算方式
ActionRecPayPurpose Action = "CN_RECPAYPURPOSE" // 收付款用途
ActionExpense Action = "BD_Expense" // 费用项目
ActionPayment Action = "AP_PAYBILL" // 付款单
)
type OperatorType = string
@@ -25,3 +27,11 @@ const (
OperatorTypeXSY OperatorType = "XSY" // 业务员
OperatorTypeCGY OperatorType = "CGY" // 采购员
)
type PaymentType = string
const (
PaymentTypePurchase PaymentType = "FKDLX09_SYS" // 采购付款单
PaymentTypeCost PaymentType = "FKDLX10_SYS" // 费用付款单
PaymentTypeRequest PaymentType = "FKDLX11_SYS" // 报销付款单
)

View File

@@ -11,6 +11,7 @@ type Ik3cloud struct {
Receivable receivable // 应收
Payable payable // 应付
Dict dict // 字典
Payment payment // 付款单
}
type Entity struct {
Id int64 `json:"Id"`

47
ik3cloud/payment.go Normal file
View File

@@ -0,0 +1,47 @@
package ik3cloud
import (
"context"
"time"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/ik3cloud/constant"
"github.com/shopspring/decimal"
)
type payment struct {
}
type ArgsPaymentSave struct {
PaymentId int64 // 付款单id
Number string // 付款单编号
PaymentType constant.PaymentType // 付款类型
PayeeNameType string // 收款单位类型
PayeeName string // 收款单位
CurrencyNumber string // 币种
DepartmentNumber string // 采购部门
StaffNumber string // 采购员
Remarks string // 备注
Costs []PaymentCostItem // 费用
Rate decimal.Decimal // 汇率
Date time.Time // 业务日期 2006-01-02 15:04:05
}
type PaymentCostItem struct {
Amount decimal.Decimal // 金额
Date time.Time // 费用日期
InvoiceSerial string // 发票号
DepartmentNumber string // 核算部门
SettlementMethod string // 结算方式
PaymentPurpose string // 付款用途
ExpenseItem string // 费用项目
}
// Save @TITLE 保存付款单
func (p *payment) Save(ctx context.Context, args ArgsPaymentSave) (entity Entity, err error) {
xClient, err := client.GetClient(p)
if err != nil {
return
}
err = xClient.Call(ctx, "Save", args, &entity)
return
}

View File

@@ -2,16 +2,36 @@ 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 // 客户编码
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 保存应收