Skip to content

Commit

Permalink
Internal changes of InvoiceObject Handling
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Mar 10, 2024
1 parent bd47b83 commit 56bc31d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/ZugferdDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@ public function getInvoiceObject()
}

/**
* Sets the reference to the internal invoice object
* Create a new instance of the internal invoice object
*
* @param \horstoeko\zugferd\entities\basic\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\basicwö\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\en16931\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\extended\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\minimum\rsm\CrossIndustryInvoice $invoiceObject
* @return \horstoeko\zugferd\entities\basic\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\basicwö\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\en16931\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\extended\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\minimum\rsm\CrossIndustryInvoice
*/
protected function setInvoiceObject($invoiceObject)
protected function createInvoiceObject()
{
$this->invoiceObject = $invoiceObject;
$this->invoiceObject = $this->getObjectHelper()->getCrossIndustryInvoice();

return $this->invoiceObject;
}
Expand Down
3 changes: 2 additions & 1 deletion src/ZugferdDocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public static function createNew(int $profileId): ZugferdDocumentBuilder
*/
public function initNewDocument(): ZugferdDocumentBuilder
{
$this->setInvoiceObject($this->getObjectHelper()->getCrossIndustryInvoice());
$this->createInvoiceObject();

$this->headerTradeAgreement = $this->getInvoiceObject()->getSupplyChainTradeTransaction()->getApplicableHeaderTradeAgreement();
$this->headerTradeDelivery = $this->getInvoiceObject()->getSupplyChainTradeTransaction()->getApplicableHeaderTradeDelivery();
$this->headerTradeSettlement = $this->getInvoiceObject()->getSupplyChainTradeTransaction()->getApplicableHeaderTradeSettlement();
Expand Down

0 comments on commit 56bc31d

Please sign in to comment.