diff --git a/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue b/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue index 8681c73..e185ee2 100644 --- a/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue +++ b/src/modules/timesheet-approval/components/timesheet-approval-period-picker.vue @@ -20,7 +20,7 @@ const onDateSelected = (value: string, reason: string, details: QDateDetails) => { calendar_date.value = value; - is_showing_calendar_picker.value = false; + is_showing_calendar_picker.value = false; emit('date-selected', value, reason, details); } diff --git a/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts b/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts index 952b192..ecdf20a 100644 --- a/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts +++ b/src/modules/timesheet-approval/composables/use-timesheet-approval-api.ts @@ -2,6 +2,7 @@ import { useTimesheetStore } from "src/stores/timesheet-store"; import { useAuthStore } from "src/stores/auth-store"; import type { PayPeriodReportFilters } from "../types/timesheet-approval-pay-period-report-interface"; import { default_pay_period_overview_employee, type PayPeriodOverviewEmployee } from "../types/timesheet-approval-pay-period-overview-employee-interface"; +import { date } from "quasar"; export const useTimesheetApprovalApi = () => { const timesheet_store = useTimesheetStore(); @@ -63,11 +64,29 @@ export const useTimesheetApprovalApi = () => { await timesheet_store.getTimesheetApprovalCSVReport(options); }; + const getCurrentPayPerdioOverview = async (): Promise => { + const today = date.formatDate(new Date(), 'YYYY-MM-DD'); + const success = await timesheet_store.getPayPeriodByDate(today); + if(!success) return; + + const { pay_year, pay_period_no } = timesheet_store.current_pay_period; + + await timesheet_store.getTimesheetApprovalPayPeriodEmployeeOverviews( + pay_year, + pay_period_no, + auth_store.user.email + ); + + await timesheet_store.getTimesheetsByPayPeriodAndEmail(auth_store.user.email); + + }; + return { getPayPeriodOverviewByDate, getNextPayPeriodOverview, getPayPeriodOverviewByEmployeeEmail, getTimesheetsByPayPeriodAndEmail, - getTimesheetApprovalCSVReport + getTimesheetApprovalCSVReport, + getCurrentPayPerdioOverview } }; \ No newline at end of file diff --git a/src/modules/timesheets/components/timesheet/deprecated-timesheet-shift-form.vue b/src/modules/timesheets/components/timesheet/deprecated-timesheet-shift-form.vue deleted file mode 100644 index 9d3e299..0000000 --- a/src/modules/timesheets/components/timesheet/deprecated-timesheet-shift-form.vue +++ /dev/null @@ -1,266 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/timesheets/components/timesheet-details-shifts-row-header.vue b/src/modules/timesheets/components/timesheet/timesheet-details-shifts-row-header.vue similarity index 100% rename from src/modules/timesheets/components/timesheet-details-shifts-row-header.vue rename to src/modules/timesheets/components/timesheet/timesheet-details-shifts-row-header.vue diff --git a/src/modules/timesheets/components/timesheet-details-shifts-row.vue b/src/modules/timesheets/components/timesheet/timesheet-details-shifts-row.vue similarity index 67% rename from src/modules/timesheets/components/timesheet-details-shifts-row.vue rename to src/modules/timesheets/components/timesheet/timesheet-details-shifts-row.vue index 2fb0ab5..2c7fa7b 100644 --- a/src/modules/timesheets/components/timesheet-details-shifts-row.vue +++ b/src/modules/timesheets/components/timesheet/timesheet-details-shifts-row.vue @@ -1,9 +1,35 @@