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

20138 - Suspended EFT Account Views #2827

Merged
merged 9 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth-web",
"version": "2.6.10",
"version": "2.6.11",
"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
95 changes: 56 additions & 39 deletions auth-web/src/components/auth/account-freeze/AccountOverview.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<template>
<div>
<p class="mb-10">
This account has been suspended for a failed payment.
<p class="mb-10 red--text">
<v-icon
color="red"
class="pr-1"
small
>
mdi-alert
</v-icon>
You have overdue payments for your account. Please settle payment to reactivate your account.
seeker25 marked this conversation as resolved.
Show resolved Hide resolved
</p>

<v-card
Expand All @@ -21,21 +28,17 @@
<v-divider class="my-2" />
<v-row>
<v-col cols="9">
<div>Dishonored Bank Instrument Fee</div>
<div class="font-italic">
As per PAD terms, you are charged $30 dishonored bank fee for every failed payment
</div>
</v-col>
<v-col class="text-end">
${{ nsfAmount.toFixed(2) }}
<div>Overdue statements</div>
</v-col>
</v-row>
<v-row>
<v-col cols="9">
Total Transactions
</v-col>
<v-col class="text-end">
${{ totalAmount.toFixed(2) }}
<v-row
v-for="invoice in invoices"
:key="invoice.id"
>
<v-col class="pt-0">
<div class="link">
{{ formatDateRange(invoice.fromDate, invoice.toDate) }}
</div>
</v-col>
</v-row>
<v-divider class="my-2" />
Expand All @@ -44,7 +47,7 @@
Total Amount Due
</v-col>
<v-col class="text-end">
${{ totalAmountRemaining.toFixed(2) }}
${{ totalAmountDue.toFixed(2) }}
</v-col>
</v-row>
</v-card-text>
Expand All @@ -56,17 +59,6 @@
cols="12"
class="mt-5 pb-0 d-inline-flex"
>
<v-btn
large
text
color="primary"
@click="downloadNSFInvoicesPDF"
>
<v-icon class="ml-n2">
mdi-download
</v-icon>
<span>Download Transaction Invoice (PDF)</span>
</v-btn>
<v-spacer />
<v-btn
large
Expand All @@ -86,37 +78,55 @@
<script lang="ts">
import { computed, defineComponent, onMounted, reactive, toRefs } from '@vue/composition-api'
import CommonUtils from '@/util/common-util'
import { FailedInvoice } from '@/models/invoice'
import { FailedEFTInvoice } from '@/models/invoice'
import moment from 'moment'
import { useOrgStore } from '@/stores/org'

