-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvoice.js
49 lines (36 loc) · 1.09 KB
/
invoice.js
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
var item1, item2, inv1;
function invoices() {
console.log('hello');
}
function ItemObj(id, price, quantity, note) {
this.id = id;
this.price = price;
this.quantity = quantity;
this.note = note;
}
item1 = new ItemObj('ochestra224', 125, 2, "Center Mezzanine");
item2 = new ItemObj('balcony32', 50, 1, "Left Mezzanine");
function InvoiceObj(id, customerId, raised, due, paid, note, item1, item2) {
this.id = id;
this.customerId = customerId;
this.raised = raised;
this.due = due;
this.paid = paid;
this.note = note;
// assume only two items per invoice
this.items = [item1, item2];
}
inv1 = new InvoiceObj(1, 111, "10/15/2014", "10/22/2014", true, "Jazz concert", item1, item2);
inv2 = new InvoiceObj(2, 222, "11/16/2015", "11/23/2015", false, "Jazz concert", item1, item2);
function MarshallInvoices(invoices) {
var myLog = function(arg) {
console.log(arg);
};
function write() {
for (var i = 0; i < invoices.length; i++) {
myLog(invoices[i]);
}
}
write();
}
MarshallInvoices([inv1, inv2]);