diff --git a/erp/purchase.go b/erp/purchase.go index 8434772..e0eae71 100644 --- a/erp/purchase.go +++ b/erp/purchase.go @@ -177,3 +177,40 @@ func (p *purchase) Cancel(ctx context.Context, purchaseId int64) (err error) { err = xClient.Call(ctx, "Cancel", purchaseId, &reply) return } + +type ArgsPurchaseHistory struct { + Page bean.Page + Search PurchaseHistorySearch +} +type PurchaseHistorySearch struct { + ProductId int64 // 产品id +} +type ReplyPurchaseHistory struct { + List []PurchaseHistoryItem `json:"list"` + Total int64 `json:"total"` +} +type PurchaseHistoryItem struct { + PurchaseId int64 `json:"purchaseId"` + PiSerial string `json:"piSerial"` + OrderDate time.Time `json:"orderDate"` + FactorySerial string `json:"factorySerial"` + FactoryName string `json:"factoryName"` + PurchasePrice decimal.Decimal `json:"purchasePrice"` + PurchaseCount int64 `json:"purchaseCount"` + PurchaseAmount decimal.Decimal `json:"purchaseAmount"` + PurchaseCurrency string `json:"purchaseCurrency"` + PurchaseCurrencyName string `json:"purchaseCurrencyName"` + PurchaseCurrencySymbol string `json:"purchaseCurrencySymbol"` + PurchaseCurrencyRate decimal.Decimal `json:"purchaseCurrencyRate"` + CreatedStaffId int64 `json:"createdStaffId"` +} + +// History @TITLE 历史记录 +func (p *purchase) History(ctx context.Context, args ArgsPurchaseHistory) (reply ReplyPurchaseHistory, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "History", args, &reply) + return +} diff --git a/erp/sale.go b/erp/sale.go index c1cdc30..f7e232a 100644 --- a/erp/sale.go +++ b/erp/sale.go @@ -278,3 +278,40 @@ func (s *sale) Clone(ctx context.Context, args ArgsSaleClone) (reply int64, err err = xClient.Call(ctx, "Clone", args, &reply) return } + +type ArgsSaleHistory struct { + Page bean.Page + Search SaleHistorySearch +} +type SaleHistorySearch struct { + ProductId int64 // 产品id +} +type ReplySaleHistory struct { + List []SaleHistoryItem `json:"list"` + Total int64 `json:"total"` +} +type SaleHistoryItem struct { + SaleId int64 `json:"saleId"` + PiSerial string `json:"piSerial"` + ContractDate time.Time `json:"contractDate"` + CustomName string `json:"customName"` + CustomShortName string `json:"customShortName"` + SalePrice decimal.Decimal `json:"salePrice"` + SaleCount int64 `json:"saleCount"` + SaleAmount decimal.Decimal `json:"saleAmount"` + SaleCurrency string `json:"saleCurrency"` + SaleCurrencyName string `json:"saleCurrencyName"` + SaleCurrencySymbol string `json:"saleCurrencySymbol"` + SaleCurrencyRate decimal.Decimal `json:"saleCurrencyRate"` + CreatedStaffId int64 `json:"createdStaffId"` +} + +// History @TITLE 历史记录 +func (s *sale) History(ctx context.Context, args ArgsSaleHistory) (reply ReplySaleHistory, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "History", args, &reply) + return +}