Subversion Repositories SmartDukaan

Rev

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

Rev 20938 Rev 20951
Line 11... Line 11...
11
	private double shippingCharges=0;
11
	private double shippingCharges=0;
12
 
12
 
13
	private double totalShippingAmount=0;
13
	private double totalShippingAmount=0;
14
	private  int totalPcs = 0;
14
	private  int totalPcs = 0;
15
	private Order order;
15
	private Order order;
16
	
-
 
-
 
16
	private boolean cashOnDelivery=false;
17
	
17
 
18
	public ShipmentInfo(List<Order> orders) {
18
	public ShipmentInfo(List<Order> orders) {
19
		for(Order o : orders) {
19
		for(Order o : orders) {
20
			this.totalAmount += o.getTotal_amount();
20
			this.totalAmount += o.getTotal_amount();
21
			this.totalWeightInKg += o.getTotal_weight();
21
			this.totalWeightInKg += o.getTotal_weight();
22
			this.netPayable += o.getNet_payable_amount();
22
			this.netPayable += o.getNet_payable_amount();
23
			this.shippingCharges += o.getShippingCost();
23
			this.shippingCharges += o.getShippingCost();
24
			this.totalPcs += o.getLineitems().get(0).getQuantity();
24
			this.totalPcs += o.getLineitems().get(0).getQuantity();
25
		}
25
		}
26
		this.order = orders.get(0);
26
		this.order = orders.get(0);
-
 
27
		determineCod();
-
 
28
 
-
 
29
	}
-
 
30
 
-
 
31
	private void determineCod(){
-
 
32
		if (order.isCod() && netPayable > 0){
-
 
33
			cashOnDelivery = true;
-
 
34
		}
27
	}
35
	}
28
 
36
 
29
	public double getTotalWeightInKg() {
37
	public double getTotalWeightInKg() {
30
		return totalWeightInKg;
38
		return totalWeightInKg;
31
	}
39
	}
32
	
40
 
33
	public double getTotalAmount() {
41
	public double getTotalAmount() {
34
		return totalAmount;
42
		return totalAmount;
35
	}
43
	}
36
	
44
 
37
	public double getTotalShippingAmount() {
45
	public double getTotalShippingAmount() {
38
		return totalShippingAmount;
46
		return totalShippingAmount;
39
	}
47
	}
40
	
48
 
41
	public int getTotalPcs() {
49
	public int getTotalPcs() {
42
		return totalPcs;
50
		return totalPcs;
43
	}
51
	}
44
 
52
 
45
	public Order getOrder() {
53
	public Order getOrder() {
46
		return order;
54
		return order;
47
	}
55
	}
48
	
56
 
49
	public double getNetPayable() {
57
	public double getNetPayable() {
50
		return netPayable;
58
		return netPayable;
51
	}
59
	}
52
 
60
 
53
	public void setNetPayable(double netPayable) {
61
	public void setNetPayable(double netPayable) {
54
		this.netPayable = netPayable;
62
		this.netPayable = netPayable;
55
	}
63
	}
-
 
64
 
-
 
65
	public boolean isCashOnDelivery() {
-
 
66
		return cashOnDelivery;
-
 
67
	}
-
 
68
 
56
}
69
}