mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:57:32 -05:00 
			
		
		
		
	
						commit
						02fe47c014
					
				@ -103,7 +103,7 @@ class Response
 | 
				
			|||||||
    public function __construct($data)
 | 
					    public function __construct($data)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if(!$data)
 | 
					        if(!$data)
 | 
				
			||||||
            return;
 | 
					            return $this;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach($data as $key => $value){
 | 
					        foreach($data as $key => $value){
 | 
				
			||||||
            $this->{$key} = $value;
 | 
					            $this->{$key} = $value;
 | 
				
			||||||
 | 
				
			|||||||
@ -11,12 +11,13 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace App\Factory;
 | 
					namespace App\Factory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use App\DataMapper\ClientRegistrationFields;
 | 
					 | 
				
			||||||
use App\DataMapper\CompanySettings;
 | 
					 | 
				
			||||||
use App\Libraries\MultiDB;
 | 
					 | 
				
			||||||
use App\Models\Company;
 | 
					 | 
				
			||||||
use App\Utils\Ninja;
 | 
					use App\Utils\Ninja;
 | 
				
			||||||
 | 
					use App\Models\Company;
 | 
				
			||||||
 | 
					use App\Libraries\MultiDB;
 | 
				
			||||||
use App\Utils\Traits\MakesHash;
 | 
					use App\Utils\Traits\MakesHash;
 | 
				
			||||||
 | 
					use App\DataMapper\Tax\TaxModel;
 | 
				
			||||||
 | 
					use App\DataMapper\CompanySettings;
 | 
				
			||||||
 | 
					use App\DataMapper\ClientRegistrationFields;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CompanyFactory
 | 
					class CompanyFactory
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -48,7 +49,8 @@ class CompanyFactory
 | 
				
			|||||||
        $company->default_password_timeout = 1800000;
 | 
					        $company->default_password_timeout = 1800000;
 | 
				
			||||||
        $company->markdown_email_enabled = true;
 | 
					        $company->markdown_email_enabled = true;
 | 
				
			||||||
        $company->markdown_enabled = false;
 | 
					        $company->markdown_enabled = false;
 | 
				
			||||||
 | 
					        $company->tax_data = new TaxModel();
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        return $company;
 | 
					        return $company;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -11,13 +11,14 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace App\Jobs\Company;
 | 
					namespace App\Jobs\Company;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use App\DataMapper\ClientRegistrationFields;
 | 
					 | 
				
			||||||
use App\DataMapper\CompanySettings;
 | 
					 | 
				
			||||||
use App\Libraries\MultiDB;
 | 
					 | 
				
			||||||
use App\Models\Company;
 | 
					 | 
				
			||||||
use App\Utils\Ninja;
 | 
					use App\Utils\Ninja;
 | 
				
			||||||
 | 
					use App\Models\Company;
 | 
				
			||||||
 | 
					use App\Libraries\MultiDB;
 | 
				
			||||||
use App\Utils\Traits\MakesHash;
 | 
					use App\Utils\Traits\MakesHash;
 | 
				
			||||||
 | 
					use App\DataMapper\Tax\TaxModel;
 | 
				
			||||||
 | 
					use App\DataMapper\CompanySettings;
 | 
				
			||||||
use Illuminate\Foundation\Bus\Dispatchable;
 | 
					use Illuminate\Foundation\Bus\Dispatchable;
 | 
				
			||||||
 | 
					use App\DataMapper\ClientRegistrationFields;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CreateCompany
 | 
					class CreateCompany
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -65,6 +66,7 @@ class CreateCompany
 | 
				
			|||||||
        $company->client_registration_fields = ClientRegistrationFields::generate();
 | 
					        $company->client_registration_fields = ClientRegistrationFields::generate();
 | 
				
			||||||
        $company->markdown_email_enabled = true;
 | 
					        $company->markdown_email_enabled = true;
 | 
				
			||||||
        $company->markdown_enabled = false;
 | 
					        $company->markdown_enabled = false;
 | 
				
			||||||
 | 
					        $company->tax_data = new TaxModel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (Ninja::isHosted()) {
 | 
					        if (Ninja::isHosted()) {
 | 
				
			||||||
            $company->subdomain = MultiDB::randomSubdomainGenerator();
 | 
					            $company->subdomain = MultiDB::randomSubdomainGenerator();
 | 
				
			||||||
 | 
				
			|||||||
@ -11,8 +11,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace Database\Factories;
 | 
					namespace Database\Factories;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use App\DataMapper\CompanySettings;
 | 
					 | 
				
			||||||
use App\Utils\Traits\MakesHash;
 | 
					use App\Utils\Traits\MakesHash;
 | 
				
			||||||
 | 
					use App\DataMapper\Tax\TaxModel;
 | 
				
			||||||
 | 
					use App\DataMapper\CompanySettings;
 | 
				
			||||||
use Illuminate\Database\Eloquent\Factories\Factory;
 | 
					use Illuminate\Database\Eloquent\Factories\Factory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CompanyFactory extends Factory
 | 
					class CompanyFactory extends Factory
 | 
				
			||||||
@ -38,6 +39,7 @@ class CompanyFactory extends Factory
 | 
				
			|||||||
            'custom_fields' => (object) [
 | 
					            'custom_fields' => (object) [
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            'company_key' => $this->createHash(),
 | 
					            'company_key' => $this->createHash(),
 | 
				
			||||||
 | 
					            'tax_data' => new TaxModel(),
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,9 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use App\Models\Company;
 | 
				
			||||||
use App\Models\Language;
 | 
					use App\Models\Language;
 | 
				
			||||||
 | 
					use App\DataMapper\Tax\TaxModel;
 | 
				
			||||||
 | 
					use Illuminate\Support\Facades\Schema;
 | 
				
			||||||
use Illuminate\Database\Schema\Blueprint;
 | 
					use Illuminate\Database\Schema\Blueprint;
 | 
				
			||||||
use Illuminate\Database\Migrations\Migration;
 | 
					use Illuminate\Database\Migrations\Migration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -26,7 +29,10 @@ return new class extends Migration
 | 
				
			|||||||
            $table->dropColumn('enable_e_invoice');
 | 
					            $table->dropColumn('enable_e_invoice');
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Company::query()->cursor()->each(function ($company){
 | 
				
			||||||
 | 
					            $company->tax_data = new TaxModel();
 | 
				
			||||||
 | 
					            $company->save();
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 | 
				
			|||||||
@ -183,7 +183,7 @@ class BankTransactionRuleTest extends TestCase
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if ($response) {
 | 
					        if ($response) {
 | 
				
			||||||
            $arr = $response->json();
 | 
					            $arr = $response->json();
 | 
				
			||||||
            nlog($arr);
 | 
					           
 | 
				
			||||||
            $response->assertStatus(200);
 | 
					            $response->assertStatus(200);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user