Files
service/ik3cloud/receivable.go
kanade c778603b66 feat(erp): 更新收据和应收账款数据结构
- 在收据结构中添加付款公司字段
- 将应收账款数量类型从int64改为decimal.Decimal
- 在应收账款项目中添加发票单位字段
- 更新ik3cloud中应收账款产品项目的数量类型为decimal.Decimal
2026-01-27 14:26:36 +08:00

65 lines
2.1 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 // 出口佣金
}
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 // 退税差额
}
// 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)
}