Subversion Repositories SmartDukaan

Rev

Rev 20643 | Rev 20951 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20642 amit.gupta 1
package com.providers.logistics;
2
 
3
import in.shop2020.model.v1.order.Order;
4
 
5
import java.util.List;
6
 
7
public class ShipmentInfo {
8
	private double totalWeightInKg=0;
9
	private double totalAmount=0;
20938 amit.gupta 10
	private double netPayable=0;
11
	private double shippingCharges=0;
20642 amit.gupta 12
 
13
	private double totalShippingAmount=0;
14
	private  int totalPcs = 0;
15
	private Order order;
16
 
17
 
18
	public ShipmentInfo(List<Order> orders) {
19
		for(Order o : orders) {
20
			this.totalAmount += o.getTotal_amount();
21
			this.totalWeightInKg += o.getTotal_weight();
20938 amit.gupta 22
			this.netPayable += o.getNet_payable_amount();
23
			this.shippingCharges += o.getShippingCost();
20642 amit.gupta 24
			this.totalPcs += o.getLineitems().get(0).getQuantity();
25
		}
26
		this.order = orders.get(0);
27
	}
28
 
29
	public double getTotalWeightInKg() {
30
		return totalWeightInKg;
31
	}
32
 
33
	public double getTotalAmount() {
34
		return totalAmount;
35
	}
36
 
37
	public double getTotalShippingAmount() {
38
		return totalShippingAmount;
39
	}
40
 
41
	public int getTotalPcs() {
42
		return totalPcs;
43
	}
44
 
45
	public Order getOrder() {
46
		return order;
47
	}
20938 amit.gupta 48
 
49
	public double getNetPayable() {
50
		return netPayable;
51
	}
52
 
53
	public void setNetPayable(double netPayable) {
54
		this.netPayable = netPayable;
55
	}
20642 amit.gupta 56
}