-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInvoice.java
More file actions
37 lines (30 loc) · 813 Bytes
/
Invoice.java
File metadata and controls
37 lines (30 loc) · 813 Bytes
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
package com.company;
import java.util.*;
import java.time.LocalDate;
public class Invoice {
public cart products = new cart();
public int total;
public int id;
LocalDate date = LocalDate.now();
public boolean paid = false;
public int getId () {
return id;
}
public Invoice (cart userCart, int total)
{
products = userCart;
this.total = total;
this.id = (InvoiceIdServer.instance()).getId();
}
public void printInvoice()
{
System.out.println("Date: " + date);
System.out.println("Products: " + products);
System.out.println("total: " + total);
}
public void payInvoice()
{
System.out.println("Invoice has been paid.");
paid = true;
}
}