Subversion Repositories SmartDukaan

Rev

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

Rev 20938 Rev 20960
Line 1... Line 1...
1
package com.aramex.impl;
1
package com.aramex.impl;
2
 
2
 
3
import in.shop2020.model.v1.order.Order;
3
import in.shop2020.model.v1.order.Order;
4
 
4
 
-
 
5
import java.util.ArrayList;
5
import java.util.Calendar;
6
import java.util.Calendar;
6
import java.util.List;
7
import java.util.List;
7
 
8
 
8
import com.aramex.stub.Address;
9
import com.aramex.stub.Address;
9
import com.aramex.stub.ArrayOfShipment;
10
import com.aramex.stub.ArrayOfShipment;
Line 48... Line 49...
48
		details.setPaymentType("P");
49
		details.setPaymentType("P");
49
		details.setChargeableWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
50
		details.setChargeableWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
50
		details.setActualWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
51
		details.setActualWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
51
		details.setDescriptionOfGoods("Electronics");
52
		details.setDescriptionOfGoods("Electronics");
52
		details.setGoodsOriginCountry("IN");
53
		details.setGoodsOriginCountry("IN");
53
		if(shipmentInfo.getNetPayable()==0){
54
		if(shipmentInfo.isCashOnDelivery()){
54
			details.setServices("CODS");
55
			details.setServices("CODS");
55
			details.setCashOnDeliveryAmount(new Money("INR", shipmentInfo.getNetPayable()));
56
			details.setCashOnDeliveryAmount(new Money("INR", shipmentInfo.getNetPayable()));
56
		}
57
		}
57
		details.setCustomsValueAmount(new Money("INR", shipmentInfo.getTotalAmount()));
58
		details.setCustomsValueAmount(new Money("INR", shipmentInfo.getTotalAmount()));
58
		details.setNumberOfPieces(shipmentInfo.getTotalPcs());
59
		details.setNumberOfPieces(shipmentInfo.getTotalPcs());
Line 168... Line 169...
168
		shipperAddress.setPostCode("122016");
169
		shipperAddress.setPostCode("122016");
169
		shipper.setPartyAddress(shipperAddress);
170
		shipper.setPartyAddress(shipperAddress);
170
		return shipper;
171
		return shipper;
171
	}
172
	}
172
	
173
	
-
 
174
	public static void main(String[] args) {
-
 
175
		List<Order> orders = new ArrayList<Order>();
-
 
176
		Order o = new Order();
-
 
177
		o.setTotal_amount(1000.00);
-
 
178
		o.setTotal_weight(.900);
-
 
179
		o.setNet_payable_amount(0.01);
-
 
180
		o.setShippingCost(20.0);
-
 
181
		o.setCod(true);
-
 
182
		orders.add(o);
-
 
183
		ShipmentInfo s = new ShipmentInfo(orders);
-
 
184
		System.out.println(s.isCashOnDelivery());
-
 
185
		
-
 
186
		
-
 
187
	}
-
 
188
	
173
}
189
}