func (VS *Server) itemStockToHTML(c *gin.Context, item Item, serviceID bson.ObjectId) ItemHTML {
	var iHTML ItemHTML
	iHTML.ID = item.ID
	iHTML.Name = item.Name
	prod, isProd := VS.getVideoCourseByID(c, item.ID, "h_view", "itemStockToHTML", "prod, isProd := VS.getVideoCourseByID", false)
	if isProd {
		iHTML.Photo = "/local/video-courses/" + prod.Name + "/purchases/" + "/" + prod.Photo
	} else {
		cat := VS.getCategoryByID(c, item.IDCategory, "h_view", "itemStockToHTML", "cat := VS.getCategoryByID")
		iHTML.CategoryName = cat.Name
		tpe := VS.getCategoryTypeByID(c, cat.Type, "h_view", "itemStockToHTML", "tpe := VS.getCategoryTypeByID")
		iHTML.Photo = "/local/categories/" + tpe.Name + "/" + cat.Name + "/" + item.Photo
	}
	// VS.getAllPositiveStockByServiceID
	stockFromServiceHTML := VS.stocksToHTML(c, VS.getAllPositiveStockByServiceIDandItemOrVideoID(c, serviceID, item.ID, "h_view", "itemStockToHTML", "stockFromServiceHTML := VS.stocksToHTML("))
	if len(stockFromServiceHTML) != 0 {
		iHTML.Stock = append(iHTML.Stock, stockFromServiceHTML...)
	}
	return iHTML
}
// This method take an Item and returns an ItemHTML, taking care if is a Video product or not. It is used for the real stock in the Service
This method take an Item and returns an ItemHTML, taking care if is a Video product or not. It is used for the real stock in the Service
// This method take an Item and returns an ItemHTML taking care if is a Video product or not . It is used for the real stock in the Service
func (VS *Server) itemStockToHTML(c *gin.Context, item Item, serviceID bson.ObjectId) ItemHTML {
	var iHTML ItemHTML
	iHTML.ID = item.ID
	iHTML.Name = item.Name
	prod, isProd := VS.getVideoCourseByID(c, item.ID, "h_view", "itemStockToHTML", "prod, isProd := VS.getVideoCourseByID", false)
	if isProd {
		iHTML.Photo = "/local/video-courses/" + prod.Name + "/purchases/" + "/" + prod.Photo
	} else {
		cat := VS.getCategoryByID(c, item.IDCategory, "h_view", "itemStockToHTML", "cat := VS.getCategoryByID")
		iHTML.CategoryName = cat.Name
		tpe := VS.getCategoryTypeByID(c, cat.Type, "h_view", "itemStockToHTML", "tpe := VS.getCategoryTypeByID")
		iHTML.Photo = "/local/categories/" + tpe.Name + "/" + cat.Name + "/" + item.Photo
	}
	stockFromServiceHTML := VS.stocksToHTML(c, VS.getAllPositiveStockByServiceIDandItemOrVideoID(c, serviceID, item.ID, "h_view", "itemStockToHTML", "stockFromServiceHTML := VS.stocksToHTML("))
	if len(stockFromServiceHTML) != 0 {
		iHTML.Stock = append(iHTML.Stock, stockFromServiceHTML...)
	}
	return iHTML
}
func ( VS * Server ) itemStockToHTML ( c * gin . Context , item Item , serviceID bson . ObjectId ) ItemHTML { var iHTML ItemHTML iHTML . ID = item . ID iHTML . Name = item . Name prod , isProd := VS . getVideoCourseByID ( c , item . ID , " " , " " , " " , false ) if isProd { iHTML . Photo = " " + prod . Name + " " + " " + prod . Photo } else { cat := VS . getCategoryByID ( c , item . IDCategory , " " , " " , " " ) iHTML . CategoryName = cat . Name tpe := VS . getCategoryTypeByID ( c , cat . Type , " " , " " , " " ) iHTML . Photo = " " + tpe . Name + " " + cat . Name + " " + item . Photo } stockFromServiceHTML := VS . stocksToHTML ( c , VS . getAllPositiveStockByServiceIDandItemOrVideoID ( c , serviceID , item . ID , " " , " " , " " ) ) if len ( stockFromServiceHTML ) != 0 { iHTML . Stock = append ( iHTML . Stock , stockFromServiceHTML ... ) } return iHTML }
This method take an Item and returns an ItemHTML, taking care if is a Video product or not.
This method take an Item and returns an ItemHTML taking care if is a Video product or not .
// VS.getAllPositiveStockByServiceID