Repository navigation
Expand file tree
/
Copy pathBuyInvoice.java
More file actions
76 lines (68 loc) · 2.01 KB
/
Copy pathBuyInvoice.java
File metadata and controls
76 lines (68 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package Invoive;
import Products.* ;
import java.util.ArrayList;
public class BuyInvoice
{
private int invoiveId;
private String buyDate;
private double paidMoney;
private ArrayList<Product> purchasedProducts;
private String sellerName;
private boolean isDelivered;
//----------------------------------------------
BuyInvoice(int invoiveId, String buyDate, double paidMoney, String sellerName, boolean isDelivered)
{
setInvoiveId(invoiveId);
setBuyDate(buyDate);
setPaidMoney(paidMoney);
setSellerName(sellerName);
setIsDelivered(isDelivered);
purchasedProducts = new ArrayList<>();
}
//----------------------------------------------
public int getInvoiveId() {
return invoiveId;
}
public void setInvoiveId(int invoiveId) {
this.invoiveId = invoiveId;
}
public String getBuyDate() {
return buyDate;
}
public void setBuyDate(String buyDate) {
this.buyDate = buyDate;
}
public double getPaidMoney() {
return paidMoney;
}
public void setPaidMoney(double paidMoney) {
this.paidMoney = paidMoney;
}
public ArrayList<Product> getPurchasedProducts() {
return purchasedProducts;
}
public void setPurchasedProducts(Product product) {
this.purchasedProducts.add(product) ;
}
public String getSellerName() {
return sellerName;
}
public void setSellerName(String sellerName) {
this.sellerName = sellerName;
}
public boolean isDelivered() {
return isDelivered;
}
public void setIsDelivered(boolean delivered) {
isDelivered = delivered;
}
//-----------------------------------------------
@Override
public String toString()
{
return "invoive id:"+invoiveId+
"/buy date:"+buyDate+
"/paid money:"+paidMoney+
"/seller:"+sellerName;
}
}