Skip to content

Commit

Permalink
Preparations for name swapping support
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Jul 4, 2024
1 parent 7bdd5ce commit 131850d
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/XmlConverterCiiToUbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ class XmlConverterCiiToUbl extends XmlConverterBase
*/
private $automaticModeDisabled = true;

/**
* Internal flag to disable name swapping (Legal Organisation and Party Name)
*
* @var boolean
*/
private $nameSwappingDisabled = true;

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -196,6 +203,30 @@ public function enableAutomaticMode(): XmlConverterCiiToUbl
return $this;
}

/**
* Disable name swapping
*
* @return XmlConverterCiiToUbl
*/
public function disableNameSwapping(): XmlConverterCiiToUbl
{
$this->nameSwappingDisabled = true;

return $this;
}

/**
* Enable name swapping
*
* @return XmlConverterCiiToUbl
*/
public function enableNameSwapping(): XmlConverterCiiToUbl
{
$this->nameSwappingDisabled = false;

return $this;
}

/**
* Returns true if source is a credit note, otherwise false
*
Expand Down
31 changes: 31 additions & 0 deletions src/XmlConverterUblToCii.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ class XmlConverterUblToCii extends XmlConverterBase
*/
private $ublLineQuantityRootName = 'cbc:InvoicedQuantity';

/**
* Internal flag to disable name swapping (Party Legal Entity and Party Name)
*
* @var boolean
*/
private $nameSwappingDisabled = true;

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -145,6 +152,30 @@ protected function doConvert()
return $this;
}

/**
* Disable name swapping
*
* @return XmlConverterUblToCii
*/
public function disableNameSwapping(): XmlConverterUblToCii
{
$this->nameSwappingDisabled = true;

return $this;
}

/**
* Enable name swapping
*
* @return XmlConverterUblToCii
*/
public function enableNameSwapping(): XmlConverterUblToCii
{
$this->nameSwappingDisabled = false;

return $this;
}

/**
* Convert system information
*
Expand Down

0 comments on commit 131850d

Please sign in to comment.