- 新增发票号字段用于标识应收单据 - 添加国内运费字段记录本地运输成本 - 添加国外运费字段记录国际运输成本 - 添加出口佣金字段记录销售佣金信息 - 扩展应收单结构体以支持更多财务明细
50 lines
1.6 KiB
Go
50 lines
1.6 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 int64 // 数量
|
|
UnitPrice decimal.Decimal // 含税单价
|
|
AddTaxRate decimal.Decimal // 税率
|
|
ExTaxUnitPrice decimal.Decimal // 不含税单价
|
|
TaxAmount decimal.Decimal // 税额
|
|
UnitAmount decimal.Decimal // 含税金额
|
|
ExTaxUnitAmount 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
|
|
}
|