export default defineComponent({
name: 'AccountOverviewView',
name: 'AccountOverviewNSFView',
emits: ['step-forward'],
setup (_, { emit }) {
const orgStore = useOrgStore()
const currentOrganization = computed(() => orgStore.currentOrganization)
const currentMembership = computed(() => orgStore.currentMembership)
const calculateFailedInvoices: any = orgStore.calculateFailedInvoices
const calculateFailedInvoices: any = orgStore.calculateFailedEFTInvoices
const downloadNSFInvoicesPDF: any = orgStore.downloadNSFInvoicesPDF
const formatDate = CommonUtils.formatDisplayDate
const suspendedDate = (currentOrganization.value?.suspendedOn) ? formatDate(new Date(currentOrganization.value.suspendedOn)) : ''

const state = reactive({
nsfAmount: 0,
totalAmount: 0,
totalAmountRemaining: 0,
totalPaidAmount: 0
invoices: [],
totalAmountDue: 0
})

const goNext = () => {
emit('step-forward')
}

const getMomentDateObj = (dateStr) => {
return moment(dateStr, 'YYYY-MM-DD')
}

const formatDateRange = (date1, date2) => {
seeker25 marked this conversation as resolved.
Show resolved Hide resolved
let dateObj1 = getMomentDateObj(date1)
let dateObj2 = getMomentDateObj(date2)
let year = (dateObj1.year() === dateObj2.year()) ? dateObj1.year() : ''
let month = (dateObj1.month() === dateObj2.month()) ? dateObj1.format('MMMM') : ''
if (date1 === date2) {
return dateObj1.format('MMMM DD, YYYY')
} else if (year && !month) {
return `${dateObj1.format('MMMM DD')} - ${dateObj2.format('MMMM DD')}, ${year}`
} else if (year && month) {
return `${month} ${dateObj1.date()} - ${dateObj2.date()}, ${year}`
} else {
return `${dateObj1.format('MMMM DD, YYYY')} - ${dateObj2.format('MMMM DD, YYYY')}`
}
}

onMounted(async () => {
const failedInvoices: FailedInvoice = await calculateFailedInvoices()
state.totalAmount = failedInvoices?.totalTransactionAmount || 0
state.nsfAmount = failedInvoices?.nsfFee || 0
state.totalAmountRemaining = failedInvoices?.totalAmountToPay || 0
const failedInvoices: FailedEFTInvoice = await calculateFailedInvoices()
state.invoices = failedInvoices?.invoices || []
state.totalAmountDue = failedInvoices?.totalAmountDue || 0
})

return {
Expand All @@ -125,7 +135,8 @@ export default defineComponent({
currentMembership,
suspendedDate,
downloadNSFInvoicesPDF,
goNext
goNext,
formatDateRange
}
}
})
Expand All @@ -135,6 +146,12 @@ export default defineComponent({
<style lang="scss" scoped>
@import "$assets/scss/theme.scss";

.link {
color: var(--v-primary-base) !important;
text-decoration: underline;
cursor: pointer;
}

.suspended-info-card {
border-color: $BCgovInputError !important;
border-width: 2px !important;
Expand Down
146 changes: 146 additions & 0 deletions auth-web/src/components/auth/account-freeze/AccountOverviewNSF.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<template>
<div>
<p class="mb-10">
This account has been suspended for a failed payment.
</p>

<v-card
outlined
flat
class="suspended-info-card mb-12"
>
<v-card-text class="py-2 px-6">
<v-row>
<v-col cols="9">
Suspended from
</v-col>
<v-col class="text-end">
{{ suspendedDate }}
</v-col>
</v-row>
<v-divider class="my-2" />
<v-row>
<v-col cols="9">
<div>Dishonored Bank Instrument Fee</div>
<div class="font-italic">
As per PAD terms, you are charged $30 dishonored bank fee for every failed payment
</div>
</v-col>
<v-col class="text-end">
${{ nsfAmount.toFixed(2) }}
</v-col>
</v-row>
<v-row>
<v-col cols="9">
Total Transactions
</v-col>
<v-col class="text-end">
${{ totalAmount.toFixed(2) }}
</v-col>
</v-row>
<v-divider class="my-2" />
<v-row class="font-weight-bold">
<v-col cols="9">
Total Amount Due
</v-col>
<v-col class="text-end">
${{ totalAmountRemaining.toFixed(2) }}
</v-col>
</v-row>
</v-card-text>
</v-card>

<v-divider />
<v-row>
<v-col
cols="12"
class="mt-5 pb-0 d-inline-flex"
>
<v-btn
large
text
color="primary"
@click="downloadNSFInvoicesPDF"
>
<v-icon class="ml-n2">
mdi-download
</v-icon>
<span>Download Transaction Invoice (PDF)</span>
</v-btn>
<v-spacer />
<v-btn
large
color="primary"
@click="goNext"
>
<span>Next</span>
<v-icon class="ml-2">
mdi-arrow-right
</v-icon>
</v-btn>
</v-col>
</v-row>
</div>
</template>

<script lang="ts">
import { computed, defineComponent, onMounted, reactive, toRefs } from '@vue/composition-api'
import CommonUtils from '@/util/common-util'
import { FailedInvoice } from '@/models/invoice'
import { useOrgStore } from '@/stores/org'

export default defineComponent({
name: 'AccountOverviewNSFView',
emits: ['step-forward'],
setup (_, { emit }) {
const orgStore = useOrgStore()
const currentOrganization = computed(() => orgStore.currentOrganization)
seeker25 marked this conversation as resolved.
Show resolved Hide resolved
const currentMembership = computed(() => orgStore.currentMembership)
const calculateFailedInvoices: any = orgStore.calculateFailedInvoices
const downloadNSFInvoicesPDF: any = orgStore.downloadNSFInvoicesPDF
const formatDate = CommonUtils.formatDisplayDate
const suspendedDate = (currentOrganization.value?.suspendedOn) ? formatDate(new Date(currentOrganization.value.suspendedOn)) : ''
seeker25 marked this conversation as resolved.
Show resolved Hide resolved

const state = reactive({
nsfAmount: 0,
totalAmount: 0,
totalAmountRemaining: 0,
totalPaidAmount: 0
})

const goNext = () => {
emit('step-forward')
}

onMounted(async () => {
const failedInvoices: FailedInvoice = await calculateFailedInvoices()
state.totalAmount = failedInvoices?.totalTransactionAmount || 0
state.nsfAmount = failedInvoices?.nsfFee || 0
state.totalAmountRemaining = failedInvoices?.totalAmountToPay || 0
})

return {
...toRefs(state),
currentOrganization,
currentMembership,
suspendedDate,
downloadNSFInvoicesPDF,
goNext
}
}
})

</script>

<style lang="scss" scoped>
@import "$assets/scss/theme.scss";

.suspended-info-card {
border-color: $BCgovInputError !important;
border-width: 2px !important;

.sub-txt {
font-size: .75rem;
}
}
</style>
Loading
Loading