-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransaction.java
More file actions
86 lines (71 loc) · 2.16 KB
/
Copy pathTransaction.java
File metadata and controls
86 lines (71 loc) · 2.16 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
77
78
79
80
81
82
83
84
85
86
import java.util.Calendar;
import java.util.Date;
import java.util.ArrayList;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author CHUCK
*/
public class Transaction {
private ArrayList<Document> products;
private long cardNumber;
private double totalPrice;
private String customerName;
private Date date;
private String billingInfo;
public Transaction(ArrayList<Document> products, long cardNumber, double totalPrice, String customerName, String billingInfo) {
this.products = products;
this.cardNumber = cardNumber;
this.totalPrice = totalPrice;
this.customerName = customerName;
Calendar cal = Calendar.getInstance();
this.date = cal.getTime();
this.billingInfo = billingInfo;
}
public long getCardNumber() {
return cardNumber;
}
public void setCardNumber(long cardNumber) {
this.cardNumber = cardNumber;
}
public double getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(double totalPrice) {
this.totalPrice = totalPrice;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getBillingInfo() {
return billingInfo;
}
public void setBillingInfo(String billingInfo) {
this.billingInfo = billingInfo;
}
public void display(){
System.out.println("\nProducts: \n");
for(Document d : products){
d.display();
System.out.print("\n");
}
System.out.println("Total price: " + totalPrice);
System.out.println("Customer name: " + customerName);
System.out.println("Date of transaction: " + date.toString());
System.out.println("Biling info of customer: " + billingInfo);
System.out.println();
}
}