Skip to content

Commit 76caee5

Browse files
committed
unit test retention with creditnote
1 parent 4dbb8a5 commit 76caee5

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Retention xmlns="urn:sunat:names:specification:ubl:peru:schema:xsd:Retention-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<ext:UBLExtensions>
4+
<ext:UBLExtension>
5+
<ext:ExtensionContent/>
6+
</ext:UBLExtension>
7+
</ext:UBLExtensions>
8+
<cbc:UBLVersionID>2.0</cbc:UBLVersionID>
9+
<cbc:CustomizationID>1.0</cbc:CustomizationID>
10+
<cac:Signature>
11+
<cbc:ID>IdFactesol</cbc:ID>
12+
<cac:SignatoryParty>
13+
<cac:PartyIdentification>
14+
<cbc:ID>20101991319</cbc:ID>
15+
</cac:PartyIdentification>
16+
<cac:PartyName>
17+
<cbc:Name><![CDATA[WORTEC S.A.]]></cbc:Name>
18+
</cac:PartyName>
19+
</cac:SignatoryParty>
20+
<cac:DigitalSignatureAttachment>
21+
<cac:ExternalReference>
22+
<cbc:URI>#SignatureSP</cbc:URI>
23+
</cac:ExternalReference>
24+
</cac:DigitalSignatureAttachment>
25+
</cac:Signature>
26+
<cbc:ID>R001-00000006</cbc:ID>
27+
<cbc:IssueDate>2018-02-01</cbc:IssueDate>
28+
<cac:AgentParty>
29+
<cac:PartyIdentification>
30+
<cbc:ID schemeID="6">20101991319</cbc:ID>
31+
</cac:PartyIdentification>
32+
<cac:PartyName>
33+
<cbc:Name><![CDATA[WORTEC S.A.]]></cbc:Name>
34+
</cac:PartyName>
35+
<cac:PostalAddress>
36+
<cbc:ID>150140</cbc:ID>
37+
<cbc:StreetName><![CDATA[AV. DEL PINAR NRO. 124 INT. 302]]></cbc:StreetName>
38+
<cbc:CitySubdivisionName><![CDATA[CHACARILLA DEL ESTANQUE]]></cbc:CitySubdivisionName>
39+
<cbc:CityName><![CDATA[LIMA]]></cbc:CityName>
40+
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
41+
<cbc:District>SANTIAGO DE SURCO</cbc:District>
42+
<cac:Country>
43+
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
44+
</cac:Country>
45+
</cac:PostalAddress>
46+
<cac:PartyLegalEntity>
47+
<cbc:RegistrationName><![CDATA[WORTEC SOCIEDAD ANONIMA]]></cbc:RegistrationName>
48+
</cac:PartyLegalEntity>
49+
</cac:AgentParty>
50+
<cac:ReceiverParty>
51+
<cac:PartyIdentification>
52+
<cbc:ID schemeID="6">20467463684</cbc:ID>
53+
</cac:PartyIdentification>
54+
<cac:PartyLegalEntity>
55+
<cbc:RegistrationName><![CDATA[HEAP LEACHING CONSULTING S.A.C]]></cbc:RegistrationName>
56+
</cac:PartyLegalEntity>
57+
</cac:ReceiverParty>
58+
<sac:SUNATRetentionSystemCode>01</sac:SUNATRetentionSystemCode>
59+
<sac:SUNATRetentionPercent>3.00</sac:SUNATRetentionPercent>
60+
<cbc:TotalInvoiceAmount currencyID="PEN">21.00</cbc:TotalInvoiceAmount>
61+
<sac:SUNATTotalPaid currencyID="PEN">679.00</sac:SUNATTotalPaid>
62+
<sac:SUNATRetentionDocumentReference>
63+
<cbc:ID schemeID="01">F003-00000001</cbc:ID>
64+
<cbc:IssueDate>2018-02-01</cbc:IssueDate>
65+
<cbc:TotalInvoiceAmount currencyID="PEN">1000.00</cbc:TotalInvoiceAmount>
66+
<cac:Payment>
67+
<cbc:ID>1</cbc:ID>
68+
<cbc:PaidAmount currencyID="PEN">500.00</cbc:PaidAmount>
69+
<cbc:PaidDate>2018-02-01</cbc:PaidDate>
70+
</cac:Payment>
71+
<sac:SUNATRetentionInformation>
72+
<sac:SUNATRetentionAmount currencyID="PEN">15.00</sac:SUNATRetentionAmount>
73+
<sac:SUNATRetentionDate>2018-02-01</sac:SUNATRetentionDate>
74+
<sac:SUNATNetTotalPaid currencyID="PEN">485.00</sac:SUNATNetTotalPaid>
75+
<cac:ExchangeRate>
76+
<cbc:SourceCurrencyCode>PEN</cbc:SourceCurrencyCode>
77+
<cbc:TargetCurrencyCode>PEN</cbc:TargetCurrencyCode>
78+
<cbc:CalculationRate>1.00</cbc:CalculationRate>
79+
<cbc:Date>2018-02-01</cbc:Date>
80+
</cac:ExchangeRate>
81+
</sac:SUNATRetentionInformation>
82+
</sac:SUNATRetentionDocumentReference>
83+
<sac:SUNATRetentionDocumentReference>
84+
<cbc:ID schemeID="07">F003-00000001</cbc:ID>
85+
<cbc:IssueDate>2018-02-01</cbc:IssueDate>
86+
<cbc:TotalInvoiceAmount currencyID="PEN">500.00</cbc:TotalInvoiceAmount>
87+
</sac:SUNATRetentionDocumentReference>
88+
</Retention>

tests/Xml/Parser/RetentionParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testParseDoc($filename)
3333
$this->assertNotEmpty($detail->getTipoDoc());
3434
$this->assertNotEmpty($detail->getNumDoc());
3535
$this->assertNotNull($detail->getFechaEmision());
36-
$this->assertGreaterThan(0, count($detail->getPagos()));
36+
$this->assertTrue(is_array($detail->getPagos()));
3737
$this->assertTrue(is_float($detail->getImpTotal()));
3838
$this->assertTrue(is_float($detail->getImpRetenido()));
3939
$this->assertTrue(is_float($detail->getImpPagar()));

0 commit comments

Comments
 (0)