diff --git a/.github/workflows/backend-code-style-fix.yml b/.github/workflows/backend-code-style-fix.yml
deleted file mode 100644
index 0e926862..00000000
--- a/.github/workflows/backend-code-style-fix.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: Code Style Fix
-
-on: [push, pull_request]
-
-
-jobs:
- php-cs-fixer:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
- with:
- ref: ${{ github.head_ref }}
-
- - name: Run PHP CS Fixer
- uses: docker://oskarstark/php-cs-fixer-ga
- with:
- args: --config=.php_cs.dist --allow-risky=yes
-
- - name: Commit changes
- uses: stefanzweifel/git-auto-commit-action@v4
- with:
- commit_message: Fix backend code styling
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index 9db927f2..00000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-name: Frontend Build
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
- workflow_dispatch:
-
-jobs:
- build:
- runs-on: ubuntu-latest
-
- strategy:
- matrix:
- node-version: [14.x]
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
-
- - name: Install dependencies
- run: npm install
-
- - run: npm run prod
-
- - name: Commit changes
- uses: stefanzweifel/git-auto-commit-action@v4
- with:
- commit_message: Application Build
diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml
deleted file mode 100644
index df0c48cd..00000000
--- a/.github/workflows/unit-testing.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: Unit Testing
-
-on:
- push:
- branches: [ master, oasis ]
- pull_request:
- branches: [ master, oasis ]
-
-jobs:
- test:
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: true
- matrix:
- os: [ubuntu-latest]
- php: [8.0]
- stability: [prefer-stable]
-
- name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
-
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- extensions: ctype, json, exif, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
- coverage: none
-
- - name: Setup problem matchers
- run: |
- echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
-
- - name: Install dependencies
- run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
-
- - name: Run tests
- run: vendor/bin/phpunit
diff --git a/.php_cs.cache b/.php_cs.cache
index 1e6f3590..a5e6fb53 100644
--- a/.php_cs.cache
+++ b/.php_cs.cache
@@ -1 +1 @@
-{"php":"8.0.6","version":"2.19.0:v2.19.0#d5b8a9d852b292c2f8a035200fa6844b1f82300b","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sortAlgorithm":"length"},"blank_line_before_statement":{"statements":["break","case","continue","declare","default","die","do","exit","for","foreach","goto","if","include","include_once","require","require_once","return","switch","throw","try","while","yield","yield_from"]},"class_attributes_separation":{"elements":["method"]},"no_extra_blank_lines":["break","case","continue","curly_brace_block","default","extra","parenthesis_brace_block","return","square_brace_block","switch","throw","use","useTrait","use_trait"],"cast_spaces":{"space":"single"},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"single_space_after_construct":true,"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline_array":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"no_spaces_around_offset":true,"method_chaining_indentation":true,"array_indentation":true,"single_quote":true,"no_singleline_whitespace_before_semicolons":true,"no_empty_statement":true,"standardize_increment":true,"object_operator_without_whitespace":true,"ternary_operator_spaces":true,"no_leading_namespace_whitespace":true,"no_blank_lines_before_namespace":true,"fully_qualified_strict_types":true,"single_line_throw":true,"function_typehint_space":true,"simplified_if_return":true,"no_useless_else":true,"no_unneeded_curly_braces":true,"no_empty_comment":true,"no_blank_lines_after_class_opening":true,"whitespace_after_comma_in_array":true,"trim_array_spaces":true,"no_whitespace_before_comma_in_array":true,"lowercase_static_reference":true},"hashes":{"app\/Traits\/Oasis.php":309271869,"app\/Providers\/AppServiceProvider.php":2241922344,"app\/Providers\/FortifyServiceProvider.php":4138315837,"app\/Providers\/AuthServiceProvider.php":169859517,"app\/Providers\/RouteServiceProvider.php":2048667731,"app\/Providers\/BroadcastServiceProvider.php":3541093703,"app\/Providers\/EventServiceProvider.php":3395009334,"app\/Models\/Oasis\/InvoiceProfile.php":4228451072,"app\/Models\/Oasis\/Invoice.php":3356808891,"app\/Models\/Oasis\/SubscriptionRequest.php":3752927732,"app\/Models\/Oasis\/Client.php":2068352069,"app\/Models\/LanguageTranslation.php":1555765712,"app\/Models\/Zip.php":2771946819,"app\/Models\/File.php":263030666,"app\/Models\/User.php":1428661787,"app\/Models\/Folder.php":4201207301,"app\/Models\/Invoice.php":787253879,"app\/Models\/UserSettings.php":3400206961,"app\/Models\/Traffic.php":2512673789,"app\/Models\/Share.php":131227417,"app\/Models\/Language.php":1756684391,"app\/Models\/Page.php":907354308,"app\/Models\/Setting.php":3917536845,"app\/Exceptions\/Handler.php":1302274777,"app\/Http\/Middleware\/VerifyCsrfToken.php":2876451146,"app\/Http\/Middleware\/RedirectIfAuthenticated.php":4037446582,"app\/Http\/Middleware\/TrimStrings.php":10633912,"app\/Http\/Middleware\/Authenticate.php":829439188,"app\/Http\/Middleware\/TrustProxies.php":3573151230,"app\/Http\/Middleware\/CheckForMaintenanceMode.php":3053801562,"app\/Http\/Middleware\/PreventRequestsDuringMaintenance.php":2280943271,"app\/Http\/Middleware\/EncryptCookies.php":1502216959,"app\/Http\/Mail\/SendContactMessage.php":594829001,"app\/Http\/Resources\/Oasis\/InvoiceProfileCollection.php":560786380,"app\/Http\/Resources\/Oasis\/OasisViewClientResource.php":2537894862,"app\/Http\/Resources\/Oasis\/OasisInvoiceCollection.php":1754967547,"app\/Http\/Resources\/Oasis\/OasisViewInvoiceResource.php":3306960249,"app\/Http\/Resources\/Oasis\/OasisInvoiceResource.php":1769728686,"app\/Http\/Resources\/Oasis\/OasisViewInvoiceCollection.php":3263720200,"app\/Http\/Resources\/Oasis\/InvoiceProfileResource.php":2501455430,"app\/Http\/Resources\/Oasis\/SubscriptionRequestResource.php":1852157891,"app\/Http\/Resources\/Oasis\/OasisViewClientCollection.php":2584161109,"app\/Http\/Resources\/LanguageCollection.php":1364645788,"app\/Http\/Resources\/FileResource.php":2500497589,"app\/Http\/Resources\/PricingCollection.php":549452717,"app\/Http\/Resources\/PageCollection.php":842383211,"app\/Http\/Resources\/InvoiceAdminCollection.php":274747241,"app\/Http\/Resources\/PricingResource.php":2786525720,"app\/Http\/Resources\/PaymentDefaultCardResource.php":1710261108,"app\/Http\/Resources\/LanguageResource.php":1673048322,"app\/Http\/Resources\/PlanCollection.php":1402537053,"app\/Http\/Resources\/InvoiceCollection.php":3442384146,"app\/Http\/Resources\/PageResource.php":2562874131,"app\/Http\/Resources\/UserResource.php":3989233916,"app\/Http\/Resources\/UserStorageResource.php":3173368149,"app\/Http\/Resources\/ShareResource.php":3638836792,"app\/Http\/Resources\/UserSubscription.php":1868974562,"app\/Http\/Resources\/InvoiceAdminResource.php":545842233,"app\/Http\/Resources\/InvoiceResource.php":4272309745,"app\/Http\/Resources\/PaymentCardCollection.php":35382430,"app\/Http\/Resources\/PlanResource.php":1883298248,"app\/Http\/Resources\/PaymentCardResource.php":407843952,"app\/Http\/Resources\/UsersCollection.php":3057145737,"app\/Http\/Requests\/Oasis\/StoreInvoiceProfileRequest.php":956548959,"app\/Http\/Requests\/Oasis\/ShareInvoiceRequest.php":2048451259,"app\/Http\/Requests\/Oasis\/StoreInvoiceRequest.php":480901664,"app\/Http\/Requests\/Oasis\/StoreClientRequest.php":92862977,"app\/Http\/Requests\/Oasis\/CreateOrderRequest.php":470969561,"app\/Http\/Requests\/Payments\/RegisterNewPaymentMethodRequest.php":2918618691,"app\/Http\/Requests\/Auth\/CheckAccountRequest.php":708120184,"app\/Http\/Requests\/Admin\/ChangeRoleRequest.php":1925938295,"app\/Http\/Requests\/Admin\/ChangeStorageCapacityRequest.php":1669862599,"app\/Http\/Requests\/Admin\/DeleteUserRequest.php":2636618911,"app\/Http\/Requests\/Admin\/CreateUserByAdmin.php":3365802358,"app\/Http\/Requests\/User\/UpdateUserPasswordRequest.php":2221986665,"app\/Http\/Requests\/Languages\/UpdateLanguageRequest.php":3062642093,"app\/Http\/Requests\/Languages\/UpdateStringRequest.php":477321427,"app\/Http\/Requests\/Languages\/CreateLanguageRequest.php":3242997343,"app\/Http\/Requests\/Subscription\/StoreUpgradeAccountRequest.php":3421291521,"app\/Http\/Requests\/FileBrowser\/SearchRequest.php":202095165,"app\/Http\/Requests\/PublicPages\/SendContactMessageRequest.php":3821039611,"app\/Http\/Requests\/SetupWizard\/StoreStripeCredentialsRequest.php":429869546,"app\/Http\/Requests\/SetupWizard\/StoreAppSetupRequest.php":2162069828,"app\/Http\/Requests\/SetupWizard\/StoreStripeBillingRequest.php":2767086903,"app\/Http\/Requests\/SetupWizard\/StoreEnvironmentSetupRequest.php":662138835,"app\/Http\/Requests\/SetupWizard\/StoreDatabaseCredentialsRequest.php":3405038241,"app\/Http\/Requests\/SetupWizard\/StoreStripePlansRequest.php":698544961,"app\/Http\/Requests\/FileFunctions\/DeleteItemRequest.php":3936258011,"app\/Http\/Requests\/FileFunctions\/CreateFolderRequest.php":1300625783,"app\/Http\/Requests\/FileFunctions\/UploadRequest.php":2854944424,"app\/Http\/Requests\/FileFunctions\/RenameItemRequest.php":3723095090,"app\/Http\/Requests\/FileFunctions\/MoveItemRequest.php":1125344009,"app\/Http\/Requests\/Share\/UpdateShareRequest.php":403673781,"app\/Http\/Requests\/Share\/CreateShareRequest.php":898178246,"app\/Http\/Requests\/Share\/AuthenticateShareRequest.php":1928811787,"app\/Http\/custom-helpers.php":1559419455,"app\/Http\/helpers.php":3766059098,"app\/Http\/Controllers\/Oasis\/AdminController.php":4212515772,"app\/Http\/Controllers\/Oasis\/SubscriptionController.php":2766815517,"app\/Http\/Controllers\/Oasis\/ClientController.php":3857580952,"app\/Http\/Controllers\/Oasis\/InvoiceController.php":3148572979,"app\/Http\/Controllers\/Oasis\/InvoiceProfileController.php":1129602879,"app\/Http\/Controllers\/Controller.php":2646027293,"app\/Http\/Controllers\/Sharing\/ManipulateShareItemsController.php":14558414,"app\/Http\/Controllers\/Sharing\/FileSharedAccessController.php":3821037715,"app\/Http\/Controllers\/Sharing\/BrowseShareController.php":4259232858,"app\/Http\/Controllers\/App\/Maintenance.php":96974254,"app\/Http\/Controllers\/App\/SetupWizardController.php":1789728519,"app\/Http\/Controllers\/App\/AppFunctionsController.php":962854844,"app\/Http\/Controllers\/Auth\/ForgotPasswordController.php":2521654140,"app\/Http\/Controllers\/Auth\/LoginController.php":2932123434,"app\/Http\/Controllers\/Auth\/ConfirmPasswordController.php":711266715,"app\/Http\/Controllers\/Auth\/AuthController.php":3570080690,"app\/Http\/Controllers\/Auth\/ResetPasswordController.php":348514476,"app\/Http\/Controllers\/Auth\/VerificationController.php":260994322,"app\/Http\/Controllers\/Admin\/UserController.php":1705519460,"app\/Http\/Controllers\/Admin\/DashboardController.php":596828009,"app\/Http\/Controllers\/Admin\/SettingController.php":2219478395,"app\/Http\/Controllers\/Admin\/InvoiceController.php":2147703671,"app\/Http\/Controllers\/Admin\/PlanController.php":297053207,"app\/Http\/Controllers\/Admin\/LanguageController.php":158330191,"app\/Http\/Controllers\/Admin\/PagesController.php":3260477919,"app\/Http\/Controllers\/User\/AccountController.php":4219317847,"app\/Http\/Controllers\/User\/SubscriptionController.php":2751297300,"app\/Http\/Controllers\/User\/PaymentMethodsController.php":3648774,"app\/Http\/Controllers\/Subscription\/StripeWebhookController.php":2426977191,"app\/Http\/Controllers\/FileManager\/FavouriteController.php":2757720034,"app\/Http\/Controllers\/FileManager\/TrashController.php":4243775923,"app\/Http\/Controllers\/FileManager\/EditItemsController.php":2432718425,"app\/Http\/Controllers\/FileManager\/BrowseController.php":115194502,"app\/Http\/Controllers\/FileManager\/ShareController.php":2848524553,"app\/Http\/Controllers\/FileManager\/FileAccessController.php":2326554064,"app\/Http\/Notifications\/ConfirmPayment.php":332683570,"app\/Http\/Kernel.php":2136109776,"app\/Actions\/Fortify\/UpdateUserProfileInformation.php":2472609909,"app\/Actions\/Fortify\/PasswordValidationRules.php":2923916238,"app\/Actions\/Fortify\/UpdateUserPassword.php":2632724801,"app\/Actions\/Fortify\/ResetUserPassword.php":4190615589,"app\/Actions\/Fortify\/CreateNewUser.php":3715974201,"app\/Rules\/DisabledMimetypes.php":3208905600,"app\/Notifications\/Oasis\/InvoiceDeliveryNotification.php":2029222843,"app\/Notifications\/Oasis\/ReminderForPaymentRequiredNotification.php":324257851,"app\/Notifications\/Oasis\/PaymentRequiredNotification.php":1014418625,"app\/Notifications\/ResetPassword.php":217123398,"app\/Notifications\/SharedSendViaEmail.php":113607832,"app\/Services\/DemoService.php":3417423904,"app\/Services\/LanguageService.php":2377025800,"app\/Services\/Oasis\/CzechRegisterSearchService.php":3582263603,"app\/Services\/Oasis\/OasisDevService.php":2949798966,"app\/Services\/Oasis\/OasisService.php":533721080,"app\/Services\/StripeService.php":2332109809,"app\/Services\/SetupService.php":3211368368,"app\/Services\/SchedulerService.php":3203885791,"app\/Services\/FileManagerService.php":2226703157,"app\/Services\/HelperService.php":1615752066,"app\/Console\/Commands\/SetupOasisEnvironment.php":2167679147,"app\/Console\/Commands\/SetupProdEnvironment.php":1770210272,"app\/Console\/Commands\/SetupDevEnvironment.php":3359383874,"app\/Console\/Kernel.php":2439449263,"routes\/maintenance.php":3748923669,"routes\/oasis.php":3886734264,"routes\/file.php":3064209512,"routes\/user.php":4259547085,"routes\/channels.php":2877044881,"routes\/console.php":2045403946,"routes\/web.php":2109839853,"routes\/share.php":1915112226,"routes\/setup.php":174846292,"routes\/api.php":3451943582,"routes\/admin.php":1753159742,"config\/hashing.php":509629418,"config\/fortify.php":26876281,"config\/auth.php":3170093846,"config\/app.php":2412183403,"config\/laravel-query-monitor.php":1440668834,"config\/mail.php":328575859,"config\/language-translations.php":1455662337,"config\/services.php":2567151055,"config\/database.php":2792060856,"config\/cache.php":1332522112,"config\/cashier.php":3667756931,"config\/session.php":2232050276,"config\/snappy.php":3659993845,"config\/content.php":395802805,"config\/backup.php":3248077103,"config\/queue.php":1206545377,"config\/custom-language-translations.php":3482741498,"config\/vuefilemanager.php":1126120216,"config\/broadcasting.php":2563027683,"config\/view.php":3441258419,"config\/scout.php":3982286810,"config\/cors.php":814133164,"config\/logging.php":794303111,"config\/filesystems.php":2319776559}}
\ No newline at end of file
+{"php":"8.0.6","version":"2.19.0:v2.19.0#d5b8a9d852b292c2f8a035200fa6844b1f82300b","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sortAlgorithm":"length"},"blank_line_before_statement":{"statements":["break","case","continue","declare","default","die","do","exit","for","foreach","goto","if","include","include_once","require","require_once","return","switch","throw","try","while","yield","yield_from"]},"class_attributes_separation":{"elements":["method"]},"no_extra_blank_lines":["break","case","continue","curly_brace_block","default","extra","parenthesis_brace_block","return","square_brace_block","switch","throw","use","useTrait","use_trait"],"cast_spaces":{"space":"single"},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"single_space_after_construct":true,"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline_array":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"no_spaces_around_offset":true,"method_chaining_indentation":true,"array_indentation":true,"single_quote":true,"no_singleline_whitespace_before_semicolons":true,"no_empty_statement":true,"standardize_increment":true,"object_operator_without_whitespace":true,"ternary_operator_spaces":true,"no_leading_namespace_whitespace":true,"no_blank_lines_before_namespace":true,"fully_qualified_strict_types":true,"single_line_throw":true,"function_typehint_space":true,"simplified_if_return":true,"no_useless_else":true,"no_unneeded_curly_braces":true,"no_empty_comment":true,"no_blank_lines_after_class_opening":true,"whitespace_after_comma_in_array":true,"trim_array_spaces":true,"no_whitespace_before_comma_in_array":true,"lowercase_static_reference":true},"hashes":{"app\/Traits\/Oasis.php":309271869,"app\/Providers\/AppServiceProvider.php":2241922344,"app\/Providers\/FortifyServiceProvider.php":4138315837,"app\/Providers\/AuthServiceProvider.php":169859517,"app\/Providers\/RouteServiceProvider.php":2048667731,"app\/Providers\/BroadcastServiceProvider.php":3541093703,"app\/Providers\/EventServiceProvider.php":3395009334,"app\/Models\/Oasis\/InvoiceProfile.php":4228451072,"app\/Models\/Oasis\/Invoice.php":3356808891,"app\/Models\/Oasis\/SubscriptionRequest.php":3752927732,"app\/Models\/Oasis\/Client.php":2453895471,"app\/Models\/LanguageTranslation.php":1555765712,"app\/Models\/Zip.php":2771946819,"app\/Models\/File.php":263030666,"app\/Models\/User.php":1428661787,"app\/Models\/Folder.php":4201207301,"app\/Models\/Invoice.php":787253879,"app\/Models\/UserSettings.php":3400206961,"app\/Models\/Traffic.php":2512673789,"app\/Models\/Share.php":131227417,"app\/Models\/Language.php":1756684391,"app\/Models\/Page.php":907354308,"app\/Models\/Setting.php":3917536845,"app\/Exceptions\/Handler.php":1302274777,"app\/Http\/Middleware\/VerifyCsrfToken.php":2876451146,"app\/Http\/Middleware\/RedirectIfAuthenticated.php":4037446582,"app\/Http\/Middleware\/TrimStrings.php":10633912,"app\/Http\/Middleware\/Authenticate.php":829439188,"app\/Http\/Middleware\/TrustProxies.php":3573151230,"app\/Http\/Middleware\/CheckForMaintenanceMode.php":3053801562,"app\/Http\/Middleware\/PreventRequestsDuringMaintenance.php":2280943271,"app\/Http\/Middleware\/EncryptCookies.php":1502216959,"app\/Http\/Mail\/SendContactMessage.php":594829001,"app\/Http\/Resources\/Oasis\/InvoiceProfileCollection.php":560786380,"app\/Http\/Resources\/Oasis\/OasisViewClientResource.php":2537894862,"app\/Http\/Resources\/Oasis\/OasisInvoiceCollection.php":1754967547,"app\/Http\/Resources\/Oasis\/OasisViewInvoiceResource.php":3306960249,"app\/Http\/Resources\/Oasis\/OasisInvoiceResource.php":1769728686,"app\/Http\/Resources\/Oasis\/OasisViewInvoiceCollection.php":3263720200,"app\/Http\/Resources\/Oasis\/InvoiceProfileResource.php":2501455430,"app\/Http\/Resources\/Oasis\/SubscriptionRequestResource.php":1852157891,"app\/Http\/Resources\/Oasis\/OasisViewClientCollection.php":2584161109,"app\/Http\/Resources\/LanguageCollection.php":1364645788,"app\/Http\/Resources\/FileResource.php":2500497589,"app\/Http\/Resources\/PricingCollection.php":549452717,"app\/Http\/Resources\/PageCollection.php":842383211,"app\/Http\/Resources\/InvoiceAdminCollection.php":274747241,"app\/Http\/Resources\/PricingResource.php":2786525720,"app\/Http\/Resources\/PaymentDefaultCardResource.php":1710261108,"app\/Http\/Resources\/LanguageResource.php":1673048322,"app\/Http\/Resources\/PlanCollection.php":1402537053,"app\/Http\/Resources\/InvoiceCollection.php":3442384146,"app\/Http\/Resources\/PageResource.php":2562874131,"app\/Http\/Resources\/UserResource.php":3989233916,"app\/Http\/Resources\/UserStorageResource.php":3173368149,"app\/Http\/Resources\/ShareResource.php":3638836792,"app\/Http\/Resources\/UserSubscription.php":1868974562,"app\/Http\/Resources\/InvoiceAdminResource.php":545842233,"app\/Http\/Resources\/InvoiceResource.php":4272309745,"app\/Http\/Resources\/PaymentCardCollection.php":35382430,"app\/Http\/Resources\/PlanResource.php":1883298248,"app\/Http\/Resources\/PaymentCardResource.php":407843952,"app\/Http\/Resources\/UsersCollection.php":3057145737,"app\/Http\/Requests\/Oasis\/StoreInvoiceProfileRequest.php":956548959,"app\/Http\/Requests\/Oasis\/ShareInvoiceRequest.php":2048451259,"app\/Http\/Requests\/Oasis\/StoreInvoiceRequest.php":480901664,"app\/Http\/Requests\/Oasis\/StoreClientRequest.php":92862977,"app\/Http\/Requests\/Oasis\/CreateOrderRequest.php":470969561,"app\/Http\/Requests\/Payments\/RegisterNewPaymentMethodRequest.php":2918618691,"app\/Http\/Requests\/Auth\/CheckAccountRequest.php":708120184,"app\/Http\/Requests\/Admin\/ChangeRoleRequest.php":1925938295,"app\/Http\/Requests\/Admin\/ChangeStorageCapacityRequest.php":1669862599,"app\/Http\/Requests\/Admin\/DeleteUserRequest.php":2636618911,"app\/Http\/Requests\/Admin\/CreateUserByAdmin.php":3365802358,"app\/Http\/Requests\/User\/UpdateUserPasswordRequest.php":2221986665,"app\/Http\/Requests\/Languages\/UpdateLanguageRequest.php":3062642093,"app\/Http\/Requests\/Languages\/UpdateStringRequest.php":477321427,"app\/Http\/Requests\/Languages\/CreateLanguageRequest.php":3242997343,"app\/Http\/Requests\/Subscription\/StoreUpgradeAccountRequest.php":3421291521,"app\/Http\/Requests\/FileBrowser\/SearchRequest.php":202095165,"app\/Http\/Requests\/PublicPages\/SendContactMessageRequest.php":3821039611,"app\/Http\/Requests\/SetupWizard\/StoreStripeCredentialsRequest.php":429869546,"app\/Http\/Requests\/SetupWizard\/StoreAppSetupRequest.php":2162069828,"app\/Http\/Requests\/SetupWizard\/StoreStripeBillingRequest.php":2767086903,"app\/Http\/Requests\/SetupWizard\/StoreEnvironmentSetupRequest.php":662138835,"app\/Http\/Requests\/SetupWizard\/StoreDatabaseCredentialsRequest.php":3405038241,"app\/Http\/Requests\/SetupWizard\/StoreStripePlansRequest.php":698544961,"app\/Http\/Requests\/FileFunctions\/DeleteItemRequest.php":3936258011,"app\/Http\/Requests\/FileFunctions\/CreateFolderRequest.php":1300625783,"app\/Http\/Requests\/FileFunctions\/UploadRequest.php":2854944424,"app\/Http\/Requests\/FileFunctions\/RenameItemRequest.php":3723095090,"app\/Http\/Requests\/FileFunctions\/MoveItemRequest.php":1125344009,"app\/Http\/Requests\/Share\/UpdateShareRequest.php":403673781,"app\/Http\/Requests\/Share\/CreateShareRequest.php":898178246,"app\/Http\/Requests\/Share\/AuthenticateShareRequest.php":1928811787,"app\/Http\/custom-helpers.php":1559419455,"app\/Http\/helpers.php":3766059098,"app\/Http\/Controllers\/Oasis\/AdminController.php":4212515772,"app\/Http\/Controllers\/Oasis\/SubscriptionController.php":2766815517,"app\/Http\/Controllers\/Oasis\/ClientController.php":662765908,"app\/Http\/Controllers\/Oasis\/InvoiceController.php":1185372207,"app\/Http\/Controllers\/Oasis\/InvoiceProfileController.php":1129602879,"app\/Http\/Controllers\/Controller.php":2646027293,"app\/Http\/Controllers\/Sharing\/ManipulateShareItemsController.php":14558414,"app\/Http\/Controllers\/Sharing\/FileSharedAccessController.php":3821037715,"app\/Http\/Controllers\/Sharing\/BrowseShareController.php":4259232858,"app\/Http\/Controllers\/App\/Maintenance.php":96974254,"app\/Http\/Controllers\/App\/SetupWizardController.php":1789728519,"app\/Http\/Controllers\/App\/AppFunctionsController.php":962854844,"app\/Http\/Controllers\/Auth\/ForgotPasswordController.php":2521654140,"app\/Http\/Controllers\/Auth\/LoginController.php":2932123434,"app\/Http\/Controllers\/Auth\/ConfirmPasswordController.php":711266715,"app\/Http\/Controllers\/Auth\/AuthController.php":3570080690,"app\/Http\/Controllers\/Auth\/ResetPasswordController.php":348514476,"app\/Http\/Controllers\/Auth\/VerificationController.php":260994322,"app\/Http\/Controllers\/Admin\/UserController.php":1705519460,"app\/Http\/Controllers\/Admin\/DashboardController.php":596828009,"app\/Http\/Controllers\/Admin\/SettingController.php":2219478395,"app\/Http\/Controllers\/Admin\/InvoiceController.php":2147703671,"app\/Http\/Controllers\/Admin\/PlanController.php":297053207,"app\/Http\/Controllers\/Admin\/LanguageController.php":158330191,"app\/Http\/Controllers\/Admin\/PagesController.php":3260477919,"app\/Http\/Controllers\/User\/AccountController.php":4219317847,"app\/Http\/Controllers\/User\/SubscriptionController.php":2751297300,"app\/Http\/Controllers\/User\/PaymentMethodsController.php":3648774,"app\/Http\/Controllers\/Subscription\/StripeWebhookController.php":2426977191,"app\/Http\/Controllers\/FileManager\/FavouriteController.php":2757720034,"app\/Http\/Controllers\/FileManager\/TrashController.php":4243775923,"app\/Http\/Controllers\/FileManager\/EditItemsController.php":2432718425,"app\/Http\/Controllers\/FileManager\/BrowseController.php":115194502,"app\/Http\/Controllers\/FileManager\/ShareController.php":2848524553,"app\/Http\/Controllers\/FileManager\/FileAccessController.php":2326554064,"app\/Http\/Notifications\/ConfirmPayment.php":332683570,"app\/Http\/Kernel.php":2136109776,"app\/Actions\/Fortify\/UpdateUserProfileInformation.php":2472609909,"app\/Actions\/Fortify\/PasswordValidationRules.php":2923916238,"app\/Actions\/Fortify\/UpdateUserPassword.php":2632724801,"app\/Actions\/Fortify\/ResetUserPassword.php":4190615589,"app\/Actions\/Fortify\/CreateNewUser.php":3715974201,"app\/Rules\/DisabledMimetypes.php":3208905600,"app\/Notifications\/Oasis\/InvoiceDeliveryNotification.php":2029222843,"app\/Notifications\/Oasis\/ReminderForPaymentRequiredNotification.php":324257851,"app\/Notifications\/Oasis\/PaymentRequiredNotification.php":1014418625,"app\/Notifications\/ResetPassword.php":217123398,"app\/Notifications\/SharedSendViaEmail.php":113607832,"app\/Services\/DemoService.php":3417423904,"app\/Services\/LanguageService.php":2377025800,"app\/Services\/Oasis\/CzechRegisterSearchService.php":3582263603,"app\/Services\/Oasis\/OasisDevService.php":2949798966,"app\/Services\/Oasis\/OasisService.php":533721080,"app\/Services\/StripeService.php":2332109809,"app\/Services\/SetupService.php":3211368368,"app\/Services\/SchedulerService.php":3203885791,"app\/Services\/FileManagerService.php":2226703157,"app\/Services\/HelperService.php":1615752066,"app\/Console\/Commands\/SetupOasisEnvironment.php":3330862626,"app\/Console\/Commands\/SetupProdEnvironment.php":1770210272,"app\/Console\/Commands\/SetupDevEnvironment.php":3359383874,"app\/Console\/Kernel.php":2439449263,"routes\/maintenance.php":3748923669,"routes\/oasis.php":3886734264,"routes\/file.php":3064209512,"routes\/user.php":4259547085,"routes\/channels.php":2877044881,"routes\/console.php":2045403946,"routes\/web.php":2109839853,"routes\/share.php":1915112226,"routes\/setup.php":174846292,"routes\/api.php":3451943582,"routes\/admin.php":1753159742,"config\/hashing.php":509629418,"config\/fortify.php":26876281,"config\/auth.php":3170093846,"config\/app.php":2412183403,"config\/laravel-query-monitor.php":1440668834,"config\/mail.php":328575859,"config\/language-translations.php":1455662337,"config\/services.php":2567151055,"config\/database.php":2792060856,"config\/cache.php":1332522112,"config\/cashier.php":3667756931,"config\/session.php":2232050276,"config\/snappy.php":3659993845,"config\/content.php":395802805,"config\/backup.php":3248077103,"config\/queue.php":1206545377,"config\/custom-language-translations.php":2653749497,"config\/vuefilemanager.php":1126120216,"config\/broadcasting.php":2563027683,"config\/view.php":3441258419,"config\/scout.php":3982286810,"config\/cors.php":814133164,"config\/logging.php":794303111,"config\/filesystems.php":2319776559}}
\ No newline at end of file
diff --git a/app/Console/Commands/SetupOasisEnvironment.php b/app/Console/Commands/SetupOasisEnvironment.php
index 0480d637..b723733a 100644
--- a/app/Console/Commands/SetupOasisEnvironment.php
+++ b/app/Console/Commands/SetupOasisEnvironment.php
@@ -45,7 +45,6 @@ class SetupOasisEnvironment extends Command
{
$this->info('Setting up Oasis environment');
- $this->create_demo_content();
$this->set_oasis_data();
$this->info('Dispatching jobs...');
@@ -56,92 +55,6 @@ class SetupOasisEnvironment extends Command
$this->info('Everything is done, congratulations! 🥳🥳🥳');
}
- public function create_demo_content()
- {
- $user = User::whereEmail('howdy@hi5ve.digital')
- ->first();
-
- $hash = Str::random(12);
-
- // Get invoice logo and stamp
- Storage::putFileAs('system', storage_path('demo/app/logo-horizontal.svg'), "{$hash}-logo-horizontal.svg", 'private');
- Storage::putFileAs('system', storage_path('demo/oasis/stamp.png'), "{$hash}-stamp.png", 'private');
-
- $profile = $user->invoiceProfile()->create([
- 'company' => 'VueFileManager Inc.',
- 'registration_notes' => 'Registrácia na OR SR Bratislava I. oddiel: Sro vl. č. 91906',
- 'logo' => "system/{$hash}-logo-horizontal.svg",
- 'ico' => '46530045',
- 'dic' => '2023489457',
- 'ic_dph' => 'SK2023489457',
- 'address' => 'Does 11',
- 'state' => 'Slovakia',
- 'city' => 'Bratislava',
- 'postal_code' => '04001',
- 'country' => 'SK',
- 'bank' => 'Fio Banka',
- 'iban' => 'SK20000054236423624',
- 'swift' => 'FIOZXXX',
- 'phone' => '+421950123456',
- 'email' => 'howdy@hi5ve.digital',
- 'author' => 'John Doe',
- 'stamp' => "system/{$hash}-stamp.png",
- ]);
-
- $clients = Client::factory(Client::class)
- ->count(6)
- ->create(['user_id' => $user->id]);
-
- $regular_invoices = Invoice::factory(Invoice::class)
- ->state(new Sequence(
- ['client_id' => $clients[0]->id],
- ['client_id' => $clients[1]->id],
- ['client_id' => $clients[2]->id],
- ['client_id' => $clients[3]->id],
- ['client_id' => $clients[4]->id],
- ['client_id' => $clients[5]->id],
- ))->count(8)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'discount_type' => null,
- 'user' => $profile->toArray(),
- ]);
-
- $advance_invoices = Invoice::factory(Invoice::class)
- ->count(6)
- ->state(new Sequence(
- ['client_id' => $clients[0]->id],
- ['client_id' => $clients[1]->id],
- ['client_id' => $clients[2]->id],
- ['client_id' => $clients[3]->id],
- ['client_id' => $clients[4]->id],
- ['client_id' => $clients[5]->id],
- ))->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'advance-invoice',
- 'discount_type' => null,
- 'user' => $profile->toArray(),
- ]);
-
- // Generate PDF
- collect([$regular_invoices, $advance_invoices])
- ->collapse()
- ->each(function ($invoice) use ($user) {
- $this->info("Generating invoice id: $invoice->id");
-
- \PDF::loadView('oasis.invoices.invoice', [
- 'invoice' => Invoice::find($invoice->id),
- 'user' => $user,
- ])
- ->setPaper('a4')
- ->setOrientation('portrait')
- ->save(
- storage_path("app/files/{$invoice->user_id}/invoice-{$invoice->id}.pdf")
- );
- });
- }
-
public function set_oasis_data()
{
Setting::updateOrCreate([
diff --git a/app/Http/Controllers/Oasis/ClientController.php b/app/Http/Controllers/Oasis/ClientController.php
deleted file mode 100644
index ca0e604a..00000000
--- a/app/Http/Controllers/Oasis/ClientController.php
+++ /dev/null
@@ -1,130 +0,0 @@
-whereUserId(Auth::id())
- ->get();
-
- return response(
- new OasisViewClientCollection($clients),
- 200
- );
- }
-
- /**
- * @param StoreClientRequest $request
- * @return Application|ResponseFactory|Response
- */
- public function store(StoreClientRequest $request)
- {
- $client = $request->user()
- ->clients()
- ->create([
- 'avatar' => store_avatar($request, 'avatar') ?? null,
- 'name' => $request->name,
- 'email' => $request->email ?? null,
- 'phone_number' => $request->phone_number ?? null,
- 'address' => $request->address,
- 'city' => $request->city,
- 'postal_code' => $request->postal_code,
- 'country' => $request->country,
- 'ico' => $request->ico ?? null,
- 'dic' => $request->dic ?? null,
- 'ic_dph' => $request->ic_dph ?? null,
- ]);
-
- return response(
- new OasisViewClientResource($client),
- 201
- );
- }
-
- /**
- * @param Client $client
- * @return Application|ResponseFactory|Response
- */
- public function show(Client $client)
- {
- return response(new OasisViewClientResource($client), 200);
- }
-
- /**
- * @param Client $client
- * @param Request $request
- * @return Application|ResponseFactory|Response
- */
- public function update(Client $client, Request $request)
- {
- // Store image if exist
- if ($request->hasFile($request->name)) {
- // Find and update image path
- $client->update([
- $request->name => store_avatar($request, $request->name),
- ]);
-
- return response('Done', 204);
- }
-
- $client->update(
- make_single_input($request)
- );
-
- return response('Done', 204);
- }
-
- /**
- * @param Client $client
- * @throws \Exception
- */
- public function destroy(Client $client)
- {
- $client->delete();
-
- return response('Done', 204);
- }
-
- /**
- * @param Client $client
- * @return Application|ResponseFactory|Response
- */
- public function show_invoices(Client $client)
- {
- return response(new OasisInvoiceCollection($client->invoices), 200);
- }
-
- /**
- * @return mixed
- */
- public function search()
- {
- $query = remove_accents(request()->input('query'));
-
- $results = Client::search($query)
- ->where('user_id', request()->user()->id)
- ->get();
-
- return response(
- new OasisViewClientCollection($results),
- 200
- );
- }
-}
diff --git a/app/Http/Controllers/Oasis/InvoiceController.php b/app/Http/Controllers/Oasis/InvoiceController.php
deleted file mode 100644
index e512f23b..00000000
--- a/app/Http/Controllers/Oasis/InvoiceController.php
+++ /dev/null
@@ -1,287 +0,0 @@
-whereUserId(Auth::id())
- ->whereInvoiceType('regular-invoice')
- ->get();
-
- return response(
- new OasisViewInvoiceCollection($invoices),
- 200
- );
- }
-
- /**
- * @return Application|ResponseFactory|Response
- */
- public function get_all_advance_invoices()
- {
- $invoices = Invoice::sortable(['created_at', 'DESC'])
- ->whereUserId(Auth::id())
- ->whereInvoiceType('advance-invoice')
- ->get();
-
- return response(
- new OasisViewInvoiceCollection($invoices),
- 200
- );
- }
-
- /**
- * @param Invoice $invoice
- * @return Application|ResponseFactory|Response
- */
- public function get_single_invoice(Invoice $invoice)
- {
- return response(
- new OasisInvoiceResource($invoice),
- 200
- );
- }
-
- /**
- * @param Invoice $invoice
- * @return \Symfony\Component\HttpFoundation\StreamedResponse
- */
- public function download_invoice(Invoice $invoice)
- {
- if (! Storage::exists(invoice_path($invoice))) {
- abort(404, 'Not Found');
- }
-
- return Storage::download(invoice_path($invoice), "invoice-{$invoice->id}.pdf");
- }
-
- /**
- * @return Application|ResponseFactory|Response
- */
- public function search()
- {
- $results = Invoice::search(
- remove_accents(request()->input('query'))
- )
- ->where('user_id', request()->user()->id)
- ->where('invoice_type', request()->input('type'))
- ->get();
-
- return response(
- new OasisViewInvoiceCollection($results),
- 200
- );
- }
-
- /**
- * Store and generate new invoice
- *
- * @param StoreInvoiceRequest $request
- * @return Application|ResponseFactory|Response
- */
- public function store(StoreInvoiceRequest $request)
- {
- $client = $this->getOrStoreClient($request);
- $user = $request->user();
-
- $invoice = Invoice::create([
- 'user_id' => $user->id,
- 'client_id' => $client->id ?? null,
- 'invoice_type' => $request->invoice_type,
- 'invoice_number' => $request->invoice_number,
- 'variable_number' => $request->variable_number,
- 'delivery_at' => $request->delivery_at,
- 'discount_type' => $request->discount_type ?? null,
- 'discount_rate' => $request->discount_rate ?? null,
- 'items' => json_decode($request->items),
- 'user' => $user->invoiceProfile,
- 'client' => [
- 'email' => $client->email ?? $request->client_email,
- 'name' => $client->name ?? $request->client_name,
- 'address' => $client->address ?? $request->client_address,
- 'city' => $client->city ?? $request->client_city,
- 'postal_code' => $client->postal_code ?? $request->client_postal_code,
- 'country' => $client->country ?? $request->client_country,
- 'ico' => $client->ico ?? $request->client_ico,
- 'dic' => $client->dic ?? $request->client_dic ?? null,
- 'ic_dph' => $client->ic_dph ?? $request->client_ic_dph ?? null,
- ],
- ]);
-
- // Generate PDF
- \PDF::loadView('oasis.invoices.invoice', [
- 'invoice' => Invoice::find($invoice->id),
- 'user' => $user,
- ])
- ->setPaper('a4')
- ->setOrientation('portrait')
- ->save(
- storage_path("app/files/{$user->id}/invoice-{$invoice->id}.pdf")
- );
-
- if ($request->send_invoice && $invoice->client['email']) {
- Notification::route('mail', $invoice->client['email'])->notify(
- new InvoiceDeliveryNotification($user, $invoice)
- );
- }
-
- return response(
- new OasisViewInvoiceResource($invoice),
- 201
- );
- }
-
- /**
- * Store and generate new invoice
- *
- * @param Request $request
- * @param Invoice $invoice
- * @return Application|ResponseFactory|Response
- */
- public function update(StoreInvoiceRequest $request, Invoice $invoice)
- {
- $user = $request->user();
-
- $invoice->update([
- 'invoice_number' => $request->invoice_number,
- 'variable_number' => $request->variable_number,
- 'delivery_at' => $request->delivery_at,
- 'discount_type' => $request->discount_type ?? null,
- 'discount_rate' => $request->discount_rate ?? null,
- 'items' => json_decode($request->items),
- ]);
-
- Storage::delete(invoice_path($invoice));
-
- // Generate PDF
- \PDF::loadView('oasis.invoices.invoice', [
- 'invoice' => Invoice::find($invoice->id),
- 'user' => $user,
- ])
- ->setPaper('a4')
- ->setOrientation('portrait')
- ->save(
- storage_path("app/files/{$user->id}/invoice-{$invoice->id}.pdf")
- );
-
- if ($request->send_invoice && $invoice->client['email']) {
- Notification::route('mail', $invoice->client['email'])->notify(
- new InvoiceDeliveryNotification($user, $invoice)
- );
- }
-
- return response(
- 'Done',
- 204
- );
- }
-
- /**
- * Share invoice via email
- *
- * @param ShareInvoiceRequest $request
- * @param Invoice $invoice
- */
- public function share(ShareInvoiceRequest $request, Invoice $invoice)
- {
- Notification::route('mail', $request->email)
- ->notify(
- new InvoiceDeliveryNotification($request->user(), $invoice)
- );
-
- return response(
- 'Done',
- 204
- );
- }
-
- /**
- * @param Invoice $invoice
- * @throws \Exception
- */
- public function destroy(Invoice $invoice)
- {
- $invoice->delete();
-
- return response('Done', 204);
- }
-
- /**
- * Get data for frontend invoice creator
- *
- * @return array
- */
- public function editor()
- {
- $user = Auth::user();
-
- return [
- 'isVatPayer' => $user->invoiceProfile->ic_dph ?? false,
- 'latestInvoiceNumber' => $user->regularInvoices->first()
- ? (int) $user->regularInvoices->first()->invoice_number
- : null,
- 'recommendedInvoiceNumber' => $user->regularInvoices->first()
- ? (int) $user->regularInvoices->first()->invoice_number + 1
- : Carbon::now()->format('Y') . '0001',
- 'clients' => $user->clients->map(function ($client) {
- return [
- 'label' => $client->name,
- 'value' => $client->id,
- ];
- }),
- ];
- }
-
- /**
- * @param StoreInvoiceRequest $request
- * @return mixed
- */
- private function getOrStoreClient(StoreInvoiceRequest $request)
- {
- if (! Str::isUuid($request->client) && $request->store_client) {
- return $request->user()
- ->clients()
- ->create([
- 'avatar' => store_avatar($request, 'client_avatar') ?? null,
- 'name' => $request->client_name,
- 'email' => $request->client_email ?? null,
- 'phone_number' => $request->client_phone_number ?? null,
- 'address' => $request->client_address,
- 'city' => $request->client_city,
- 'postal_code' => $request->client_postal_code,
- 'country' => $request->client_country,
- 'ico' => $request->client_ico ?? null,
- 'dic' => $request->client_dic ?? null,
- 'ic_dph' => $request->client_ic_dph ?? null,
- ]);
- }
-
- return Client::whereUserId($request->user()->id)
- ->whereId($request->client)
- ->first();
- }
-}
diff --git a/app/Http/Controllers/Oasis/InvoiceProfileController.php b/app/Http/Controllers/Oasis/InvoiceProfileController.php
deleted file mode 100644
index 49975255..00000000
--- a/app/Http/Controllers/Oasis/InvoiceProfileController.php
+++ /dev/null
@@ -1,90 +0,0 @@
-invoiceProfile) {
- return response(
- new InvoiceProfileResource($user->invoiceProfile),
- 200
- );
- }
-
- return response("Profile didn't exists", 404);
- }
-
- /**
- * @param Request $request
- * @return Application|ResponseFactory|Response
- */
- public function store(Request $request)
- {
- $profile = InvoiceProfile::create([
- 'user_id' => $request->user()->id,
- 'logo' => store_system_image($request, 'logo') ?? null,
- 'stamp' => store_system_image($request, 'stamp') ?? null,
- 'company' => $request->company,
- 'email' => $request->email,
- 'ico' => $request->ico,
- 'dic' => $request->dic,
- 'ic_dph' => $request->ic_dph,
- 'registration_notes' => $request->registration_notes,
- 'author' => $request->author,
- 'address' => $request->address,
- 'state' => $request->state,
- 'city' => $request->city,
- 'postal_code' => $request->postal_code,
- 'country' => $request->country,
- 'phone' => $request->phone,
- 'bank' => $request->bank,
- 'iban' => $request->iban,
- 'swift' => $request->swift,
- ]);
-
- return response(
- new InvoiceProfileResource($profile),
- 201
- );
- }
-
- /**
- * @param \Illuminate\Http\Request $request
- * @return \Illuminate\Http\Response
- */
- public function update(Request $request)
- {
- // Store image if exist
- if ($request->hasFile($request->name)) {
- // Find and update image path
- $request->user()
- ->invoiceProfile()
- ->update([
- $request->name => store_system_image($request, $request->name),
- ]);
-
- return response('Done', 204);
- }
-
- $request->user()
- ->invoiceProfile()
- ->update(make_single_input($request));
-
- return response('Done', 204);
- }
-}
diff --git a/app/Http/Requests/Oasis/ShareInvoiceRequest.php b/app/Http/Requests/Oasis/ShareInvoiceRequest.php
deleted file mode 100644
index ec989f10..00000000
--- a/app/Http/Requests/Oasis/ShareInvoiceRequest.php
+++ /dev/null
@@ -1,29 +0,0 @@
- 'required|email',
- ];
- }
-}
diff --git a/app/Http/Requests/Oasis/StoreClientRequest.php b/app/Http/Requests/Oasis/StoreClientRequest.php
deleted file mode 100644
index 10609a10..00000000
--- a/app/Http/Requests/Oasis/StoreClientRequest.php
+++ /dev/null
@@ -1,39 +0,0 @@
- 'sometimes|nullable',
- 'name' => 'required|string',
- 'email' => 'sometimes|email|nullable',
- 'phone_number' => 'sometimes|string|nullable',
- 'address' => 'required|string',
- 'city' => 'required|string',
- 'postal_code' => 'required|string',
- 'country' => 'required|string',
- 'ico' => 'required|string',
- 'dic' => 'required|string|nullable',
- 'ic_dph' => 'sometimes|string|nullable',
- ];
- }
-}
diff --git a/app/Http/Requests/Oasis/StoreInvoiceProfileRequest.php b/app/Http/Requests/Oasis/StoreInvoiceProfileRequest.php
deleted file mode 100644
index 497d8868..00000000
--- a/app/Http/Requests/Oasis/StoreInvoiceProfileRequest.php
+++ /dev/null
@@ -1,46 +0,0 @@
- 'sometimes|file',
- 'stamp' => 'sometimes|file',
- 'company' => 'required|string',
- 'email' => 'required|email',
- 'ico' => 'sometimes|string|nullable',
- 'dic' => 'sometimes|string|nullable',
- 'ic_dph' => 'sometimes|string|nullable',
- 'registration_notes' => 'sometimes|string|nullable',
- 'author' => 'required|string',
- 'address' => 'required|string',
- 'state' => 'required|string',
- 'city' => 'required|string',
- 'postal_code' => 'required|string',
- 'country' => 'required|string',
- 'phone' => 'required|string',
- 'bank' => 'required|string',
- 'iban' => 'required|string',
- 'swift' => 'required|string',
- ];
- }
-}
diff --git a/app/Http/Requests/Oasis/StoreInvoiceRequest.php b/app/Http/Requests/Oasis/StoreInvoiceRequest.php
deleted file mode 100644
index f5014058..00000000
--- a/app/Http/Requests/Oasis/StoreInvoiceRequest.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 'sometimes|string',
- 'invoice_number' => 'required|string',
- 'variable_number' => 'required|string',
- 'client' => 'sometimes|required',
- 'items' => 'required|string',
- 'discount_type' => 'sometimes|string',
- 'discount_rate' => 'sometimes|integer',
- 'delivery_at' => 'required|date',
- ];
- }
-}
diff --git a/app/Http/Resources/Oasis/InvoiceProfileCollection.php b/app/Http/Resources/Oasis/InvoiceProfileCollection.php
deleted file mode 100644
index eb868699..00000000
--- a/app/Http/Resources/Oasis/InvoiceProfileCollection.php
+++ /dev/null
@@ -1,22 +0,0 @@
- $this->collection,
- ];
- }
-}
diff --git a/app/Http/Resources/Oasis/InvoiceProfileResource.php b/app/Http/Resources/Oasis/InvoiceProfileResource.php
deleted file mode 100644
index 78970e6d..00000000
--- a/app/Http/Resources/Oasis/InvoiceProfileResource.php
+++ /dev/null
@@ -1,43 +0,0 @@
- [
- 'id' => $this->id,
- 'type' => 'invoice-profile',
- 'attributes' => [
- 'logo' => $this->logo,
- 'stamp' => $this->stamp,
- 'company' => $this->company,
- 'email' => $this->email,
- 'ico' => $this->ico,
- 'dic' => $this->dic,
- 'ic_dph' => $this->ic_dph,
- 'registration_notes' => $this->registration_notes,
- 'author' => $this->author,
- 'address' => $this->address,
- 'state' => $this->state,
- 'city' => $this->city,
- 'postal_code' => $this->postal_code,
- 'country' => $this->country,
- 'phone' => $this->phone,
- 'bank' => $this->bank,
- 'iban' => $this->iban,
- 'swift' => $this->swift,
- ],
- ],
- ];
- }
-}
diff --git a/app/Http/Resources/Oasis/OasisInvoiceCollection.php b/app/Http/Resources/Oasis/OasisInvoiceCollection.php
deleted file mode 100644
index 77f03342..00000000
--- a/app/Http/Resources/Oasis/OasisInvoiceCollection.php
+++ /dev/null
@@ -1,22 +0,0 @@
- $this->collection,
- ];
- }
-}
diff --git a/app/Http/Resources/Oasis/OasisInvoiceResource.php b/app/Http/Resources/Oasis/OasisInvoiceResource.php
deleted file mode 100644
index ed745b64..00000000
--- a/app/Http/Resources/Oasis/OasisInvoiceResource.php
+++ /dev/null
@@ -1,38 +0,0 @@
- [
- 'id' => $this->id,
- 'type' => 'invoice',
- 'attributes' => [
- 'name' => $this->client['name'] . ' ' . format_to_currency($this->total_net, $this->currency),
- 'invoice_number' => $this->invoice_number,
- 'variable_number' => $this->variable_number,
- 'invoice_type' => $this->invoice_type,
- 'delivery_at' => $this->delivery_at,
- 'items' => $this->items,
- 'discount_type' => $this->discount_type,
- 'discount_rate' => $this->discount_rate,
- 'client' => $this->client,
- 'total' => format_to_currency($this->total_net, $this->currency),
- 'file_url' => "/oasis/invoice/$this->id",
- 'mimetype' => 'pdf',
- 'created_at' => format_date($this->created_at, '%d. %B. %Y'),
- ],
- ],
- ];
- }
-}
diff --git a/app/Http/Resources/Oasis/OasisViewClientCollection.php b/app/Http/Resources/Oasis/OasisViewClientCollection.php
deleted file mode 100644
index e205acc3..00000000
--- a/app/Http/Resources/Oasis/OasisViewClientCollection.php
+++ /dev/null
@@ -1,20 +0,0 @@
-collection;
- }
-}
diff --git a/app/Http/Resources/Oasis/OasisViewClientResource.php b/app/Http/Resources/Oasis/OasisViewClientResource.php
deleted file mode 100644
index a4a6735c..00000000
--- a/app/Http/Resources/Oasis/OasisViewClientResource.php
+++ /dev/null
@@ -1,45 +0,0 @@
-whereClientId($this->id)
- ->sum('total_net');
-
- $total_invoices = \DB::table('invoices')
- ->whereClientId($this->id)
- ->count();
-
- return [
- 'id' => $this->id,
- 'type' => 'client',
- 'created_at' => format_date($this->created_at, '%d. %B %Y'),
-
- 'totalNet' => format_to_currency($total_net, 'CZK'),
- 'totalInvoices' => $total_invoices,
-
- 'avatar' => $this->avatar,
- 'name' => $this->name,
- 'email' => $this->email,
- 'phone_number' => $this->phone_number,
- 'address' => $this->address,
- 'city' => $this->city,
- 'postal_code' => $this->postal_code,
- 'country' => $this->country,
- 'ico' => $this->ico,
- 'dic' => $this->dic,
- 'ic_dph' => $this->ic_dph,
- ];
- }
-}
diff --git a/app/Http/Resources/Oasis/OasisViewInvoiceCollection.php b/app/Http/Resources/Oasis/OasisViewInvoiceCollection.php
deleted file mode 100644
index eacf5d1f..00000000
--- a/app/Http/Resources/Oasis/OasisViewInvoiceCollection.php
+++ /dev/null
@@ -1,20 +0,0 @@
-collection;
- }
-}
diff --git a/app/Http/Resources/Oasis/OasisViewInvoiceResource.php b/app/Http/Resources/Oasis/OasisViewInvoiceResource.php
deleted file mode 100644
index e57c0b50..00000000
--- a/app/Http/Resources/Oasis/OasisViewInvoiceResource.php
+++ /dev/null
@@ -1,29 +0,0 @@
- $this->id,
- 'client_id' => $this->client_id,
- 'name' => $this->client['name'] . ' ' . format_to_currency($this->total_net, $this->currency),
- 'invoice_number' => $this->invoice_number,
- 'total' => format_to_currency($this->total_net, $this->currency),
- 'file_url' => "/oasis/invoice/$this->id",
- 'client_name' => $this->client['name'],
- 'mimetype' => 'pdf',
- 'type' => 'invoice',
- 'created_at' => format_date($this->created_at, '%d. %B. %Y'),
- ];
- }
-}
diff --git a/app/Http/custom-helpers.php b/app/Http/custom-helpers.php
deleted file mode 100644
index a6327bef..00000000
--- a/app/Http/custom-helpers.php
+++ /dev/null
@@ -1,210 +0,0 @@
-user_id}/invoice-{$invoice->id}.pdf";
-}
-
-/**
- * Get only tax for single invoice item
- *
- * @param $item
- * @return float|int|string
- */
-function invoice_item_only_tax_price($item)
-{
- return ($item['price'] * $item['amount']) * ($item['tax_rate'] / 100);
-}
-
-/**
- * Get item price with tax for single invoice item
- *
- * @param $item
- * @return float|int|string
- */
-function invoice_item_with_tax_price($item)
-{
- return ($item['price'] * $item['amount']) * ($item['tax_rate'] / 100 + 1);
-}
-
-/**
- * @param $invoice
- * @return \Illuminate\Support\Collection
- */
-function invoice_tax_base($invoice)
-{
- $bag = collect([]);
-
- // Count tax base
- foreach ($invoice['items'] as $item) {
- if (! $bag->firstWhere('rate', $item['tax_rate'])) {
- $bag->push([
- 'rate' => $item['tax_rate'],
- 'total' => $item['price'] * $item['amount'],
- ]);
- } else {
- $bag->map(function ($bagItem) use ($item) {
- if ($bagItem['rate'] === $item['tax_rate']) {
- $bagItem['total'] += ($item['price'] * $item['amount']);
- }
- });
- }
- }
-
- // Count discount
- if ($invoice['discount_type']) {
- return $bag->map(function ($bagItem) use ($invoice) {
- if ($invoice['discount_type'] === 'percent') {
- $bagItem['total'] -= $bagItem['total'] * ($invoice['discount_rate'] / 100);
- }
-
- if ($invoice['discount_type'] === 'value') {
- $percentage_of_discount = $invoice['discount_rate'] / (invoice_total($invoice) + $invoice['discount_rate']);
-
- $bagItem['total'] -= $bagItem['total'] * $percentage_of_discount;
- }
-
- return $bagItem;
- });
- }
-
- return $bag;
-}
-
-/**
- * @param $invoice
- * @return \Illuminate\Support\Collection
- */
-function invoice_tax_summary($invoice)
-{
- $bag = collect([]);
-
- // Count tax base
- foreach ($invoice['items'] as $item) {
- if (! $bag->firstWhere('rate', $item['tax_rate'])) {
- $bag->push([
- 'rate' => $item['tax_rate'],
- 'total' => ($item['price'] * $item['amount']) * ($item['tax_rate'] / 100),
- ]);
- } else {
- $bag->map(function ($bagItem) use ($item) {
- if ($bagItem['rate'] === $item['tax_rate']) {
- $bagItem['total'] += ($item['price'] * $item['amount']) * ($item['tax_rate'] / 100);
- }
- });
- }
- }
-
- // Count discount
- if ($invoice['discount_type']) {
- return $bag->map(function ($bagItem) use ($invoice) {
- if ($invoice['discount_type'] === 'percent') {
- $bagItem['total'] -= $bagItem['total'] * ($invoice['discount_rate'] / 100);
- }
-
- if ($invoice['discount_type'] === 'value') {
- $percentage_of_discount = $invoice['discount_rate'] / (invoice_total($invoice) + $invoice['discount_rate']);
-
- $bagItem['total'] -= $bagItem['total'] * $percentage_of_discount;
- }
-
- return $bagItem;
- });
- }
-
- return $bag;
-}
-
-/**
- * @param $invoice
- * @return float|int|string
- */
-function invoice_total($invoice)
-{
- $total = 0;
-
- foreach ($invoice['items'] as $item) {
- $total_without_tax = $item['amount'] * $item['price'];
-
- if ($invoice['user']['ic_dph'] && $item['tax_rate']) {
- $total_without_tax += $total_without_tax * ($item['tax_rate'] / 100);
- }
-
- $total += $total_without_tax;
- }
-
- if ($invoice['discount_type']) {
- if ($invoice['discount_type'] === 'percent') {
- $total -= $total * ($invoice['discount_rate'] / 100);
- }
-
- if ($invoice['discount_type'] === 'value') {
- $total -= $invoice['discount_rate'];
- }
- }
-
- return $total;
-}
-
-/**
- * @param $invoice
- * @param false $format
- * @return float|int|string
- */
-function invoice_total_tax($invoice)
-{
- $total = 0;
-
- foreach ($invoice['items'] as $item) {
- $total += ($item['amount'] * $item['price']) * ($item['tax_rate'] / 100);
- }
-
- return $total;
-}
-
-/**
- * @param $value
- * @param string $currency
- * @param string $locale
- * @return string
- */
-function format_to_currency($value, $currency = 'CZK', $locale = 'cs')
-{
- $amount = round($value, 2) * 100;
-
- return Cashier::formatAmount((int) $amount, $currency, $locale);
-}
diff --git a/app/Http/helpers.php b/app/Http/helpers.php
index efd9777a..0fa39412 100644
--- a/app/Http/helpers.php
+++ b/app/Http/helpers.php
@@ -1,11 +1,10 @@
value ?? null;
-}
-
-/**
- * Get all app settings and return them as json
- */
-function get_settings_in_json()
-{
- return json_decode(
- Setting::all()
- ->pluck('value', 'name')
- ->toJson()
- );
-}
-
-/**
- * Check if setup wizard was passed
- *
- * @return string
- */
-function get_setup_status()
-{
- $setup_success = get_setting('setup_wizard_success');
-
- return boolval($setup_success) ? 'setup-done' : 'setup-disclaimer';
-}
-
-/**
- * Create paragraph from text
- *
- * @param $str
- * @return mixed|null|string|string[]
- */
-function add_paragraphs($str)
-{
- // Trim whitespace
- if (($str = trim($str)) === '') {
- return '';
+ return substr($name, 0, $len) . str_repeat('*', $len) . '@' . end($em);
}
-
- // Standardize newlines
- $str = str_replace(["\r\n", "\r"], "\n", $str);
-
- // Trim whitespace on each line
- $str = preg_replace('~^[ \t]+~m', '', $str);
- $str = preg_replace('~[ \t]+$~m', '', $str);
-
- // The following regexes only need to be executed if the string contains html
- if ($html_found = (strpos($str, '<') !== false)) {
- // Elements that should not be surrounded by p tags
- $no_p = '(?:p|div|article|header|aside|hgroup|canvas|output|progress|section|figcaption|audio|video|nav|figure|footer|video|details|main|menu|summary|h[1-6r]|ul|ol|li|blockquote|d[dlt]|pre|t[dhr]|t(?:able|body|foot|head)|c(?:aption|olgroup)|form|s(?:elect|tyle)|a(?:ddress|rea)|ma(?:p|th))';
-
- // Put at least two linebreaks before and after $no_p elements
- $str = preg_replace('~^<' . $no_p . '[^>]*+>~im', "\n$0", $str);
- $str = preg_replace('~' . $no_p . '\s*+>$~im', "$0\n", $str);
- }
-
- // Do the
magic!
- $str = '
' . trim($str) . '
';
- $str = preg_replace('~\n{2,}~', "\n\n", $str);
-
- // The following regexes only need to be executed if the string contains html
- if ($html_found !== false) {
- // Remove p tags around $no_p elements
- $str = preg_replace('~
(?=?' . $no_p . '[^>]*+>)~i', '', $str);
- $str = preg_replace('~(?' . $no_p . '[^>]*+>)
~i', '$1', $str);
- }
-
- // Convert single linebreaks to
- $str = preg_replace('~(?\n", $str);
-
- return $str;
}
-/**
- * Set environment value
- *
- * @param $key
- * @param $value
- * @return bool
- */
-function setEnvironmentValue(array $values)
-{
- $envFile = app()->environmentFilePath();
- $str = file_get_contents($envFile);
+if (! function_exists('get_setting')) {
+ /**
+ * Get single value from settings table
+ *
+ * @param $setting
+ * @return |null
+ */
+ function get_setting($setting)
+ {
+ return Setting::find($setting)->value ?? null;
+ }
+}
- if (count($values) > 0) {
- foreach ($values as $envKey => $envValue) {
- $str .= "\n"; // In case the searched variable is in the last line without \n
- $keyPosition = strpos($str, "{$envKey}=");
- $endOfLinePosition = strpos($str, "\n", $keyPosition);
- $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);
+if (! function_exists('get_settings_in_json')) {
+ /**
+ * Get all app settings and return them as json
+ */
+ function get_settings_in_json()
+ {
+ return json_decode(
+ Setting::all()
+ ->pluck('value', 'name')
+ ->toJson()
+ );
+ }
+}
- // If key does not exist, add it
- $str = str_replace($oldLine, "{$envKey}={$envValue}", $str);
+if (! function_exists('get_setup_status')) {
+ /**
+ * Check if setup wizard was passed
+ *
+ * @return string
+ */
+ function get_setup_status()
+ {
+ $setup_success = get_setting('setup_wizard_success');
+
+ return boolval($setup_success) ? 'setup-done' : 'setup-disclaimer';
+ }
+}
+
+if (! function_exists('add_paragraphs')) {
+ /**
+ * Create paragraph from text
+ *
+ * @param $str
+ * @return mixed|null|string|string[]
+ */
+ function add_paragraphs($str)
+ {
+ // Trim whitespace
+ if (($str = trim($str)) === '') {
+ return '';
+ }
+
+ // Standardize newlines
+ $str = str_replace(["\r\n", "\r"], "\n", $str);
+
+ // Trim whitespace on each line
+ $str = preg_replace('~^[ \t]+~m', '', $str);
+ $str = preg_replace('~[ \t]+$~m', '', $str);
+
+ // The following regexes only need to be executed if the string contains html
+ if ($html_found = (strpos($str, '<') !== false)) {
+ // Elements that should not be surrounded by p tags
+ $no_p = '(?:p|div|article|header|aside|hgroup|canvas|output|progress|section|figcaption|audio|video|nav|figure|footer|video|details|main|menu|summary|h[1-6r]|ul|ol|li|blockquote|d[dlt]|pre|t[dhr]|t(?:able|body|foot|head)|c(?:aption|olgroup)|form|s(?:elect|tyle)|a(?:ddress|rea)|ma(?:p|th))';
+
+ // Put at least two linebreaks before and after $no_p elements
+ $str = preg_replace('~^<' . $no_p . '[^>]*+>~im', "\n$0", $str);
+ $str = preg_replace('~' . $no_p . '\s*+>$~im', "$0\n", $str);
+ }
+
+ // Do the magic!
+ $str = '
' . trim($str) . '
';
+ $str = preg_replace('~\n{2,}~', "\n\n", $str);
+
+ // The following regexes only need to be executed if the string contains html
+ if ($html_found !== false) {
+ // Remove p tags around $no_p elements
+ $str = preg_replace('~
(?=?' . $no_p . '[^>]*+>)~i', '', $str);
+ $str = preg_replace('~(?' . $no_p . '[^>]*+>)
~i', '$1', $str);
+ }
+
+ // Convert single linebreaks to
+ $str = preg_replace('~(?\n", $str);
+
+ return $str;
+ }
+}
+
+if (! function_exists('setEnvironmentValue')) {
+ /**
+ * Set environment value
+ *
+ * @param array $values
+ * @return bool
+ */
+ function setEnvironmentValue(array $values): bool
+ {
+ $envFile = app()->environmentFilePath();
+ $str = file_get_contents($envFile);
+
+ if (count($values) > 0) {
+ foreach ($values as $envKey => $envValue) {
+ $str .= "\n"; // In case the searched variable is in the last line without \n
+ $keyPosition = strpos($str, "{$envKey}=");
+ $endOfLinePosition = strpos($str, "\n", $keyPosition);
+ $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);
+
+ // If key does not exist, add it
+ $str = str_replace($oldLine, "{$envKey}={$envValue}", $str);
+ }
+ }
+
+ $str = substr($str, 0, -1);
+
+ return ! (! file_put_contents($envFile, $str));
+ }
+}
+
+if (! function_exists('get_invoice_number')) {
+ /**
+ * Get invoice number
+ *
+ * @return string
+ */
+ function get_invoice_number()
+ {
+ $invoices = Invoice::all();
+
+ if ($invoices->isEmpty()) {
+ return now()->year . '001';
+ }
+
+ return (int) $invoices->last()->order + 1;
+ }
+}
+
+
+if (! function_exists('cache_forget_many')) {
+ /**
+ * Forget many cache keys at once
+ * @param $cache
+ */
+ function cache_forget_many($cache)
+ {
+ foreach ($cache as $item) {
+ \Illuminate\Support\Facades\Cache::forget($item);
}
}
-
- $str = substr($str, 0, -1);
-
- return ! (! file_put_contents($envFile, $str))
- ;
}
-/**
- * Get invoice number
- *
- * @return string
- */
-function get_invoice_number()
-{
- $invoices = \App\Invoice::all();
-
- if ($invoices->isEmpty()) {
- return now()->year . '001';
- }
-
- return (int) $invoices->last()->order + 1;
-}
-
-/**
- * Forget many cache keys at once
- * @param $cache
- */
-function cache_forget_many($cache)
-{
- foreach ($cache as $item) {
- \Illuminate\Support\Facades\Cache::forget($item);
+if (! function_exists('get_storage')) {
+ /**
+ * Get app version from config
+ *
+ * @return \Illuminate\Config\Repository|mixed
+ */
+ function get_storage()
+ {
+ return env('FILESYSTEM_DRIVER');
}
}
-/**
- * Get app version from config
- *
- * @return \Illuminate\Config\Repository|mixed
- */
-function get_storage()
-{
- return env('FILESYSTEM_DRIVER');
-}
-
-/**
- * Check if is running AWS s3 as storage
- *
- * @return bool
- */
-function is_storage_driver($driver)
-{
- if (is_array($driver)) {
- return in_array(config('filesystems.default'), $driver);
- }
-
- return config('filesystems.default') === $driver;
-}
-
-/**
- * Get app version from config
- *
- * @return \Illuminate\Config\Repository|mixed
- */
-function get_version()
-{
- return config('vuefilemanager.version');
-}
-
-/**
- * Check if is demo
- *
- * @return bool
- */
-function is_demo()
-{
- return config('vuefilemanager.is_demo');
-}
-
-/**
- * Check if is demo
- *
- * @param $email
- * @return mixed
- */
-function is_demo_account($email)
-{
- return config('vuefilemanager.is_demo') && $email === 'howdy@hi5ve.digital';
-}
-
-/**
- * Get folder or file item
- *
- * @param $type
- * @param $id
- * @return \Illuminate\Database\Eloquent\Builder|Model
- */
-function get_item($type, $id)
-{
- $model = strtolower($type) === 'folder' ? 'Folder' : 'File';
-
- return ("App\\Models\\$model")::find($id);
-}
-
-/**
- * Get shared token
- *
- * @param $token
- * @return \Illuminate\Database\Eloquent\Builder|Model
- */
-function get_shared($token)
-{
- return Share::whereToken($token)
- ->firstOrFail();
-}
-
-/**
- * Check if shared permission is editor
- *
- * @param $shared
- * @return bool
- */
-function is_editor($shared)
-{
- return $shared->permission === 'editor';
-}
-
-/**
- * Check if shared permission is visitor
- *
- * @param $shared
- * @return bool
- */
-function is_visitor($shared)
-{
- return $shared->permission === 'visitor';
-}
-
-/**
- * Store user avatar to storage
- *
- * @param $request
- * @param $name
- * @return string|null
- */
-function store_avatar($request, $name)
-{
- if (! $request->hasFile($name)) {
- return null;
- }
-
- $image = $request->file($name);
-
- // Store avatar
- $image_path = Str::random(16) . '-' . $image->getClientOriginalName();
-
- if (in_array($image->getClientMimeType(), ['image/gif', 'image/jpeg', 'image/jpg', 'image/png', 'image/webp'])) {
- // Create intervention image
- $img = Image::make($image->getRealPath());
-
- // Generate thumbnail
- $img->fit('150', '150')->stream();
-
- // Store thumbnail to disk
- Storage::put("avatars/$image_path", $img);
- }
-
- if ($image->getClientMimeType() === 'image/svg+xml') {
- Storage::putFileAs('avatars', $image, $image_path);
- }
-
- // Return path to image
- return "avatars/$image_path";
-}
-
-/**
- * Store system image
- *
- * @param $request
- * @param $name
- * @return string|null
- */
-function store_system_image($request, $name)
-{
- if (! $request->hasFile($name)) {
- return null;
- }
-
- $image = $request->file($name);
-
- // Store avatar
- $filename = Str::random(8) . '-' . str_replace(' ', '', $image->getClientOriginalName());
-
- // Store image to disk
- Storage::putFileAs('system', $image, $filename);
-
- // Return path to image
- return "system/$filename";
-}
-
-/**
- * Make input from request
- *
- * @param $request
- * @return array
- */
-function make_single_input($request)
-{
- // Create container
- $data = [];
-
- // Add data to array
- $data[$request->name] = $request->value;
-
- // Return input
- return $data;
-}
-
-/**
- * Format integer to gigabytes
- *
- * @param $gigabytes
- * @return string
- */
-function format_gigabytes($gigabytes)
-{
- if ($gigabytes >= 1000) {
- return Metric::gigabytes($gigabytes)->format('Tb/');
- }
-
- return Metric::gigabytes($gigabytes)->format('GB/');
-}
-
-/**
- * Format string to formated megabytes string
- *
- * @param $megabytes
- * @return string
- */
-function format_megabytes($megabytes)
-{
- if ($megabytes >= 1000) {
- return $megabytes / 1000 . 'GB';
- }
-
- if ($megabytes >= 1000000) {
- return $megabytes / 1000000 . 'TB';
- }
-
- return $megabytes . 'MB';
-}
-
-/**
- * Convert megabytes to bytes
- *
- * @param $megabytes
- * @return int|string
- */
-function format_bytes($megabytes)
-{
- return Metric::megabytes($megabytes)->numberOfBytes();
-}
-
-/**
- * Get storage usage in percent
- *
- * @param $used
- * @param $capacity
- * @return string
- */
-function get_storage_fill_percentage($used, $capacity)
-{
- // Format gigabytes to bytes
- $total = intval(Metric::gigabytes($capacity)->numberOfBytes());
-
- // Count progress
- if ($total == 0) {
- $progress = 100;
- } else {
- $progress = ($used * 100) / $total;
- }
-
- // Return in 2 decimal
- return number_format((float) $progress, 2, '.', '');
-}
-
-/**
- * Get user capacity fill by percentage
- *
- * @param $id
- * @param null $additionals
- * @return string
- */
-function user_storage_percentage($id, $additionals = null)
-{
- $user = User::findOrFail($id);
-
- $used = $user->used_capacity;
-
- if ($additionals) {
- $used = $user->used_capacity + $additionals;
- }
-
- return get_storage_fill_percentage($used, $user->settings->storage_capacity);
-}
-
-/**
- * Find all key values in recursive array
- *
- * @param array $array
- * @param $needle
- * @return array
- */
-function recursiveFind(array $array, $needle)
-{
- $iterator = new RecursiveArrayIterator($array);
- $recursive = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST);
- $aHitList = [];
-
- foreach ($recursive as $key => $value) {
- if ($key === $needle) {
- array_push($aHitList, $value);
+if (! function_exists('is_storage_driver')) {
+ /**
+ * Check if is running AWS s3 as storage
+ *
+ * @return bool
+ */
+ function is_storage_driver($driver)
+ {
+ if (is_array($driver)) {
+ return in_array(config('filesystems.default'), $driver);
}
+
+ return config('filesystems.default') === $driver;
}
-
- return $aHitList;
}
-/**
- * Get values which appears only once in array
- * @param $arr
- * @return array
- */
-function appeared_once($arr)
-{
- $array_count_values = array_count_values($arr);
-
- $single_time_comming_values_array = [];
-
- foreach ($array_count_values as $key => $val) {
- if ($val == 1) {
- $single_time_comming_values_array[] = $key;
- }
+if (! function_exists('get_version')) {
+ /**
+ * Get app version from config
+ *
+ * @return \Illuminate\Config\Repository|mixed
+ */
+ function get_version()
+ {
+ return config('vuefilemanager.version');
}
-
- return $single_time_comming_values_array;
}
-/**
- * @param $folders
- * @param string $by_column
- * @return array
- */
-function filter_folders_ids($folders, $by_column = 'id')
-{
- $folder_ids = recursiveFind($folders->toArray(), $by_column);
-
- return appeared_once($folder_ids);
-}
-
-/**
- * Format localized date
- *
- * @param $date
- * @param string $format
- * @return string
- */
-function format_date($date, $format = '%d. %B. %Y, %H:%M')
-{
- $start = Carbon::parse($date);
-
- return $start->formatLocalized($format);
-}
-
-/**
- * Get file type from mimetype
- *
- * @param $file_mimetype
- * @return string
- */
-function get_file_type($file_mimetype)
-{
- // Get mimetype from file
- $mimetype = explode('/', $file_mimetype);
-
- if (in_array($mimetype[0], ['image', 'video', 'audio'])) {
- return $mimetype[0];
+if (! function_exists('is_demo')) {
+ /**
+ * Check if is demo
+ *
+ * @return bool
+ */
+ function is_demo()
+ {
+ return config('vuefilemanager.is_demo');
}
-
- return 'file';
}
-/**
- * It map language translations as language key and language value
- *
- * @param $translations
- * @return mixed
- */
-function map_language_translations($translations)
-{
- return $translations->map(function ($string) {
- return [$string->key => $string->value];
- })->collapse();
-}
-
-/**
- * Get file type from mimetype
- *
- * @param $mimetype
- * @return mixed
- */
-function get_file_type_from_mimetype($mimetype)
-{
- return explode('/', $mimetype)[1];
-}
-
-/**
- * Format pretty name file
- *
- * @param $basename
- * @param $name
- * @param $mimetype
- * @return string
- */
-function get_pretty_name($basename, $name, $mimetype)
-{
- $file_extension = substr(strrchr($basename, '.'), 1);
-
- if (strpos($name, $file_extension) !== false) {
- return $name;
+if (! function_exists('is_demo_account')) {
+ /**
+ * Check if is demo
+ *
+ * @param $email
+ * @return mixed
+ */
+ function is_demo_account($email)
+ {
+ return config('vuefilemanager.is_demo') && $email === 'howdy@hi5ve.digital';
}
-
- if ($file_extension) {
- return $name . '.' . $file_extension;
- }
-
- return $name . '.' . $mimetype;
}
-/**
- * Get exif data from jpeg image
- *
- * @param $file
- * @return array|null
- */
-function get_image_meta_data($file)
-{
- if (get_file_type_from_mimetype($file->getMimeType()) === 'jpeg') {
- try {
- // Try to get the exif data
- return mb_convert_encoding(Image::make($file->getRealPath())->exif(), 'UTF8', 'UTF8');
- } catch (\Exception $e) {
+if (! function_exists('get_item')) {
+ /**
+ * Get folder or file item
+ *
+ * @param $type
+ * @param $id
+ * @return \Illuminate\Database\Eloquent\Builder|Model
+ */
+ function get_item($type, $id)
+ {
+ $model = strtolower($type) === 'folder' ? 'Folder' : 'File';
+
+ return ("App\\Models\\$model")::find($id);
+ }
+}
+
+if (! function_exists('get_shared')) {
+ /**
+ * Get shared token
+ *
+ * @param $token
+ * @return \Illuminate\Database\Eloquent\Builder|Model
+ */
+ function get_shared($token)
+ {
+ return Share::whereToken($token)
+ ->firstOrFail();
+ }
+}
+
+if (! function_exists('is_editor')) {
+ /**
+ * Check if shared permission is editor
+ *
+ * @param $shared
+ * @return bool
+ */
+ function is_editor($shared)
+ {
+ return $shared->permission === 'editor';
+ }
+}
+
+if (! function_exists('is_visitor')) {
+ /**
+ * Check if shared permission is visitor
+ *
+ * @param $shared
+ * @return bool
+ */
+ function is_visitor($shared)
+ {
+ return $shared->permission === 'visitor';
+ }
+}
+
+if (! function_exists('store_avatar')) {
+ /**
+ * Store user avatar to storage
+ *
+ * @param $request
+ * @param $name
+ * @return string|null
+ */
+ function store_avatar($request, $name)
+ {
+ if (! $request->hasFile($name)) {
return null;
}
+
+ $image = $request->file($name);
+
+ // Store avatar
+ $image_path = Str::random(16) . '-' . $image->getClientOriginalName();
+
+ if (in_array($image->getClientMimeType(), ['image/gif', 'image/jpeg', 'image/jpg', 'image/png', 'image/webp'])) {
+ // Create intervention image
+ $img = Image::make($image->getRealPath());
+
+ // Generate thumbnail
+ $img->fit('150', '150')->stream();
+
+ // Store thumbnail to disk
+ Storage::put("avatars/$image_path", $img);
+ }
+
+ if ($image->getClientMimeType() === 'image/svg+xml') {
+ Storage::putFileAs('avatars', $image, $image_path);
+ }
+
+ // Return path to image
+ return "avatars/$image_path";
}
}
-/**
- * @return Collection
- */
-function get_default_language_translations()
-{
- return collect([
- config('language-translations.extended'),
- config('language-translations.regular'),
- config('custom-language-translations'),
- ])->collapse();
+
+if (! function_exists('store_system_image')) {
+ /**
+ * Store system image
+ *
+ * @param $request
+ * @param $name
+ * @return string|null
+ */
+ function store_system_image($request, $name)
+ {
+ if (! $request->hasFile($name)) {
+ return null;
+ }
+
+ $image = $request->file($name);
+
+ // Store avatar
+ $filename = Str::random(8) . '-' . str_replace(' ', '', $image->getClientOriginalName());
+
+ // Store image to disk
+ Storage::putFileAs('system', $image, $filename);
+
+ // Return path to image
+ return "system/$filename";
+ }
}
-/**
- * Check if app is in dev mode
- *
- * @return bool
- */
-function is_dev()
-{
- return env('APP_ENV') === 'local';
+if (! function_exists('make_single_input')) {
+ /**
+ * Make input from request
+ *
+ * @param $request
+ * @return array
+ */
+ function make_single_input($request)
+ {
+ // Create container
+ $data = [];
+
+ // Add data to array
+ $data[$request->name] = $request->value;
+
+ // Return input
+ return $data;
+ }
}
-/**
- * @param $str
- * @return bool
- */
-function seems_utf8($str)
-{
- $length = strlen($str);
+if (! function_exists('format_gigabytes')) {
+ /**
+ * Format integer to gigabytes
+ *
+ * @param $gigabytes
+ * @return string
+ */
+ function format_gigabytes($gigabytes)
+ {
+ if ($gigabytes >= 1000) {
+ return Metric::gigabytes($gigabytes)->format('Tb/');
+ }
- for ($i = 0; $i < $length; $i++) {
- $c = ord($str[$i]);
+ return Metric::gigabytes($gigabytes)->format('GB/');
+ }
+}
- if ($c < 0x80) {
- $n = 0;
- } # 0bbbbbbb
- elseif (($c & 0xE0) == 0xC0) {
- $n = 1;
- } # 110bbbbb
- elseif (($c & 0xF0) == 0xE0) {
- $n = 2;
- } # 1110bbbb
- elseif (($c & 0xF8) == 0xF0) {
- $n = 3;
- } # 11110bbb
- elseif (($c & 0xFC) == 0xF8) {
- $n = 4;
- } # 111110bb
- elseif (($c & 0xFE) == 0xFC) {
- $n = 5;
- } # 1111110b
- else {
- return false;
- } # Does not match any model
+if (! function_exists('format_megabytes')) {
+ /**
+ * Format string to formated megabytes string
+ *
+ * @param $megabytes
+ * @return string
+ */
+ function format_megabytes($megabytes)
+ {
+ if ($megabytes >= 1000) {
+ return $megabytes / 1000 . 'GB';
+ }
- for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?
- if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80)) {
- return false;
+ if ($megabytes >= 1000000) {
+ return $megabytes / 1000000 . 'TB';
+ }
+
+ return $megabytes . 'MB';
+ }
+}
+
+if (! function_exists('format_bytes')) {
+ /**
+ * Convert megabytes to bytes
+ *
+ * @param $megabytes
+ * @return int|string
+ */
+ function format_bytes($megabytes)
+ {
+ return Metric::megabytes($megabytes)->numberOfBytes();
+ }
+}
+
+if (! function_exists('get_storage_fill_percentage')) {
+ /**
+ * Get storage usage in percent
+ *
+ * @param $used
+ * @param $capacity
+ * @return string
+ */
+ function get_storage_fill_percentage($used, $capacity)
+ {
+ // Format gigabytes to bytes
+ $total = intval(Metric::gigabytes($capacity)->numberOfBytes());
+
+ // Count progress
+ if ($total == 0) {
+ $progress = 100;
+ } else {
+ $progress = ($used * 100) / $total;
+ }
+
+ // Return in 2 decimal
+ return number_format((float) $progress, 2, '.', '');
+ }
+}
+
+if (! function_exists('user_storage_percentage')) {
+ /**
+ * Get user capacity fill by percentage
+ *
+ * @param $id
+ * @param null $additionals
+ * @return string
+ */
+ function user_storage_percentage($id, $additionals = null)
+ {
+ $user = User::findOrFail($id);
+
+ $used = $user->used_capacity;
+
+ if ($additionals) {
+ $used = $user->used_capacity + $additionals;
+ }
+
+ return get_storage_fill_percentage($used, $user->settings->storage_capacity);
+ }
+}
+
+if (! function_exists('recursiveFind')) {
+ /**
+ * Find all key values in recursive array
+ *
+ * @param array $array
+ * @param $needle
+ * @return array
+ */
+ function recursiveFind(array $array, $needle)
+ {
+ $iterator = new RecursiveArrayIterator($array);
+ $recursive = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST);
+ $aHitList = [];
+
+ foreach ($recursive as $key => $value) {
+ if ($key === $needle) {
+ array_push($aHitList, $value);
+ }
+ }
+
+ return $aHitList;
+ }
+}
+
+if (! function_exists('appeared_once')) {
+ /**
+ * Get values which appears only once in array
+ * @param $arr
+ * @return array
+ */
+ function appeared_once($arr)
+ {
+ $array_count_values = array_count_values($arr);
+
+ $single_time_comming_values_array = [];
+
+ foreach ($array_count_values as $key => $val) {
+ if ($val == 1) {
+ $single_time_comming_values_array[] = $key;
+ }
+ }
+
+ return $single_time_comming_values_array;
+ }
+}
+
+if (! function_exists('filter_folders_ids')) {
+ /**
+ * @param $folders
+ * @param string $by_column
+ * @return array
+ */
+ function filter_folders_ids($folders, $by_column = 'id')
+ {
+ $folder_ids = recursiveFind($folders->toArray(), $by_column);
+
+ return appeared_once($folder_ids);
+ }
+}
+
+if (! function_exists('format_date')) {
+ /**
+ * Format localized date
+ *
+ * @param $date
+ * @param string $format
+ * @return string
+ */
+ function format_date($date, $format = '%d. %B. %Y, %H:%M')
+ {
+ $start = Carbon::parse($date);
+
+ return $start->formatLocalized($format);
+ }
+}
+
+if (! function_exists('get_file_type')) {
+ /**
+ * Get file type from mimetype
+ *
+ * @param $file_mimetype
+ * @return string
+ */
+ function get_file_type($file_mimetype)
+ {
+ // Get mimetype from file
+ $mimetype = explode('/', $file_mimetype);
+
+ if (in_array($mimetype[0], ['image', 'video', 'audio'])) {
+ return $mimetype[0];
+ }
+
+ return 'file';
+ }
+}
+
+if (! function_exists('map_language_translations')) {
+ /**
+ * It map language translations as language key and language value
+ *
+ * @param $translations
+ * @return mixed
+ */
+ function map_language_translations($translations)
+ {
+ return $translations->map(function ($string) {
+ return [$string->key => $string->value];
+ })->collapse();
+ }
+}
+
+if (! function_exists('get_file_type_from_mimetype')) {
+ /**
+ * Get file type from mimetype
+ *
+ * @param $mimetype
+ * @return mixed
+ */
+ function get_file_type_from_mimetype($mimetype)
+ {
+ return explode('/', $mimetype)[1];
+ }
+}
+
+if (! function_exists('get_pretty_name')) {
+ /**
+ * Format pretty name file
+ *
+ * @param $basename
+ * @param $name
+ * @param $mimetype
+ * @return string
+ */
+ function get_pretty_name($basename, $name, $mimetype)
+ {
+ $file_extension = substr(strrchr($basename, '.'), 1);
+
+ if (strpos($name, $file_extension) !== false) {
+ return $name;
+ }
+
+ if ($file_extension) {
+ return $name . '.' . $file_extension;
+ }
+
+ return $name . '.' . $mimetype;
+ }
+}
+
+if (! function_exists('get_image_meta_data')) {
+ /**
+ * Get exif data from jpeg image
+ *
+ * @param $file
+ * @return array|null
+ */
+ function get_image_meta_data($file)
+ {
+ if (get_file_type_from_mimetype($file->getMimeType()) === 'jpeg') {
+ try {
+ // Try to get the exif data
+ return mb_convert_encoding(Image::make($file->getRealPath())->exif(), 'UTF8', 'UTF8');
+ } catch (\Exception $e) {
+ return null;
}
}
}
-
- return true;
}
-/**
- * Converts all accent characters to ASCII characters.
- *
- * If there are no accent characters, then the string given is just returned.
- *
- * @param string $string Text that might have accent characters
- * @return string Filtered string with replaced "nice" characters.
- */
-function remove_accents($string)
-{
- if (! preg_match('/[\x80-\xff]/', $string)) {
+if (! function_exists('get_default_language_translations')) {
+ /**
+ * @return Collection
+ */
+ function get_default_language_translations()
+ {
+ return collect([
+ config('language-translations.extended'),
+ config('language-translations.regular'),
+ config('custom-language-translations'),
+ ])->collapse();
+ }
+}
+
+if (! function_exists('is_dev')) {
+ /**
+ * Check if app is in dev mode
+ *
+ * @return bool
+ */
+ function is_dev()
+ {
+ return env('APP_ENV') === 'local';
+ }
+}
+
+if (! function_exists('seems_utf8')) {
+ /**
+ * @param $str
+ * @return bool
+ */
+ function seems_utf8($str)
+ {
+ $length = strlen($str);
+
+ for ($i = 0; $i < $length; $i++) {
+ $c = ord($str[$i]);
+
+ if ($c < 0x80) {
+ $n = 0;
+ } # 0bbbbbbb
+ elseif (($c & 0xE0) == 0xC0) {
+ $n = 1;
+ } # 110bbbbb
+ elseif (($c & 0xF0) == 0xE0) {
+ $n = 2;
+ } # 1110bbbb
+ elseif (($c & 0xF8) == 0xF0) {
+ $n = 3;
+ } # 11110bbb
+ elseif (($c & 0xFC) == 0xF8) {
+ $n = 4;
+ } # 111110bb
+ elseif (($c & 0xFE) == 0xFC) {
+ $n = 5;
+ } # 1111110b
+ else {
+ return false;
+ } # Does not match any model
+
+ for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?
+ if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+}
+
+if (! function_exists('remove_accents')) {
+ /**
+ * Converts all accent characters to ASCII characters.
+ *
+ * If there are no accent characters, then the string given is just returned.
+ *
+ * @param string $string Text that might have accent characters
+ * @return string Filtered string with replaced "nice" characters.
+ */
+ function remove_accents($string)
+ {
+ if (! preg_match('/[\x80-\xff]/', $string)) {
+ return $string;
+ }
+
+ if (seems_utf8($string)) {
+ $chars = [
+ // Decompositions for Latin-1 Supplement
+ chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',
+ chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',
+ chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',
+ chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',
+ chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',
+ chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',
+ chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',
+ chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',
+ chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',
+ chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',
+ chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',
+ chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',
+ chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',
+ chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',
+ chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',
+ chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',
+ chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',
+ chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',
+ chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',
+ chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',
+ chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',
+ chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',
+ chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',
+ chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',
+ chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',
+ chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',
+ chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',
+ chr(195) . chr(191) => 'y',
+ // Decompositions for Latin Extended-A
+ chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',
+ chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',
+ chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',
+ chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',
+ chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',
+ chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',
+ chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',
+ chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',
+ chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',
+ chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',
+ chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',
+ chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',
+ chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',
+ chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',
+ chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',
+ chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',
+ chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',
+ chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',
+ chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',
+ chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',
+ chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',
+ chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',
+ chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',
+ chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',
+ chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',
+ chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',
+ chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',
+ chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',
+ chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',
+ chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',
+ chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',
+ chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',
+ chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',
+ chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',
+ chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',
+ chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',
+ chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',
+ chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',
+ chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',
+ chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',
+ chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',
+ chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',
+ chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',
+ chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',
+ chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',
+ chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',
+ chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',
+ chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',
+ chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',
+ chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',
+ chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',
+ chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',
+ chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',
+ chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',
+ chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',
+ chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',
+ chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',
+ chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',
+ chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',
+ chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',
+ chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',
+ chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',
+ chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',
+ chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',
+ // Euro Sign
+ chr(226) . chr(130) . chr(172) => 'E',
+ // GBP (Pound) Sign
+ chr(194) . chr(163) => '', ];
+
+ $string = strtr($string, $chars);
+ } else {
+ // Assume ISO-8859-1 if not UTF-8
+ $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158)
+ . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194)
+ . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202)
+ . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210)
+ . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218)
+ . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227)
+ . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235)
+ . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243)
+ . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251)
+ . chr(252) . chr(253) . chr(255);
+
+ $chars['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy';
+
+ $string = strtr($string, $chars['in'], $chars['out']);
+ $double_chars['in'] = [chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)];
+ $double_chars['out'] = ['OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'];
+ $string = str_replace($double_chars['in'], $double_chars['out'], $string);
+ }
+
return $string;
}
-
- if (seems_utf8($string)) {
- $chars = [
- // Decompositions for Latin-1 Supplement
- chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',
- chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',
- chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',
- chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',
- chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',
- chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',
- chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',
- chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',
- chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',
- chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',
- chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',
- chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',
- chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',
- chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',
- chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',
- chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',
- chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',
- chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',
- chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',
- chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',
- chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',
- chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',
- chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',
- chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',
- chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',
- chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',
- chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',
- chr(195) . chr(191) => 'y',
- // Decompositions for Latin Extended-A
- chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',
- chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',
- chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',
- chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',
- chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',
- chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',
- chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',
- chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',
- chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',
- chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',
- chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',
- chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',
- chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',
- chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',
- chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',
- chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',
- chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',
- chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',
- chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',
- chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',
- chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',
- chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',
- chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',
- chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',
- chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',
- chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',
- chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',
- chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',
- chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',
- chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',
- chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',
- chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',
- chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',
- chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',
- chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',
- chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',
- chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',
- chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',
- chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',
- chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',
- chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',
- chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',
- chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',
- chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',
- chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',
- chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',
- chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',
- chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',
- chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',
- chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',
- chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',
- chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',
- chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',
- chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',
- chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',
- chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',
- chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',
- chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',
- chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',
- chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',
- chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',
- chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',
- chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',
- chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',
- // Euro Sign
- chr(226) . chr(130) . chr(172) => 'E',
- // GBP (Pound) Sign
- chr(194) . chr(163) => '', ];
-
- $string = strtr($string, $chars);
- } else {
- // Assume ISO-8859-1 if not UTF-8
- $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158)
- . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194)
- . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202)
- . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210)
- . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218)
- . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227)
- . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235)
- . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243)
- . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251)
- . chr(252) . chr(253) . chr(255);
-
- $chars['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy';
-
- $string = strtr($string, $chars['in'], $chars['out']);
- $double_chars['in'] = [chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)];
- $double_chars['out'] = ['OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'];
- $string = str_replace($double_chars['in'], $double_chars['out'], $string);
- }
-
- return $string;
}
-/**
- * Get all files from folder and get their folder location in VueFileManager directories
- *
- * @param $folders
- * @param null $files
- * @param array $path
- * @return array
- */
-function get_files_for_zip($folders, $files, $path = [])
-{
- // Return file list
- if (! isset($folders->folders)) {
- return $files->unique()->values()->all();
- }
+if (! function_exists('get_files_for_zip')) {
+ /**
+ * Get all files from folder and get their folder location in VueFileManager directories
+ *
+ * @param $folders
+ * @param null $files
+ * @param array $path
+ * @return array
+ */
+ function get_files_for_zip($folders, $files, $path = [])
+ {
+ // Return file list
+ if (! isset($folders->folders)) {
+ return $files->unique()->values()->all();
+ }
- // Push file path
- array_push($path, $folders->name);
+ // Push file path
+ array_push($path, $folders->name);
- // Push file to collection
- $folders->files->each(function ($file) use ($files, $path) {
- $files->push([
- 'name' => $file->name,
- 'basename' => $file->basename,
- 'mimetype' => $file->mimetype,
- 'folder_path' => implode('/', $path),
- ]);
- });
-
- // Get all children folders and folders within
- if ($folders->folders->isNotEmpty()) {
- $folders->folders->map(function ($folder) use ($files, $path) {
- return get_files_for_zip($folder, $files, $path);
+ // Push file to collection
+ $folders->files->each(function ($file) use ($files, $path) {
+ $files->push([
+ 'name' => $file->name,
+ 'basename' => $file->basename,
+ 'mimetype' => $file->mimetype,
+ 'folder_path' => implode('/', $path),
+ ]);
});
- }
- return get_files_for_zip($folders->folders->first(), $files, $path);
-}
-
-/**
- * Set time by user timezone GMT
- *
- * @param $time
- * @return Carbon
- */
-function set_time_by_user_timezone($time)
-{
- $user = Auth::user();
-
- if ($user) {
- $time_zone = intval($user->settings->timezone * 60 ?? null);
-
- return Carbon::parse($time)->addMinutes($time_zone ?? 0);
- }
-
- return Carbon::parse($time);
-}
-
-/**
- * Translate the given message.
- *
- * @param $key
- * @param null $values
- * @return string|string[]
- */
-function __t($key, $values = null)
-{
- // Get current locale
- $locale = cache()->rememberForever('language', function () {
- try {
- return get_setting('language') ?? 'en';
- } catch (QueryException $e) {
- return 'en';
+ // Get all children folders and folders within
+ if ($folders->folders->isNotEmpty()) {
+ $folders->folders->map(function ($folder) use ($files, $path) {
+ return get_files_for_zip($folder, $files, $path);
+ });
}
- });
- // Get language strings
- $strings = cache()->rememberForever("language-translations-$locale", function () use ($locale) {
- try {
- return Language::whereLocale($locale)->first()->languageTranslations ?? get_default_language_translations();
- } catch (QueryException $e) {
- return get_default_language_translations();
- }
- });
-
- // Find the string by key
- $string = $strings->get($key)
- ? $strings->get($key)
- : $strings->firstWhere('key', $key)->value;
-
- if ($values) {
- return replace_occurrence($string, collect($values));
+ return get_files_for_zip($folders->folders->first(), $files, $path);
}
-
- return $string;
}
-/**
- * Replace string occurrence in __t() by their values
- *
- * @param $string
- * @param $values
- * @return string|string[]
- */
-function replace_occurrence($string, $values)
-{
- $occurrences = $values->map(function ($message, $key) {
- return [
- 'key' => ":$key",
- 'message' => $message,
- ];
- });
+if (! function_exists('set_time_by_user_timezone')) {
+ /**
+ * Set time by user timezone GMT
+ *
+ * @param $time
+ * @return Carbon
+ */
+ function set_time_by_user_timezone($time)
+ {
+ $user = Auth::user();
- return str_ireplace(
- $occurrences->pluck('key')->toArray(),
- $occurrences->pluck('message')->toArray(),
- $string
- );
+ if ($user) {
+ $time_zone = intval($user->settings->timezone * 60 ?? null);
+
+ return Carbon::parse($time)->addMinutes($time_zone ?? 0);
+ }
+
+ return Carbon::parse($time);
+ }
+}
+
+if (! function_exists('__t')) {
+ /**
+ * Translate the given message.
+ *
+ * @param $key
+ * @param null $values
+ * @return string|string[]
+ */
+ function __t($key, $values = null)
+ {
+ // Get current locale
+ $locale = cache()->rememberForever('language', function () {
+ try {
+ return get_setting('language') ?? 'en';
+ } catch (QueryException $e) {
+ return 'en';
+ }
+ });
+
+ // Get language strings
+ $strings = cache()->rememberForever("language-translations-$locale", function () use ($locale) {
+ try {
+ return Language::whereLocale($locale)->first()->languageTranslations ?? get_default_language_translations();
+ } catch (QueryException $e) {
+ return get_default_language_translations();
+ }
+ });
+
+ // Find the string by key
+ $string = $strings->get($key)
+ ? $strings->get($key)
+ : $strings->firstWhere('key', $key)->value;
+
+ if ($values) {
+ return replace_occurrence($string, collect($values));
+ }
+
+ return $string;
+ }
+}
+
+if (! function_exists('replace_occurrence')) {
+ /**
+ * Replace string occurrence in __t() by their values
+ *
+ * @param $string
+ * @param $values
+ * @return string|string[]
+ */
+ function replace_occurrence($string, $values)
+ {
+ $occurrences = $values->map(function ($message, $key) {
+ return [
+ 'key' => ":$key",
+ 'message' => $message,
+ ];
+ });
+
+ return str_ireplace(
+ $occurrences->pluck('key')->toArray(),
+ $occurrences->pluck('message')->toArray(),
+ $string
+ );
+ }
}
diff --git a/app/Models/Oasis/Client.php b/app/Models/Oasis/Client.php
deleted file mode 100644
index eef17912..00000000
--- a/app/Models/Oasis/Client.php
+++ /dev/null
@@ -1,96 +0,0 @@
-attributes['avatar'] && ! is_storage_driver('local')) {
- return Storage::temporaryUrl($this->attributes['avatar'], now()->addDay());
- }
-
- // Get avatar from local storage
- if ($this->attributes['avatar']) {
- return url('/' . $this->attributes['avatar']);
- }
-
- return url('/assets/images/default-avatar.png');
- }
-
- public function user()
- {
- return $this->hasOne(User::class, 'id', 'user_id');
- }
-
- public function invoices()
- {
- return $this->hasMany(Invoice::class);
- }
-
- /**
- * Index file
- *
- * @return array
- */
- public function toSearchableArray()
- {
- $array = $this->toArray();
-
- $client_name = Str::slug($array['name'], ' ');
- $client_email = Str::slug($array['email'], ' ');
-
- return [
- 'id' => $this->id,
- 'clientName' => $array['name'],
- 'clientNameNgrams' => utf8_encode((new TNTIndexer)->buildTrigrams(implode(', ', [$client_name]))),
- 'clientEmail' => $array['email'],
- 'clientEmailNgrams' => utf8_encode((new TNTIndexer)->buildTrigrams(implode(', ', [$client_email]))),
- ];
- }
-
- protected static function boot()
- {
- parent::boot();
-
- static::creating(function ($client) {
- $client->id = (string) Str::uuid();
- });
-
- static::deleting(function ($client) {
- if ($client->getRawOriginal('avatar')) {
- Storage::delete($client->getRawOriginal('avatar'));
- }
- });
- }
-}
diff --git a/app/Models/Oasis/Invoice.php b/app/Models/Oasis/Invoice.php
deleted file mode 100644
index 32a2af9e..00000000
--- a/app/Models/Oasis/Invoice.php
+++ /dev/null
@@ -1,84 +0,0 @@
- 'array',
- 'user' => 'array',
- 'client' => 'array',
- ];
-
- public $guarded = [
- 'id',
- ];
-
- public $sortable = [
- 'invoice_number',
- 'created_at',
- 'total_net',
- ];
-
- public $incrementing = false;
-
- protected $keyType = 'string';
-
- public function author()
- {
- return $this->hasOne(User::class, 'id', 'user_id');
- }
-
- public function client()
- {
- return $this->hasOne(Client::class, 'id', 'user_id');
- }
-
- public function toSearchableArray()
- {
- $array = $this->toArray();
-
- $client_name = Str::slug($array['client']['name'], ' ');
-
- return [
- 'id' => $this->id,
- 'clientName' => $array['client']['name'],
- 'clientNameNgrams' => utf8_encode((new TNTIndexer)->buildTrigrams(implode(', ', [$client_name]))),
- 'invoiceNumber' => $array['invoice_number'],
- 'invoiceNumberNgrams' => utf8_encode((new TNTIndexer)->buildTrigrams(implode(', ', [$array['invoice_number']]))),
- ];
- }
-
- protected static function boot()
- {
- parent::boot();
-
- static::creating(function ($invoice) {
- $invoice->id = (string) Str::uuid();
-
- $invoice->total_net = invoice_total($invoice);
- $invoice->total_tax = invoice_total_tax($invoice);
-
- $invoice->currency = 'CZK';
- });
-
- static::updating(function ($invoice) {
- $invoice->total_net = invoice_total($invoice);
- $invoice->total_tax = invoice_total_tax($invoice);
- });
-
- static::deleting(function ($invoice) {
- Storage::delete(invoice_path($invoice));
- });
- }
-}
diff --git a/app/Models/Oasis/InvoiceProfile.php b/app/Models/Oasis/InvoiceProfile.php
deleted file mode 100644
index 1a3aff75..00000000
--- a/app/Models/Oasis/InvoiceProfile.php
+++ /dev/null
@@ -1,32 +0,0 @@
-hasOne(User::class, 'id', 'user_id');
- }
-
- protected static function boot()
- {
- parent::boot();
-
- static::creating(function ($invoice) {
- $invoice->id = (string) Str::uuid();
- });
- }
-}
diff --git a/app/Notifications/Oasis/InvoiceDeliveryNotification.php b/app/Notifications/Oasis/InvoiceDeliveryNotification.php
deleted file mode 100644
index 07c6e8c9..00000000
--- a/app/Notifications/Oasis/InvoiceDeliveryNotification.php
+++ /dev/null
@@ -1,68 +0,0 @@
-user = $user;
- $this->invoice = $invoice;
- }
-
- /**
- * Get the notification's delivery channels.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function via($notifiable)
- {
- return ['mail'];
- }
-
- /**
- * Get the mail representation of the notification.
- *
- * @param mixed $notifiable
- * @return \Illuminate\Notifications\Messages\MailMessage
- */
- public function toMail($notifiable)
- {
- return (new MailMessage)
- ->subject(__t('in.notify.subject', ['company' => $this->user->invoiceProfile->company]))
- ->greeting(__t('mail_greeting'))
- ->line(__t('in.notify.message', ['company' => $this->user->invoiceProfile->company]))
- ->salutation(__t('mail_salutation'))
- ->attach(storage_path('app/' . invoice_path($this->invoice)), [
- 'as' => 'name.pdf',
- 'mime' => 'application/pdf',
- ]);
- }
-
- /**
- * Get the array representation of the notification.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function toArray($notifiable)
- {
- return [
- ];
- }
-}
diff --git a/app/Traits/Oasis.php b/app/Traits/Oasis.php
index c97a26ad..7b2b252f 100644
--- a/app/Traits/Oasis.php
+++ b/app/Traits/Oasis.php
@@ -1,9 +1,6 @@
hasOne(SubscriptionRequest::class);
}
-
- public function invoiceProfile()
- {
- return $this->hasOne(InvoiceProfile::class);
- }
-
- public function clients()
- {
- return $this->hasMany(Client::class, 'user_id', 'id')
- ->orderByDesc('created_at');
- }
-
- public function regularInvoices()
- {
- return $this->hasMany(Invoice::class)->whereInvoiceType('regular-invoice')->orderByDesc('created_at');
- }
-
- public function advanceInvoices()
- {
- return $this->hasMany(Invoice::class)->whereInvoiceType('advance-invoice')->orderByDesc('created_at');
- }
}
diff --git a/composer.json b/composer.json
index 756d4249..0efa3096 100644
--- a/composer.json
+++ b/composer.json
@@ -35,7 +35,8 @@
"spatie/laravel-backup": "^6.15",
"spatie/laravel-tail": "^4.3",
"teamtnt/laravel-scout-tntsearch-driver": "^11.1.0",
- "vimeo/psalm": "^4.7"
+ "vimeo/psalm": "^4.7",
+ "makingcg/vuefilemanager-invoicing": "dev-master"
},
"require-dev": {
"ext-json": "*",
@@ -46,6 +47,11 @@
"nunomaduro/collision": "^5.3.0",
"phpunit/phpunit": "^9.5.2"
},
+ "repositories": [{
+ "type": "path",
+ "url": "../vuefilemanager-invoicing"
+ }
+ ],
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
diff --git a/composer.lock b/composer.lock
index eec59d0f..61fdb920 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "00cbdcc8589eda0ebebb68616acae12c",
+ "content-hash": "78711ace16bbb77d8e0a9381e7984e03",
"packages": [
{
"name": "amphp/amp",
@@ -230,16 +230,16 @@
},
{
"name": "aws/aws-sdk-php",
- "version": "3.180.6",
+ "version": "3.181.1",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "1a836be14ba664ea11eb965dec77715e9e607013"
+ "reference": "0829df420170e4994767860290a69487a18555f7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1a836be14ba664ea11eb965dec77715e9e607013",
- "reference": "1a836be14ba664ea11eb965dec77715e9e607013",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0829df420170e4994767860290a69487a18555f7",
+ "reference": "0829df420170e4994767860290a69487a18555f7",
"shasum": ""
},
"require": {
@@ -314,9 +314,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.180.6"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.181.1"
},
- "time": "2021-05-10T18:17:07+00:00"
+ "time": "2021-05-12T18:13:31+00:00"
},
{
"name": "bacon/bacon-qr-code",
@@ -2997,16 +2997,16 @@
},
{
"name": "laravel/cashier",
- "version": "v12.13.0",
+ "version": "v12.13.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/cashier-stripe.git",
- "reference": "f1a7d5ffce278bf9c85cd3c1b86c45d688f3bf00"
+ "reference": "532089a487dd09c6fa5adaf9c0088715a7623e48"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/cashier-stripe/zipball/f1a7d5ffce278bf9c85cd3c1b86c45d688f3bf00",
- "reference": "f1a7d5ffce278bf9c85cd3c1b86c45d688f3bf00",
+ "url": "https://api.github.com/repos/laravel/cashier-stripe/zipball/532089a487dd09c6fa5adaf9c0088715a7623e48",
+ "reference": "532089a487dd09c6fa5adaf9c0088715a7623e48",
"shasum": ""
},
"require": {
@@ -3071,7 +3071,7 @@
"issues": "https://github.com/laravel/cashier/issues",
"source": "https://github.com/laravel/cashier"
},
- "time": "2021-04-27T17:42:05+00:00"
+ "time": "2021-05-11T20:52:30+00:00"
},
{
"name": "laravel/fortify",
@@ -3138,16 +3138,16 @@
},
{
"name": "laravel/framework",
- "version": "v8.40.0",
+ "version": "v8.41.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "a654897ad7f97aea9d7ef292803939798c4a02a4"
+ "reference": "05417155d886df8710e55c84e12622b52d83c47c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/a654897ad7f97aea9d7ef292803939798c4a02a4",
- "reference": "a654897ad7f97aea9d7ef292803939798c4a02a4",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/05417155d886df8710e55c84e12622b52d83c47c",
+ "reference": "05417155d886df8710e55c84e12622b52d83c47c",
"shasum": ""
},
"require": {
@@ -3255,7 +3255,7 @@
"phpunit/phpunit": "Required to use assertions and run tests (^8.5.8|^9.3.3).",
"predis/predis": "Required to use the predis connector (^1.1.2).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
- "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0).",
+ "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0).",
"symfony/cache": "Required to PSR-6 cache bridge (^5.1.4).",
"symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).",
@@ -3302,20 +3302,20 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2021-04-28T14:38:56+00:00"
+ "time": "2021-05-11T14:00:02+00:00"
},
{
"name": "laravel/sanctum",
- "version": "v2.10.0",
+ "version": "v2.11.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/sanctum.git",
- "reference": "a08cfee365c6b6df3e91c8f43b92f7163ffc8a94"
+ "reference": "3ed8f60dafef026acc21733366a08746a7bd176e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/sanctum/zipball/a08cfee365c6b6df3e91c8f43b92f7163ffc8a94",
- "reference": "a08cfee365c6b6df3e91c8f43b92f7163ffc8a94",
+ "url": "https://api.github.com/repos/laravel/sanctum/zipball/3ed8f60dafef026acc21733366a08746a7bd176e",
+ "reference": "3ed8f60dafef026acc21733366a08746a7bd176e",
"shasum": ""
},
"require": {
@@ -3366,7 +3366,7 @@
"issues": "https://github.com/laravel/sanctum/issues",
"source": "https://github.com/laravel/sanctum"
},
- "time": "2021-04-20T16:20:46+00:00"
+ "time": "2021-05-11T21:03:57+00:00"
},
{
"name": "laravel/scout",
@@ -3564,16 +3564,16 @@
},
{
"name": "league/commonmark",
- "version": "1.6.1",
+ "version": "1.6.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
- "reference": "2651c497f005de305c7ba3f232cbd87b8c00ee8c"
+ "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2651c497f005de305c7ba3f232cbd87b8c00ee8c",
- "reference": "2651c497f005de305c7ba3f232cbd87b8c00ee8c",
+ "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7d70d2f19c84bcc16275ea47edabee24747352eb",
+ "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb",
"shasum": ""
},
"require": {
@@ -3661,7 +3661,7 @@
"type": "tidelift"
}
],
- "time": "2021-05-08T16:08:00+00:00"
+ "time": "2021-05-12T11:39:41+00:00"
},
{
"name": "league/flysystem",
@@ -3976,6 +3976,97 @@
},
"time": "2020-12-01T23:44:14+00:00"
},
+ {
+ "name": "makingcg/vuefilemanager-invoicing",
+ "version": "dev-master",
+ "dist": {
+ "type": "path",
+ "url": "../vuefilemanager-invoicing",
+ "reference": "d2a7cb5aa267c25f2a559d8af6740a327a2b3bef"
+ },
+ "require": {
+ "barryvdh/laravel-snappy": "^0.4.8",
+ "ext-json": "*",
+ "illuminate/contracts": "^8.37",
+ "intervention/image": "^2.5",
+ "kyslik/column-sortable": "^6.4",
+ "laravel/cashier": "^12.13",
+ "php": "^8.0",
+ "spatie/laravel-package-tools": "^1.4.3",
+ "teamtnt/laravel-scout-tntsearch-driver": "^11.3"
+ },
+ "require-dev": {
+ "brianium/paratest": "^6.2",
+ "ext-json": "*",
+ "friendsofphp/php-cs-fixer": "^2.19",
+ "nunomaduro/collision": "^5.3",
+ "orchestra/testbench": "^6.15",
+ "phpunit/phpunit": "^9.3",
+ "spatie/laravel-ray": "^1.9",
+ "vimeo/psalm": "^4.7.2"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "Makingcg\\Invoice\\InvoiceServiceProvider",
+ "Kyslik\\ColumnSortable\\ColumnSortableServiceProvider"
+ ],
+ "aliases": {
+ "Invoice": "Makingcg\\Invoice\\InvoiceFacade",
+ "PDF": "Barryvdh\\Snappy\\Facades\\SnappyPdf"
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Makingcg\\Invoice\\": "src",
+ "Makingcg\\Invoice\\Database\\Factories\\": "database/factories"
+ },
+ "files": [
+ "src/helpers.php"
+ ]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Makingcg\\Invoice\\Tests\\": "tests"
+ }
+ },
+ "scripts": {
+ "psalm": [
+ "vendor/bin/psalm"
+ ],
+ "format": [
+ "vendor/bin/php-cs-fixer fix --allow-risky=yes"
+ ],
+ "test": [
+ "./vendor/bin/testbench package:test --parallel --no-coverage"
+ ],
+ "test-coverage": [
+ "vendor/bin/phpunit --coverage-html coverage"
+ ]
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Peter Papp",
+ "email": "peterpapp@makingcg.com",
+ "role": "Developer"
+ }
+ ],
+ "description": "The invoice system for VueFileManager app",
+ "homepage": "https://github.com/makingcg/vuefilemanager-invoicing",
+ "keywords": [
+ "MakingCG",
+ "laravel",
+ "vuefilemanager-invoicing"
+ ],
+ "transport-options": {
+ "relative": true
+ }
+ },
{
"name": "mockery/mockery",
"version": "1.4.3",
@@ -4351,16 +4442,16 @@
},
{
"name": "nesbot/carbon",
- "version": "2.47.0",
+ "version": "2.48.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "606262fd8888b75317ba9461825a24fc34001e1e"
+ "reference": "d3c447f21072766cddec3522f9468a5849a76147"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/606262fd8888b75317ba9461825a24fc34001e1e",
- "reference": "606262fd8888b75317ba9461825a24fc34001e1e",
+ "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d3c447f21072766cddec3522f9468a5849a76147",
+ "reference": "d3c447f21072766cddec3522f9468a5849a76147",
"shasum": ""
},
"require": {
@@ -4440,7 +4531,7 @@
"type": "tidelift"
}
],
- "time": "2021-04-13T21:54:02+00:00"
+ "time": "2021-05-07T10:08:30+00:00"
},
{
"name": "netresearch/jsonmapper",
@@ -7937,16 +8028,16 @@
},
{
"name": "symfony/console",
- "version": "v5.2.7",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "90374b8ed059325b49a29b55b3f8bb4062c87629"
+ "reference": "864568fdc0208b3eba3638b6000b69d2386e6768"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/90374b8ed059325b49a29b55b3f8bb4062c87629",
- "reference": "90374b8ed059325b49a29b55b3f8bb4062c87629",
+ "url": "https://api.github.com/repos/symfony/console/zipball/864568fdc0208b3eba3638b6000b69d2386e6768",
+ "reference": "864568fdc0208b3eba3638b6000b69d2386e6768",
"shasum": ""
},
"require": {
@@ -8014,7 +8105,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.2.7"
+ "source": "https://github.com/symfony/console/tree/v5.2.8"
},
"funding": [
{
@@ -8030,7 +8121,7 @@
"type": "tidelift"
}
],
- "time": "2021-04-19T14:07:32+00:00"
+ "time": "2021-05-11T15:45:21+00:00"
},
{
"name": "symfony/css-selector",
@@ -8166,16 +8257,16 @@
},
{
"name": "symfony/error-handler",
- "version": "v5.2.7",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
- "reference": "ea3ddbf67615e883ca7c33a4de61213789846782"
+ "reference": "1416bc16317a8188aabde251afef7618bf4687ac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/error-handler/zipball/ea3ddbf67615e883ca7c33a4de61213789846782",
- "reference": "ea3ddbf67615e883ca7c33a4de61213789846782",
+ "url": "https://api.github.com/repos/symfony/error-handler/zipball/1416bc16317a8188aabde251afef7618bf4687ac",
+ "reference": "1416bc16317a8188aabde251afef7618bf4687ac",
"shasum": ""
},
"require": {
@@ -8215,7 +8306,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/error-handler/tree/v5.2.7"
+ "source": "https://github.com/symfony/error-handler/tree/v5.2.8"
},
"funding": [
{
@@ -8231,7 +8322,7 @@
"type": "tidelift"
}
],
- "time": "2021-04-07T15:57:33+00:00"
+ "time": "2021-05-07T13:42:21+00:00"
},
{
"name": "symfony/event-dispatcher",
@@ -8461,16 +8552,16 @@
},
{
"name": "symfony/finder",
- "version": "v5.2.4",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "0d639a0943822626290d169965804f79400e6a04"
+ "reference": "eccb8be70d7a6a2230d05f6ecede40f3fdd9e252"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04",
- "reference": "0d639a0943822626290d169965804f79400e6a04",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/eccb8be70d7a6a2230d05f6ecede40f3fdd9e252",
+ "reference": "eccb8be70d7a6a2230d05f6ecede40f3fdd9e252",
"shasum": ""
},
"require": {
@@ -8502,7 +8593,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v5.2.4"
+ "source": "https://github.com/symfony/finder/tree/v5.2.8"
},
"funding": [
{
@@ -8518,7 +8609,7 @@
"type": "tidelift"
}
],
- "time": "2021-02-15T18:55:04+00:00"
+ "time": "2021-05-10T14:39:23+00:00"
},
{
"name": "symfony/http-client-contracts",
@@ -8600,16 +8691,16 @@
},
{
"name": "symfony/http-foundation",
- "version": "v5.2.7",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "a416487a73bb9c9d120e9ba3a60547f4a3fb7a1f"
+ "reference": "e8fbbab7c4a71592985019477532629cb2e142dc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a416487a73bb9c9d120e9ba3a60547f4a3fb7a1f",
- "reference": "a416487a73bb9c9d120e9ba3a60547f4a3fb7a1f",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e8fbbab7c4a71592985019477532629cb2e142dc",
+ "reference": "e8fbbab7c4a71592985019477532629cb2e142dc",
"shasum": ""
},
"require": {
@@ -8653,7 +8744,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-foundation/tree/v5.2.7"
+ "source": "https://github.com/symfony/http-foundation/tree/v5.2.8"
},
"funding": [
{
@@ -8669,20 +8760,20 @@
"type": "tidelift"
}
],
- "time": "2021-05-01T13:46:24+00:00"
+ "time": "2021-05-07T13:41:16+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v5.2.7",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "1e9f6879f070f718e0055fbac232a56f67b8b6bd"
+ "reference": "c3cb71ee7e2d3eae5fe1001f81780d6a49b37937"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/1e9f6879f070f718e0055fbac232a56f67b8b6bd",
- "reference": "1e9f6879f070f718e0055fbac232a56f67b8b6bd",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c3cb71ee7e2d3eae5fe1001f81780d6a49b37937",
+ "reference": "c3cb71ee7e2d3eae5fe1001f81780d6a49b37937",
"shasum": ""
},
"require": {
@@ -8765,7 +8856,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-kernel/tree/v5.2.7"
+ "source": "https://github.com/symfony/http-kernel/tree/v5.2.8"
},
"funding": [
{
@@ -8781,7 +8872,7 @@
"type": "tidelift"
}
],
- "time": "2021-05-01T14:53:15+00:00"
+ "time": "2021-05-12T13:27:53+00:00"
},
{
"name": "symfony/mime",
@@ -10113,16 +10204,16 @@
},
{
"name": "symfony/string",
- "version": "v5.2.6",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572"
+ "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572",
- "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572",
+ "url": "https://api.github.com/repos/symfony/string/zipball/01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db",
+ "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db",
"shasum": ""
},
"require": {
@@ -10176,7 +10267,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.2.6"
+ "source": "https://github.com/symfony/string/tree/v5.2.8"
},
"funding": [
{
@@ -10192,20 +10283,20 @@
"type": "tidelift"
}
],
- "time": "2021-03-17T17:12:15+00:00"
+ "time": "2021-05-10T14:56:10+00:00"
},
{
"name": "symfony/translation",
- "version": "v5.2.7",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "e37ece5242564bceea54d709eafc948377ec9749"
+ "reference": "445caa74a5986f1cc9dd91a2975ef68fa7cb2068"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/e37ece5242564bceea54d709eafc948377ec9749",
- "reference": "e37ece5242564bceea54d709eafc948377ec9749",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/445caa74a5986f1cc9dd91a2975ef68fa7cb2068",
+ "reference": "445caa74a5986f1cc9dd91a2975ef68fa7cb2068",
"shasum": ""
},
"require": {
@@ -10269,7 +10360,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/translation/tree/v5.2.7"
+ "source": "https://github.com/symfony/translation/tree/v5.2.8"
},
"funding": [
{
@@ -10285,7 +10376,7 @@
"type": "tidelift"
}
],
- "time": "2021-04-01T08:15:21+00:00"
+ "time": "2021-05-07T13:41:16+00:00"
},
{
"name": "symfony/translation-contracts",
@@ -10367,16 +10458,16 @@
},
{
"name": "symfony/var-dumper",
- "version": "v5.2.7",
+ "version": "v5.2.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "27cb9f7cfa3853c736425c7233a8f68814b19636"
+ "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/27cb9f7cfa3853c736425c7233a8f68814b19636",
- "reference": "27cb9f7cfa3853c736425c7233a8f68814b19636",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d693200a73fae179d27f8f1b16b4faf3e8569eba",
+ "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba",
"shasum": ""
},
"require": {
@@ -10435,7 +10526,7 @@
"dump"
],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v5.2.7"
+ "source": "https://github.com/symfony/var-dumper/tree/v5.2.8"
},
"funding": [
{
@@ -10451,7 +10542,7 @@
"type": "tidelift"
}
],
- "time": "2021-04-19T14:07:32+00:00"
+ "time": "2021-05-07T13:42:21+00:00"
},
{
"name": "teamtnt/laravel-scout-tntsearch-driver",
@@ -11297,12 +11388,12 @@
"source": {
"type": "git",
"url": "https://github.com/composer/composer.git",
- "reference": "0021758e0bcf964237a56cb22e2f0309118b6a3f"
+ "reference": "5456cf81971b897ee82f75e82d2bcc3ad0bc6b84"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/composer/zipball/0021758e0bcf964237a56cb22e2f0309118b6a3f",
- "reference": "0021758e0bcf964237a56cb22e2f0309118b6a3f",
+ "url": "https://api.github.com/repos/composer/composer/zipball/5456cf81971b897ee82f75e82d2bcc3ad0bc6b84",
+ "reference": "5456cf81971b897ee82f75e82d2bcc3ad0bc6b84",
"shasum": ""
},
"require": {
@@ -11388,7 +11479,7 @@
"type": "tidelift"
}
],
- "time": "2021-05-10T11:14:14+00:00"
+ "time": "2021-05-12T13:19:52+00:00"
},
{
"name": "composer/metadata-minifier",
@@ -12191,7 +12282,9 @@
],
"aliases": [],
"minimum-stability": "dev",
- "stability-flags": [],
+ "stability-flags": {
+ "makingcg/vuefilemanager-invoicing": 20
+ },
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
diff --git a/database/factories/Oasis/ClientFactory.php b/database/factories/Oasis/ClientFactory.php
deleted file mode 100644
index 8c950ec5..00000000
--- a/database/factories/Oasis/ClientFactory.php
+++ /dev/null
@@ -1,44 +0,0 @@
- $this->faker->uuid,
- 'user_id' => $this->faker->uuid,
- 'name' => $this->faker->company,
- 'email' => $this->faker->email,
- 'phone_number' => $this->faker->phoneNumber,
- 'address' => $this->faker->address,
- 'city' => $this->faker->city,
- 'postal_code' => $this->faker->postcode,
- 'country' => $this->faker->randomElement(
- ['SK', 'CZ', 'DE', 'FR']
- ),
- 'ico' => $this->faker->numberBetween(11111111, 99999999),
- 'dic' => $this->faker->numberBetween(11111111, 99999999),
- 'ic_dph' => 'CZ' . $this->faker->numberBetween(1111111111, 9999999999),
- 'created_at' => $this->faker->dateTimeBetween(
- $startDate = '-6 months', $endDate = 'now', $timezone = null
- ),
- ];
- }
-}
diff --git a/database/factories/Oasis/InvoiceFactory.php b/database/factories/Oasis/InvoiceFactory.php
deleted file mode 100644
index 34251751..00000000
--- a/database/factories/Oasis/InvoiceFactory.php
+++ /dev/null
@@ -1,94 +0,0 @@
- $this->faker->uuid,
- 'user_id' => $this->faker->uuid,
- 'client_id' => $this->faker->uuid,
- 'invoice_type' => $this->faker->randomElement([
- 'regular-invoice', 'advance-invoice'
- ]),
- 'invoice_number' => $this->faker->numberBetween(2120001, 2120999),
- 'variable_number' => $this->faker->numberBetween(2120001, 2120999),
- 'currency' => $this->faker->randomElement([
- 'CZK', 'EUR'
- ]),
- 'user' => [],
- 'client' => [
- 'name' => $this->faker->company,
- 'email' => $this->faker->email,
- 'phone_number' => $this->faker->phoneNumber,
- 'address' => $this->faker->address,
- 'city' => $this->faker->city,
- 'postal_code' => $this->faker->postcode,
- 'country' => $this->faker->randomElement(
- ['SK', 'CZ', 'DE', 'FR']
- ),
- 'ico' => $this->faker->numberBetween(11111111, 99999999),
- 'dic' => $this->faker->numberBetween(11111111, 99999999),
- 'ic_dph' => 'CZ' . $this->faker->numberBetween(1111111111, 9999999999),
- ],
- 'items' => [
- [
- 'description' => $this->faker->realText(60),
- 'amount' => $this->faker->numberBetween(1, 3),
- 'tax_rate' => 20,
- 'price' => $this->faker->randomElement([120, 360, 400, 80, 90, 45, 16, 8]),
- ],
- [
- 'description' => $this->faker->realText(60),
- 'amount' => $this->faker->numberBetween(1, 3),
- 'tax_rate' => 20,
- 'price' => $this->faker->randomElement([120, 360, 400, 80, 90, 45, 16, 8]),
- ],
- ],
- 'discount_type' => $this->faker->randomElement(['percent', 'value', null]),
- 'delivery_at' => $this->faker->dateTimeBetween(
- $startDate = '-6 months', $endDate = 'now', $timezone = null
- ),
- 'created_at' => $this->faker->dateTimeBetween(
- $startDate = '-6 months', $endDate = 'now', $timezone = null
- ),
- ];
- }
-
- /**
- * Configure the model factory.
- *
- * @return $this
- */
- public function configure()
- {
- return $this->afterCreating(function (Invoice $invoice) {
- if ($invoice->discount_type === 'percent') {
- $invoice->discount_rate = $this->faker->randomElement([2, 5, 10, 15, 20]);
- }
-
- if ($invoice->discount_type === 'value') {
- $invoice->discount_rate = $this->faker->randomElement([20, 10]);
- }
-
- $invoice->save();
- });
- }
-}
diff --git a/database/factories/Oasis/InvoiceProfileFactory.php b/database/factories/Oasis/InvoiceProfileFactory.php
deleted file mode 100644
index e2a2dd59..00000000
--- a/database/factories/Oasis/InvoiceProfileFactory.php
+++ /dev/null
@@ -1,51 +0,0 @@
- $this->faker->uuid,
- 'user_id' => $this->faker->uuid,
- 'company' => $this->faker->company,
- 'logo' => '',
- 'email' => $this->faker->email,
- 'ico' => rand(11111111, 99999999),
- 'dic' => rand(11111111, 99999999),
- 'ic_dph' => 'SK' . rand(111111111111, 999999999999),
- 'registration_notes' => $this->faker->realText(80),
- 'author' => $this->faker->name,
- 'stamp' => '',
- 'address' => $this->faker->address,
- 'state' => $this->faker->state,
- 'city' => $this->faker->city,
- 'postal_code' => $this->faker->postcode,
- 'country' => $this->faker->randomElement([
- 'SK', 'CZ', 'DE', 'FR'
- ]),
- 'phone' => $this->faker->phoneNumber,
- 'bank' => $this->faker->randomElement([
- 'Fio Banka', 'Tatra Banka'
- ]),
- 'iban' => $this->faker->iban('CZ'),
- 'swift' => $this->faker->swiftBicNumber,
- ];
- }
-}
\ No newline at end of file
diff --git a/database/migrations/oasis/2021_04_21_060812_create_invoices_table.php b/database/migrations/oasis/2021_04_21_060812_create_invoices_table.php
deleted file mode 100644
index 70f1c217..00000000
--- a/database/migrations/oasis/2021_04_21_060812_create_invoices_table.php
+++ /dev/null
@@ -1,58 +0,0 @@
-uuid('id')->primary()->index();
- $table->uuid('user_id')->index();
- $table->uuid('client_id')->nullable()->index();
-
- $table->enum('invoice_type', [
- 'regular-invoice', 'advance-invoice'
- ]);
-
- $table->text('invoice_number')->nullable();
- $table->text('variable_number')->nullable();
-
- $table->longText('client');
- $table->longText('user');
- $table->longText('items');
-
- $table->date('delivery_at')->nullable();
- $table->dateTime('due_at')->nullable();
-
- $table->enum('discount_type', [
- 'percent', 'value'
- ])->nullable();
- $table->integer('discount_rate')->nullable();
-
- $table->text('currency');
-
- $table->string('total_net')->nullable();
- $table->string('total_tax')->nullable();
-
- $table->timestamps();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('invoices');
- }
-}
diff --git a/database/migrations/oasis/2021_04_21_061055_create_clients_table.php b/database/migrations/oasis/2021_04_21_061055_create_clients_table.php
deleted file mode 100644
index 2e1d8412..00000000
--- a/database/migrations/oasis/2021_04_21_061055_create_clients_table.php
+++ /dev/null
@@ -1,48 +0,0 @@
-uuid('id')->primary()->index();
- $table->uuid('user_id')->index();
-
- $table->text('name');
- $table->text('avatar')->nullable();
-
- $table->text('email')->nullable();
- $table->text('phone_number')->nullable();
-
- $table->text('address')->nullable();
- $table->text('city')->nullable();
- $table->text('postal_code')->nullable();
- $table->text('country')->nullable();
-
- $table->text('ico')->nullable();
- $table->text('dic')->nullable();
- $table->text('ic_dph')->nullable();
-
- $table->timestamps();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('clients');
- }
-}
diff --git a/database/migrations/oasis/2021_04_27_070058_create_invoice_profiles_table.php b/database/migrations/oasis/2021_04_27_070058_create_invoice_profiles_table.php
deleted file mode 100644
index 4aa0cd2b..00000000
--- a/database/migrations/oasis/2021_04_27_070058_create_invoice_profiles_table.php
+++ /dev/null
@@ -1,57 +0,0 @@
-uuid('id')->primary()->index();
- $table->uuid('user_id')->index();
-
- $table->text('company')->nullable();
- $table->string('logo')->nullable();
- $table->string('email')->nullable();
- $table->string('phone')->nullable();
-
- $table->text('address')->nullable();
- $table->text('state')->nullable();
- $table->text('city')->nullable();
- $table->text('postal_code')->nullable();
- $table->text('country')->nullable();
-
- $table->string('ico')->nullable();
- $table->string('dic')->nullable();
- $table->string('ic_dph')->nullable();
-
- $table->text('registration_notes')->nullable();
-
- $table->text('bank')->nullable();
- $table->string('iban')->nullable();
- $table->string('swift')->nullable();
-
- $table->string('author')->nullable();
- $table->string('stamp')->nullable();
-
- $table->timestamps();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('invoice_profiles');
- }
-}
diff --git a/public/mix-manifest.json b/public/mix-manifest.json
index b4cfde13..e717a3a6 100644
--- a/public/mix-manifest.json
+++ b/public/mix-manifest.json
@@ -1,93 +1,114 @@
{
- "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~4509a016.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~4509a016.js?id=195bc845f51ce6d36498",
- "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~e360f8a1.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~e360f8a1.js?id=40bff66dbabd620a5c7e",
- "/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js": "/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js?id=c3203130039da465a7d3",
- "/chunks/admin~chunks/oasis/invoices~chunks/platform~chunks/shared.js": "/chunks/admin~chunks/oasis/invoices~chunks/platform~chunks/shared.js?id=b1b8e6c2481a414ca4f7",
- "/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js": "/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js?id=8754c1ac780767414ce0",
- "/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js": "/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js?id=f7ba959865708b74aef5",
- "/vendors~chunks/oasis/invoices~chunks/platform~chunks/shared.js": "/vendors~chunks/oasis/invoices~chunks/platform~chunks/shared.js?id=44a3217593d9f71d702d",
- "/chunks/admin.js": "/chunks/admin.js?id=a90bf8811291e010df46",
- "/chunks/dashboard~chunks/dashboard-oasis.js": "/chunks/dashboard~chunks/dashboard-oasis.js?id=aa4de94799f0d6359f96",
- "/chunks/files~chunks/shared/file-browser.js": "/chunks/files~chunks/shared/file-browser.js?id=6863be7ae651919065a9",
- "/js/main.js": "/js/main.js?id=d6379a33f108c8da5b8d",
- "/css/app.css": "/css/app.css?id=e9183e52105da8549dfd",
- "/chunks/admin-account.js": "/chunks/admin-account.js?id=800a54b12ef6257507d5",
- "/chunks/app-appearance.js": "/chunks/app-appearance.js?id=1c1b83566868a90dd8e9",
- "/chunks/app-billings.js": "/chunks/app-billings.js?id=ffdebe1a9e985d043bb1",
- "/chunks/app-email.js": "/chunks/app-email.js?id=0a30b4f964b30c34ac14",
- "/chunks/app-index.js": "/chunks/app-index.js?id=5911c461bb12e6809df3",
- "/chunks/app-language.js": "/chunks/app-language.js?id=2f45b27675d7b2796351",
- "/chunks/app-others.js": "/chunks/app-others.js?id=5ca619d9d98d0948d457",
- "/chunks/app-payments.js": "/chunks/app-payments.js?id=f96b5d5874e7cb2e5a85",
- "/chunks/app-settings.js": "/chunks/app-settings.js?id=dfd81d8780a29fae1c51",
- "/chunks/app-setup.js": "/chunks/app-setup.js?id=c98df061fd25143ee592",
- "/chunks/billings-detail.js": "/chunks/billings-detail.js?id=56b76453c25a36f8982b",
- "/chunks/contact-us.js": "/chunks/contact-us.js?id=faeb0ff087099d2338fb",
- "/chunks/create-new-password.js": "/chunks/create-new-password.js?id=233006f4daf51540a6e5",
- "/chunks/dashboard.js": "/chunks/dashboard.js?id=a520d5e05f5f3c889918",
- "/chunks/dashboard-oasis.js": "/chunks/dashboard-oasis.js?id=ed57d28970e9d25a57c7",
- "/chunks/database.js": "/chunks/database.js?id=5e8858c96d80facd4158",
- "/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=d1c5ca1c79b2debac866",
- "/chunks/environment-setup.js": "/chunks/environment-setup.js?id=a14cbd92bd392981cbd0",
- "/chunks/files.js": "/chunks/files.js?id=f3f80f4ffa9990321a26",
- "/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=16a2798ed2eda763f85a",
- "/chunks/homepage.js": "/chunks/homepage.js?id=172d61f6a78fe8c66bff",
- "/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=27becfa27d2c09b54ae5",
- "/chunks/invoices.js": "/chunks/invoices.js?id=27a853727d4417256b02",
- "/chunks/not-found-shared.js": "/chunks/not-found-shared.js?id=1147a3c9625cffbf8743",
- "/chunks/oasis/homepage.js": "/chunks/oasis/homepage.js?id=d40682da49cec1a2056c",
- "/chunks/oasis/invoices.js": "/chunks/oasis/invoices.js?id=f40590af47d3e87881e8",
- "/chunks/oasis/invoices/client.js": "/chunks/oasis/invoices/client.js?id=0800ccae10be5349c8de",
- "/chunks/oasis/invoices/client-detail.js": "/chunks/oasis/invoices/client-detail.js?id=ea9620cce66b649f9125",
- "/chunks/oasis/invoices/client-invoices.js": "/chunks/oasis/invoices/client-invoices.js?id=77bd22b0313cab88ec61",
- "/chunks/oasis/invoices/create-client.js": "/chunks/oasis/invoices/create-client.js?id=27adbe42488c8081359f",
- "/chunks/oasis/invoices/create-invoice.js": "/chunks/oasis/invoices/create-invoice.js?id=3e52f7809f7e49417ba0",
- "/chunks/oasis/invoices/edit-invoice.js": "/chunks/oasis/invoices/edit-invoice.js?id=f946ffc9bf91ad585d96",
- "/chunks/oasis/invoices/list.js": "/chunks/oasis/invoices/list.js?id=55e5a0f10cd50f73e71a",
- "/chunks/oasis/invoices/profile.js": "/chunks/oasis/invoices/profile.js?id=656ba33790a80c962402",
- "/chunks/oasis/platba.js": "/chunks/oasis/platba.js?id=ce165f5e168c74681d5b",
- "/chunks/oasis/sign-up.js": "/chunks/oasis/sign-up.js?id=265fd13102e82de6c885",
- "/chunks/oasis/upgrade-billing.js": "/chunks/oasis/upgrade-billing.js?id=62d7e569a508b89efbda",
- "/chunks/oasis/upgrade-plan.js": "/chunks/oasis/upgrade-plan.js?id=0ff04d189e8012a772a6",
- "/chunks/oasis/user-create.js": "/chunks/oasis/user-create.js?id=dbbe553b1192f51e3347",
- "/chunks/oasis/users.js": "/chunks/oasis/users.js?id=90b79a2afd1c1af0de93",
- "/chunks/page-edit.js": "/chunks/page-edit.js?id=f461a854720e430167ad",
- "/chunks/pages.js": "/chunks/pages.js?id=154de6ecf8de75e52986",
- "/chunks/plan.js": "/chunks/plan.js?id=4017c43bca1e88be52fe",
- "/chunks/plan-create.js": "/chunks/plan-create.js?id=3858091e1cb4ccbff2a2",
- "/chunks/plan-delete.js": "/chunks/plan-delete.js?id=59fce90e14b91b926134",
- "/chunks/plan-settings.js": "/chunks/plan-settings.js?id=3d5c890c879c318877ec",
- "/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=3aeb7347662acca51436",
- "/chunks/plans.js": "/chunks/plans.js?id=de86874e55eec9384139",
- "/chunks/platform.js": "/chunks/platform.js?id=e960062bdcc0f26132a8",
- "/chunks/profile.js": "/chunks/profile.js?id=b0f4b9f9ded460ba6f0f",
- "/chunks/purchase-code.js": "/chunks/purchase-code.js?id=bcfbccee713a4915aa3d",
- "/chunks/settings.js": "/chunks/settings.js?id=dd11a55964c72fc86e8f",
- "/chunks/settings-create-payment-methods.js": "/chunks/settings-create-payment-methods.js?id=4f258d7ae720f6058cdc",
- "/chunks/settings-invoices.js": "/chunks/settings-invoices.js?id=cab4472faa901c1bbf0a",
- "/chunks/settings-password.js": "/chunks/settings-password.js?id=4b6f61865aad9ce1b901",
- "/chunks/settings-payment-methods.js": "/chunks/settings-payment-methods.js?id=58bbb1d7d4c3b73a46f1",
- "/chunks/settings-storage.js": "/chunks/settings-storage.js?id=7c18021929c42436c232",
- "/chunks/settings-subscription.js": "/chunks/settings-subscription.js?id=815fd683f57807826ae1",
- "/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=d0353ac99122ce69fb7f",
- "/chunks/shared.js": "/chunks/shared.js?id=66276189545daa439300",
- "/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=ddb14efefb1b754beddb",
- "/chunks/shared/file-browser.js": "/chunks/shared/file-browser.js?id=2a90999a1e96c274fbe6",
- "/chunks/shared/single-file.js": "/chunks/shared/single-file.js?id=d6f870eec2d2b4a4400a",
- "/chunks/sign-in.js": "/chunks/sign-in.js?id=79b669b21e0bcd9c69e3",
- "/chunks/sign-up.js": "/chunks/sign-up.js?id=188a69077b6b694efcdf",
- "/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=a71ab09be65541bfe932",
- "/chunks/subscription-plans.js": "/chunks/subscription-plans.js?id=bf68567befa1a54e245d",
- "/chunks/subscription-service.js": "/chunks/subscription-service.js?id=fbaf740effbd15eec7ea",
- "/chunks/upgrade-billing.js": "/chunks/upgrade-billing.js?id=64448adc4e0e2b541fe7",
- "/chunks/upgrade-plan.js": "/chunks/upgrade-plan.js?id=ca1b7f41502c32648d31",
- "/chunks/user.js": "/chunks/user.js?id=020eaf5a4df86c951c9e",
- "/chunks/user-create.js": "/chunks/user-create.js?id=49085ae287fd04da6793",
- "/chunks/user-delete.js": "/chunks/user-delete.js?id=7d9f71a92cc65984c7d1",
- "/chunks/user-detail.js": "/chunks/user-detail.js?id=995a0bf595cd43315779",
- "/chunks/user-invoices.js": "/chunks/user-invoices.js?id=ab6cbcc0968f86cc76ae",
- "/chunks/user-password.js": "/chunks/user-password.js?id=9991537c31e5be9b7a5e",
- "/chunks/user-storage.js": "/chunks/user-storage.js?id=97119b2893b1ca5e2b06",
- "/chunks/user-subscription.js": "/chunks/user-subscription.js?id=11d16c401ebdba04b506",
- "/chunks/users.js": "/chunks/users.js?id=9181ac549cb36558a19c"
+ "/js/main.js": "/js/main.js",
+ "/css/app.css": "/css/app.css",
+ "/chunks/admin.js": "/chunks/admin.js?id=3048a34ebd4668893224",
+ "/chunks/admin-account.js": "/chunks/admin-account.js?id=8d842bebde408d97b8e4",
+ "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~e360f8a1.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~e360f8a1.js?id=9a997811677c9fcc0c6e",
+ "/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~062c965c.js": "/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~062c965c.js?id=515118382f7ad5724a54",
+ "/chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/~56ae6336.js": "/chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/~56ae6336.js?id=3500df10c19053acd77b",
+ "/chunks/admin~chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/sh~d177b2e8.js": "/chunks/admin~chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/sh~d177b2e8.js?id=a387d2c725058d00da7d",
+ "/chunks/admin~chunks/files~chunks/oasis/invoices~chunks/settings~chunks/shared/file-browser.js": "/chunks/admin~chunks/files~chunks/oasis/invoices~chunks/settings~chunks/shared/file-browser.js?id=e15b67406596821c2be9",
+ "/chunks/admin~chunks/oasis/invoices~chunks/platform.js": "/chunks/admin~chunks/oasis/invoices~chunks/platform.js?id=6b26b3e293cd0f376a73",
+ "/chunks/admin~chunks/oasis/invoices~chunks/platform~chunks/shared.js": "/chunks/admin~chunks/oasis/invoices~chunks/platform~chunks/shared.js?id=1ca47708816a4be47a0a",
+ "/chunks/app-appearance.js": "/chunks/app-appearance.js?id=1c320a815afcc355bae7",
+ "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~262a2a36.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~262a2a36.js?id=e6505b93727b56256f92",
+ "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~2e0b85bd.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~2e0b85bd.js?id=d4fb46f05374a298ac1b",
+ "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~c329baf3.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~c329baf3.js?id=917423b1c6ec5a0c7435",
+ "/chunks/app-billings.js": "/chunks/app-billings.js?id=2bbe6337f28ee663e2ef",
+ "/chunks/app-email.js": "/chunks/app-email.js?id=069bcdd39373a75f8270",
+ "/chunks/app-index.js": "/chunks/app-index.js?id=6fd365716d797307517b",
+ "/chunks/app-language.js": "/chunks/app-language.js?id=6353a4c87d14aec62efb",
+ "/chunks/app-language~chunks/app-settings~chunks/dashboard~chunks/dashboard-oasis~chunks/invoices~chun~93101a7f.js": "/chunks/app-language~chunks/app-settings~chunks/dashboard~chunks/dashboard-oasis~chunks/invoices~chun~93101a7f.js?id=93fb27b76209e5b7b2d9",
+ "/chunks/app-language~chunks/dashboard~chunks/dashboard-oasis~chunks/files~chunks/invoices~chunks/oasi~78bb4d4b.js": "/chunks/app-language~chunks/dashboard~chunks/dashboard-oasis~chunks/files~chunks/invoices~chunks/oasi~78bb4d4b.js?id=1f922f753ccc5064dbe1",
+ "/chunks/app-others.js": "/chunks/app-others.js?id=764423f8911acbc659a9",
+ "/chunks/app-payments.js": "/chunks/app-payments.js?id=4ecc19e6297a15de5278",
+ "/chunks/app-settings.js": "/chunks/app-settings.js?id=acc6ba7a93681f0d5d64",
+ "/chunks/app-setup.js": "/chunks/app-setup.js?id=e19bd2887ed43d5bfe91",
+ "/chunks/billings-detail.js": "/chunks/billings-detail.js?id=7df1b3539a19b34d2d03",
+ "/chunks/contact-us.js": "/chunks/contact-us.js?id=5d26cf9527766c281c2a",
+ "/chunks/contact-us~chunks/dynamic-page~chunks/homepage.js": "/chunks/contact-us~chunks/dynamic-page~chunks/homepage.js?id=22bd5db44c72e8de5f5b",
+ "/chunks/create-new-password.js": "/chunks/create-new-password.js?id=48dc53ccbd502c2739ec",
+ "/chunks/dashboard.js": "/chunks/dashboard.js?id=55a783975e40f9dcf31b",
+ "/chunks/dashboard-oasis.js": "/chunks/dashboard-oasis.js?id=8b37095a96ece7d6c1d8",
+ "/chunks/dashboard~chunks/dashboard-oasis.js": "/chunks/dashboard~chunks/dashboard-oasis.js?id=67a4a8d617c2e38cb1f3",
+ "/chunks/dashboard~chunks/dashboard-oasis~chunks/invoices~chunks/oasis/invoices/client-invoices~chunks~4ba83fa1.js": "/chunks/dashboard~chunks/dashboard-oasis~chunks/invoices~chunks/oasis/invoices/client-invoices~chunks~4ba83fa1.js?id=2e029bf012cccfd18e6c",
+ "/chunks/database.js": "/chunks/database.js?id=d94b18f487382a1a8021",
+ "/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=17cbd34e8c621c7a93e5",
+ "/chunks/dynamic-page~chunks/oasis/homepage.js": "/chunks/dynamic-page~chunks/oasis/homepage.js?id=9840011d02134efd9210",
+ "/chunks/environment-setup.js": "/chunks/environment-setup.js?id=b42ed6eea4625ce1c2db",
+ "/chunks/files.js": "/chunks/files.js?id=af40942fb64ed6bbdd99",
+ "/chunks/files~chunks/oasis/invoices/list~chunks/oasis/platba~chunks/settings-subscription~chunks/shar~32471b3c.js": "/chunks/files~chunks/oasis/invoices/list~chunks/oasis/platba~chunks/settings-subscription~chunks/shar~32471b3c.js?id=793a4093a170b7021e1a",
+ "/chunks/files~chunks/oasis/invoices/list~chunks/platform~chunks/shared/file-browser.js": "/chunks/files~chunks/oasis/invoices/list~chunks/platform~chunks/shared/file-browser.js?id=3c89f716b5797441dd98",
+ "/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js": "/chunks/files~chunks/oasis/invoices/list~chunks/shared/file-browser.js?id=2d5163fd2869304720da",
+ "/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js": "/chunks/files~chunks/oasis/invoices~chunks/oasis/invoices/list~chunks/platform~chunks/shared~chunks/s~40cda2f4.js?id=25a8f2ba10196cc72353",
+ "/chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/s~3fd62fd8.js": "/chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~chunks/s~3fd62fd8.js?id=d39c8f198b09bb094e80",
+ "/chunks/files~chunks/shared/file-browser.js": "/chunks/files~chunks/shared/file-browser.js?id=b7472ffd394e412cab33",
+ "/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js": "/chunks/files~chunks/shared/file-browser~chunks/shared/single-file.js?id=eb79ae61af1b37bcfd7f",
+ "/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=877a9289b77ac3885042",
+ "/chunks/homepage.js": "/chunks/homepage.js?id=1a86b7f0efa95ad65c4a",
+ "/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=561f2ef3cdde4f64c18c",
+ "/chunks/invoices.js": "/chunks/invoices.js?id=733a4a9b02203923e96b",
+ "/chunks/not-found-shared.js": "/chunks/not-found-shared.js?id=7fc7f9b6f10bdfac770e",
+ "/chunks/oasis/homepage.js": "/chunks/oasis/homepage.js?id=a1885dd8814f9eb63a1c",
+ "/chunks/oasis/invoices.js": "/chunks/oasis/invoices.js?id=92a5a7559d95a87b3753",
+ "/chunks/oasis/invoices/client.js": "/chunks/oasis/invoices/client.js?id=5278e4b3fec7c313b500",
+ "/chunks/oasis/invoices/client-detail.js": "/chunks/oasis/invoices/client-detail.js?id=f04d993baccf515554db",
+ "/chunks/oasis/invoices/client-invoices.js": "/chunks/oasis/invoices/client-invoices.js?id=6558d35b1bfe20e8ede6",
+ "/chunks/oasis/invoices/create-client.js": "/chunks/oasis/invoices/create-client.js?id=a27824905ee00e5b9d5e",
+ "/chunks/oasis/invoices/create-invoice.js": "/chunks/oasis/invoices/create-invoice.js?id=da39947baccf666a1efc",
+ "/chunks/oasis/invoices/edit-invoice.js": "/chunks/oasis/invoices/edit-invoice.js?id=b8776f1c1d5b8b0626da",
+ "/chunks/oasis/invoices/list.js": "/chunks/oasis/invoices/list.js?id=fe9326d4268e817e3c58",
+ "/chunks/oasis/invoices/profile.js": "/chunks/oasis/invoices/profile.js?id=cb529bbeb676d24b011e",
+ "/chunks/oasis/invoices~chunks/platform~chunks/shared.js": "/chunks/oasis/invoices~chunks/platform~chunks/shared.js?id=14c791d5a02c82b747e9",
+ "/chunks/oasis/platba.js": "/chunks/oasis/platba.js?id=791bf891bb4a384c0890",
+ "/chunks/oasis/platba~chunks/oasis/upgrade-billing~chunks/oasis/upgrade-plan~chunks/upgrade-billing~ch~6880400b.js": "/chunks/oasis/platba~chunks/oasis/upgrade-billing~chunks/oasis/upgrade-plan~chunks/upgrade-billing~ch~6880400b.js?id=0c8d1c3cca084baa177f",
+ "/chunks/oasis/sign-up.js": "/chunks/oasis/sign-up.js?id=e53eeb48ebabae259f9c",
+ "/chunks/oasis/upgrade-billing.js": "/chunks/oasis/upgrade-billing.js?id=3008775e9c2b22f22215",
+ "/chunks/oasis/upgrade-plan.js": "/chunks/oasis/upgrade-plan.js?id=b0148f9d17a29bc32736",
+ "/chunks/oasis/user-create.js": "/chunks/oasis/user-create.js?id=23c05f1f2af5c8ed5f93",
+ "/chunks/oasis/users.js": "/chunks/oasis/users.js?id=d15e1dd3ad4aa6cd8a77",
+ "/chunks/page-edit.js": "/chunks/page-edit.js?id=9ccfe006fcd9ef785a61",
+ "/chunks/pages.js": "/chunks/pages.js?id=7a1843e7aaeeaa111dc8",
+ "/chunks/plan.js": "/chunks/plan.js?id=ac3046761e9083aa3053",
+ "/chunks/plan-create.js": "/chunks/plan-create.js?id=5fc3fd093be62eea931e",
+ "/chunks/plan-delete.js": "/chunks/plan-delete.js?id=ac08dc4225f7440d0512",
+ "/chunks/plan-settings.js": "/chunks/plan-settings.js?id=311e6ea9254d8f5423a0",
+ "/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=146c53671951b7061131",
+ "/chunks/plans.js": "/chunks/plans.js?id=d4cfc1b66dd5021a3c84",
+ "/chunks/platform.js": "/chunks/platform.js?id=32656f7d130ecbe06f12",
+ "/chunks/platform~chunks/shared.js": "/chunks/platform~chunks/shared.js?id=a66981c626d89a234103",
+ "/chunks/profile.js": "/chunks/profile.js?id=42695eb6d8ab8b0220d9",
+ "/chunks/purchase-code.js": "/chunks/purchase-code.js?id=4873b06c3bbca3fe2c36",
+ "/chunks/settings.js": "/chunks/settings.js?id=fcc97a29894164e2977c",
+ "/chunks/settings-create-payment-methods.js": "/chunks/settings-create-payment-methods.js?id=16b924e46bb6731fb294",
+ "/chunks/settings-invoices.js": "/chunks/settings-invoices.js?id=9d3c3ed48e31da008b33",
+ "/chunks/settings-password.js": "/chunks/settings-password.js?id=0277b40c37adc464b97d",
+ "/chunks/settings-payment-methods.js": "/chunks/settings-payment-methods.js?id=bfca271280566258f0b6",
+ "/chunks/settings-storage.js": "/chunks/settings-storage.js?id=3763d6291aa27e295a81",
+ "/chunks/settings-subscription.js": "/chunks/settings-subscription.js?id=d44d995362fe6567fc11",
+ "/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=c6b88005b133268ed88f",
+ "/chunks/shared.js": "/chunks/shared.js?id=a2c4342bfddd4946cb85",
+ "/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=3d5c7754d438830a4204",
+ "/chunks/shared/file-browser.js": "/chunks/shared/file-browser.js?id=f46e9dc63c1313bc2256",
+ "/chunks/shared/single-file.js": "/chunks/shared/single-file.js?id=e8aedb75df7fe227d693",
+ "/chunks/sign-in.js": "/chunks/sign-in.js?id=1d2f0d12e71a2eae51f1",
+ "/chunks/sign-up.js": "/chunks/sign-up.js?id=ce15b1156cf37c0a9703",
+ "/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=4c45fae14fd222237a62",
+ "/chunks/subscription-plans.js": "/chunks/subscription-plans.js?id=53e92bad3f19ffcd7bb0",
+ "/chunks/subscription-service.js": "/chunks/subscription-service.js?id=7011390fa6d368070d72",
+ "/chunks/upgrade-billing.js": "/chunks/upgrade-billing.js?id=3541c0262320aeaf0749",
+ "/chunks/upgrade-plan.js": "/chunks/upgrade-plan.js?id=e9c46003e82194e85439",
+ "/chunks/user.js": "/chunks/user.js?id=3090bfd5b85dd1b200ec",
+ "/chunks/user-create.js": "/chunks/user-create.js?id=d4c1fc74ca50973925b3",
+ "/chunks/user-delete.js": "/chunks/user-delete.js?id=9b2354c223ea128603d6",
+ "/chunks/user-detail.js": "/chunks/user-detail.js?id=84eada5c23af5d5a22d5",
+ "/chunks/user-invoices.js": "/chunks/user-invoices.js?id=e1a81d02e60bba5770d7",
+ "/chunks/user-password.js": "/chunks/user-password.js?id=ddf2709371236446ae98",
+ "/chunks/user-storage.js": "/chunks/user-storage.js?id=38f3edba743a7448f8e6",
+ "/chunks/user-subscription.js": "/chunks/user-subscription.js?id=32b823b73166fcaf70c4",
+ "/chunks/users.js": "/chunks/users.js?id=178dc8d8c83a43d6e77f",
+ "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~4509a016.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~4509a016.js?id=ea781ec6ec7cf0645e05",
+ "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~66c4fa45.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~66c4fa45.js?id=accf0be7f09c1000b571",
+ "/vendors~chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~~b42d96c6.js": "/vendors~chunks/files~chunks/oasis/invoices~chunks/platform~chunks/shared~chunks/shared/file-browser~~b42d96c6.js?id=a564e3b9054e42dda63f",
+ "/vendors~chunks/oasis/invoices~chunks/platform~chunks/shared.js": "/vendors~chunks/oasis/invoices~chunks/platform~chunks/shared.js?id=03d3cf785cbafa4d31f0"
}
diff --git a/resources/sass/oasis/invoice.scss b/resources/sass/oasis/invoice.scss
deleted file mode 100644
index 23c035a0..00000000
--- a/resources/sass/oasis/invoice.scss
+++ /dev/null
@@ -1,346 +0,0 @@
-$primary-color: #bc30fd;
-$text-color: #1B2539;
-$border-color: #D8D8D8;
-$background-color: #F4F5F6;
-$border-radius: 15px;
-
-@mixin font-size($size) {
- font-size:(($size*1.6)/16) + 0em;
-}
-
-* {
- outline: 0;
- margin: 0;
- padding: 0;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- color: $text-color;
-}
-
-*, html, body, h1, h2, h3, h4, p, span, b, strong {
- font-family: 'Nunito', serif;
-}
-
-html {
- font-size: 100%;
-}
-
-.row {
- display: -webkit-flex;
- -webkit-flex-wrap: nowrap;
- width: 100%;
-
- &.spaces {
- margin: 0 -15px;
-
- div[class^='col-'] {
- padding: 0 15px;
- }
- }
-
- div[class^='col-'] {
- -webkit-flex-grow: 1;
-
- &.align-right {
- text-align: right;
- }
- }
-
- .col-left, .col-right {
- width: 49%;
- }
-
- &.align-center div[class^='col-'] {
- -webkit-align-self: center;
- }
- &.align-bottom div[class^='col-'] {
- -webkit-align-self: flex-end;
- }
-}
-
-.invoice-header {
-
- .col-left, .col-right {
- display: inline-block;
- }
-
- .logo {
- margin-bottom: 5px;
- display: block;
- width: 260px;
- }
-
- .email, .phone {
- display: block;
- @include font-size(7);
- font-weight: 400;
- margin-bottom: 2px;
- }
-
- h1 {
- line-height: 1;
- padding-bottom: 5px;
- @include font-size(16);
- }
-
- h2 {
- color: $primary-color;
- font-weight: 600;
- @include font-size(11);
- }
-
- h4 {
- color: $text-color;
- font-weight: 600;
- @include font-size(7);
- }
-}
-
-.supplier {
- float: right;
- max-width: 600px;
-
- .box {
- background: $background-color;
- border-radius: $border-radius;
- padding: 20px;
- }
-
- .dates {
- margin-top: 10px;
-
- p {
- text-align: right;
- @include font-size(9);
- }
- }
-}
-
-.special-wrapper {
- padding-bottom: 20px;
- border-bottom: 1px dashed $border-color;
- margin: 0 -5px 25px;
-
- .special-item {
- background: $background-color;
- border-radius: 8px;
- display: inline-block;
- width: 20.9%;
- margin: 0 5px;
-
- &:nth-child(1) {
- width: 31.5%;
- }
-
- .padding {
- padding: 10px 15px;
- }
- }
-
- b {
- color: $primary-color;
- @include font-size(9);
- font-weight: 600;
- margin-bottom: 5px;
- display: block;
- }
-
- span {
- @include font-size(10);
- font-weight: 600;
- word-break: break-word;
- overflow-wrap: break-word;
- width: 100%;
- display: block;
- }
-}
-
-.table {
- table-layout: fixed;
- border-collapse: collapse;
- width: 100%;
-
- .table-row {
-
- &:nth-child(even) {
- background-color: $background-color;
- border-radius: 12px;
- }
-
- .table-cell {
- text-align: left;
- word-break: break-word;
- padding: 5px;
-
- span, a {
- word-break: break-word;
- }
-
- &:first-child {
- width: 280px;
- padding-left: 15px;
- padding-right: 15px;
- }
-
- &:last-child {
- text-align: right;
- padding-right: 15px;
- }
- }
- }
-
- tbody {
- .table-row {
- padding: 5px 0;
- }
- }
-
- thead {
- background-color: white !important;
- padding-bottom: 15px;
- border-bottom: 0;
-
- .table-cell {
-
- span {
- color: $primary-color;
- font-weight: 600;
- @include font-size(9);
- white-space: nowrap;
- }
- }
- }
-
- .table-cell {
- word-break: break-all;
-
- span, a {
- vertical-align: middle;
- font-weight: 600;
- @include font-size(9);
- }
- }
-}
-
-.summary {
- max-width: 300px;
- margin: 15px 0 10px auto;
- text-align: right;
-
- li {
- padding: 2px 0;
- display: block;
-
- b, span {
- white-space: nowrap;
- }
-
- .col-full {
- width: 50%;
- display: inline-block;
- }
- }
-
- span {
- @include font-size(10);
- }
-
- b {
- @include font-size(13);
- font-weight: 600;
- }
-}
-
-.notes {
- padding-top: 20px;
- border-top: 1px dashed $border-color;
-}
-
-.invoice-author {
- display: -webkit-flex;
- -webkit-justify-content: space-between;
- -webkit-align-items: flex-end;
- padding-bottom: 25px;
-
- .sign {
- text-align: right;
- }
-
- img {
- max-height: 125px;
- display: block;
- margin: 0 0 0 auto;
- }
-}
-
-.invoice-footer {
- padding-top: 15px;
- border-top: 1px dashed $border-color;
- text-align: center;
-
- p {
- @include font-size(10);
- }
-
- a {
- color: $primary-color;
- }
-}
-
-h3 {
- color: $primary-color;
- font-weight: 600;
- padding-bottom: 8px;
- @include font-size(10);
-}
-
-p, span {
- font-weight: 600;
- padding-bottom: 4px;
- @include font-size(10);
- color: $text-color;
-}
-
-.highlight {
- color: $primary-color;
-}
-
-section, header {
- border-bottom: 1px dashed $border-color;
- padding-bottom: 10px;
- margin-bottom: 20px;
-}
-
-.address, .number {
- display: block;
- font-weight: 600;
-}
-
-.content-box {
- padding-bottom: 15px;
-}
-
-.thank-you {
- text-align: center;
- font-size: 22px;
- margin-top: 20px;
- margin-bottom: 60px;
-}
-
-footer {
-
- .stamp {
- max-width: 200px;
- display: block;
- margin: 0 0 0 auto;
- }
-
- div {
- align-self: flex-end;
- }
-
- h3 {
- display: inline-block;
- }
-}
diff --git a/resources/views/oasis/invoices/invoice.blade.php b/resources/views/oasis/invoices/invoice.blade.php
deleted file mode 100644
index f1e88ed1..00000000
--- a/resources/views/oasis/invoices/invoice.blade.php
+++ /dev/null
@@ -1,288 +0,0 @@
-
-
-
-
-
-
-
-
-
- @if(is_route('invoice-debug'))
-
-
-
- @else
-
-
-
- @endif
-
- {{ __t('in.invoice') }}
-
-
-
-
- {{--Invoice header--}}
-
-
-
-
-
-
-
{{ __t('in.doc.customer') }}:
-
{{ $invoice->client['name'] }}
-
{{ $invoice->client['address'] }}, {{ $invoice->client['city'] }}
-
{{ $invoice->client['postal_code'] }} {{ $invoice->client['country'] }}
-
-
-
- @isset($invoice->client['ico'])
- {{ __t('in_editor.ico') }} : {{ $invoice->client['ico'] }}
- @endisset
- @isset($invoice->client['dic'])
- {{ __t('in_editor.dic') }} : {{ $invoice->client['dic'] }}
- @endisset
- @isset($invoice->client['ic_dph'])
- {{ __t('in_editor.ic_dph') }} : {{ $invoice->client['ic_dph'] }}
- @endisset
-
-
-
-
-
{{ __t('in.doc.date_of_issue') }}: {{ format_date($invoice->created_at, '%d. %B %Y') }}
-
{{ __t('in.doc.date_of_delivery') }}: {{ format_date($invoice->delivery_at, '%d. %B %Y') }}
-
{{ __t('in.doc.due_date') }}: {{ format_date($invoice->due_at, '%d. %B %Y') }}
-
-
-
-
-
{{ __t('in.doc.supplier') }}:
-
{{ $invoice->user['company'] }}
-
{{ $invoice->user['registration_notes'] }}
-
-
-
-
{{ __t('in.doc.headquarters') }}:
-
{{ $invoice->user['address'] }} {{ $invoice->user['city'] }}
-
{{ $invoice->user['postal_code'] }}, {{ $invoice->user['country'] }}
-
-
-
-
{{ __t('user_settings.title_billing') }}:
-
- @isset($invoice->user['ico'])
-
{{ __t('in_editor.ico') }}: {{ $invoice->user['ico'] }}
- @endisset
- @isset($invoice->user['dic'])
-
{{ __t('in_editor.dic') }}: {{ $invoice->user['dic'] }}
- @endisset
- @isset($invoice->user['ic_dph'])
-
{{ __t('in_editor.ic_dph') }}: {{ $invoice->user['ic_dph'] }}
- @endisset
-
-
{{ $invoice->user['bank'] }}
-
{{ __t('in.form.iban') }}: {{ $invoice->user['iban'] }}, {{ __t('in.form.swift_code') }}: {{ $invoice->user['swift'] }}
-
-
-
- {{--Special info--}}
-
-
-
- {{ __t('in.doc.bank_account_number') }}:
- {{ $invoice->user['iban'] }}
-
-
-
-
- {{ __t('in.doc.variable_symbol') }}:
- {{ $invoice->variable_number }}
-
-
-
-
- {{ __t('in.doc.due_date') }}:
- {{ format_date($invoice->due_at, '%d. %h. %Y') }}
-
-
-
-
- {{ __t('in.doc.sum_to_pay') }}:
- {{ format_to_currency($invoice->total_net) }}
-
-
-
-
- {{--Items table--}}
-
-
-
-
- {{ __t('in.doc.item.name') }}
-
-
- {{ __t('in.doc.item.amount') }}
-
-
- {{ __t('in.doc.item.price_per_unit') }}
-
-
- {{ __t('in.doc.item.total') }}
-
- @if($invoice->user['ic_dph'])
-
- {{ __t('in.doc.item.vat_rate') }}
-
-
- {{ __t('in.doc.item.vat') }}
-
-
- {{ __t('in.doc.item.total_with_vat') }}
-
- @endif
-
-
-
-
- @foreach($invoice->items as $item)
-
-
- {{ $item['description'] }}
-
-
- {{ $item['amount'] }}
-
-
- {{ format_to_currency($item['price']) }}
-
-
-
- {{ format_to_currency($item['price'] * $item['amount']) }}
-
-
- @if($invoice->user['ic_dph'])
-
- {{ $item['tax_rate'] }} %
-
- @endif
-
- @if($invoice->user['ic_dph'])
-
- {{ format_to_currency(invoice_item_only_tax_price($item)) }}
-
-
- {{ format_to_currency(invoice_item_with_tax_price($item)) }}
-
- @endif
-
- @endforeach
-
-
-
-
-
- {{--Item Summary--}}
-
-
- @if($invoice->discount_type)
-
- {{ __t('in.doc.discount') }}:
- -{{ $invoice->discount_type === 'percent' ? $invoice->discount_rate . '%' : format_to_currency($invoice->discount_rate) }}
-
- @endif
-
- {{--VAT Base--}}
- @if($invoice->user['ic_dph'])
-
- @foreach(invoice_tax_base($invoice) as $item)
-
- {{ __t('in.doc.vat_base') }} {{ $item['rate'] }}%:
- {{ format_to_currency($item['total']) }}
-
- @endforeach
-
- @endif
-
- {{--VAT Summary--}}
- @if($invoice->user['ic_dph'])
-
- @foreach(invoice_tax_summary($invoice) as $item)
-
- {{ __t('in.doc.item.vat') }} {{ $item['rate'] }}%:
- {{ format_to_currency($item['total']) }}
-
- @endforeach
-
- @endif
-
-
- {{ __t('in.doc.sum_to_pay') }}:
- {{ format_to_currency(invoice_total($invoice)) }}
-
-
-
-
-
-
{{ __t('in.doc.thanks') }}
-
-
- {{--Invoice author--}}
-
-
- @if(! $invoice->user['ic_dph'])
-
{{ __t('in.doc.not_vat_payer') }}
- @endif
-
-
- @if(is_route('invoice-debug') && $user->invoiceProfile->stamp)
-
- @endif
-
- @if(! is_route('invoice-debug') && $user->invoiceProfile->stamp)
-
- @endif
-
-
{{ __t('in.doc.creator') }}: {{ $invoice->user['author'] }}
-
-
-
- {{--Invoice Footer--}}
-
-
-
-
diff --git a/routes/oasis.php b/routes/oasis.php
index 8309b15e..103be547 100644
--- a/routes/oasis.php
+++ b/routes/oasis.php
@@ -1,11 +1,7 @@
'api', 'prefix' => '/api/oasis'], function () {
// Admin
@@ -21,51 +17,9 @@ Route::group(['middleware' => 'api', 'prefix' => '/api/oasis'], function () {
Route::get('/{order}', [SubscriptionController::class, 'get_subscription_request']);
Route::get('/{order}/setup-intent', [SubscriptionController::class, 'get_setup_intent']);
});
-
- // Invoices
- Route::group(['middleware' => 'auth:sanctum', 'prefix' => 'invoices'], function () {
- Route::get('/regular', [InvoiceController::class, 'get_all_regular_invoices']);
- Route::get('/advance', [InvoiceController::class, 'get_all_advance_invoices']);
- Route::get('/search', [InvoiceController::class, 'search']);
-
- Route::get('/profile', [InvoiceProfileController::class, 'show']);
- Route::post('/profile', [InvoiceProfileController::class, 'store']);
- Route::patch('/profile', [InvoiceProfileController::class, 'update']);
-
- Route::get('/editor', [InvoiceController::class, 'editor']);
-
- Route::get('/{invoice}', [InvoiceController::class, 'get_single_invoice']);
- Route::delete('/{invoice}', [InvoiceController::class, 'destroy']);
- Route::post('/{invoice}', [InvoiceController::class, 'update']);
- Route::post('/{invoice}/share', [InvoiceController::class, 'share']);
- Route::post('/', [InvoiceController::class, 'store']);
- });
-
- // Clients
- Route::group(['prefix' => 'clients'], function () {
- Route::get('/', [ClientController::class, 'index']);
- Route::get('/search', [ClientController::class, 'search']);
-
- Route::get('/{client}', [ClientController::class, 'show']);
- Route::get('/{client}/invoices', [ClientController::class, 'show_invoices']);
- Route::patch('/{client}', [ClientController::class, 'update']);
- Route::delete('/{client}', [ClientController::class, 'destroy']);
-
- Route::post('/', [ClientController::class, 'store']);
- });
});
// Web routes
Route::group(['middleware' => 'web', 'prefix' => 'oasis'], function () {
Route::post('/subscribe/{order}/set-password', [SubscriptionController::class, 'set_password']);
-
- // Invoices
- Route::group(['middleware' => 'auth:sanctum'], function () {
- Route::get('/invoice/{invoice}', [InvoiceController::class, 'download_invoice']);
- });
-});
-
-// Debug routes
-Route::group(['middleware' => 'web', 'prefix' => 'oasis/debug'], function () {
- Route::get('/invoice', [OasisDevService::class, 'get_invoice_view'])->name('invoice-debug');
});
diff --git a/tests/Feature/Oasis/OasisClientTest.php b/tests/Feature/Oasis/OasisClientTest.php
deleted file mode 100644
index 61e2c514..00000000
--- a/tests/Feature/Oasis/OasisClientTest.php
+++ /dev/null
@@ -1,300 +0,0 @@
-create();
-
- $this->assertDatabaseHas('clients', [
- 'name' => $client->name,
- ]);
- }
-
- /**
- * @test
- */
- public function it_create_new_client_with_avatar()
- {
- Storage::fake('local');
-
- $avatar = UploadedFile::fake()
- ->image('fake-image.jpg');
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $this->postJson('/api/oasis/clients', [
- 'avatar' => $avatar,
- 'name' => 'VueFileManager Inc.',
-
- 'email' => 'howdy@hi5ve.digital',
- 'phone_number' => '+421 950 123 456',
-
- 'address' => 'Does 12',
- 'city' => 'Bratislava',
- 'postal_code' => '076 54',
- 'country' => 'SK',
-
- 'ico' => '11111111',
- 'dic' => '11111111',
- 'ic_dph' => 'SK11111111',
- ])->assertStatus(201);
-
- $this->assertDatabaseHas('clients', [
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- 'email' => 'howdy@hi5ve.digital',
- ]);
-
- Storage::disk('local')
- ->assertExists(
- Client::first()->getRawOriginal('avatar')
- );
- }
-
- /**
- * @test
- */
- public function it_create_new_client_without_avatar_and_contact_info()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $this->postJson('/api/oasis/clients', [
- 'avatar' => null,
- 'name' => 'VueFileManager Inc.',
- 'email' => null,
- 'phone_number' => null,
- 'address' => 'Does 12',
- 'city' => 'Bratislava',
- 'postal_code' => '076 54',
- 'country' => 'SK',
- 'ico' => '11111111',
- 'dic' => '11111111',
- 'ic_dph' => 'SK11111111',
- ])->assertStatus(201);
-
- $this->assertDatabaseHas('clients', [
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- ]);
- }
-
- /**
- * @test
- */
- public function it_update_client_info()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $client = Client::factory(Client::class)
- ->create(['user_id' => $user->id]);
-
- $this->patchJson("/api/oasis/clients/$client->id", [
- 'name' => 'name',
- 'value' => 'VueFileManager Inc.',
- ])->assertStatus(204);
-
- $this->assertDatabaseHas('clients', [
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- ]);
- }
-
- /**
- * @test
- */
- public function it_update_client_avatar()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $client = Client::factory(Client::class)
- ->create(['user_id' => $user->id]);
-
- $avatar = UploadedFile::fake()
- ->image('fake-image.jpg');
-
- $this->patchJson("/api/oasis/clients/$client->id", [
- 'name' => 'avatar',
- 'avatar' => $avatar,
- ])->assertStatus(204);
-
- $this->assertDatabaseMissing('clients', [
- 'user_id' => $user->id,
- 'avatar' => null,
- ]);
-
- Storage::disk('local')->assertExists(
- Client::first()->getRawOriginal('avatar')
- );
- }
-
- /**
- * @test
- */
- public function it_delete_client()
- {
- Storage::fake('local');
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $avatar = UploadedFile::fake()
- ->image('fake-image.jpg');
-
- Storage::putFileAs('avatar', $avatar, 'fake-image.jpg');
-
- $client = Client::factory(Client::class)
- ->create([
- 'avatar' => 'avatar/fake-image.jpg',
- 'user_id' => $user->id,
- ]);
-
- $this->deleteJson("/api/oasis/clients/$client->id")
- ->assertStatus(204);
-
- $this->assertDatabaseMissing('clients', [
- 'id' => $client->id
- ]);
-
- Storage::disk('local')
- ->assertMissing('avatar/fake-image.jpg');
- }
-
- /**
- * @test
- */
- public function it_get_single_client()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $client = Client::factory(Client::class)
- ->create([
- 'user_id' => $user->id,
- ]);
-
- $this->getJson("/api/oasis/clients/$client->id")
- ->assertJsonFragment([
- 'id' => $client->id,
- ])->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_get_client_client_invoices()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $client = Client::factory(Client::class)
- ->create([
- 'user_id' => $user->id,
- ]);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- $invoice = Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'client_id' => $client->id,
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => 2001212,
- 'client' => [
- 'name' => 'VueFileManager Inc.',
- ],
- 'user' => $profile->toArray(),
- ]);
-
- $this->getJson("/api/oasis/clients/$client->id/invoices")
- ->assertJsonFragment([
- 'id' => $invoice->id,
- ])
- ->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_get_all_clients()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- Client::factory(Client::class)
- ->count(2)
- ->create([
- 'user_id' => $user->id,
- ]);
-
- $this->getJson('/api/oasis/clients')
- ->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_search_user_client()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $client = Client::factory(Client::class)
- ->create([
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- 'email' => 'info@company.com',
- ]);
-
- $this->getJson('/api/oasis/clients/search?query=vue')
- ->assertJsonFragment([
- 'id' => $client->id,
- ])->assertStatus(200);
-
- $this->getJson('/api/oasis/clients/search?query=inf')
- ->assertJsonFragment([
- 'id' => $client->id,
- ])->assertStatus(200);
- }
-}
diff --git a/tests/Feature/Oasis/OasisInvoiceProfileTest.php b/tests/Feature/Oasis/OasisInvoiceProfileTest.php
deleted file mode 100644
index 39eef6ea..00000000
--- a/tests/Feature/Oasis/OasisInvoiceProfileTest.php
+++ /dev/null
@@ -1,145 +0,0 @@
-create(['role' => 'user']);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $this->getJson('/api/oasis/invoices/profile')
- ->assertStatus(200)
- ->assertJsonFragment([
- 'company' => $profile->company,
- ]);
- }
-
- /**
- * @test
- */
- public function user_store_invoice_profile_with_images()
- {
- Storage::fake('local');
-
- $image = UploadedFile::fake()
- ->image('fake-image.jpg');
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $this->postJson('/api/oasis/invoices/profile', [
- 'company' => 'VueFileManager Inc.',
- 'registration_notes' => 'Some registration notes',
- 'logo' => $image,
-
- 'ico' => '11111111',
- 'dic' => '11111111',
- 'ic_dph' => 'SK20002313123',
-
- 'address' => 'Does 11',
- 'state' => 'Slovakia',
- 'city' => 'Bratislava',
- 'postal_code' => '04001',
- 'country' => 'SK',
-
- 'bank' => 'Fio Banka',
- 'iban' => 'SK20000054236423624',
- 'swift' => 'FIOZXXX',
-
- 'phone' => '+421950123456',
- 'email' => 'howdy@hi5ve.digital',
- 'author' => 'John Doe',
- 'stamp' => $image,
- ])->assertStatus(201)
- ->assertJsonFragment([
- 'company' => 'VueFileManager Inc.',
- ]);
-
- $this->assertDatabaseHas('invoice_profiles', [
- 'user_id' => $user->id,
- 'company' => 'VueFileManager Inc.',
- 'email' => 'howdy@hi5ve.digital',
- ]);
-
- $profile = InvoiceProfile::first();
-
- Storage::disk('local')->assertExists($profile->logo);
- Storage::disk('local')->assertExists($profile->stamp);
- }
-
- /**
- * @test
- */
- public function user_update_invoice_profile_column()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $this->patchJson('/api/oasis/invoices/profile', [
- 'name' => 'company',
- 'value' => 'VueFileManager Inc.',
- ])->assertStatus(204);
-
- $this->assertDatabaseHas('invoice_profiles', [
- 'user_id' => $user->id,
- 'company' => 'VueFileManager Inc.',
- ]);
- }
-
- /**
- * @test
- */
- public function user_update_invoice_profile_logo()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $image = UploadedFile::fake()
- ->image('fake-image.jpg');
-
- $this->patchJson('/api/oasis/invoices/profile', [
- 'name' => 'logo',
- 'logo' => $image,
- ])->assertStatus(204);
-
- $this->assertDatabaseMissing('invoice_profiles', [
- 'logo' => null,
- ]);
-
- Storage::disk('local')->assertExists(
- InvoiceProfile::first()->logo
- );
- }
-}
diff --git a/tests/Feature/Oasis/OasisInvoiceTest.php b/tests/Feature/Oasis/OasisInvoiceTest.php
deleted file mode 100644
index 3f2f40cc..00000000
--- a/tests/Feature/Oasis/OasisInvoiceTest.php
+++ /dev/null
@@ -1,802 +0,0 @@
-items = [
- [
- 'description' => "No, I've made up my mind about it; if I'm Mabel, I'll stay.",
- 'amount' => 1,
- 'tax_rate' => 20,
- 'price' => 200,
- ],
- [
- 'description' => "I only knew the right words,' said poor Alice, who felt.",
- 'amount' => 3,
- 'tax_rate' => 20,
- 'price' => 500,
- ],
- ];
-
- $this->client = [
- 'email' => 'howdy@hi5ve.digital',
- 'name' => 'VueFileManager Inc.',
- 'address' => 'Does 12',
- 'city' => 'Bratislava',
- 'postal_code' => '076 54',
- 'country' => 'SK',
- 'ico' => 11111111,
- 'dic' => 11111111,
- 'ic_dph' => 'SK11111111',
- ];
- }
-
- /**
- * @test
- */
- public function it_test_invoice_item_only_tax_price_function()
- {
- $item = [
- 'description' => 'Test 1',
- 'amount' => 1,
- 'tax_rate' => 20,
- 'price' => 20,
- ];
-
- $this->assertEquals(4, invoice_item_only_tax_price($item));
- }
-
- /**
- * @test
- */
- public function it_test_invoice_item_with_tax_price_function()
- {
- $item = [
- 'description' => 'Test 1',
- 'amount' => 1,
- 'tax_rate' => 20,
- 'price' => 20,
- ];
-
- $this->assertEquals(24, invoice_item_with_tax_price($item));
- }
-
- /**
- * @test
- */
- public function it_test_invoice_total_net()
- {
- $invoice = [
- 'user' => [
- 'ic_dph' => 43123545233
- ],
- 'discount_type' => null,
- 'currency' => 'CZK',
- 'items' => [
- [
- 'description' => 'Test 1',
- 'amount' => 1,
- 'tax_rate' => 20,
- 'price' => 20,
- ],
- [
- 'description' => 'Test 2',
- 'amount' => 3,
- 'tax_rate' => 20,
- 'price' => 50,
- ],
- ]
- ];
-
- $this->assertEquals(204, invoice_total($invoice));
- }
-
- /**
- * @test
- */
- public function it_test_invoice_total_tax()
- {
- $invoice = [
- 'currency' => 'CZK',
- 'discount_type' => 'value',
- 'discount_rate' => 18,
- 'items' => [
- [
- 'description' => 'Test 1',
- 'amount' => 1,
- 'tax_rate' => 20,
- 'price' => 100,
- ],
- [
- 'description' => 'Test 2',
- 'amount' => 2,
- 'tax_rate' => 10,
- 'price' => 100,
- ],
- ]
- ];
-
- $this->assertEquals(40, invoice_total_tax($invoice));
- }
-
- /**
- * @test
- */
- public function it_test_invoice_factory()
- {
- $invoice_profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create();
-
- $invoice = Invoice::factory(Invoice::class)
- ->create(['user' => $invoice_profile->toArray()]);
-
- $this->assertDatabaseHas('invoices', [
- 'id' => $invoice->id,
- ]);
-
- $this->assertDatabaseMissing('invoices', [
- 'user' => null,
- ]);
- }
-
- /**
- * @test
- */
- public function user_create_new_invoice_with_storing_new_client()
- {
- Notification::fake();
- Storage::fake('local');
- PDF::fake();
-
- $avatar = UploadedFile::fake()
- ->image('fake-image.jpg');
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $this->postJson('/api/oasis/invoices', [
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => '2120001',
- 'variable_number' => '2120001',
- 'items' => json_encode($this->items),
- 'discount_type' => 'percent',
- 'discount_rate' => 10,
- 'delivery_at' => Carbon::now()->addWeek(),
- 'store_client' => true,
- 'send_invoice' => true,
- 'client' => 'others',
- 'client_avatar' => $avatar,
- 'client_name' => 'VueFileManager Inc.',
- 'client_email' => 'howdy@hi5ve.digital',
- 'client_phone_number' => '+421 950 123 456',
- 'client_address' => 'Does 12',
- 'client_city' => 'Bratislava',
- 'client_postal_code' => '076 54',
- 'client_country' => 'SK',
- 'client_ico' => 11111111,
- 'client_dic' => 11111111,
- 'client_ic_dph' => 'SK11111111',
- ])->assertStatus(201);
-
- $this->assertDatabaseHas('invoices', [
- 'invoice_number' => '2120001',
- 'user_id' => $user->id,
- 'items' => json_encode($this->items),
- 'client' => json_encode($this->client),
- ]);
-
- $this->assertDatabaseHas('clients', [
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- 'email' => 'howdy@hi5ve.digital',
- ]);
-
- Storage::disk('local')
- ->assertExists(
- Client::first()->getRawOriginal('avatar')
- );
-
- PDF::assertFileNameIs(storage_path("app/" . invoice_path(Invoice::first())));
-
- Notification::assertTimesSent(1, InvoiceDeliveryNotification::class);
- }
-
- /**
- * @test
- */
- public function user_create_new_invoice_with_storing_new_client_without_avatar_and_mail()
- {
- Storage::fake('local');
- Notification::fake();
- PDF::fake();
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $this->postJson('/api/oasis/invoices', [
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => '2120001',
- 'variable_number' => '2120001',
- 'items' => json_encode($this->items),
- 'discount_type' => 'percent',
- 'discount_rate' => 10,
- 'delivery_at' => Carbon::now()->addWeek(),
- 'store_client' => true,
- 'send_invoice' => true,
- 'client' => 'others',
- 'client_avatar' => null,
- 'client_name' => 'VueFileManager Inc.',
- 'client_email' => null,
- 'client_phone_number' => '+421 950 123 456',
- 'client_address' => 'Does 12',
- 'client_city' => 'Bratislava',
- 'client_postal_code' => '076 54',
- 'client_country' => 'SK',
- 'client_ico' => 11111111,
- 'client_dic' => 11111111,
- 'client_ic_dph' => 'SK11111111',
- ])->assertStatus(201);
-
- $this->assertDatabaseHas('invoices', [
- 'invoice_number' => '2120001',
- 'user_id' => $user->id,
- 'items' => json_encode($this->items),
- ]);
-
- $this->assertDatabaseHas('clients', [
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- ]);
-
- PDF::assertFileNameIs(storage_path("app/" . invoice_path(Invoice::first())));
-
- Notification::assertNothingSent();
- }
-
- /**
- * @test
- */
- public function user_create_new_invoice_without_storing_client_without_avatar_and_mail()
- {
- Storage::fake('local');
- Notification::fake();
- PDF::fake();
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $this->postJson('/api/oasis/invoices', [
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => '2120001',
- 'variable_number' => '2120001',
- 'items' => json_encode($this->items),
- 'discount_type' => 'percent',
- 'discount_rate' => 10,
- 'delivery_at' => Carbon::now()->addWeek(),
- 'store_client' => false,
- 'send_invoice' => false,
- 'client' => 'others',
- 'client_avatar' => null,
- 'client_name' => 'VueFileManager Inc.',
- 'client_email' => 'howdy@hi5ve.digital',
- 'client_phone_number' => '+421 950 123 456',
- 'client_address' => 'Does 12',
- 'client_city' => 'Bratislava',
- 'client_postal_code' => '076 54',
- 'client_country' => 'SK',
- 'client_ico' => 11111111,
- 'client_dic' => 11111111,
- 'client_ic_dph' => 'SK11111111',
- ])->assertStatus(201);
-
- $this->assertDatabaseHas('invoices', [
- 'invoice_number' => '2120001',
- 'user_id' => $user->id,
- 'items' => json_encode($this->items),
- 'client' => json_encode($this->client),
- ]);
-
- $this->assertDatabaseMissing('clients', [
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- ]);
-
- PDF::assertFileNameIs(storage_path("app/" . invoice_path(Invoice::first())));
-
- Notification::assertNothingSent();
- }
-
- /**
- * @test
- */
- public function user_create_new_invoice_without_storing_client()
- {
- Storage::fake('local');
- Notification::fake();
- PDF::fake();
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $this->postJson('/api/oasis/invoices', [
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => '2120001',
- 'variable_number' => '2120001',
- 'items' => json_encode($this->items),
- 'discount_type' => 'percent',
- 'discount_rate' => 10,
- 'delivery_at' => Carbon::now()->addWeek(),
- 'store_client' => false,
- 'send_invoice' => true,
- 'client' => 'others',
- 'client_name' => 'VueFileManager Inc.',
- 'client_email' => 'howdy@hi5ve.digital',
- 'client_phone_number' => '+421 950 123 456',
- 'client_address' => 'Does 12',
- 'client_city' => 'Bratislava',
- 'client_postal_code' => '076 54',
- 'client_country' => 'SK',
- 'client_ico' => 11111111,
- 'client_dic' => 11111111,
- 'client_ic_dph' => 'SK11111111',
- ])->assertStatus(201);
-
- $this->assertDatabaseHas('invoices', [
- 'invoice_number' => '2120001',
- 'user_id' => $user->id,
- 'items' => json_encode($this->items),
- 'client' => json_encode($this->client),
- ]);
-
- $this->assertDatabaseMissing('clients', [
- 'name' => 'VueFileManager Inc.',
- 'email' => 'howdy@hi5ve.digital',
- ]);
-
- PDF::assertFileNameIs(storage_path("app/" . invoice_path(Invoice::first())));
-
- Notification::assertTimesSent(1, InvoiceDeliveryNotification::class);
- }
-
- /**
- * @test
- */
- public function user_create_new_invoice_with_existing_client()
- {
- Storage::fake('local');
- Notification::fake();
- PDF::fake();
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $client = Client::factory(Client::class)
- ->create([
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- 'email' => 'howdy@hi5ve.digital',
- ]);
-
- $this->postJson('/api/oasis/invoices', [
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => '2120001',
- 'variable_number' => '2120001',
- 'client' => $client->id,
- 'items' => json_encode($this->items),
- 'discount_type' => 'percent',
- 'discount_rate' => 10,
- 'delivery_at' => Carbon::now()->addWeek(),
- 'send_invoice' => true,
- ])->assertStatus(201);
-
- $this->assertDatabaseHas('invoices', [
- 'invoice_number' => '2120001',
- 'user_id' => $user->id,
- 'client_id' => $client->id,
- 'items' => json_encode($this->items),
- ]);
-
- PDF::assertFileNameIs(storage_path("app/" . invoice_path(Invoice::first())));
-
- Notification::assertTimesSent(1, InvoiceDeliveryNotification::class);
- }
-
- /**
- * @test
- */
- public function user_update_existing_invoice()
- {
- PDF::fake();
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- $invoice = Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'user' => $profile->toArray(),
- ]);
-
- $this->postJson("/api/oasis/invoices/$invoice->id", [
- 'invoice_number' => '2120001',
- 'variable_number' => '2120001',
- 'items' => json_encode($this->items),
- 'discount_type' => 'value',
- 'discount_rate' => 10,
- 'delivery_at' => Carbon::now()->addWeek(),
- ])->assertStatus(204);
-
- $this->assertDatabaseHas('invoices', [
- 'invoice_number' => '2120001',
- 'discount_type' => 'value',
- 'items' => json_encode($this->items),
- 'discount_rate' => 10,
- 'total_net' => 2030,
- ]);
-
- PDF::assertFileNameIs(storage_path("app/" . invoice_path(Invoice::first())));
- }
-
- /**
- * @test
- */
- public function user_delete_invoice()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- $invoice = Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'user' => $profile->toArray(),
- ]);
-
- \PDF::loadView('oasis.invoices.invoice', [
- 'invoice' => Invoice::find($invoice->id),
- 'user' => $user,
- ])
- ->setPaper('a4')
- ->setOrientation('portrait')
- ->save(
- storage_path("app/files/{$invoice->user_id}/invoice-{$invoice->id}.pdf")
- );
-
- Storage::disk('local')
- ->assertExists(
- invoice_path($invoice)
- );
-
- $this->delete("/api/oasis/invoices/$invoice->id");
-
- $this->assertDatabaseMissing('invoices', [
- 'id' => $invoice->id
- ]);
-
- Storage::disk('local')
- ->assertMissing(
- invoice_path($invoice)
- );
- }
-
- /**
- * @test
- */
- public function it_download_invoice_from_url()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $client = Client::factory(Client::class)
- ->create([
- 'user_id' => $user->id,
- 'name' => 'VueFileManager Inc.',
- 'email' => 'howdy@hi5ve.digital',
- ]);
-
- $this->postJson('/api/oasis/invoices', [
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => '2120001',
- 'variable_number' => '2120001',
- 'client' => $client->id,
- 'items' => json_encode($this->items),
- 'discount_type' => 'percent',
- 'discount_rate' => 10,
- 'delivery_at' => Carbon::now()->addWeek(),
- 'send_invoice' => true,
- ])->assertStatus(201);
-
- $invoice = Invoice::first();
-
- $this->get("/oasis/invoice/{$invoice->id}")
- ->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_get_single_invoice()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $invoice = Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'user' => $profile->toArray(),
- ]);
-
- $this->getJson("/api/oasis/invoices/$invoice->id")
- ->assertJsonFragment([
- 'id' => $invoice->id,
- ])->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_get_all_user_regular_invoices()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $invoice = Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'user' => $profile->toArray(),
- ]);
-
- $this->getJson('/api/oasis/invoices/regular')
- ->assertJsonFragment([
- 'id' => $invoice->id,
- ])->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_get_all_user_advance_invoices()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $invoice = Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'advance-invoice',
- 'user' => $profile->toArray(),
- ]);
-
- $this->getJson('/api/oasis/invoices/advance')
- ->assertJsonFragment([
- 'id' => $invoice->id,
- ])->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_search_user_regular_invoice()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => 2001212,
- 'client' => [
- 'name' => 'VueFileManager Inc.',
- ],
- 'user' => $profile->toArray(),
- ]);
-
- $this->getJson('/api/oasis/invoices/search?type=regular-invoice&query=2001212')
- ->assertJsonFragment([
- 'invoice_number' => '2001212',
- ])->assertStatus(200);
-
- $this->getJson('/api/oasis/invoices/search?type=regular-invoice&query=Vue')
- ->assertJsonFragment([
- 'invoice_number' => '2001212',
- ])->assertStatus(200);
- }
-
- /**
- * @test
- */
- public function it_get_data_for_invoice_editor()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- $client = Client::factory(Client::class)
- ->count(2)
- ->create(['user_id' => $user->id]);
-
- $client->pluck('id')
- ->each(function ($id) {
- $this->getJson('/api/oasis/invoices/editor')
- ->assertStatus(200)
- ->assertJsonFragment([
- 'value' => $id,
- 'recommendedInvoiceNumber' => '20210001',
- ]);
- });
- }
-
- /**
- * @test
- */
- public function it_get_default_recommended_invoice_number()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- $this->getJson('/api/oasis/invoices/editor')
- ->assertStatus(200)
- ->assertJsonFragment([
- 'latestInvoiceNumber' => null,
- 'recommendedInvoiceNumber' => '20210001',
- ]);
- }
-
- /**
- * @test
- */
- public function it_get_next_invoice_number_after_latest_invoice_number()
- {
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- Sanctum::actingAs($user);
-
- InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'invoice_number' => 20210001,
- 'client' => [
- 'name' => 'VueFileManager Inc.',
- ],
- 'user' => [
- 'ic_dph' => 423143124213
- ],
- ]);
-
- $this->getJson('/api/oasis/invoices/editor')
- ->assertStatus(200)
- ->assertJsonFragment([
- 'latestInvoiceNumber' => 20210001,
- 'recommendedInvoiceNumber' => 20210002,
- ]);
- }
-
- /**
- * @test
- */
- public function it_send_single_invoice_on_email()
- {
- Notification::fake();
-
- $user = User::factory(User::class)
- ->create(['role' => 'user']);
-
- $profile = InvoiceProfile::factory(InvoiceProfile::class)
- ->create(['user_id' => $user->id]);
-
- Sanctum::actingAs($user);
-
- $invoice = Invoice::factory(Invoice::class)
- ->create([
- 'user_id' => $user->id,
- 'invoice_type' => 'regular-invoice',
- 'user' => $profile->toArray(),
- ]);
-
- $this->postJson("/api/oasis/invoices/$invoice->id/share", [
- 'email' => 'john@doe.com',
- ])->assertStatus(204);
-
- Notification::assertTimesSent(1, InvoiceDeliveryNotification::class);
- }
-}
diff --git a/webpack.mix.js b/webpack.mix.js
index 200dbf0b..614907c8 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -34,12 +34,12 @@ mix.js('resources/js/main.js', 'public/js')
clientLogLevel: 'none'
}
})
- .options({
+ /*.options({
hmrOptions: {
host: '192.168.1.198',
port: '8080'
},
- })
+ })*/
.disableNotifications();
if (mix.inProduction()) {