From 6a8dcfdc75aa8a2bee3caa06a7f47eb1696b94b3 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 16 Oct 2026 16:12:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(paymentRefund):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E9=80=80=E6=AC=BE=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加付款退款单常量定义及类型枚举 - 在 Ik3cloud 结构体中注册付款退款单模块 - 实现付款退款单保存接口 Save - 实现付款退款单作废接口 Cancel - 定义付款退款单参数结构体及费用明细项 --- ik3cloud/constant/constant.go | 9 ++++++ ik3cloud/ik3cloud.go | 27 +++++++++--------- ik3cloud/paymentRefund.go | 53 +++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 ik3cloud/paymentRefund.go diff --git a/ik3cloud/constant/constant.go b/ik3cloud/constant/constant.go index dbe6a08..1512dfb 100644 --- a/ik3cloud/constant/constant.go +++ b/ik3cloud/constant/constant.go @@ -19,6 +19,7 @@ const ( ActionRecPayPurpose Action = "CN_RECPAYPURPOSE" // 收付款用途 ActionExpense Action = "BD_Expense" // 费用项目 ActionPayment Action = "AP_PAYBILL" // 付款单 + ActionPaymentRefund Action = "AP_REFUNDBILL" // 付款退款单 ActionInformation Action = "BOS_ASSISTANTDATA_DETAIL" // 辅助资料 ActionReceiptAction Action = "AR_RECEIVEBILL" // 收款单 ActionBankAccount Action = "CN_BANKACNT" // 银行账户 @@ -42,6 +43,7 @@ var ActionIdField = map[Action]string{ ActionRecPayPurpose: "", ActionExpense: "", ActionPayment: "FID", + ActionPaymentRefund: "FID", ActionInformation: "FEntryID", ActionReceiptAction: "FID", } @@ -62,6 +64,7 @@ var ActionNumberField = map[Action]string{ ActionRecPayPurpose: "FNumber", ActionExpense: "FNumber", ActionPayment: "FBillNo", + ActionPaymentRefund: "FBillNo", ActionInformation: "FNumber", ActionReceiptAction: "FBillNo", } @@ -97,6 +100,12 @@ const ( ReceiptTypeReceipt ReceiptType = "SKDLX09_SYS" // 收款单 ) +type PaymentRefundType = string + +const ( + PaymentRefundTypePurchase PaymentRefundType = "FKTKDLX01_SYS" // 采购业务退款单 +) + type InformationType = string const ( diff --git a/ik3cloud/ik3cloud.go b/ik3cloud/ik3cloud.go index f9bc470..609cbe4 100644 --- a/ik3cloud/ik3cloud.go +++ b/ik3cloud/ik3cloud.go @@ -7,19 +7,20 @@ import ( ) type Ik3cloud struct { - Department department // 部门 - Staff staff // 员工 - Position position // 职位 - Contact contact // 联系人 - Factory factory // 工厂 - Custom custom // 客户 - Product product // 产品 - Receivable receivable // 应收 - Payable payable // 应付 - Dict dict // 字典 - Payment payment // 付款单 - Information information // 资料 - Receipt receipt // 收款单 + Department department // 部门 + Staff staff // 员工 + Position position // 职位 + Contact contact // 联系人 + Factory factory // 工厂 + Custom custom // 客户 + Product product // 产品 + Receivable receivable // 应收 + Payable payable // 应付 + Dict dict // 字典 + Payment payment // 付款单 + Information information // 资料 + Receipt receipt // 收款单 + PaymentRefund paymentRefund // 付款退款单 } type Entity struct { diff --git a/ik3cloud/paymentRefund.go b/ik3cloud/paymentRefund.go new file mode 100644 index 0000000..0cdac57 --- /dev/null +++ b/ik3cloud/paymentRefund.go @@ -0,0 +1,53 @@ +package ik3cloud + +import ( + "context" + "time" + + "git.kumo.work/shama/service/client" + "git.kumo.work/shama/service/ik3cloud/constant" + "github.com/shopspring/decimal" +) + +type paymentRefund struct { +} + +type ArgsPaymentRefundSave struct { + PaymentRefundId int64 // 付款退款单id + Number string // 付款退款单编号 + RefundType constant.PaymentRefundType // 付款退款单类型 + PayUnitType string // 付款单位类型 + PayUnit string // 付款单位(退款供应商) + CurrencyNumber string // 币种 + Rate decimal.Decimal // 汇率 + Date time.Time // 业务日期 2006-01-02 15:04:05 + Remarks string // 备注 + Costs []PaymentRefundCostItem // 费用 +} + +type PaymentRefundCostItem struct { + PaymentPurpose string // 原付款用途 + Amount decimal.Decimal // 金额 + BankAccount string // 我方银行账号 + InvoiceSerial string // 发票号 +} + +// Save @TITLE 保存付款退款单 +func (p *paymentRefund) Save(ctx context.Context, args ArgsPaymentRefundSave) (entity Entity, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "Save", args, &entity) + return +} + +// Cancel @TITLE 作废 +func (p *paymentRefund) Cancel(ctx context.Context, args Unique) (err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Cancel", args, &reply) +}