commit
d7ddbda9eb
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 8.2
|
php-version: 8.3
|
||||||
extensions: mysql, mysqlnd, sqlite3, bcmath, gd, curl, zip, openssl, mbstring, xml
|
extensions: mysql, mysqlnd, sqlite3, bcmath, gd, curl, zip, openssl, mbstring, xml
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
5.12.24
|
5.12.25
|
||||||
|
|
@ -96,10 +96,10 @@ class MapSettings extends AbstractService
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
||||||
}
|
}
|
||||||
private function handleLanguage(string $language_id): string
|
private function handleLanguage(?string $language_id): string
|
||||||
{
|
{
|
||||||
/** @var \App\Models\Language $language */
|
/** @var \App\Models\Language $language */
|
||||||
$language = app('languages')->firstWhere('id', $language_id);
|
$language = app('languages')->firstWhere('id', $language_id ?? '1');
|
||||||
return $language->name;
|
return $language->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ class ZugferdEDocument extends AbstractService
|
||||||
|
|
||||||
private ?string $exemption_reason_code = null;
|
private ?string $exemption_reason_code = null;
|
||||||
|
|
||||||
|
private ?string $temp_file_path = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __construct
|
* __construct
|
||||||
*
|
*
|
||||||
|
|
@ -90,7 +92,8 @@ class ZugferdEDocument extends AbstractService
|
||||||
->setPaymentTerms() // 3. Then payment terms
|
->setPaymentTerms() // 3. Then payment terms
|
||||||
->setLineItems() // 4. Then line items
|
->setLineItems() // 4. Then line items
|
||||||
->setCustomSurcharges() // 4a. Surcharges
|
->setCustomSurcharges() // 4a. Surcharges
|
||||||
->setDocumentSummation(); // 5. Finally document summation
|
->setDocumentSummation() // 5. Finally document summation
|
||||||
|
->setAdditionalReferencedDocument(); // 6. Additional referenced document
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
|
|
@ -125,6 +128,27 @@ class ZugferdEDocument extends AbstractService
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function setAdditionalReferencedDocument(): self
|
||||||
|
{
|
||||||
|
if($this->document->client->getSetting('merge_e_invoice_to_pdf')) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
$invitation = $this->document->invitations()->first();
|
||||||
|
$pdf = (new \App\Jobs\Entity\CreateRawPdf($invitation))->handle();
|
||||||
|
$file_name = $this->document->numberFormatter().'.pdf';
|
||||||
|
|
||||||
|
$this->temp_file_path = \App\Utils\TempFile::filePath($pdf, $file_name);
|
||||||
|
|
||||||
|
$this->xdocument->addDocumentInvoiceSupportingDocumentWithFile(
|
||||||
|
$this->document->number,
|
||||||
|
$this->temp_file_path,
|
||||||
|
$file_name,
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setDocumentTaxes
|
* setDocumentTaxes
|
||||||
*
|
*
|
||||||
|
|
@ -249,7 +273,14 @@ class ZugferdEDocument extends AbstractService
|
||||||
|
|
||||||
public function getXml(): string
|
public function getXml(): string
|
||||||
{
|
{
|
||||||
return $this->xdocument->getContent();
|
$xml = $this->xdocument->getContent();
|
||||||
|
|
||||||
|
//used if we are embedding the document within the PDF
|
||||||
|
if($this->temp_file_path){
|
||||||
|
unlink($this->temp_file_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function bootFlags(): self
|
private function bootFlags(): self
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ return [
|
||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||||
'app_version' => env('APP_VERSION', '5.12.24'),
|
'app_version' => env('APP_VERSION', '5.12.25'),
|
||||||
'app_tag' => env('APP_TAG', '5.12.24'),
|
'app_tag' => env('APP_TAG', '5.12.25'),
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', false),
|
'api_secret' => env('API_SECRET', false),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue