mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Update company tax data
This commit is contained in:
parent
214044675e
commit
ee7ab54b38
45
app/Jobs/Company/CompanyTaxRate.php
Normal file
45
app/Jobs/Company/CompanyTaxRate.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Jobs\Company;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Libraries\MultiDB;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use App\Services\Tax\Providers\TaxProvider;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
|
||||
class CompanyTaxRate implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param Company $company
|
||||
*/
|
||||
public function __construct(public Company $company)
|
||||
{
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
MultiDB::setDB($this->company->db);
|
||||
|
||||
$tp = new TaxProvider($this->company);
|
||||
$tp->updateCompanyTaxData();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -78,7 +78,7 @@ trait CompanySettingsSaver
|
||||
|
||||
$entity->settings = $company_settings;
|
||||
|
||||
if(Ninja::isHosted() && $company_settings->country_id == "840" && array_key_exists('settings', $entity->getDirty()))
|
||||
if(Ninja::isHosted() && $entity?->calc_taxes && $company_settings->country_id == "840" && array_key_exists('settings', $entity->getDirty()))
|
||||
{
|
||||
$old_settings = $entity->getOriginal()['settings'];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user