File tree Expand file tree Collapse file tree 3 files changed +20
-20
lines changed Expand file tree Collapse file tree 3 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ import Route from '@ember/routing/route';
3
3
export default class extends Route {
4
4
5
5
titleToken ( model ) {
6
- let invoice_identifier = model . get ( 'identifier' ) ;
7
- return this . l10n . t ( `Paid Event Invoice -${ invoice_identifier } ` ) ;
6
+ return this . l10n . tVar ( `Paid Event Invoice - ${ model . get ( 'identifier' ) } ` ) ;
8
7
}
9
8
10
9
model ( params ) {
Original file line number Diff line number Diff line change 1
1
import Route from '@ember/routing/route' ;
2
2
3
3
export default class extends Route {
4
- async model ( params ) {
5
- let filterOptions = [
6
- {
7
- name : 'identifier' ,
8
- op : 'eq' ,
9
- val : params . invoice_identifier
10
- }
11
- ] ;
12
- return {
13
- 'user' : await this . authManager . currentUser ,
14
- 'data' : await this . store . query ( 'event-invoice' , {
15
- include : 'event' ,
16
- filter : filterOptions
17
- } )
18
- } ;
4
+ titleToken ( model ) {
5
+ return this . l10n . tVar ( `Review Event Invoice - ${ model . get ( 'identifier' ) } ` ) ;
19
6
}
20
7
8
+ model ( params ) {
9
+ return this . store . findRecord ( 'event-invoice' , params . invoice_identifier , {
10
+ include : 'event,user' ,
11
+ reload : true
12
+ } ) ;
13
+ }
14
+
15
+ afterModel ( model ) {
16
+ if ( model . get ( 'status' ) === 'due' ) {
17
+ this . transitionTo ( 'event-invoice.review' , model . get ( 'identifier' ) ) ;
18
+ } else if ( model . get ( 'status' ) === 'paid' ) {
19
+ this . transitionTo ( 'event-invoice.paid' , model . get ( 'identifier' ) ) ;
20
+ }
21
+ }
21
22
}
Original file line number Diff line number Diff line change 59
59
<div class =" ui padded segment" >
60
60
<div class =" ui list" >
61
61
<div class =" item" >
62
- <strong >{{ t ' Event Name' }} :</strong > {{ model.data. event.name }}
62
+ <strong >{{ t ' Event Name' }} :</strong > {{ model.event.name }}
63
63
</div >
64
64
<div class =" item" >
65
- <strong >{{ t ' Date Issued' }} :</strong > {{ moment-format model.data. createdAt ' MM/DD/YYYY' }}
65
+ <strong >{{ t ' Date Issued' }} :</strong > {{ moment-format model.createdAt ' MM/DD/YYYY' }}
66
66
</div >
67
67
<div class =" item" >
68
- <strong >{{ t ' Total Invoice Amount' }} :</strong > {{ format-number model.data .amount }}
68
+ <strong >{{ t ' Total Invoice Amount' }} :</strong > {{ currency-symbol model.event.paymentCurrency }} {{ format-number model.amount }}
69
69
</div >
70
70
</div >
71
71
</div >
You can’t perform that action at this time.
0 commit comments