feat(erp): 新增付款退款单服务层
- 在 ERP 服务结构体中注册 PaymentRefund 模块 - 新增付款退款单列表查询接口,支持按退款单号、工厂、时间范围等条件搜索 - 新增付款退款单手动创建接口 - 新增付款退款单详情查询接口 - 新增付款退款单编辑接口 - 新增付款退款单金蝶同步接口
This commit is contained in:
@@ -14,6 +14,7 @@ type Erp struct {
|
||||
Accounting accounting
|
||||
Payable payable
|
||||
Payment payment
|
||||
PaymentRefund paymentRefund
|
||||
Receivable receivable
|
||||
Receipt receipt
|
||||
Expense expense
|
||||
|
||||
132
erp/paymentRefund.go
Normal file
132
erp/paymentRefund.go
Normal file
@@ -0,0 +1,132 @@
|
||||
package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type paymentRefund struct {
|
||||
}
|
||||
|
||||
type ArgsPaymentRefundList struct {
|
||||
Page bean.Page
|
||||
Search PaymentRefundSearch
|
||||
}
|
||||
type PaymentRefundSearch struct {
|
||||
PaymentRefundIds []int64 // 付款退款单id
|
||||
PaymentRefundSerial string // 付款退款单号
|
||||
FactoryId int64 // 工厂
|
||||
FactoryName string // 工厂名称
|
||||
CreatedAtStart *time.Time // 创建开始时间
|
||||
CreatedAtEnd *time.Time // 创建结束时间
|
||||
}
|
||||
type ReplyPaymentRefundList struct {
|
||||
Total int64 `json:"total"`
|
||||
List []PaymentRefundItem `json:"list"`
|
||||
}
|
||||
type PaymentRefundItem struct {
|
||||
Id int64 `json:"id"`
|
||||
PaymentRefundSerial string `json:"paymentRefundSerial"`
|
||||
FactoryId int64 `json:"factoryId"`
|
||||
FactoryName string `json:"factoryName"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
RefundDate time.Time `json:"refundDate"`
|
||||
BankAccount string `json:"bankAccount"`
|
||||
InvoiceSerial string `json:"invoiceSerial"`
|
||||
PaymentPurpose string `json:"paymentPurpose"`
|
||||
Remark string `json:"remark"`
|
||||
Ik3cloudStatus int64 `json:"ik3CloudStatus"`
|
||||
Ik3cloudErrMsg string `json:"ik3CloudErrMsg"`
|
||||
Ik3cloudUpdatedAt *time.Time `json:"ik3CloudUpdatedAt"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
type PaymentRefundCostItem struct {
|
||||
Id int64 `json:"id"`
|
||||
PaymentPurpose string `json:"paymentPurpose"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
BankAccount string `json:"bankAccount"`
|
||||
InvoiceSerial string `json:"invoiceSerial"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (p *paymentRefund) List(ctx context.Context, args ArgsPaymentRefundList) (reply ReplyPaymentRefundList, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsPaymentRefundAdd struct {
|
||||
StaffId int64
|
||||
PaymentRefundAdd
|
||||
}
|
||||
type PaymentRefundAdd struct {
|
||||
FactoryId int64 // 工厂id
|
||||
Currency string // 币种
|
||||
CurrencyName string // 币种名称
|
||||
CurrencySymbol string // 币种符号
|
||||
CurrencyRate decimal.Decimal // 币种汇率
|
||||
RefundDate time.Time // 退款日期
|
||||
Amount decimal.Decimal // 金额
|
||||
Remark string // 备注
|
||||
PaymentPurpose string // 原付款用途
|
||||
BankAccount string // 我方银行账号
|
||||
InvoiceSerial string // 发票号
|
||||
}
|
||||
|
||||
// Add @TITLE 添加(手动创建)
|
||||
func (p *paymentRefund) Add(ctx context.Context, args ArgsPaymentRefundAdd) (paymentRefundId int64, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Add", args, &paymentRefundId)
|
||||
return
|
||||
}
|
||||
|
||||
// Info @TITLE 详情
|
||||
func (p *paymentRefund) Info(ctx context.Context, paymentRefundId int64) (reply PaymentRefundItem, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Info", paymentRefundId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsPaymentRefundEdit struct {
|
||||
PaymentRefundId int64 // 付款退款单id
|
||||
PaymentRefundAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑
|
||||
func (p *paymentRefund) Edit(ctx context.Context, args ArgsPaymentRefundEdit) (err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
|
||||
// Ik3cloud @TITLE 金蝶同步
|
||||
func (p *paymentRefund) Ik3cloud(ctx context.Context, paymentRefundId int64) (err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Ik3cloud", paymentRefundId, &reply)
|
||||
}
|
||||
Reference in New Issue
Block a user