Skip to content

Commit

Permalink
fix: Use correct billing info and PDF URL (#5146)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Sep 25, 2020
1 parent 1b99118 commit c9660eb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 69 deletions.
5 changes: 0 additions & 5 deletions app/models/event-invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export default ModelBase.extend({
paymentMode : attr('string'),
stripeToken : attr('string'),
last4 : attr('string'),
address : attr('string'),
city : attr('string'),
state : attr('string'),
country : attr('string'),
zipcode : attr('string'),
expMonth : attr('number'),
expYear : attr('number'),
amount : attr('number'),
Expand Down
6 changes: 5 additions & 1 deletion app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,9 @@ export default ModelBase.extend({
const user = this.store.peekRecord('user', this.id);
this.authManager.persistCurrentUser(user);
}
}
},

fullName: computed('firstName', 'lastName', function() {
return [this.firstName, this.lastName].filter(Boolean).join(' ');
})
});
24 changes: 12 additions & 12 deletions app/templates/components/event-invoice/billing-info.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@
<div class="ui padded segment">
<div class="ui list">
<div class="item">
<strong>{{t 'From'}}:</strong> {{this.user.billingContactName}}
<strong>{{t 'From'}}:</strong> {{this.settings.adminBillingContactName}}
</div>
<div class="item">
<strong>{{t 'Phone'}}:</strong> {{this.user.billingPhone}}
<strong>{{t 'Company'}}:</strong> {{this.settings.adminCompany}}
</div>
<div class="item">
<strong>{{t 'Email'}}:</strong> {{this.user.email}}
<strong>{{t 'Phone'}}:</strong> {{this.settings.adminBillingPhone}}
</div>
<div class="item">
<strong>{{t 'Billing Address'}}:</strong> {{this.user.billingAddress}}
<strong>{{t 'Email'}}:</strong> {{this.settings.adminBillingEmail}}
</div>
<div class="item">
<strong>{{t 'Zip Code'}}:</strong> {{this.user.billingZipCode}}
<strong>{{t 'Zip Code'}}:</strong> {{this.settings.adminBillingZip}}
</div>
<div class="item">
<strong>{{t 'Country'}}:</strong> {{this.user.billingCountry}}
<strong>{{t 'Country'}}:</strong> {{this.settings.adminBillingCountry}}
</div>
</div>
</div>
<div class="ui padded segment">
<div class="ui list">
<div class="item">
<strong>{{t 'To'}}:</strong> {{this.settings.adminBillingContactName}}
<strong>{{t 'To'}}:</strong> {{or this.user.billingContactName this.user.fullName}}
</div>
<div class="item">
<strong>{{t 'Company'}}:</strong> {{this.settings.adminCompany}}
<strong>{{t 'Phone'}}:</strong> {{this.user.billingPhone}}
</div>
<div class="item">
<strong>{{t 'Phone'}}:</strong> {{this.settings.adminBillingPhone}}
<strong>{{t 'Email'}}:</strong> {{this.user.email}}
</div>
<div class="item">
<strong>{{t 'Email'}}:</strong> {{this.settings.adminBillingEmail}}
<strong>{{t 'Billing Address'}}:</strong> {{this.user.billingAddress}}
</div>
<div class="item">
<strong>{{t 'Zip Code'}}:</strong> {{this.settings.adminBillingZip}}
<strong>{{t 'Zip Code'}}:</strong> {{this.user.billingZipCode}}
</div>
<div class="item">
<strong>{{t 'Country'}}:</strong> {{this.settings.adminBillingCountry}}
<strong>{{t 'Country'}}:</strong> {{this.user.billingCountry}}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/event-invoice/paid.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
</div>
<div class="row">
<div class="column right aligned">
<button {{action 'downloadEventInvoice' this.model.event.name this.model.identifier }}
<a href="{{ this.model.invoicePdfUrl }}" target="_blank" rel="noopener"
class="ui labeled icon blue {{if this.isLoadingInvoice 'loading'}} button">
<i class="print alternate icon"></i>
{{t 'Print Invoice'}}
</button>
</a>
</div>
</div>
<div class="row">
Expand Down
51 changes: 2 additions & 49 deletions app/templates/event-invoice/review.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,8 @@
<h1 class="ui header">{{t 'Review Invoice'}}</h1>
<div class="row">
<div class="sixteen wide column">
<div class="ui segments">
<div class="ui secondary segment">
<h3 class="weight-400">{{t 'Billing Info'}}</h3>
</div>
<div class="ui padded segment">
<div class="ui list">
<div class="item">
<strong>{{t 'From'}}:</strong> {{this.model.user.billingContactName}}
</div>
<div class="item">
<strong>{{t 'Phone'}}:</strong> {{this.model.user.billingPhone}}
</div>
<div class="item">
<strong>{{t 'Email'}}:</strong> {{this.model.user.email}}
</div>
<div class="item">
<strong>{{t 'Billing Address'}}:</strong> {{this.model.user.billingAddress}}
</div>
<div class="item">
<strong>{{t 'Zip Code'}}:</strong> {{this.model.user.billingZipCode}}
</div>
<div class="item">
<strong>{{t 'Country'}}:</strong> {{this.model.user.billingCountry}}
</div>
</div>
</div>
<div class="ui padded segment">
<div class="ui list">
<div class="item">
<strong>{{t 'To'}}:</strong> {{this.settings.adminBillingContactName}}
</div>
<div class="item">
<strong>{{t 'Company'}}:</strong> {{this.settings.adminCompany}}
</div>
<div class="item">
<strong>{{t 'Phone'}}:</strong> {{this.settings.adminBillingPhone}}
</div>
<div class="item">
<strong>{{t 'Email'}}:</strong> {{this.settings.adminBillingEmail}}
</div>
<div class="item">
<strong>{{t 'Zip Code'}}:</strong> {{this.settings.adminBillingZip}}
</div>
<div class="item">
<strong>{{t 'Country'}}:</strong> {{this.settings.adminBillingCountry}}
</div>
</div>
</div>
</div>
<EventInvoice::BillingInfo
@user={{this.model.user}} />
<div class="ui segments">
<div class="ui secondary segment">
<h3 class="weight-400">{{t 'Invoice Details'}}</h3>
Expand Down

1 comment on commit c9660eb

@vercel
Copy link

@vercel vercel bot commented on c9660eb Sep 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.