54 lines
1.5 KiB
Go
54 lines
1.5 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 receipt struct {
|
|
}
|
|
type ArgsReceiptSave struct {
|
|
ReceiptId int64 // 收款单ID
|
|
Number string // 单据编号
|
|
ReceiptType constant.ReceiptType // 收款单类型
|
|
Date time.Time // 收款单日期
|
|
DepartmentNumber string // 部门编号
|
|
StaffXsyNumber string // 业务员编号
|
|
CurrencyNumber string // 币种编号
|
|
Rate decimal.Decimal // 汇率
|
|
Remarks string // 备注
|
|
Costs []ReceiptCost // 费用明细
|
|
CustomNumber string // 客户编号
|
|
}
|
|
|
|
type ReceiptCost struct {
|
|
InvoiceSerial string // 发票号
|
|
DepartmentNumber string // 部门编号
|
|
Amount decimal.Decimal // 金额
|
|
Remarks string // 备注
|
|
}
|
|
|
|
// Save @TITLE 保存收款单
|
|
func (r *receipt) Save(ctx context.Context, args ArgsReceiptSave) (entity Entity, err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "Save", args, &entity)
|
|
return
|
|
}
|
|
|
|
// Cancel @TITLE 作废
|
|
func (r *receipt) Cancel(ctx context.Context, args Unique) (err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Cancel", args, &reply)
|
|
}
|