- 在 receivable 结构体中新增 ExportCost 字段表示外销成本 - 添加 MinusTaxRate 字段用于存储退税率 - 引入 MinusTaxAmount 字段记录退税额 - 完善结构体注释以明确各字段含义
53 lines
1.8 KiB
Go
53 lines
1.8 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 // 不含税金额
|
|
ExportCost decimal.Decimal // 外销成本
|
|
MinusTaxRate decimal.Decimal // 退税率
|
|
MinusTaxAmount 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
|
|
}
|