mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Updates for e-invoicing
This commit is contained in:
parent
8b8a5e3148
commit
f85e96c3a6
@ -307,7 +307,7 @@ class Peppol extends AbstractService
|
||||
|
||||
if($this->invoice->e_invoice) {
|
||||
|
||||
$this->p_invoice = $this->e->decode('Peppol', json_encode($this->invoice->e_invoice), 'json');
|
||||
$this->p_invoice = $this->e->decode('Peppol', json_encode($this->invoice->e_invoice->Invoice), 'json');
|
||||
|
||||
return $this;
|
||||
|
||||
@ -402,7 +402,7 @@ class Peppol extends AbstractService
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return json_decode($this->toJson(), true);
|
||||
return ['Invoice' => json_decode($this->toJson(), true)];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1046,6 +1046,24 @@ class Peppol extends AbstractService
|
||||
*/
|
||||
public function setInvoiceDefaults(): self
|
||||
{
|
||||
|
||||
// Stub new invoice with company settings.
|
||||
if($this->_company_settings)
|
||||
{
|
||||
foreach(get_object_vars($this->_company_settings) as $prop => $value){
|
||||
$this->p_invoice->{$prop} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// Overwrite with any client level settings
|
||||
if($this->_client_settings)
|
||||
{
|
||||
foreach (get_object_vars($this->_client_settings) as $prop => $value) {
|
||||
$this->p_invoice->{$prop} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// Plucks special overriding properties scanning the correct settings level
|
||||
$settings = [
|
||||
'AccountingCostCode' => 7,
|
||||
'AccountingCost' => 7,
|
||||
|
Loading…
x
Reference in New Issue
Block a user