mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Move e_invoice_type to settings object
This commit is contained in:
parent
735e2bb40a
commit
d06fa55f31
@ -475,7 +475,10 @@ class CompanySettings extends BaseSettings
|
||||
|
||||
public $sync_invoice_quote_columns = true;
|
||||
|
||||
public $e_invoice_type = 'EN16931';
|
||||
|
||||
public static $casts = [
|
||||
'e_invoice_type' => 'string',
|
||||
'mailgun_endpoint' => 'string',
|
||||
'client_initiated_payments' => 'bool',
|
||||
'client_initiated_payments_minimum' => 'float',
|
||||
|
@ -38,7 +38,7 @@ class CreateXInvoice implements ShouldQueue
|
||||
$company = $invoice->company;
|
||||
$client = $invoice->client;
|
||||
$profile = "";
|
||||
switch ($company->e_invoice_type) {
|
||||
switch ($client->getSetting('e_invoice_type')) {
|
||||
case "EN16931":
|
||||
$profile = ZugferdProfiles::PROFILE_EN16931;
|
||||
break;
|
||||
@ -63,6 +63,9 @@ class CreateXInvoice implements ShouldQueue
|
||||
case "XInvoice-Basic":
|
||||
$profile = ZugferdProfiles::PROFILE_BASIC;
|
||||
break;
|
||||
default:
|
||||
$profile = ZugferdProfiles::PROFILE_EN16931;
|
||||
break;
|
||||
|
||||
}
|
||||
$xrechnung = ZugferdDocumentBuilder::CreateNew($profile);
|
||||
|
@ -840,7 +840,6 @@ class Company extends BaseModel
|
||||
'matomo_url',
|
||||
'matomo_id',
|
||||
'enable_e_invoice',
|
||||
'e_invoice_type',
|
||||
'client_can_register',
|
||||
'enable_shop_api',
|
||||
'invoice_task_timelog',
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('companies', function (Blueprint $table) {
|
||||
$table->dropColumn('e_invoice_type');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user