mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 11:50:57 -04:00
Merge branch 'v5-develop' into v5-stable
This commit is contained in:
commit
5a6bf2cae3
@ -28,15 +28,6 @@ REDIS_HOST=127.0.0.1
|
|||||||
REDIS_PASSWORD=null
|
REDIS_PASSWORD=null
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
|
|
||||||
MAIL_MAILER=smtp
|
|
||||||
MAIL_HOST=smtp.mailtrap.io
|
|
||||||
MAIL_PORT=2525
|
|
||||||
MAIL_USERNAME=null
|
|
||||||
MAIL_PASSWORD=null
|
|
||||||
MAIL_ENCRYPTION=null
|
|
||||||
MAIL_FROM_ADDRESS="user@example.com"
|
|
||||||
MAIL_FROM_NAME="Self Hosted User"
|
|
||||||
|
|
||||||
POSTMARK_API_TOKEN=
|
POSTMARK_API_TOKEN=
|
||||||
REQUIRE_HTTPS=false
|
REQUIRE_HTTPS=false
|
||||||
|
|
||||||
|
9
.github/workflows/phpunit.yml
vendored
9
.github/workflows/phpunit.yml
vendored
@ -13,8 +13,8 @@ jobs:
|
|||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: ['ubuntu-20.04', 'ubuntu-22.04']
|
operating-system: ['ubuntu-22.04','ubuntu-24.04']
|
||||||
php-versions: ['8.1','8.2']
|
php-versions: ['8.2']
|
||||||
phpunit-versions: ['latest']
|
phpunit-versions: ['latest']
|
||||||
ci_node_total: [ 8 ]
|
ci_node_total: [ 8 ]
|
||||||
ci_node_index: [ 0, 1, 2, 3, 4, 5, 6, 7]
|
ci_node_index: [ 0, 1, 2, 3, 4, 5, 6, 7]
|
||||||
@ -95,14 +95,15 @@ jobs:
|
|||||||
- name: Get Composer Cache Directory
|
- name: Get Composer Cache Directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-${{ matrix.php }}-composer-
|
${{ runner.os }}-${{ matrix.php }}-composer-
|
||||||
|
|
||||||
|
|
||||||
- name: Install composer dependencies
|
- name: Install composer dependencies
|
||||||
run: |
|
run: |
|
||||||
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
|
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
5
.github/workflows/react_release.yml
vendored
5
.github/workflows/react_release.yml
vendored
@ -38,8 +38,6 @@ jobs:
|
|||||||
sudo php artisan cache:clear
|
sudo php artisan cache:clear
|
||||||
sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
|
sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
|
||||||
sudo find ./ -type d -exec chmod 755 {} \;
|
sudo find ./ -type d -exec chmod 755 {} \;
|
||||||
sudo rm -f public/main.*
|
|
||||||
sudo rm -f public/flutter*
|
|
||||||
|
|
||||||
- name: Prepare React FrontEnd
|
- name: Prepare React FrontEnd
|
||||||
run: |
|
run: |
|
||||||
@ -49,6 +47,7 @@ jobs:
|
|||||||
npm i
|
npm i
|
||||||
npm run build
|
npm run build
|
||||||
cp -r dist/* ../public/
|
cp -r dist/* ../public/
|
||||||
|
cp dist/index.html ../resources/views/react/index.blade.php
|
||||||
|
|
||||||
- name: Prepare JS/CSS assets
|
- name: Prepare JS/CSS assets
|
||||||
run: |
|
run: |
|
||||||
@ -65,7 +64,7 @@ jobs:
|
|||||||
- name: Build project
|
- name: Build project
|
||||||
run: |
|
run: |
|
||||||
shopt -s dotglob
|
shopt -s dotglob
|
||||||
tar --exclude='public/storage' --exclude='.htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/react-invoiceninja.tar *
|
tar --exclude='public/storage' --exclude='./htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/react-invoiceninja.tar *
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@ -50,6 +50,7 @@ jobs:
|
|||||||
mkdir -p ../public/react/${{ github.event.release.tag_name }}/
|
mkdir -p ../public/react/${{ github.event.release.tag_name }}/
|
||||||
cp -r dist/react/* ../public/react/${{ github.event.release.tag_name }}/
|
cp -r dist/react/* ../public/react/${{ github.event.release.tag_name }}/
|
||||||
cp -r dist/react/* ../public/react/
|
cp -r dist/react/* ../public/react/
|
||||||
|
cp dist/index.html ../resources/views/react/index.blade.php
|
||||||
|
|
||||||
mkdir -p ../public/tinymce_6.4.2/tinymce/js/
|
mkdir -p ../public/tinymce_6.4.2/tinymce/js/
|
||||||
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
|
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
|
||||||
@ -73,7 +74,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
zip -r /home/runner/work/invoiceninja/invoiceninja.zip .* -x "../*"
|
zip -r /home/runner/work/invoiceninja/invoiceninja.zip .* -x "../*"
|
||||||
shopt -s dotglob
|
shopt -s dotglob
|
||||||
tar --exclude='public/storage' --exclude='.htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/invoiceninja.tar *
|
tar --exclude='public/storage' --exclude='./htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/invoiceninja.tar *
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -40,3 +40,4 @@ _ide_helper_models.php
|
|||||||
_ide_helper.php
|
_ide_helper.php
|
||||||
/composer.phar
|
/composer.phar
|
||||||
.tx/
|
.tx/
|
||||||
|
.phpunit.cache
|
@ -1 +1 @@
|
|||||||
5.8.30
|
5.9.0
|
@ -13,5 +13,10 @@ namespace Illuminate\Contracts\Mail
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function brevo_config(string $key)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -169,26 +169,21 @@ class CheckData extends Command
|
|||||||
|
|
||||||
private function checkCompanyTokens()
|
private function checkCompanyTokens()
|
||||||
{
|
{
|
||||||
// CompanyUser::whereDoesntHave('token', function ($query){
|
|
||||||
// return $query->where('is_system', 1);
|
|
||||||
// })->cursor()->each(function ($cu){
|
|
||||||
// if ($cu->user) {
|
|
||||||
// $this->logMessage("Creating missing company token for user # {$cu->user->id} for company id # {$cu->company->id}");
|
|
||||||
// (new CreateCompanyToken($cu->company, $cu->user, 'System'))->handle();
|
|
||||||
// } else {
|
|
||||||
// $this->logMessage("Dangling User ID # {$cu->id}");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
CompanyUser::query()->cursor()->each(function ($cu) {
|
CompanyUser::query()->cursor()->each(function ($cu) {
|
||||||
|
|
||||||
if (CompanyToken::where('user_id', $cu->user_id)->where('company_id', $cu->company_id)->where('is_system', 1)->doesntExist()) {
|
if (CompanyToken::where('user_id', $cu->user_id)->where('company_id', $cu->company_id)->where('is_system', 1)->doesntExist()) {
|
||||||
$this->logMessage("Creating missing company token for user # {$cu->user_id} for company id # {$cu->company_id}");
|
|
||||||
|
|
||||||
if ($cu->company && $cu->user) {
|
if ($cu->company && $cu->user) {
|
||||||
|
$this->logMessage("Creating missing company token for user # {$cu->user_id} for company id # {$cu->company_id}");
|
||||||
(new CreateCompanyToken($cu->company, $cu->user, 'System'))->handle();
|
(new CreateCompanyToken($cu->company, $cu->user, 'System'))->handle();
|
||||||
} else {
|
|
||||||
// $cu->forceDelete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$cu->user) {
|
||||||
|
$this->logMessage("No user found for company user - removing company user");
|
||||||
|
$cu->forceDelete();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -213,7 +208,7 @@ class CheckData extends Command
|
|||||||
->cursor()
|
->cursor()
|
||||||
->each(function ($client) {
|
->each(function ($client) {
|
||||||
if ($client->recurring_invoices()->where('is_deleted', 0)->where('deleted_at', null)->count() > 1) {
|
if ($client->recurring_invoices()->where('is_deleted', 0)->where('deleted_at', null)->count() > 1) {
|
||||||
$this->logMessage("Duplicate Recurring Invoice => {$client->custom_value1}");
|
$this->logMessage("Duplicate Recurring Invoice => {$client->custom_value1} || {$client->id}}");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -482,6 +477,14 @@ class CheckData extends Command
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->logMessage("No contact present, so cannot add invitation for {$entity_key} - {$entity->id}");
|
$this->logMessage("No contact present, so cannot add invitation for {$entity_key} - {$entity->id}");
|
||||||
|
|
||||||
|
try{
|
||||||
|
$entity->service()->createInvitations()->save();
|
||||||
|
}
|
||||||
|
catch(\Exception $e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -884,14 +887,14 @@ class CheckData extends Command
|
|||||||
public function checkClientSettings()
|
public function checkClientSettings()
|
||||||
{
|
{
|
||||||
if ($this->option('fix') == 'true') {
|
if ($this->option('fix') == 'true') {
|
||||||
Client::query()->whereNull('country_id')->cursor()->each(function ($client) {
|
Client::query()->whereNull('country_id')->orWhere('country_id', 0)->cursor()->each(function ($client) {
|
||||||
$client->country_id = $client->company->settings->country_id;
|
$client->country_id = $client->company->settings->country_id;
|
||||||
$client->saveQuietly();
|
$client->saveQuietly();
|
||||||
|
|
||||||
$this->logMessage("Fixing country for # {$client->id}");
|
$this->logMessage("Fixing country for # {$client->id}");
|
||||||
});
|
});
|
||||||
|
|
||||||
Client::query()->whereNull("settings->currency_id")->cursor()->each(function ($client) {
|
Client::query()->whereNull("settings->currency_id")->orWhereJsonContains('settings', ['currency_id' => ''])->cursor()->each(function ($client) {
|
||||||
$settings = $client->settings;
|
$settings = $client->settings;
|
||||||
$settings->currency_id = (string)$client->company->settings->currency_id;
|
$settings->currency_id = (string)$client->company->settings->currency_id;
|
||||||
$client->settings = $settings;
|
$client->settings = $settings;
|
||||||
@ -933,7 +936,6 @@ class CheckData extends Command
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Invoice::withTrashed()
|
Invoice::withTrashed()
|
||||||
->where("partial", 0)
|
->where("partial", 0)
|
||||||
->whereNotNull("partial_due_date")
|
->whereNotNull("partial_due_date")
|
||||||
@ -947,7 +949,42 @@ class CheckData extends Command
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Company::whereDoesntHave('company_users', function ($query){
|
||||||
|
$query->where('is_owner', 1);
|
||||||
|
})
|
||||||
|
->cursor()
|
||||||
|
->when(Ninja::isHosted())
|
||||||
|
->each(function ($c){
|
||||||
|
|
||||||
|
$this->logMessage("Orphan Account # {$c->account_id}");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
CompanyUser::whereDoesntHave('tokens')
|
||||||
|
->cursor()
|
||||||
|
->when(Ninja::isHosted())
|
||||||
|
->each(function ($cu){
|
||||||
|
|
||||||
|
$this->logMessage("Missing tokens for Company User # {$cu->id}");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
CompanyUser::whereDoesntHave('user')
|
||||||
|
->cursor()
|
||||||
|
->when(Ninja::isHosted())
|
||||||
|
->each(function ($cu) {
|
||||||
|
|
||||||
|
$this->logMessage("Missing user for Company User # {$cu->id}");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$cus = CompanyUser::withTrashed()
|
||||||
|
->whereHas("user", function ($query) {
|
||||||
|
$query->whereColumn("users.account_id", "!=", "company_user.account_id");
|
||||||
|
})->pluck('id')->implode(",");
|
||||||
|
|
||||||
|
|
||||||
|
$this->logMessage("Cross Linked CompanyUser ids # {$cus}");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,60 +4,61 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\DataMapper\ClientRegistrationFields;
|
use stdClass;
|
||||||
use App\DataMapper\CompanySettings;
|
use Carbon\Carbon;
|
||||||
use App\DataMapper\FeesAndLimits;
|
use Faker\Factory;
|
||||||
use App\Events\Invoice\InvoiceWasCreated;
|
use App\Models\Task;
|
||||||
use App\Events\RecurringInvoice\RecurringInvoiceWasCreated;
|
use App\Models\User;
|
||||||
use App\Factory\GroupSettingFactory;
|
use App\Utils\Ninja;
|
||||||
use App\Factory\InvoiceFactory;
|
use App\Models\Quote;
|
||||||
use App\Factory\InvoiceItemFactory;
|
|
||||||
use App\Factory\RecurringInvoiceFactory;
|
|
||||||
use App\Factory\SubscriptionFactory;
|
|
||||||
use App\Helpers\Invoice\InvoiceSum;
|
|
||||||
use App\Jobs\Company\CreateCompanyTaskStatuses;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\BankIntegration;
|
|
||||||
use App\Models\BankTransaction;
|
|
||||||
use App\Models\BankTransactionRule;
|
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\ClientContact;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Models\CompanyGateway;
|
|
||||||
use App\Models\CompanyToken;
|
|
||||||
use App\Models\Country;
|
|
||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
|
use App\Models\Vendor;
|
||||||
|
use App\Models\Account;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Models\Country;
|
||||||
use App\Models\Expense;
|
use App\Models\Expense;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\RecurringInvoice;
|
|
||||||
use App\Models\Task;
|
|
||||||
use App\Models\TaskStatus;
|
|
||||||
use App\Models\TaxRate;
|
use App\Models\TaxRate;
|
||||||
use App\Models\User;
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\Vendor;
|
use App\Models\TaskStatus;
|
||||||
|
use App\Models\CompanyToken;
|
||||||
|
use App\Models\ClientContact;
|
||||||
use App\Models\VendorContact;
|
use App\Models\VendorContact;
|
||||||
use App\Repositories\InvoiceRepository;
|
use App\Models\CompanyGateway;
|
||||||
use App\Utils\Ninja;
|
use App\Factory\InvoiceFactory;
|
||||||
use App\Utils\Traits\GeneratesCounter;
|
use App\Models\BankIntegration;
|
||||||
|
use App\Models\BankTransaction;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Carbon\Carbon;
|
|
||||||
use Faker\Factory;
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use App\Models\RecurringInvoice;
|
||||||
|
use App\DataMapper\FeesAndLimits;
|
||||||
|
use App\DataMapper\ClientSettings;
|
||||||
|
use App\DataMapper\CompanySettings;
|
||||||
|
use App\Factory\InvoiceItemFactory;
|
||||||
|
use App\Helpers\Invoice\InvoiceSum;
|
||||||
|
use App\Models\BankTransactionRule;
|
||||||
|
use App\Factory\GroupSettingFactory;
|
||||||
|
use App\Factory\SubscriptionFactory;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use stdClass;
|
use App\Repositories\InvoiceRepository;
|
||||||
|
use App\Factory\RecurringInvoiceFactory;
|
||||||
|
use App\Events\Invoice\InvoiceWasCreated;
|
||||||
|
use App\DataMapper\ClientRegistrationFields;
|
||||||
|
use App\Jobs\Company\CreateCompanyTaskStatuses;
|
||||||
|
use App\Events\RecurringInvoice\RecurringInvoiceWasCreated;
|
||||||
|
|
||||||
class CreateSingleAccount extends Command
|
class CreateSingleAccount extends Command
|
||||||
{
|
{
|
||||||
@ -951,7 +952,7 @@ class CreateSingleAccount extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (config('ninja.testvars.paytrace.decrypted') && ($this->gateway == 'all' || $this->gateway == 'paytrace')) {
|
if (config('ninja.testvars.paytrace') && ($this->gateway == 'all' || $this->gateway == 'paytrace')) {
|
||||||
$cg = new CompanyGateway();
|
$cg = new CompanyGateway();
|
||||||
$cg->company_id = $company->id;
|
$cg->company_id = $company->id;
|
||||||
$cg->user_id = $user->id;
|
$cg->user_id = $user->id;
|
||||||
@ -960,7 +961,7 @@ class CreateSingleAccount extends Command
|
|||||||
$cg->require_billing_address = true;
|
$cg->require_billing_address = true;
|
||||||
$cg->require_shipping_address = true;
|
$cg->require_shipping_address = true;
|
||||||
$cg->update_details = true;
|
$cg->update_details = true;
|
||||||
$cg->config = encrypt(config('ninja.testvars.paytrace.decrypted'));
|
$cg->config = encrypt(config('ninja.testvars.paytrace'));
|
||||||
|
|
||||||
$cg->save();
|
$cg->save();
|
||||||
|
|
||||||
@ -1015,6 +1016,85 @@ class CreateSingleAccount extends Command
|
|||||||
$cg->fees_and_limits = $fees_and_limits;
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
$cg->save();
|
$cg->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config('ninja.testvars.eway') && ($this->gateway == 'all' || $this->gateway == 'eway')) {
|
||||||
|
$cg = new CompanyGateway();
|
||||||
|
$cg->company_id = $company->id;
|
||||||
|
$cg->user_id = $user->id;
|
||||||
|
$cg->gateway_key = '944c20175bbe6b9972c05bcfe294c2c7';
|
||||||
|
$cg->require_cvv = true;
|
||||||
|
$cg->require_billing_address = true;
|
||||||
|
$cg->require_shipping_address = true;
|
||||||
|
$cg->update_details = true;
|
||||||
|
$cg->config = encrypt(config('ninja.testvars.eway'));
|
||||||
|
$cg->save();
|
||||||
|
|
||||||
|
$gateway_types = $cg->driver()->gatewayTypes();
|
||||||
|
|
||||||
|
$fees_and_limits = new stdClass();
|
||||||
|
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
|
||||||
|
|
||||||
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
|
$cg->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (config('ninja.testvars.gocardless') && ($this->gateway == 'all' || $this->gateway == 'gocardless')) {
|
||||||
|
|
||||||
|
$c_settings = ClientSettings::defaults();
|
||||||
|
$c_settings->currency_id = '2';
|
||||||
|
|
||||||
|
$client = Client::factory()->create([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'company_id' => $company->id,
|
||||||
|
'name' => 'cypress',
|
||||||
|
'country_id' => 826,
|
||||||
|
'settings' => $c_settings
|
||||||
|
]);
|
||||||
|
|
||||||
|
$cg = new CompanyGateway();
|
||||||
|
$cg->company_id = $company->id;
|
||||||
|
$cg->user_id = $user->id;
|
||||||
|
$cg->gateway_key = 'b9886f9257f0c6ee7c302f1c74475f6c';
|
||||||
|
$cg->require_cvv = true;
|
||||||
|
$cg->require_billing_address = true;
|
||||||
|
$cg->require_shipping_address = true;
|
||||||
|
$cg->update_details = true;
|
||||||
|
$cg->config = encrypt(config('ninja.testvars.gocardless'));
|
||||||
|
$cg->save();
|
||||||
|
|
||||||
|
$gateway_types = $cg->driver($client)->gatewayTypes();
|
||||||
|
|
||||||
|
$fees_and_limits = new stdClass();
|
||||||
|
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
|
||||||
|
|
||||||
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
|
$cg->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config('ninja.testvars.forte') && ($this->gateway == 'all' || $this->gateway == 'forte')) {
|
||||||
|
$cg = new CompanyGateway();
|
||||||
|
$cg->company_id = $company->id;
|
||||||
|
$cg->user_id = $user->id;
|
||||||
|
$cg->gateway_key = 'kivcvjexxvdiyqtj3mju5d6yhpeht2xs';
|
||||||
|
$cg->require_cvv = true;
|
||||||
|
$cg->require_billing_address = true;
|
||||||
|
$cg->require_shipping_address = true;
|
||||||
|
$cg->update_details = true;
|
||||||
|
$cg->config = encrypt(config('ninja.testvars.forte'));
|
||||||
|
$cg->save();
|
||||||
|
|
||||||
|
$gateway_types = $cg->driver()->gatewayTypes();
|
||||||
|
|
||||||
|
$fees_and_limits = new stdClass();
|
||||||
|
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
|
||||||
|
|
||||||
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
|
$cg->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createRecurringInvoice(Client $client)
|
private function createRecurringInvoice(Client $client)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -110,7 +110,9 @@ class DemoMode extends Command
|
|||||||
|
|
||||||
$this->info('Creating Small Account and Company');
|
$this->info('Creating Small Account and Company');
|
||||||
|
|
||||||
$account = Account::factory()->create();
|
$account = Account::factory()->create([
|
||||||
|
"set_react_as_default_ap" => 0,
|
||||||
|
]);
|
||||||
$company = Company::factory()->create([
|
$company = Company::factory()->create([
|
||||||
'account_id' => $account->id,
|
'account_id' => $account->id,
|
||||||
'slack_webhook_url' => config('ninja.notification.slack'),
|
'slack_webhook_url' => config('ninja.notification.slack'),
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -68,7 +68,6 @@ class EncryptNinja extends Command
|
|||||||
$contents = Storage::disk('base')->get($file);
|
$contents = Storage::disk('base')->get($file);
|
||||||
$encrypted = encrypt($contents);
|
$encrypted = encrypt($contents);
|
||||||
Storage::disk('base')->put($file.".enc", $encrypted);
|
Storage::disk('base')->put($file.".enc", $encrypted);
|
||||||
// Storage::disk('base')->delete($file);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -20,7 +20,7 @@ class ReactBuilder extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'ninja:react';
|
protected $signature = 'ninja:react {--type=}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
@ -42,10 +42,14 @@ class ReactBuilder extends Command
|
|||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
if($this->option('type') == 'local') {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$includes = '';
|
$includes = '';
|
||||||
|
|
||||||
$directoryIterator = false;
|
$directoryIterator = false;
|
||||||
@ -72,5 +76,9 @@ class ReactBuilder extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
file_put_contents(resource_path('views/react/head.blade.php'), $includes);
|
file_put_contents(resource_path('views/react/head.blade.php'), $includes);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -52,6 +52,10 @@ class DbQuery extends GenericMixedMetric
|
|||||||
|
|
||||||
public $string_metric7 = 'ip_address';
|
public $string_metric7 = 'ip_address';
|
||||||
|
|
||||||
|
public $string_metric8 = 'client_version';
|
||||||
|
|
||||||
|
public $string_metric9 = 'platform';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The counter
|
* The counter
|
||||||
* set to 1.
|
* set to 1.
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -30,7 +30,7 @@ class RevenueTrack extends GenericMixedMetric
|
|||||||
* The name of the counter.
|
* The name of the counter.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $name = 'app.revenue';
|
public $name = 'app.cac';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The datetime of the counter measurement.
|
* The datetime of the counter measurement.
|
||||||
@ -59,14 +59,14 @@ class RevenueTrack extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $string_metric7 = 'product';
|
public $string_metric7 = 'plan';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gateway Reference
|
* Gateway Reference
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $string_metric8 = 'gateway_reference';
|
public $string_metric8 = 'plan_term';
|
||||||
|
|
||||||
public $string_metric9 = 'entity_reference';
|
public $string_metric9 = 'entity_reference';
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -229,7 +229,7 @@ class CompanySettings extends BaseSettings
|
|||||||
public $require_quote_signature = false; //@TODO ben to confirm
|
public $require_quote_signature = false; //@TODO ben to confirm
|
||||||
|
|
||||||
//email settings
|
//email settings
|
||||||
public $email_sending_method = 'default'; //enum 'default','gmail','office365' 'client_postmark', 'client_mailgun', 'mailgun' //@implemented
|
public $email_sending_method = 'default'; //enum 'default','gmail','office365' 'client_postmark', 'client_mailgun', 'mailgun', 'client_brevo' //@implemented
|
||||||
|
|
||||||
public $gmail_sending_user_id = '0'; //@implemented
|
public $gmail_sending_user_id = '0'; //@implemented
|
||||||
|
|
||||||
@ -451,6 +451,8 @@ class CompanySettings extends BaseSettings
|
|||||||
|
|
||||||
public $mailgun_endpoint = 'api.mailgun.net'; //api.eu.mailgun.net
|
public $mailgun_endpoint = 'api.mailgun.net'; //api.eu.mailgun.net
|
||||||
|
|
||||||
|
public $brevo_secret = '';
|
||||||
|
|
||||||
public $auto_bill_standard_invoices = false;
|
public $auto_bill_standard_invoices = false;
|
||||||
|
|
||||||
public $email_alignment = 'center'; // center , left, right
|
public $email_alignment = 'center'; // center , left, right
|
||||||
@ -477,6 +479,8 @@ class CompanySettings extends BaseSettings
|
|||||||
|
|
||||||
public $e_invoice_type = 'EN16931';
|
public $e_invoice_type = 'EN16931';
|
||||||
|
|
||||||
|
public $e_quote_type = 'OrderX_Comfort';
|
||||||
|
|
||||||
public $default_expense_payment_type_id = '0';
|
public $default_expense_payment_type_id = '0';
|
||||||
|
|
||||||
public $enable_e_invoice = false;
|
public $enable_e_invoice = false;
|
||||||
@ -497,7 +501,17 @@ class CompanySettings extends BaseSettings
|
|||||||
|
|
||||||
public $use_unapplied_payment = 'off'; //always, option, off //@implemented
|
public $use_unapplied_payment = 'off'; //always, option, off //@implemented
|
||||||
|
|
||||||
|
public $enable_rappen_rounding = false;
|
||||||
|
|
||||||
|
public bool $task_round_up = true;
|
||||||
|
|
||||||
|
public int $task_round_to_nearest = 1;
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
|
'task_round_up' => 'bool',
|
||||||
|
'task_round_to_nearest' => 'int',
|
||||||
|
'e_quote_type' => 'string',
|
||||||
|
'enable_rappen_rounding' => 'bool',
|
||||||
'use_unapplied_payment' => 'string',
|
'use_unapplied_payment' => 'string',
|
||||||
'show_pdfhtml_on_mobile' => 'bool',
|
'show_pdfhtml_on_mobile' => 'bool',
|
||||||
'payment_email_all_contacts' => 'bool',
|
'payment_email_all_contacts' => 'bool',
|
||||||
@ -505,7 +519,6 @@ class CompanySettings extends BaseSettings
|
|||||||
'delivery_note_design_id' => 'string',
|
'delivery_note_design_id' => 'string',
|
||||||
'payment_receipt_design_id' => 'string',
|
'payment_receipt_design_id' => 'string',
|
||||||
'payment_refund_design_id' => 'string',
|
'payment_refund_design_id' => 'string',
|
||||||
'classification' => 'string',
|
|
||||||
'enable_e_invoice' => 'bool',
|
'enable_e_invoice' => 'bool',
|
||||||
'classification' => 'string',
|
'classification' => 'string',
|
||||||
'default_expense_payment_type_id' => 'string',
|
'default_expense_payment_type_id' => 'string',
|
||||||
@ -527,6 +540,7 @@ class CompanySettings extends BaseSettings
|
|||||||
'postmark_secret' => 'string',
|
'postmark_secret' => 'string',
|
||||||
'mailgun_secret' => 'string',
|
'mailgun_secret' => 'string',
|
||||||
'mailgun_domain' => 'string',
|
'mailgun_domain' => 'string',
|
||||||
|
'brevo_secret' => 'string',
|
||||||
'send_email_on_mark_paid' => 'bool',
|
'send_email_on_mark_paid' => 'bool',
|
||||||
'vendor_portal_enable_uploads' => 'bool',
|
'vendor_portal_enable_uploads' => 'bool',
|
||||||
'besr_id' => 'string',
|
'besr_id' => 'string',
|
||||||
@ -848,7 +862,7 @@ class CompanySettings extends BaseSettings
|
|||||||
$company_settings = (object) get_class_vars(self::class);
|
$company_settings = (object) get_class_vars(self::class);
|
||||||
|
|
||||||
foreach ($company_settings as $key => $value) {
|
foreach ($company_settings as $key => $value) {
|
||||||
if (! property_exists($settings, $key)) {
|
if (!property_exists($settings, $key)) {
|
||||||
$settings->{$key} = self::castAttribute($key, $company_settings->{$key});
|
$settings->{$key} = self::castAttribute($key, $company_settings->{$key});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -881,7 +895,7 @@ class CompanySettings extends BaseSettings
|
|||||||
{
|
{
|
||||||
$notification = new stdClass();
|
$notification = new stdClass();
|
||||||
$notification->email = [];
|
$notification->email = [];
|
||||||
$notification->email = ['invoice_sent_all','payment_success_all','payment_manual_all'];
|
$notification->email = ['invoice_sent_all', 'payment_success_all', 'payment_manual_all'];
|
||||||
|
|
||||||
return $notification;
|
return $notification;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -65,6 +65,8 @@ class InvoiceItem
|
|||||||
|
|
||||||
public $expense_id = '';
|
public $expense_id = '';
|
||||||
|
|
||||||
|
public $unit_code = 'C62';
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
'task_id' => 'string',
|
'task_id' => 'string',
|
||||||
'expense_id' => 'string',
|
'expense_id' => 'string',
|
||||||
@ -92,5 +94,6 @@ class InvoiceItem
|
|||||||
'custom_value2' => 'string',
|
'custom_value2' => 'string',
|
||||||
'custom_value3' => 'string',
|
'custom_value3' => 'string',
|
||||||
'custom_value4' => 'string',
|
'custom_value4' => 'string',
|
||||||
|
'unit_code' => 'string',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -213,7 +213,7 @@ class SettingsData
|
|||||||
|
|
||||||
public bool $show_accept_quote_terms = false; //@TODO ben to confirm
|
public bool $show_accept_quote_terms = false; //@TODO ben to confirm
|
||||||
|
|
||||||
public string $email_sending_method = 'default'; // enum 'default', 'gmail', 'office365', 'client_postmark', 'client_mailgun' //@implemented
|
public string $email_sending_method = 'default'; // enum 'default', 'gmail', 'office365', 'client_postmark', 'client_mailgun' , 'client_brevo' //@implemented
|
||||||
|
|
||||||
public string $gmail_sending_user_id = '0'; //@implemented
|
public string $gmail_sending_user_id = '0'; //@implemented
|
||||||
|
|
||||||
@ -433,6 +433,8 @@ class SettingsData
|
|||||||
|
|
||||||
public string $mailgun_endpoint = 'api.mailgun.net'; // api.eu.mailgun.net
|
public string $mailgun_endpoint = 'api.mailgun.net'; // api.eu.mailgun.net
|
||||||
|
|
||||||
|
public string $brevo_secret = '';
|
||||||
|
|
||||||
public bool $auto_bill_standard_invoices = false;
|
public bool $auto_bill_standard_invoices = false;
|
||||||
|
|
||||||
public string $email_alignment = 'center'; // center, left, right
|
public string $email_alignment = 'center'; // center, left, right
|
||||||
@ -469,8 +471,8 @@ class SettingsData
|
|||||||
|
|
||||||
public function cast(mixed $object)
|
public function cast(mixed $object)
|
||||||
{
|
{
|
||||||
if(is_array($object)) {
|
if (is_array($object)) {
|
||||||
$object = (object)$object;
|
$object = (object) $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($object)) {
|
if (is_object($object)) {
|
||||||
@ -478,9 +480,9 @@ class SettingsData
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
settype($object->{$key}, gettype($this->{$key}));
|
settype($object->{$key}, gettype($this->{$key}));
|
||||||
} catch(\Exception | \Error | \Throwable $e) {
|
} catch (\Exception | \Error | \Throwable $e) {
|
||||||
|
|
||||||
if(property_exists($this, $key)) {
|
if (property_exists($this, $key)) {
|
||||||
$object->{$key} = $this->{$key};
|
$object->{$key} = $this->{$key};
|
||||||
} else {
|
} else {
|
||||||
unset($object->{$key});
|
unset($object->{$key});
|
||||||
@ -506,11 +508,11 @@ class SettingsData
|
|||||||
|
|
||||||
public function toObject(): object
|
public function toObject(): object
|
||||||
{
|
{
|
||||||
return (object)$this->object;
|
return (object) $this->object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
return (array)$this->object;
|
return (array) $this->object;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
278
app/DataMapper/Sources/PayPalBalanceAffecting.php
Normal file
278
app/DataMapper/Sources/PayPalBalanceAffecting.php
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\DataMapper\Sources;
|
||||||
|
|
||||||
|
use App\DataMapper\InvoiceItem;
|
||||||
|
|
||||||
|
class PayPalBalanceAffecting
|
||||||
|
{
|
||||||
|
|
||||||
|
private array $key_map = [
|
||||||
|
'Date' => 'date',
|
||||||
|
'Time' => 'time',
|
||||||
|
'TimeZone' => 'timezone',
|
||||||
|
'Name' => 'name',
|
||||||
|
'Type' => 'type',
|
||||||
|
'Status' => 'status',
|
||||||
|
'Currency' => 'currency',
|
||||||
|
'Gross' => 'gross',
|
||||||
|
'Fee' => 'fee',
|
||||||
|
'Net' => 'net',
|
||||||
|
'From Email Address' => 'fromEmailAddress',
|
||||||
|
'To Email Address' => 'toEmailAddress',
|
||||||
|
'Transaction ID' => 'transactionId',
|
||||||
|
'Shipping Address' => 'shippingAddress',
|
||||||
|
'Item Title' => 'itemTitle',
|
||||||
|
'Item ID' => 'itemId',
|
||||||
|
'Option 1 Name' => 'option1Name',
|
||||||
|
'Option 1 Value' => 'option1Value',
|
||||||
|
'Option 2 Name' => 'option2Name',
|
||||||
|
'Option 2 Value' => 'option2Value',
|
||||||
|
'Reference Txn ID' => 'referenceTxId',
|
||||||
|
'Invoice Number' => 'invoiceNumber',
|
||||||
|
'Custom Number' => 'customNumber',
|
||||||
|
'Quantity' => 'quantity',
|
||||||
|
'Receipt ID' => 'receiptId',
|
||||||
|
'Address Line 1' => 'addressLine1',
|
||||||
|
'Address Line 2/District/Neighborhood' => 'addressLine2DistrictNeighborhood',
|
||||||
|
'Town/City' => 'townCity',
|
||||||
|
'State/Province/Region/County/Territory/Prefecture/Republic' => 'stateProvinceRegionCountyTerritoryPrefectureRepublic',
|
||||||
|
'Zip/Postal Code' => 'zipPostalCode',
|
||||||
|
'Country' => 'country',
|
||||||
|
'Contact Phone Number' => 'contactPhoneNumber',
|
||||||
|
'Subject' => 'subject',
|
||||||
|
'Note' => 'note',
|
||||||
|
'Transaction Event Code' => 'transactionEventCode',
|
||||||
|
'Payment Tracking ID' => 'paymentTrackingId',
|
||||||
|
'Item Details' => 'itemDetails',
|
||||||
|
'Authorization Review Status' => 'authorizationReviewStatus',
|
||||||
|
'Country Code' => 'countryCode',
|
||||||
|
'Tip' => 'tip',
|
||||||
|
'Discount' => 'discount',
|
||||||
|
'Credit Transactional Fee' => 'creditTransactionalFee',
|
||||||
|
'Original Invoice ID' => 'originalInvoiceId',
|
||||||
|
];
|
||||||
|
|
||||||
|
public $date;
|
||||||
|
public $time;
|
||||||
|
public $timezone;
|
||||||
|
public $name;
|
||||||
|
public $type;
|
||||||
|
public $status;
|
||||||
|
public $currency;
|
||||||
|
public $gross;
|
||||||
|
public $fee;
|
||||||
|
public $net;
|
||||||
|
public $fromEmailAddress;
|
||||||
|
public $toEmailAddress;
|
||||||
|
public $transactionId;
|
||||||
|
public $shippingAddress;
|
||||||
|
public $itemTitle;
|
||||||
|
public $itemId;
|
||||||
|
public $option1Name;
|
||||||
|
public $option1Value;
|
||||||
|
public $option2Name;
|
||||||
|
public $option2Value;
|
||||||
|
public $referenceTxnId;
|
||||||
|
public $invoiceNumber;
|
||||||
|
public $customNumber;
|
||||||
|
public $quantity;
|
||||||
|
public $receiptId;
|
||||||
|
public $addressLine1;
|
||||||
|
public $addressLine2DistrictNeighborhood;
|
||||||
|
public $townCity;
|
||||||
|
public $stateProvinceRegionCountyTerritoryPrefectureRepublic;
|
||||||
|
public $zipPostalCode;
|
||||||
|
public $country;
|
||||||
|
public $contactPhoneNumber;
|
||||||
|
public $subject;
|
||||||
|
public $note;
|
||||||
|
public $transactionEventCode;
|
||||||
|
public $paymentTrackingId;
|
||||||
|
public $itemDetails;
|
||||||
|
public $authorizationReviewStatus;
|
||||||
|
public $countryCode;
|
||||||
|
public $tip;
|
||||||
|
public $discount;
|
||||||
|
public $creditTransactionalFee;
|
||||||
|
public $originalInvoiceId;
|
||||||
|
|
||||||
|
public function __construct(private array $import_row){}
|
||||||
|
|
||||||
|
public function run(): self
|
||||||
|
{
|
||||||
|
foreach($this->import_row as $key => $value) {
|
||||||
|
|
||||||
|
$prop = $this->key_map[$key] ?? false;
|
||||||
|
|
||||||
|
if($prop)
|
||||||
|
$this->{$prop} = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getClient(): array
|
||||||
|
{
|
||||||
|
$client = [
|
||||||
|
'name' => $this->name,
|
||||||
|
'contacts' => [$this->getContact()],
|
||||||
|
'email' => $this->fromEmailAddress,
|
||||||
|
];
|
||||||
|
|
||||||
|
$client = array_merge($client, $this->returnAddress());
|
||||||
|
$client = array_merge($client, $this->returnShippingAddress());
|
||||||
|
|
||||||
|
return $client;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getInvoice(): array
|
||||||
|
{
|
||||||
|
$item = new InvoiceItem;
|
||||||
|
$item->cost = $this->gross ?? 0;
|
||||||
|
$item->product_key = $this->itemId ?? '';
|
||||||
|
$item->notes = $this->subject ?? $this->itemDetails;
|
||||||
|
$item->quantity = 1;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'number' => trim($this->invoiceNumber ?? $this->transactionId),
|
||||||
|
'date' => str_replace('/','-', $this->date ?? ''),
|
||||||
|
'line_items' => [$item],
|
||||||
|
'name' => $this->name ?? '',
|
||||||
|
'email' => $this->fromEmailAddress ?? '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getContact(): array
|
||||||
|
{
|
||||||
|
$name_parts = explode(" ", $this->name ?? '');
|
||||||
|
|
||||||
|
if(count($name_parts) == 2)
|
||||||
|
{
|
||||||
|
$contact['first_name'] = $name_parts[0];
|
||||||
|
$contact['last_name'] = $name_parts[1];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$contact['first_name'] = $this->name ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$contact['email'] = $this->fromEmailAddress ?? '';
|
||||||
|
$contact['phone'] = $this->contactPhoneNumber ?? '';
|
||||||
|
|
||||||
|
return $contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function returnAddress(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'address1' => $this->addressLine1 ?? '',
|
||||||
|
'address2' => $this->addressLine2DistrictNeighborhood ?? '',
|
||||||
|
'city' => $this->townCity ?? '',
|
||||||
|
'state' => $this->stateProvinceRegionCountyTerritoryPrefectureRepublic ?? '',
|
||||||
|
'country_id' => $this->countryCode ?? '',
|
||||||
|
'postal_code' => $this->zipPostalCode ?? '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function returnShippingAddress(): array
|
||||||
|
{
|
||||||
|
if(strlen($this->shippingAddress ?? '') <3)
|
||||||
|
return [];
|
||||||
|
|
||||||
|
$ship_parts = explode(",", $this->shippingAddress);
|
||||||
|
|
||||||
|
if(count($ship_parts) != 7)
|
||||||
|
return [];
|
||||||
|
|
||||||
|
return [
|
||||||
|
'shipping_address1' => $ship_parts[2],
|
||||||
|
'shipping_address2' => '',
|
||||||
|
'shipping_city' => $ship_parts[3],
|
||||||
|
'shipping_state' => $ship_parts[4],
|
||||||
|
'shipping_postal_code' => $ship_parts[5],
|
||||||
|
'shipping_country_id' => $ship_parts[6],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getType(): string
|
||||||
|
{
|
||||||
|
return $this->type ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isInvoiceType(): bool
|
||||||
|
{
|
||||||
|
return $this->type == 'Website Payment';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// $csv = Reader::createFromString($csvFile);
|
||||||
|
// // $csvdelimiter = self::detectDelimiter($csvfile);
|
||||||
|
// $csv->setDelimiter(",");
|
||||||
|
// $stmt = new Statement();
|
||||||
|
// $data = iterator_to_array($stmt->process($csv));
|
||||||
|
|
||||||
|
// $header = $data[0];
|
||||||
|
// $arr = [];
|
||||||
|
|
||||||
|
// foreach($data as $key => $value) {
|
||||||
|
|
||||||
|
|
||||||
|
// if($key == 0) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $arr[] = array_combine($header, $value);
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $arr;
|
||||||
|
|
||||||
|
// $company = Company::find(3358);
|
||||||
|
// $owner = $company->owner();
|
||||||
|
// $client_repo = new ClientRepository(new ClientContactRepository());
|
||||||
|
// $invoice_repo = new InvoiceRepository();
|
||||||
|
|
||||||
|
// foreach($arr as $pp) {
|
||||||
|
|
||||||
|
// $p = new PayPalBalanceAffecting($pp);
|
||||||
|
// $p->run();
|
||||||
|
|
||||||
|
|
||||||
|
// if(!$p->isInvoiceType()) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $import_c = $p->getClient();
|
||||||
|
// $import_i = $p->getInvoice();
|
||||||
|
|
||||||
|
|
||||||
|
// $contact = ClientContact::where('company_id', 3358)->where('email', $import_c['email'])->first();
|
||||||
|
|
||||||
|
|
||||||
|
// if(!$contact) {
|
||||||
|
|
||||||
|
// $cc = ClientFactory::create($company->id, $owner->id);
|
||||||
|
|
||||||
|
// $client = $client_repo->save($import_c, $cc);
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
// $client = $contact->client;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $i = InvoiceFactory::create($company->id, $owner->id);
|
||||||
|
// $i->client_id = $client->id;
|
||||||
|
// $invoice_repo->save($import_i, $i);
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,18 +4,19 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\DataMapper\Tax;
|
namespace App\DataMapper\Tax;
|
||||||
|
|
||||||
use App\DataMapper\Tax\ZipTax\Response;
|
use App\Models\Quote;
|
||||||
use App\DataProviders\USStates;
|
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
|
use App\DataProviders\USStates;
|
||||||
|
use App\DataMapper\Tax\ZipTax\Response;
|
||||||
|
|
||||||
class BaseRule implements RuleInterface
|
class BaseRule implements RuleInterface
|
||||||
{
|
{
|
||||||
@ -168,7 +169,6 @@ class BaseRule implements RuleInterface
|
|||||||
/* We should only apply taxes for configured states */
|
/* We should only apply taxes for configured states */
|
||||||
if(!array_key_exists($this->client->country->iso_3166_2, $this->region_codes)) {
|
if(!array_key_exists($this->client->country->iso_3166_2, $this->region_codes)) {
|
||||||
nlog('Automatic tax calculations not supported for this country - defaulting to company country');
|
nlog('Automatic tax calculations not supported for this country - defaulting to company country');
|
||||||
nlog("With new logic, we should never see this");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Harvest the client_region */
|
/** Harvest the client_region */
|
||||||
@ -211,7 +211,7 @@ class BaseRule implements RuleInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Applies the tax data to the invoice */
|
/** Applies the tax data to the invoice */
|
||||||
if($this->invoice instanceof Invoice && $tax_data) {
|
if(($this->invoice instanceof Invoice || $this->invoice instanceof Quote) && $tax_data) {
|
||||||
|
|
||||||
$this->invoice->tax_data = $tax_data;
|
$this->invoice->tax_data = $tax_data;
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ class BaseRule implements RuleInterface
|
|||||||
return USStates::getState(strlen($this->client->postal_code) > 1 ? $this->client->postal_code : $this->client->shipping_postal_code);
|
return USStates::getState(strlen($this->client->postal_code) > 1 ? $this->client->postal_code : $this->client->shipping_postal_code);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->client->company->country()->iso_3166_2 == 'US' ? $this->client->company->tax_data->seller_subregion : 'CA';
|
return 'CA';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -235,17 +235,17 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
} elseif(in_array($this->client_subregion, $this->eu_country_codes) && !$this->client->vat_number) { //eu country / no valid vat
|
} elseif(in_array($this->client_subregion, $this->eu_country_codes) && !$this->client->vat_number) { //eu country / no valid vat
|
||||||
if(($this->client->company->tax_data->seller_subregion != $this->client_subregion) && $this->client->company->tax_data->regions->EU->has_sales_above_threshold) {
|
if(($this->client->company->tax_data->seller_subregion != $this->client_subregion) && $this->client->company->tax_data->regions->EU->has_sales_above_threshold) {
|
||||||
// nlog("eu zone with sales above threshold");
|
// nlog("eu zone with sales above threshold");
|
||||||
$this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->country->iso_3166_2}->tax_rate;
|
$this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->country->iso_3166_2}->tax_rate ?? 0;
|
||||||
$this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->country->iso_3166_2}->reduced_tax_rate;
|
$this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->country->iso_3166_2}->reduced_tax_rate ?? 0;
|
||||||
} else {
|
} else {
|
||||||
// nlog("EU with intra-community supply ie DE to DE");
|
// nlog("EU with intra-community supply ie DE to DE");
|
||||||
$this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate;
|
$this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate ?? 0;
|
||||||
$this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->reduced_tax_rate;
|
$this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->reduced_tax_rate ?? 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// nlog("default tax");
|
// nlog("default tax");
|
||||||
$this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate;
|
$this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate ?? 0;
|
||||||
$this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->reduced_tax_rate;
|
$this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->reduced_tax_rate ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user