diff --git a/ik3cloud/constant/constant.go b/ik3cloud/constant/constant.go index dbe6a08..1512dfb 100644 --- a/ik3cloud/constant/constant.go +++ b/ik3cloud/constant/constant.go @@ -19,6 +19,7 @@ const ( ActionRecPayPurpose Action = "CN_RECPAYPURPOSE" // 收付款用途 ActionExpense Action = "BD_Expense" // 费用项目 ActionPayment Action = "AP_PAYBILL" // 付款单 + ActionPaymentRefund Action = "AP_REFUNDBILL" // 付款退款单 ActionInformation Action = "BOS_ASSISTANTDATA_DETAIL" // 辅助资料 ActionReceiptAction Action = "AR_RECEIVEBILL" // 收款单 ActionBankAccount Action = "CN_BANKACNT" // 银行账户 @@ -42,6 +43,7 @@ var ActionIdField = map[Action]string{ ActionRecPayPurpose: "", ActionExpense: "", ActionPayment: "FID", + ActionPaymentRefund: "FID", ActionInformation: "FEntryID", ActionReceiptAction: "FID", } @@ -62,6 +64,7 @@ var ActionNumberField = map[Action]string{ ActionRecPayPurpose: "FNumber", ActionExpense: "FNumber", ActionPayment: "FBillNo", + ActionPaymentRefund: "FBillNo", ActionInformation: "FNumber", ActionReceiptAction: "FBillNo", } @@ -97,6 +100,12 @@ const ( ReceiptTypeReceipt ReceiptType = "SKDLX09_SYS" // 收款单 ) +type PaymentRefundType = string + +const ( + PaymentRefundTypePurchase PaymentRefundType = "FKTKDLX01_SYS" // 采购业务退款单 +) + type InformationType = string const ( diff --git a/ik3cloud/ik3cloud.go b/ik3cloud/ik3cloud.go index f9bc470..609cbe4 100644 --- a/ik3cloud/ik3cloud.go +++ b/ik3cloud/ik3cloud.go @@ -7,19 +7,20 @@ import ( ) type Ik3cloud struct { - Department department // 部门 - Staff staff // 员工 - Position position // 职位 - Contact contact // 联系人 - Factory factory // 工厂 - Custom custom // 客户 - Product product // 产品 - Receivable receivable // 应收 - Payable payable // 应付 - Dict dict // 字典 - Payment payment // 付款单 - Information information // 资料 - Receipt receipt // 收款单 + Department department // 部门 + Staff staff // 员工 + Position position // 职位 + Contact contact // 联系人 + Factory factory // 工厂 + Custom custom // 客户 + Product product // 产品 + Receivable receivable // 应收 + Payable payable // 应付 + Dict dict // 字典 + Payment payment // 付款单 + Information information // 资料 + Receipt receipt // 收款单 + PaymentRefund paymentRefund // 付款退款单 } type Entity struct { diff --git a/ik3cloud/paymentRefund.go b/ik3cloud/paymentRefund.go new file mode 100644 index 0000000..0cdac57 --- /dev/null +++ b/ik3cloud/paymentRefund.go @@ -0,0 +1,53 @@ +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) +}