diff --git a/app/Http/Controllers/Reports/MonthlyReportController.php b/app/Http/Controllers/Reports/MonthlyReportController.php index 2a14d443..301f5377 100644 --- a/app/Http/Controllers/Reports/MonthlyReportController.php +++ b/app/Http/Controllers/Reports/MonthlyReportController.php @@ -17,6 +17,7 @@ use Carbon\Carbon; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use App\Classes\Modules\Jobs\ControllersLogic\SubmitJobLogic; +use Illuminate\Support\Facades\Log; class MonthlyReportController { @@ -150,45 +151,84 @@ class MonthlyReportController } public function customerReport(Request $request): JsonResponse { + try { + $connection = CompanyConnection::where('invitee_reference', $request->route('marking'))->firstOrFail(); + $invitee = $connection->invitee; - $connection = CompanyConnection::where('invitee_reference', $request->route('marking'))->firstOrFail(); - $id = $connection->invitee->id; + if (!$invitee) { + Log::warning('Customer report: invitee not found for marking', ['marking' => $request->route('marking')]); + return (new ApiResponseObject('Customer not found', + 'The customer associated with this marking no longer exists.', + HttpStatus::OK_WITH_MESSAGE, ['data' => [ + 'activated_orders' => 0, + 'total_cbm' => 0, + 'packages' => 0, + ]]))->handler(); + } - $from = $request->route('from') ? Carbon::parse($request->route('from')) : Carbon::parse('01-01-2018'); - $to = $request->route('to') ? Carbon::parse($request->route('to')) : Carbon::now(); + $id = $invitee->id; - $containers = Container::whereBetween('loading_date', [$from, $to])->orderBy('loading_date')->get(); + $from = $request->route('from') ? Carbon::parse($request->route('from')) : Carbon::parse('01-01-2018'); + $to = $request->route('to') ? Carbon::parse($request->route('to')) : Carbon::now(); - $packingLists = $containers->flatMap(function ($container) { - return $container->packingLists; - }); + // Only load containers that actually have packing lists belonging to this customer, + // instead of loading ALL containers and filtering in PHP (which causes memory exhaustion). + $containers = Container::whereBetween('loading_date', [$from, $to]) + ->whereHas('packingLists', function ($query) use ($id) { + $query->whereHas('packages', function ($pkgQuery) use ($id) { + $pkgQuery->whereHas('companyModule', function ($cmQuery) use ($id) { + $cmQuery->where('company_modules.id', $id); + }); + }); + }) + ->orderBy('loading_date') + ->get(); - $packages = $packingLists->map(function ($packingList) { - $replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first(); - return $replica ? $replica : $packingList; - })->flatMap(function ($packingList) { - return $packingList->packages; - }); + $packingLists = $containers->flatMap(function ($container) { + return $container->packingLists; + }); - $packages = $packages->filter(function($package) use ($id) { - return $package->companyModule->id === $id; - }); + $userType = Auth() && Auth()->user() ? Auth()->user()->type : RoleTypes::USER; + $exceptionUsers = in_array($userType, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]); - $orders = $packages->unique(function ($package) { - return $package->order; - }); + $packages = $packingLists->map(function ($packingList) use ($exceptionUsers) { + $replica = $exceptionUsers ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first(); + return $replica ? $replica : $packingList; + })->flatMap(function ($packingList) { + return $packingList->packages; + }); - $totalCbm = $packages->sum(function($package){ - return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity; - }); + $packages = $packages->filter(function($package) use ($id) { + $companyModule = $package->companyModule; + return $companyModule && $companyModule->id === $id; + }); - return (new ApiResponseObject('fetch monthly report Successful', - '', - HttpStatus::OK_WITH_MESSAGE, ['data' => [ - 'activated_orders' => count($orders), - 'total_cbm' => $totalCbm, - 'packages' => $packages->sum('quantity'), - ]]))->handler(); + $orders = $packages->unique(function ($package) { + return $package->order; + }); + + $totalCbm = $packages->sum(function($package){ + return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity; + }); + + return (new ApiResponseObject('fetch monthly report Successful', + '', + HttpStatus::OK_WITH_MESSAGE, ['data' => [ + 'activated_orders' => count($orders), + 'total_cbm' => $totalCbm, + 'packages' => $packages->sum('quantity'), + ]]))->handler(); + + } catch (\Exception $e) { + Log::error('Customer report failed', [ + 'marking' => $request->route('marking'), + 'from' => $request->route('from'), + 'to' => $request->route('to'), + 'error' => $e->getMessage(), + 'trace' => $e->getTraceAsString(), + ]); + throw $e; + } } public function serviceReport(Request $request): JsonResponse { diff --git a/resources/assets/vue/app.ts b/resources/assets/vue/app.ts index fafc0ef5..8be5a9d8 100644 --- a/resources/assets/vue/app.ts +++ b/resources/assets/vue/app.ts @@ -16,21 +16,21 @@ window.route = route; window.Vapor = Vapor; window.Vapor.withBaseAssetUrl(import.meta.env.VITE_VAPOR_ASSET_URL); +const pinia = createPinia(); // Create app const app = createApp({ - created() { + setup() { const { routesGuard } = useGuards(); routesGuard(); }, }); // Pinia store -const pinia = createPinia(); app.use(pinia); // V-Money app.use(VMoney); -app.directive('money', Money3Directive); +// app.directive('money', Money3Directive); // Expose stores for legacy Blade templates that are not SFCs (app.config.globalProperties as any).authStore = useAuthStore(); @@ -106,355 +106,6 @@ function downloadUsedComponents() { // } // }); -// Components -// import LoadingComponent from './components/general/elements/LoadingComponent.vue'; -// import ModalComponent from './components/general/elements/ModalComponent.vue'; -// import LoginFormComponent from './components/accounts/forms/LoginFormComponent.vue'; -// import ForgetPasswordFormComponent from './components/accounts/forms/ForgetPasswordFormComponent.vue'; -// import RegistrationFormComponent from './components/accounts/forms/RegistrationFormComponent.vue'; -// import LogoutComponent from './components/accounts/elements/LogoutComponent.vue'; -// import ValidationWrapperComponent from './components/general/forms/ValidationWrapperComponent.vue'; -// import ValidationErrorComponent from './components/general/forms/ValidationErrorComponent.vue'; -// import ErrorMessageComponent from './components/general/elements/ErrorMessageComponent.vue'; -// import ListComponent from './components/general/elements/ListComponent.vue'; -// import PaginationComponent from './components/general/elements/PaginationComponent.vue'; -// import TransitionComponent from './components/general/elements/TransitionComponent.vue'; -// import CustomerProfileSectionComponent from './components/companies/sections/CustomerProfileSectionComponent.vue'; -// import DeliveryCustomerProfileSectionComponent from './components/companies/sections/DeliveryCustomerProfileSectionComponent.vue'; -// import WarehouseSectionComponent from './components/companies/sections/WarehouseSectionComponent.vue'; -// import CustomerProfileComponent from './components/companies/elements/CustomerProfileComponent.vue'; -// import QuickOrderComponent from './components/orders/elements/QuickOrderComponent.vue'; -// import OnBoardingSectionComponent from './components/companies/sections/OnBoardingSectionComponent.vue'; -// import IdentificationVerificationComponent from './components/companies/elements/IdentificationVerificationComponent.vue'; -// import AddressVerificationComponent from './components/addresses/elements/AddressVerificationComponent.vue'; -// import UnclaimedPackinglistComponent from './components/orders/elements/UnclaimedPackinglistComponent.vue'; -// import ProfitModelReportSectionComponent from './components/reports/sections/ProfitModelReportSectionComponent.vue'; -// import MonthlySalesReportSectionComponent from './components/reports/sections/MonthlySalesReportSectionComponent.vue'; -// import ServiceReportSectionComponent from './components/reports/sections/ServiceReportSectionComponent.vue'; -// import DatePickerComponent from './components/general/forms/DatePickerComponent.vue'; -// import DatePickerLimitRangeComponent from './components/general/forms/DatePickerLimitRangeComponent.vue'; -// import OpenLinkInNewTabComponent from './components/general/elements/OpenLinkInNewTabComponent.vue'; -// import AddressFormComponent from './components/addresses/forms/AddressFormComponent.vue'; -// import AssignSegmentFormComponent from './components/companies/forms/AssignSegmentFormComponent.vue'; -// import ContactFormComponent from './components/companies/forms/ContactFormComponent.vue'; -// import DetachSegmentFormComponent from './components/companies/forms/DetachSegmentFormComponent.vue'; -// import EInvoiceInfoFormComponent from './components/companies/forms/EInvoiceInfoFormComponent.vue'; -// import EInvoiceRequestFormComponent from './components/companies/forms/EInvoiceRequestFormComponent.vue'; -// import IdentificationVerificationFormComponent from './components/companies/forms/IdentificationVerificationFormComponent.vue'; -// import UpdateCompanyNameFormComponent from './components/companies/forms/UpdateCompanyNameFormComponent.vue'; -// import UpdateCreditTermStatusFormComponent from './components/companies/forms/UpdateCreditTermStatusFormComponent.vue'; -// import UpdateIdentificationNumberFormComponent from './components/companies/forms/UpdateIdentificationNumberFormComponent.vue'; -// import RejectIdentificationVerificationFormComponent from './components/companies/forms/RejectIdentificationVerificationFormComponent.vue'; -// import ChangeCustomerCompanyDetailsFormComponent from './components/orders/forms/ChangeCustomerCompanyDetailsFormComponent.vue'; -// import ChangeCustomerEmailFormComponent from './components/orders/forms/ChangeCustomerEmailFormComponent.vue'; -// import ChangeCustomerContactNumberFormComponent from './components/orders/forms/ChangeCustomerContactNumberFormComponent.vue'; -// import ChangeCustomerNameFormComponent from './components/orders/forms/ChangeCustomerNameFormComponent.vue'; -// import EInvoiceInfoComponent from './components/companies/elements/EInvoiceInfoComponent.vue'; -// import AdminPaymentsBillingSectionComponent from './components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue'; -// import AdminPaymentsBillingPollingSectionComponent from './components/paymentsBilling/sections/AdminPaymentsBillingPollingSectionComponent.vue'; -// import AdminDisputePaymentsBillingComponent from './components/paymentsBilling/elements/AdminDisputePaymentsBillingComponent.vue'; -// import AdminPaymentsBillingWithSearchComponent from './components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue'; -// import AdminPaymentsBillingWithSearchPollingComponent from './components/paymentsBilling/elements/AdminPaymentsBillingWithSearchPollingComponent.vue'; -// import SingleParentAdminPaymentsBillingComponent from './components/paymentsBilling/elements/SingleParentAdminPaymentsBillingComponent.vue'; -// import SingleAdminPaymentsBillingWithStorageComponent from './components/paymentsBilling/elements/SingleAdminPaymentsBillingWithStorageComponent.vue'; -// import SingleAdminPaymentsBillingWithoutStorageComponent from './components/paymentsBilling/elements/SingleAdminPaymentsBillingWithoutStorageComponent.vue'; -// import CustomerPaymentsBillingWithStorageComponent from './components/paymentsBilling/elements/CustomerPaymentsBillingWithStorageComponent.vue'; -// import ApproveShippingInvoiceFormComponent from './components/paymentsBilling/forms/ApproveShippingInvoiceFormComponent.vue'; -// import CustomerInvoiceRemarkFormComponent from './components/paymentsBilling/forms/CustomerInvoiceRemarkFormComponent.vue'; -// import DeleteDisputeFormComponent from './components/paymentsBilling/forms/DeleteDisputeFormComponent.vue'; -// import DeleteGroupPaymentAttemptFormComponent from './components/paymentsBilling/forms/DeleteGroupPaymentAttemptFormComponent.vue'; -// import DeleteInvoiceFormComponent from './components/paymentsBilling/forms/DeleteInvoiceFormComponent.vue'; -// import DeleteShippingInvoiceFormComponent from './components/paymentsBilling/forms/DeleteShippingInvoiceFormComponent.vue'; -// import GroupPaymentFormComponent from './components/paymentsBilling/forms/GroupPaymentFormComponent.vue'; -// import InvoiceItemFormComponent from './components/paymentsBilling/forms/InvoiceItemFormComponent.vue'; -// import InvoiceItemsFormComponent from './components/paymentsBilling/forms/InvoiceItemsFormComponent.vue'; -// import PaymentFormComponent from './components/paymentsBilling/forms/PaymentFormComponent.vue'; -// import PaymentVerificationFormComponent from './components/paymentsBilling/forms/PaymentVerificationFormComponent.vue'; -// import RegenerateDisputeInvoiceFormComponent from './components/paymentsBilling/forms/RegenerateDisputeInvoiceFormComponent.vue'; -// import WaiveInvoiceFormComponent from './components/paymentsBilling/forms/WaiveInvoiceFormComponent.vue'; -// import DownloadBillingWithDatesComponent from './components/paymentsBilling/forms/DownloadBillingWithDatesComponent.vue'; -// import DownloadParcelSummaryComponent from './components/paymentsBilling/forms/DownloadParcelSummaryComponent.vue'; -// import NewServiceAnnouncementComponent from './components/companies/elements/NewServiceAnnouncementComponent.vue'; -// import ExportCompanyModuleSummaryFormComponent from './components/reports/forms/ExportCompanyModuleSummaryFormComponent.vue'; -// import NotificationSectionComponent from './components/general/elements/NotificationSectionComponent.vue'; -// import PaymentVerificationComponent from './components/paymentsBilling/elements/PaymentVerificationComponent.vue'; -// import DocumentFileViewerComponent from './components/general/elements/DocumentFileViewerComponent.vue'; -// import FulfilmentInterestedFormComponent from './components/companies/elements/FulfilmentInterestedFormComponent.vue'; -// import FileInputComponent from './components/general/forms/FileInputComponent.vue'; -// import FileUploadComponent from './components/general/forms/FileUploadComponent.vue'; -// import RemarkComponent from './components/general/elements/RemarkComponent.vue'; -// import GeneralConfirmationFormComponent from './components/general/forms/GeneralConfirmationFormComponent.vue'; -// import SelectComponent from './components/general/forms/SelectComponent.vue'; -// import SelectableComponent from './components/general/forms/SelectableComponent.vue'; -// import RemarkFormComponent from './components/general/forms/RemarkFormComponent.vue'; -// import RemarkCommentFormComponent from './components/general/forms/RemarkCommentFormComponent.vue'; -// import ReloadConfirmationFormComponent from './components/general/forms/ReloadConfirmationFormComponent.vue'; -// import HelpMenuFormComponent from './components/general/forms/HelpMenuFormComponent.vue'; -// import DeleteRemarkFormComponent from './components/general/forms/DeleteRemarkFormComponent.vue'; -// import ModalFormComponent from './components/general/forms/ModalFormComponent.vue'; -// import AnchorLinkComponent from './components/general/elements/AnchorLinkComponent.vue'; -// import BearComponent from './components/general/elements/bearComponent.vue'; -// import BoxLoadingComponent from './components/general/elements/BoxLoadingComponent.vue'; -// import HelpMenuComponent from './components/general/elements/HelpMenuComponent.vue'; -// import ListPollingComponent from './components/general/elements/ListPollingComponent.vue'; -// import PasswordProtectedDownloadComponent from './components/general/elements/PasswordProtectedDownloadComponent.vue'; -// import PdfViewerComponent from './components/general/elements/PdfViewerComponent.vue'; -// import RemarkListComponent from './components/general/elements/RemarkListComponent.vue'; -// import SearchComponent from './components/general/elements/SearchComponent.vue'; -// import CustomerPaymentBillingSectionComponent from './components/companies/sections/CustomerPaymentBillingSectionComponent.vue'; -// import PaymentsBillingVariant2Components from './components/paymentsBilling/elements/PaymentsBillingVariant2Components.vue'; -// import GroupPaymentsBillingComponents from './components/paymentsBilling/elements/GroupPaymentsBillingComponents.vue'; -// import WalletComponent from './components/wallets/elements/WalletComponent.vue'; -// import WalletTopUpFormComponent from './components/wallets/forms/WalletTopUpFormComponent.vue'; -// import ViewAnnouncementFormComponent from './components/announcements/forms/ViewAnnouncementFormComponent.vue'; -// import BillingAddressSectionComponent from './components/addresses/sections/BillingAddressSectionComponent.vue'; -// import OrderSectionComponent from './components/orders/sections/OrderSectionComponent.vue'; -// import OrderFormComponent from './components/orders/forms/OrderFormComponent.vue'; -// import SelectAddressComponent from './components/addresses/elements/SelectAddressComponent.vue'; -// import WarehouseAddressFormComponent from './components/addresses/forms/WarehouseAddressFormComponent.vue'; -// import OrderProfileV2SectionComponent from './components/orders/sections/OrderProfileV2SectionComponent.vue'; -// import OrderPackageV3SectionComponent from './components/orders/sections/OrderPackageV3SectionComponent.vue'; -// import OrderPackageReceivedSectionComponent from './components/orders/sections/OrderPackageReceivedSectionComponent.vue'; -// import TaxRebateQrCodeFormComponent from './components/orders/forms/TaxRebateQrCodeFormComponent.vue'; -// import CustPayBillParentComponent from './components/paymentsBilling/elements/CustPayBillParentComponent.vue'; -// import ChangeOrderAddressFormComponent from './components/orders/forms/ChangeOrderAddressFormComponent.vue'; -// import ChangeOrderNumberFormComponent from './components/orders/forms/ChangeOrderNumberFormComponent.vue'; -// import CreateWarehousePackageListFormComponent from './components/orders/forms/CreateWarehousePackageListFormComponent.vue'; -// import DownloadReceivePaymentDepositEntryReportComponent from './components/companies/elements/DownloadReceivePaymentDepositEntryReportComponent.vue'; -// import DownloadCustomersDataReportComponent from './components/companies/elements/DownloadCustomersDataReportComponent.vue'; -// import DownloadUploadSalesInvoiceReportComponent from './components/companies/elements/DownloadUploadSalesInvoiceReportComponent.vue'; -// import DownloadUnpaidSalesInvoiceReportComponent from './components/companies/elements/DownloadUnpaidSalesInvoiceReportComponent.vue'; -// import DownloadReceivePaymentForOrderReportComponent from './components/companies/elements/DownloadReceivePaymentForOrderReportComponent.vue'; -// import UploadComponent from './components/orders/elements/UploadComponent.vue'; -// import OrderComponent from './components/orders/elements/OrderComponent.vue'; -// import ListOrderComponent from './components/orders/elements/ListOrderComponent.vue'; -// import OrderPackageSummaryComponent from './components/orders/elements/OrderPackageSummaryComponent.vue'; -// import CancelOrderFormComponent from './components/orders/forms/CancelOrderFormComponent.vue'; -// import RestoreOrderFormComponent from './components/orders/forms/RestoreOrderFormComponent.vue'; -// import PaymentsBillingComponents from './components/paymentsBilling/elements/PaymentsBillingComponents.vue'; -// import CustomerActivityReportSectionComponent from './components/reports/sections/CustomerActivityReportSectionComponent.vue'; -// import SearchCustomerByEmailComponent from './components/reports/sections/SearchCustomerByEmailComponent.vue'; -// import CustomerReportSectionComponent from './components/reports/sections/CustomerReportSectionComponent.vue'; -// import CompanyComponent from './components/companies/elements/CompanyComponent.vue'; -// import UserCompanyComponent from './components/companies/elements/UserCompanyComponent.vue'; -// import OrderSearchSectionComponent from './components/orders/sections/OrderSearchSectionComponent.vue'; -// import WarehouseListExportComponent from './components/companies/elements/WarehouseListExportComponent.vue'; -// import WarehousePackingListComponent from './components/containers/elements/WarehousePackingListComponent.vue'; -// import ParcelComponent from './components/orders/elements/ParcelComponent.vue'; -// import DeleteParcelFormComponent from './components/paymentsBilling/forms/DeleteParcelFormComponent.vue'; -// import ContainerSearchComponent from './components/containers/elements/ContainerSearchComponent.vue'; -// import CreateLoadContainerFormComponent from './components/containers/forms/CreateLoadContainerFormComponent.vue'; -// import ContainerComponent from './components/containers/elements/ContainerComponent.vue'; -// import PackingListSectionComponent from './components/containers/sections/PackingListSectionComponent.vue'; -// import SegmentCompanyComponent from './components/segments/elements/SegmentCompanyComponent.vue'; -// import AdminFeedbackCustomerSectionComponent from './components/feedback/sections/AdminFeedbackCustomerSectionComponent.vue'; -// import GenerateFeedbackLinkFormComponent from './components/feedback/forms/GenerateFeedbackLinkFormComponent.vue'; -// import QuestionAnswerComponent from './components/feedback/elements/QuestionAnswerComponent.vue'; -// import UserProfileComponent from './components/settings/elements/UserProfileComponent.vue'; -// import UploadDebtorExcelComponent from './components/containers/elements/UploadDebtorExcelComponent.vue'; -// import PermitsReminderComponent from './components/settings/elements/PermitsReminderComponent.vue'; -// import UserFormComponent from './components/user/form/UserFormComponent.vue'; -// import ListAdminComponent from './components/user/elements/ListAdminComponent.vue'; -// import BasePriceFormComponent from './components/settings/forms/BasePriceFormComponent.vue'; -// import ListBasePriceSectionComponent from './components/settings/elements/ListBasePriceSectionComponent.vue'; -// import EditSegmentPriceFormComponent from './components/settings/forms/EditSegmentPriceFormComponent.vue'; -// import SegmentFormComponent from './components/settings/forms/SegmentFormComponent.vue'; -// import SegmentComponent from './components/settings/elements/SegmentComponent.vue'; -// import AnnouncementFormComponent from './components/settings/forms/AnnouncementFormComponent.vue'; -// import AnnouncementListComponent from './components/announcements/elements/AnnouncementListComponent.vue'; -// import DeleteAnnouncementFormComponent from './components/settings/forms/DeleteAnnouncementFormComponent.vue'; -// import DetachAnnouncementFromSegmentFormComponent from './components/announcements/forms/DetachAnnouncementFromSegmentFormComponent.vue'; -// import AssignAnnouncementToSegmentFormComponent from './components/announcements/forms/AssignAnnouncementToSegmentFormComponent.vue'; -// import PostcodeSectionComponent from './components/settings/elements/PostcodeSectionComponent.vue'; -// import StatesChargesComponent from './components/settings/elements/StatesChargesComponent.vue'; -// import EditStateChargesFormComponent from './components/settings/forms/EditStateChargesFormComponent.vue'; -// import WarehouseChargesComponent from './components/settings/elements/WarehouseChargesComponent.vue'; -// import EditWarehouseChargesFormComponent from './components/settings/forms/EditWarehouseChargesFormComponent.vue'; -// import PaymentAttemptLimitFormComponent from './components/settings/forms/PaymentAttemptLimitFormComponent.vue'; -// import DisplayWarehouseAddressComponent from './components/addresses/elements/DisplayWarehouseAddressComponent.vue'; -// import AddPermitsReminderFormComponent from './components/settings/forms/AddPermitsReminderFormComponent.vue'; -// import PermitsReminderItemComponent from './components/settings/elements/PermitsReminderItemComponent.vue'; -// import UserComponent from './components/user/elements/UserComponent.vue'; -// import ListPostcodeComponent from './components/settings/elements/ListPostcodeComponent.vue'; -// import ChangeAdminRoleTypeFormComponent from './components/orders/forms/ChangeAdminRoleTypeFormComponent.vue'; -// import DeleteUserFormComponent from './components/user/form/DeleteUserFormComponent.vue'; -// import DeclarePostcodeAreaFormComponent from './components/containers/forms/DeclarePostcodeAreaFormComponent.vue'; - - -// app.component('LoadingComponent', LoadingComponent); -// app.component('ModalComponent', ModalComponent); -// app.component('LoginFormComponent', LoginFormComponent); -// app.component('ForgetPasswordFormComponent', ForgetPasswordFormComponent); -// app.component('RegistrationFormComponent', RegistrationFormComponent); -// app.component('LogoutComponent', LogoutComponent); -// app.component('ValidationWrapperComponent', ValidationWrapperComponent); -// app.component('ValidationErrorComponent', ValidationErrorComponent); -// app.component('ErrorMessageComponent', ErrorMessageComponent); -// app.component('ListComponent', ListComponent); -// app.component('PaginationComponent', PaginationComponent); -// app.component('TransitionComponent', TransitionComponent); -// app.component('CustomerProfileSectionComponent', CustomerProfileSectionComponent); -// app.component('DeliveryCustomerProfileSectionComponent', DeliveryCustomerProfileSectionComponent); -// app.component('WarehouseSectionComponent', WarehouseSectionComponent); -// app.component('CustomerProfileComponent', CustomerProfileComponent); -// app.component('QuickOrderComponent', QuickOrderComponent); -// app.component('OnBoardingSectionComponent', OnBoardingSectionComponent); -// app.component('IdentificationVerificationComponent', IdentificationVerificationComponent); -// app.component('AddressVerificationComponent', AddressVerificationComponent); -// app.component('UnclaimedPackinglistComponent', UnclaimedPackinglistComponent); -// app.component('ProfitModelReportSectionComponent', ProfitModelReportSectionComponent); -// app.component('MonthlySalesReportSectionComponent', MonthlySalesReportSectionComponent); -// app.component('ServiceReportSectionComponent', ServiceReportSectionComponent); -// app.component('DatePickerComponent', DatePickerComponent); -// app.component('DatePickerLimitRangeComponent', DatePickerLimitRangeComponent); -// app.component('OpenLinkInNewTabComponent', OpenLinkInNewTabComponent); -// app.component('AddressFormComponent', AddressFormComponent); -// app.component('AssignSegmentFormComponent', AssignSegmentFormComponent); -// app.component('ContactFormComponent', ContactFormComponent); -// app.component('DetachSegmentFormComponent', DetachSegmentFormComponent); -// app.component('EInvoiceInfoFormComponent', EInvoiceInfoFormComponent); -// app.component('EInvoiceRequestFormComponent', EInvoiceRequestFormComponent); -// app.component('IdentificationVerificationFormComponent', IdentificationVerificationFormComponent); -// app.component('UpdateCompanyNameFormComponent', UpdateCompanyNameFormComponent); -// app.component('UpdateCreditTermStatusFormComponent', UpdateCreditTermStatusFormComponent); -// app.component('UpdateIdentificationNumberFormComponent', UpdateIdentificationNumberFormComponent); -// app.component('RejectIdentificationVerificationFormComponent', RejectIdentificationVerificationFormComponent); -// app.component('ChangeCustomerCompanyDetailsFormComponent', ChangeCustomerCompanyDetailsFormComponent); -// app.component('ChangeCustomerEmailFormComponent', ChangeCustomerEmailFormComponent); -// app.component('ChangeCustomerContactNumberFormComponent', ChangeCustomerContactNumberFormComponent); -// app.component('ChangeCustomerNameFormComponent', ChangeCustomerNameFormComponent); -// app.component('EInvoiceInfoComponent', EInvoiceInfoComponent); -// app.component('AdminPaymentsBillingSectionComponent', AdminPaymentsBillingSectionComponent); -// app.component('AdminPaymentsBillingPollingSectionComponent', AdminPaymentsBillingPollingSectionComponent); -// app.component('AdminDisputePaymentsBillingComponent', AdminDisputePaymentsBillingComponent); -// app.component('AdminPaymentsBillingWithSearchComponent', AdminPaymentsBillingWithSearchComponent); -// app.component('AdminPaymentsBillingWithSearchPollingComponent', AdminPaymentsBillingWithSearchPollingComponent); -// app.component('SingleParentAdminPaymentsBillingComponent', SingleParentAdminPaymentsBillingComponent); -// app.component('SingleAdminPaymentsBillingWithStorageComponent', SingleAdminPaymentsBillingWithStorageComponent); -// app.component('SingleAdminPaymentsBillingWithoutStorageComponent', SingleAdminPaymentsBillingWithoutStorageComponent); -// app.component('CustomerPaymentsBillingWithStorageComponent', CustomerPaymentsBillingWithStorageComponent); -// app.component('ApproveShippingInvoiceFormComponent', ApproveShippingInvoiceFormComponent); -// app.component('CustomerInvoiceRemarkFormComponent', CustomerInvoiceRemarkFormComponent); -// app.component('DeleteDisputeFormComponent', DeleteDisputeFormComponent); -// app.component('DeleteGroupPaymentAttemptFormComponent', DeleteGroupPaymentAttemptFormComponent); -// app.component('DeleteInvoiceFormComponent', DeleteInvoiceFormComponent); -// app.component('DeleteShippingInvoiceFormComponent', DeleteShippingInvoiceFormComponent); -// app.component('GroupPaymentFormComponent', GroupPaymentFormComponent); -// app.component('InvoiceItemFormComponent', InvoiceItemFormComponent); -// app.component('InvoiceItemsFormComponent', InvoiceItemsFormComponent); -// app.component('PaymentFormComponent', PaymentFormComponent); -// app.component('PaymentVerificationFormComponent', PaymentVerificationFormComponent); -// app.component('RegenerateDisputeInvoiceFormComponent', RegenerateDisputeInvoiceFormComponent); -// app.component('WaiveInvoiceFormComponent', WaiveInvoiceFormComponent); -// app.component('DownloadBillingWithDatesComponent', DownloadBillingWithDatesComponent); -// app.component('DownloadParcelSummaryComponent', DownloadParcelSummaryComponent); -// app.component('NewServiceAnnouncementComponent', NewServiceAnnouncementComponent); -// app.component('ExportCompanyModuleSummaryFormComponent', ExportCompanyModuleSummaryFormComponent); -// app.component('NotificationSectionComponent', NotificationSectionComponent); -// app.component('PaymentVerificationComponent', PaymentVerificationComponent); -// app.component('DocumentFileViewerComponent', DocumentFileViewerComponent); -// app.component('FulfilmentInterestedFormComponent', FulfilmentInterestedFormComponent); -// app.component('FileInputComponent', FileInputComponent); -// app.component('FileUploadComponent', FileUploadComponent); -// app.component('RemarkComponent', RemarkComponent); -// app.component('GeneralConfirmationFormComponent', GeneralConfirmationFormComponent); -// app.component('SelectComponent', SelectComponent); -// app.component('SelectableComponent', SelectableComponent); -// app.component('RemarkFormComponent', RemarkFormComponent); -// app.component('RemarkCommentFormComponent', RemarkCommentFormComponent); -// app.component('ReloadConfirmationFormComponent', ReloadConfirmationFormComponent); -// app.component('HelpMenuFormComponent', HelpMenuFormComponent); -// app.component('DeleteRemarkFormComponent', DeleteRemarkFormComponent); -// app.component('ModalFormComponent', ModalFormComponent); -// app.component('AnchorLinkComponent', AnchorLinkComponent); -// app.component('BearComponent', BearComponent); -// app.component('BoxLoadingComponent', BoxLoadingComponent); -// app.component('HelpMenuComponent', HelpMenuComponent); -// app.component('ListPollingComponent', ListPollingComponent); -// app.component('PasswordProtectedDownloadComponent', PasswordProtectedDownloadComponent); -// app.component('PdfViewerComponent', PdfViewerComponent); -// app.component('RemarkListComponent', RemarkListComponent); -// app.component('SearchComponent', SearchComponent); -// app.component('CustomerPaymentBillingSectionComponent', CustomerPaymentBillingSectionComponent); -// app.component('PaymentsBillingVariant2Components', PaymentsBillingVariant2Components); -// app.component('GroupPaymentsBillingComponents', GroupPaymentsBillingComponents); -// app.component('WalletComponent', WalletComponent); -// app.component('WalletTopUpFormComponent', WalletTopUpFormComponent); -// app.component('ViewAnnouncementFormComponent', ViewAnnouncementFormComponent); -// app.component('BillingAddressSectionComponent', BillingAddressSectionComponent); -// app.component('OrderSectionComponent', OrderSectionComponent); -// app.component('OrderFormComponent', OrderFormComponent); -// app.component('SelectAddressComponent', SelectAddressComponent); -// app.component('WarehouseAddressFormComponent', WarehouseAddressFormComponent); -// app.component('OrderProfileV2SectionComponent', OrderProfileV2SectionComponent); -// app.component('OrderPackageV3SectionComponent', OrderPackageV3SectionComponent); -// app.component('OrderPackageReceivedSectionComponent', OrderPackageReceivedSectionComponent); -// app.component('TaxRebateQrCodeFormComponent', TaxRebateQrCodeFormComponent); -// app.component('CustPayBillParentComponent', CustPayBillParentComponent); -// app.component('ChangeOrderAddressFormComponent', ChangeOrderAddressFormComponent); -// app.component('ChangeOrderNumberFormComponent', ChangeOrderNumberFormComponent); -// app.component('CreateWarehousePackageListFormComponent', CreateWarehousePackageListFormComponent); -// app.component('DownloadReceivePaymentDepositEntryReportComponent', DownloadReceivePaymentDepositEntryReportComponent); -// app.component('DownloadCustomersDataReportComponent', DownloadCustomersDataReportComponent); -// app.component('DownloadUploadSalesInvoiceReportComponent', DownloadUploadSalesInvoiceReportComponent); -// app.component('DownloadUnpaidSalesInvoiceReportComponent', DownloadUnpaidSalesInvoiceReportComponent); -// app.component('DownloadReceivePaymentForOrderReportComponent', DownloadReceivePaymentForOrderReportComponent); -// app.component('UploadComponent', UploadComponent); -// app.component('OrderComponent', OrderComponent); -// app.component('ListOrderComponent', ListOrderComponent); -// app.component('OrderPackageSummaryComponent', OrderPackageSummaryComponent); -// app.component('CancelOrderFormComponent', CancelOrderFormComponent); -// app.component('RestoreOrderFormComponent', RestoreOrderFormComponent); -// app.component('PaymentsBillingComponents', PaymentsBillingComponents); -// app.component('CustomerActivityReportSectionComponent', CustomerActivityReportSectionComponent); -// app.component('SearchCustomerByEmailComponent', SearchCustomerByEmailComponent); -// app.component('CustomerReportSectionComponent', CustomerReportSectionComponent); -// app.component('CompanyComponent', CompanyComponent); -// app.component('UserCompanyComponent', UserCompanyComponent); -// app.component('OrderSearchSectionComponent', OrderSearchSectionComponent); -// app.component('WarehouseListExportComponent', WarehouseListExportComponent); -// app.component('WarehousePackingListComponent', WarehousePackingListComponent); -// app.component('ParcelComponent', ParcelComponent); -// app.component('DeleteParcelFormComponent', DeleteParcelFormComponent); -// app.component('ContainerSearchComponent', ContainerSearchComponent); -// app.component('CreateLoadContainerFormComponent', CreateLoadContainerFormComponent); -// app.component('ContainerComponent', ContainerComponent); -// app.component('PackingListSectionComponent', PackingListSectionComponent); -// app.component('SegmentCompanyComponent', SegmentCompanyComponent); -// app.component('AdminFeedbackCustomerSectionComponent', AdminFeedbackCustomerSectionComponent); -// app.component('GenerateFeedbackLinkFormComponent', GenerateFeedbackLinkFormComponent); -// app.component('QuestionAnswerComponent', QuestionAnswerComponent); -// app.component('UserProfileComponent', UserProfileComponent); -// app.component('UploadDebtorExcelComponent', UploadDebtorExcelComponent); -// app.component('PermitsReminderComponent', PermitsReminderComponent); -// app.component('UserFormComponent', UserFormComponent); -// app.component('ListAdminComponent', ListAdminComponent); -// app.component('BasePriceFormComponent', BasePriceFormComponent); -// app.component('ListBasePriceSectionComponent', ListBasePriceSectionComponent); -// app.component('EditSegmentPriceFormComponent', EditSegmentPriceFormComponent); -// app.component('SegmentFormComponent', SegmentFormComponent); -// app.component('SegmentComponent', SegmentComponent); -// app.component('AnnouncementFormComponent', AnnouncementFormComponent); -// app.component('AnnouncementListComponent', AnnouncementListComponent); -// app.component('DeleteAnnouncementFormComponent', DeleteAnnouncementFormComponent); -// app.component('DetachAnnouncementFromSegmentFormComponent', DetachAnnouncementFromSegmentFormComponent); -// app.component('AssignAnnouncementToSegmentFormComponent', AssignAnnouncementToSegmentFormComponent); -// app.component('PostcodeSectionComponent', PostcodeSectionComponent); -// app.component('StatesChargesComponent', StatesChargesComponent); -// app.component('EditStateChargesFormComponent', EditStateChargesFormComponent); -// app.component('WarehouseChargesComponent', WarehouseChargesComponent); -// app.component('EditWarehouseChargesFormComponent', EditWarehouseChargesFormComponent); -// app.component('PaymentAttemptLimitFormComponent', PaymentAttemptLimitFormComponent); -// app.component('DisplayWarehouseAddressComponent', DisplayWarehouseAddressComponent); -// app.component('AddPermitsReminderFormComponent', AddPermitsReminderFormComponent); -// app.component('PermitsReminderItemComponent', PermitsReminderItemComponent); -// app.component('UserComponent', UserComponent); -// app.component('ListPostcodeComponent', ListPostcodeComponent); -// app.component('ChangeAdminRoleTypeFormComponent', ChangeAdminRoleTypeFormComponent); -// app.component('DeleteUserFormComponent', DeleteUserFormComponent); -// app.component('DeclarePostcodeAreaFormComponent', DeclarePostcodeAreaFormComponent); - - // Register tooltip directive app.directive('tooltip', { mounted(el, binding) { diff --git a/resources/assets/vue/components/companies/elements/DownloadCustomersDataReportComponent.vue b/resources/assets/vue/components/companies/elements/DownloadCustomersDataReportComponent.vue index 6519cf8c..173f5046 100644 --- a/resources/assets/vue/components/companies/elements/DownloadCustomersDataReportComponent.vue +++ b/resources/assets/vue/components/companies/elements/DownloadCustomersDataReportComponent.vue @@ -42,12 +42,13 @@ diff --git a/resources/assets/vue/components/general/elements/ListPollingComponent.vue b/resources/assets/vue/components/general/elements/ListPollingComponent.vue index eb83acc6..5ef6061d 100644 --- a/resources/assets/vue/components/general/elements/ListPollingComponent.vue +++ b/resources/assets/vue/components/general/elements/ListPollingComponent.vue @@ -56,6 +56,7 @@ import { useQueueStore } from '@/stores/queue'; import { useUiStore } from '@/stores/ui'; import { useJobPollingStore } from '@/stores/jobPolling'; import { useRequest } from '@/composables/useRequest'; +import PaginationComponent from '@/components/general/elements/PaginationComponent.vue'; const props = withDefaults(defineProps<{ section: string; @@ -74,7 +75,7 @@ const { submit } = useRequest(); const filters = ref(props.options); const isLoading = ref(false); -const pagination = ref(null); +const pagination = ref | null>(null); const setDecoratorDefault = () => { filters.value = {}; @@ -126,7 +127,8 @@ const successHandler = (response: any) => { queueStore.setListComplete({ name: props.section, data: result.data }); jobPollingStore.stopPollingJobResultByJobId(currentJob().jobId); if (pagination.value) { - pagination.value.makePagination(result.meta, result.links); + // pagination.value.makePagination(result.meta, result.links); + pagination.value.makePagination(result.meta); } isLoading.value = false; }; diff --git a/resources/assets/vue/components/orders/elements/ListOrderComponent.vue b/resources/assets/vue/components/orders/elements/ListOrderComponent.vue index 845dbb69..ae1c627d 100644 --- a/resources/assets/vue/components/orders/elements/ListOrderComponent.vue +++ b/resources/assets/vue/components/orders/elements/ListOrderComponent.vue @@ -55,6 +55,7 @@ import { useRequest } from '@/composables/useRequest'; import { useQueueStore } from '@/stores/queue'; import { useUiStore } from '@/stores/ui'; import { route } from '@/general/functions/router'; +import PaginationComponent from '@/components/general/elements/PaginationComponent.vue'; const asset = window.Vapor.asset; @@ -80,7 +81,7 @@ const { submit } = useRequest(); const filters = ref(props.options); const api_count = ref(0); const isLoading = ref(true); -const pagination = ref(null); +const pagination = ref | null>(null); // Create computed properties for reactive data const listData = computed(() => queueStore.getListData(props.section)); @@ -114,7 +115,7 @@ const fetchList = () => { name: props.section, data: response.payload.data }); - pagination.value?.makePagination(response.payload.meta, response.payload.links); + pagination.value?.makePagination(response.payload.meta); //pagination.value?.makePagination(response.payload.meta, response.payload.links); api_count.value += 1; isLoading.value = false; } @@ -138,7 +139,7 @@ const updateFilters = (newFilters: any) => { name: props.section, data: response.payload.data }); - pagination.value?.makePagination(response.payload.meta, response.payload.links); + pagination.value?.makePagination(response.payload.meta); //pagination.value?.makePagination(response.payload.meta, response.payload.links); api_count.value += 1; isLoading.value = false; } @@ -157,6 +158,6 @@ onMounted(() => { }); defineExpose({ - updateFilters + // updateFilters //no where is this being used }); diff --git a/resources/assets/vue/components/orders/sections/DeliveryOrdersTableSectionComponent.vue b/resources/assets/vue/components/orders/sections/DeliveryOrdersTableSectionComponent.vue index 0f8e5948..635b71d0 100644 --- a/resources/assets/vue/components/orders/sections/DeliveryOrdersTableSectionComponent.vue +++ b/resources/assets/vue/components/orders/sections/DeliveryOrdersTableSectionComponent.vue @@ -146,6 +146,7 @@ import { useUiStore } from '@/stores/ui'; import { useQueueStore } from '@/stores/queue'; import { useRequest } from '@/composables/useRequest'; import { route } from '@/general/functions/router'; +import PaginationComponent from '@/components/general/elements/PaginationComponent.vue'; interface Props { data?: any; @@ -166,7 +167,7 @@ const emptyListSection = ref(false); const orderNumber = ref(''); const orderMarking = ref(''); const orderSenderName = ref(''); -const pagination = ref(null); +const pagination = ref | null>(null); const filters = ref(props.data ? { company_module_id: props.data.company_module.id, @@ -224,7 +225,7 @@ const fetchList = () => { const successHandler = (response: any) => { queueStore.setListComplete({ name: section.value, data: response.payload.data }); - pagination.value?.makePagination(response.payload.meta, response.payload.links); + pagination.value?.makePagination(response.payload.meta); //pagination.value?.makePagination(response.payload.meta, response.payload.links); metaData.value = response.payload.meta; orderData.value = response.payload.data; }; diff --git a/resources/assets/vue/components/orders/sections/OrdersTableSectionComponent.vue b/resources/assets/vue/components/orders/sections/OrdersTableSectionComponent.vue index fa3bc159..2997c61b 100644 --- a/resources/assets/vue/components/orders/sections/OrdersTableSectionComponent.vue +++ b/resources/assets/vue/components/orders/sections/OrdersTableSectionComponent.vue @@ -192,6 +192,7 @@ import { useUiStore } from '@/stores/ui'; import { useQueueStore } from '@/stores/queue'; import { useRequest } from '@/composables/useRequest'; import { route } from '@/general/functions/router'; +import PaginationComponent from '@/components/general/elements/PaginationComponent.vue'; const authStore = useAuthStore(); const uiStore = useUiStore(); @@ -205,7 +206,7 @@ const perPageFilterDropDownStatus = ref(false); const orderStatus = ref('Active'); const orderStatusFilterArray = ref(['Active', 'Complete', 'Pending Verification', 'Cancelled']); const orderStatusFilterDropDownStatus = ref(false); -const pagination = ref(null); +const pagination = ref | null>(null); const filters = ref({ per_page: 2, @@ -298,7 +299,7 @@ const updateFilters = (newFilters: any) => { const successHandler = (response: any) => { queueStore.setListComplete({ name: section.value, data: response.payload.data }); - pagination.value?.makePagination(response.payload.meta, response.payload.links); + pagination.value?.makePagination(response.payload.meta); //pagination.value?.makePagination(response.payload.meta, response.payload.links); metaData.value = response.payload.meta; }; diff --git a/resources/assets/vue/components/paymentsBilling/forms/DownloadParcelSummaryComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DownloadParcelSummaryComponent.vue index bc17c5c0..e17a5abd 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/DownloadParcelSummaryComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/DownloadParcelSummaryComponent.vue @@ -52,7 +52,7 @@ const maxDays = 30; const startDate = ref(''); const endDate = ref(''); const isValidRange = ref(false); -const endDatePicker = ref(null); +const endDatePicker = ref | null>(null); const downloadUrl = computed(() => { return generateLink(); diff --git a/resources/assets/vue/components/reports/sections/CustomerReportSectionComponent.vue b/resources/assets/vue/components/reports/sections/CustomerReportSectionComponent.vue index b7b19cce..d7e14a50 100644 --- a/resources/assets/vue/components/reports/sections/CustomerReportSectionComponent.vue +++ b/resources/assets/vue/components/reports/sections/CustomerReportSectionComponent.vue @@ -29,7 +29,7 @@
- +
@@ -130,4 +130,4 @@ const fetchReport = () => { } }); }; - \ No newline at end of file + diff --git a/resources/assets/vue/components/wallets/forms/WalletTopUpFormComponent.vue b/resources/assets/vue/components/wallets/forms/WalletTopUpFormComponent.vue index f30246d5..67b7b806 100644 --- a/resources/assets/vue/components/wallets/forms/WalletTopUpFormComponent.vue +++ b/resources/assets/vue/components/wallets/forms/WalletTopUpFormComponent.vue @@ -174,6 +174,5 @@ const $store = { get getUserId() { return authStore.getUserId; } } }; -defineExpose({ v$ });