Skip to content
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

Show product usage start date and end date in billing record display #122

Merged
merged 4 commits into from Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/billingRecord/IFXBillingRecord.js
Expand Up @@ -172,6 +172,14 @@ export default class BillingRecord extends IFXItemBase {
return this.data.updated
}

get startDate() {
return this.productUsage.start_date
}

get endDate() {
return this.productUsage.end_date
}

addTransaction(transaction) {
this.data.transactions.push(transaction)
}
Expand Down
21 changes: 19 additions & 2 deletions src/components/billingRecord/IFXBillingRecordList.vue
Expand Up @@ -65,6 +65,11 @@ export default {
required: false,
default: 20,
},
showDates: {
type: Boolean,
required: false,
default: false,
},
},
mounted() {
this.facilityBillingRecords()
Expand Down Expand Up @@ -92,10 +97,12 @@ export default {
{ text: 'Lab', value: 'account.organization', sortable: true },
{ text: 'Expense Code / PO', value: 'account.slug', sortable: true },
{ text: 'Product', value: 'product', sortable: true },
{ text: 'Start Date', value: 'startDate', sortable: true, hide: !this.showDates, namedSlot: true },
{ text: 'End Date', value: 'endDate', sortable: true, hide: !this.showDates, namedSlot: true },
{ text: 'Charge', value: 'charge', sortable: true, width: '100px' },
{ text: 'Percent', value: 'percent', sortable: true, width: '100px' },
{ text: 'Usage id', value: 'productUsage.id', sortable: true },
{ text: 'Txn desc', value: 'transactions', sortable: false },
{ text: 'Transaction Description', value: 'transactions', sortable: false },
{ text: 'Actions', value: 'actions', sortable: false },
],
rowSelectionToggle: [],
Expand Down Expand Up @@ -908,7 +915,7 @@ export default {
<template
v-slot:group.header="{ group, headers, isOpen, toggle }"
v-on:rendered="itemRendered('group.header')"
>
>
<IFXBillingRecordHeader
:key="group"
:item="item"
Expand Down Expand Up @@ -951,6 +958,16 @@ export default {
<template v-slot:item.charge="{ item }">
{{ item.charge | centsToDollars }}
</template>
<template v-slot:item.startDate="{ item }">
<span style="white-space: nowrap">
{{ item.startDate | humanDatetime }}
</span>
</template>
<template v-slot:item.endDate="{ item }">
<span style="white-space: nowrap">
{{ item.endDate | humanDatetime }}
</span>
</template>
<template v-slot:item.actions="{ item }">
<div class="d-flex flex-row">
<IFXButton
Expand Down
18 changes: 17 additions & 1 deletion src/components/billingRecord/IFXBillingRecordListDecimal.vue
Expand Up @@ -65,6 +65,11 @@ export default {
required: false,
default: 20,
},
showDates: {
type: Boolean,
required: false,
default: false,
},
},
mounted() {
this.facilityBillingRecords()
Expand Down Expand Up @@ -92,10 +97,12 @@ export default {
{ text: 'Lab', value: 'account.organization', sortable: true },
{ text: 'Expense Code / PO', value: 'account.slug', sortable: true },
{ text: 'Product', value: 'product', sortable: true },
{ text: 'Start Date', value: 'startDate', sortable: true, hide: !this.showDates, namedSlot: true },
{ text: 'End Date', value: 'endDate', sortable: true, hide: !this.showDates, namedSlot: true },
{ text: 'Charge', value: 'decimalCharge', sortable: true, width: '100px' },
{ text: 'Percent', value: 'percent', sortable: true, width: '100px' },
{ text: 'Usage id', value: 'productUsage.id', sortable: true },
{ text: 'Txn desc', value: 'transactions', sortable: false },
{ text: 'Transaction description', value: 'transactions', sortable: false },
{ text: 'Actions', value: 'actions', sortable: false },
],
rowSelectionToggle: [],
Expand Down Expand Up @@ -952,6 +959,15 @@ export default {
<template v-slot:item.decimalCharge="{ item }">
{{ item.decimalCharge | dollars }}
</template>
<template v-slot:item.startDate="{ item }">
<span style="white-space: nowrap">
{{ item.startDate | humanDatetime }}
</span>
</template>
<template v-slot:item.endDate="{ item }">
<span style="white-space: nowrap">
{{ item.endDate | humanDatetime }}
</span>
<template v-slot:item.actions="{ item }">
<div class="d-flex flex-row">
<IFXButton
Expand Down
7 changes: 7 additions & 0 deletions src/components/billingRecord/IFXBillingRecords.vue
Expand Up @@ -21,6 +21,11 @@ export default {
required: false,
default: false,
},
showDates: {
type: Boolean,
required: false,
default: false,
},
},
data() {
return {
Expand Down Expand Up @@ -145,6 +150,7 @@ export default {
:allowApprovals="false"
:allowDownloads="allowDownloads"
:useDefaultMailButton="useDefaultMailButton"
:showDates="showDates"
/>
<IFXBillingRecordList
v-else
Expand All @@ -155,6 +161,7 @@ export default {
:allowApprovals="false"
:allowDownloads="allowDownloads"
:useDefaultMailButton="useDefaultMailButton"
:showDates="showDates"
/>
</v-col>
</v-row>
Expand Down