From 9bb757707c31ec2675a53421cccea3f8074ab9e0 Mon Sep 17 00:00:00 2001 From: ruff Date: Mon, 26 Dec 2022 01:01:51 +0100 Subject: [PATCH] Fixed tests and test assets --- tests/assets/reader-order-x-comfort.pdf | Bin 70543 -> 70589 bytes .../OrderDocumentPdfReaderComfortTest.php | 44 ++++++++++++++---- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/tests/assets/reader-order-x-comfort.pdf b/tests/assets/reader-order-x-comfort.pdf index 4e00131215fb82232b4dfdd892517c65dda9cd84..6f539fd55aa56885e857ab34a05e521ce347c927 100644 GIT binary patch delta 4513 zcmZXYS5Om-v-TnMKtQU1^rrMcLa5SvlhAt$p$G&ageoL}^xlysMSAa%t~5bO~@~ zgd`LwZsg?WG+5}+$Zz+*Y)wrc++Y8 zal@05fFATuZ#k>H8%KnCJGW0Ps_>PWUC33#PfaCD>K(Vp<#X{!oRo4H^bF(%dfDxY zCp0X<8xn93spGVhrlP5_caGocMHa|yQx#(Qjm{Il92PnK`?+i3O6}cF`wOyt_T+;N zw80NV3yHv?vvvL(!gv*ejD7gtclSquS3zOf7NDRzwh zp1ptP3FX43vJ^#vy4Nywy$Qr(By-%K3a0c5Gkp4TQT~iZlBZM&+vtQ=vxF-Tr1{;& z!HKKU2|WNcxYvS5axwViM>u&&3}7=s$izFILv@$HAYGa19@NOYMT%j)Y?XF|16~T{ zm-iys@U2Ve39DUzyJyy#w&O@#AJgc)l!LxI+)eNmw5t2gWA|dc;n(Yp z2RY@TqrgEd8|PXmIX}tMw2EToObO~i0V!bXSx+U&UXl$~&BcTF9zBA(oLj2!stKx- zPQ8D1URPTiiBjOv@cN_nl#=Vp)?pR!q`3qasqvCQ$h|b7hhex^FCbbOa(NsHYA9wtbUfmuuK+zC=SwR1xl}$YsPO{HZGe(De z4Fz0sL{K&){9*cx|FslA^yAXU)LJ*Eh6;ntrejocA~t+9FNMU5l+?uZvouiT#*taj z+Qx)CzLb5ODC(V$iZ5n#vKl9-@I-lL}mz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Xt&;>lPps-Y2$ik?Pe8Lsk2u4|mGu4@c3uQQ&@o z3Ld@sN)5WJd<8c$W7dvpur4ou$+W|uF z#tJd-Opl+g{_)%ZT+TQ&(-H}_BJQg{deN5@rW?SgGY!`dBnLzC9`VHlK zlSi&oxI#@cQkY~yaHtWy_tuJA{`4hI(0t4MX>;HBaD7eB9JHgOr&6BgmR_)VuZ1Mh z%&vhhdrQa8VCuc2-tKk93?>O3o<6XR?m`pBlJ&Hngt^Qu2CEK*YUb^Qrj01-vP4it z_;^2GWeR~#S6Au3Irtm`yj89l^__mr%hi<FevesgmS zJv7Q*!v@|nes$R6xcTgb%0vi1sOW2dk2$JYVK7=EXW`m;W{A8@Sn6Nd`&o#dg10{9 z`bh)CaW>GZ^Uy|%g@)NhN?5Cjp`Gy*p@dhe$5tvwgFfpc8UM+5dAn?@>Es57{MP4B zG>F<}7Cqeb#P6Po&&{E+`0es6xze+~!|ibnlE21m;L7egVTGXJeZp=F`6|E)u# zA+S6FR&u5LXdDaz#mPcsa1bXa2N+BiE(1k4%c7l-&JUfOATmk{I2;a%b9O{KqoGhZ u9ECq_)bwK3+ diff --git a/tests/testcases/OrderDocumentPdfReaderComfortTest.php b/tests/testcases/OrderDocumentPdfReaderComfortTest.php index 66897f6..1232552 100644 --- a/tests/testcases/OrderDocumentPdfReaderComfortTest.php +++ b/tests/testcases/OrderDocumentPdfReaderComfortTest.php @@ -78,7 +78,7 @@ public function testGetDocumentInformation(): void $this->assertEquals("PO123456789", $documentNo); $this->assertEquals(OrderDocumentTypes::ORDER, $documentTypeCode); - $this->assertEquals("25.12.2022", $documentDate->format('d.m.Y')); + $this->assertEquals("26.12.2022", $documentDate->format('d.m.Y')); $this->assertEquals("EUR", $documentCurrency); $this->assertEquals("Doc Name", $documentName); $this->assertEmpty($documentLanguageId); @@ -96,7 +96,7 @@ public function testGetIsDocumentCopy(): void self::$document->getIsDocumentCopy($documentIsCopy); $this->assertNotNull($documentIsCopy); - $this->assertFalse($documentIsCopy); + $this->assertTrue($documentIsCopy); } /** @@ -1156,9 +1156,9 @@ public function testGetDocumentRequestedDeliverySupplyChainEvent(): void $this->assertNotNull($occurrenceDateTime); $this->assertNotNull($startDateTime); $this->assertNotNull($endDateTime); - $this->assertEquals("25.12.2022", $occurrenceDateTime->format('d.m.Y')); - $this->assertEquals("25.12.2022", $startDateTime->format('d.m.Y')); - $this->assertEquals("25.12.2022", $endDateTime->format('d.m.Y')); + $this->assertEquals("26.12.2022", $occurrenceDateTime->format('d.m.Y')); + $this->assertEquals("26.12.2022", $startDateTime->format('d.m.Y')); + $this->assertEquals("26.12.2022", $endDateTime->format('d.m.Y')); } /** @@ -1486,7 +1486,7 @@ public function testGetDocumentReceivableSpecifiedTradeAccountingAccount(): void self::$document->getDocumentReceivableSpecifiedTradeAccountingAccount($id, $typeCode); $this->assertEquals("BUYER_ACCOUNT_REF", $id); - $this->assertEquals("", $typeCode); + $this->assertEquals("BUYER_ACCOUNT_REF_TYPE", $typeCode); } /** @@ -2665,7 +2665,7 @@ public function testGetDocumentPositionGrossPriceAllowanceChargePos1(): void $this->assertEquals(0, $sequence); $this->assertEquals(0, $basisQuantity); $this->assertEquals("", $basisQuantityUnitCode); - $this->assertEquals("", $reasonCode); + $this->assertEquals("95", $reasonCode); self::$document->nextDocumentPositionGrossPriceAllowanceCharge(); self::$document->getDocumentPositionGrossPriceAllowanceCharge($actualAmount, $isCharge, $calculationPercent, $basisAmount, $reason, $taxTypeCode, $taxCategoryCode, $rateApplicablePercent, $sequence, $basisQuantity, $basisQuantityUnitCode, $reasonCode); @@ -2681,7 +2681,7 @@ public function testGetDocumentPositionGrossPriceAllowanceChargePos1(): void $this->assertEquals(0, $sequence); $this->assertEquals(0, $basisQuantity); $this->assertEquals("", $basisQuantityUnitCode); - $this->assertEquals("", $reasonCode); + $this->assertEquals("AEW", $reasonCode); $this->assertFalse(self::$document->nextDocumentPositionGrossPriceAllowanceCharge()); } @@ -2707,7 +2707,7 @@ public function testGetDocumentPositionGrossPriceAllowanceChargePos2(): void $this->assertEquals(0, $sequence); $this->assertEquals(0, $basisQuantity); $this->assertEquals("", $basisQuantityUnitCode); - $this->assertEquals("", $reasonCode); + $this->assertEquals("AEW", $reasonCode); $this->assertFalse(self::$document->nextDocumentPositionGrossPriceAllowanceCharge()); } @@ -3468,7 +3468,7 @@ public function testFirstDocumentPositionTaxPos1(): void { self::$document->firstDocumentPosition(); - $this->assertFalse(self::$document->firstDocumentPositionTax()); + $this->assertTrue(self::$document->firstDocumentPositionTax()); } /** @@ -3519,4 +3519,28 @@ public function testNextDocumentPositionTaxPos3(): void { $this->assertFalse(self::$document->nextDocumentPositionTax()); } + + /** + * @covers \horstoeko\orderx\OrderDocumentReader + * @covers \horstoeko\orderx\OrderObjectHelper + */ + public function testGetDocumentPositionTax(): void + { + self::$document->firstDocumentPosition(); + self::$document->getDocumentPositionTax( + $categoryCode, + $typeCode, + $rateApplicablePercent, + $calculatedAmount, + $exemptionReason, + $exemptionReasonCode + ); + + $this->assertEquals("S", $categoryCode); + $this->assertEquals("VAT", $typeCode); + $this->assertEquals(19.0, $rateApplicablePercent); + $this->assertEquals(0.0, $calculatedAmount); + $this->assertEquals("", $exemptionReason); + $this->assertEquals("", $exemptionReasonCode); + } }