- 添加付款退款单常量定义及类型枚举 - 在 Ik3cloud 结构体中注册付款退款单模块 - 实现付款退款单保存接口 Save - 实现付款退款单作废接口 Cancel - 定义付款退款单参数结构体及费用明细项
54 lines
1.6 KiB
Go
54 lines
1.6 KiB
Go
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)
|
|
}
|