| | |
| | | |
| | | func (s *Server) CreateOperationList(ctx context.Context, req *CreateOperationListRequest) (*CreateOperationListResponse, error) { |
| | | var operations []*models.Operation |
| | | warehouse, err := models.NewWarehouseSearch().First() |
| | | id := 0 |
| | | if req.WarehouseId != "" { |
| | | id, _ = strconv.Atoi(req.WarehouseId) |
| | | } |
| | | warehouse, err := models.NewWarehouseSearch().SetID(id).First() |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | |
| | | var details []*models.OperationDetails |
| | | var or OperationResponse |
| | | operation.SourceNumber = list.SourceNumber |
| | | operation.SalesDetailsNumber = list.SalesDetailsNumber |
| | | operation.OperationDate = timex.TimeToString2(time.Now()) |
| | | operation.Number = strconv.FormatInt(time.Now().Unix(), 10) |
| | | operation.Status = constvar.OperationStatus_Ready |