Skip to content

Commit 46d8324

Browse files
restructure
1 parent 16c8ccf commit 46d8324

File tree

2 files changed

+39
-22
lines changed

2 files changed

+39
-22
lines changed

app/controllers/admin/sales/index.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import EmberTableControllerMixin from 'open-event-frontend/mixins/ember-table-co
66
export default class IndexController extends Controller.extend(AdminSalesMixin, EmberTableControllerMixin) {
77

88
@or('authManager.currentUser.isSuperAdmin', 'authManager.currentUser.isAdmin') hasRestorePrivileges;
9-
sort_by = 'total-sales';
9+
// sort_by = 'total-sales';
1010
sort_dir = 'DSC';
1111
per_page = 10;
1212
get columns() {
@@ -45,14 +45,18 @@ get columns() {
4545
color : 'green',
4646
subcolumns : [
4747
{
48-
name : this.l10n.t('Tickets'),
49-
valuePath : 'sales.completed.ticket_count',
50-
width : 30
48+
name : this.l10n.t('Tickets'),
49+
valuePath : 'completedOrderTickets',
50+
headerComponent : 'tables/headers/sort',
51+
isSortable : true,
52+
width : 30
5153
},
5254
{
5355
name : this.l10n.t('Sales'),
54-
valuePath : 'sales.completed.sales_total',
56+
valuePath : 'completedOrderSales',
5557
extraValuePaths : ['paymentCurrency'],
58+
headerComponent : 'tables/headers/sort',
59+
isSortable : true,
5660
cellComponent : 'ui-table/cell/admin/sales/cell-amount'
5761
}
5862
]
@@ -63,13 +67,17 @@ get columns() {
6367
headerComponent : 'tables/headers/sort',
6468
subcolumns : [
6569
{
66-
name : this.l10n.t('Tickets'),
67-
valuePath : 'sales.placed.ticket_count',
68-
width : 30
70+
name : this.l10n.t('Tickets'),
71+
valuePath : 'placedOrderTickets',
72+
headerComponent : 'tables/headers/sort',
73+
isSortable : true,
74+
width : 30
6975
},
7076
{
7177
name : this.l10n.t('Sales'),
72-
valuePath : 'sales.placed.sales_total',
78+
valuePath : 'placedOrderSales',
79+
headerComponent : 'tables/headers/sort',
80+
isSortable : true,
7381
extraValuePaths : ['paymentCurrency'],
7482
cellComponent : 'ui-table/cell/admin/sales/cell-amount'
7583
}
@@ -81,13 +89,17 @@ get columns() {
8189
headerComponent : 'tables/headers/sort',
8290
subcolumns : [
8391
{
84-
name : this.l10n.t('Tickets'),
85-
valuePath : 'sales.pending.ticket_count',
86-
width : 30
92+
name : this.l10n.t('Tickets'),
93+
valuePath : 'pendingOrderTickets',
94+
headerComponent : 'tables/headers/sort',
95+
isSortable : true,
96+
width : 30
8797
},
8898
{
8999
name : this.l10n.t('Sales'),
90-
valuePath : 'sales.pending.sales_total',
100+
valuePath : 'pendingOrderSales',
101+
headerComponent : 'tables/headers/sort',
102+
isSortable : true,
91103
extraValuePaths : ['paymentCurrency'],
92104
cellComponent : 'ui-table/cell/admin/sales/cell-amount'
93105
}

app/models/admin-sales-by-event.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import attr from 'ember-data/attr';
22
import ModelBase from 'open-event-frontend/models/base';
33

44
export default ModelBase.extend({
5-
name : attr('string'),
6-
owner : attr(),
7-
type : attr(),
8-
endsAt : attr('moment'),
9-
startsAt : attr('moment'),
10-
paymentCurrency : attr('string'),
11-
totalSales : attr('number'),
12-
sales : attr(),
13-
ownerId : attr()
5+
name : attr('string'),
6+
owner : attr(),
7+
type : attr(),
8+
endsAt : attr('moment'),
9+
startsAt : attr('moment'),
10+
paymentCurrency : attr('string'),
11+
completedOrderSales : attr('number'),
12+
placedOrderSales : attr('number'),
13+
pendingOrderSales : attr('number'),
14+
completedOrderTickets : attr('number'),
15+
placedOrderTickets : attr('number'),
16+
pendingOrderTickets : attr('number'),
17+
sales : attr(),
18+
ownerId : attr()
1419
});

0 commit comments

Comments
 (0)