From 3c1fa079cf5d16cbbf8825d230d3123da030c80f Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 19 Dec 2025 16:58:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(receipt):=20=E6=B7=BB=E5=8A=A0=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=BC=96=E5=8F=B7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Receipt 结构体中新增 CustomNumber 字段 - 用于存储客户的唯一标识信息 - 支持后续按客户编号查询和统计功能 --- erp/expense.go | 10 ++++++++++ erp/receipt.go | 31 +++++++++++++++++++++++++++---- erp/receivable.go | 1 + erp/request.go | 10 ++++++++++ ik3cloud/receipt.go | 1 + 5 files changed, 49 insertions(+), 4 deletions(-) diff --git a/erp/expense.go b/erp/expense.go index 48f4267..7636b3d 100644 --- a/erp/expense.go +++ b/erp/expense.go @@ -130,3 +130,13 @@ func (r *expense) Ik3cloud(ctx context.Context, expenseId int64) (err error) { reply := 0 return xClient.Call(ctx, "Ik3cloud", expenseId, &reply) } + +// Cancel @TITLE 作废 +func (r *expense) Cancel(ctx context.Context, expenseId int64) (err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Cancel", expenseId, &reply) +} diff --git a/erp/receipt.go b/erp/receipt.go index d071f20..be5ab90 100644 --- a/erp/receipt.go +++ b/erp/receipt.go @@ -19,7 +19,8 @@ type ArgsReceiptList struct { } type ReceiptSearch struct { ReceiptSerial string // 收汇单号 - PayName string // 付款单位 + CustomId int64 // 客户筛选 + CustomName string // 客户筛选 BankName string // 结汇银行 ReceiptDateStart *time.Time // 创建开始时间 ReceiptDateEnd *time.Time // 创建结束时间 @@ -31,7 +32,8 @@ type ReplyReceiptList struct { type ReceiptItem struct { Id int64 `json:"id"` ReceiptSerial string `json:"receiptSerial"` - PayName string `json:"payName"` + CustomId int64 `json:"customId"` + CustomName string `json:"customName"` ReceiptDate time.Time `json:"receiptDate"` Currency string `json:"currency"` CurrencyName string `json:"currencyName"` @@ -65,7 +67,7 @@ type ReceiptAdd struct { CurrencyName string // 币种名称 CurrencySymbol string // 币种符号 CurrencyRate decimal.Decimal // 币种汇率 - PayName string // 付款单位 + CustomId int64 // 客户id BankName string // 结汇银行 EntryAmount decimal.Decimal // 外币入账金额 ForeignFee decimal.Decimal // 国外扣费 @@ -91,7 +93,8 @@ type ReplyReceiptInfo struct { CurrencyName string `json:"currencyName"` CurrencySymbol string `json:"currencySymbol"` CurrencyRate decimal.Decimal `json:"currencyRate"` - PayName string `json:"payName"` + CustomId int64 `json:"customId"` + CustomName string `json:"customName"` BankName string `json:"bankName"` EntryAmount decimal.Decimal `json:"entryAmount"` ForeignFee decimal.Decimal `json:"foreignFee"` @@ -127,3 +130,23 @@ func (r *receipt) Edit(ctx context.Context, args ArgsReceiptEdit) (err error) { reply := 0 return xClient.Call(ctx, "Edit", args, &reply) } + +// Ik3cloud @TITLE 金蝶同步 +func (r *receipt) Ik3cloud(ctx context.Context, receiptId int64) (err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Ik3cloud", receiptId, &reply) +} + +// Cancel @TITLE 作废 +func (r *receipt) Cancel(ctx context.Context, receiptId int64) (err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Cancel", receiptId, &reply) +} diff --git a/erp/receivable.go b/erp/receivable.go index 9f062de..ba6a7f3 100644 --- a/erp/receivable.go +++ b/erp/receivable.go @@ -18,6 +18,7 @@ type ArgsReceivableList struct { type ReceivableSearch struct { ReceivableSerial string // 收款单据号 CustomId int64 // 客户id + CustomName string // 客户名称 InvoiceSerial string // 出运发票号 CreatedAtStart *time.Time // 创建开始时间 CreatedAtEnd *time.Time // 创建结束时间 diff --git a/erp/request.go b/erp/request.go index 7f59b45..e94adbc 100644 --- a/erp/request.go +++ b/erp/request.go @@ -140,3 +140,13 @@ func (r *request) Ik3cloud(ctx context.Context, requestId int64) (err error) { reply := 0 return xClient.Call(ctx, "Ik3cloud", requestId, &reply) } + +// Cancel @TITLE 作废 +func (r *request) Cancel(ctx context.Context, requestId int64) (err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Cancel", requestId, &reply) +} diff --git a/ik3cloud/receipt.go b/ik3cloud/receipt.go index 4d7166b..6ce5c0b 100644 --- a/ik3cloud/receipt.go +++ b/ik3cloud/receipt.go @@ -22,6 +22,7 @@ type ArgsReceiptSave struct { Rate decimal.Decimal // 汇率 Remarks string // 备注 Costs []ReceiptCost // 费用明细 + CustomNumber string // 客户编号 } type ReceiptCost struct {