mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 22:04:35 -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 $sync_invoice_quote_columns = true;
|
||||||
|
|
||||||
|
public $e_invoice_type = 'EN16931';
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
|
'e_invoice_type' => 'string',
|
||||||
'mailgun_endpoint' => 'string',
|
'mailgun_endpoint' => 'string',
|
||||||
'client_initiated_payments' => 'bool',
|
'client_initiated_payments' => 'bool',
|
||||||
'client_initiated_payments_minimum' => 'float',
|
'client_initiated_payments_minimum' => 'float',
|
||||||
|
@ -38,7 +38,7 @@ class CreateXInvoice implements ShouldQueue
|
|||||||
$company = $invoice->company;
|
$company = $invoice->company;
|
||||||
$client = $invoice->client;
|
$client = $invoice->client;
|
||||||
$profile = "";
|
$profile = "";
|
||||||
switch ($company->e_invoice_type) {
|
switch ($client->getSetting('e_invoice_type')) {
|
||||||
case "EN16931":
|
case "EN16931":
|
||||||
$profile = ZugferdProfiles::PROFILE_EN16931;
|
$profile = ZugferdProfiles::PROFILE_EN16931;
|
||||||
break;
|
break;
|
||||||
@ -63,6 +63,9 @@ class CreateXInvoice implements ShouldQueue
|
|||||||
case "XInvoice-Basic":
|
case "XInvoice-Basic":
|
||||||
$profile = ZugferdProfiles::PROFILE_BASIC;
|
$profile = ZugferdProfiles::PROFILE_BASIC;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
$profile = ZugferdProfiles::PROFILE_EN16931;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
$xrechnung = ZugferdDocumentBuilder::CreateNew($profile);
|
$xrechnung = ZugferdDocumentBuilder::CreateNew($profile);
|
||||||
|
@ -840,7 +840,6 @@ class Company extends BaseModel
|
|||||||
'matomo_url',
|
'matomo_url',
|
||||||
'matomo_id',
|
'matomo_id',
|
||||||
'enable_e_invoice',
|
'enable_e_invoice',
|
||||||
'e_invoice_type',
|
|
||||||
'client_can_register',
|
'client_can_register',
|
||||||
'enable_shop_api',
|
'enable_shop_api',
|
||||||
'invoice_task_timelog',
|
'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