| | |
| | | info.SupplierName = p.Supplier.Name |
| | | info.Amount = p.Quantity.IntPart() |
| | | info.Status = int64(p.Status) |
| | | if p.Status == purchase.OrderStatusStored || p.Status == purchase.OrderStatusCompleted { |
| | | info.FinishAmount = info.Amount |
| | | } |
| | | for _, pp := range pps { |
| | | if int(p.ID) == pp.PurchaseId { |
| | | info.ProductId = pp.Product.Number |
| | | info.ProductName = pp.Product.Name |
| | | info.Specs = pp.Product.Specifications |
| | | info.Unit = pp.Product.Unit |
| | | break |
| | | ni := info |
| | | ni.ProductId = pp.Product.Number |
| | | ni.ProductName = pp.Product.Name |
| | | ni.Specs = pp.Product.Specifications |
| | | ni.Unit = pp.Product.Unit |
| | | infos = append(infos, &ni) |
| | | } |
| | | } |
| | | infos = append(infos, &info) |
| | | } |
| | | resp := new(GetPurchaseInfoResponse) |
| | | resp.Infos = infos |