diff --git a/erp/payment.go b/erp/payment.go new file mode 100644 index 0000000..dd991b5 --- /dev/null +++ b/erp/payment.go @@ -0,0 +1,77 @@ +package erp + +import ( + "context" + "time" + + "git.kumo.work/shama/service/client" + "git.kumo.work/shama/service/lib/bean" + "github.com/shopspring/decimal" +) + +type payment struct { +} +type ArgsPaymentList struct { + Page bean.Page + Search PaymentSearch +} +type PaymentSearch struct { + PaymentSerial string // 付款单号 + AccountingSerial string // 做账合同号 + CreatedAtStart *time.Time + CreatedAtEnd *time.Time + PurchaseStaffIds []int64 // 采购人员 +} +type ReplyPaymentList struct { + Total int64 `json:"total"` + List []PaymentItem `json:"list"` +} +type PaymentItem struct { + Id int64 `json:"id"` + PaymentSerial string `json:"paymentSerial"` + AccountingSerial string `json:"accountingSerial"` + PayableSerial string `json:"payableSerial"` + InvoiceSerial string `json:"invoiceSerial"` + 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"` + PurchaseStaffId int64 `json:"purchaseStaffId"` + Ik3cloudStatus int64 `json:"ik3CloudStatus"` + Ik3cloudErrMsg string `json:"ik3CloudErrMsg"` + Ik3cloudUpdatedAt *time.Time `json:"ik3CloudUpdatedAt"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` +} + +// List @TITLE 列表 +func (p *payment) List(ctx context.Context, args ArgsPaymentList) (reply ReplyPaymentList, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "List", args, &reply) + return +} + +// Gen @TITLE 生成付款单 +func (p *payment) Gen(ctx context.Context, payableId int64) (err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Gen", payableId, &reply) +} + +// Ik3cloud @TITLE 金蝶同步 +func (p *payment) Ik3cloud(ctx context.Context, paymentId int64) (err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Ik3cloud", paymentId, &reply) +}