Subversion Repositories SmartDukaan

Rev

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

Rev 7853 Rev 7862
Line 57... Line 57...
57
    private boolean showEmiOption = false;
57
    private boolean showEmiOption = false;
58
    private String errorMsg = "";
58
    private String errorMsg = "";
59
    private String deliveryLocation = ""; //This could be set as myLocation or HotSpot
59
    private String deliveryLocation = ""; //This could be set as myLocation or HotSpot
60
    private boolean showStorePickUpOption = false;
60
    private boolean showStorePickUpOption = false;
61
    private long hotSpotAddressId = 1;
61
    private long hotSpotAddressId = 1;
-
 
62
    private boolean amountZero = false;
62
    
63
    
63
    
64
    
64
    public String index(){
65
    public String index(){
65
        return processPaymentOptions();
66
        return processPaymentOptions();
66
    }
67
    }
Line 115... Line 116...
115
            
116
            
116
            Cart cart = userClient.getCart(cartId);
117
            Cart cart = userClient.getCart(cartId);
117
            String couponCode = cart.getCouponCode();
118
            String couponCode = cart.getCouponCode();
118
            logger.info("Coupon: " + couponCode);
119
            logger.info("Coupon: " + couponCode);
119
            
120
            
-
 
121
            setTotalAmount(cart);
-
 
122
            itemIdString = Utils.getItemIdStringInCart(cart);
-
 
123
            
120
            PromotionService.Client pc = new PromotionClient().getClient();
124
            PromotionService.Client pc = new PromotionClient().getClient();
-
 
125
            /*
-
 
126
             * If a gift voucher is used such that all of the amount is paid by the gift voucher then we
-
 
127
             * do not need set the hasGiftVoucher flag.
-
 
128
             */
121
            if(StringUtils.isNotEmpty(couponCode) && pc.isGiftVoucher(couponCode)){
129
            if(StringUtils.isNotEmpty(couponCode) && pc.isGiftVoucher(couponCode) && getTotalAmountL() > 0){
122
            	hasGiftVoucher = true;
130
            	hasGiftVoucher = true;
123
            }
131
            }
124
            
132
            
125
            if (!hasGiftVoucher && deliveryLocation.equals("HotSpot")) {
133
            if (!hasGiftVoucher && deliveryLocation.equals("HotSpot")) {
126
            	userClient.addStoreToCart(cartId, hotSpotAddressId);
134
            	userClient.addStoreToCart(cartId, hotSpotAddressId);
127
            	showStorePickUpOption = true;
135
            	showStorePickUpOption = true;
128
            }
136
            }
129
            setTotalAmount(cart);
-
 
130
            itemIdString = Utils.getItemIdStringInCart(cart);
-
 
131
            
-
 
132
            
137
            
133
            // Get the address to check if COD option is available for this
138
            // Get the address to check if COD option is available for this
134
            // address.
139
            // address.
135
            if(addressId == -1){
140
            if(addressId == -1){
136
                addressId = cart.getAddressId();
141
                addressId = cart.getAddressId();
Line 182... Line 187...
182
        else
187
        else
183
            totalAmountD = cart.getDiscountedPrice();
188
            totalAmountD = cart.getDiscountedPrice();
184
        
189
        
185
        FormattingUtils formattingUtils = new FormattingUtils();
190
        FormattingUtils formattingUtils = new FormattingUtils();
186
        totalAmount = formattingUtils.formatPrice(totalAmountD);
191
        totalAmount = formattingUtils.formatPrice(totalAmountD);
-
 
192
        if(totalAmountD == 0) {
-
 
193
            amountZero = true;
-
 
194
        }
187
    }
195
    }
188
 
196
 
189
    public long getAddressId(){
197
    public long getAddressId(){
190
        return this.addressId;
198
        return this.addressId;
191
    }
199
    }
Line 295... Line 303...
295
    			return scheme.getChargeValue();
303
    			return scheme.getChargeValue();
296
    		}
304
    		}
297
    	}
305
    	}
298
    	return 0;
306
    	return 0;
299
    }
307
    }
-
 
308
 
-
 
309
    public void setAmountZero(boolean amountZero) {
-
 
310
        this.amountZero = amountZero;
-
 
311
    }
-
 
312
 
-
 
313
    public boolean isAmountZero() {
-
 
314
        return amountZero;
-
 
315
    }
300
    
316
    
301
    public static String getEmiSchemesInJSON(){
317
    public static String getEmiSchemesInJSON(){
302
    	if(emiSchemesInJSON==null){
318
    	if(emiSchemesInJSON==null){
303
    		List<Map<String, Object>> schemeList = new ArrayList<Map<String,Object>>();
319
    		List<Map<String, Object>> schemeList = new ArrayList<Map<String,Object>>();
304
    		for(EmiScheme scheme: getEmiSchemes()){
320
    		for(EmiScheme scheme: getEmiSchemes()){