-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: Implemented event invoice table for organizers #3230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b10b014
feat: Implemented event invoices for organizers
mrsaicharan1 d860e3c
Merge branch 'development' into invoice-table
mrsaicharan1 2241b05
Merge branch 'development' into invoice-table
shreyanshdwivedi d2d06bf
Merge branch 'development' into invoice-table
mrsaicharan1 7ddcab5
Merge branch 'development' into invoice-table
mrsaicharan1 3f4d1ed
Merge branch 'development' into invoice-table
abhinavk96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import Controller from '@ember/controller'; | ||
|
|
||
| export default class extends Controller { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| import Controller from '@ember/controller'; | ||
| import EmberTableControllerMixin from 'open-event-frontend/mixins/ember-table-controller'; | ||
| import { computed } from '@ember/object'; | ||
|
|
||
| export default class extends Controller.extend(EmberTableControllerMixin) { | ||
| @computed() | ||
| get columns() { | ||
| let columns = []; | ||
| if (this.model.params.invoice_status === 'upcoming') { | ||
| columns = [ | ||
| { | ||
| name : 'Invoice ID', | ||
| valuePath : 'id' | ||
| }, | ||
| { | ||
| name : 'Name', | ||
| valuePath : 'event', | ||
| cellComponent : 'ui-table/cell/events/cell-event-invoice' | ||
| }, | ||
| { | ||
| name : 'Date Issued', | ||
| valuePath : 'createdAt' | ||
| }, | ||
| { | ||
| name : 'Outstanding Amount', | ||
| valuePath : 'amount' | ||
| }, | ||
| { | ||
| name : 'View Invoice', | ||
| valuePath : 'invoicePdfUrl' | ||
| } | ||
| ]; | ||
| } else if (this.model.params.invoice_status === 'paid') { | ||
| columns = [ | ||
| { | ||
| name : 'Invoice ID', | ||
| valuePath : 'id' | ||
| }, | ||
| { | ||
| name : 'Name', | ||
| valuePath : 'event', | ||
| cellComponent : 'ui-table/cell/events/cell-event-invoice' | ||
| }, | ||
| { | ||
| name : 'Date Issued', | ||
| valuePath : 'createdAt' | ||
| }, | ||
| { | ||
| name : 'Amount', | ||
| valuePath : 'amount' | ||
| }, | ||
| { | ||
| name : 'Date Paid', | ||
| valuePath : 'completedAt' | ||
| }, | ||
| { | ||
| name : 'View Invoice', | ||
| valuePath : 'invoicePdfUrl' | ||
| } | ||
|
|
||
| ]; | ||
| } else if (this.model.params.invoice_status === 'due') { | ||
| columns = [ | ||
| { | ||
| name : 'Invoice ID', | ||
| valuePath : 'id' | ||
| }, | ||
| { | ||
| name : 'Name', | ||
| valuePath : 'event', | ||
| cellComponent : 'ui-table/cell/events/cell-event-invoice' | ||
|
|
||
| }, | ||
| { | ||
| name : 'Date Issued', | ||
| valuePath : 'createdAt' | ||
| }, | ||
| { | ||
| name : 'Amount Due', | ||
| valuePath : 'amount' | ||
| }, | ||
| { | ||
| name : 'View Invoice', | ||
| valuePath : 'invoicePdfUrl' | ||
| } | ||
|
|
||
| ]; | ||
| } else if (this.model.params.invoice_status === 'due') { | ||
| columns = [ | ||
| { | ||
| name : 'Invoice ID', | ||
| valuePath : 'id' | ||
| }, | ||
| { | ||
| name : 'Name', | ||
| valuePath : 'event', | ||
| cellComponent : 'ui-table/cell/events/cell-event-invoice' | ||
| }, | ||
| { | ||
| name : 'Amount', | ||
| valuePath : 'amount' | ||
| }, | ||
| { | ||
| name : 'Status', | ||
| valuePath : 'status' | ||
| } | ||
|
|
||
| ]; | ||
| } | ||
| return columns; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import Route from '@ember/routing/route'; | ||
| import moment from 'moment'; | ||
| import EmberTableRouteMixin from 'open-event-frontend/mixins/ember-table-route'; | ||
| import { action } from '@ember/object'; | ||
|
|
||
| export default class extends Route.extend(EmberTableRouteMixin) { | ||
| titleToken() { | ||
| switch (this.params.invoice_status) { | ||
| case 'paid': | ||
| return this.l10n.t('Paid'); | ||
| case 'due': | ||
| return this.l10n.t('Due'); | ||
| case 'upcoming': | ||
| return this.l10n.t('Upcoming'); | ||
| case 'all': | ||
| return this.l10n.t('All'); | ||
| } | ||
| } | ||
| async model(params) { | ||
| this.set('params', params); | ||
| const searchField = 'name'; | ||
| let filterOptions = []; | ||
| if (params.invoice_status === 'paid' || params.invoice_status === 'due') { | ||
| filterOptions = [ | ||
| { | ||
| name : 'status', | ||
| op : 'eq', | ||
| val : params.invoice_status | ||
| } | ||
| ]; | ||
| } else if (params.invoice_status === 'upcoming') { | ||
| filterOptions = [ | ||
| { | ||
| and: [ | ||
| { | ||
| name : 'deleted-at', | ||
| op : 'eq', | ||
| val : null | ||
| }, | ||
| { | ||
| name : 'created-at', | ||
| op : 'ge', | ||
| val : moment().subtract(30, 'days').toISOString() | ||
| } | ||
| ] | ||
| } | ||
| ]; | ||
| } | ||
|
|
||
|
|
||
| filterOptions = this.applySearchFilters(filterOptions, params, searchField); | ||
|
|
||
| let queryString = { | ||
| include : 'event', | ||
| filter : filterOptions, | ||
| 'page[size]' : params.per_page || 10, | ||
| 'page[number]' : params.page || 1 | ||
| }; | ||
|
|
||
| queryString = this.applySortFilters(queryString, params); | ||
| return { | ||
| eventInvoices: (await this.store.query('event-invoice', queryString)).toArray(), | ||
| params | ||
|
|
||
| }; | ||
|
|
||
| } | ||
| @action | ||
| refreshRoute() { | ||
| this.refresh(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,23 @@ | ||
| <div class="ui grid stackable"> | ||
| <div class="thirteen wide column"> | ||
| <h2 class="ui header column">{{t 'Due Invoices'}}</h2> | ||
| <div class="row"> | ||
| <div class="eight wide column"> | ||
| {{#tabbed-navigation isNonPointing=true}} | ||
| {{#link-to 'account.billing.invoices.list' 'all' class='item'}} | ||
| {{t 'All'}} | ||
| {{/link-to}} | ||
| {{#link-to 'account.billing.invoices.list' 'due' class='item'}} | ||
| {{t 'Due'}} | ||
| {{/link-to}} | ||
| {{#link-to 'account.billing.invoices.list' 'paid' class='item'}} | ||
| {{t 'Paid'}} | ||
| {{/link-to}} | ||
| {{#link-to 'account.billing.invoices.list' 'upcoming' class='item'}} | ||
| {{t 'Upcoming'}} | ||
| {{/link-to}} | ||
| {{/tabbed-navigation}} | ||
| </div> | ||
| </div> | ||
| <div class="ui hidden divider"></div> | ||
| <div class="thirteen wide column"> | ||
| <h2 class="ui header column">{{t 'Upcoming Invoices'}}</h2> | ||
| <div class="row"> | ||
| {{outlet}} | ||
| </div> | ||
| <div class="ui hidden divider"></div> | ||
| <div class="thirteen wide column"> | ||
| <h2 class="ui header column">{{t 'Paid Invoices'}}</h2> | ||
| </div> | ||
| <div class="ui hidden divider"></div> | ||
| </div> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <div class="sixteen wide column"> | ||
| {{tables/default columns=columns | ||
| rows=model.eventInvoices | ||
| currentPage=page | ||
| pageSize=per_page | ||
| searchQuery=search | ||
| sortBy=sort_by | ||
| sortDir=sort_dir | ||
| metaData=model.eventInvoices.meta | ||
| filterOptions=filterOptions | ||
| widthConstraint="eq-container" | ||
| resizeMode="fluid" | ||
| fillMode="equal-column" | ||
| }} | ||
| </div> |
3 changes: 3 additions & 0 deletions
3
app/templates/components/ui-table/cell/events/cell-event-invoice.hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <div class="ui header weight-400"> | ||
| <img src="{{if record.logoUrl record.logoUrl '/images/placeholders/Other.jpg'}}" alt="Event Logo" class="ui image"> <br> {{record.name}} | ||
| </div> |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrsaicharan1 the spacing is incorrect in this file. Please fix it.