Subversion Repositories SmartDukaan

Rev

Rev 29707 | Rev 29755 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29707 Rev 29752
Line 48... Line 48...
48
import com.spice.profitmandi.common.model.CustomPaymentOption;
48
import com.spice.profitmandi.common.model.CustomPaymentOption;
49
import com.spice.profitmandi.common.model.CustomRetailer;
49
import com.spice.profitmandi.common.model.CustomRetailer;
50
import com.spice.profitmandi.common.model.FoiBadReturnRequest;
50
import com.spice.profitmandi.common.model.FoiBadReturnRequest;
51
import com.spice.profitmandi.common.model.GstRate;
51
import com.spice.profitmandi.common.model.GstRate;
52
import com.spice.profitmandi.common.model.InsuranceModel;
52
import com.spice.profitmandi.common.model.InsuranceModel;
-
 
53
import com.spice.profitmandi.common.model.ItemDescriptionModel;
53
import com.spice.profitmandi.common.model.ItemIdQuantityAvailability;
54
import com.spice.profitmandi.common.model.ItemIdQuantityAvailability;
54
import com.spice.profitmandi.common.model.PdfModel;
55
import com.spice.profitmandi.common.model.PdfModel;
55
import com.spice.profitmandi.common.model.PriceModel;
56
import com.spice.profitmandi.common.model.PriceModel;
56
import com.spice.profitmandi.common.model.ProfitMandiConstants;
57
import com.spice.profitmandi.common.model.ProfitMandiConstants;
57
import com.spice.profitmandi.common.model.Quantity;
58
import com.spice.profitmandi.common.model.Quantity;
Line 1319... Line 1320...
1319
		for (Map.Entry<Integer, CustomFofoOrderItem> entry : itemIdCustomFofoLineItemMap.entrySet()) {
1320
		for (Map.Entry<Integer, CustomFofoOrderItem> entry : itemIdCustomFofoLineItemMap.entrySet()) {
1320
			int itemId = entry.getKey();
1321
			int itemId = entry.getKey();
1321
			CustomFofoOrderItem customFofoOrderItem = entry.getValue();
1322
			CustomFofoOrderItem customFofoOrderItem = entry.getValue();
1322
			LOGGER.info("CustomFofoOrderItem -- {}", customFofoOrderItem);
1323
			LOGGER.info("CustomFofoOrderItem -- {}", customFofoOrderItem);
1323
			PriceModel priceModel = itemIdMopPriceMap.get(itemId);
1324
			PriceModel priceModel = itemIdMopPriceMap.get(itemId);
1324
			if (customFofoOrderItem.getSerialNumberDetails().stream()
1325
			Item item = itemRepository.selectById(itemId);
-
 
1326
			if (!(item.getBrand().equals("Live Demo") || item.getCategoryId()!=ProfitMandiConstants.MOBILE_CATEGORY_ID || item.getCategoryId()!=ProfitMandiConstants.TABLET_CATEGORY_ID)&& customFofoOrderItem.getSerialNumberDetails().stream()
1325
					.filter(x -> org.apache.commons.lang.StringUtils.isNotEmpty(x.getSerialNumber()))
1327
					.filter(x -> org.apache.commons.lang.StringUtils.isNotEmpty(x.getSerialNumber()))
1326
					.collect(Collectors.toList()).size() > 0) {
1328
					.collect(Collectors.toList()).size() > 0) {
1327
				if (Utils.compareFloat(priceModel.getPrice(),
1329
				if (Utils.compareFloat(priceModel.getPrice(),
1328
						customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount()) > 0) {
1330
						customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount()) > 0) {
1329
					throw new ProfitMandiBusinessException("Selling Price for ",
1331
					throw new ProfitMandiBusinessException("Selling Price for ",
1330
							itemRepository.selectById(itemId).getItemDescription(), "FFORDR_1010");
1332
							item.getItemDescription(), "FFORDR_1010");
1331
				}
1333
				}
1332
			} else {
1334
			} else {
1333
				if (priceModel.getPurchasePrice() > customFofoOrderItem.getSellingPrice()) {
1335
				if (priceModel.getPurchasePrice() > customFofoOrderItem.getSellingPrice()) {
1334
					throw new ProfitMandiBusinessException("Selling Price",
1336
					throw new ProfitMandiBusinessException("Selling Price",
1335
							itemRepository.selectById(itemId).getItemDescription(),
1337
							itemRepository.selectById(itemId).getItemDescription(),