mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Ensure setting has always a value
This commit is contained in:
parent
3fe09ae2bd
commit
9a286f65e6
@ -60,7 +60,8 @@ class CreateEDocument implements ShouldQueue
|
|||||||
/* Set customized translations _NOW_ */
|
/* Set customized translations _NOW_ */
|
||||||
$t->replace(Ninja::transformTranslations($this->document->client->getMergedSettings()));
|
$t->replace(Ninja::transformTranslations($this->document->client->getMergedSettings()));
|
||||||
|
|
||||||
$e_document_type = $this->document->client->getSetting('e_invoice_type');
|
$e_document_type = $settings_entity->getSetting('e_invoice_type') ? $settings_entity->getSetting('e_invoice_type') : "XInvoice_3_0";
|
||||||
|
$e_quote_type = $settings_entity->getSetting('e_quote_type') ? $settings_entity->getSetting('e_quote_type') : "OrderX_Extended";
|
||||||
if ($this->document instanceof Invoice){
|
if ($this->document instanceof Invoice){
|
||||||
switch ($e_document_type) {
|
switch ($e_document_type) {
|
||||||
case "EN16931":
|
case "EN16931":
|
||||||
@ -89,7 +90,7 @@ class CreateEDocument implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($this->document instanceof Quote){
|
elseif ($this->document instanceof Quote){
|
||||||
switch ($e_document_type){
|
switch ($e_quote_type){
|
||||||
case "OrderX_Basic":
|
case "OrderX_Basic":
|
||||||
case "OrderX_Comfort":
|
case "OrderX_Comfort":
|
||||||
case "OrderX_Extended":
|
case "OrderX_Extended":
|
||||||
@ -101,7 +102,7 @@ class CreateEDocument implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($this->document instanceof PurchaseOrder){
|
elseif ($this->document instanceof PurchaseOrder){
|
||||||
switch ($e_document_type){
|
switch ($e_quote_type){
|
||||||
case "OrderX_Basic":
|
case "OrderX_Basic":
|
||||||
case "OrderX_Comfort":
|
case "OrderX_Comfort":
|
||||||
case "OrderX_Extended":
|
case "OrderX_Extended":
|
||||||
|
@ -35,7 +35,7 @@ class OrderXDocument extends AbstractService
|
|||||||
|
|
||||||
$company = $this->document->company;
|
$company = $this->document->company;
|
||||||
$settings_entity = ($this->document Instanceof PurchaseOrder) ? $this->document->vendor : $this->document->client;
|
$settings_entity = ($this->document Instanceof PurchaseOrder) ? $this->document->vendor : $this->document->client;
|
||||||
$profile = $settings_entity->getSetting('e_quote_type');
|
$profile = $settings_entity->getSetting('e_quote_type') ? $settings_entity->getSetting('e_quote_type') : "OrderX_Extended";
|
||||||
|
|
||||||
$profile = match ($profile) {
|
$profile = match ($profile) {
|
||||||
"OrderX_Basic" => OrderProfiles::PROFILE_BASIC,
|
"OrderX_Basic" => OrderProfiles::PROFILE_BASIC,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user