Subversion Repositories SmartDukaan

Rev

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

Rev 32021 Rev 32165
Line 8... Line 8...
8
import java.util.List;
8
import java.util.List;
9
import java.util.Objects;
9
import java.util.Objects;
10
 
10
 
11
public class InventoryPayoutModel {
11
public class InventoryPayoutModel {
12
    int inventoryItemId;
12
    int inventoryItemId;
-
 
13
    List<SchemeInOut> paidSios;
13
    List<SchemeInOut> schemePayouts;
14
    List<SchemeInOut> pendingSios;
14
    List<OfferPayout> offerPayouts;
15
    List<OfferPayout> offerPayouts;
15
 
16
 
16
    private double fixedAmount;
17
    private double fixedAmount;
17
    private double percentageAmount;
18
    private double percentageAmount;
18
    private double paidAmount;
19
    private double paidAmount;
19
    private double dp;
20
    private double dp;
20
 
21
 
-
 
22
    public List<SchemeInOut> getPendingSios() {
-
 
23
        return pendingSios;
-
 
24
    }
-
 
25
 
-
 
26
    @Override
-
 
27
    public boolean equals(Object o) {
-
 
28
        if (this == o) return true;
-
 
29
        if (o == null || getClass() != o.getClass()) return false;
-
 
30
        InventoryPayoutModel that = (InventoryPayoutModel) o;
-
 
31
        return inventoryItemId == that.inventoryItemId && Double.compare(that.fixedAmount, fixedAmount) == 0 && Double.compare(that.percentageAmount, percentageAmount) == 0 && Double.compare(that.paidAmount, paidAmount) == 0 && Double.compare(that.dp, dp) == 0 && Objects.equals(paidSios, that.paidSios) && Objects.equals(pendingSios, that.pendingSios) && Objects.equals(offerPayouts, that.offerPayouts);
-
 
32
    }
-
 
33
 
-
 
34
    @Override
-
 
35
    public int hashCode() {
-
 
36
        return Objects.hash(inventoryItemId, paidSios, pendingSios, offerPayouts, fixedAmount, percentageAmount, paidAmount, dp);
-
 
37
    }
-
 
38
 
-
 
39
    public void setPendingSios(List<SchemeInOut> pendingSios) {
-
 
40
        this.pendingSios = pendingSios;
-
 
41
    }
-
 
42
 
21
    public double getActualRolloutAmount() {
43
    public double getActualRolloutAmount() {
22
        double effectiveDp = this.getDp() - this.getFixedAmount();
44
        double effectiveDp = this.getDp() - this.getFixedAmount();
23
        double value = effectiveDp * percentageAmount / (100 + percentageAmount);
45
        double value = effectiveDp * percentageAmount / (100 + percentageAmount);
24
        return this.getFixedAmount() + value;
46
        return this.getFixedAmount() + value;
25
    }
47
    }
Line 39... Line 61...
39
            }
61
            }
40
        }
62
        }
41
        return rollout;
63
        return rollout;
42
    }
64
    }
43
 
65
 
44
    public InventoryPayoutModel(int inventoryItemId, List<SchemeInOut> schemePayouts, List<OfferPayout> offerPayouts) {
66
    public InventoryPayoutModel(int inventoryItemId, List<SchemeInOut> paidSios, List<SchemeInOut> pendingSios, List<OfferPayout> offerPayouts) {
45
        this.inventoryItemId = inventoryItemId;
67
        this.inventoryItemId = inventoryItemId;
-
 
68
        this.paidSios = paidSios;
46
        this.schemePayouts = schemePayouts;
69
        this.pendingSios = pendingSios;
47
        this.offerPayouts = offerPayouts;
70
        this.offerPayouts = offerPayouts;
48
    }
71
    }
49
 
72
 
50
    @Override
73
    @Override
51
    public String toString() {
74
    public String toString() {
52
        return "InventoryPayoutModel{" +
75
        return "InventoryPayoutModel{" +
53
                "inventoryItemId=" + inventoryItemId +
76
                "inventoryItemId=" + inventoryItemId +
54
                ", schemePayouts=" + schemePayouts +
77
                ", paidSios=" + paidSios +
55
                ", offerPayouts=" + offerPayouts +
78
                ", offerPayouts=" + offerPayouts +
56
                ", fixedAmount=" + fixedAmount +
79
                ", fixedAmount=" + fixedAmount +
57
                ", percentageAmount=" + percentageAmount +
80
                ", percentageAmount=" + percentageAmount +
58
                ", paidAmount=" + paidAmount +
81
                ", paidAmount=" + paidAmount +
59
                '}';
82
                '}';
Line 89... Line 112...
89
 
112
 
90
    public void setInventoryItemId(int inventoryItemId) {
113
    public void setInventoryItemId(int inventoryItemId) {
91
        this.inventoryItemId = inventoryItemId;
114
        this.inventoryItemId = inventoryItemId;
92
    }
115
    }
93
 
116
 
94
    public List<SchemeInOut> getSchemePayouts() {
117
    public List<SchemeInOut> getPaidSios() {
95
        return schemePayouts;
118
        return paidSios;
96
    }
119
    }
97
 
120
 
98
    public void setSchemePayouts(List<SchemeInOut> schemePayouts) {
121
    public void setPaidSios(List<SchemeInOut> paidSios) {
99
        this.schemePayouts = schemePayouts;
122
        this.paidSios = paidSios;
100
    }
123
    }
101
 
124
 
102
    public List<OfferPayout> getOfferPayouts() {
125
    public List<OfferPayout> getOfferPayouts() {
103
        return offerPayouts;
126
        return offerPayouts;
104
    }
127
    }
Line 109... Line 132...
109
 
132
 
110
    public void setDp(double dp) {
133
    public void setDp(double dp) {
111
        this.dp = dp;
134
        this.dp = dp;
112
    }
135
    }
113
 
136
 
114
    @Override
-
 
115
    public boolean equals(Object o) {
-
 
116
        if (this == o) return true;
-
 
117
        if (o == null || getClass() != o.getClass()) return false;
-
 
118
        InventoryPayoutModel that = (InventoryPayoutModel) o;
-
 
119
        return inventoryItemId == that.inventoryItemId && Double.compare(that.fixedAmount, fixedAmount) == 0 && Double.compare(that.percentageAmount, percentageAmount) == 0 && Double.compare(that.paidAmount, paidAmount) == 0 && Double.compare(that.dp, dp) == 0 && Objects.equals(schemePayouts, that.schemePayouts) && Objects.equals(offerPayouts, that.offerPayouts);
-
 
120
    }
-
 
121
 
-
 
122
    @Override
-
 
123
    public int hashCode() {
-
 
124
        return Objects.hash(inventoryItemId, schemePayouts, offerPayouts, fixedAmount, percentageAmount, paidAmount, dp);
-
 
125
    }
-
 
126
 
-
 
127
    public void setOfferPayouts(List<OfferPayout> offerPayouts) {
137
    public void setOfferPayouts(List<OfferPayout> offerPayouts) {
128
        this.offerPayouts = offerPayouts;
138
        this.offerPayouts = offerPayouts;
129
    }
139
    }
130
}
140
}