Files
service/ik3cloud/receivable.go
kanade 084778d51e feat(ik3cloud): 添加海关编码字段到应付和应收模块
- 在Payable结构体中添加CustomsSerial字段
- 在Receivable结构体中添加CustomsSerial字段
- 为两个模块增加海关编码数据支持
2026-06-02 18:02:42 +08:00

67 lines
2.2 KiB
Go

package ik3cloud
import (
"context"
"time"
"git.kumo.work/shama/service/client"
"github.com/shopspring/decimal"
)
type receivable struct {
}
type ArgsReceivableSave struct {
ReceivableId int64 // 应收单id
InvoiceSerial string // 发票号
Number string // 编码
CustomNumber string // 客户编码
CurrencyNumber string // 币种
DepartmentNumber string // 部门
StaffXsyNumber string // 业务员
Products []ReceivableProductItem // 商品
Rate decimal.Decimal // 汇率
Date time.Time // 日期
DomesticShippingCost decimal.Decimal // 国内运费
ForeignShippingCost decimal.Decimal // 国外运费
ForeignCommission decimal.Decimal // 出口佣金
Consignee string // 收货人
}
type ReceivableProductItem struct {
Number string // 商品编码
Name string // 商品名称
Count decimal.Decimal // 数量
UnitPrice decimal.Decimal // 含税单价
AddTaxRate decimal.Decimal // 税率
ExTaxUnitPrice decimal.Decimal // 不含税单价
TaxAmount decimal.Decimal // 税额
UnitAmount decimal.Decimal // 含税金额
ExTaxUnitAmount decimal.Decimal // 不含税金额
ExportCost decimal.Decimal // 外销成本
MinusTaxRate decimal.Decimal // 退税率
MinusTaxAmount decimal.Decimal // 退税额
Unit string // 单位
MinusTaxDifference decimal.Decimal // 退税差额
CustomsSerial string // 海关编码
}
// Save @TITLE 保存应收
func (r *receivable) Save(ctx context.Context, args ArgsReceivableSave) (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 *receivable) 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)
}