Skip to content

Commit

Permalink
fix: fixed wrong description at adv pricing #minor (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
wehrsefr authored Jun 5, 2024
1 parent dcebe7b commit dcb0826
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/CXml/Model/PriceBasisQuantity.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class PriceBasisQuantity
* @Ser\SerializedName("Description")
* @Ser\XmlElement (cdata=false)
*/
private Description $description;
private MultilanguageString $description;

public function __construct(int $quantity, float $conversionFactor, string $unitOfMeasure, Description $description)
public function __construct(int $quantity, float $conversionFactor, string $unitOfMeasure, MultilanguageString $description)
{
$this->quantity = $quantity;
$this->conversionFactor = $conversionFactor;
Expand All @@ -53,7 +53,7 @@ public function getUnitOfMeasure(): string
return $this->unitOfMeasure;
}

public function getDescription(): Description
public function getDescription(): MultilanguageString
{
return $this->description;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use CXml\Model\Message\PunchOutOrderMessage;
use CXml\Model\Message\PunchOutOrderMessageHeader;
use CXml\Model\MoneyWrapper;
use CXml\Model\MultilanguageString;
use CXml\Model\PayloadIdentity;
use CXml\Model\PriceBasisQuantity;
use CXml\Payload\PayloadIdentityFactoryInterface;
Expand All @@ -32,7 +33,7 @@ protected function setUp(): void
$this->dtdValidator = new DtdValidator(__DIR__.'/../../metadata/cxml/dtd/1.2.050/');
}

public function testMinimumExample(): void
public function testMinimumExampleAdvPricing(): void
{
$from = new Credential(
'DUNS',
Expand Down Expand Up @@ -61,7 +62,7 @@ public function testMinimumExample(): void
[
new Classification('UNSPSC', 'ean1234'),
],
new PriceBasisQuantity(2, 0.5, 'BOX', Description::createWithShortName('1 Box is 2 EA and the unit price is for 2', null, 'en'))
new PriceBasisQuantity(2, 0.5, 'BOX', new MultilanguageString('1 Box is 2 EA and the unit price is for 2', null, 'en'))
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
<UnitOfMeasure>EA</UnitOfMeasure>
<PriceBasisQuantity quantity="2" conversionFactor="0.5">
<UnitOfMeasure>BOX</UnitOfMeasure>
<Description xml:lang="en">
<ShortName>1 Box is 2 EA and the unit price is for 2</ShortName>
</Description>
<Description xml:lang="en">1 Box is 2 EA and the unit price is for 2</Description>
</PriceBasisQuantity>
<Classification domain="UNSPSC">ean1234</Classification>
</ItemDetail>
Expand Down

0 comments on commit dcb0826

Please sign in to comment.