@Override
	public BigDecimal calculateTotal() {
		PointOfSaleTerminal.quantityOfProducts();
		Double res = new Double(0);

		Set<Map.Entry<String, Integer>> set = mapOfQuantityProducts.entrySet();

		for (Map.Entry<String, Integer> entry : set) {
			String codeOfProduct = entry.getKey();
			Integer quantityOfProduct = entry.getValue();

			if (mapOfProductsList.containsKey(codeOfProduct)) {
				Product product = mapOfProductsList.get(codeOfProduct);
				Double price = product.getPrice();
				Integer nwp = product.getNumberOfWholesaleProducts();
				Double wholesalePrice = product.getWholesalePrise();
				if (nwp >= 1) {
					res += (quantityOfProduct / nwp) * wholesalePrice + (quantityOfProduct % nwp) * price;
				} else {
					res += quantityOfProduct * price;
				}
			}
		}
		return (BigDecimal.valueOf(res).setScale(2, BigDecimal.ROUND_UP));
	}