mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 01:34:35 -04:00
Working on peppol
This commit is contained in:
parent
46d3138779
commit
54588c1510
@ -95,4 +95,9 @@ class UserPresenter extends EntityPresenter
|
|||||||
{
|
{
|
||||||
return $this->entity->phone ?? ' ';
|
return $this->entity->phone ?? ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function email(): string
|
||||||
|
{
|
||||||
|
return $this->entity->email ?? ' ';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -575,9 +575,9 @@ $tax_amount->amount = $this->invoice->uses_inclusive_taxes ? $this->calcInclusiv
|
|||||||
$party->PhysicalLocation = $address;
|
$party->PhysicalLocation = $address;
|
||||||
|
|
||||||
$contact = new Contact();
|
$contact = new Contact();
|
||||||
$contact->ElectronicMail = $this->invoice->company->owner()->email ?? 'owner@gmail.com';
|
$contact->ElectronicMail = $this->getSetting('Invoice.AccountingSupplierParty.Party.Contact') ?? $this->invoice->company->owner()->present()->email();
|
||||||
$contact->Telephone = '';
|
$contact->Telephone = $this->getSetting('Invoice.AccountingSupplierParty.Party.Telephone') ?? $this->invoice->company->getSetting('phone');
|
||||||
$contact->Name = '';
|
$contact->Name = $this->getSetting('Invoice.AccountingSupplierParty.Party.Name') ?? $this->invoice->company->owner()->present()->name();
|
||||||
|
|
||||||
$party->Contact = $contact;
|
$party->Contact = $contact;
|
||||||
|
|
||||||
@ -703,20 +703,26 @@ $tax_amount->amount = $this->invoice->uses_inclusive_taxes ? $this->calcInclusiv
|
|||||||
//only scans for top level props
|
//only scans for top level props
|
||||||
foreach($settings as $prop => $visibility){
|
foreach($settings as $prop => $visibility){
|
||||||
|
|
||||||
if($prop_value = PropertyResolver::resolve($this->invoice->client->e_invoice, $prop))
|
if($prop_value = $this->getSetting($prop))
|
||||||
$this->p_invoice->{$prop} = $prop_value;
|
$this->p_invoice->{$prop} = $prop_value;
|
||||||
elseif($prop_value = PropertyResolver::resolve($this->invoice->company->e_invoice, $prop)) {
|
|
||||||
$this->p_invoice->{$prop} = $prop_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSetting(object $e_invoice, string $property_path): mixed
|
public function getSetting(string $property_path): mixed
|
||||||
{
|
{
|
||||||
return PropertyResolver::resolve($e_invoice, $property_path);
|
|
||||||
|
if($prop_value = PropertyResolver::resolve($this->invoice->e_invoice, $property_path))
|
||||||
|
return $prop_value;
|
||||||
|
elseif($prop_value = PropertyResolver::resolve($this->invoice->client->e_invoice, $property_path))
|
||||||
|
return $prop_value;
|
||||||
|
elseif($prop_value = PropertyResolver::resolve($this->invoice->company->e_invoice, $property_path))
|
||||||
|
return $prop_value;
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countryLevelMutators():self
|
public function countryLevelMutators():self
|
||||||
|
34
composer.lock
generated
34
composer.lock
generated
@ -535,16 +535,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "aws/aws-sdk-php",
|
"name": "aws/aws-sdk-php",
|
||||||
"version": "3.316.3",
|
"version": "3.316.10",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||||
"reference": "e832e594b3c213760e067e15ef2739f77505e832"
|
"reference": "eeb8df6ff6caa428e8bcd631ad2a96430900a249"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/e832e594b3c213760e067e15ef2739f77505e832",
|
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/eeb8df6ff6caa428e8bcd631ad2a96430900a249",
|
||||||
"reference": "e832e594b3c213760e067e15ef2739f77505e832",
|
"reference": "eeb8df6ff6caa428e8bcd631ad2a96430900a249",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -624,9 +624,9 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.316.3"
|
"source": "https://github.com/aws/aws-sdk-php/tree/3.316.10"
|
||||||
},
|
},
|
||||||
"time": "2024-07-12T18:07:23+00:00"
|
"time": "2024-07-30T18:10:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bacon/bacon-qr-code",
|
"name": "bacon/bacon-qr-code",
|
||||||
@ -4552,16 +4552,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/framework",
|
"name": "laravel/framework",
|
||||||
"version": "v11.18.1",
|
"version": "v11.19.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/framework.git",
|
"url": "https://github.com/laravel/framework.git",
|
||||||
"reference": "b19ba518c56852567e99fbae9321bc436c2cc5a8"
|
"reference": "5e103d499e9ee5bcfc184412d034c4e516b87085"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/framework/zipball/b19ba518c56852567e99fbae9321bc436c2cc5a8",
|
"url": "https://api.github.com/repos/laravel/framework/zipball/5e103d499e9ee5bcfc184412d034c4e516b87085",
|
||||||
"reference": "b19ba518c56852567e99fbae9321bc436c2cc5a8",
|
"reference": "5e103d499e9ee5bcfc184412d034c4e516b87085",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -4754,7 +4754,7 @@
|
|||||||
"issues": "https://github.com/laravel/framework/issues",
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
"source": "https://github.com/laravel/framework"
|
"source": "https://github.com/laravel/framework"
|
||||||
},
|
},
|
||||||
"time": "2024-07-26T10:39:29+00:00"
|
"time": "2024-07-30T15:22:41+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/pint",
|
"name": "laravel/pint",
|
||||||
@ -17347,16 +17347,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
"version": "10.5.28",
|
"version": "10.5.29",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "ff7fb85cdf88131b83e721fb2a327b664dbed275"
|
"reference": "8e9e80872b4e8064401788ee8a32d40b4455318f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ff7fb85cdf88131b83e721fb2a327b664dbed275",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e9e80872b4e8064401788ee8a32d40b4455318f",
|
||||||
"reference": "ff7fb85cdf88131b83e721fb2a327b664dbed275",
|
"reference": "8e9e80872b4e8064401788ee8a32d40b4455318f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -17428,7 +17428,7 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||||
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.28"
|
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.29"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -17444,7 +17444,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-07-18T14:54:16+00:00"
|
"time": "2024-07-30T11:08:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "react/cache",
|
"name": "react/cache",
|
||||||
|
@ -19,18 +19,19 @@ use Tests\MockAccountData;
|
|||||||
use App\DataMapper\InvoiceItem;
|
use App\DataMapper\InvoiceItem;
|
||||||
use App\DataMapper\ClientSettings;
|
use App\DataMapper\ClientSettings;
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
|
use App\Factory\CompanyUserFactory;
|
||||||
use InvoiceNinja\EInvoice\EInvoice;
|
use InvoiceNinja\EInvoice\EInvoice;
|
||||||
use InvoiceNinja\EInvoice\Symfony\Encode;
|
use InvoiceNinja\EInvoice\Symfony\Encode;
|
||||||
use App\Services\EDocument\Standards\Peppol;
|
use App\Services\EDocument\Standards\Peppol;
|
||||||
use App\Services\EDocument\Standards\FatturaPANew;
|
use App\Services\EDocument\Standards\FatturaPANew;
|
||||||
use Illuminate\Routing\Middleware\ThrottleRequests;
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\PaymentMeans;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use InvoiceNinja\EInvoice\Models\FatturaPA\FatturaElettronica;
|
use InvoiceNinja\EInvoice\Models\FatturaPA\FatturaElettronica;
|
||||||
use InvoiceNinja\EInvoice\Models\Peppol\BranchType\FinancialInstitutionBranch;
|
use InvoiceNinja\EInvoice\Models\Peppol\BranchType\FinancialInstitutionBranch;
|
||||||
use InvoiceNinja\EInvoice\Models\Peppol\FinancialAccountType\PayeeFinancialAccount;
|
use InvoiceNinja\EInvoice\Models\Peppol\FinancialAccountType\PayeeFinancialAccount;
|
||||||
use InvoiceNinja\EInvoice\Models\FatturaPA\FatturaElettronicaBodyType\FatturaElettronicaBody;
|
use InvoiceNinja\EInvoice\Models\FatturaPA\FatturaElettronicaBodyType\FatturaElettronicaBody;
|
||||||
use InvoiceNinja\EInvoice\Models\FatturaPA\FatturaElettronicaHeaderType\FatturaElettronicaHeader;
|
use InvoiceNinja\EInvoice\Models\FatturaPA\FatturaElettronicaHeaderType\FatturaElettronicaHeader;
|
||||||
use InvoiceNinja\EInvoice\Models\Peppol\PaymentMeans;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
@ -93,6 +94,12 @@ class PeppolTest extends TestCase
|
|||||||
'e_invoice' => $einvoice,
|
'e_invoice' => $einvoice,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$cu = CompanyUserFactory::create($this->user->id, $company->id, $this->account->id);
|
||||||
|
$cu->is_owner = true;
|
||||||
|
$cu->is_admin = true;
|
||||||
|
$cu->is_locked = false;
|
||||||
|
$cu->save();
|
||||||
|
|
||||||
$client_settings = ClientSettings::defaults();
|
$client_settings = ClientSettings::defaults();
|
||||||
$client_settings->currency_id = '3';
|
$client_settings->currency_id = '3';
|
||||||
|
|
||||||
@ -206,6 +213,12 @@ class PeppolTest extends TestCase
|
|||||||
'e_invoice' => $einvoice,
|
'e_invoice' => $einvoice,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$cu = CompanyUserFactory::create($this->user->id, $company->id, $this->account->id);
|
||||||
|
$cu->is_owner = true;
|
||||||
|
$cu->is_admin = true;
|
||||||
|
$cu->is_locked = false;
|
||||||
|
$cu->save();
|
||||||
|
|
||||||
$client_settings = ClientSettings::defaults();
|
$client_settings = ClientSettings::defaults();
|
||||||
$client_settings->currency_id = '3';
|
$client_settings->currency_id = '3';
|
||||||
|
|
||||||
@ -302,6 +315,13 @@ class PeppolTest extends TestCase
|
|||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
$cu = CompanyUserFactory::create($this->user->id, $company->id, $this->account->id);
|
||||||
|
$cu->is_owner = true;
|
||||||
|
$cu->is_admin = true;
|
||||||
|
$cu->is_locked = false;
|
||||||
|
$cu->save();
|
||||||
|
|
||||||
$client_settings = ClientSettings::defaults();
|
$client_settings = ClientSettings::defaults();
|
||||||
$client_settings->currency_id = '3';
|
$client_settings->currency_id = '3';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user