Compare commits
210 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edb4a90823 | ||
|
|
ec0ec4401a | ||
|
|
7b82c799f2 | ||
|
|
a75fd54e8a | ||
|
|
70d263dfa2 | ||
|
|
1463544bdb | ||
|
|
59de0216ac | ||
|
|
69c0b5e530 | ||
|
|
d3edf6ab21 | ||
|
|
fba8e6bb9f | ||
|
|
9b74091119 | ||
|
|
7d1c236c27 | ||
|
|
260f8a909c | ||
|
|
7d7f05b5ee | ||
|
|
5f610a9d49 | ||
|
|
e0d903629a | ||
|
|
93ab20492e | ||
|
|
ebf5666b2a | ||
|
|
5bf7c07048 | ||
|
|
ba0380c0e7 | ||
|
|
9ddcea260d | ||
|
|
c1096d7100 | ||
|
|
d2221ff20b | ||
|
|
13a0789089 | ||
|
|
b95982de03 | ||
|
|
d25fc0c72d | ||
|
|
5ecdc6e084 | ||
|
|
72c4aed24b | ||
|
|
3d58ec0aec | ||
|
|
0a39fbb141 | ||
|
|
9bcd4e028b | ||
|
|
9ee4512e01 | ||
|
|
8b855003a1 | ||
|
|
f9e44df6fe | ||
|
|
9ceda7dfb5 | ||
|
|
ca386a2e62 | ||
|
|
5851a3ed7d | ||
|
|
87f63d07fc | ||
|
|
cf69b439c0 | ||
|
|
5f8d0afe1b | ||
|
|
8ed57d5edf | ||
|
|
9ca4bf2d02 | ||
|
|
1bb5a8efd4 | ||
|
|
63d17685de | ||
|
|
38349476fb | ||
|
|
76631a7f59 | ||
|
|
76c4cc982f | ||
|
|
7be517f0c3 | ||
|
|
b66ed112ef | ||
|
|
027aef9ce0 | ||
|
|
d2e8b1e884 | ||
|
|
7157225aa7 | ||
|
|
fd8d4b835c | ||
|
|
2d8d375cbf | ||
|
|
8f10b89736 | ||
|
|
47be5a5f3a | ||
|
|
830a82ff9b | ||
|
|
996afc767c | ||
|
|
a536b9d6b8 | ||
|
|
3925173bee | ||
|
|
9969f52bd6 | ||
|
|
5121a02b4d | ||
|
|
41b4812c50 | ||
|
|
284daf314b | ||
|
|
a612dcde86 | ||
|
|
9648764acb | ||
|
|
fd8e5b886a | ||
|
|
775917cbac | ||
|
|
22be3c2a84 | ||
|
|
b90c423569 | ||
|
|
159fe7120e | ||
|
|
a65acadafa | ||
|
|
1979eccadd | ||
|
|
c1526b59ae | ||
|
|
a369e017c9 | ||
|
|
788344783e | ||
|
|
e2c71df8b6 | ||
|
|
5253cbc902 | ||
|
|
84a54b08c7 | ||
|
|
03a1c2be8a | ||
|
|
d5e5acf6c4 | ||
|
|
95c36f111b | ||
|
|
60897083d1 | ||
|
|
7d61ec8317 | ||
|
|
f7747f06f5 | ||
|
|
45acf67daa | ||
|
|
7364b8e021 | ||
|
|
b54dc7bf0a | ||
|
|
70444c7a12 | ||
|
|
6a146e8fff | ||
|
|
cfeee5f98c | ||
|
|
53bebc4d0f | ||
|
|
2204272953 | ||
|
|
2897fdaa9e | ||
|
|
de5d5d3b10 | ||
|
|
35d5f532bc | ||
|
|
2d243be4ae | ||
|
|
53c8f8d6e0 | ||
|
|
9e489535cc | ||
|
|
8816bd30c3 | ||
|
|
2b8af442cc | ||
|
|
d73e56cbb6 | ||
|
|
bdecb380fc | ||
|
|
7aa172b1db | ||
|
|
9d7145c61b | ||
|
|
97713e130b | ||
|
|
1ddffc01c9 | ||
|
|
7e973ff91e | ||
|
|
ebcbbbaa1f | ||
|
|
bf6e93f8d8 | ||
|
|
1937169640 | ||
|
|
49038a0c17 | ||
|
|
3e86707f9f | ||
|
|
b427a69735 | ||
|
|
487d44ba67 | ||
|
|
a4a55f5369 | ||
|
|
35795e415b | ||
|
|
64674fea24 | ||
|
|
2ecab1b6a6 | ||
|
|
c97a3b8c16 | ||
|
|
3689a70e36 | ||
|
|
597cfc0662 | ||
|
|
fa5c787140 | ||
|
|
32a9df4e67 | ||
|
|
7106056115 | ||
|
|
0b1a8d7572 | ||
|
|
32002bcfc3 | ||
|
|
9a4b63adbb | ||
|
|
136ae88f95 | ||
|
|
7ae74ab8ed | ||
|
|
c51f27803f | ||
|
|
ebd87245af | ||
|
|
64269c5fc0 | ||
|
|
a164e945a7 | ||
|
|
e619d1d541 | ||
|
|
40c30cce2f | ||
|
|
b5aee8a8bf | ||
|
|
63b331dcc8 | ||
|
|
956f2fda33 | ||
|
|
7cedb82d1e | ||
|
|
8dbd44d37d | ||
|
|
4c6c71a85d | ||
|
|
37126963f6 | ||
|
|
e751a1ddbf | ||
|
|
e3039763c6 | ||
|
|
d6049b026e | ||
|
|
d5c264f540 | ||
|
|
21cc007474 | ||
|
|
a66b500fc6 | ||
|
|
fd4cf13234 | ||
|
|
26ae669659 | ||
|
|
5c85088a23 | ||
|
|
955ab0c5db | ||
|
|
dcfd178c20 | ||
|
|
d50b754cb0 | ||
|
|
9372a304c7 | ||
|
|
54b47d4ac0 | ||
|
|
d398ae2411 | ||
|
|
9dfa3bc9dd | ||
|
|
22e739ca26 | ||
|
|
fd960fa543 | ||
|
|
1e0fa8d044 | ||
|
|
6037e92fd3 | ||
|
|
b9a0438632 | ||
|
|
74a56afe6d | ||
|
|
1a4b9ddac6 | ||
|
|
ba45d0b272 | ||
|
|
3671bcced5 | ||
|
|
5ad41db0ce | ||
|
|
dbc0ba02fc | ||
|
|
97271449ed | ||
|
|
e58e6b3980 | ||
|
|
e25c6b8ee2 | ||
|
|
37c7ec4265 | ||
|
|
b02bf18989 | ||
|
|
1324394256 | ||
|
|
391df15a96 | ||
|
|
50a0532bf4 | ||
|
|
0743b003ab | ||
|
|
05b12a6bb9 | ||
|
|
1da5352bed | ||
|
|
7a07c3da1c | ||
|
|
7b5e0a4eb2 | ||
|
|
f441166133 | ||
|
|
c5cbfff67b | ||
|
|
e87dd65bc2 | ||
|
|
d9ce3467ae | ||
|
|
e15de6dee6 | ||
|
|
511ba0ee36 | ||
|
|
f5e6f23712 | ||
|
|
874c162db2 | ||
|
|
e56846131f | ||
|
|
93f0385a45 | ||
|
|
c9acbc3688 | ||
|
|
2ca59a68e2 | ||
|
|
a29082d85e | ||
|
|
03d4992875 | ||
|
|
48cfe8cc6b | ||
|
|
7dc4ecd209 | ||
|
|
a99aa30669 | ||
|
|
2d02e4f569 | ||
|
|
8dde332c6d | ||
|
|
c7c95423cf | ||
|
|
25a1ec88eb | ||
|
|
533d7b8546 | ||
|
|
b002dfd2af | ||
|
|
4dfb6de450 | ||
|
|
686042c922 | ||
|
|
f0692c75b4 | ||
|
|
661232acaa |
199 changed files with 14913 additions and 5726 deletions
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -36,6 +36,6 @@ If applicable, add screenshots to help explain your problem.
|
|||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
Note: Before posting don't forget to check our "Troubleshooting" category in the [docs](https://invoiceninja.github.io/docs/self-host-troubleshooting/) (https://invoiceninja.github.io/docs/self-host-troubleshooting/).
|
||||
<!-- Note: Before posting don't forget to check our "Troubleshooting" category in the [docs](https://invoiceninja.github.io/docs/self-host-troubleshooting/) (https://invoiceninja.github.io/docs/self-host-troubleshooting/) -->
|
||||
|
||||
**(v5) Can you replicate the issue on our demo site? https://demo.invoiceninja.com**
|
||||
|
|
|
|||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -17,7 +17,7 @@
|
|||
/bootstrap/environment.php
|
||||
/vendor
|
||||
/node_modules
|
||||
/.DS_Store
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
/.env
|
||||
/.env.development.php
|
||||
|
|
|
|||
88
LICENSE
88
LICENSE
|
|
@ -1,47 +1,47 @@
|
|||
Copyright (c) 2018 by Hillel Coren
|
||||
Invoice Ninja * https://www.invoiceninja.com
|
||||
"CREATE. SEND. GET PAID"
|
||||
Elastic License 2.0 (ELv2)
|
||||
Elastic License
|
||||
|
||||
All Rights Reserved
|
||||
ATTRIBUTION ASSURANCE LICENSE (adapted from the original BSD license)
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the conditions below are met.
|
||||
These conditions require a modest attribution to InvoiceNinja.com (the
|
||||
"Author"), who hopes that its promotional value may help justify the
|
||||
thousands of dollars in otherwise billable time invested in writing
|
||||
this and other freely available, open-source software.
|
||||
Acceptance
|
||||
By using the software, you agree to all of the terms and conditions below.
|
||||
|
||||
1. Redistributions of source code, in whole or part and with or without
|
||||
modification (the "Code"), must prominently display this GPG-signed
|
||||
text in verifiable form.
|
||||
2. Redistributions of the Code in binary form must be accompanied by
|
||||
this GPG-signed text in any documentation and, each time the resulting
|
||||
executable program or a program dependent thereon is launched, a
|
||||
prominent display (e.g., splash screen or banner text) of the Author's
|
||||
attribution information, which includes:
|
||||
(a) Name ("Hillel Coren"),
|
||||
(b) Professional identification ("Invoice Ninja"), and
|
||||
(c) URL ("https://www.invoiceninja.com").
|
||||
3. Neither the name nor any trademark of the Author may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
4. Users are entirely responsible, to the exclusion of the Author and
|
||||
any other persons, for compliance with (1) regulations set by owners or
|
||||
administrators of employed equipment, (2) licensing terms of any other
|
||||
software, and (3) local regulations regarding use, including those
|
||||
regarding import, export, and use of encryption software.
|
||||
Copyright License
|
||||
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
|
||||
|
||||
THIS FREE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE AUTHOR OR ANY CONTRIBUTOR BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
EFFECTS OF UNAUTHORIZED OR MALICIOUS NETWORK ACCESS;
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Limitations
|
||||
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
|
||||
|
||||
You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
|
||||
|
||||
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
||||
|
||||
Patents
|
||||
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
||||
|
||||
Notices
|
||||
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
|
||||
|
||||
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
|
||||
|
||||
No Other Rights
|
||||
These terms do not imply any licenses other than those expressly granted in these terms.
|
||||
|
||||
Termination
|
||||
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
|
||||
|
||||
No Liability
|
||||
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
||||
|
||||
Definitions
|
||||
The licensor is the entity offering these terms, and the software is the software the licensor makes available under these terms, including any portion of it.
|
||||
|
||||
you refers to the individual or entity agreeing to these terms.
|
||||
|
||||
your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
||||
|
||||
your licenses are all the licenses granted to you for the software under these terms.
|
||||
|
||||
use means anything you do with the software requiring one of your licenses.
|
||||
|
||||
trademark means trademarks, service marks, and similar rights.
|
||||
|
||||
For more information regarding the interpretation of this license please see here: https://invoiceninja.github.io/docs/legal/license/
|
||||
22
README.md
22
README.md
|
|
@ -15,7 +15,7 @@ Just make sure to add the `invoice-ninja` tag to your question.
|
|||
|
||||
#### Note: v5 is now tagged Stable! To upgrade from v4 you need to [install v5](https://invoiceninja.github.io/docs/self-host-installation/) as a separate app and then use the migration tool in the latest version of v4 on Settings > Account Management.
|
||||
|
||||
All Pro and Enterprise features from the hosted app are included in the open-source code. We offer a $30 per year white-label license to remove the Invoice Ninja branding from client facing parts of the app.
|
||||
All Pro and Enterprise features from the hosted app are included in the open-code. We offer a $30 per year white-label license to remove the Invoice Ninja branding from client facing parts of the app.
|
||||
|
||||
The self-host zip includes all third party libraries whereas downloading the code from GitHub requires using Composer to install the dependencies.
|
||||
|
||||
|
|
@ -25,17 +25,19 @@ The self-host zip includes all third party libraries whereas downloading the cod
|
|||
* [Support Forum](https://www.invoiceninja.com/forums/forum/support/)
|
||||
* [StackOverflow](https://stackoverflow.com/tags/invoice-ninja/)
|
||||
|
||||
## Referral Program
|
||||
* Earn 50% of Pro & Enterprise Plans up to 4 years - [Learn more](https://www.invoiceninja.com/referral-program/)
|
||||
|
||||
## Mobile App
|
||||
* [iPhone](https://itunes.apple.com/us/app/invoice-ninja/id1435514417?ls=1&mt=8)
|
||||
* [Android](https://play.google.com/store/apps/details?id=com.invoiceninja.flutter)
|
||||
* [Source Code](https://github.com/invoiceninja/flutter-mobile)
|
||||
* [iPhone](https://apps.apple.com/us/app/invoice-ninja-v5/id1503970375#?platform=iphone)
|
||||
* [Android](https://play.google.com/store/apps/details?id=com.invoiceninja.app)
|
||||
* [Linux](https://github.com/invoiceninja/flutter-mobile)
|
||||
|
||||
## Desktop App
|
||||
* [MacOS](https://apps.apple.com/app/id1503970375)
|
||||
* [Windows](https://microsoft.com/en-us/p/invoice-ninja/9n3f2bbcfdr6)
|
||||
* [MacOS Desktop](https://snapcraft.io/invoiceninja)
|
||||
|
||||
## Installation Options
|
||||
* [Ansible](https://github.com/invoiceninja/ansible-installer)
|
||||
* [Self-Host Zip](https://docs.invoiceninja.com/install.html)
|
||||
* [Self-Host Zip](https://invoice-ninja.readthedocs.io/en/latest/install.html)
|
||||
* [Docker File](https://hub.docker.com/r/invoiceninja/invoiceninja/)
|
||||
* [Cloudron](https://cloudron.io/store/com.invoiceninja.cloudronapp.html)
|
||||
* [Softaculous](https://www.softaculous.com/apps/ecommerce/Invoice_Ninja)
|
||||
|
|
@ -49,7 +51,7 @@ The self-host zip includes all third party libraries whereas downloading the cod
|
|||
## Development
|
||||
* [API Documentation](https://invoice-ninja.readthedocs.io/en/latest/api.html)
|
||||
* [PHP SDK](https://github.com/invoiceninja/sdk-php)
|
||||
* [Zend Framework](https://github.com/alexz707/InvoiceNinjaModule)
|
||||
* [Laminas Framework](https://github.com/alexz707/InvoiceNinjaModule)
|
||||
* [Custom Module](https://invoice-ninja.readthedocs.io/en/latest/custom_modules.html) | [Watch Video](https://www.youtube.com/watch?v=8jJ-PYuq85k)
|
||||
|
||||
## Third Party Modules
|
||||
|
|
@ -92,5 +94,5 @@ For information on how contribute to Invoice Ninja, please see our [contributing
|
|||
* [Mike Skaggs](https://github.com/titan-fail)
|
||||
|
||||
## License
|
||||
Invoice Ninja is released under the Attribution Assurance License.
|
||||
Invoice Ninja is released under the Elastic License 2.0
|
||||
See [LICENSE](LICENSE) for details.
|
||||
|
|
|
|||
3
SECURITY.md
Normal file
3
SECURITY.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
## Reporting a Vulnerability
|
||||
|
||||
If you discover any security related issues, please email contact@invoiceninja.com instead of using the issue tracker.
|
||||
|
|
@ -78,7 +78,7 @@ class CheckData extends Command
|
|||
$this->checkContacts();
|
||||
|
||||
if (! $this->option('client_id')) {
|
||||
$this->checkBlankInvoiceHistory();
|
||||
//$this->checkBlankInvoiceHistory();
|
||||
$this->checkPaidToDate();
|
||||
$this->checkDraftSentInvoices();
|
||||
}
|
||||
|
|
@ -92,12 +92,12 @@ class CheckData extends Command
|
|||
if (! $this->option('client_id')) {
|
||||
$this->checkOAuth();
|
||||
//$this->checkInvitations();
|
||||
$this->checkAccountData();
|
||||
//$this->checkAccountData();
|
||||
$this->checkLookupData();
|
||||
$this->checkFailedJobs();
|
||||
}
|
||||
|
||||
$this->checkTranslations();
|
||||
//$this->checkTranslations();
|
||||
$this->logMessage('Done: ' . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE));
|
||||
$errorEmail = env('ERROR_EMAIL');
|
||||
|
||||
|
|
@ -160,6 +160,7 @@ class CheckData extends Command
|
|||
$invoices = Invoice::whereInvoiceStatusId(INVOICE_STATUS_SENT)
|
||||
->whereIsPublic(false)
|
||||
->withTrashed()
|
||||
->where('updated_at', '>', '2022-01-01')
|
||||
->get();
|
||||
|
||||
$this->logMessage($invoices->count() . ' draft sent invoices');
|
||||
|
|
@ -638,7 +639,7 @@ class CheckData extends Command
|
|||
->where('payments.payment_status_id', '!=', 3)
|
||||
->where('payments.is_deleted', '=', 0);
|
||||
})
|
||||
->where('invoices.updated_at', '>', '2017-10-01')
|
||||
->where('invoices.updated_at', '>', '2022-01-01')
|
||||
->groupBy('invoices.id')
|
||||
->havingRaw('(invoices.amount - invoices.balance) != coalesce(sum(payments.amount - payments.refunded), 0)')
|
||||
->get(['invoices.id', 'invoices.amount', 'invoices.balance', DB::raw('coalesce(sum(payments.amount - payments.refunded), 0)')]);
|
||||
|
|
@ -662,6 +663,7 @@ class CheckData extends Command
|
|||
->where('invoices.is_public', '=', 1)
|
||||
->where('invoices.invoice_type_id', '=', INVOICE_TYPE_STANDARD)
|
||||
->where('invoices.is_recurring', '=', 0)
|
||||
->where('clients.updated_at', '>', '2022-01-01')
|
||||
->havingRaw('abs(clients.balance - sum(invoices.balance)) > .01 and clients.balance != 999999999.9999');
|
||||
|
||||
if ($this->option('client_id')) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use App\Models\User;
|
|||
use App\Traits\GenerateMigrationResources;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ExportMigrations extends Command
|
||||
{
|
||||
|
|
@ -17,7 +18,7 @@ class ExportMigrations extends Command
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'migrations:export {--user=} {--random=}';
|
||||
protected $signature = 'migrations:export {--user=} {--email=} {--random=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
|
@ -46,8 +47,36 @@ class ExportMigrations extends Command
|
|||
$this->info('Note: Migrations will be stored inside of (storage/migrations) folder.');
|
||||
|
||||
if($this->option('user')) {
|
||||
$record = User::findOrFail($this->option('user'));
|
||||
$record = User::on(DB_NINJA_1)->find($this->option('user'));
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
$record = User::on(DB_NINJA_2)->find($this->option('user'));
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
|
||||
$this->info('I could not find that user - sorry');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($this->option('email')) {
|
||||
$record = User::on(DB_NINJA_1)->where('email', $this->option('email'))->first();
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
$record = User::on(DB_NINJA_2)->where('email', $this->option('email'))->first();
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
|
||||
$this->info('I could not find that user by email - sorry');
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->option('random')){
|
||||
|
|
@ -70,6 +99,7 @@ class ExportMigrations extends Command
|
|||
private function export($user)
|
||||
{
|
||||
$this->account = $user->account;
|
||||
Auth::login($user);
|
||||
|
||||
$date = date('Y-m-d');
|
||||
$accountKey = $this->account->account_key;
|
||||
|
|
@ -92,17 +122,20 @@ class ExportMigrations extends Command
|
|||
'products' => $this->getProducts(),
|
||||
'credits' => $this->getCreditsNotes(),
|
||||
'invoices' => $this->getInvoices(),
|
||||
'recurring_expenses' => $this->getRecurringExpenses(),
|
||||
'recurring_invoices' => $this->getRecurringInvoices(),
|
||||
'quotes' => $this->getQuotes(),
|
||||
'payments' => array_merge($this->getPayments(), $this->getCredits()),
|
||||
'payments' => $this->getPayments(),
|
||||
'documents' => $this->getDocuments(),
|
||||
'expense_categories' => $this->getExpenseCategories(),
|
||||
'task_statuses' => $this->getTaskStatuses(),
|
||||
'expenses' => $this->getExpenses(),
|
||||
'tasks' => $this->getTasks(),
|
||||
'documents' => $this->getDocuments(),
|
||||
'ninja_tokens' => $this->getNinjaToken(),
|
||||
];
|
||||
|
||||
Storage::makeDirectory('migrations');
|
||||
$file = storage_path("migrations/{$fileName}.zip");
|
||||
|
||||
$zip = new \ZipArchive();
|
||||
|
|
|
|||
154
app/Console/Commands/ForceMigration.php
Normal file
154
app/Console/Commands/ForceMigration.php
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Jobs\HostedMigration;
|
||||
use App\Libraries\Utils;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ForceMigration extends Command
|
||||
{
|
||||
// define('DB_NINJA_1', 'db-ninja-1');
|
||||
// define('DB_NINJA_2', 'db-ninja-2');
|
||||
|
||||
public $db = DB_NINJA_1;
|
||||
|
||||
public $force = false;
|
||||
|
||||
public $user = false;
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ninja:force-migrate-v5 {--email=} {--force=} {--database=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Force migrate accounts to v5 - (Hosted function only)';
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
if($this->option('database'))
|
||||
$this->db = $this->option('database');
|
||||
|
||||
if($this->option('force'))
|
||||
$this->force = $this->option('force');
|
||||
|
||||
if(!Utils::isNinjaProd())
|
||||
return;
|
||||
|
||||
config(['database.default' => $this->db]);
|
||||
|
||||
$company = $this->getCompany();
|
||||
|
||||
if(!$company){
|
||||
|
||||
$this->logMessage('Could not find a company with that email address');
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
$this->forceMigrate($company);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function getCompany()
|
||||
{
|
||||
|
||||
if($this->option('email')){
|
||||
|
||||
$user = User::on($this->db)
|
||||
->where('email', $this->option('email'))
|
||||
->whereNull('public_id')
|
||||
->orWhere('public_id', 0)
|
||||
->first();
|
||||
|
||||
if(!$user){
|
||||
$this->logMessage('Could not find an owner user with that email address');
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->user = $user;
|
||||
|
||||
return $user->account->company;
|
||||
|
||||
}
|
||||
|
||||
// $company = Company::on($this->db)
|
||||
// ->whereNull('plan')
|
||||
// ->orWhereIn('plan', ['','free'])
|
||||
// ->whereHas('accounts', function ($query){
|
||||
// $query->where('account_key', '!=', 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h');
|
||||
// $query->orWhere('account_key', '!=', 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx702');
|
||||
// $query->orWhere('account_key', '!=', 'AsFmBAeLXF0IKf7tmi0eiyZfmWW9hxMT');
|
||||
// })
|
||||
// ->with('accounts')
|
||||
// ->withCount('accounts')
|
||||
// ->having('accounts_count', '>=', 1)
|
||||
// ->first();
|
||||
|
||||
// return $company;
|
||||
|
||||
}
|
||||
|
||||
private function logMessage($str)
|
||||
{
|
||||
$str = date('Y-m-d h:i:s').' '.$str;
|
||||
$this->info($str);
|
||||
$this->log .= $str."\n";
|
||||
}
|
||||
|
||||
private function forceMigrate($company)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
if(!$this->user)
|
||||
$this->user = $company->accounts->first()->users()->whereNull('public_id')->orWhere('public_id', 0)->first();
|
||||
|
||||
|
||||
if(!$this->user){
|
||||
$this->logMessage('Could not find an owner user with that email address');
|
||||
exit;
|
||||
}
|
||||
|
||||
if($company){
|
||||
|
||||
foreach($company->accounts as $key => $account)
|
||||
{
|
||||
|
||||
$data['companies'][$key]['id'] = $account->id;
|
||||
$data['companies'][$key]['force'] = $this->force;
|
||||
|
||||
}
|
||||
|
||||
$this->dispatch(new HostedMigration($this->user, $data, $this->db, true));
|
||||
|
||||
$company->is_migrated = true;
|
||||
$company->save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -70,6 +70,8 @@ class SendRecurringInvoices extends Command
|
|||
->get();
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
|
||||
if(!$account->account_email_settings->is_disabled)
|
||||
$account->checkCounterReset();
|
||||
}
|
||||
}
|
||||
|
|
@ -94,6 +96,11 @@ class SendRecurringInvoices extends Command
|
|||
$this->info(date('r') . ' Processing Invoice: '. $recurInvoice->id);
|
||||
|
||||
$account = $recurInvoice->account;
|
||||
|
||||
if($account->account_email_settings->is_disabled){
|
||||
continue;
|
||||
}
|
||||
|
||||
$account->loadLocalizationSettings($recurInvoice->client);
|
||||
Auth::loginUsingId($recurInvoice->activeUser()->id);
|
||||
|
||||
|
|
@ -127,7 +134,7 @@ class SendRecurringInvoices extends Command
|
|||
foreach ($expenses as $expense) {
|
||||
$shouldSendToday = $expense->shouldSendToday();
|
||||
|
||||
if (! $shouldSendToday) {
|
||||
if (! $shouldSendToday || $expense->account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class SendReminders extends Command
|
|||
|
||||
/** @var Invoice $invoice */
|
||||
foreach ($delayedAutoBillInvoices as $invoice) {
|
||||
if ($invoice->isPaid()) {
|
||||
if ($invoice->isPaid() || $invoice->account->is_deleted) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ class SendReminders extends Command
|
|||
$this->info(date('r ') . $accounts->count() . ' accounts found with fees enabled');
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS)) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ class SendReminders extends Command
|
|||
$this->info(date('r ') . count($accounts) . ' accounts found with reminders enabled');
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS)) {
|
||||
if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ class SendReminders extends Command
|
|||
$account = $scheduledReport->account;
|
||||
$account->loadLocalizationSettings();
|
||||
|
||||
if (! $account->hasFeature(FEATURE_REPORTS)) {
|
||||
if (! $account->hasFeature(FEATURE_REPORTS) || $account->account_email_settings->is_disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
82
app/Console/Commands/SyncAccounts.php
Normal file
82
app/Console/Commands/SyncAccounts.php
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Libraries\Utils;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SyncAccounts extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ninja:sync-v5';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Sync accounts to v5 - (Hosted function only)';
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
if(!Utils::isNinjaProd())
|
||||
return;
|
||||
|
||||
config(['database.default' => DB_NINJA_1]);
|
||||
|
||||
$this->updateAccounts();
|
||||
|
||||
config(['database.default' => DB_NINJA_2]);
|
||||
|
||||
$this->updateAccounts();
|
||||
|
||||
}
|
||||
|
||||
private function updateAccounts()
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$a = Company::whereIn('plan', ['pro', 'enterprise'])
|
||||
->with('accounts')
|
||||
->cursor()->each(function ($company) use ($data){
|
||||
|
||||
$accounts = $company->accounts->pluck('account_key');
|
||||
|
||||
$data[] = [
|
||||
'plan' => $company->plan,
|
||||
'plan_term' => $company->plan_term,
|
||||
'plan_started' => $company->plan_started,
|
||||
'plan_paid' => $company->plan_paid,
|
||||
'plan_expires' => $company->plan_expires,
|
||||
'num_users' => $company->num_users,
|
||||
'accounts' => $accounts
|
||||
];
|
||||
|
||||
});
|
||||
|
||||
//post DATA
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ class Kernel extends ConsoleKernel
|
|||
'App\Console\Commands\CalculatePayouts',
|
||||
'App\Console\Commands\UpdateKey',
|
||||
'App\Console\Commands\ExportMigrations',
|
||||
'App\Console\Commands\SyncAccounts',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -55,5 +56,20 @@ class Kernel extends ConsoleKernel
|
|||
->command('ninja:send-reminders --force')
|
||||
->sendOutputTo($logFile)
|
||||
->daily();
|
||||
|
||||
if(Utils::isNinjaProd())
|
||||
{
|
||||
|
||||
$schedule
|
||||
->command('ninja:sync-v5')
|
||||
->withoutOverlapping()
|
||||
->daily();
|
||||
|
||||
|
||||
// $schedule
|
||||
// ->command('ninja:force-migrate-v5')
|
||||
// ->everyMinute()
|
||||
// ->withoutOverlapping();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ if (! defined('APP_NAME')) {
|
|||
define('NINJA_APP_URL', env('NINJA_APP_URL', 'https://app.invoiceninja.com'));
|
||||
define('NINJA_DOCS_URL', env('NINJA_DOCS_URL', 'https://invoice-ninja.readthedocs.io/en/latest'));
|
||||
define('NINJA_DATE', '2000-01-01');
|
||||
define('NINJA_VERSION', '4.5.40' . env('NINJA_VERSION_SUFFIX'));
|
||||
define('NINJA_VERSION', '4.5.50' . env('NINJA_VERSION_SUFFIX'));
|
||||
define('NINJA_TERMS_VERSION', '1.0.1');
|
||||
|
||||
define('SOCIAL_LINK_FACEBOOK', env('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja'));
|
||||
|
|
@ -631,6 +631,8 @@ if (! defined('APP_NAME')) {
|
|||
define('INVOICE_FIELDS_PRODUCT', 'product_fields');
|
||||
define('INVOICE_FIELDS_TASK', 'task_fields');
|
||||
|
||||
define('NINJA_V5_TOKEN', env('NINJA_V5_TOKEN',false));
|
||||
|
||||
$creditCards = [
|
||||
1 => ['card' => 'images/credit_cards/Test-Visa-Icon.png', 'text' => 'Visa'],
|
||||
2 => ['card' => 'images/credit_cards/Test-MasterCard-Icon.png', 'text' => 'Master Card'],
|
||||
|
|
|
|||
|
|
@ -2,20 +2,19 @@
|
|||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use Exception;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Foundation\Validation\ValidationException;
|
||||
use Illuminate\Http\Exception\HttpResponseException;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Session\TokenMismatchException;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Redirect;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Utils;
|
||||
use Request;
|
||||
|
||||
/**
|
||||
* Class Handler.
|
||||
|
|
@ -30,7 +29,6 @@ class Handler extends ExceptionHandler
|
|||
protected $dontReport = [
|
||||
TokenMismatchException::class,
|
||||
ModelNotFoundException::class,
|
||||
ValidationException::class,
|
||||
\Illuminate\Validation\ValidationException::class,
|
||||
//AuthorizationException::class,
|
||||
//HttpException::class,
|
||||
|
|
@ -103,7 +101,7 @@ class Handler extends ExceptionHandler
|
|||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
$value = Request::header('X-Ninja-Token');
|
||||
$value = \Request::header('X-Ninja-Token');
|
||||
|
||||
if ($e instanceof ModelNotFoundException) {
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ use Auth;
|
|||
use Cache;
|
||||
use File;
|
||||
use Image;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use Response;
|
||||
|
|
@ -109,7 +108,7 @@ class AccountController extends BaseController
|
|||
{
|
||||
$user = false;
|
||||
$account = false;
|
||||
$guestKey = Input::get('guest_key'); // local storage key to login until registered
|
||||
$guestKey = \Request::input('guest_key'); // local storage key to login until registered
|
||||
|
||||
if (Auth::check()) {
|
||||
return Redirect::to('invoices/create');
|
||||
|
|
@ -141,13 +140,13 @@ class AccountController extends BaseController
|
|||
Session::flash('warning', $message);
|
||||
}
|
||||
|
||||
if ($redirectTo = Input::get('redirect_to')) {
|
||||
if ($redirectTo = \Request::input('redirect_to')) {
|
||||
$redirectTo = SITE_URL . '/' . ltrim($redirectTo, '/');
|
||||
} else {
|
||||
$redirectTo = Input::get('sign_up') ? 'dashboard' : 'invoices/create';
|
||||
$redirectTo = \Request::input('sign_up') ? 'dashboard' : 'invoices/create';
|
||||
}
|
||||
|
||||
return Redirect::to($redirectTo)->with('sign_up', Input::get('sign_up'));
|
||||
return Redirect::to($redirectTo)->with('sign_up', \Request::input('sign_up'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -159,9 +158,9 @@ class AccountController extends BaseController
|
|||
$account = $user->account;
|
||||
$company = $account->company;
|
||||
|
||||
$plan = Input::get('plan');
|
||||
$term = Input::get('plan_term');
|
||||
$numUsers = Input::get('num_users');
|
||||
$plan = \Request::input('plan');
|
||||
$term = \Request::input('plan_term');
|
||||
$numUsers = \Request::input('num_users');
|
||||
|
||||
if ($plan != PLAN_ENTERPRISE) {
|
||||
$numUsers = 1;
|
||||
|
|
@ -764,11 +763,11 @@ class AccountController extends BaseController
|
|||
{
|
||||
$user = Auth::user();
|
||||
$account = $user->account;
|
||||
$modules = Input::get('modules');
|
||||
$modules = \Request::input('modules');
|
||||
|
||||
if (Utils::isSelfHost()) {
|
||||
// get all custom modules, including disabled
|
||||
$custom_modules = collect(Input::get('custom_modules'))->each(function ($item, $key) {
|
||||
$custom_modules = collect(\Request::input('custom_modules'))->each(function ($item, $key) {
|
||||
$module = Module::find($item);
|
||||
if ($module && $module->disabled()) {
|
||||
$module->enable();
|
||||
|
|
@ -782,10 +781,10 @@ class AccountController extends BaseController
|
|||
});
|
||||
}
|
||||
|
||||
$user->force_pdfjs = Input::get('force_pdfjs') ? true : false;
|
||||
$user->force_pdfjs = \Request::input('force_pdfjs') ? true : false;
|
||||
$user->save();
|
||||
|
||||
$account->live_preview = Input::get('live_preview') ? true : false;
|
||||
$account->live_preview = \Request::input('live_preview') ? true : false;
|
||||
|
||||
// Automatically disable live preview when using a large font
|
||||
$fonts = Cache::get('fonts')->filter(function ($font) use ($account) {
|
||||
|
|
@ -813,7 +812,7 @@ class AccountController extends BaseController
|
|||
*/
|
||||
private function saveCustomizeDesign()
|
||||
{
|
||||
$designId = intval(Input::get('design_id')) ?: CUSTOM_DESIGN1;
|
||||
$designId = intval(\Request::input('design_id')) ?: CUSTOM_DESIGN1;
|
||||
$field = 'custom_design' . ($designId - 10);
|
||||
|
||||
if (Auth::user()->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN)) {
|
||||
|
|
@ -821,7 +820,7 @@ class AccountController extends BaseController
|
|||
if (! $account->custom_design1) {
|
||||
$account->invoice_design_id = CUSTOM_DESIGN1;
|
||||
}
|
||||
$account->$field = Input::get('custom_design');
|
||||
$account->$field = \Request::input('custom_design');
|
||||
$account->save();
|
||||
|
||||
Session::flash('message', trans('texts.updated_settings'));
|
||||
|
|
@ -897,28 +896,28 @@ class AccountController extends BaseController
|
|||
|
||||
foreach (AccountEmailSettings::$templates as $type) {
|
||||
$subjectField = "email_subject_{$type}";
|
||||
$subject = Input::get($subjectField, $account->getEmailSubject($type));
|
||||
$subject = \Request::input($subjectField, $account->getEmailSubject($type));
|
||||
$account->account_email_settings->$subjectField = ($subject == $account->getDefaultEmailSubject($type) ? null : $subject);
|
||||
|
||||
$bodyField = "email_template_{$type}";
|
||||
$body = Input::get($bodyField, $account->getEmailTemplate($type));
|
||||
$body = \Request::input($bodyField, $account->getEmailTemplate($type));
|
||||
$account->account_email_settings->$bodyField = ($body == $account->getDefaultEmailTemplate($type) ? null : $body);
|
||||
}
|
||||
|
||||
foreach ([TEMPLATE_REMINDER1, TEMPLATE_REMINDER2, TEMPLATE_REMINDER3] as $type) {
|
||||
$enableField = "enable_{$type}";
|
||||
$account->$enableField = Input::get($enableField) ? true : false;
|
||||
$account->{"num_days_{$type}"} = Input::get("num_days_{$type}");
|
||||
$account->{"field_{$type}"} = Input::get("field_{$type}");
|
||||
$account->{"direction_{$type}"} = Input::get("field_{$type}") == REMINDER_FIELD_INVOICE_DATE ? REMINDER_DIRECTION_AFTER : Input::get("direction_{$type}");
|
||||
$account->$enableField = \Request::input($enableField) ? true : false;
|
||||
$account->{"num_days_{$type}"} = \Request::input("num_days_{$type}");
|
||||
$account->{"field_{$type}"} = \Request::input("field_{$type}");
|
||||
$account->{"direction_{$type}"} = \Request::input("field_{$type}") == REMINDER_FIELD_INVOICE_DATE ? REMINDER_DIRECTION_AFTER : \Request::input("direction_{$type}");
|
||||
|
||||
$number = preg_replace('/[^0-9]/', '', $type);
|
||||
$account->account_email_settings->{"late_fee{$number}_amount"} = Input::get("late_fee{$number}_amount");
|
||||
$account->account_email_settings->{"late_fee{$number}_percent"} = Input::get("late_fee{$number}_percent");
|
||||
$account->account_email_settings->{"late_fee{$number}_amount"} = \Request::input("late_fee{$number}_amount");
|
||||
$account->account_email_settings->{"late_fee{$number}_percent"} = \Request::input("late_fee{$number}_percent");
|
||||
}
|
||||
|
||||
$account->enable_reminder4 = Input::get('enable_reminder4') ? true : false;
|
||||
$account->account_email_settings->frequency_id_reminder4 = Input::get('frequency_id_reminder4');
|
||||
$account->enable_reminder4 = \Request::input('enable_reminder4') ? true : false;
|
||||
$account->account_email_settings->frequency_id_reminder4 = \Request::input('frequency_id_reminder4');
|
||||
|
||||
$account->save();
|
||||
$account->account_email_settings->save();
|
||||
|
|
@ -935,7 +934,7 @@ class AccountController extends BaseController
|
|||
private function saveTaxRates()
|
||||
{
|
||||
$account = Auth::user()->account;
|
||||
$account->fill(Input::all());
|
||||
$account->fill(Request::all());
|
||||
$account->save();
|
||||
|
||||
Session::flash('message', trans('texts.updated_settings'));
|
||||
|
|
@ -950,10 +949,10 @@ class AccountController extends BaseController
|
|||
{
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$account->show_product_notes = Input::get('show_product_notes') ? true : false;
|
||||
$account->fill_products = Input::get('fill_products') ? true : false;
|
||||
$account->update_products = Input::get('update_products') ? true : false;
|
||||
$account->convert_products = Input::get('convert_products') ? true : false;
|
||||
$account->show_product_notes = \Request::input('show_product_notes') ? true : false;
|
||||
$account->fill_products = \Request::input('fill_products') ? true : false;
|
||||
$account->update_products = \Request::input('update_products') ? true : false;
|
||||
$account->convert_products = \Request::input('convert_products') ? true : false;
|
||||
$account->save();
|
||||
|
||||
Session::flash('message', trans('texts.updated_settings'));
|
||||
|
|
@ -969,15 +968,15 @@ class AccountController extends BaseController
|
|||
if (Auth::user()->account->hasFeature(FEATURE_INVOICE_SETTINGS)) {
|
||||
$rules = [];
|
||||
foreach ([ENTITY_INVOICE, ENTITY_QUOTE, ENTITY_CLIENT] as $entityType) {
|
||||
if (Input::get("{$entityType}_number_type") == 'pattern') {
|
||||
if (\Request::input("{$entityType}_number_type") == 'pattern') {
|
||||
$rules["{$entityType}_number_pattern"] = 'has_counter';
|
||||
}
|
||||
}
|
||||
if (Input::get('credit_number_enabled')) {
|
||||
if (\Request::input('credit_number_enabled')) {
|
||||
$rules['credit_number_prefix'] = 'required_without:credit_number_pattern';
|
||||
$rules['credit_number_pattern'] = 'required_without:credit_number_prefix';
|
||||
}
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to('settings/'.ACCOUNT_INVOICE_SETTINGS)
|
||||
|
|
@ -985,47 +984,47 @@ class AccountController extends BaseController
|
|||
->withInput();
|
||||
} else {
|
||||
$account = Auth::user()->account;
|
||||
$account->custom_value1 = Input::get('custom_value1');
|
||||
$account->custom_value2 = Input::get('custom_value2');
|
||||
$account->custom_invoice_taxes1 = Input::get('custom_invoice_taxes1') ? true : false;
|
||||
$account->custom_invoice_taxes2 = Input::get('custom_invoice_taxes2') ? true : false;
|
||||
$account->custom_value1 = \Request::input('custom_value1');
|
||||
$account->custom_value2 = \Request::input('custom_value2');
|
||||
$account->custom_invoice_taxes1 = \Request::input('custom_invoice_taxes1') ? true : false;
|
||||
$account->custom_invoice_taxes2 = \Request::input('custom_invoice_taxes2') ? true : false;
|
||||
$account->custom_fields = request()->custom_fields;
|
||||
$account->invoice_number_padding = Input::get('invoice_number_padding');
|
||||
$account->invoice_number_counter = Input::get('invoice_number_counter');
|
||||
$account->quote_number_prefix = Input::get('quote_number_prefix');
|
||||
$account->share_counter = Input::get('share_counter') ? true : false;
|
||||
$account->invoice_terms = Input::get('invoice_terms');
|
||||
$account->invoice_footer = Input::get('invoice_footer');
|
||||
$account->quote_terms = Input::get('quote_terms');
|
||||
$account->auto_convert_quote = Input::get('auto_convert_quote');
|
||||
$account->auto_archive_quote = Input::get('auto_archive_quote');
|
||||
$account->auto_archive_invoice = Input::get('auto_archive_invoice');
|
||||
$account->auto_email_invoice = Input::get('auto_email_invoice');
|
||||
$account->recurring_invoice_number_prefix = Input::get('recurring_invoice_number_prefix');
|
||||
$account->invoice_number_padding = \Request::input('invoice_number_padding');
|
||||
$account->invoice_number_counter = \Request::input('invoice_number_counter');
|
||||
$account->quote_number_prefix = \Request::input('quote_number_prefix');
|
||||
$account->share_counter = \Request::input('share_counter') ? true : false;
|
||||
$account->invoice_terms = \Request::input('invoice_terms');
|
||||
$account->invoice_footer = \Request::input('invoice_footer');
|
||||
$account->quote_terms = \Request::input('quote_terms');
|
||||
$account->auto_convert_quote = \Request::input('auto_convert_quote');
|
||||
$account->auto_archive_quote = \Request::input('auto_archive_quote');
|
||||
$account->auto_archive_invoice = \Request::input('auto_archive_invoice');
|
||||
$account->auto_email_invoice = \Request::input('auto_email_invoice');
|
||||
$account->recurring_invoice_number_prefix = \Request::input('recurring_invoice_number_prefix');
|
||||
|
||||
$account->client_number_prefix = trim(Input::get('client_number_prefix'));
|
||||
$account->client_number_pattern = trim(Input::get('client_number_pattern'));
|
||||
$account->client_number_counter = Input::get('client_number_counter');
|
||||
$account->credit_number_counter = Input::get('credit_number_counter');
|
||||
$account->credit_number_prefix = trim(Input::get('credit_number_prefix'));
|
||||
$account->credit_number_pattern = trim(Input::get('credit_number_pattern'));
|
||||
$account->reset_counter_frequency_id = Input::get('reset_counter_frequency_id');
|
||||
$account->reset_counter_date = $account->reset_counter_frequency_id ? Utils::toSqlDate(Input::get('reset_counter_date')) : null;
|
||||
$account->client_number_prefix = trim(\Request::input('client_number_prefix'));
|
||||
$account->client_number_pattern = trim(\Request::input('client_number_pattern'));
|
||||
$account->client_number_counter = \Request::input('client_number_counter');
|
||||
$account->credit_number_counter = \Request::input('credit_number_counter');
|
||||
$account->credit_number_prefix = trim(\Request::input('credit_number_prefix'));
|
||||
$account->credit_number_pattern = trim(\Request::input('credit_number_pattern'));
|
||||
$account->reset_counter_frequency_id = \Request::input('reset_counter_frequency_id');
|
||||
$account->reset_counter_date = $account->reset_counter_frequency_id ? Utils::toSqlDate(\Request::input('reset_counter_date')) : null;
|
||||
|
||||
if (Input::has('recurring_hour')) {
|
||||
$account->recurring_hour = Input::get('recurring_hour');
|
||||
if (Request::has('recurring_hour')) {
|
||||
$account->recurring_hour = \Request::input('recurring_hour');
|
||||
}
|
||||
|
||||
if (! $account->share_counter) {
|
||||
$account->quote_number_counter = Input::get('quote_number_counter');
|
||||
$account->quote_number_counter = \Request::input('quote_number_counter');
|
||||
}
|
||||
|
||||
foreach ([ENTITY_INVOICE, ENTITY_QUOTE, ENTITY_CLIENT] as $entityType) {
|
||||
if (Input::get("{$entityType}_number_type") == 'prefix') {
|
||||
$account->{"{$entityType}_number_prefix"} = trim(Input::get("{$entityType}_number_prefix"));
|
||||
if (\Request::input("{$entityType}_number_type") == 'prefix') {
|
||||
$account->{"{$entityType}_number_prefix"} = trim(\Request::input("{$entityType}_number_prefix"));
|
||||
$account->{"{$entityType}_number_pattern"} = null;
|
||||
} else {
|
||||
$account->{"{$entityType}_number_pattern"} = trim(Input::get("{$entityType}_number_pattern"));
|
||||
$account->{"{$entityType}_number_pattern"} = trim(\Request::input("{$entityType}_number_pattern"));
|
||||
$account->{"{$entityType}_number_prefix"} = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1053,27 +1052,27 @@ class AccountController extends BaseController
|
|||
{
|
||||
if (Auth::user()->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN)) {
|
||||
$account = Auth::user()->account;
|
||||
$account->hide_quantity = Input::get('hide_quantity') ? true : false;
|
||||
$account->hide_paid_to_date = Input::get('hide_paid_to_date') ? true : false;
|
||||
$account->all_pages_header = Input::get('all_pages_header') ? true : false;
|
||||
$account->all_pages_footer = Input::get('all_pages_footer') ? true : false;
|
||||
$account->invoice_embed_documents = Input::get('invoice_embed_documents') ? true : false;
|
||||
$account->header_font_id = Input::get('header_font_id');
|
||||
$account->body_font_id = Input::get('body_font_id');
|
||||
$account->primary_color = Input::get('primary_color');
|
||||
$account->secondary_color = Input::get('secondary_color');
|
||||
$account->invoice_design_id = Input::get('invoice_design_id');
|
||||
$account->quote_design_id = Input::get('quote_design_id');
|
||||
$account->font_size = intval(Input::get('font_size'));
|
||||
$account->page_size = Input::get('page_size');
|
||||
$account->hide_quantity = \Request::input('hide_quantity') ? true : false;
|
||||
$account->hide_paid_to_date = \Request::input('hide_paid_to_date') ? true : false;
|
||||
$account->all_pages_header = \Request::input('all_pages_header') ? true : false;
|
||||
$account->all_pages_footer = \Request::input('all_pages_footer') ? true : false;
|
||||
$account->invoice_embed_documents = \Request::input('invoice_embed_documents') ? true : false;
|
||||
$account->header_font_id = \Request::input('header_font_id');
|
||||
$account->body_font_id = \Request::input('body_font_id');
|
||||
$account->primary_color = \Request::input('primary_color');
|
||||
$account->secondary_color = \Request::input('secondary_color');
|
||||
$account->invoice_design_id = \Request::input('invoice_design_id');
|
||||
$account->quote_design_id = \Request::input('quote_design_id');
|
||||
$account->font_size = intval(\Request::input('font_size'));
|
||||
$account->page_size = \Request::input('page_size');
|
||||
$account->background_image_id = Document::getPrivateId(request()->background_image_id);
|
||||
|
||||
$labels = [];
|
||||
foreach (Account::$customLabels as $field) {
|
||||
$labels[$field] = Input::get("labels_{$field}");
|
||||
$labels[$field] = \Request::input("labels_{$field}");
|
||||
}
|
||||
$account->invoice_labels = json_encode($labels);
|
||||
$account->invoice_fields = Input::get('invoice_fields_json');
|
||||
$account->invoice_fields = \Request::input('invoice_fields_json');
|
||||
|
||||
$account->save();
|
||||
|
||||
|
|
@ -1089,12 +1088,12 @@ class AccountController extends BaseController
|
|||
private function saveNotifications()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$user->notify_sent = Input::get('notify_sent');
|
||||
$user->notify_viewed = Input::get('notify_viewed');
|
||||
$user->notify_paid = Input::get('notify_paid');
|
||||
$user->notify_approved = Input::get('notify_approved');
|
||||
$user->only_notify_owned = Input::get('only_notify_owned');
|
||||
$user->slack_webhook_url = Input::get('slack_webhook_url');
|
||||
$user->notify_sent = \Request::input('notify_sent');
|
||||
$user->notify_viewed = \Request::input('notify_viewed');
|
||||
$user->notify_paid = \Request::input('notify_paid');
|
||||
$user->notify_approved = \Request::input('notify_approved');
|
||||
$user->only_notify_owned = \Request::input('only_notify_owned');
|
||||
$user->slack_webhook_url = \Request::input('slack_webhook_url');
|
||||
$user->save();
|
||||
|
||||
$account = $user->account;
|
||||
|
|
@ -1117,8 +1116,8 @@ class AccountController extends BaseController
|
|||
$this->accountRepo->save($request->input(), $account);
|
||||
|
||||
/* Logo image file */
|
||||
if ($uploaded = Input::file('logo')) {
|
||||
$path = Input::file('logo')->getRealPath();
|
||||
if ($uploaded = Request::file('logo')) {
|
||||
$path = Request::file('logo')->getRealPath();
|
||||
$disk = $account->getLogoDisk();
|
||||
$extension = strtolower($uploaded->getClientOriginalExtension());
|
||||
|
||||
|
|
@ -1204,7 +1203,7 @@ class AccountController extends BaseController
|
|||
{
|
||||
/** @var \App\Models\User $user */
|
||||
$user = Auth::user();
|
||||
$email = trim(strtolower(Input::get('email')));
|
||||
$email = trim(strtolower(\Request::input('email')));
|
||||
|
||||
if (! \App\Models\LookupUser::validateField('email', $email, $user)) {
|
||||
return Redirect::to('settings/' . ACCOUNT_USER_DETAILS)
|
||||
|
|
@ -1218,34 +1217,34 @@ class AccountController extends BaseController
|
|||
$rules['phone'] = 'required';
|
||||
}
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to('settings/'.ACCOUNT_USER_DETAILS)
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
} else {
|
||||
$user->first_name = trim(Input::get('first_name'));
|
||||
$user->last_name = trim(Input::get('last_name'));
|
||||
$user->first_name = trim(\Request::input('first_name'));
|
||||
$user->last_name = trim(\Request::input('last_name'));
|
||||
$user->username = $email;
|
||||
$user->email = $email;
|
||||
$user->phone = trim(Input::get('phone'));
|
||||
$user->dark_mode = Input::get('dark_mode');
|
||||
$user->phone = trim(\Request::input('phone'));
|
||||
$user->dark_mode = \Request::input('dark_mode');
|
||||
|
||||
if (! Auth::user()->is_admin) {
|
||||
$user->notify_sent = Input::get('notify_sent');
|
||||
$user->notify_viewed = Input::get('notify_viewed');
|
||||
$user->notify_paid = Input::get('notify_paid');
|
||||
$user->notify_approved = Input::get('notify_approved');
|
||||
$user->only_notify_owned = Input::get('only_notify_owned');
|
||||
$user->notify_sent = \Request::input('notify_sent');
|
||||
$user->notify_viewed = \Request::input('notify_viewed');
|
||||
$user->notify_paid = \Request::input('notify_paid');
|
||||
$user->notify_approved = \Request::input('notify_approved');
|
||||
$user->only_notify_owned = \Request::input('only_notify_owned');
|
||||
}
|
||||
|
||||
if ($user->google_2fa_secret && ! Input::get('enable_two_factor')) {
|
||||
if ($user->google_2fa_secret && ! \Request::input('enable_two_factor')) {
|
||||
$user->google_2fa_secret = null;
|
||||
}
|
||||
|
||||
if (Utils::isNinja()) {
|
||||
if (Input::get('referral_code') && ! $user->referral_code) {
|
||||
if (\Request::input('referral_code') && ! $user->referral_code) {
|
||||
$user->referral_code = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
}
|
||||
}
|
||||
|
|
@ -1267,15 +1266,15 @@ class AccountController extends BaseController
|
|||
/** @var \App\Models\Account $account */
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$account->timezone_id = Input::get('timezone_id') ? Input::get('timezone_id') : null;
|
||||
$account->date_format_id = Input::get('date_format_id') ? Input::get('date_format_id') : null;
|
||||
$account->datetime_format_id = Input::get('datetime_format_id') ? Input::get('datetime_format_id') : null;
|
||||
$account->currency_id = Input::get('currency_id') ? Input::get('currency_id') : 1; // US Dollar
|
||||
$account->language_id = Input::get('language_id') ? Input::get('language_id') : 1; // English
|
||||
$account->military_time = Input::get('military_time') ? true : false;
|
||||
$account->show_currency_code = Input::get('show_currency_code') ? true : false;
|
||||
$account->start_of_week = Input::get('start_of_week') ? Input::get('start_of_week') : 0;
|
||||
$account->financial_year_start = Input::get('financial_year_start') ? Input::get('financial_year_start') : null;
|
||||
$account->timezone_id = \Request::input('timezone_id') ? \Request::input('timezone_id') : null;
|
||||
$account->date_format_id = \Request::input('date_format_id') ? \Request::input('date_format_id') : null;
|
||||
$account->datetime_format_id = \Request::input('datetime_format_id') ? \Request::input('datetime_format_id') : null;
|
||||
$account->currency_id = \Request::input('currency_id') ? \Request::input('currency_id') : 1; // US Dollar
|
||||
$account->language_id = \Request::input('language_id') ? \Request::input('language_id') : 1; // English
|
||||
$account->military_time = \Request::input('military_time') ? true : false;
|
||||
$account->show_currency_code = \Request::input('show_currency_code') ? true : false;
|
||||
$account->start_of_week = \Request::input('start_of_week') ? \Request::input('start_of_week') : 0;
|
||||
$account->financial_year_start = \Request::input('financial_year_start') ? \Request::input('financial_year_start') : null;
|
||||
$account->save();
|
||||
|
||||
event(new UserSettingsChanged());
|
||||
|
|
@ -1291,10 +1290,10 @@ class AccountController extends BaseController
|
|||
private function saveOnlinePayments()
|
||||
{
|
||||
$account = Auth::user()->account;
|
||||
$account->token_billing_type_id = Input::get('token_billing_type_id');
|
||||
$account->auto_bill_on_due_date = boolval(Input::get('auto_bill_on_due_date'));
|
||||
$account->gateway_fee_enabled = boolval(Input::get('gateway_fee_enabled'));
|
||||
$account->send_item_details = boolval(Input::get('send_item_details'));
|
||||
$account->token_billing_type_id = \Request::input('token_billing_type_id');
|
||||
$account->auto_bill_on_due_date = boolval(\Request::input('auto_bill_on_due_date'));
|
||||
$account->gateway_fee_enabled = boolval(\Request::input('gateway_fee_enabled'));
|
||||
$account->send_item_details = boolval(\Request::input('send_item_details'));
|
||||
|
||||
$account->save();
|
||||
|
||||
|
|
@ -1332,7 +1331,7 @@ class AccountController extends BaseController
|
|||
*/
|
||||
public function checkEmail()
|
||||
{
|
||||
$email = trim(strtolower(Input::get('email')));
|
||||
$email = trim(strtolower(\Request::input('email')));
|
||||
$user = Auth::user();
|
||||
|
||||
if (! \App\Models\LookupUser::validateField('email', $email, $user)) {
|
||||
|
|
@ -1370,16 +1369,16 @@ class AccountController extends BaseController
|
|||
$rules['new_email'] .= ',' . Auth::user()->id . ',id';
|
||||
}
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$firstName = trim(Input::get('new_first_name'));
|
||||
$lastName = trim(Input::get('new_last_name'));
|
||||
$email = trim(strtolower(Input::get('new_email')));
|
||||
$password = trim(Input::get('new_password'));
|
||||
$firstName = trim(\Request::input('new_first_name'));
|
||||
$lastName = trim(\Request::input('new_last_name'));
|
||||
$email = trim(strtolower(\Request::input('new_email')));
|
||||
$password = trim(\Request::input('new_password'));
|
||||
|
||||
if (! \App\Models\LookupUser::validateField('email', $email, $user)) {
|
||||
return '';
|
||||
|
|
@ -1408,7 +1407,7 @@ class AccountController extends BaseController
|
|||
|
||||
$user->account->startTrial(PLAN_PRO);
|
||||
|
||||
if (Input::get('go_pro') == 'true') {
|
||||
if (\Request::input('go_pro') == 'true') {
|
||||
session([REQUESTED_PRO_PLAN => true]);
|
||||
}
|
||||
|
||||
|
|
@ -1422,15 +1421,15 @@ class AccountController extends BaseController
|
|||
public function doRegister()
|
||||
{
|
||||
$affiliate = Affiliate::where('affiliate_key', '=', SELF_HOST_AFFILIATE_KEY)->first();
|
||||
$email = trim(Input::get('email'));
|
||||
$email = trim(\Request::input('email'));
|
||||
|
||||
if (! $email || $email == TEST_USERNAME) {
|
||||
return RESULT_FAILURE;
|
||||
}
|
||||
|
||||
$license = new License();
|
||||
$license->first_name = Input::get('first_name');
|
||||
$license->last_name = Input::get('last_name');
|
||||
$license->first_name = \Request::input('first_name');
|
||||
$license->last_name = \Request::input('last_name');
|
||||
$license->email = $email;
|
||||
$license->transaction_reference = Request::getClientIp();
|
||||
$license->license_key = Utils::generateLicense();
|
||||
|
|
@ -1457,7 +1456,7 @@ class AccountController extends BaseController
|
|||
*/
|
||||
public function cancelAccount()
|
||||
{
|
||||
if ($reason = trim(Input::get('reason'))) {
|
||||
if ($reason = trim(\Request::input('reason'))) {
|
||||
$email = Auth::user()->email;
|
||||
$name = Auth::user()->getDisplayName();
|
||||
|
||||
|
|
@ -1550,7 +1549,7 @@ class AccountController extends BaseController
|
|||
*/
|
||||
public function previewEmail(TemplateService $templateService)
|
||||
{
|
||||
$template = Input::get('template');
|
||||
$template = \Request::input('template');
|
||||
$invitation = \App\Models\Invitation::scope()
|
||||
->with('invoice.client.contacts')
|
||||
->first();
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ use App\Models\AccountGateway;
|
|||
use App\Models\Gateway;
|
||||
use App\Services\AccountGatewayService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use Session;
|
||||
use stdClass;
|
||||
use URL;
|
||||
|
|
@ -90,7 +90,7 @@ class AccountGatewayController extends BaseController
|
|||
|
||||
$account = Auth::user()->account;
|
||||
$accountGatewaysIds = $account->gatewayIds();
|
||||
$wepay = Input::get('wepay');
|
||||
$wepay = \Request::input('wepay');
|
||||
|
||||
$data = self::getViewModel();
|
||||
$data['url'] = 'gateways';
|
||||
|
|
@ -158,8 +158,8 @@ class AccountGatewayController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action');
|
||||
$ids = Input::get('bulk_public_id');
|
||||
$action = \Request::input('bulk_action');
|
||||
$ids = \Request::input('bulk_public_id');
|
||||
$count = $this->accountGatewayService->bulk($ids, $action);
|
||||
|
||||
Session::flash('message', trans("texts.{$action}d_account_gateway"));
|
||||
|
|
@ -174,7 +174,7 @@ class AccountGatewayController extends BaseController
|
|||
*/
|
||||
public function save($accountGatewayPublicId = false)
|
||||
{
|
||||
$gatewayId = Input::get('primary_gateway_id') ?: Input::get('secondary_gateway_id');
|
||||
$gatewayId = \Request::input('primary_gateway_id') ?: \Request::input('secondary_gateway_id');
|
||||
$gateway = Gateway::findOrFail($gatewayId);
|
||||
|
||||
$rules = [];
|
||||
|
|
@ -208,8 +208,8 @@ class AccountGatewayController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
$creditcards = Input::get('creditCardTypes');
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$creditcards = \Request::input('creditCardTypes');
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$url = $accountGatewayPublicId ? "/gateways/{$accountGatewayPublicId}/edit" : 'gateways/create?other_providers=' . ($gatewayId == GATEWAY_WEPAY ? 'false' : 'true');
|
||||
|
|
@ -250,7 +250,7 @@ class AccountGatewayController extends BaseController
|
|||
|
||||
if ($gatewayId != GATEWAY_WEPAY) {
|
||||
foreach ($fields as $field => $details) {
|
||||
$value = trim(Input::get($gateway->id . '_' . $field));
|
||||
$value = trim(\Request::input($gateway->id . '_' . $field));
|
||||
// if the new value is masked use the original value
|
||||
if ($oldConfig && $value && $value === str_repeat('*', strlen($value))) {
|
||||
$value = $oldConfig->$field;
|
||||
|
|
@ -265,28 +265,28 @@ class AccountGatewayController extends BaseController
|
|||
$config = clone $oldConfig;
|
||||
}
|
||||
|
||||
$publishableKey = trim(Input::get('publishable_key'));
|
||||
$publishableKey = trim(\Request::input('publishable_key'));
|
||||
if ($publishableKey = str_replace('*', '', $publishableKey)) {
|
||||
$config->publishableKey = $publishableKey;
|
||||
} elseif ($oldConfig && property_exists($oldConfig, 'publishableKey')) {
|
||||
$config->publishableKey = $oldConfig->publishableKey;
|
||||
}
|
||||
|
||||
$plaidClientId = trim(Input::get('plaid_client_id'));
|
||||
$plaidClientId = trim(\Request::input('plaid_client_id'));
|
||||
if (! $plaidClientId || $plaidClientId = str_replace('*', '', $plaidClientId)) {
|
||||
$config->plaidClientId = $plaidClientId;
|
||||
} elseif ($oldConfig && property_exists($oldConfig, 'plaidClientId')) {
|
||||
$config->plaidClientId = $oldConfig->plaidClientId;
|
||||
}
|
||||
|
||||
$plaidSecret = trim(Input::get('plaid_secret'));
|
||||
$plaidSecret = trim(\Request::input('plaid_secret'));
|
||||
if (! $plaidSecret || $plaidSecret = str_replace('*', '', $plaidSecret)) {
|
||||
$config->plaidSecret = $plaidSecret;
|
||||
} elseif ($oldConfig && property_exists($oldConfig, 'plaidSecret')) {
|
||||
$config->plaidSecret = $oldConfig->plaidSecret;
|
||||
}
|
||||
|
||||
$plaidPublicKey = trim(Input::get('plaid_public_key'));
|
||||
$plaidPublicKey = trim(\Request::input('plaid_public_key'));
|
||||
if (! $plaidPublicKey || $plaidPublicKey = str_replace('*', '', $plaidPublicKey)) {
|
||||
$config->plaidPublicKey = $plaidPublicKey;
|
||||
} elseif ($oldConfig && property_exists($oldConfig, 'plaidPublicKey')) {
|
||||
|
|
@ -294,11 +294,11 @@ class AccountGatewayController extends BaseController
|
|||
}
|
||||
|
||||
if ($gatewayId == GATEWAY_STRIPE) {
|
||||
$config->enableAlipay = boolval(Input::get('enable_alipay'));
|
||||
$config->enableSofort = boolval(Input::get('enable_sofort'));
|
||||
$config->enableSepa = boolval(Input::get('enable_sepa'));
|
||||
$config->enableBitcoin = boolval(Input::get('enable_bitcoin'));
|
||||
$config->enableApplePay = boolval(Input::get('enable_apple_pay'));
|
||||
$config->enableAlipay = boolval(\Request::input('enable_alipay'));
|
||||
$config->enableSofort = boolval(\Request::input('enable_sofort'));
|
||||
$config->enableSepa = boolval(\Request::input('enable_sepa'));
|
||||
$config->enableBitcoin = boolval(\Request::input('enable_bitcoin'));
|
||||
$config->enableApplePay = boolval(\Request::input('enable_apple_pay'));
|
||||
|
||||
if ($config->enableApplePay && $uploadedFile = request()->file('apple_merchant_id')) {
|
||||
$config->appleMerchantId = File::get($uploadedFile);
|
||||
|
|
@ -308,11 +308,11 @@ class AccountGatewayController extends BaseController
|
|||
}
|
||||
|
||||
if ($gatewayId == GATEWAY_STRIPE || $gatewayId == GATEWAY_WEPAY) {
|
||||
$config->enableAch = boolval(Input::get('enable_ach'));
|
||||
$config->enableAch = boolval(\Request::input('enable_ach'));
|
||||
}
|
||||
|
||||
if ($gatewayId == GATEWAY_BRAINTREE) {
|
||||
$config->enablePayPal = boolval(Input::get('enable_paypal'));
|
||||
$config->enablePayPal = boolval(\Request::input('enable_paypal'));
|
||||
}
|
||||
|
||||
$cardCount = 0;
|
||||
|
|
@ -323,9 +323,9 @@ class AccountGatewayController extends BaseController
|
|||
}
|
||||
|
||||
$accountGateway->accepted_credit_cards = $cardCount;
|
||||
$accountGateway->show_address = Input::get('show_address') ? true : false;
|
||||
$accountGateway->show_shipping_address = Input::get('show_shipping_address') ? true : false;
|
||||
$accountGateway->update_address = Input::get('update_address') ? true : false;
|
||||
$accountGateway->show_address = \Request::input('show_address') ? true : false;
|
||||
$accountGateway->show_shipping_address = \Request::input('show_shipping_address') ? true : false;
|
||||
$accountGateway->update_address = \Request::input('update_address') ? true : false;
|
||||
$accountGateway->setConfig($config);
|
||||
|
||||
if ($accountGatewayPublicId) {
|
||||
|
|
@ -395,7 +395,7 @@ class AccountGatewayController extends BaseController
|
|||
'country' => 'required|in:US,CA,GB',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to('gateways/create')
|
||||
|
|
@ -404,9 +404,9 @@ class AccountGatewayController extends BaseController
|
|||
}
|
||||
|
||||
if (! $user->email) {
|
||||
$user->email = trim(Input::get('email'));
|
||||
$user->first_name = trim(Input::get('first_name'));
|
||||
$user->last_name = trim(Input::get('last_name'));
|
||||
$user->email = trim(\Request::input('email'));
|
||||
$user->first_name = trim(\Request::input('first_name'));
|
||||
$user->last_name = trim(\Request::input('last_name'));
|
||||
$user->save();
|
||||
}
|
||||
|
||||
|
|
@ -416,9 +416,9 @@ class AccountGatewayController extends BaseController
|
|||
$userDetails = [
|
||||
'client_id' => WEPAY_CLIENT_ID,
|
||||
'client_secret' => WEPAY_CLIENT_SECRET,
|
||||
'email' => Input::get('email'),
|
||||
'first_name' => Input::get('first_name'),
|
||||
'last_name' => Input::get('last_name'),
|
||||
'email' => \Request::input('email'),
|
||||
'first_name' => \Request::input('first_name'),
|
||||
'last_name' => \Request::input('last_name'),
|
||||
'original_ip' => \Request::getClientIp(true),
|
||||
'original_device' => \Request::server('HTTP_USER_AGENT'),
|
||||
'tos_acceptance_time' => time(),
|
||||
|
|
@ -434,18 +434,18 @@ class AccountGatewayController extends BaseController
|
|||
$wepay = new WePay($accessToken);
|
||||
|
||||
$accountDetails = [
|
||||
'name' => Input::get('company_name'),
|
||||
'name' => \Request::input('company_name'),
|
||||
'description' => trans('texts.wepay_account_description'),
|
||||
'theme_object' => json_decode(WEPAY_THEME),
|
||||
'callback_uri' => $accountGateway->getWebhookUrl(),
|
||||
'rbits' => $account->present()->rBits,
|
||||
'country' => Input::get('country'),
|
||||
'country' => \Request::input('country'),
|
||||
];
|
||||
|
||||
if (Input::get('country') == 'CA') {
|
||||
if (\Request::input('country') == 'CA') {
|
||||
$accountDetails['currencies'] = ['CAD'];
|
||||
$accountDetails['country_options'] = ['debit_opt_in' => boolval(Input::get('debit_cards'))];
|
||||
} elseif (Input::get('country') == 'GB') {
|
||||
$accountDetails['country_options'] = ['debit_opt_in' => boolval(\Request::input('debit_cards'))];
|
||||
} elseif (\Request::input('country') == 'GB') {
|
||||
$accountDetails['currencies'] = ['GBP'];
|
||||
}
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ class AccountGatewayController extends BaseController
|
|||
'accountId' => $wepayAccount->account_id,
|
||||
'state' => $wepayAccount->state,
|
||||
'testMode' => WEPAY_ENVIRONMENT == WEPAY_STAGE,
|
||||
'country' => Input::get('country'),
|
||||
'country' => \Request::input('country'),
|
||||
]);
|
||||
|
||||
if ($confirmationRequired) {
|
||||
|
|
@ -522,7 +522,7 @@ class AccountGatewayController extends BaseController
|
|||
*/
|
||||
public function savePaymentGatewayLimits()
|
||||
{
|
||||
$gateway_type_id = intval(Input::get('gateway_type_id'));
|
||||
$gateway_type_id = intval(\Request::input('gateway_type_id'));
|
||||
$gateway_settings = AccountGatewaySettings::scope()->where('gateway_type_id', '=', $gateway_type_id)->first();
|
||||
|
||||
if ( ! $gateway_settings) {
|
||||
|
|
@ -530,14 +530,14 @@ class AccountGatewayController extends BaseController
|
|||
$gateway_settings->gateway_type_id = $gateway_type_id;
|
||||
}
|
||||
|
||||
$gateway_settings->min_limit = Input::get('limit_min_enable') ? intval(Input::get('limit_min')) : null;
|
||||
$gateway_settings->max_limit = Input::get('limit_max_enable') ? intval(Input::get('limit_max')) : null;
|
||||
$gateway_settings->min_limit = \Request::input('limit_min_enable') ? intval(\Request::input('limit_min')) : null;
|
||||
$gateway_settings->max_limit = \Request::input('limit_max_enable') ? intval(\Request::input('limit_max')) : null;
|
||||
|
||||
if ($gateway_settings->max_limit !== null && $gateway_settings->min_limit > $gateway_settings->max_limit) {
|
||||
$gateway_settings->max_limit = $gateway_settings->min_limit;
|
||||
}
|
||||
|
||||
$gateway_settings->fill(Input::all());
|
||||
$gateway_settings->fill(Request::all());
|
||||
$gateway_settings->save();
|
||||
|
||||
Session::flash('message', trans('texts.updated_settings'));
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use Config;
|
|||
use DB;
|
||||
use Event;
|
||||
use Exception;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Response;
|
||||
use Session;
|
||||
|
|
@ -58,17 +57,17 @@ class AppController extends BaseController
|
|||
}
|
||||
|
||||
$valid = false;
|
||||
$test = Input::get('test');
|
||||
$test = \Request::input('test');
|
||||
|
||||
$app = Input::get('app');
|
||||
$app = \Request::input('app');
|
||||
$app['key'] = env('APP_KEY') ?: strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
$app['debug'] = Input::get('debug') ? 'true' : 'false';
|
||||
$app['https'] = Input::get('https') ? 'true' : 'false';
|
||||
$app['debug'] = \Request::input('debug') ? 'true' : 'false';
|
||||
$app['https'] = \Request::input('https') ? 'true' : 'false';
|
||||
|
||||
$database = Input::get('database');
|
||||
$database = \Request::input('database');
|
||||
$dbType = 'mysql'; // $database['default'];
|
||||
$database['connections'] = [$dbType => $database['type']];
|
||||
$mail = Input::get('mail');
|
||||
$mail = \Request::input('mail');
|
||||
|
||||
if ($test == 'mail') {
|
||||
return self::testMail($mail);
|
||||
|
|
@ -137,10 +136,10 @@ class AppController extends BaseController
|
|||
Artisan::call('db:seed', ['--force' => true, '--class' => 'UpdateSeeder']);
|
||||
|
||||
if (! Account::count()) {
|
||||
$firstName = trim(Input::get('first_name'));
|
||||
$lastName = trim(Input::get('last_name'));
|
||||
$email = trim(strtolower(Input::get('email')));
|
||||
$password = trim(Input::get('password'));
|
||||
$firstName = trim(\Request::input('first_name'));
|
||||
$lastName = trim(\Request::input('last_name'));
|
||||
$email = trim(strtolower(\Request::input('email')));
|
||||
$password = trim(\Request::input('password'));
|
||||
$account = $this->accountRepo->create($firstName, $lastName, $email, $password);
|
||||
|
||||
$user = $account->users()->first();
|
||||
|
|
@ -167,13 +166,13 @@ class AppController extends BaseController
|
|||
return Redirect::to('/settings/system_settings');
|
||||
}
|
||||
|
||||
$app = Input::get('app');
|
||||
$db = Input::get('database');
|
||||
$mail = Input::get('mail');
|
||||
$app = \Request::input('app');
|
||||
$db = \Request::input('database');
|
||||
$mail = \Request::input('mail');
|
||||
|
||||
$_ENV['APP_URL'] = $app['url'];
|
||||
$_ENV['APP_DEBUG'] = Input::get('debug') ? 'true' : 'false';
|
||||
$_ENV['REQUIRE_HTTPS'] = Input::get('https') ? 'true' : 'false';
|
||||
$_ENV['APP_DEBUG'] = \Request::input('debug') ? 'true' : 'false';
|
||||
$_ENV['REQUIRE_HTTPS'] = \Request::input('https') ? 'true' : 'false';
|
||||
|
||||
$_ENV['DB_TYPE'] = 'mysql'; // $db['default'];
|
||||
$_ENV['DB_HOST'] = $db['type']['host'];
|
||||
|
|
@ -314,7 +313,7 @@ class AppController extends BaseController
|
|||
Session::flush();
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
Artisan::call('db:seed', ['--force' => true, '--class' => 'UpdateSeeder']);
|
||||
Event::fire(new UserSettingsChanged());
|
||||
Event::dispatch(new UserSettingsChanged());
|
||||
|
||||
// legacy fix: check cipher is in .env file
|
||||
if (! env('APP_CIPHER')) {
|
||||
|
|
@ -346,7 +345,12 @@ class AppController extends BaseController
|
|||
FROM information_schema.TABLES
|
||||
WHERE TABLE_NAME='clients' AND TABLE_SCHEMA='ninja'");
|
||||
|
||||
if (count($result) && $result[0]->engine == 'InnoDB') {
|
||||
if(property_exists($result[0], 'engine'))
|
||||
$engine = $result[0]->engine;
|
||||
else
|
||||
$engine = $result[0]->ENGINE;
|
||||
|
||||
if (count($result) && $engine == 'InnoDB') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -363,15 +367,15 @@ class AppController extends BaseController
|
|||
|
||||
public function emailBounced()
|
||||
{
|
||||
$messageId = Input::get('MessageID');
|
||||
$error = Input::get('Name') . ': ' . Input::get('Description');
|
||||
$messageId = \Request::input('MessageID');
|
||||
$error = \Request::input('Name') . ': ' . \Request::input('Description');
|
||||
|
||||
return $this->emailService->markBounced($messageId, $error) ? RESULT_SUCCESS : RESULT_FAILURE;
|
||||
}
|
||||
|
||||
public function emailOpened()
|
||||
{
|
||||
$messageId = Input::get('MessageID');
|
||||
$messageId = \Request::input('MessageID');
|
||||
|
||||
return $this->emailService->markOpened($messageId) ? RESULT_SUCCESS : RESULT_FAILURE;
|
||||
|
||||
|
|
@ -409,7 +413,7 @@ class AppController extends BaseController
|
|||
|
||||
public function stats()
|
||||
{
|
||||
if (! hash_equals(Input::get('password') ?: '', env('RESELLER_PASSWORD'))) {
|
||||
if (! hash_equals(\Request::input('password') ?: '', env('RESELLER_PASSWORD'))) {
|
||||
sleep(3);
|
||||
|
||||
return '';
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class LoginController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
Event::fire(new UserLoggedIn());
|
||||
Event::dispatch(new UserLoggedIn());
|
||||
|
||||
return redirect()->intended($this->redirectTo);
|
||||
}
|
||||
|
|
@ -188,11 +188,11 @@ class LoginController extends Controller
|
|||
$key = $userId . ':' . $request->totp;
|
||||
|
||||
//use cache to store token to blacklist
|
||||
Cache::add($key, true, 4);
|
||||
Cache::add($key, true, 4 * 60);
|
||||
|
||||
//login and redirect user
|
||||
auth()->loginUsingId($userId);
|
||||
Event::fire(new UserLoggedIn());
|
||||
Event::dispatch(new UserLoggedIn());
|
||||
|
||||
if ($trust = request()->trust) {
|
||||
$user = auth()->user();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ResetPasswordController extends Controller
|
|||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
protected function sendResetResponse($response)
|
||||
protected function sendResetResponse(Request $request, $response)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
|
|
@ -51,8 +51,8 @@ class ResetPasswordController extends Controller
|
|||
session(['2fa:user:id' => $user->id]);
|
||||
return redirect('/validate_two_factor/' . $user->account->account_key);
|
||||
} else {
|
||||
Event::fire(new UserLoggedIn());
|
||||
return $this->traitSendResetResponse($response);
|
||||
Event::dispatch(new UserLoggedIn());
|
||||
return $this->traitSendResetResponse($request, $response);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use Cache;
|
|||
use Crypt;
|
||||
use File;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use Utils;
|
||||
|
|
@ -74,8 +73,8 @@ class BankAccountController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action');
|
||||
$ids = Input::get('bulk_public_id');
|
||||
$action = \Request::input('bulk_action');
|
||||
$ids = \Request::input('bulk_public_id');
|
||||
$count = $this->bankAccountService->bulk($ids, $action);
|
||||
|
||||
Session::flash('message', trans('texts.archived_bank_account'));
|
||||
|
|
@ -85,9 +84,9 @@ class BankAccountController extends BaseController
|
|||
|
||||
public function validateAccount()
|
||||
{
|
||||
$publicId = Input::get('public_id');
|
||||
$username = trim(Input::get('bank_username'));
|
||||
$password = trim(Input::get('bank_password'));
|
||||
$publicId = \Request::input('public_id');
|
||||
$username = trim(\Request::input('bank_username'));
|
||||
$password = trim(\Request::input('bank_password'));
|
||||
|
||||
if ($publicId) {
|
||||
$bankAccount = BankAccount::scope($publicId)->firstOrFail();
|
||||
|
|
@ -100,11 +99,11 @@ class BankAccountController extends BaseController
|
|||
$bankId = $bankAccount->bank_id;
|
||||
} else {
|
||||
$bankAccount = new BankAccount;
|
||||
$bankAccount->bank_id = Input::get('bank_id');
|
||||
$bankAccount->bank_id = \Request::input('bank_id');
|
||||
}
|
||||
|
||||
$bankAccount->app_version = Input::get('app_version');
|
||||
$bankAccount->ofx_version = Input::get('ofx_version');
|
||||
$bankAccount->app_version = \Request::input('app_version');
|
||||
$bankAccount->ofx_version = \Request::input('ofx_version');
|
||||
|
||||
if ($publicId) {
|
||||
$bankAccount->save();
|
||||
|
|
@ -115,18 +114,18 @@ class BankAccountController extends BaseController
|
|||
|
||||
public function store(CreateBankAccountRequest $request)
|
||||
{
|
||||
$bankAccount = $this->bankAccountRepo->save(Input::all());
|
||||
$bankAccount = $this->bankAccountRepo->save(Request::all());
|
||||
|
||||
$bankId = Input::get('bank_id');
|
||||
$username = trim(Input::get('bank_username'));
|
||||
$password = trim(Input::get('bank_password'));
|
||||
$bankId = \Request::input('bank_id');
|
||||
$username = trim(\Request::input('bank_username'));
|
||||
$password = trim(\Request::input('bank_password'));
|
||||
|
||||
return json_encode($this->bankAccountService->loadBankAccounts($bankAccount, $username, $password, true));
|
||||
}
|
||||
|
||||
public function importExpenses($bankId)
|
||||
{
|
||||
return $this->bankAccountService->importExpenses($bankId, Input::all());
|
||||
return $this->bankAccountService->importExpenses($bankId, Request::all());
|
||||
}
|
||||
|
||||
public function showImportOFX()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers;
|
|||
use App\Models\EntityModel;
|
||||
use App\Ninja\Serializers\ArraySerializer;
|
||||
use Auth;
|
||||
use Input;
|
||||
use League\Fractal\Manager;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection;
|
||||
|
|
@ -24,7 +23,7 @@ use Utils;
|
|||
* @SWG\Info(
|
||||
* version="1.0.0",
|
||||
* title="Invoice Ninja API",
|
||||
* description="An open-source invoicing and time-tracking app built with Laravel",
|
||||
* description="A source-available invoicing and time-tracking app built with Laravel",
|
||||
* termsOfService="",
|
||||
* @SWG\Contact(
|
||||
* email="contact@invoiceninja.com"
|
||||
|
|
@ -56,11 +55,11 @@ class BaseAPIController extends Controller
|
|||
{
|
||||
$this->manager = new Manager();
|
||||
|
||||
if ($include = Request::get('include')) {
|
||||
if ($include = \Request::get('include')) {
|
||||
$this->manager->parseIncludes($include);
|
||||
}
|
||||
|
||||
$this->serializer = Request::get('serializer') ?: API_SERIALIZER_ARRAY;
|
||||
$this->serializer = \Request::get('serializer') ?: API_SERIALIZER_ARRAY;
|
||||
|
||||
if ($this->serializer === API_SERIALIZER_JSON) {
|
||||
$this->manager->setSerializer(new JsonApiSerializer());
|
||||
|
|
@ -92,24 +91,24 @@ class BaseAPIController extends Controller
|
|||
protected function listResponse($query)
|
||||
{
|
||||
$transformerClass = EntityModel::getTransformerName($this->entityType);
|
||||
$transformer = new $transformerClass(Auth::user()->account, Input::get('serializer'));
|
||||
$transformer = new $transformerClass(Auth::user()->account, \Request::input('serializer'));
|
||||
|
||||
$includes = $transformer->getDefaultIncludes();
|
||||
$includes = $this->getRequestIncludes($includes);
|
||||
|
||||
$query->with($includes);
|
||||
|
||||
if (Input::get('filter_active')) {
|
||||
if (\Request::input('filter_active')) {
|
||||
$query->whereNull('deleted_at');
|
||||
}
|
||||
|
||||
if (Input::get('updated_at') > 0) {
|
||||
$updatedAt = intval(Input::get('updated_at'));
|
||||
if (\Request::input('updated_at') > 0) {
|
||||
$updatedAt = intval(\Request::input('updated_at'));
|
||||
$query->where('updated_at', '>=', date('Y-m-d H:i:s', $updatedAt));
|
||||
}
|
||||
|
||||
if (Input::get('client_id') > 0) {
|
||||
$clientPublicId = Input::get('client_id');
|
||||
if (\Request::input('client_id') > 0) {
|
||||
$clientPublicId = \Request::input('client_id');
|
||||
$filter = function ($query) use ($clientPublicId) {
|
||||
$query->where('public_id', '=', $clientPublicId);
|
||||
};
|
||||
|
|
@ -136,7 +135,7 @@ class BaseAPIController extends Controller
|
|||
}
|
||||
|
||||
$transformerClass = EntityModel::getTransformerName($this->entityType);
|
||||
$transformer = new $transformerClass(Auth::user()->account, Input::get('serializer'));
|
||||
$transformer = new $transformerClass(Auth::user()->account, \Request::input('serializer'));
|
||||
|
||||
$data = $this->createItem($item, $transformer, $this->entityType);
|
||||
|
||||
|
|
@ -161,7 +160,7 @@ class BaseAPIController extends Controller
|
|||
}
|
||||
|
||||
if (is_a($query, "Illuminate\Database\Eloquent\Builder")) {
|
||||
$limit = Input::get('per_page', DEFAULT_API_PAGE_SIZE);
|
||||
$limit = \Request::input('per_page', DEFAULT_API_PAGE_SIZE);
|
||||
if (Utils::isNinja()) {
|
||||
$limit = min(MAX_API_PAGE_SIZE, $limit);
|
||||
}
|
||||
|
|
@ -178,7 +177,7 @@ class BaseAPIController extends Controller
|
|||
|
||||
protected function response($response)
|
||||
{
|
||||
$index = Request::get('index') ?: 'data';
|
||||
$index = \Request::get('index') ?: 'data';
|
||||
|
||||
if ($index == 'none') {
|
||||
unset($response['meta']);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -15,24 +14,24 @@ class BlueVineController extends BaseController
|
|||
$user = Auth::user();
|
||||
|
||||
$data = [
|
||||
'personal_user_full_name' => Input::get('name'),
|
||||
'business_phone_number' => Input::get('phone'),
|
||||
'email' => Input::get('email'),
|
||||
'personal_fico_score' => intval(Input::get('fico_score')),
|
||||
'business_annual_revenue' => intval(Input::get('annual_revenue')),
|
||||
'business_monthly_average_bank_balance' => intval(Input::get('average_bank_balance')),
|
||||
'business_inception_date' => date('Y-m-d', strtotime(Input::get('business_inception'))),
|
||||
'personal_user_full_name' => \Request::input('name'),
|
||||
'business_phone_number' => \Request::input('phone'),
|
||||
'email' => \Request::input('email'),
|
||||
'personal_fico_score' => intval(\Request::input('fico_score')),
|
||||
'business_annual_revenue' => intval(\Request::input('annual_revenue')),
|
||||
'business_monthly_average_bank_balance' => intval(\Request::input('average_bank_balance')),
|
||||
'business_inception_date' => date('Y-m-d', strtotime(\Request::input('business_inception'))),
|
||||
'partner_internal_business_id' => 'ninja_account_' . $user->account_id,
|
||||
];
|
||||
|
||||
if (! empty(Input::get('quote_type_factoring'))) {
|
||||
if (! empty(\Request::input('quote_type_factoring'))) {
|
||||
$data['invoice_factoring_offer'] = true;
|
||||
$data['desired_credit_line'] = intval(Input::get('desired_credit_limit')['invoice_factoring']);
|
||||
$data['desired_credit_line'] = intval(\Request::input('desired_credit_limit')['invoice_factoring']);
|
||||
}
|
||||
|
||||
if (! empty(Input::get('quote_type_loc'))) {
|
||||
if (! empty(\Request::input('quote_type_loc'))) {
|
||||
$data['line_of_credit_offer'] = true;
|
||||
$data['desired_credit_line_for_loc'] = intval(Input::get('desired_credit_limit')['line_of_credit']);
|
||||
$data['desired_credit_line_for_loc'] = intval(\Request::input('desired_credit_limit')['line_of_credit']);
|
||||
}
|
||||
|
||||
$api_client = new \GuzzleHttp\Client();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use Auth;
|
|||
use Cache;
|
||||
use DB;
|
||||
use Exception;
|
||||
use Input;
|
||||
use Utils;
|
||||
|
||||
class BotController extends Controller
|
||||
|
|
@ -28,7 +27,7 @@ class BotController extends Controller
|
|||
{
|
||||
abort(404);
|
||||
|
||||
$input = Input::all();
|
||||
$input = \Request::all();
|
||||
$botUserId = $input['from']['id'];
|
||||
|
||||
if (! $token = $this->authenticate($input)) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use App\Http\Requests\CreateClientRequest;
|
|||
use App\Http\Requests\UpdateClientRequest;
|
||||
use App\Models\Client;
|
||||
use App\Ninja\Repositories\ClientRepository;
|
||||
use Input;
|
||||
use Response;
|
||||
|
||||
class ClientApiController extends BaseAPIController
|
||||
|
|
@ -46,11 +45,11 @@ class ClientApiController extends BaseAPIController
|
|||
->orderBy('updated_at', 'desc')
|
||||
->withTrashed();
|
||||
|
||||
if ($email = Input::get('email')) {
|
||||
if ($email = \Request::input('email')) {
|
||||
$clients = $clients->whereHas('contacts', function ($query) use ($email) {
|
||||
$query->where('email', $email);
|
||||
});
|
||||
} elseif ($idNumber = Input::get('id_number')) {
|
||||
} elseif ($idNumber = \Request::input('id_number')) {
|
||||
$clients = $clients->whereIdNumber($idNumber);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Http\Controllers\ClientAuth;
|
||||
|
||||
use Illuminate\Mail\Message;
|
||||
use Password;
|
||||
use Config;
|
||||
use Utils;
|
||||
|
|
@ -39,7 +40,7 @@ class ForgotPasswordController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
*/
|
||||
public function showLinkRequestForm()
|
||||
{
|
||||
|
|
@ -55,7 +56,7 @@ class ForgotPasswordController extends Controller
|
|||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
|
||||
*/
|
||||
public function sendResetLinkEmail(Request $request)
|
||||
{
|
||||
|
|
@ -91,7 +92,7 @@ class ForgotPasswordController extends Controller
|
|||
});
|
||||
|
||||
return $response == Password::RESET_LINK_SENT
|
||||
? $this->sendResetLinkResponse($response)
|
||||
? $this->sendResetLinkResponse($request, $response)
|
||||
: $this->sendResetLinkFailedResponse($request, $response);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ use App\Ninja\Repositories\ClientRepository;
|
|||
use App\Services\ClientService;
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -57,7 +56,7 @@ class ClientController extends BaseController
|
|||
|
||||
public function getDatatable()
|
||||
{
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
$userId = Auth::user()->filterIdByEntity(ENTITY_CLIENT);
|
||||
|
||||
return $this->clientService->getDatatable($search, $userId);
|
||||
|
|
@ -201,7 +200,7 @@ class ClientController extends BaseController
|
|||
private static function getViewModel()
|
||||
{
|
||||
return [
|
||||
'data' => Input::old('data'),
|
||||
'data' => \Request::old('data'),
|
||||
'account' => Auth::user()->account,
|
||||
'sizes' => Cache::get('sizes'),
|
||||
'customLabel1' => Auth::user()->account->customLabel('client1'),
|
||||
|
|
@ -227,8 +226,8 @@ class ClientController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
|
||||
if ($action == 'purge' && ! auth()->user()->is_admin) {
|
||||
return redirect('dashboard')->withError(trans('texts.not_authorized'));
|
||||
|
|
|
|||
|
|
@ -67,6 +67,17 @@ class ClientPortalController extends BaseController
|
|||
$client = $invoice->client;
|
||||
$account = $invoice->account;
|
||||
|
||||
/* Forward requests from V4 to V5 if the domain is set */
|
||||
if(strlen($account->account_email_settings->forward_url_for_v5) >1){
|
||||
|
||||
if ($invoice->isType(INVOICE_TYPE_QUOTE))
|
||||
$entity = 'quote';
|
||||
else
|
||||
$entity = 'invoice';
|
||||
|
||||
return redirect($account->account_email_settings->forward_url_for_v5."/client/".$entity."/".$invitationKey);
|
||||
}
|
||||
|
||||
if (request()->silent) {
|
||||
session(['silent:' . $client->id => true]);
|
||||
return redirect(request()->url() . (request()->borderless ? '?borderless=true' : ''));
|
||||
|
|
@ -78,7 +89,7 @@ class ClientPortalController extends BaseController
|
|||
]);
|
||||
}
|
||||
|
||||
if (! Input::has('phantomjs') && ! session('silent:' . $client->id) && ! Session::has($invitation->invitation_key)
|
||||
if (! Request::has('phantomjs') && ! session('silent:' . $client->id) && ! Session::has($invitation->invitation_key)
|
||||
&& (! Auth::check() || Auth::user()->account_id != $invoice->account_id)) {
|
||||
if ($invoice->isType(INVOICE_TYPE_QUOTE)) {
|
||||
event(new QuoteInvitationWasViewed($invoice, $invitation));
|
||||
|
|
@ -129,14 +140,14 @@ class ClientPortalController extends BaseController
|
|||
$paymentURL = '';
|
||||
if (count($paymentTypes) == 1) {
|
||||
$paymentURL = $paymentTypes[0]['url'];
|
||||
if (in_array($paymentTypes[0]['gatewayTypeId'], [GATEWAY_TYPE_CUSTOM1, GATEWAY_TYPE_CUSTOM2, GATEWAY_TYPE_CUSTOM3])) {
|
||||
if (array_key_exists('gatewayTypeId', $paymentTypes[0]) && in_array($paymentTypes[0]['gatewayTypeId'], [GATEWAY_TYPE_CUSTOM1, GATEWAY_TYPE_CUSTOM2, GATEWAY_TYPE_CUSTOM3])) {
|
||||
// do nothing
|
||||
} elseif (! $account->isGatewayConfigured(GATEWAY_PAYPAL_EXPRESS)) {
|
||||
$paymentURL = URL::to($paymentURL);
|
||||
}
|
||||
}
|
||||
|
||||
if (! Input::has('phantomjs')) {
|
||||
if (! Request::has('phantomjs')) {
|
||||
if ($wepayGateway = $account->getGatewayConfig(GATEWAY_WEPAY)) {
|
||||
$data['enableWePayACH'] = $wepayGateway->getAchEnabled();
|
||||
}
|
||||
|
|
@ -151,6 +162,11 @@ class ClientPortalController extends BaseController
|
|||
$showApprove = false;
|
||||
}
|
||||
|
||||
$gatewayTypeIdCast = false;
|
||||
|
||||
if(count($paymentTypes) >= 1 && array_key_exists('gatewayTypeId', $paymentTypes[0]))
|
||||
$gatewayTypeIdCast = $paymentTypes[0]['gatewayTypeId'];
|
||||
|
||||
$data += [
|
||||
'account' => $account,
|
||||
'showApprove' => $showApprove,
|
||||
|
|
@ -161,8 +177,8 @@ class ClientPortalController extends BaseController
|
|||
'contact' => $contact,
|
||||
'paymentTypes' => $paymentTypes,
|
||||
'paymentURL' => $paymentURL,
|
||||
'phantomjs' => Input::has('phantomjs'),
|
||||
'gatewayTypeId' => count($paymentTypes) == 1 ? $paymentTypes[0]['gatewayTypeId'] : false,
|
||||
'phantomjs' => Request::has('phantomjs'),
|
||||
'gatewayTypeId' => count($paymentTypes) == 1 ? $gatewayTypeIdCast : false,
|
||||
];
|
||||
|
||||
if ($invoice->canBePaid()) {
|
||||
|
|
@ -228,7 +244,7 @@ class ClientPortalController extends BaseController
|
|||
return RESULT_FAILURE;
|
||||
}
|
||||
|
||||
if ($signature = Input::get('signature')) {
|
||||
if ($signature = \Request::input('signature')) {
|
||||
$invitation->signature_base64 = $signature;
|
||||
$invitation->signature_date = date_create();
|
||||
$invitation->save();
|
||||
|
|
@ -389,7 +405,7 @@ class ClientPortalController extends BaseController
|
|||
return '';
|
||||
}
|
||||
|
||||
return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_INVOICE, Input::get('sSearch'));
|
||||
return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_INVOICE, \Request::input('sSearch'));
|
||||
}
|
||||
|
||||
public function recurringInvoiceDatatable()
|
||||
|
|
@ -432,7 +448,7 @@ class ClientPortalController extends BaseController
|
|||
if (! $contact = $this->getContact()) {
|
||||
return $this->returnError();
|
||||
}
|
||||
$payments = $this->paymentRepo->findForContact($contact->id, Input::get('sSearch'));
|
||||
$payments = $this->paymentRepo->findForContact($contact->id, \Request::input('sSearch'));
|
||||
|
||||
return Datatable::query($payments)
|
||||
->addColumn('invoice_number', function ($model) {
|
||||
|
|
@ -517,7 +533,7 @@ class ClientPortalController extends BaseController
|
|||
return false;
|
||||
}
|
||||
|
||||
return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_QUOTE, Input::get('sSearch'));
|
||||
return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_QUOTE, \Request::input('sSearch'));
|
||||
}
|
||||
|
||||
public function creditIndex()
|
||||
|
|
@ -626,7 +642,7 @@ class ClientPortalController extends BaseController
|
|||
return false;
|
||||
}
|
||||
|
||||
return $this->documentRepo->getClientDatatable($contact->id, ENTITY_DOCUMENT, Input::get('sSearch'));
|
||||
return $this->documentRepo->getClientDatatable($contact->id, ENTITY_DOCUMENT, \Request::input('sSearch'));
|
||||
}
|
||||
|
||||
private function returnError($error = false)
|
||||
|
|
@ -839,9 +855,9 @@ class ClientPortalController extends BaseController
|
|||
|
||||
public function verifyPaymentMethod()
|
||||
{
|
||||
$publicId = Input::get('source_id');
|
||||
$amount1 = Input::get('verification1');
|
||||
$amount2 = Input::get('verification2');
|
||||
$publicId = \Request::input('source_id');
|
||||
$amount1 = \Request::input('verification1');
|
||||
$amount2 = \Request::input('verification2');
|
||||
|
||||
if (! $contact = $this->getContact()) {
|
||||
return $this->returnError();
|
||||
|
|
@ -895,14 +911,14 @@ class ClientPortalController extends BaseController
|
|||
$client = $contact->client;
|
||||
$account = $client->account;
|
||||
|
||||
$validator = Validator::make(Input::all(), ['source' => 'required']);
|
||||
$validator = Validator::make(Request::all(), ['source' => 'required']);
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to($client->account->enable_client_portal_dashboard ? '/client/dashboard' : '/client/payment_methods/');
|
||||
}
|
||||
|
||||
$paymentDriver = $account->paymentDriver(false, GATEWAY_TYPE_TOKEN);
|
||||
$paymentMethod = PaymentMethod::clientId($client->id)
|
||||
->wherePublicId(Input::get('source'))
|
||||
->wherePublicId(\Request::input('source'))
|
||||
->firstOrFail();
|
||||
|
||||
$customer = $paymentDriver->customer($client->id);
|
||||
|
|
@ -934,14 +950,14 @@ class ClientPortalController extends BaseController
|
|||
|
||||
$client = $contact->client;
|
||||
|
||||
$validator = Validator::make(Input::all(), ['public_id' => 'required']);
|
||||
$validator = Validator::make(Request::all(), ['public_id' => 'required']);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to('client/invoices/recurring');
|
||||
}
|
||||
|
||||
$publicId = Input::get('public_id');
|
||||
$enable = Input::get('enable');
|
||||
$publicId = \Request::input('public_id');
|
||||
$enable = \Request::input('enable');
|
||||
$invoice = $client->invoices()->where('public_id', intval($publicId))->first();
|
||||
|
||||
if ($invoice && $invoice->is_recurring && ($invoice->auto_bill == AUTO_BILL_OPT_IN || $invoice->auto_bill == AUTO_BILL_OPT_OUT)) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use App\Http\Requests\CreateContactRequest;
|
|||
use App\Http\Requests\UpdateContactRequest;
|
||||
use App\Models\Contact;
|
||||
use App\Ninja\Repositories\ContactRepository;
|
||||
use Input;
|
||||
use Response;
|
||||
use Utils;
|
||||
use App\Services\ContactService;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Http\Requests\UpdateCreditRequest;
|
|||
use App\Models\Invoice;
|
||||
use App\Models\Credit;
|
||||
use App\Ninja\Repositories\CreditRepository;
|
||||
use Input;
|
||||
use Response;
|
||||
|
||||
class CreditApiController extends BaseAPIController
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ use App\Models\Credit;
|
|||
use App\Ninja\Datatables\CreditDatatable;
|
||||
use App\Ninja\Repositories\CreditRepository;
|
||||
use App\Services\CreditService;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -47,13 +46,13 @@ class CreditController extends BaseController
|
|||
|
||||
public function getDatatable($clientPublicId = null)
|
||||
{
|
||||
return $this->creditService->getDatatable($clientPublicId, Input::get('sSearch'));
|
||||
return $this->creditService->getDatatable($clientPublicId, \Request::input('sSearch'));
|
||||
}
|
||||
|
||||
public function create(CreditRequest $request)
|
||||
{
|
||||
$data = [
|
||||
'clientPublicId' => Input::old('client') ? Input::old('client') : ($request->client_id ?: 0),
|
||||
'clientPublicId' => \Request::old('client') ? \Request::old('client') : ($request->client_id ?: 0),
|
||||
'credit' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'credits',
|
||||
|
|
@ -111,7 +110,7 @@ class CreditController extends BaseController
|
|||
|
||||
private function save($credit = null)
|
||||
{
|
||||
$credit = $this->creditService->save(Input::all(), $credit);
|
||||
$credit = $this->creditService->save(\Request::all(), $credit);
|
||||
|
||||
$message = $credit->wasRecentlyCreated ? trans('texts.created_credit') : trans('texts.updated_credit');
|
||||
Session::flash('message', $message);
|
||||
|
|
@ -121,8 +120,8 @@ class CreditController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
$count = $this->creditService->bulk($ids, $action);
|
||||
|
||||
if ($count > 0) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Http\Requests\UpdateExpenseCategoryRequest;
|
|||
use App\Models\ExpenseCategory;
|
||||
use App\Ninja\Repositories\ExpenseCategoryRepository;
|
||||
use App\Services\ExpenseCategoryService;
|
||||
use Input;
|
||||
|
||||
class ExpenseCategoryApiController extends BaseAPIController
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Http\Requests\UpdateExpenseCategoryRequest;
|
|||
use App\Ninja\Datatables\ExpenseCategoryDatatable;
|
||||
use App\Ninja\Repositories\ExpenseCategoryRepository;
|
||||
use App\Services\ExpenseCategoryService;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
|
|
@ -40,7 +39,7 @@ class ExpenseCategoryController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
return $this->categoryService->getDatatable(Input::get('sSearch'));
|
||||
return $this->categoryService->getDatatable(\Request::input('sSearch'));
|
||||
}
|
||||
|
||||
public function create(ExpenseCategoryRequest $request)
|
||||
|
|
@ -89,8 +88,8 @@ class ExpenseCategoryController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
$count = $this->categoryService->bulk($ids, $action);
|
||||
|
||||
if ($count > 0) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use App\Ninja\Repositories\InvoiceRepository;
|
|||
use App\Services\ExpenseService;
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use Session;
|
||||
|
|
@ -61,7 +60,7 @@ class ExpenseController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
return $this->expenseService->getDatatable(Input::get('sSearch'));
|
||||
return $this->expenseService->getDatatable(\Request::input('sSearch'));
|
||||
}
|
||||
|
||||
public function getDatatableVendor($vendorPublicId = null)
|
||||
|
|
@ -83,7 +82,7 @@ class ExpenseController extends BaseController
|
|||
}
|
||||
|
||||
$data = [
|
||||
'vendorPublicId' => Input::old('vendor') ? Input::old('vendor') : $request->vendor_id,
|
||||
'vendorPublicId' => Request::old('vendor') ? Request::old('vendor') : $request->vendor_id,
|
||||
'expense' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'expenses',
|
||||
|
|
@ -190,7 +189,7 @@ class ExpenseController extends BaseController
|
|||
|
||||
Session::flash('message', trans('texts.updated_expense'));
|
||||
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
if (in_array($action, ['archive', 'delete', 'restore', 'invoice', 'add_to_invoice'])) {
|
||||
return self::bulk();
|
||||
}
|
||||
|
|
@ -227,8 +226,8 @@ class ExpenseController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
$referer = Request::server('HTTP_REFERER');
|
||||
|
||||
switch ($action) {
|
||||
|
|
@ -268,7 +267,7 @@ class ExpenseController extends BaseController
|
|||
->with('expenseCurrencyId', $currencyId)
|
||||
->with('expenses', $ids);
|
||||
} else {
|
||||
$invoiceId = Input::get('invoice_id');
|
||||
$invoiceId = \Request::input('invoice_id');
|
||||
|
||||
return Redirect::to("invoices/{$invoiceId}/edit")
|
||||
->with('expenseCurrencyId', $currencyId)
|
||||
|
|
@ -291,7 +290,7 @@ class ExpenseController extends BaseController
|
|||
private static function getViewModel($expense = false)
|
||||
{
|
||||
return [
|
||||
'data' => Input::old('data'),
|
||||
'data' => Request::old('data'),
|
||||
'account' => Auth::user()->account,
|
||||
'vendors' => Vendor::scope()->withActiveOrSelected($expense ? $expense->vendor_id : false)->with('vendor_contacts')->orderBy('name')->get(),
|
||||
'clients' => Client::scope()->withActiveOrSelected($expense ? $expense->client_id : false)->with('contacts')->orderBy('name')->get(),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use App\Libraries\Utils;
|
|||
use App\Models\Account;
|
||||
use App\Ninja\Mailers\Mailer;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Mail;
|
||||
use Redirect;
|
||||
use Request;
|
||||
|
|
@ -65,17 +64,27 @@ class HomeController extends BaseController
|
|||
*/
|
||||
public function invoiceNow()
|
||||
{
|
||||
$url = 'https://invoicing.co';
|
||||
|
||||
if (Request::has('rc')) {
|
||||
$url = $url . '?rc=' . \Request::input('rc');
|
||||
}
|
||||
|
||||
return Redirect::to($url);
|
||||
|
||||
/*
|
||||
// Track the referral/campaign code
|
||||
if (Input::has('rc')) {
|
||||
session([SESSION_REFERRAL_CODE => Input::get('rc')]);
|
||||
if (Request::has('rc')) {
|
||||
session([SESSION_REFERRAL_CODE => \Request::input('rc')]);
|
||||
}
|
||||
|
||||
if (Auth::check()) {
|
||||
$redirectTo = Input::get('redirect_to') ? SITE_URL . '/' . ltrim(Input::get('redirect_to'), '/') : 'invoices/create';
|
||||
return Redirect::to($redirectTo)->with('sign_up', Input::get('sign_up'));
|
||||
$redirectTo = \Request::input('redirect_to') ? SITE_URL . '/' . ltrim(\Request::input('redirect_to'), '/') : 'invoices/create';
|
||||
return Redirect::to($redirectTo)->with('sign_up', \Request::input('sign_up'));
|
||||
} else {
|
||||
return View::make('public.invoice_now');
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -115,7 +124,7 @@ class HomeController extends BaseController
|
|||
*/
|
||||
public function logError()
|
||||
{
|
||||
return Utils::logError(Input::get('error'), 'JavaScript');
|
||||
return Utils::logError(\Request::input('error'), 'JavaScript');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use Illuminate\Http\Request;
|
|||
use App\Services\ImportService;
|
||||
use App\Jobs\ImportData;
|
||||
use Exception;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use Utils;
|
||||
|
|
@ -26,7 +25,7 @@ class ImportController extends BaseController
|
|||
return redirect('/settings/' . ACCOUNT_IMPORT_EXPORT)->withError(trans('texts.confirm_account_to_import'));
|
||||
}
|
||||
|
||||
$source = Input::get('source');
|
||||
$source = \Request::input('source');
|
||||
$files = [];
|
||||
$timestamp = time();
|
||||
|
||||
|
|
@ -70,8 +69,8 @@ class ImportController extends BaseController
|
|||
'timestamp' => $timestamp,
|
||||
]);
|
||||
} elseif ($source === IMPORT_JSON) {
|
||||
$includeData = filter_var(Input::get('data'), FILTER_VALIDATE_BOOLEAN);
|
||||
$includeSettings = filter_var(Input::get('settings'), FILTER_VALIDATE_BOOLEAN);
|
||||
$includeData = filter_var(\Request::input('data'), FILTER_VALIDATE_BOOLEAN);
|
||||
$includeSettings = filter_var(\Request::input('settings'), FILTER_VALIDATE_BOOLEAN);
|
||||
if (config('queue.default') === 'sync') {
|
||||
$results = $this->importService->importJSON($files[IMPORT_JSON], $includeData, $includeSettings);
|
||||
$message = $this->importService->presentResults($results, $includeSettings);
|
||||
|
|
@ -109,9 +108,9 @@ class ImportController extends BaseController
|
|||
public function doImportCSV()
|
||||
{
|
||||
try {
|
||||
$map = Input::get('map');
|
||||
$headers = Input::get('headers');
|
||||
$timestamp = Input::get('timestamp');
|
||||
$map = \Request::input('map');
|
||||
$headers = \Request::input('headers');
|
||||
$timestamp = \Request::input('timestamp');
|
||||
|
||||
if (config('queue.default') === 'sync') {
|
||||
$results = $this->importService->importCSV($map, $headers, $timestamp);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Models\Subscription;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Response;
|
||||
use Utils;
|
||||
|
||||
|
|
@ -18,7 +17,7 @@ class IntegrationController extends BaseAPIController
|
|||
*/
|
||||
public function subscribe()
|
||||
{
|
||||
$eventId = Utils::lookupEventId(trim(Input::get('event')));
|
||||
$eventId = Utils::lookupEventId(trim(\Request::input('event')));
|
||||
|
||||
if (! $eventId) {
|
||||
return Response::json('Event is invalid', 500);
|
||||
|
|
@ -26,7 +25,7 @@ class IntegrationController extends BaseAPIController
|
|||
|
||||
$subscription = Subscription::createNew();
|
||||
$subscription->event_id = $eventId;
|
||||
$subscription->target_url = trim(Input::get('target_url'));
|
||||
$subscription->target_url = trim(\Request::input('target_url'));
|
||||
$subscription->save();
|
||||
|
||||
if (! $subscription->id) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ use App\Ninja\Repositories\PaymentRepository;
|
|||
use App\Services\InvoiceService;
|
||||
use App\Services\PaymentService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Response;
|
||||
use Utils;
|
||||
use Validator;
|
||||
|
|
@ -64,12 +63,12 @@ class InvoiceApiController extends BaseAPIController
|
|||
->orderBy('updated_at', 'desc');
|
||||
|
||||
// Filter by invoice number
|
||||
if ($invoiceNumber = Input::get('invoice_number')) {
|
||||
if ($invoiceNumber = \Request::input('invoice_number')) {
|
||||
$invoices->whereInvoiceNumber($invoiceNumber);
|
||||
}
|
||||
|
||||
// Fllter by status
|
||||
if ($statusId = Input::get('status_id')) {
|
||||
if ($statusId = \Request::input('status_id')) {
|
||||
$invoices->where('invoice_status_id', '>=', $statusId);
|
||||
}
|
||||
|
||||
|
|
@ -134,7 +133,7 @@ class InvoiceApiController extends BaseAPIController
|
|||
*/
|
||||
public function store(CreateInvoiceAPIRequest $request)
|
||||
{
|
||||
$data = Input::all();
|
||||
$data = \Request::all();
|
||||
$error = null;
|
||||
|
||||
if (isset($data['email'])) {
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ use App\Services\RecurringInvoiceService;
|
|||
use Auth;
|
||||
use Cache;
|
||||
use DB;
|
||||
use Input;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use Request;
|
||||
use URL;
|
||||
use Utils;
|
||||
use View;
|
||||
|
|
@ -68,7 +68,7 @@ class InvoiceController extends BaseController
|
|||
public function getDatatable($clientPublicId = null)
|
||||
{
|
||||
$accountId = Auth::user()->account_id;
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
|
||||
return $this->invoiceService->getDatatable($accountId, $clientPublicId, ENTITY_INVOICE, $search);
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ class InvoiceController extends BaseController
|
|||
public function getRecurringDatatable($clientPublicId = null)
|
||||
{
|
||||
$accountId = Auth::user()->account_id;
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
|
||||
return $this->recurringInvoiceService->getDatatable($accountId, $clientPublicId, ENTITY_RECURRING_INVOICE, $search);
|
||||
}
|
||||
|
|
@ -219,6 +219,9 @@ class InvoiceController extends BaseController
|
|||
$clients = $clients->where('clients.user_id', '=', Auth::user()->id);
|
||||
}
|
||||
|
||||
if($clientPublicId != 0)
|
||||
$clients->where('public_id', $clientPublicId);
|
||||
|
||||
$data = [
|
||||
'clients' => $clients->get(),
|
||||
'entityType' => $invoice->getEntityType(),
|
||||
|
|
@ -317,7 +320,7 @@ class InvoiceController extends BaseController
|
|||
}
|
||||
|
||||
return [
|
||||
'data' => Input::old('data'),
|
||||
'data' => Request::old('data'),
|
||||
'account' => Auth::user()->account->load('country'),
|
||||
'products' => Product::scope()->orderBy('product_key')->get(),
|
||||
'taxRateOptions' => $taxRateOptions,
|
||||
|
|
@ -345,8 +348,8 @@ class InvoiceController extends BaseController
|
|||
$data = $request->input();
|
||||
$data['documents'] = $request->file('documents');
|
||||
|
||||
$action = Input::get('action');
|
||||
$entityType = Input::get('entityType');
|
||||
$action = \Request::input('action');
|
||||
$entityType = \Request::input('entityType');
|
||||
|
||||
$invoice = $this->invoiceService->save($data);
|
||||
$entityType = $invoice->getEntityType();
|
||||
|
|
@ -379,8 +382,8 @@ class InvoiceController extends BaseController
|
|||
$data = $request->input();
|
||||
$data['documents'] = $request->file('documents');
|
||||
|
||||
$action = Input::get('action');
|
||||
$entityType = Input::get('entityType');
|
||||
$action = \Request::input('action');
|
||||
$entityType = \Request::input('entityType');
|
||||
|
||||
$invoice = $this->invoiceService->save($data, $request->entity());
|
||||
$entityType = $invoice->getEntityType();
|
||||
|
|
@ -402,14 +405,14 @@ class InvoiceController extends BaseController
|
|||
|
||||
private function emailInvoice($invoice)
|
||||
{
|
||||
$reminder = Input::get('reminder');
|
||||
$template = Input::get('template');
|
||||
$pdfUpload = Utils::decodePDF(Input::get('pdfupload'));
|
||||
$reminder = \Request::input('reminder');
|
||||
$template = \Request::input('template');
|
||||
$pdfUpload = Utils::decodePDF(\Request::input('pdfupload'));
|
||||
$entityType = $invoice->getEntityType();
|
||||
|
||||
if (filter_var(Input::get('save_as_default'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
if (filter_var(\Request::input('save_as_default'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
$account = Auth::user()->account;
|
||||
$account->setTemplateDefaults(Input::get('template_type'), $template['subject'], $template['body']);
|
||||
$account->setTemplateDefaults(\Request::input('template_type'), $template['subject'], $template['body']);
|
||||
}
|
||||
|
||||
if (! Auth::user()->confirmed) {
|
||||
|
|
@ -427,7 +430,7 @@ class InvoiceController extends BaseController
|
|||
$response = $this->emailRecurringInvoice($invoice);
|
||||
} else {
|
||||
$userId = Auth::user()->id;
|
||||
$this->dispatch(new SendInvoiceEmail($invoice, $userId, $reminder, $template));
|
||||
dispatch(new SendInvoiceEmail($invoice, $userId, $reminder, $template));
|
||||
$response = true;
|
||||
}
|
||||
|
||||
|
|
@ -490,8 +493,8 @@ class InvoiceController extends BaseController
|
|||
*/
|
||||
public function bulk($entityType = ENTITY_INVOICE)
|
||||
{
|
||||
$action = Input::get('bulk_action') ?: Input::get('action');
|
||||
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids'));
|
||||
$action = \Request::input('bulk_action') ?: \Request::input('action');
|
||||
$ids = \Request::input('bulk_public_id') ?: (\Request::input('public_id') ?: \Request::input('ids'));
|
||||
$count = $this->invoiceService->bulk($ids, $action);
|
||||
|
||||
if ($count > 0) {
|
||||
|
|
|
|||
|
|
@ -6,15 +6,22 @@ use App\Http\Controllers\BaseController;
|
|||
use App\Http\Requests\MigrationAuthRequest;
|
||||
use App\Http\Requests\MigrationCompaniesRequest;
|
||||
use App\Http\Requests\MigrationEndpointRequest;
|
||||
use App\Http\Requests\MigrationForwardRequest;
|
||||
use App\Http\Requests\MigrationTypeRequest;
|
||||
use App\Jobs\HostedMigration;
|
||||
use App\Libraries\Utils;
|
||||
use App\Models\Account;
|
||||
use App\Models\AccountGatewayToken;
|
||||
use App\Models\Client;
|
||||
use App\Services\Migration\AuthService;
|
||||
use App\Services\Migration\CompanyService;
|
||||
use App\Services\Migration\CompleteService;
|
||||
use App\Traits\GenerateMigrationResources;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Validator;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
|
||||
class StepsController extends BaseController
|
||||
{
|
||||
|
|
@ -45,6 +52,17 @@ class StepsController extends BaseController
|
|||
*/
|
||||
public function start()
|
||||
{
|
||||
if(Utils::isNinja()){
|
||||
|
||||
session()->put('MIGRATION_ENDPOINT', 'https://v5-app1.invoicing.co');
|
||||
// session()->put('MIGRATION_ENDPOINT', 'http://ninja.test:8000');
|
||||
session()->put('MIGRATION_ACCOUNT_TOKEN','');
|
||||
session()->put('MIGRAITON_API_SECRET', null);
|
||||
|
||||
return $this->companies();
|
||||
|
||||
}
|
||||
|
||||
return view('migration.start');
|
||||
}
|
||||
|
||||
|
|
@ -65,17 +83,12 @@ class StepsController extends BaseController
|
|||
{
|
||||
session()->put('MIGRATION_TYPE', $request->option);
|
||||
|
||||
if ($request->option == 0) {
|
||||
|
||||
session()->put('MIGRATION_ENDPOINT', 'https://invoicing.co');
|
||||
if ($request->option == 0 || $request->option == '0') {
|
||||
|
||||
return redirect(
|
||||
url('/migration/auth')
|
||||
url('/migration/companies?hosted=true')
|
||||
);
|
||||
|
||||
// return redirect(
|
||||
// url('/migration/endpoint')
|
||||
// );
|
||||
}
|
||||
|
||||
return redirect(
|
||||
|
|
@ -83,8 +96,145 @@ class StepsController extends BaseController
|
|||
);
|
||||
}
|
||||
|
||||
public function forwardUrl(Request $request)
|
||||
{
|
||||
|
||||
if(Utils::isNinjaProd())
|
||||
return $this->autoForwardUrl();
|
||||
|
||||
$rules = [
|
||||
'url' => 'nullable|url',
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return back()
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
|
||||
$account_settings = \Auth::user()->account->account_email_settings;
|
||||
|
||||
if(strlen($request->input('url')) == 0) {
|
||||
$account_settings->is_disabled = false;
|
||||
}
|
||||
else {
|
||||
$account_settings->is_disabled = true;
|
||||
}
|
||||
|
||||
$account_settings->forward_url_for_v5 = rtrim($request->input('url'),'/');
|
||||
$account_settings->save();
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function disableForwarding()
|
||||
{
|
||||
$account = \Auth::user()->account;
|
||||
|
||||
$account_settings = $account->account_email_settings;
|
||||
$account_settings->forward_url_for_v5 = '';
|
||||
$account_settings->is_disabled = false;
|
||||
$account_settings->save();
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
private function autoForwardUrl()
|
||||
{
|
||||
|
||||
$url = 'https://invoicing.co/api/v1/confirm_forwarding';
|
||||
// $url = 'http://devhosted.test:8000/api/v1/confirm_forwarding';
|
||||
|
||||
$headers = [
|
||||
'X-API-HOSTED-SECRET' => config('ninja.ninja_hosted_secret'),
|
||||
'X-Requested-With' => 'XMLHttpRequest',
|
||||
'Content-Type' => 'application/json',
|
||||
];
|
||||
|
||||
$account = \Auth::user()->account;
|
||||
$gateway_reference = '';
|
||||
|
||||
$ninja_client = Client::where('public_id', $account->id)->first();
|
||||
|
||||
if($ninja_client){
|
||||
$agt = AccountGatewayToken::where('client_id', $ninja_client->id)->first();
|
||||
|
||||
if($agt)
|
||||
$gateway_reference = $agt->token;
|
||||
}
|
||||
|
||||
$body = [
|
||||
'account_key' => $account->account_key,
|
||||
'email' => $account->getPrimaryUser()->email,
|
||||
'plan' => $account->company->plan,
|
||||
'plan_term' =>$account->company->plan_term,
|
||||
'plan_started' =>$account->company->plan_started,
|
||||
'plan_paid' =>$account->company->plan_paid,
|
||||
'plan_expires' =>$account->company->plan_expires,
|
||||
'trial_started' =>$account->company->trial_started,
|
||||
'trial_plan' =>$account->company->trial_plan,
|
||||
'plan_price' =>$account->company->plan_price,
|
||||
'num_users' =>$account->company->num_users,
|
||||
'gateway_reference' => $gateway_reference,
|
||||
];
|
||||
|
||||
$client = new \GuzzleHttp\Client([
|
||||
'headers' => $headers,
|
||||
]);
|
||||
|
||||
$response = $client->post($url,[
|
||||
RequestOptions::JSON => $body,
|
||||
RequestOptions::ALLOW_REDIRECTS => false
|
||||
]);
|
||||
|
||||
if($response->getStatusCode() == 401){
|
||||
info("autoForwardUrl");
|
||||
info($response->getBody());
|
||||
|
||||
} elseif ($response->getStatusCode() == 200) {
|
||||
|
||||
$message_body = json_decode($response->getBody(), true);
|
||||
|
||||
$forwarding_url = $message_body['forward_url'];
|
||||
|
||||
$account_settings = $account->account_email_settings;
|
||||
|
||||
if(strlen($forwarding_url) == 0) {
|
||||
$account_settings->is_disabled = false;
|
||||
}
|
||||
else {
|
||||
$account_settings->is_disabled = true;
|
||||
}
|
||||
|
||||
$account_settings->forward_url_for_v5 = rtrim($forwarding_url,'/');
|
||||
$account_settings->save();
|
||||
|
||||
$billing_transferred = $message_body['billing_transferred'];
|
||||
|
||||
if($billing_transferred == 'true'){
|
||||
|
||||
$company = $account->company;
|
||||
$company->plan = null;
|
||||
$company->plan_expires = null;
|
||||
$company->save();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
info("failed to autoforward");
|
||||
info(json_decode($response->getBody()->getContents()));
|
||||
// dd('else');
|
||||
}
|
||||
|
||||
return back();
|
||||
|
||||
}
|
||||
|
||||
public function endpoint()
|
||||
{
|
||||
|
||||
if ($this->shouldGoBack('endpoint')) {
|
||||
return redirect(
|
||||
url($this->access['endpoint']['redirect'])
|
||||
|
|
@ -175,23 +325,38 @@ class StepsController extends BaseController
|
|||
url($this->access['companies']['redirect'])
|
||||
);
|
||||
}
|
||||
$bool = true;
|
||||
|
||||
if(Utils::isNinja())
|
||||
{
|
||||
|
||||
$this->dispatch(new HostedMigration(auth()->user(), $request->all(), config('database.default')));
|
||||
|
||||
return view('migration.completed');
|
||||
|
||||
}
|
||||
|
||||
$completeService = (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN')));
|
||||
|
||||
try {
|
||||
$migrationData = $this->generateMigrationData($request->all());
|
||||
|
||||
$completeService = (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN')))
|
||||
->data($migrationData)
|
||||
$completeService->data($migrationData)
|
||||
->endpoint(session('MIGRATION_ENDPOINT'))
|
||||
->start();
|
||||
}
|
||||
finally {
|
||||
catch(\Exception $e){
|
||||
info($e->getMessage());
|
||||
return view('migration.completed', ['customMessage' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
|
||||
if ($completeService->isSuccessful()) {
|
||||
return view('migration.completed');
|
||||
}
|
||||
|
||||
return view('migration.completed', ['customMessage' => $completeService->getErrors()[0]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function completed()
|
||||
|
|
@ -257,9 +422,10 @@ class StepsController extends BaseController
|
|||
'products' => $this->getProducts(),
|
||||
'credits' => $this->getCreditsNotes(),
|
||||
'invoices' => $this->getInvoices(),
|
||||
'recurring_expenses' => $this->getRecurringExpenses(),
|
||||
'recurring_invoices' => $this->getRecurringInvoices(),
|
||||
'quotes' => $this->getQuotes(),
|
||||
'payments' => array_merge($this->getPayments(), $this->getCredits()),
|
||||
'payments' => $this->getPayments(),
|
||||
'documents' => $this->getDocuments(),
|
||||
'expense_categories' => $this->getExpenseCategories(),
|
||||
'task_statuses' => $this->getTaskStatuses(),
|
||||
|
|
@ -274,8 +440,6 @@ class StepsController extends BaseController
|
|||
Storage::makeDirectory('migrations');
|
||||
$file = Storage::path("migrations/{$fileName}.zip");
|
||||
|
||||
//$file = storage_path("migrations/{$fileName}.zip");
|
||||
|
||||
ksort($localMigrationData);
|
||||
|
||||
$zip = new \ZipArchive();
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ use App\Libraries\CurlUtils;
|
|||
use Auth;
|
||||
use Cache;
|
||||
use CreditCard;
|
||||
use Input;
|
||||
use Omnipay;
|
||||
use Session;
|
||||
use URL;
|
||||
use Utils;
|
||||
use Validator;
|
||||
use View;
|
||||
use Request;
|
||||
|
||||
class NinjaController extends BaseController
|
||||
{
|
||||
|
|
@ -91,18 +91,18 @@ class NinjaController extends BaseController
|
|||
*/
|
||||
public function show_license_payment()
|
||||
{
|
||||
if (Input::has('return_url')) {
|
||||
session(['return_url' => Input::get('return_url')]);
|
||||
if (\Request::has('return_url')) {
|
||||
session(['return_url' => \Request::input('return_url')]);
|
||||
}
|
||||
|
||||
if (Input::has('affiliate_key')) {
|
||||
if ($affiliate = Affiliate::where('affiliate_key', '=', Input::get('affiliate_key'))->first()) {
|
||||
if (\Request::has('affiliate_key')) {
|
||||
if ($affiliate = Affiliate::where('affiliate_key', '=', \Request::input('affiliate_key'))->first()) {
|
||||
session(['affiliate_id' => $affiliate->id]);
|
||||
}
|
||||
}
|
||||
|
||||
if (Input::has('product_id')) {
|
||||
session(['product_id' => Input::get('product_id')]);
|
||||
if (\Request::has('product_id')) {
|
||||
session(['product_id' => \Request::input('product_id')]);
|
||||
} elseif (! Session::has('product_id')) {
|
||||
session(['product_id' => PRODUCT_ONE_CLICK_INSTALL]);
|
||||
}
|
||||
|
|
@ -111,8 +111,8 @@ class NinjaController extends BaseController
|
|||
return Utils::fatalError();
|
||||
}
|
||||
|
||||
if (Utils::isNinjaDev() && Input::has('test_mode')) {
|
||||
session(['test_mode' => Input::get('test_mode')]);
|
||||
if (Utils::isNinjaDev() && \Request::has('test_mode')) {
|
||||
session(['test_mode' => \Request::input('test_mode')]);
|
||||
}
|
||||
|
||||
$account = $this->accountRepo->getNinjaAccount();
|
||||
|
|
@ -167,7 +167,7 @@ class NinjaController extends BaseController
|
|||
'country_id' => 'required',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return redirect()->to('license')
|
||||
|
|
@ -185,7 +185,7 @@ class NinjaController extends BaseController
|
|||
if ($testMode) {
|
||||
$ref = 'TEST_MODE';
|
||||
} else {
|
||||
$details = self::getLicensePaymentDetails(Input::all(), $affiliate);
|
||||
$details = self::getLicensePaymentDetails(Request::all(), $affiliate);
|
||||
|
||||
$gateway = Omnipay::create($accountGateway->gateway->provider);
|
||||
$gateway->initialize((array) $accountGateway->getConfig());
|
||||
|
|
@ -203,9 +203,9 @@ class NinjaController extends BaseController
|
|||
$licenseKey = Utils::generateLicense();
|
||||
|
||||
$license = new License();
|
||||
$license->first_name = Input::get('first_name');
|
||||
$license->last_name = Input::get('last_name');
|
||||
$license->email = Input::get('email');
|
||||
$license->first_name = \Request::input('first_name');
|
||||
$license->last_name = \Request::input('last_name');
|
||||
$license->email = \Request::input('email');
|
||||
$license->transaction_reference = $ref;
|
||||
$license->license_key = $licenseKey;
|
||||
$license->affiliate_id = Session::get('affiliate_id');
|
||||
|
|
@ -241,8 +241,8 @@ class NinjaController extends BaseController
|
|||
*/
|
||||
public function claim_license()
|
||||
{
|
||||
$licenseKey = Input::get('license_key');
|
||||
$productId = Input::get('product_id', PRODUCT_ONE_CLICK_INSTALL);
|
||||
$licenseKey = \Request::input('license_key');
|
||||
$productId = \Request::input('product_id', PRODUCT_ONE_CLICK_INSTALL);
|
||||
|
||||
// add in dashes
|
||||
if (strlen($licenseKey) == 20) {
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ use App\Services\PaymentService;
|
|||
use Auth;
|
||||
use Crawler;
|
||||
use Exception;
|
||||
use Input;
|
||||
use Session;
|
||||
use URL;
|
||||
use Utils;
|
||||
use Validator;
|
||||
use View;
|
||||
use Request;
|
||||
|
||||
/**
|
||||
* Class OnlinePaymentController.
|
||||
|
|
@ -114,7 +114,7 @@ class OnlinePaymentController extends BaseController
|
|||
}
|
||||
|
||||
try {
|
||||
return $paymentDriver->startPurchase(Input::all(), $sourceId);
|
||||
return $paymentDriver->startPurchase(Request::all(), $sourceId);
|
||||
} catch (Exception $exception) {
|
||||
return $this->error($paymentDriver, $exception);
|
||||
}
|
||||
|
|
@ -202,12 +202,12 @@ class OnlinePaymentController extends BaseController
|
|||
|
||||
$paymentDriver = $invitation->account->paymentDriver($invitation, $gatewayTypeId);
|
||||
|
||||
if ($error = Input::get('error_description') ?: Input::get('error')) {
|
||||
if ($error = \Request::input('error_description') ?: \Request::input('error')) {
|
||||
return $this->error($paymentDriver, $error);
|
||||
}
|
||||
|
||||
try {
|
||||
if ($paymentDriver->completeOffsitePurchase(Input::all())) {
|
||||
if ($paymentDriver->completeOffsitePurchase(Request::all())) {
|
||||
Session::flash('message', trans('texts.applied_payment'));
|
||||
}
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ class OnlinePaymentController extends BaseController
|
|||
$paymentDriver = $accountGateway->paymentDriver();
|
||||
|
||||
try {
|
||||
$result = $paymentDriver->handleWebHook(Input::all());
|
||||
$result = $paymentDriver->handleWebHook(Request::all());
|
||||
|
||||
return response()->json(['message' => $result]);
|
||||
} catch (Exception $exception) {
|
||||
|
|
@ -350,8 +350,8 @@ class OnlinePaymentController extends BaseController
|
|||
return redirect()->to(NINJA_WEB_URL, 301);
|
||||
}
|
||||
|
||||
$account = Account::whereAccountKey(Input::get('account_key'))->first();
|
||||
$redirectUrl = Input::get('redirect_url');
|
||||
$account = Account::whereAccountKey(\Request::input('account_key'))->first();
|
||||
$redirectUrl = \Request::input('redirect_url');
|
||||
$failureUrl = URL::previous();
|
||||
|
||||
if (! $account || ! $account->enable_buy_now_buttons || ! $account->hasFeature(FEATURE_BUY_NOW_BUTTONS)) {
|
||||
|
|
@ -360,7 +360,7 @@ class OnlinePaymentController extends BaseController
|
|||
|
||||
Auth::onceUsingId($account->users[0]->id);
|
||||
$account->loadLocalizationSettings();
|
||||
$product = Product::scope(Input::get('product_id'))->first();
|
||||
$product = Product::scope(\Request::input('product_id'))->first();
|
||||
|
||||
if (! $product) {
|
||||
return redirect()->to("{$failureUrl}/?error=invalid product");
|
||||
|
|
@ -368,7 +368,7 @@ class OnlinePaymentController extends BaseController
|
|||
|
||||
// check for existing client using contact_key
|
||||
$client = false;
|
||||
if ($contactKey = Input::get('contact_key')) {
|
||||
if ($contactKey = \Request::input('contact_key')) {
|
||||
$client = Client::scope()->whereHas('contacts', function ($query) use ($contactKey) {
|
||||
$query->where('contact_key', $contactKey);
|
||||
})->first();
|
||||
|
|
@ -380,7 +380,7 @@ class OnlinePaymentController extends BaseController
|
|||
'email' => 'email|string|max:100',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
return redirect()->to("{$failureUrl}/?error=" . $validator->errors()->first());
|
||||
}
|
||||
|
|
@ -404,17 +404,17 @@ class OnlinePaymentController extends BaseController
|
|||
|
||||
$data = [
|
||||
'client_id' => $client->id,
|
||||
'is_recurring' => filter_var(Input::get('is_recurring'), FILTER_VALIDATE_BOOLEAN),
|
||||
'is_public' => filter_var(Input::get('is_recurring'), FILTER_VALIDATE_BOOLEAN),
|
||||
'frequency_id' => Input::get('frequency_id'),
|
||||
'auto_bill_id' => Input::get('auto_bill_id'),
|
||||
'start_date' => Input::get('start_date', date('Y-m-d')),
|
||||
'is_recurring' => filter_var(\Request::input('is_recurring'), FILTER_VALIDATE_BOOLEAN),
|
||||
'is_public' => filter_var(\Request::input('is_recurring'), FILTER_VALIDATE_BOOLEAN),
|
||||
'frequency_id' => \Request::input('frequency_id'),
|
||||
'auto_bill_id' => \Request::input('auto_bill_id'),
|
||||
'start_date' => \Request::input('start_date', date('Y-m-d')),
|
||||
'tax_rate1' => $account->tax_rate1,
|
||||
'tax_name1' => $account->tax_name1 ?: '',
|
||||
'tax_rate2' => $account->tax_rate2,
|
||||
'tax_name2' => $account->tax_name2 ?: '',
|
||||
'custom_text_value1' => Input::get('custom_invoice1'),
|
||||
'custom_text_value2' => Input::get('custom_invoice2'),
|
||||
'custom_text_value1' => \Request::input('custom_invoice1'),
|
||||
'custom_text_value2' => \Request::input('custom_invoice2'),
|
||||
'invoice_items' => [[
|
||||
'product_key' => $product->product_key,
|
||||
'notes' => $product->notes,
|
||||
|
|
@ -424,8 +424,8 @@ class OnlinePaymentController extends BaseController
|
|||
'tax_name1' => $product->tax_name1 ?: '',
|
||||
'tax_rate2' => $product->tax_rate2,
|
||||
'tax_name2' => $product->tax_name2 ?: '',
|
||||
'custom_value1' => Input::get('custom_product1') ?: $product->custom_value1,
|
||||
'custom_value2' => Input::get('custom_product2') ?: $product->custom_value2,
|
||||
'custom_value1' => \Request::input('custom_product1') ?: $product->custom_value1,
|
||||
'custom_value2' => \Request::input('custom_product2') ?: $product->custom_value2,
|
||||
]],
|
||||
];
|
||||
$invoice = $invoiceService->save($data);
|
||||
|
|
@ -445,7 +445,7 @@ class OnlinePaymentController extends BaseController
|
|||
$link = $invitation->getLink();
|
||||
}
|
||||
|
||||
if (filter_var(Input::get('return_link'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
if (filter_var(\Request::input('return_link'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
return $link;
|
||||
} else {
|
||||
return redirect()->to($link);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ use App\Models\Payment;
|
|||
use App\Ninja\Mailers\ContactMailer;
|
||||
use App\Ninja\Repositories\PaymentRepository;
|
||||
use App\Services\PaymentService;
|
||||
use Input;
|
||||
use Response;
|
||||
|
||||
class PaymentApiController extends BaseAPIController
|
||||
|
|
@ -113,7 +112,7 @@ class PaymentApiController extends BaseAPIController
|
|||
|
||||
$payment = $this->paymentService->save($request->input(), null, $request->invoice);
|
||||
|
||||
if (Input::get('email_receipt')) {
|
||||
if (\Request::input('email_receipt')) {
|
||||
$this->contactMailer->sendPaymentConfirmation($payment);
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +159,7 @@ class PaymentApiController extends BaseAPIController
|
|||
$data['public_id'] = $publicId;
|
||||
$payment = $this->paymentRepo->save($data, $request->entity());
|
||||
|
||||
if (Input::get('email_receipt')) {
|
||||
if (\Request::input('email_receipt')) {
|
||||
$this->contactMailer->sendPaymentConfirmation($payment);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ use App\Services\PaymentService;
|
|||
use Auth;
|
||||
use Cache;
|
||||
use DropdownButton;
|
||||
use Input;
|
||||
use Session;
|
||||
use Utils;
|
||||
use View;
|
||||
use Request;
|
||||
|
||||
class PaymentController extends BaseController
|
||||
{
|
||||
|
|
@ -79,7 +79,7 @@ class PaymentController extends BaseController
|
|||
*/
|
||||
public function getDatatable($clientPublicId = null)
|
||||
{
|
||||
return $this->paymentService->getDatatable($clientPublicId, Input::get('sSearch'));
|
||||
return $this->paymentService->getDatatable($clientPublicId, \Request::input('sSearch'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -98,8 +98,8 @@ class PaymentController extends BaseController
|
|||
->with('client', 'invoice_status')
|
||||
->orderBy('invoice_number')->get();
|
||||
|
||||
$clientPublicId = Input::old('client') ? Input::old('client') : ($request->client_id ?: 0);
|
||||
$invoicePublicId = Input::old('invoice') ? Input::old('invoice') : ($request->invoice_id ?: 0);
|
||||
$clientPublicId = Request::old('client') ? Request::old('client') : ($request->client_id ?: 0);
|
||||
$invoicePublicId = Request::old('invoice') ? Request::old('invoice') : ($request->invoice_id ?: 0);
|
||||
|
||||
$totalCredit = false;
|
||||
if ($clientPublicId && $client = Client::scope($clientPublicId)->first()) {
|
||||
|
|
@ -118,7 +118,7 @@ class PaymentController extends BaseController
|
|||
'method' => 'POST',
|
||||
'url' => 'payments',
|
||||
'title' => trans('texts.new_payment'),
|
||||
'paymentTypeId' => Input::get('paymentTypeId'),
|
||||
'paymentTypeId' => \Request::input('paymentTypeId'),
|
||||
'clients' => Client::scope()->with('contacts')->orderBy('name')->get(),
|
||||
'totalCredit' => $totalCredit,
|
||||
];
|
||||
|
|
@ -211,7 +211,7 @@ class PaymentController extends BaseController
|
|||
|
||||
$payment = $this->paymentService->save($input, null, $request->invoice);
|
||||
|
||||
if (Input::get('email_receipt')) {
|
||||
if (\Request::input('email_receipt')) {
|
||||
$this->contactMailer->sendPaymentConfirmation($payment);
|
||||
Session::flash('message', trans($credit ? 'texts.created_payment_and_credit_emailed_client' : 'texts.created_payment_emailed_client'));
|
||||
} else {
|
||||
|
|
@ -244,8 +244,8 @@ class PaymentController extends BaseController
|
|||
*/
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
|
||||
if ($action === 'email') {
|
||||
$payment = Payment::scope($ids)->withArchived()->first();
|
||||
|
|
@ -253,8 +253,8 @@ class PaymentController extends BaseController
|
|||
Session::flash('message', trans('texts.emailed_payment'));
|
||||
} else {
|
||||
$count = $this->paymentService->bulk($ids, $action, [
|
||||
'refund_amount' => Input::get('refund_amount'),
|
||||
'refund_email' => Input::get('refund_email'),
|
||||
'refund_amount' => \Request::input('refund_amount'),
|
||||
'refund_email' => \Request::input('refund_email'),
|
||||
]);
|
||||
if ($count > 0) {
|
||||
$message = Utils::pluralize($action == 'refund' ? 'refunded_payment' : $action.'d_payment', $count);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class PaymentTermApiController extends BaseAPIController
|
|||
|
||||
$paymentTerm = PaymentTerm::createNew();
|
||||
|
||||
$paymentTerm->num_days = Utils::parseInt(Input::get('num_days'));
|
||||
$paymentTerm->num_days = Utils::parseInt(\Request::input('num_days'));
|
||||
$paymentTerm->name = 'Net ' . $paymentTerm->num_days;
|
||||
$paymentTerm->save();
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use App\Http\Requests\UpdatePaymentTermRequest;
|
|||
use App\Models\PaymentTerm;
|
||||
use App\Services\PaymentTermService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -114,7 +113,7 @@ class PaymentTermController extends BaseController
|
|||
$paymentTerm = PaymentTerm::createNew();
|
||||
}
|
||||
|
||||
$paymentTerm->num_days = Utils::parseInt(Input::get('num_days'));
|
||||
$paymentTerm->num_days = Utils::parseInt(\Request::input('num_days'));
|
||||
$paymentTerm->name = 'Net ' . $paymentTerm->num_days;
|
||||
$paymentTerm->save();
|
||||
|
||||
|
|
@ -129,8 +128,8 @@ class PaymentTermController extends BaseController
|
|||
*/
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action');
|
||||
$ids = Input::get('bulk_public_id');
|
||||
$action = \Request::input('bulk_action');
|
||||
$ids = \Request::input('bulk_public_id');
|
||||
$count = $this->paymentTermService->bulk($ids, $action);
|
||||
|
||||
Session::flash('message', trans('texts.archived_payment_term'));
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use App\Ninja\Repositories\ProductRepository;
|
|||
use App\Services\ProductService;
|
||||
use Auth;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -72,7 +71,7 @@ class ProductController extends BaseController
|
|||
*/
|
||||
public function getDatatable()
|
||||
{
|
||||
return $this->productService->getDatatable(Auth::user()->account_id, Input::get('sSearch'));
|
||||
return $this->productService->getDatatable(Auth::user()->account_id, \Request::input('sSearch'));
|
||||
}
|
||||
|
||||
public function cloneProduct(ProductRequest $request, $publicId)
|
||||
|
|
@ -167,7 +166,7 @@ class ProductController extends BaseController
|
|||
$product = Product::createNew();
|
||||
}
|
||||
|
||||
$this->productRepo->save(Input::all(), $product);
|
||||
$this->productRepo->save(\Request::all(), $product);
|
||||
|
||||
$message = $productPublicId ? trans('texts.updated_product') : trans('texts.created_product');
|
||||
Session::flash('message', $message);
|
||||
|
|
@ -189,8 +188,8 @@ class ProductController extends BaseController
|
|||
*/
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
|
||||
if ($action == 'invoice') {
|
||||
$products = Product::scope($ids)->get();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ use App\Models\Project;
|
|||
use App\Ninja\Repositories\ProjectRepository;
|
||||
use App\Services\ProjectService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use App\Ninja\Datatables\ProjectDatatable;
|
|||
use App\Ninja\Repositories\ProjectRepository;
|
||||
use App\Services\ProjectService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
|
|
@ -44,7 +43,7 @@ class ProjectController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
$userId = Auth::user()->filterIdByEntity(ENTITY_PROJECT);
|
||||
|
||||
return $this->projectService->getDatatable($search, $userId);
|
||||
|
|
@ -114,7 +113,7 @@ class ProjectController extends BaseController
|
|||
|
||||
Session::flash('message', trans('texts.updated_project'));
|
||||
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
if (in_array($action, ['archive', 'delete', 'restore', 'invoice'])) {
|
||||
return self::bulk();
|
||||
}
|
||||
|
|
@ -124,8 +123,8 @@ class ProjectController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
|
||||
if ($action == 'invoice') {
|
||||
$data = [];
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ use App\Ninja\Datatables\ProposalCategoryDatatable;
|
|||
use App\Ninja\Repositories\ProposalCategoryRepository;
|
||||
use App\Services\ProposalCategoryService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
|
|
@ -43,7 +42,7 @@ class ProposalCategoryController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
$userId = Auth::user()->filterId();
|
||||
|
||||
return $this->proposalCategoryService->getDatatable($search, $userId);
|
||||
|
|
@ -102,7 +101,7 @@ class ProposalCategoryController extends BaseController
|
|||
|
||||
Session::flash('message', trans('texts.updated_proposal_category'));
|
||||
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
if (in_array($action, ['archive', 'delete', 'restore'])) {
|
||||
return self::bulk();
|
||||
}
|
||||
|
|
@ -112,8 +111,8 @@ class ProposalCategoryController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
|
||||
$count = $this->proposalCategoryService->bulk($ids, $action);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use App\Ninja\Datatables\ProposalDatatable;
|
|||
use App\Ninja\Repositories\ProposalRepository;
|
||||
use App\Services\ProposalService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
|
|
@ -50,7 +49,7 @@ class ProposalController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
//$userId = Auth::user()->filterId();
|
||||
$userId = Auth::user()->filterIdByEntity(ENTITY_PROPOSAL);
|
||||
|
||||
|
|
@ -117,7 +116,7 @@ class ProposalController extends BaseController
|
|||
public function store(CreateProposalRequest $request)
|
||||
{
|
||||
$proposal = $this->proposalService->save($request->input());
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
|
||||
if ($action == 'email') {
|
||||
$this->dispatch(new SendInvoiceEmail($proposal->invoice, auth()->user()->id, false, false, $proposal));
|
||||
|
|
@ -132,7 +131,7 @@ class ProposalController extends BaseController
|
|||
public function update(UpdateProposalRequest $request)
|
||||
{
|
||||
$proposal = $this->proposalService->save($request->input(), $request->entity());
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
|
||||
if (in_array($action, ['archive', 'delete', 'restore'])) {
|
||||
return self::bulk();
|
||||
|
|
@ -150,8 +149,8 @@ class ProposalController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action') ?: Input::get('action');
|
||||
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids'));
|
||||
$action = \Request::input('bulk_action') ?: \Request::input('action');
|
||||
$ids = \Request::input('bulk_public_id') ?: (\Request::input('public_id') ?: \Request::input('ids'));
|
||||
|
||||
$count = $this->proposalService->bulk($ids, $action);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use App\Ninja\Datatables\ProposalSnippetDatatable;
|
|||
use App\Ninja\Repositories\ProposalSnippetRepository;
|
||||
use App\Services\ProposalSnippetService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
|
|
@ -44,7 +43,7 @@ class ProposalSnippetController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
$userId = Auth::user()->filterId();
|
||||
|
||||
return $this->proposalSnippetService->getDatatable($search, $userId);
|
||||
|
|
@ -107,7 +106,7 @@ class ProposalSnippetController extends BaseController
|
|||
|
||||
Session::flash('message', trans('texts.updated_proposal_snippet'));
|
||||
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
if (in_array($action, ['archive', 'delete', 'restore'])) {
|
||||
return self::bulk();
|
||||
}
|
||||
|
|
@ -117,8 +116,8 @@ class ProposalSnippetController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
|
||||
$count = $this->proposalSnippetService->bulk($ids, $action);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ use App\Ninja\Datatables\ProposalTemplateDatatable;
|
|||
use App\Ninja\Repositories\ProposalTemplateRepository;
|
||||
use App\Services\ProposalTemplateService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
|
|
@ -43,7 +42,7 @@ class ProposalTemplateController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
$userId = Auth::user()->filterId();
|
||||
|
||||
return $this->proposalTemplateService->getDatatable($search, $userId);
|
||||
|
|
@ -147,7 +146,7 @@ class ProposalTemplateController extends BaseController
|
|||
|
||||
Session::flash('message', trans('texts.updated_proposal_template'));
|
||||
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
if (in_array($action, ['archive', 'delete', 'restore'])) {
|
||||
return self::bulk();
|
||||
}
|
||||
|
|
@ -157,8 +156,8 @@ class ProposalTemplateController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
|
||||
$count = $this->proposalTemplateService->bulk($ids, $action);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ use App\Ninja\Repositories\InvoiceRepository;
|
|||
use App\Services\InvoiceService;
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use Utils;
|
||||
|
|
@ -60,7 +59,7 @@ class QuoteController extends BaseController
|
|||
public function getDatatable($clientPublicId = null)
|
||||
{
|
||||
$accountId = Auth::user()->account_id;
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
|
||||
return $this->invoiceService->getDatatable($accountId, $clientPublicId, ENTITY_QUOTE, $search);
|
||||
}
|
||||
|
|
@ -82,7 +81,7 @@ class QuoteController extends BaseController
|
|||
$data = [
|
||||
'entityType' => $invoice->getEntityType(),
|
||||
'invoice' => $invoice,
|
||||
'data' => Input::old('data'),
|
||||
'data' => \Request::old('data'),
|
||||
'method' => 'POST',
|
||||
'url' => 'invoices',
|
||||
'title' => trans('texts.new_quote'),
|
||||
|
|
@ -115,9 +114,9 @@ class QuoteController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action') ?: Input::get('action');
|
||||
$action = \Request::input('bulk_action') ?: \Request::input('action');
|
||||
;
|
||||
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids'));
|
||||
$ids = \Request::input('bulk_public_id') ?: (\Request::input('public_id') ?: \Request::input('ids'));
|
||||
|
||||
if ($action == 'convert') {
|
||||
$invoice = Invoice::with('invoice_items')->scope($ids)->firstOrFail();
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ use App\Ninja\Datatables\RecurringExpenseDatatable;
|
|||
use App\Ninja\Repositories\RecurringExpenseRepository;
|
||||
use App\Services\RecurringExpenseService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use View;
|
||||
use Cache;
|
||||
use Request;
|
||||
|
||||
class RecurringExpenseController extends BaseController
|
||||
{
|
||||
|
|
@ -46,7 +46,7 @@ class RecurringExpenseController extends BaseController
|
|||
|
||||
public function getDatatable($expensePublicId = null)
|
||||
{
|
||||
$search = Input::get('sSearch');
|
||||
$search = \Request::input('sSearch');
|
||||
$userId = Auth::user()->filterId();
|
||||
|
||||
return $this->recurringExpenseService->getDatatable($search, $userId);
|
||||
|
|
@ -61,7 +61,7 @@ class RecurringExpenseController extends BaseController
|
|||
}
|
||||
|
||||
$data = [
|
||||
'vendorPublicId' => Input::old('vendor') ? Input::old('vendor') : $request->vendor_id,
|
||||
'vendorPublicId' => Request::old('vendor') ? Request::old('vendor') : $request->vendor_id,
|
||||
'expense' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'recurring_expenses',
|
||||
|
|
@ -113,7 +113,7 @@ class RecurringExpenseController extends BaseController
|
|||
private static function getViewModel()
|
||||
{
|
||||
return [
|
||||
'data' => Input::old('data'),
|
||||
'data' => Request::old('data'),
|
||||
'account' => Auth::user()->account,
|
||||
'categories' => ExpenseCategory::whereAccountId(Auth::user()->account_id)->withArchived()->orderBy('name')->get(),
|
||||
'taxRates' => TaxRate::scope()->whereIsInclusive(false)->orderBy('name')->get(),
|
||||
|
|
@ -136,7 +136,7 @@ class RecurringExpenseController extends BaseController
|
|||
|
||||
Session::flash('message', trans('texts.updated_recurring_expense'));
|
||||
|
||||
if (in_array(Input::get('action'), ['archive', 'delete', 'restore'])) {
|
||||
if (in_array(\Request::input('action'), ['archive', 'delete', 'restore'])) {
|
||||
return self::bulk();
|
||||
}
|
||||
|
||||
|
|
@ -145,8 +145,8 @@ class RecurringExpenseController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
$count = $this->recurringExpenseService->bulk($ids, $action);
|
||||
|
||||
if ($count > 0) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Jobs\RunReport;
|
|||
use App\Models\Account;
|
||||
use App\Models\ScheduledReport;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Utils;
|
||||
use View;
|
||||
use Carbon;
|
||||
|
|
@ -58,14 +57,14 @@ class ReportController extends BaseController
|
|||
return redirect('/');
|
||||
}
|
||||
|
||||
$action = Input::get('action');
|
||||
$format = Input::get('format');
|
||||
$action = \Request::input('action');
|
||||
$format = \Request::input('format');
|
||||
|
||||
if (Input::get('report_type')) {
|
||||
$reportType = Input::get('report_type');
|
||||
$dateField = Input::get('date_field');
|
||||
$startDate = date_create(Input::get('start_date'));
|
||||
$endDate = date_create(Input::get('end_date'));
|
||||
if (\Request::input('report_type')) {
|
||||
$reportType = \Request::input('report_type');
|
||||
$dateField = \Request::input('date_field');
|
||||
$startDate = date_create(\Request::input('start_date'));
|
||||
$endDate = date_create(\Request::input('end_date'));
|
||||
} else {
|
||||
$reportType = ENTITY_INVOICE;
|
||||
$dateField = FILTER_INVOICE_DATE;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers;
|
|||
use App\Models\Subscription;
|
||||
use App\Services\SubscriptionService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -107,8 +106,8 @@ class SubscriptionController extends BaseController
|
|||
*/
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action');
|
||||
$ids = Input::get('bulk_public_id');
|
||||
$action = \Request::input('bulk_action');
|
||||
$ids = \Request::input('bulk_public_id');
|
||||
|
||||
$count = $this->subscriptionService->bulk($ids, $action);
|
||||
|
||||
|
|
@ -137,7 +136,7 @@ class SubscriptionController extends BaseController
|
|||
$subscriptionPublicId = $subscription->public_id;
|
||||
}
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(\Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to($subscriptionPublicId ? 'subscriptions/edit' : 'subscriptions/create')->withInput()->withErrors($validator);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Models\Task;
|
|||
use App\Ninja\Repositories\TaskRepository;
|
||||
use App\Ninja\Transformers\TaskTransformer;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Response;
|
||||
|
||||
class TaskApiController extends BaseAPIController
|
||||
|
|
@ -103,7 +102,7 @@ class TaskApiController extends BaseAPIController
|
|||
*/
|
||||
public function store()
|
||||
{
|
||||
$data = Input::all();
|
||||
$data = \Request::all();
|
||||
$taskId = isset($data['id']) ? $data['id'] : false;
|
||||
|
||||
if (isset($data['client_id']) && $data['client_id']) {
|
||||
|
|
@ -143,7 +142,7 @@ class TaskApiController extends BaseAPIController
|
|||
$task = $this->taskRepo->save($taskId, $data);
|
||||
$task = Task::scope($task->public_id)->with('client')->first();
|
||||
|
||||
$transformer = new TaskTransformer(Auth::user()->account, Input::get('serializer'));
|
||||
$transformer = new TaskTransformer(Auth::user()->account, \Request::input('serializer'));
|
||||
$data = $this->createItem($task, $transformer, 'task');
|
||||
|
||||
return $this->response($data);
|
||||
|
|
@ -185,7 +184,7 @@ class TaskApiController extends BaseAPIController
|
|||
|
||||
$task = $request->entity();
|
||||
|
||||
$task = $this->taskRepo->save($task->public_id, \Illuminate\Support\Facades\Input::all());
|
||||
$task = $this->taskRepo->save($task->public_id, \Illuminate\Support\Facades\Request::all());
|
||||
|
||||
return $this->itemResponse($task);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use App\Ninja\Repositories\TaskRepository;
|
|||
use App\Services\TaskService;
|
||||
use Auth;
|
||||
use DropdownButton;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use Session;
|
||||
|
|
@ -86,7 +85,7 @@ class TaskController extends BaseController
|
|||
*/
|
||||
public function getDatatable($clientPublicId = null, $projectPublicId = null)
|
||||
{
|
||||
return $this->taskService->getDatatable($clientPublicId, $projectPublicId, Input::get('sSearch'));
|
||||
return $this->taskService->getDatatable($clientPublicId, $projectPublicId, \Request::input('sSearch'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -126,8 +125,8 @@ class TaskController extends BaseController
|
|||
|
||||
$data = [
|
||||
'task' => null,
|
||||
'clientPublicId' => Input::old('client') ? Input::old('client') : ($request->client_id ?: 0),
|
||||
'projectPublicId' => Input::old('project_id') ? Input::old('project_id') : ($request->project_id ?: 0),
|
||||
'clientPublicId' => Request::old('client') ? Request::old('client') : ($request->client_id ?: 0),
|
||||
'projectPublicId' => Request::old('project_id') ? Request::old('project_id') : ($request->project_id ?: 0),
|
||||
'method' => 'POST',
|
||||
'url' => 'tasks',
|
||||
'title' => trans('texts.new_task'),
|
||||
|
|
@ -229,7 +228,7 @@ class TaskController extends BaseController
|
|||
*/
|
||||
private function save($request, $publicId = null)
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$action = \Request::input('action');
|
||||
|
||||
if (in_array($action, ['archive', 'delete', 'restore'])) {
|
||||
return self::bulk();
|
||||
|
|
@ -260,8 +259,8 @@ class TaskController extends BaseController
|
|||
*/
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ?: (Input::get('id') ?: Input::get('ids'));
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ?: (\Request::input('id') ?: \Request::input('ids'));
|
||||
$referer = Request::server('HTTP_REFERER');
|
||||
|
||||
if (in_array($action, ['resume', 'stop'])) {
|
||||
|
|
@ -277,7 +276,7 @@ class TaskController extends BaseController
|
|||
Session::flash('message', trans('texts.updated_task_status'));
|
||||
return $this->returnBulk($this->entityType, $action, $ids);
|
||||
} elseif ($action == 'invoice' || $action == 'add_to_invoice') {
|
||||
$tasks = Task::scope($ids)->with('account', 'client', 'project')->orderBy('project_id', 'id')->get();
|
||||
$tasks = Task::scope($ids)->with('account', 'client', 'project')->orderBy('project_id')->orderBy('id')->get();
|
||||
$clientPublicId = false;
|
||||
$data = [];
|
||||
|
||||
|
|
@ -315,7 +314,7 @@ class TaskController extends BaseController
|
|||
if ($action == 'invoice') {
|
||||
return Redirect::to("invoices/create/{$clientPublicId}")->with('tasks', $data);
|
||||
} else {
|
||||
$invoiceId = Input::get('invoice_id');
|
||||
$invoiceId = \Request::input('invoice_id');
|
||||
|
||||
return Redirect::to("invoices/{$invoiceId}/edit")->with('tasks', $data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Models\TaxRate;
|
|||
use App\Ninja\Repositories\TaxRateRepository;
|
||||
use App\Services\TaxRateService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -81,8 +80,8 @@ class TaxRateController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action');
|
||||
$ids = Input::get('bulk_public_id');
|
||||
$action = \Request::input('bulk_action');
|
||||
$ids = \Request::input('bulk_public_id');
|
||||
$count = $this->taxRateService->bulk($ids, $action);
|
||||
|
||||
Session::flash('message', trans('texts.archived_tax_rate'));
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers;
|
|||
use App\Models\AccountToken;
|
||||
use App\Services\TokenService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -108,8 +107,8 @@ class TokenController extends BaseController
|
|||
*/
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action');
|
||||
$ids = Input::get('bulk_public_id');
|
||||
$action = \Request::input('bulk_action');
|
||||
$ids = \Request::input('bulk_public_id');
|
||||
$count = $this->tokenService->bulk($ids, $action);
|
||||
|
||||
Session::flash('message', trans('texts.archived_token'));
|
||||
|
|
@ -134,17 +133,17 @@ class TokenController extends BaseController
|
|||
->where('public_id', '=', $tokenPublicId)->firstOrFail();
|
||||
}
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(\Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to($tokenPublicId ? 'tokens/edit' : 'tokens/create')->withInput()->withErrors($validator);
|
||||
}
|
||||
|
||||
if ($tokenPublicId) {
|
||||
$token->name = trim(Input::get('name'));
|
||||
$token->name = trim(\Request::input('name'));
|
||||
} else {
|
||||
$token = AccountToken::createNew();
|
||||
$token->name = trim(Input::get('name'));
|
||||
$token->name = trim(\Request::input('name'));
|
||||
$token->token = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Ninja\Mailers\UserMailer;
|
|||
use App\Ninja\Repositories\AccountRepository;
|
||||
use App\Services\UserService;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Password;
|
||||
use Redirect;
|
||||
use Request;
|
||||
|
|
@ -131,8 +130,8 @@ class UserController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('bulk_action');
|
||||
$id = Input::get('bulk_public_id');
|
||||
$action = \Request::input('bulk_action');
|
||||
$id = \Request::input('bulk_public_id');
|
||||
|
||||
$user = User::where('account_id', '=', Auth::user()->account_id)
|
||||
->where('public_id', '=', $id)
|
||||
|
|
@ -184,7 +183,7 @@ class UserController extends BaseController
|
|||
$rules['email'] = 'required|email|unique:users';
|
||||
}
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to($userPublicId ? 'users/edit' : 'users/create')
|
||||
|
|
@ -192,20 +191,20 @@ class UserController extends BaseController
|
|||
->withInput();
|
||||
}
|
||||
|
||||
if (! \App\Models\LookupUser::validateField('email', Input::get('email'), $user)) {
|
||||
if (! \App\Models\LookupUser::validateField('email', \Request::input('email'), $user)) {
|
||||
return Redirect::to($userPublicId ? 'users/edit' : 'users/create')
|
||||
->withError(trans('texts.email_taken'))
|
||||
->withInput();
|
||||
}
|
||||
|
||||
if ($userPublicId) {
|
||||
$user->first_name = trim(Input::get('first_name'));
|
||||
$user->last_name = trim(Input::get('last_name'));
|
||||
$user->username = trim(Input::get('email'));
|
||||
$user->email = trim(Input::get('email'));
|
||||
$user->first_name = trim(\Request::input('first_name'));
|
||||
$user->last_name = trim(\Request::input('last_name'));
|
||||
$user->username = trim(\Request::input('email'));
|
||||
$user->email = trim(\Request::input('email'));
|
||||
if (Auth::user()->hasFeature(FEATURE_USER_PERMISSIONS)) {
|
||||
$user->is_admin = boolval(Input::get('is_admin'));
|
||||
$user->permissions = self::formatUserPermissions(Input::get('permissions'));
|
||||
$user->is_admin = boolval(\Request::input('is_admin'));
|
||||
$user->permissions = self::formatUserPermissions(\Request::input('permissions'));
|
||||
}
|
||||
} else {
|
||||
$lastUser = User::withTrashed()->where('account_id', '=', Auth::user()->account_id)
|
||||
|
|
@ -213,23 +212,23 @@ class UserController extends BaseController
|
|||
|
||||
$user = new User();
|
||||
$user->account_id = Auth::user()->account_id;
|
||||
$user->first_name = trim(Input::get('first_name'));
|
||||
$user->last_name = trim(Input::get('last_name'));
|
||||
$user->username = trim(Input::get('email'));
|
||||
$user->email = trim(Input::get('email'));
|
||||
$user->first_name = trim(\Request::input('first_name'));
|
||||
$user->last_name = trim(\Request::input('last_name'));
|
||||
$user->username = trim(\Request::input('email'));
|
||||
$user->email = trim(\Request::input('email'));
|
||||
$user->registered = true;
|
||||
$user->password = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
$user->confirmation_code = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
$user->public_id = $lastUser->public_id + 1;
|
||||
if (Auth::user()->hasFeature(FEATURE_USER_PERMISSIONS)) {
|
||||
$user->is_admin = boolval(Input::get('is_admin'));
|
||||
$user->permissions = self::formatUserPermissions(Input::get('permissions'));
|
||||
$user->is_admin = boolval(\Request::input('is_admin'));
|
||||
$user->permissions = self::formatUserPermissions(\Request::input('permissions'));
|
||||
}
|
||||
}
|
||||
|
||||
$user->save();
|
||||
|
||||
if (! $user->confirmed && Input::get('action') === 'email') {
|
||||
if (! $user->confirmed && \Request::input('action') === 'email') {
|
||||
$this->userMailer->sendConfirmation($user, Auth::user());
|
||||
$message = trans('texts.sent_invite');
|
||||
} else {
|
||||
|
|
@ -306,14 +305,14 @@ class UserController extends BaseController
|
|||
// check the current password is correct
|
||||
if (! Auth::validate([
|
||||
'email' => Auth::user()->email,
|
||||
'password' => Input::get('current_password'),
|
||||
'password' => \Request::input('current_password'),
|
||||
])) {
|
||||
return trans('texts.password_error_incorrect');
|
||||
}
|
||||
|
||||
// validate the new password
|
||||
$password = Input::get('new_password');
|
||||
$confirm = Input::get('confirm_password');
|
||||
$password = \Request::input('new_password');
|
||||
$confirm = \Request::input('confirm_password');
|
||||
|
||||
if (strlen($password) < 6 || $password != $confirm) {
|
||||
return trans('texts.password_error_invalid');
|
||||
|
|
@ -389,12 +388,12 @@ class UserController extends BaseController
|
|||
|
||||
public function saveSidebarState()
|
||||
{
|
||||
if (Input::has('show_left')) {
|
||||
Session::put(SESSION_LEFT_SIDEBAR, boolval(Input::get('show_left')));
|
||||
if (Request::has('show_left')) {
|
||||
Session::put(SESSION_LEFT_SIDEBAR, boolval(\Request::input('show_left')));
|
||||
}
|
||||
|
||||
if (Input::has('show_right')) {
|
||||
Session::put(SESSION_RIGHT_SIDEBAR, boolval(Input::get('show_right')));
|
||||
if (Request::has('show_right')) {
|
||||
Session::put(SESSION_RIGHT_SIDEBAR, boolval(\Request::input('show_right')));
|
||||
}
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use App\Http\Requests\CreateVendorRequest;
|
|||
use App\Http\Requests\UpdateVendorRequest;
|
||||
use App\Models\Vendor;
|
||||
use App\Ninja\Repositories\VendorRepository;
|
||||
use Input;
|
||||
use Response;
|
||||
use Utils;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use App\Ninja\Repositories\VendorRepository;
|
|||
use App\Services\VendorService;
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use URL;
|
||||
|
|
@ -49,7 +48,7 @@ class VendorController extends BaseController
|
|||
|
||||
public function getDatatable()
|
||||
{
|
||||
return $this->vendorService->getDatatable(Input::get('sSearch'));
|
||||
return $this->vendorService->getDatatable(\Request::input('sSearch'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -149,7 +148,7 @@ class VendorController extends BaseController
|
|||
private static function getViewModel()
|
||||
{
|
||||
return [
|
||||
'data' => Input::old('data'),
|
||||
'data' => \Request::old('data'),
|
||||
'account' => Auth::user()->account,
|
||||
];
|
||||
}
|
||||
|
|
@ -172,8 +171,8 @@ class VendorController extends BaseController
|
|||
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids');
|
||||
$action = \Request::input('action');
|
||||
$ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
|
||||
$count = $this->vendorService->bulk($ids, $action);
|
||||
|
||||
$message = Utils::pluralize($action.'d_vendor', $count);
|
||||
|
|
|
|||
|
|
@ -64,5 +64,6 @@ class Kernel extends HttpKernel
|
|||
'lookup' => \App\Http\Middleware\DatabaseLookup::class,
|
||||
'permissions.required' => \App\Http\Middleware\PermissionsRequired::class,
|
||||
'migration' => \App\Http\Middleware\EligibleForMigration::class,
|
||||
'migration_channel' => \App\Http\Middleware\MigrationLookup::class,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,8 +104,9 @@ class ApiCheck
|
|||
return Response::json("Please wait {$wait} second(s)", 403, $headers);
|
||||
}
|
||||
|
||||
Cache::put("hour_throttle:{$key}", $new_hour_throttle, 60);
|
||||
Cache::put("last_api_request:{$key}", time(), 60);
|
||||
|
||||
Cache::put("hour_throttle:{$key}", $new_hour_throttle, 60 * 60);
|
||||
Cache::put("last_api_request:{$key}", time(), 60 * 60);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
|
|
|||
53
app/Http/Middleware/MigrationLookup.php
Normal file
53
app/Http/Middleware/MigrationLookup.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Closure;
|
||||
use App\Models\LookupAccount;
|
||||
use App\Models\LookupContact;
|
||||
use App\Models\LookupInvitation;
|
||||
use App\Models\LookupProposalInvitation;
|
||||
use App\Models\LookupAccountToken;
|
||||
use App\Models\LookupUser;
|
||||
use Auth;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Utils;
|
||||
|
||||
class MigrationLookup
|
||||
{
|
||||
private string $migration_notification = 'The Invoice Ninja v4 platform is now disabled for free users. Please <a class="btn btn-primary btn-sm" href="/migration/start">Migrate Now</a> to the new Invoice Ninja v5 platform to remain as a free account.<br><br>
|
||||
*Not ready for v5? Upgrade to Pro or Enterprise to remain on v4. *Please note that the v4 platform will be "sunset" in November 2022.';
|
||||
|
||||
private string $silo = 'V4 is now disabled for your account. Please migrate. <a class="btn btn-primary btn-sm" href="/migration/start">Migrate Now</a> Upgrade to v5 and take advantage of our <a class="btn btn-danger btn-sm" href="https://invoicing.co/campaign/black_friday_2022">Black friday promo</a>';
|
||||
|
||||
public function handle(Request $request, Closure $next, $guard = 'user')
|
||||
{
|
||||
if (! env('MULTI_DB_ENABLED')) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
//need to wrap an additional block over this to funnel users in a particular range
|
||||
if(auth()->user()->id >= config('ninja.migration_user_start') &&
|
||||
auth()->user()->id <= config('ninja.migration_user_end') &&
|
||||
(!auth()->user()->account->company->plan_expires || Carbon::parse(auth()->user()->account->company->plan_expires)->lt(now())))
|
||||
{
|
||||
if ($guard == 'user') {
|
||||
|
||||
if(request()->is('migration/*') || request()->is('settings/*')) {
|
||||
|
||||
return $next($request);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return redirect('/settings/account_management')->with('warning',$this->silo);
|
||||
}
|
||||
elseif(!auth()->user()->account->company->plan_expires || Carbon::parse(auth()->user()->account->company->plan_expires)->lt(now())){
|
||||
session()->flash('warning',$this->migration_notification);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,6 @@ use Cache;
|
|||
use Closure;
|
||||
use Event;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Schema;
|
||||
use Session;
|
||||
|
|
@ -39,9 +38,9 @@ class StartupCheck
|
|||
// set TRUSTED_PROXIES=* if you want to trust every proxy.
|
||||
if (isset($_ENV['TRUSTED_PROXIES'])) {
|
||||
if (env('TRUSTED_PROXIES') == '*') {
|
||||
$request->setTrustedProxies(['127.0.0.1', $request->server->get('REMOTE_ADDR')]);
|
||||
$request->setTrustedProxies(['127.0.0.1', $request->server->get('REMOTE_ADDR')],Request::HEADER_X_FORWARDED_ALL);
|
||||
} else{
|
||||
$request->setTrustedProxies(array_map('trim', explode(',', env('TRUSTED_PROXIES'))));
|
||||
$request->setTrustedProxies(array_map('trim', explode(',', env('TRUSTED_PROXIES'))),Request::HEADER_X_FORWARDED_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -151,8 +150,8 @@ class StartupCheck
|
|||
}
|
||||
|
||||
// Check if we're requesting to change the account's language
|
||||
if (Input::has('lang')) {
|
||||
$locale = Input::get('lang');
|
||||
if (\Request::has('lang')) {
|
||||
$locale = \Request::input('lang');
|
||||
App::setLocale($locale);
|
||||
session([SESSION_LOCALE => $locale]);
|
||||
|
||||
|
|
@ -172,15 +171,15 @@ class StartupCheck
|
|||
|
||||
// Make sure the account/user localization settings are in the session
|
||||
if (Auth::check() && ! Session::has(SESSION_TIMEZONE)) {
|
||||
Event::fire(new UserLoggedIn());
|
||||
Event::dispatch(new UserLoggedIn());
|
||||
}
|
||||
|
||||
// Check if the user is claiming a license (ie, additional invoices, white label, etc.)
|
||||
if (! Utils::isNinjaProd() && isset($_SERVER['REQUEST_URI'])) {
|
||||
$claimingLicense = Utils::startsWith($_SERVER['REQUEST_URI'], '/claim_license');
|
||||
if (! $claimingLicense && Input::has('license_key') && Input::has('product_id')) {
|
||||
$licenseKey = Input::get('license_key');
|
||||
$productId = Input::get('product_id');
|
||||
if (! $claimingLicense && \Request::has('license_key') && \Request::has('product_id')) {
|
||||
$licenseKey = \Request::input('license_key');
|
||||
$productId = \Request::input('product_id');
|
||||
|
||||
$url = (Utils::isNinjaDev() ? SITE_URL : NINJA_APP_URL) . "/claim_license?license_key={$licenseKey}&product_id={$productId}&get_date=true";
|
||||
$data = trim(CurlUtils::get($url));
|
||||
|
|
@ -208,11 +207,11 @@ class StartupCheck
|
|||
|
||||
// Check data has been cached
|
||||
$cachedTables = unserialize(CACHED_TABLES);
|
||||
if (Input::has('clear_cache')) {
|
||||
if (\Request::has('clear_cache')) {
|
||||
Session::flash('message', 'Cache cleared');
|
||||
}
|
||||
foreach ($cachedTables as $name => $class) {
|
||||
if (Input::has('clear_cache') || ! Cache::has($name)) {
|
||||
if (\Request::has('clear_cache') || ! Cache::has($name)) {
|
||||
// check that the table exists in case the migration is pending
|
||||
if (! Schema::hasTable((new $class())->getTable())) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace App\Http\Requests;
|
|||
|
||||
use App\Libraries\HistoryUtils;
|
||||
use App\Models\EntityModel;
|
||||
use Input;
|
||||
use Utils;
|
||||
|
||||
class EntityRequest extends Request
|
||||
|
|
@ -33,7 +32,7 @@ class EntityRequest extends Request
|
|||
}
|
||||
}
|
||||
if (! $publicId) {
|
||||
$publicId = Input::get('public_id') ?: Input::get('id');
|
||||
$publicId = \Request::input('public_id') ?: \Request::input('id');
|
||||
}
|
||||
|
||||
if (! $publicId) {
|
||||
|
|
|
|||
30
app/Http/Requests/MigrationForwardRequest.php
Normal file
30
app/Http/Requests/MigrationForwardRequest.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MigrationForwardRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'url' => 'nullable|url',
|
||||
];
|
||||
}
|
||||
}
|
||||
191
app/Jobs/HostedMigration.php
Normal file
191
app/Jobs/HostedMigration.php
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Jobs\Job;
|
||||
use App\Libraries\Utils;
|
||||
use App\Models\Account;
|
||||
use App\Models\User;
|
||||
use App\Services\Migration\CompleteService;
|
||||
use App\Traits\GenerateMigrationResources;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
// use Unirest\Request;
|
||||
|
||||
class HostedMigration extends Job
|
||||
{
|
||||
use GenerateMigrationResources;
|
||||
|
||||
public $db;
|
||||
|
||||
public $data;
|
||||
|
||||
public $user;
|
||||
|
||||
private $v4_secret;
|
||||
|
||||
public $migration_token;
|
||||
|
||||
private $forced;
|
||||
|
||||
public $tries = 1;
|
||||
|
||||
public $timeout = 0;
|
||||
|
||||
public function __construct(User $user, array $data, $db, $forced = false)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->data = $data;
|
||||
$this->db = $db;
|
||||
$this->forced = $forced;
|
||||
$this->v4_secret = config('ninja.ninja_hosted_secret');
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
config(['database.default' => $this->db]);
|
||||
|
||||
//Create or get a token
|
||||
$this->getToken();
|
||||
|
||||
$completeService = (new CompleteService($this->migration_token));
|
||||
|
||||
$migrationData = $this->generateMigrationData($this->data);
|
||||
|
||||
$completeService->data($migrationData)
|
||||
->endpoint('https://v5-app1.invoicing.co')
|
||||
// ->endpoint('http://devhosted.test:8000')
|
||||
->start();
|
||||
|
||||
}
|
||||
|
||||
private function getToken()
|
||||
{
|
||||
$url = 'https://invoicing.co/api/v1/get_migration_account';
|
||||
// $url = 'http://devhosted.test:8000/api/v1/get_migration_account';
|
||||
|
||||
$headers = [
|
||||
'X-API-HOSTED-SECRET' => $this->v4_secret,
|
||||
'X-Requested-With' => 'XMLHttpRequest',
|
||||
'Content-Type' => 'application/json',
|
||||
];
|
||||
|
||||
$body = [
|
||||
'first_name' => $this->user->first_name,
|
||||
'last_name' => $this->user->last_name,
|
||||
'email' => $this->user->email,
|
||||
'privacy_policy' => true,
|
||||
'terms_of_service' => true,
|
||||
'password' => '',
|
||||
];
|
||||
|
||||
$client = new \GuzzleHttp\Client([
|
||||
'headers' => $headers,
|
||||
]);
|
||||
|
||||
$response = $client->post($url,[
|
||||
RequestOptions::JSON => $body,
|
||||
RequestOptions::ALLOW_REDIRECTS => false
|
||||
]);
|
||||
|
||||
if($response->getStatusCode() == 401){
|
||||
info($response->getBody());
|
||||
|
||||
} elseif ($response->getStatusCode() == 200) {
|
||||
|
||||
$message_body = json_decode($response->getBody(), true);
|
||||
|
||||
$this->migration_token = $message_body['token'];
|
||||
|
||||
} else {
|
||||
// info(json_decode($response->getBody()->getContents()));
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function generateMigrationData(array $data): array
|
||||
{
|
||||
set_time_limit(0);
|
||||
|
||||
$migrationData = [];
|
||||
|
||||
foreach ($data['companies'] as $company) {
|
||||
$account = Account::where('account_key', $company['id'])->firstOrFail();
|
||||
|
||||
$this->account = $account;
|
||||
|
||||
if($this->forced){
|
||||
//forced migration - we need to set this v4 account as inactive.
|
||||
|
||||
//set activate URL
|
||||
$account_email_settings = $this->account->account_email_settings;
|
||||
$account_email_settings->account_email_settings->forward_url_for_v5 = "https://invoiceninja-{$this->account->id}.invoicing.co";
|
||||
$account_email_settings->save();
|
||||
|
||||
$this->account->subdomain = "invoiceninja-{$this->account->id}";
|
||||
}
|
||||
|
||||
$date = date('Y-m-d');
|
||||
$accountKey = $this->account->account_key;
|
||||
|
||||
$output = fopen('php://output', 'w') or Utils::fatalError();
|
||||
|
||||
$fileName = "{$accountKey}-{$date}-invoiceninja";
|
||||
|
||||
$localMigrationData['data'] = [
|
||||
'account' => $this->getAccount(),
|
||||
'company' => $this->getCompany(),
|
||||
'users' => $this->getUsers(),
|
||||
'tax_rates' => $this->getTaxRates(),
|
||||
'payment_terms' => $this->getPaymentTerms(),
|
||||
'clients' => $this->getClients(),
|
||||
'company_gateways' => $this->getCompanyGateways(),
|
||||
'client_gateway_tokens' => $this->getClientGatewayTokens(),
|
||||
'vendors' => $this->getVendors(),
|
||||
'projects' => $this->getProjects(),
|
||||
'products' => $this->getProducts(),
|
||||
'credits' => $this->getCreditsNotes(),
|
||||
'invoices' => $this->getInvoices(),
|
||||
'recurring_expenses' => $this->getRecurringExpenses(),
|
||||
'recurring_invoices' => $this->getRecurringInvoices(),
|
||||
'quotes' => $this->getQuotes(),
|
||||
'payments' => $this->getPayments(),
|
||||
'documents' => $this->getDocuments(),
|
||||
'expense_categories' => $this->getExpenseCategories(),
|
||||
'task_statuses' => $this->getTaskStatuses(),
|
||||
'expenses' => $this->getExpenses(),
|
||||
'tasks' => $this->getTasks(),
|
||||
'documents' => $this->getDocuments(),
|
||||
'ninja_tokens' => $this->getNinjaToken(),
|
||||
];
|
||||
|
||||
$localMigrationData['force'] = array_key_exists('force', $company);
|
||||
|
||||
Storage::makeDirectory('migrations');
|
||||
$file = Storage::path("app/migrations/{$fileName}.zip");
|
||||
|
||||
//$file = storage_path("migrations/{$fileName}.zip");
|
||||
|
||||
ksort($localMigrationData);
|
||||
|
||||
$zip = new \ZipArchive();
|
||||
$zip->open($file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
|
||||
$zip->addFromString('migration.json', json_encode($localMigrationData, JSON_PRETTY_PRINT));
|
||||
$zip->close();
|
||||
|
||||
$localMigrationData['file'] = $file;
|
||||
|
||||
$migrationData[] = $localMigrationData;
|
||||
}
|
||||
|
||||
return $migrationData;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ class SendInvoiceEmail extends Job implements ShouldQueue
|
|||
/**
|
||||
* @var Invoice
|
||||
*/
|
||||
protected $invoice;
|
||||
public $invoice;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
|
|
|
|||
|
|
@ -2,51 +2,53 @@
|
|||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Traits\SerialisesDeletedModels;
|
||||
use App\Models\User;
|
||||
use App\Ninja\Mailers\UserMailer;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Traits\SerialisesDeletedModels;
|
||||
|
||||
/**
|
||||
* Class SendInvoiceEmail.
|
||||
*/
|
||||
class SendNotificationEmail extends Job implements ShouldQueue
|
||||
{
|
||||
use InteractsWithQueue, SerializesModels, SerialisesDeletedModels {
|
||||
SerialisesDeletedModels::getRestoredPropertyValue insteadof SerializesModels;
|
||||
}
|
||||
use InteractsWithQueue;
|
||||
|
||||
public $deleteWhenMissingModels = true;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
protected $user;
|
||||
public User $user;
|
||||
|
||||
/**
|
||||
* @var Invoice
|
||||
*/
|
||||
protected $invoice;
|
||||
public Invoice $invoice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var Payment
|
||||
*/
|
||||
protected $payment;
|
||||
public ?Payment $payment;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $notes;
|
||||
public $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $server;
|
||||
public $server;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
|
|
@ -59,7 +61,7 @@ class SendNotificationEmail extends Job implements ShouldQueue
|
|||
* @param mixed $type
|
||||
* @param mixed $payment
|
||||
*/
|
||||
public function __construct($user, $invoice, $type, $payment, $notes)
|
||||
public function __construct(User $user, Invoice $invoice, $type, ?Payment $payment, $notes)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->invoice = $invoice;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ use Carbon;
|
|||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Exception;
|
||||
use Input;
|
||||
use Log;
|
||||
use Request;
|
||||
use Schema;
|
||||
|
|
@ -437,7 +436,7 @@ class Utils
|
|||
];
|
||||
|
||||
if (static::isNinja()) {
|
||||
$data['url'] = Input::get('url', Request::url());
|
||||
$data['url'] = \Request::input('url', Request::url());
|
||||
$data['previous'] = url()->previous();
|
||||
} else {
|
||||
$data['url'] = request()->path();
|
||||
|
|
|
|||
|
|
@ -17,14 +17,10 @@ class DNSListener
|
|||
|
||||
public function addDNSRecord(SubdomainWasUpdated $event)
|
||||
{
|
||||
if(env("CLOUDFLARE_DNS_ENABLED"))
|
||||
Cloudflare::addDNSRecord($event->account);
|
||||
}
|
||||
|
||||
public function removeDNSRecord(SubdomainWasRemoved $event)
|
||||
{
|
||||
if(env("CLOUDFLARE_DNS_ENABLED"))
|
||||
Cloudflare::removeDNSRecord($event->account);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
<?php namespace App\Listeners;
|
||||
<?php
|
||||
|
||||
namespace App\Listeners;
|
||||
|
||||
use App\Ninja\Mailers\UserMailer;
|
||||
use App\Ninja\Mailers\ContactMailer;
|
||||
use App\Events\InvoiceWasEmailed;
|
||||
use App\Events\QuoteWasEmailed;
|
||||
use App\Events\InvoiceInvitationWasViewed;
|
||||
use App\Events\QuoteInvitationWasViewed;
|
||||
use App\Events\QuoteInvitationWasApproved;
|
||||
use App\Events\InvoiceWasEmailed;
|
||||
use App\Events\PaymentWasCreated;
|
||||
use App\Services\PushService;
|
||||
use App\Events\QuoteInvitationWasApproved;
|
||||
use App\Events\QuoteInvitationWasViewed;
|
||||
use App\Events\QuoteWasEmailed;
|
||||
use App\Jobs\SendNotificationEmail;
|
||||
use App\Jobs\SendPaymentEmail;
|
||||
use App\Models\Invoice;
|
||||
use App\Ninja\Mailers\ContactMailer;
|
||||
use App\Ninja\Mailers\UserMailer;
|
||||
use App\Notifications\PaymentCreated;
|
||||
use App\Services\PushService;
|
||||
|
||||
/**
|
||||
* Class NotificationListener
|
||||
|
|
@ -49,7 +52,7 @@ class NotificationListener
|
|||
* @param $type
|
||||
* @param null $payment
|
||||
*/
|
||||
private function sendNotifications($invoice, $type, $payment = null, $notes = false)
|
||||
private function sendNotifications(Invoice $invoice, $type, $payment = null, $notes = false)
|
||||
{
|
||||
foreach ($invoice->account->users as $user)
|
||||
{
|
||||
|
|
|
|||
23
app/Logging/CustomizeSingleLogger.php
Normal file
23
app/Logging/CustomizeSingleLogger.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Logging;
|
||||
|
||||
class CustomizeSingleLogger
|
||||
{
|
||||
/**
|
||||
* Customize the given logger instance.
|
||||
*
|
||||
* @param \Illuminate\Log\Logger $logger
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __invoke($logger)
|
||||
{
|
||||
$logger->pushHandler(new \Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-info.log',
|
||||
\Monolog\Logger::INFO, false));
|
||||
$logger->pushHandler(new \Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-warning.log',
|
||||
\Monolog\Logger::WARNING, false));
|
||||
$logger->pushHandler(new \Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-error.log',
|
||||
\Monolog\Logger::ERROR, false));
|
||||
}
|
||||
}
|
||||
|
|
@ -1123,7 +1123,13 @@ class Account extends Eloquent
|
|||
Session::put(SESSION_DATE_FORMAT, $this->date_format ? $this->date_format->format : DEFAULT_DATE_FORMAT);
|
||||
Session::put(SESSION_DATE_PICKER_FORMAT, $this->date_format ? $this->date_format->picker_format : DEFAULT_DATE_PICKER_FORMAT);
|
||||
|
||||
$currencyId = ($client && $client->currency_id) ? $client->currency_id : $this->currency_id ?: DEFAULT_CURRENCY;
|
||||
//php 7.3
|
||||
// $currencyId = ($client && $client->currency_id) ? $client->currency_id : $this->currency_id ?: DEFAULT_CURRENCY;
|
||||
//php 7.4
|
||||
$currencyId = ($client && $client->currency_id) ? $client->currency_id : ($this->currency_id ?: DEFAULT_CURRENCY);
|
||||
|
||||
// $currencyId = ($client && $client->currency_id) ? $client->currency_id : $this->currency_id ?: DEFAULT_CURRENCY;
|
||||
|
||||
$locale = ($client && $client->language_id) ? $client->language->locale : ($this->language_id ? $this->Language->locale : DEFAULT_LOCALE);
|
||||
|
||||
Session::put(SESSION_CURRENCY, $currencyId);
|
||||
|
|
@ -1963,7 +1969,7 @@ Account::updated(function ($account) {
|
|||
return;
|
||||
}
|
||||
|
||||
Event::fire(new UserSettingsChanged());
|
||||
Event::dispatch(new UserSettingsChanged());
|
||||
});
|
||||
|
||||
Account::deleted(function ($account)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class Document extends EntityModel
|
|||
'application/msword',
|
||||
'application/excel', 'application/vnd.ms-excel', 'application/x-excel', 'application/x-msexcel',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/postscript', 'image/svg+xml',
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/postscript',
|
||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.ms-powerpoint',
|
||||
];
|
||||
|
||||
|
|
@ -57,9 +57,6 @@ class Document extends EntityModel
|
|||
'ai' => [
|
||||
'mime' => 'application/postscript',
|
||||
],
|
||||
'svg' => [
|
||||
'mime' => 'image/svg+xml',
|
||||
],
|
||||
'jpeg' => [
|
||||
'mime' => 'image/jpeg',
|
||||
],
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class LookupModel extends Eloquent
|
|||
abort(404, "Looked up {$className} not found: {$field} => {$value}");
|
||||
}
|
||||
|
||||
Cache::put($key, $server, 120);
|
||||
Cache::put($key, $server, 120 * 60);
|
||||
} else {
|
||||
config(['database.default' => $current]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ class Payment extends EntityModel
|
|||
$this->payment_status_id = $this->refunded == $this->amount ? PAYMENT_STATUS_REFUNDED : PAYMENT_STATUS_PARTIALLY_REFUNDED;
|
||||
$this->save();
|
||||
|
||||
Event::fire(new PaymentWasRefunded($this, $refund_change));
|
||||
Event::dispatch(new PaymentWasRefunded($this, $refund_change));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -258,7 +258,7 @@ class Payment extends EntityModel
|
|||
return false;
|
||||
}
|
||||
|
||||
Event::fire(new PaymentWasVoided($this));
|
||||
Event::dispatch(new PaymentWasVoided($this));
|
||||
|
||||
$this->refunded = $this->amount;
|
||||
$this->payment_status_id = PAYMENT_STATUS_VOIDED;
|
||||
|
|
@ -271,7 +271,7 @@ class Payment extends EntityModel
|
|||
{
|
||||
$this->payment_status_id = PAYMENT_STATUS_COMPLETED;
|
||||
$this->save();
|
||||
Event::fire(new PaymentCompleted($this));
|
||||
Event::dispatch(new PaymentCompleted($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -282,7 +282,7 @@ class Payment extends EntityModel
|
|||
$this->payment_status_id = PAYMENT_STATUS_FAILED;
|
||||
$this->gateway_error = $failureMessage;
|
||||
$this->save();
|
||||
Event::fire(new PaymentFailed($this));
|
||||
Event::dispatch(new PaymentFailed($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -220,11 +220,11 @@ class PaymentMethod extends EntityModel
|
|||
}
|
||||
|
||||
if (! empty($data)) {
|
||||
Cache::put('bankData:'.$routingNumber, $data, 5);
|
||||
Cache::put('bankData:'.$routingNumber, $data, 5 * 60);
|
||||
|
||||
return $data;
|
||||
} else {
|
||||
Cache::put('bankData:'.$routingNumber, false, 5);
|
||||
Cache::put('bankData:'.$routingNumber, false, 5 * 60);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ trait HasRecurrence
|
|||
}
|
||||
|
||||
$account = $this->account;
|
||||
|
||||
if (! $account) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$timezone = $account->getTimezone();
|
||||
|
||||
if (! $this->start_date || Carbon::parse($this->start_date, $timezone)->isFuture()) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,10 @@ trait Inviteable
|
|||
}
|
||||
}
|
||||
|
||||
return $hasValue ? implode($parts, '<br/>') : false;
|
||||
return $hasValue ? implode('<br/>', $parts) : false;
|
||||
|
||||
// return $hasValue ? implode($parts, '<br/>') : false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -402,8 +402,8 @@ class ContactMailer extends Mailer
|
|||
$day_hits_remaining = $day_hits_remaining >= 0 ? $day_hits_remaining : 0;
|
||||
}
|
||||
|
||||
Cache::put("email_day_throttle:{$key}", $new_day_throttle, 60);
|
||||
Cache::put("last_email_request:{$key}", time(), 60);
|
||||
Cache::put("email_day_throttle:{$key}", $new_day_throttle, 60 * 60);
|
||||
Cache::put("last_email_request:{$key}", time(), 60 * 60);
|
||||
|
||||
if ($new_day_throttle > $day) {
|
||||
$errorEmail = env('ERROR_EMAIL');
|
||||
|
|
@ -414,7 +414,7 @@ class ContactMailer extends Mailer
|
|||
->subject("Email throttle triggered for account " . $account->id);
|
||||
});
|
||||
}
|
||||
Cache::put("throttle_notified:{$key}", true, 60 * 24);
|
||||
Cache::put("throttle_notified:{$key}", true, 60 * 24 * 60);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class UserMailer extends Mailer
|
|||
User $user,
|
||||
Invoice $invoice,
|
||||
$notificationType,
|
||||
Payment $payment = null,
|
||||
?Payment $payment,
|
||||
$notes = false
|
||||
) {
|
||||
if (! $user->shouldNotify($invoice)) {
|
||||
|
|
|
|||
|
|
@ -794,9 +794,10 @@ class BasePaymentDriver
|
|||
$payment->contact_id = $invitation->contact_id;
|
||||
$payment->transaction_reference = $ref;
|
||||
$payment->payment_date = $account->getDateTime()->format('Y-m-d');
|
||||
$payment->ip = Request::ip();
|
||||
$payment->ip = \Request::ip();
|
||||
|
||||
$payment = $this->creatingPayment($payment, $paymentMethod);
|
||||
//Laravel 6 upgrade - uncommented this line as it was causing a failure
|
||||
// $payment = $this->creatingPayment($payment, $paymentMethod);
|
||||
|
||||
if ($paymentMethod) {
|
||||
$payment->last4 = $paymentMethod->last4;
|
||||
|
|
|
|||
|
|
@ -228,7 +228,6 @@ class StripePaymentDriver extends BasePaymentDriver
|
|||
if ( ! empty($data['payment_intent'])) {
|
||||
// Find the existing payment intent.
|
||||
$intent = PaymentIntent::retrieve($data['payment_intent']);
|
||||
|
||||
if ( ! $intent->amount == $data['amount'] * pow(10, $currency['precision'])) {
|
||||
// Make sure that the provided payment intent matches the invoice amount.
|
||||
throw new Exception('Incorrect PaymentIntent amount.');
|
||||
|
|
@ -270,8 +269,8 @@ class StripePaymentDriver extends BasePaymentDriver
|
|||
return $this->doOmnipayOnsitePurchase($data, $paymentMethod);
|
||||
}
|
||||
}
|
||||
|
||||
$intent = PaymentIntent::create($params);
|
||||
|
||||
}
|
||||
|
||||
if (empty($intent)) {
|
||||
|
|
@ -282,6 +281,7 @@ class StripePaymentDriver extends BasePaymentDriver
|
|||
throw new PaymentActionRequiredException(['payment_intent' => $intent]);
|
||||
} else if ($intent->status == 'succeeded') {
|
||||
$ref = ! empty($intent->charges->data) ? $intent->charges->data[0]->id : null;
|
||||
|
||||
$payment = $this->createPayment($ref, $paymentMethod);
|
||||
|
||||
if ($this->invitation->invoice->account->isNinjaAccount()) {
|
||||
|
|
@ -296,7 +296,6 @@ class StripePaymentDriver extends BasePaymentDriver
|
|||
$this->tokenResponse = $payment_method;
|
||||
parent::createToken();
|
||||
}
|
||||
|
||||
return $payment;
|
||||
} else {
|
||||
throw new Exception('Invalid PaymentIntent status: ' . $intent->status);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ class InvoiceReport extends AbstractReport
|
|||
|
||||
public function run()
|
||||
{
|
||||
if (!Auth::user()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$account = Auth::user()->account;
|
||||
$statusIds = $this->options['status_ids'];
|
||||
$exportFormat = $this->options['export_format'];
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ use App\Models\User;
|
|||
use App\Models\UserAccount;
|
||||
use App\Models\LookupUser;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Request;
|
||||
use Schema;
|
||||
use Session;
|
||||
|
|
@ -37,19 +36,19 @@ class AccountRepository
|
|||
}
|
||||
|
||||
$company = new Company();
|
||||
$company->utm_source = Input::get('utm_source');
|
||||
$company->utm_medium = Input::get('utm_medium');
|
||||
$company->utm_campaign = Input::get('utm_campaign');
|
||||
$company->utm_term = Input::get('utm_term');
|
||||
$company->utm_content = Input::get('utm_content');
|
||||
$company->utm_source = \Request::input('utm_source');
|
||||
$company->utm_medium = \Request::input('utm_medium');
|
||||
$company->utm_campaign = \Request::input('utm_campaign');
|
||||
$company->utm_term = \Request::input('utm_term');
|
||||
$company->utm_content = \Request::input('utm_content');
|
||||
$company->referral_code = Session::get(SESSION_REFERRAL_CODE);
|
||||
|
||||
if (Input::get('utm_campaign')) {
|
||||
if (env('PROMO_CAMPAIGN') && hash_equals(Input::get('utm_campaign'), env('PROMO_CAMPAIGN'))) {
|
||||
if (\Request::input('utm_campaign')) {
|
||||
if (env('PROMO_CAMPAIGN') && hash_equals(\Request::input('utm_campaign'), env('PROMO_CAMPAIGN'))) {
|
||||
$company->applyDiscount(.75);
|
||||
} elseif (env('PARTNER_CAMPAIGN') && hash_equals(Input::get('utm_campaign'), env('PARTNER_CAMPAIGN'))) {
|
||||
} elseif (env('PARTNER_CAMPAIGN') && hash_equals(\Request::input('utm_campaign'), env('PARTNER_CAMPAIGN'))) {
|
||||
$company->applyFreeYear();
|
||||
} elseif (env('EDUCATION_CAMPAIGN') && hash_equals(Input::get('utm_campaign'), env('EDUCATION_CAMPAIGN'))) {
|
||||
} elseif (env('EDUCATION_CAMPAIGN') && hash_equals(\Request::input('utm_campaign'), env('EDUCATION_CAMPAIGN'))) {
|
||||
$company->applyFreeYear(2);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class PaymentCreated extends Notification implements ShouldQueue
|
|||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['slack'];
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use Form;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Request;
|
||||
use URL;
|
||||
|
|
@ -26,6 +27,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
public function boot()
|
||||
{
|
||||
Route::singularResourceParameters(false);
|
||||
Paginator::useBootstrapThree();
|
||||
|
||||
// support selecting job database
|
||||
Queue::before(function (JobProcessing $event) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use App\Events\UserLoggedIn;
|
|||
use App\Ninja\Repositories\AccountRepository;
|
||||
use App\Models\LookupUser;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Session;
|
||||
use Socialite;
|
||||
use Utils;
|
||||
|
|
@ -98,7 +97,7 @@ class AuthService
|
|||
}
|
||||
}
|
||||
|
||||
$redirectTo = Input::get('redirect_to') ? SITE_URL . '/' . ltrim(Input::get('redirect_to'), '/') : 'dashboard';
|
||||
$redirectTo = \Request::input('redirect_to') ? SITE_URL . '/' . ltrim(\Request::input('redirect_to'), '/') : 'dashboard';
|
||||
|
||||
return redirect()->to($redirectTo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@
|
|||
|
||||
namespace App\Services\Migration;
|
||||
|
||||
use Unirest\Request;
|
||||
use Unirest\Request\Body;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
// use Unirest\Request;
|
||||
// use Unirest\Request\Body;
|
||||
|
||||
class AuthService
|
||||
{
|
||||
|
|
@ -51,25 +52,57 @@ class AuthService
|
|||
'password' => $this->password,
|
||||
];
|
||||
|
||||
$body = Body::json($data);
|
||||
$client = new \GuzzleHttp\Client([
|
||||
'headers' => $this->getHeaders(),
|
||||
]);
|
||||
|
||||
$response = Request::post($this->getUrl(), $this->getHeaders(), $body);
|
||||
$response = $client->post($this->getUrl(),[
|
||||
RequestOptions::JSON => $data,
|
||||
RequestOptions::ALLOW_REDIRECTS => false
|
||||
]);
|
||||
|
||||
if (in_array($response->code, [401])) {
|
||||
info($response->raw_body);
|
||||
|
||||
if($response->getStatusCode() == 401){
|
||||
info($response->getBody());
|
||||
$this->isSuccessful = false;
|
||||
$this->processErrors($response->body->message);
|
||||
} elseif (in_array($response->code, [200])) {
|
||||
$this->processErrors($response->getBody());
|
||||
} elseif ($response->getStatusCode() == 200) {
|
||||
|
||||
$message_body = json_decode($response->getBody(), true);
|
||||
|
||||
//info(print_r($message_body,1));
|
||||
|
||||
$this->isSuccessful = true;
|
||||
$this->token = $response->body->data[0]->token->token;
|
||||
$this->token = $message_body['data'][0]['token']['token'];
|
||||
} else {
|
||||
info($response->raw_body);
|
||||
info(json_decode($response->getBody()->getContents()));
|
||||
|
||||
$this->isSuccessful = false;
|
||||
$this->errors = [trans('texts.migration_went_wrong')];
|
||||
}
|
||||
|
||||
|
||||
//return $response->getBody();
|
||||
|
||||
// $body = Body::json($data);
|
||||
|
||||
// $response = Request::post($this->getUrl(), $this->getHeaders(), $body);
|
||||
|
||||
// if (in_array($response->code, [401])) {
|
||||
// info($response->raw_body);
|
||||
|
||||
// $this->isSuccessful = false;
|
||||
// $this->processErrors($response->body->message);
|
||||
// } elseif (in_array($response->code, [200])) {
|
||||
// $this->isSuccessful = true;
|
||||
// $this->token = $response->body->data[0]->token->token;
|
||||
// } else {
|
||||
// info($response->raw_body);
|
||||
|
||||
// $this->isSuccessful = false;
|
||||
// $this->errors = [trans('texts.migration_went_wrong')];
|
||||
// }
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
namespace App\Services\Migration;
|
||||
|
||||
use App\Models\Account;
|
||||
use Unirest\Request;
|
||||
use Unirest\Request\Body;
|
||||
|
||||
class CompanyService
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
namespace App\Services\Migration;
|
||||
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Unirest\Request;
|
||||
// use Unirest\Request;
|
||||
|
||||
class CompleteService
|
||||
{
|
||||
|
|
@ -40,27 +41,53 @@ class CompleteService
|
|||
|
||||
public function start()
|
||||
{
|
||||
|
||||
$files = [];
|
||||
|
||||
foreach ($this->data as $companyKey => $companyData) {
|
||||
|
||||
$data[] = [
|
||||
$data = [
|
||||
'company_index' => $companyKey,
|
||||
'company_key' => $companyData['data']['company']['company_key'],
|
||||
'force' => $companyData['force'],
|
||||
'contents' => 'name',
|
||||
'name' => $companyKey,
|
||||
];
|
||||
|
||||
$files[$companyKey] = $companyData['file'];
|
||||
$payload[$companyKey] = [
|
||||
'contents' => json_encode($data),
|
||||
'name' => $companyData['data']['company']['company_key'],
|
||||
];
|
||||
|
||||
$files[] = [
|
||||
'name' => $companyKey,
|
||||
'company_index' => $companyKey,
|
||||
'company_key' => $companyData['data']['company']['company_key'],
|
||||
'force' => $companyData['force'],
|
||||
'contents' => file_get_contents($companyData['file']),
|
||||
'filename' => basename($companyData['file']),
|
||||
'Content-Type' => 'application/zip'
|
||||
];
|
||||
}
|
||||
|
||||
$body = \Unirest\Request\Body::multipart(['companies' => json_encode($data)], $files);
|
||||
$client = new \GuzzleHttp\Client(
|
||||
[
|
||||
'headers' => $this->getHeaders(),
|
||||
]);
|
||||
|
||||
$response = Request::post($this->getUrl(), $this->getHeaders(), $body);
|
||||
$payload_data = [
|
||||
'multipart'=> array_merge($files, $payload),
|
||||
];
|
||||
|
||||
// info(print_r($payload_data,1));
|
||||
$response = $client->request("POST", $this->getUrl(),$payload_data);
|
||||
|
||||
if($response->getStatusCode() == 200){
|
||||
|
||||
if (in_array($response->code, [200])) {
|
||||
$this->isSuccessful = true;
|
||||
return json_decode($response->getBody(),true);
|
||||
}else {
|
||||
info($response->raw_body);
|
||||
// info($response->raw_body);
|
||||
|
||||
$this->isSuccessful = false;
|
||||
$this->errors = [
|
||||
|
|
@ -69,6 +96,7 @@ class CompleteService
|
|||
}
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
public function isSuccessful()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Libraries\Utils;
|
||||
use App\Models\AccountGateway;
|
||||
use App\Models\AccountGatewaySettings;
|
||||
use App\Models\AccountGatewayToken;
|
||||
|
|
@ -19,6 +20,7 @@ use App\Models\PaymentMethod;
|
|||
use App\Models\PaymentTerm;
|
||||
use App\Models\Product;
|
||||
use App\Models\Project;
|
||||
use App\Models\RecurringExpense;
|
||||
use App\Models\Task;
|
||||
use App\Models\TaskStatus;
|
||||
use App\Models\TaxRate;
|
||||
|
|
@ -73,9 +75,19 @@ trait GenerateMigrationResources
|
|||
{
|
||||
info("get company");
|
||||
|
||||
$financial_year_start = null;
|
||||
if($this->account->financial_year_start)
|
||||
{
|
||||
//2000-02-01 format
|
||||
$exploded_date = explode("-", $this->account->financial_year_start);
|
||||
|
||||
$financial_year_start = (int)$exploded_date[1];
|
||||
|
||||
}
|
||||
|
||||
return [
|
||||
'first_day_of_week' => $this->account->start_of_week,
|
||||
'first_month_of_year' => $this->account->financial_year_start,
|
||||
'first_month_of_year' => $financial_year_start,
|
||||
'version' => NINJA_VERSION,
|
||||
'referral_code' => $this->account->referral_code ?: '',
|
||||
'account_id' => $this->account->id,
|
||||
|
|
@ -90,6 +102,7 @@ info("get company");
|
|||
'custom_surcharge_taxes1' => $this->account->custom_invoice_taxes1,
|
||||
'custom_surcharge_taxes2' => $this->account->custom_invoice_taxes2,
|
||||
'subdomain' => $this->account->subdomain,
|
||||
'portal_mode' => 'subdomain',
|
||||
'size_id' => $this->account->size_id,
|
||||
'enable_modules' => $this->account->enabled_modules,
|
||||
'custom_fields' => $this->account->custom_fields,
|
||||
|
|
@ -130,10 +143,17 @@ info("get company");
|
|||
{
|
||||
info("get co settings");
|
||||
|
||||
$timezone_id = $this->account->timezone_id ? $this->account->timezone_id : 15;
|
||||
|
||||
if($timezone_id > 57)
|
||||
$timezone_id = (string)($timezone_id - 1);
|
||||
|
||||
return [
|
||||
'entity_send_time' => 6,
|
||||
'auto_bill_date' => $this->account->auto_bill_on_due_date ? 'on_due_date' : 'on_send_date',
|
||||
'auto_bill' => $this->transformAutoBill($this->account->token_billing_id),
|
||||
'payment_terms' => $this->account->payment_terms ? (string) $this->account->payment_terms : '',
|
||||
'timezone_id' => $this->account->timezone_id ? (string) $this->account->timezone_id : '15',
|
||||
'timezone_id' => $timezone_id,
|
||||
'date_format_id' => $this->account->date_format_id ? (string) $this->account->date_format_id : '1',
|
||||
'currency_id' => $this->account->currency_id ? (string) $this->account->currency_id : '1',
|
||||
'name' => $this->account->name ?: trans('texts.untitled'),
|
||||
|
|
@ -171,7 +191,7 @@ info("get company");
|
|||
'all_pages_footer' => $this->account->all_pages_footer ? (bool) $this->account->all_pages_footer : true,
|
||||
'all_pages_header' => $this->account->all_pages_header ? (bool) $this->account->all_pages_header : true,
|
||||
'show_currency_code' => $this->account->show_currency_code ? (bool) $this->account->show_currency_code : false,
|
||||
'enable_client_portal_password' => $this->account->enable_portal_password ? (bool) $this->account->enable_portal_password : true,
|
||||
'enable_client_portal_password' => $this->account->enable_portal_password ? (bool) $this->account->enable_portal_password : false,
|
||||
'send_portal_password' => $this->account->send_portal_password ? (bool) $this->account->send_portal_password : false,
|
||||
'recurring_number_prefix' => $this->account->recurring_invoice_number_prefix ? $this->account->recurring_invoice_number_prefix : 'R',
|
||||
'enable_client_portal' => $this->account->enable_client_portal ? (bool) $this->account->enable_client_portal : false,
|
||||
|
|
@ -189,10 +209,9 @@ info("get company");
|
|||
'client_number_pattern' => $this->account->client_number_pattern ?: '',
|
||||
'payment_number_pattern' => '',
|
||||
'payment_number_counter' => 0,
|
||||
'payment_terms' => $this->account->payment_terms ?: '',
|
||||
'reset_counter_frequency_id' => $this->account->reset_counter_frequency_id ? (string) $this->transformFrequencyId
|
||||
($this->account->reset_counter_frequency_id) : '0',
|
||||
'payment_type_id' => $this->account->payment_type_id ? (string) $this->account->payment_type_id : '1',
|
||||
'payment_type_id' => $this->account->payment_type_id ? (string) $this->transformPaymentType($this->account->payment_type_id) : '1',
|
||||
'reset_counter_date' => $this->account->reset_counter_date ?: '',
|
||||
'tax_name1' => $this->account->tax_name1 ?: '',
|
||||
'tax_rate1' => $this->account->tax_rate1 ?: 0,
|
||||
|
|
@ -211,18 +230,88 @@ info("get company");
|
|||
'auto_archive_quote' => $this->account->auto_archive_quote ? (bool) $this->account->auto_archive_quote : false,
|
||||
'auto_email_invoice' => $this->account->auto_email_invoice ? (bool) $this->account->auto_email_invoice : false,
|
||||
'counter_padding' => $this->account->invoice_number_padding ?: 4,
|
||||
'reply_to_email' => $this->account->account_email_settings->reply_to_email ?: '',
|
||||
'bcc_email' => $this->account->account_email_settings->bcc_email ?: '',
|
||||
'email_subject_invoice' => $this->account->account_email_settings->email_subject_invoice ?: '',
|
||||
'email_subject_quote' => $this->account->account_email_settings->email_subject_quote ?: '',
|
||||
'email_subject_payment' => $this->account->account_email_settings->email_subject_payment ?: '',
|
||||
'email_template_invoice' => $this->account->account_email_settings->email_template_invoice ?: '',
|
||||
'email_template_quote' => $this->account->account_email_settings->email_template_quote ?: '',
|
||||
'email_template_payment' => $this->account->account_email_settings->email_template_payment ?: '',
|
||||
'email_subject_reminder1' => $this->account->account_email_settings->email_subject_reminder1 ?: '',
|
||||
'email_subject_reminder2' => $this->account->account_email_settings->email_subject_reminder2 ?: '',
|
||||
'email_subject_reminder3' => $this->account->account_email_settings->email_subject_reminder3 ?: '',
|
||||
'email_subject_reminder_endless' => $this->account->account_email_settings->email_subject_reminder4 ?: '',
|
||||
'email_template_reminder1' => $this->account->account_email_settings->email_template_reminder1 ?: '',
|
||||
'email_template_reminder2' => $this->account->account_email_settings->email_template_reminder2 ?: '',
|
||||
'email_template_reminder3' => $this->account->account_email_settings->email_template_reminder3 ?: '',
|
||||
'email_template_reminder_endless' => $this->account->account_email_settings->email_template_reminder4 ?: '',
|
||||
'late_fee_amount1' => $this->account->account_email_settings->late_fee1_amount ?: 0,
|
||||
'late_fee_amount2' => $this->account->account_email_settings->late_fee2_amount ?: 0,
|
||||
'late_fee_amount3' => $this->account->account_email_settings->late_fee3_amount ?: 0,
|
||||
'late_fee_percent1' => $this->account->account_email_settings->late_fee1_percent ?: 0,
|
||||
'late_fee_percent2' => $this->account->account_email_settings->late_fee2_percent ?: 0,
|
||||
'late_fee_percent3' => $this->account->account_email_settings->late_fee3_percent ?: 0,
|
||||
'enable_reminder1' => $this->account->enable_reminder1 ? true : false,
|
||||
'enable_reminder2' => $this->account->enable_reminder2 ? true : false,
|
||||
'enable_reminder3' => $this->account->enable_reminder3 ? true : false,
|
||||
'enable_reminder_endless' => $this->account->enable_reminder4 ? true : false,
|
||||
'num_days_reminder1' => $this->account->num_days_reminder1 ?: 0,
|
||||
'num_days_reminder2' => $this->account->num_days_reminder2 ?: 0,
|
||||
'num_days_reminder3' => $this->account->num_days_reminder3 ?: 0,
|
||||
'schedule_reminder1' => $this->buildReminderString($this->account->direction_reminder1, $this->account->field_reminder1),
|
||||
'schedule_reminder2' => $this->buildReminderString($this->account->direction_reminder2, $this->account->field_reminder2),
|
||||
'schedule_reminder3' => $this->buildReminderString($this->account->direction_reminder3, $this->account->field_reminder3),
|
||||
'endless_reminder_frequency_id' => $this->account->account_email_settings->reset_counter_frequency_id ? $this->transformFrequencyId($this->account->account_email_settings->reset_counter_frequency_id) : 0,
|
||||
'email_signature' => $this->account->email_footer ?: '',
|
||||
'email_style' => $this->getEmailStyle($this->account->email_design_id),
|
||||
'custom_message_dashboard' => $this->account->customMessage('dashboard'),
|
||||
'custom_message_unpaid_invoice' => $this->account->customMessage('unpaid_invoice'),
|
||||
'custom_message_paid_invoice' => $this->account->customMessage('paid_invoice'),
|
||||
'custom_message_unapproved_quote' => $this->account->customMessage('unapproved_quote'),
|
||||
];
|
||||
}
|
||||
|
||||
private function getEmailStyle($id){
|
||||
|
||||
switch ($id) {
|
||||
case 1:
|
||||
return 'plain';
|
||||
break;
|
||||
case 2:
|
||||
return 'light';
|
||||
break;
|
||||
case 3:
|
||||
return 'dark';
|
||||
break;
|
||||
|
||||
default:
|
||||
return 'light';
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function buildReminderString($direction, $field)
|
||||
{
|
||||
|
||||
$direction_string = $direction == 1 ? "after_" : "before_";
|
||||
$field_string = $field == 1 ? "due_date" : "invoice_date";
|
||||
|
||||
return $direction_string.$field_string;
|
||||
|
||||
}
|
||||
|
||||
public function getTaxRates()
|
||||
{
|
||||
info("get tax rates");
|
||||
|
||||
|
||||
$rates = TaxRate::where('account_id', $this->account->id)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get tax rates => " . $rates->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($rates as $rate) {
|
||||
|
|
@ -241,10 +330,12 @@ info("get company");
|
|||
}
|
||||
|
||||
protected function getClients()
|
||||
{info("get clients");
|
||||
{
|
||||
|
||||
$clients = [];
|
||||
|
||||
info("get clients => ". $this->account->clients()->count());
|
||||
|
||||
foreach ($this->account->clients()->withTrashed()->get() as $client) {
|
||||
|
||||
$number = $client->id_number;
|
||||
|
|
@ -293,8 +384,6 @@ info("get company");
|
|||
|
||||
private function getClientSettings($client)
|
||||
{
|
||||
info("get client settings");
|
||||
|
||||
|
||||
$settings = new \stdClass();
|
||||
$settings->currency_id = $client->currency_id ? (string) $client->currency_id : (string) $client->account->currency_id;
|
||||
|
|
@ -311,12 +400,13 @@ info("get company");
|
|||
|
||||
protected function getClientContacts($client)
|
||||
{
|
||||
info("get client contacts");
|
||||
|
||||
$contacts = Contact::where('client_id', $client->id)->withTrashed()->get();
|
||||
|
||||
$transformed = [];
|
||||
|
||||
info("Importing contacts => " . $contacts->count());
|
||||
|
||||
foreach ($contacts as $contact) {
|
||||
$transformed[] = [
|
||||
'id' => $contact->id,
|
||||
|
|
@ -350,18 +440,39 @@ info("get company");
|
|||
{
|
||||
$transformed = [];
|
||||
|
||||
$ninja_client = Client::where('public_id', $this->account->id)->first();
|
||||
if(!Utils::isNinja())
|
||||
return $transformed;
|
||||
|
||||
$db = DB_NINJA_1;
|
||||
$account_id = 20432;
|
||||
|
||||
if($this->account->id > 1000000){
|
||||
$db = DB_NINJA_2;
|
||||
$account_id = 1000002;
|
||||
}
|
||||
|
||||
$ninja_client = Client::on($db)->where('public_id', $this->account->id)->where('account_id', $account_id)->first();
|
||||
|
||||
if(!$ninja_client)
|
||||
return $transformed;
|
||||
|
||||
$agts = AccountGatewayToken::where('client_id', $ninja_client->id)->get();
|
||||
$agts = AccountGatewayToken::on($db)->where('client_id', $ninja_client->id)->get();
|
||||
$is_default = true;
|
||||
|
||||
if(count($agts) == 0) {
|
||||
$transformed[] = [
|
||||
'client' => $ninja_client->toArray()
|
||||
];
|
||||
}
|
||||
|
||||
foreach($agts as $agt) {
|
||||
|
||||
$payment_method = $agt->default_payment_method;
|
||||
$contact = Contact::where('id', $payment_method->contact_id)->withTrashed()->first();
|
||||
|
||||
if(!$payment_method)
|
||||
continue;
|
||||
|
||||
$contact = Contact::on($db)->where('id', $payment_method->contact_id)->withTrashed()->first();
|
||||
|
||||
$transformed[] = [
|
||||
'id' => $payment_method->id,
|
||||
|
|
@ -373,7 +484,7 @@ info("get company");
|
|||
'gateway_type_id' => $payment_method->payment_type->gateway_type_id,
|
||||
'is_default' => $is_default,
|
||||
'meta' => $this->convertMeta($payment_method),
|
||||
'client' => $contact->client->toArray(),
|
||||
'client' => $ninja_client->toArray(),
|
||||
'contacts' => $contact->client->contacts->toArray(),
|
||||
];
|
||||
}
|
||||
|
|
@ -384,12 +495,13 @@ info("get company");
|
|||
|
||||
protected function getProducts()
|
||||
{
|
||||
info("get products");
|
||||
|
||||
$products = Product::where('account_id', $this->account->id)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get products " . $products->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($products as $product) {
|
||||
|
|
@ -418,12 +530,13 @@ info("get company");
|
|||
|
||||
public function getUsers()
|
||||
{
|
||||
info("get users");
|
||||
|
||||
$users = User::where('account_id', $this->account->id)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get users " . $users->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($users as $user) {
|
||||
|
|
@ -432,12 +545,12 @@ info("get company");
|
|||
'first_name' => $user->first_name ?: '',
|
||||
'last_name' => $user->last_name ?: '',
|
||||
'phone' => $user->phone ?: '',
|
||||
'email' => $user->username,
|
||||
'email' => str_contains($user->username, "@") ? $user->username : $user->email,
|
||||
'confirmation_code' => $user->confirmation_code,
|
||||
'failed_logins' => $user->failed_logins,
|
||||
'referral_code' => $user->referral_code,
|
||||
'oauth_user_id' => $user->oauth_user_id,
|
||||
'oauth_provider_id' => $user->oauth_provider_id,
|
||||
// 'oauth_user_id' => $user->oauth_user_id,
|
||||
// 'oauth_provider_id' => $user->oauth_provider_id,
|
||||
'google_2fa_secret' => '',
|
||||
'accepted_terms_version' => $user->accepted_terms_version,
|
||||
'password' => $user->password,
|
||||
|
|
@ -454,52 +567,51 @@ info("get company");
|
|||
|
||||
private function getCreditsNotes()
|
||||
{
|
||||
info("get credit notes");
|
||||
|
||||
$credits = [];
|
||||
$export_credits = collect([]);
|
||||
|
||||
$export_credits = Invoice::where('account_id', $this->account->id)
|
||||
->where('balance', '<', '0')
|
||||
->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD)
|
||||
->where('is_public', true)
|
||||
$export_credits = Credit::where('account_id', $this->account->id)->where('amount', '>', 0)->whereIsDeleted(false)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get credit notes => " . $export_credits->count());
|
||||
|
||||
foreach ($export_credits as $credit) {
|
||||
$credits[] = [
|
||||
'id' => $credit->id,
|
||||
'client_id' => $credit->client_id,
|
||||
'user_id' => $credit->user_id,
|
||||
'company_id' => $credit->account_id,
|
||||
'status_id' => $credit->invoice_status_id,
|
||||
'design_id' => $this->getDesignId($credit->invoice_design_id),
|
||||
'number' => $credit->invoice_number,
|
||||
'discount' => $credit->discount ? $credit->discount*-1: 0,
|
||||
'is_amount_discount' => $credit->is_amount_discount ?: false,
|
||||
'po_number' => $credit->po_number ?: '',
|
||||
'date' => $credit->invoice_date,
|
||||
'last_sent_date' => $credit->last_sent_date,
|
||||
'due_date' => $credit->due_date,
|
||||
'status_id' => 2,
|
||||
'design_id' => 2,
|
||||
'number' => $credit->credit_number ?: null,
|
||||
'discount' => 0,
|
||||
'is_amount_discount' => 0,
|
||||
'po_number' => '',
|
||||
'date' => $credit->date,
|
||||
'last_sent_date' => null,
|
||||
'due_date' => null,
|
||||
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
||||
'is_deleted' => $credit->is_deleted,
|
||||
'footer' => $credit->invoice_footer ?: '',
|
||||
'public_notes' => $credit->public_notes ?: '',
|
||||
'private_notes' => $credit->private_notes ?: '',
|
||||
'terms' => $credit->terms ?: '',
|
||||
'tax_name1' => $credit->tax_name1,
|
||||
'tax_name2' => $credit->tax_name2,
|
||||
'tax_rate1' => $credit->tax_rate1,
|
||||
'tax_rate2' => $credit->tax_rate2,
|
||||
'footer' => '',
|
||||
'public_notes' => $credit->public_notes,
|
||||
'private_notes' => $credit->private_notes,
|
||||
'terms' => '',
|
||||
'tax_name1' => '',
|
||||
'tax_name2' => '',
|
||||
'tax_rate1' => 0,
|
||||
'tax_rate2' => 0,
|
||||
'tax_name3' => '',
|
||||
'tax_rate3' => 0,
|
||||
'custom_value1' => $credit->custom_value1 ?: '',
|
||||
'custom_value2' => $credit->custom_value2 ?: '',
|
||||
'custom_value1' => '',
|
||||
'custom_value2' => '',
|
||||
'next_send_date' => null,
|
||||
'amount' => $credit->amount ? $credit->amount * -1: 0,
|
||||
'balance' => $credit->balance ? $credit->balance * -1: 0,
|
||||
'partial' => $credit->partial ? $credit->partial * -1 : 0,
|
||||
'partial_due_date' => $credit->partial_due_date,
|
||||
'line_items' => $this->getCreditItems($credit->invoice_items),
|
||||
'partial' => 0,
|
||||
'partial_due_date' => null,
|
||||
'line_items' => $this->getCreditItems($credit->balance),
|
||||
'created_at' => $credit->created_at ? Carbon::parse($credit->created_at)->toDateString() : null,
|
||||
'updated_at' => $credit->updated_at ? Carbon::parse($credit->updated_at)->toDateString() : null,
|
||||
'deleted_at' => $credit->deleted_at ? Carbon::parse($credit->deleted_at)->toDateString() : null,
|
||||
|
|
@ -511,17 +623,19 @@ info("get company");
|
|||
|
||||
|
||||
protected function getInvoices()
|
||||
{ info("get invoices");
|
||||
{
|
||||
|
||||
$invoices = [];
|
||||
|
||||
$export_invoices = Invoice::where('account_id', $this->account->id)
|
||||
->where('amount', '>=', 0)
|
||||
// ->where('amount', '>=', 0)
|
||||
->where('invoice_type_id', INVOICE_TYPE_STANDARD)
|
||||
->where('is_recurring', false)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get invoices -> ". $export_invoices->count());
|
||||
|
||||
foreach ($export_invoices as $invoice) {
|
||||
$invoices[] = [
|
||||
'id' => $invoice->id,
|
||||
|
|
@ -566,6 +680,7 @@ info("get company");
|
|||
'deleted_at' => $invoice->deleted_at ? Carbon::parse($invoice->deleted_at)->toDateString() : null,
|
||||
'invitations' => $this->getResourceInvitations($invoice->invitations, 'invoice_id'),
|
||||
'auto_bill_enabled' => $invoice->auto_bill,
|
||||
'recurring_id' => $invoice->recurring_invoice_id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -591,10 +706,59 @@ info("get company");
|
|||
return $design_id;
|
||||
}
|
||||
|
||||
protected function getRecurringExpenses()
|
||||
{
|
||||
|
||||
$expenses = [];
|
||||
|
||||
$export_expenses = RecurringExpense::where('account_id', $this->account->id)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get recurring Expenses => " . $export_expenses->count());
|
||||
|
||||
foreach ($export_expenses as $expense) {
|
||||
$expenses[] = [
|
||||
'id' => $expense->id,
|
||||
'amount' => $expense->amount,
|
||||
'company_id' => $this->account->id,
|
||||
'client_id' => $expense->client_id,
|
||||
'user_id' => $expense->user_id,
|
||||
'custom_value1' => '',
|
||||
'custom_value2' => '',
|
||||
'custom_value3' => '',
|
||||
'custom_value4' => '',
|
||||
'category_id' => $expense->expense_category_id,
|
||||
'currency_id' => $expense->expense_currency_id,
|
||||
'frequency_id' => $this->transformFrequencyId($expense->frequency_id),
|
||||
'invoice_currency_id' => $expense->invoice_currency_id,
|
||||
'private_notes' => $expense->private_notes,
|
||||
'public_notes' => $expense->public_notes,
|
||||
'should_be_invoiced' => $expense->should_be_invoiced,
|
||||
'tax_name1' => $expense->tax_name1,
|
||||
'tax_name2' => $expense->tax_name2,
|
||||
'tax_name3' => '',
|
||||
'tax_rate1' => $expense->tax_rate1,
|
||||
'tax_rate2' => $expense->tax_rate2,
|
||||
'tax_rate3' => 0,
|
||||
'vendor_id' => $expense->vendor_id,
|
||||
'is_deleted' => $expense->is_deleted,
|
||||
'next_send_date' => $this->getNextSendDateForMigration($expense),
|
||||
'remaining_cycles' => $this->getRemainingCycles($expense),
|
||||
'created_at' => $expense->created_at ? Carbon::parse($expense->created_at)->toDateString() : null,
|
||||
'updated_at' => $expense->updated_at ? Carbon::parse($expense->updated_at)->toDateString() : null,
|
||||
'deleted_at' => $expense->deleted_at ? Carbon::parse($expense->deleted_at)->toDateString() : null,
|
||||
];
|
||||
}
|
||||
|
||||
return $expenses;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function getRecurringInvoices()
|
||||
{
|
||||
info("get recurring invoices");
|
||||
|
||||
|
||||
$invoices = [];
|
||||
|
||||
|
|
@ -604,6 +768,8 @@ info("get company");
|
|||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get recurring invoices => " . $export_invoices->count());
|
||||
|
||||
foreach ($export_invoices as $invoice) {
|
||||
$invoices[] = [
|
||||
'id' => $invoice->id,
|
||||
|
|
@ -648,7 +814,8 @@ info("get company");
|
|||
'due_date_days' => $this->transformDueDate($invoice),
|
||||
'remaining_cycles' => $this->getRemainingCycles($invoice),
|
||||
'invitations' => $this->getResourceInvitations($invoice->invitations, 'recurring_invoice_id'),
|
||||
'auto_bill_enabled' => $invoice->auto_bill,
|
||||
'auto_bill_enabled' => $this->calcAutoBill($invoice),
|
||||
'auto_bill' => $this->calcAutoBillEnabled($invoice),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -656,6 +823,29 @@ info("get company");
|
|||
|
||||
}
|
||||
|
||||
private function calcAutoBillEnabled($invoice)
|
||||
{
|
||||
if($invoice->auto_bill === 1)
|
||||
return 'off';
|
||||
elseif($invoice->auto_bill === 2)
|
||||
return 'optin';
|
||||
elseif($invoice->auto_bill === 3)
|
||||
return 'optout';
|
||||
elseif($invoice->auto_bill === 4)
|
||||
return 'always';
|
||||
else
|
||||
return 'off';
|
||||
}
|
||||
|
||||
private function calcAutoBill($invoice)
|
||||
{
|
||||
if($invoice->auto_bill == 4)
|
||||
return 1;
|
||||
|
||||
return $invoice->client_enable_auto_bill;
|
||||
|
||||
}
|
||||
|
||||
private function getNextSendDateForMigration($invoice)
|
||||
{
|
||||
|
||||
|
|
@ -736,8 +926,13 @@ info("get company");
|
|||
|
||||
$due_date_parts = explode("-", $invoice->due_date);
|
||||
|
||||
if(is_array($due_date_parts) && count($due_date_parts) >=3)
|
||||
if(is_array($due_date_parts) && count($due_date_parts) >=3){
|
||||
|
||||
if($due_date_parts[2] == "00")
|
||||
return "0";
|
||||
|
||||
return (string)$due_date_parts[2];
|
||||
}
|
||||
|
||||
return 'terms';
|
||||
}
|
||||
|
|
@ -834,7 +1029,7 @@ info("get company");
|
|||
if($invoice->is_public == 0)
|
||||
return 1;
|
||||
|
||||
if($invoice->end_date < now())
|
||||
if($invoice->end_date && $invoice->end_date < now())
|
||||
return 4;
|
||||
|
||||
return 1;
|
||||
|
|
@ -925,7 +1120,7 @@ info("get company");
|
|||
|
||||
public function getResourceInvitations($items, $resourceKeyId)
|
||||
{
|
||||
info("get resource {$resourceKeyId} invitations");
|
||||
// info("get resource {$resourceKeyId} invitations");
|
||||
|
||||
$transformed = [];
|
||||
|
||||
|
|
@ -955,50 +1150,40 @@ info("get company");
|
|||
return $transformed;
|
||||
}
|
||||
|
||||
public function getCreditItems($items)
|
||||
public function getCreditItems($balance)
|
||||
{
|
||||
info("get credit items");
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($items as $item) {
|
||||
|
||||
// if($item->cost < 0)
|
||||
// $item->cost = $item->cost * -1;
|
||||
|
||||
$item->qty = $item->qty * -1;
|
||||
|
||||
// if($item->discount < 0)
|
||||
// $item->discount = $item->discount * -1;
|
||||
|
||||
$transformed[] = [
|
||||
'id' => $item->id,
|
||||
'quantity' => (float) $item->qty,
|
||||
'cost' => (float) $item->cost,
|
||||
'product_key' => $item->product_key,
|
||||
'notes' => $item->notes,
|
||||
'discount' => (float) $item->discount,
|
||||
'tax_name1' => (string)$item->tax_name1,
|
||||
'tax_rate1' => (float) $item->tax_rate1,
|
||||
'tax_name2' => (string) $item->tax_name2,
|
||||
'tax_rate2' => (float) $item->tax_rate2,
|
||||
'tax_name3' => (string) '',
|
||||
'tax_rate3' => (float) 0,
|
||||
'date' => Carbon::parse($item->created_at)->toDateString(),
|
||||
'custom_value1' => $item->custom_value1 ?: '',
|
||||
'custom_value2' => $item->custom_value2 ?: '',
|
||||
'id' => '',
|
||||
'quantity' => (float) 1,
|
||||
'cost' => (float) $balance,
|
||||
'product_key' => trans('texts.balance'),
|
||||
'notes' => trans('texts.credit_balance'),
|
||||
'discount' => 0,
|
||||
'tax_name1' => '',
|
||||
'tax_rate1' => 0,
|
||||
'tax_name2' => '',
|
||||
'tax_rate2' => 0,
|
||||
'tax_name3' => '',
|
||||
'tax_rate3' => 0,
|
||||
'date' => '',
|
||||
'custom_value1' => '',
|
||||
'custom_value2' => '',
|
||||
'custom_value3' => '',
|
||||
'custom_value4' => '',
|
||||
'type_id' => (string)$item->invoice_item_type_id,
|
||||
'type_id' => '1',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
return $transformed;
|
||||
}
|
||||
|
||||
public function getInvoiceItems($items)
|
||||
{
|
||||
info("get invoice items");
|
||||
// info("get invoice items");
|
||||
|
||||
$transformed = [];
|
||||
|
||||
|
|
@ -1030,8 +1215,6 @@ info("get company");
|
|||
|
||||
public function getQuotes()
|
||||
{
|
||||
info("get quotes");
|
||||
|
||||
|
||||
$transformed = [];
|
||||
|
||||
|
|
@ -1040,6 +1223,8 @@ info("get company");
|
|||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get quotes => " . $quotes->count());
|
||||
|
||||
foreach ($quotes as $quote) {
|
||||
$transformed[] = [
|
||||
'id' => $quote->id,
|
||||
|
|
@ -1065,7 +1250,7 @@ info("get company");
|
|||
'tax_name2' => $quote->tax_name2,
|
||||
'tax_rate1' => $quote->tax_rate1,
|
||||
'tax_rate2' => $quote->tax_rate2,
|
||||
'invoice_id' => $quote->quote_invoice_id,
|
||||
'invoice_id' => Invoice::getPrivateId($quote->quote_invoice_id),
|
||||
'custom_surcharge1' => $quote->custom_value1 ?: '',
|
||||
'custom_surcharge2' => $quote->custom_value2 ?: '',
|
||||
'custom_value1' => $quote->custom_text_value1 ?: '',
|
||||
|
|
@ -1115,7 +1300,6 @@ info("get company");
|
|||
|
||||
public function getPayments()
|
||||
{
|
||||
info("get payments");
|
||||
|
||||
$transformed = [];
|
||||
|
||||
|
|
@ -1124,6 +1308,9 @@ info("get company");
|
|||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get payments => " . $payments->count());
|
||||
|
||||
|
||||
foreach ($payments as $payment) {
|
||||
$transformed[] = [
|
||||
'id' => $payment->id,
|
||||
|
|
@ -1144,6 +1331,7 @@ info("get company");
|
|||
'refunded' => $payment->refunded ?: 0,
|
||||
'date' => $payment->payment_date,
|
||||
'transaction_reference' => $payment->transaction_reference ?: '',
|
||||
'private_notes' => $payment->private_notes ?: '',
|
||||
'payer_id' => $payment->payer_id,
|
||||
'is_deleted' => (bool)$payment->is_deleted,
|
||||
'exchange_rate' => $payment->exchange_rate ? number_format((float) $payment->exchange_rate, 6) : null,
|
||||
|
|
@ -1183,12 +1371,28 @@ info("get company");
|
|||
const SEPA = 29;
|
||||
const GOCARDLESS = 30;
|
||||
const CRYPTO = 31;
|
||||
|
||||
const MOLLIE_BANK_TRANSFER = 34;
|
||||
const KBC = 35;
|
||||
const BANCONTACT = 36;
|
||||
const IDEAL = 37;
|
||||
const HOSTED_PAGE = 38;
|
||||
const GIROPAY = 39;
|
||||
const PRZELEWY24 = 40;
|
||||
const EPS = 41;
|
||||
const DIRECT_DEBIT = 42;
|
||||
const BECS = 43;
|
||||
const ACSS = 44;
|
||||
const INSTANT_BANK_PAY = 45;
|
||||
const FPX = 46;
|
||||
*/
|
||||
private function transformPaymentType($payment_type_id)
|
||||
{
|
||||
switch ($payment_type_id) {
|
||||
case 4:
|
||||
return 42;
|
||||
case PAYMENT_TYPE_CREDIT:
|
||||
return 1;
|
||||
return 32;
|
||||
case PAYMENT_TYPE_ACH:
|
||||
return 4;
|
||||
case PAYMENT_TYPE_VISA:
|
||||
|
|
@ -1209,6 +1413,8 @@ info("get company");
|
|||
return 12;
|
||||
case PAYMENT_TYPE_PAYPAL:
|
||||
return 13;
|
||||
case 16:
|
||||
return 15;
|
||||
case PAYMENT_TYPE_CARTE_BLANCHE:
|
||||
return 16;
|
||||
case PAYMENT_TYPE_UNIONPAY:
|
||||
|
|
@ -1233,6 +1439,10 @@ info("get company");
|
|||
return 30;
|
||||
case PAYMENT_TYPE_BITCOIN:
|
||||
return 31;
|
||||
case 2:
|
||||
return 1;
|
||||
case 3:
|
||||
return 2;
|
||||
|
||||
default:
|
||||
return $payment_type_id;
|
||||
|
|
@ -1249,12 +1459,13 @@ info("get company");
|
|||
|
||||
private function getCredits()
|
||||
{
|
||||
info("get credits");
|
||||
|
||||
$credits = Credit::where('account_id', $this->account->id)->where('balance', '>', 0)->whereIsDeleted(false)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get credits => " . $credits->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($credits as $credit) {
|
||||
|
|
@ -1279,10 +1490,12 @@ info("get company");
|
|||
|
||||
private function getDocuments()
|
||||
{
|
||||
info("get documents");
|
||||
|
||||
$documents = Document::where('account_id', $this->account->id)->get();
|
||||
|
||||
info("get documents => " . $documents->count());
|
||||
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($documents as $document) {
|
||||
|
|
@ -1322,12 +1535,9 @@ info("get company");
|
|||
|
||||
$fees_and_limits = $this->transformFeesAndLimits($gateway_type);
|
||||
|
||||
info("generated fees and limits = ");
|
||||
info(print_r($fees_and_limits,1));
|
||||
|
||||
$translated_gateway_type = $this->translateGatewayTypeId($gateway_type);
|
||||
|
||||
info("translated gateway_type = {$translated_gateway_type}");
|
||||
|
||||
$fees->{$translated_gateway_type} = $fees_and_limits;
|
||||
}
|
||||
|
|
@ -1337,10 +1547,11 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
private function getCompanyGateways()
|
||||
{
|
||||
info("get get company gateways");
|
||||
|
||||
$account_gateways = AccountGateway::where('account_id', $this->account->id)->withTrashed()->get();
|
||||
|
||||
info("get get company gateways => " . $account_gateways->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($account_gateways as $account_gateway) {
|
||||
|
|
@ -1357,7 +1568,7 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
}
|
||||
catch(\Exception $e){
|
||||
|
||||
info($config);
|
||||
// info($config);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1537,11 +1748,10 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
private function getClientGatewayTokens()
|
||||
{
|
||||
|
||||
info("get client gateway tokens");
|
||||
|
||||
|
||||
$payment_methods = PaymentMethod::where('account_id', $this->account->id)->withTrashed()->get();
|
||||
|
||||
info("get client gateway tokens => " . $payment_methods->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
$is_default = true;
|
||||
|
|
@ -1550,6 +1760,9 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
$contact = Contact::where('id', $payment_method->contact_id)->withTrashed()->first();
|
||||
$agt = AccountGatewayToken::where('id', $payment_method->account_gateway_token_id)->withTrashed()->first();
|
||||
|
||||
if(!$contact && !$agt)
|
||||
continue;
|
||||
|
||||
$transformed[] = [
|
||||
'id' => $payment_method->id,
|
||||
'company_id' => $this->account->id,
|
||||
|
|
@ -1560,6 +1773,9 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
'gateway_type_id' => $payment_method->payment_type->gateway_type_id,
|
||||
'is_default' => $is_default,
|
||||
'meta' => $this->convertMeta($payment_method),
|
||||
'created_at' => $payment_method->created_at ? Carbon::parse($payment_method->created_at)->toDateString() : null,
|
||||
'updated_at' => $payment_method->updated_at ? Carbon::parse($payment_method->updated_at)->toDateString() : null,
|
||||
'deleted_at' => $payment_method->deleted_at ? Carbon::parse($payment_method->deleted_at)->toDateString() : null,
|
||||
];
|
||||
|
||||
$is_default = false;
|
||||
|
|
@ -1570,11 +1786,11 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
private function getPaymentTerms()
|
||||
{
|
||||
info("get payment terms");
|
||||
|
||||
|
||||
$payment_terms = PaymentTerm::where('account_id', 0)->orWhere('account_id', $this->account->id)->withTrashed()->get();
|
||||
|
||||
info("get payment terms => " . $payment_terms->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach($payment_terms as $payment_term)
|
||||
|
|
@ -1601,10 +1817,10 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
private function getTaskStatuses()
|
||||
{
|
||||
info("get task statuses");
|
||||
|
||||
$task_statuses = TaskStatus::where('account_id', $this->account->id)->withTrashed()->get();
|
||||
|
||||
info("get task statuses => " . $task_statuses->count());
|
||||
|
||||
if($task_statuses->count() == 0)
|
||||
{
|
||||
$defaults = [
|
||||
|
|
@ -1647,10 +1863,10 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
private function getExpenseCategories()
|
||||
{
|
||||
info("get expense categories");
|
||||
|
||||
$expense_categories = ExpenseCategory::where('account_id', $this->account->id)->withTrashed()->get();
|
||||
|
||||
info("get expense categories => " . $expense_categories->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($expense_categories as $category)
|
||||
|
|
@ -1672,10 +1888,10 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
private function getExpenses()
|
||||
{
|
||||
info("get expenses");
|
||||
|
||||
$expenses = Expense::where('account_id', $this->account->id)->withTrashed()->get();
|
||||
|
||||
info("get expenses => " . $expenses->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($expenses as $expense)
|
||||
|
|
@ -1700,7 +1916,7 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
'invoice_documents' => $expense->invoice_documents,
|
||||
'invoice_id' => $expense->invoice_id,
|
||||
'payment_date' => $expense->payment_date,
|
||||
'payment_type_id' => $expense->payment_type_id,
|
||||
'payment_type_id' => $this->transformPaymentType($expense->payment_type_id),
|
||||
'private_notes' => $expense->private_notes,
|
||||
'public_notes' => $expense->public_notes,
|
||||
'recurring_expense_id' => $expense->recurring_expense_id,
|
||||
|
|
@ -1727,13 +1943,13 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
private function getTasks()
|
||||
{
|
||||
info("get tasks");
|
||||
|
||||
|
||||
$tasks = Task::where('account_id', $this->account->id)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get tasks => " . $tasks->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($tasks as $task)
|
||||
|
|
@ -1770,12 +1986,14 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
private function getProjects()
|
||||
{
|
||||
info("get projects");
|
||||
|
||||
$projects = Project::where('account_id', $this->account->id)
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
info("get projects => " . $projects);
|
||||
|
||||
|
||||
$transformed = [];
|
||||
|
||||
foreach ($projects as $project)
|
||||
|
|
@ -1812,10 +2030,10 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
protected function getVendors()
|
||||
{
|
||||
info("get vendors");
|
||||
|
||||
$vendor_query = Vendor::where('account_id', $this->account->id)->withTrashed()->get();
|
||||
|
||||
info("get vendors => " . $vendor_query->count());
|
||||
|
||||
$vendors = [];
|
||||
|
||||
foreach ($vendor_query as $vendor) {
|
||||
|
|
@ -1859,7 +2077,7 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
|
||||
protected function getVendorContacts($contacts)
|
||||
{
|
||||
info("get vendor contacts");
|
||||
info("get vendor contacts => " . $contacts->count());
|
||||
|
||||
$transformed = [];
|
||||
|
||||
|
|
@ -1878,7 +2096,7 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
'custom_value4' => '',
|
||||
'email' => $contact->email,
|
||||
'is_primary' => (bool)$contact->is_primary,
|
||||
'send_email' => (bool)$contact->send_invoice ?: false,
|
||||
'send_email' => (bool)$contact->send_invoice ?: true,
|
||||
'confirmed' => $contact->confirmation_token ? true : false,
|
||||
'email_verified_at' => $contact->created_at->toDateTimeString(),
|
||||
'last_login' => $contact->last_login,
|
||||
|
|
@ -1934,8 +2152,8 @@ info("translated gateway_type = {$translated_gateway_type}");
|
|||
}
|
||||
|
||||
$fees_and_limits = new \stdClass();
|
||||
$fees_and_limits->min_limit = $ags->min_limit;
|
||||
$fees_and_limits->max_limit = $ags->max_limit;
|
||||
$fees_and_limits->min_limit = $ags->min_limit > 0 ? $ags->min_limit : -1;
|
||||
$fees_and_limits->max_limit = $ags->max_limit > 0 ? $ags->max_limit : -1;
|
||||
$fees_and_limits->fee_amount = $ags->fee_amount;
|
||||
$fees_and_limits->fee_percent = $ags->fee_percent;
|
||||
$fees_and_limits->fee_tax_name1 = $ags->tax_name1;
|
||||
|
|
|
|||
|
|
@ -58,14 +58,6 @@ if (strstr($_SERVER['HTTP_USER_AGENT'], 'PhantomJS') && Utils::isNinjaDev()) {
|
|||
}
|
||||
*/
|
||||
|
||||
$app->configureMonologUsing(function($monolog) {
|
||||
if (config('app.log') == 'single') {
|
||||
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-info.log', Monolog\Logger::INFO, false));
|
||||
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-warning.log', Monolog\Logger::WARNING, false));
|
||||
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-error.log', Monolog\Logger::ERROR, false));
|
||||
}
|
||||
});
|
||||
|
||||
// Capture real IP if using cloudflare
|
||||
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
|
||||
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
|
||||
|
|
|
|||
134
composer.json
134
composer.json
|
|
@ -13,96 +13,99 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"php": ">=7.3.0",
|
||||
"ext-gd": "*",
|
||||
"ext-gmp": "*",
|
||||
"ext-json": "*",
|
||||
"ext-zip": "*",
|
||||
"abdala/omnipay-pagseguro": "0.2",
|
||||
"agmscode/omnipay-agms": "~1.0",
|
||||
"anahkiasen/former": "4.*",
|
||||
"andreas22/omnipay-fasapay": "1.*",
|
||||
"asgrim/ofxparser": "^1.1",
|
||||
"bacon/bacon-qr-code": "^1.0",
|
||||
"barracudanetworks/archivestream-php": "^1.0",
|
||||
"barryvdh/laravel-cors": "^0.9.1",
|
||||
"barryvdh/laravel-debugbar": "~3.0.1",
|
||||
"barryvdh/laravel-ide-helper": "~2.2",
|
||||
"cerdic/css-tidy": "~v1.5",
|
||||
"chumper/datatable": "dev-add-back-options",
|
||||
"cleverit/ubl_invoice": "1.*",
|
||||
"codedge/laravel-selfupdater": "2.2.0",
|
||||
"collizo4sky/omnipay-wepay": "dev-address-fix#942f3e0",
|
||||
"digitickets/omnipay-gocardlessv2": "dev-payment-fix",
|
||||
"doctrine/dbal": "2.5.x",
|
||||
"dompdf/dompdf": "0.6.2",
|
||||
"ezyang/htmlpurifier": "~v4.7",
|
||||
"fzaninotto/faker": "^1.5",
|
||||
"google/apiclient": "^2.0",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"intervention/image": "dev-master",
|
||||
"jaybizzle/laravel-crawler-detect": "1.*",
|
||||
"jlapp/swaggervel": "master-dev",
|
||||
"jonnyw/php-phantomjs": "dev-fixes",
|
||||
"laracasts/presenter": "dev-master",
|
||||
"turbo124/framework": "5.5.51",
|
||||
"laravel/legacy-encrypter": "^1.0",
|
||||
"laravel/socialite": "3.0.x-dev",
|
||||
"laravel/tinker": "^1.0",
|
||||
"laravelcollective/html": "5.5.*",
|
||||
"league/csv": "^9.1",
|
||||
"league/flysystem-aws-s3-v3": "~1.0",
|
||||
"league/flysystem-rackspace": "~1.0",
|
||||
"league/fractal": "0.13.*",
|
||||
"maatwebsite/excel": "~2.0",
|
||||
"mashape/unirest-php": "^3.0",
|
||||
"mpdf/mpdf": "7.1.7",
|
||||
"nesbot/carbon": "^1.26",
|
||||
"nwidart/laravel-modules": "2.0.*",
|
||||
"omnipay/authorizenet": "dev-solution-id as 2.5.0",
|
||||
"omnipay/firstdata": "^2.4",
|
||||
"patricktalmadge/bootstrapper": "5.5.x",
|
||||
"turbo124/google2fa-laravel": "0.1.2",
|
||||
"predis/predis": "^1.1",
|
||||
"simshaun/recurr": "dev-master",
|
||||
"stripe/stripe-php": "^6.40",
|
||||
"symfony/css-selector": "~3.1",
|
||||
"turbo124/laravel-push-notification": "2.*",
|
||||
"webpatser/laravel-countries": "dev-master#75992ad",
|
||||
"websight/l5-google-cloud-storage": "dev-master",
|
||||
"wepay/php-sdk": "^0.2",
|
||||
"wildbit/postmark-php": "^2.5",
|
||||
"abdala/omnipay-pagseguro": "0.2",
|
||||
"agmscode/omnipay-agms": "~1.0",
|
||||
"andreas22/omnipay-fasapay": "1.*",
|
||||
"barryvdh/laravel-cors": "^1.0.6",
|
||||
"barryvdh/laravel-debugbar": "~3.6.1",
|
||||
"barryvdh/laravel-ide-helper": "~2.7",
|
||||
"bramdevries/omnipay-paymill": "^1.0",
|
||||
"cardgate/omnipay-cardgate": "~2.0",
|
||||
"cerdic/css-tidy": "~v1.5",
|
||||
"chumper/datatable": "dev-laravel6-support",
|
||||
"cleverit/ubl_invoice": "1.*",
|
||||
"codedge/laravel-selfupdater": "2.3.0",
|
||||
"collizo4sky/omnipay-wepay": "dev-address-fix#942f3e0",
|
||||
"delatbabel/omnipay-fatzebra": "dev-master",
|
||||
"dercoder/omnipay-ecopayz": "~1.0",
|
||||
"dercoder/omnipay-paysafecard": "dev-master",
|
||||
"digitickets/omnipay-barclays-epdq": "~3.0",
|
||||
"digitickets/omnipay-datacash": "~3.0",
|
||||
"digitickets/omnipay-gocardlessv2": "dev-payment-fix",
|
||||
"digitickets/omnipay-realex": "~5.0",
|
||||
"doctrine/dbal": "2.6.x",
|
||||
"dompdf/dompdf": "^2.0",
|
||||
"ezyang/htmlpurifier": "~v4.7",
|
||||
"fotografde/omnipay-checkoutcom": "~2.0",
|
||||
"fruitcakestudio/omnipay-sisow": "~2.0",
|
||||
"fzaninotto/faker": "^1.5",
|
||||
"google/apiclient": "^2.0",
|
||||
"guzzlehttp/guzzle": "^6.5",
|
||||
"guzzlehttp/psr7": "1.8.5",
|
||||
"intervention/image": "dev-master",
|
||||
"jaybizzle/laravel-crawler-detect": "1.*",
|
||||
"jlapp/swaggervel": "master-dev",
|
||||
"jonnyw/php-phantomjs": "dev-fixes",
|
||||
"justinbusschau/omnipay-secpay": "~2.0",
|
||||
"laracasts/presenter": "dev-master",
|
||||
"laravel/framework": "^6.20",
|
||||
"laravel/helpers": "^1.4",
|
||||
"laravel/legacy-encrypter": "^1.0",
|
||||
"laravel/socialite": "~4.4.1",
|
||||
"laravel/tinker": "^1.0",
|
||||
"laravelcollective/html": "^6.2",
|
||||
"league/csv": "^9.1",
|
||||
"league/flysystem-aws-s3-v3": "~1.0",
|
||||
"league/flysystem-rackspace": "~1.0",
|
||||
"league/fractal": "0.13.*",
|
||||
"lokielse/omnipay-alipay": "~1.4",
|
||||
"maatwebsite/excel": "dev-php-fix",
|
||||
"meebio/omnipay-creditcall": "dev-master",
|
||||
"meebio/omnipay-secure-trading": "dev-master",
|
||||
"mfauveau/omnipay-pacnet": "~2.0",
|
||||
"mpdf/mpdf": "^8.0",
|
||||
"nesbot/carbon": "^2.0",
|
||||
"nwidart/laravel-modules": "2.0.*",
|
||||
"omnipay/authorizenet": "dev-solution-id as 2.5.0",
|
||||
"omnipay/bitpay": "dev-master",
|
||||
"omnipay/braintree": "^1.1",
|
||||
"omnipay/common": "2.5.2",
|
||||
"omnipay/firstdata": "^2.4",
|
||||
"omnipay/gocardless": "dev-master",
|
||||
"omnipay/mollie": "3.*",
|
||||
"omnipay/omnipay": "~2.3",
|
||||
"omnipay/payfast": "~2.0",
|
||||
"omnipay/stripe": "~2.0",
|
||||
"patricktalmadge/bootstrapper": "5.12.x",
|
||||
"pragmarx/google2fa-laravel": "0.1.4",
|
||||
"predis/predis": "^1.1",
|
||||
"simshaun/recurr": "dev-master",
|
||||
"softcommerce/omnipay-paytrace": "~1.0",
|
||||
"stripe/stripe-php": "^7",
|
||||
"superbalist/laravel-google-cloud-storage": "^2.2",
|
||||
"symfony/css-selector": "~3.1",
|
||||
"therobfonz/laravel-mandrill-driver": "~1.0",
|
||||
"turbo124/laravel-push-notification": "dev-master",
|
||||
"vemcogroup/laravel-sparkpost-driver": "~2.0",
|
||||
"vink/omnipay-komoju": "~1.0",
|
||||
"omnipay/common": "2.5.2"
|
||||
"webpatser/laravel-countries": "dev-master#75992ad",
|
||||
"wepay/php-sdk": "^0.2",
|
||||
"wildbit/postmark-php": "^2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/dom-crawler": "~3.1",
|
||||
"codeception/c3": "2.*",
|
||||
"codeception/codeception": "2.*",
|
||||
"phpspec/phpspec": "~2.1",
|
||||
"phpspec/phpspec": "~6.1",
|
||||
"phpunit/phpunit": "~5.7"
|
||||
},
|
||||
"autoload": {
|
||||
|
|
@ -157,7 +160,10 @@
|
|||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"optimize-autoloader": true
|
||||
"optimize-autoloader": true,
|
||||
"allow-plugins": {
|
||||
"codeception/c3": true
|
||||
}
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
|
|
@ -174,11 +180,11 @@
|
|||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/hillelcoren/datatable"
|
||||
"url": "https://github.com/turbo124/chumper-datatable"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/hillelcoren/php-phantomjs"
|
||||
"url": "https://github.com/turbo124/php-phantomjs"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
|
|
@ -187,6 +193,22 @@
|
|||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/hillelcoren/omnipay-authorizenet"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/turbo124/omnipay-common"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/turbo124/laravel-push-notification"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/turbo124/NotificationPusher"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/turbo124/Laravel-Excel"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
7828
composer.lock
generated
7828
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -88,21 +88,6 @@ return [
|
|||
|
||||
'cipher' => env('APP_CIPHER', 'AES-256-CBC'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Logging Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log settings for your application. Out of
|
||||
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||
| you a variety of powerful log handlers / formatters to utilize.
|
||||
|
|
||||
| Available Settings: "single", "daily", "syslog", "errorlog"
|
||||
|
|
||||
*/
|
||||
|
||||
'log' => env('LOG', 'single'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Autoloaded Service Providers
|
||||
|
|
@ -155,11 +140,10 @@ return [
|
|||
'Laravel\Socialite\SocialiteServiceProvider',
|
||||
'Jlapp\Swaggervel\SwaggervelServiceProvider',
|
||||
'Maatwebsite\Excel\ExcelServiceProvider',
|
||||
Websight\GcsProvider\CloudStorageServiceProvider::class,
|
||||
'Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider',
|
||||
Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider::class,
|
||||
Codedge\Updater\UpdaterServiceProvider::class,
|
||||
Nwidart\Modules\LaravelModulesServiceProvider::class,
|
||||
Barryvdh\Cors\ServiceProvider::class,
|
||||
Fruitcake\Cors\CorsServiceProvider::class,
|
||||
PragmaRX\Google2FALaravel\ServiceProvider::class,
|
||||
'Chumper\Datatable\DatatableServiceProvider',
|
||||
Laravel\Tinker\TinkerServiceProvider::class,
|
||||
|
|
@ -175,7 +159,6 @@ return [
|
|||
'App\Providers\RouteServiceProvider',
|
||||
|
||||
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
|
||||
'Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider',
|
||||
|
||||
],
|
||||
|
||||
|
|
@ -262,8 +245,7 @@ return [
|
|||
'Rocketeer' => 'Rocketeer\Facades\Rocketeer',
|
||||
'Socialite' => 'Laravel\Socialite\Facades\Socialite',
|
||||
'Excel' => 'Maatwebsite\Excel\Facades\Excel',
|
||||
'PushNotification' => 'Davibennun\LaravelPushNotification\Facades\PushNotification',
|
||||
'Crawler' => 'Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect',
|
||||
'Crawler' => Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect::class,
|
||||
'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade',
|
||||
'Updater' => Codedge\Updater\UpdaterFacade::class,
|
||||
'Module' => Nwidart\Modules\Facades\Module::class,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue