hola tendría que ver eso como lo mandas, pasa por aqui esa parte para poder guiarte, pero como para tratar de explicarte, en el xml hay dos partes, la parte inicial, solo debe 1 taxtotal por cada impuesto, es decir uno para el valor total del iva del 19, uno para el valor total del iva del cero (teniendo en cuenta que hay dos tipos de cero: exento y excluido) y solo se pone en esa sección el iva del cero exento, uno para el total del iva del 5 y asi sucesivamente. Luego de eso está la sección de los productos, por cada producto debe haber un detalle del impesto correspondiente, y en el producto para el caso de los iva cero excluido en esta parte es que se especifica ese iva, la suma de todos estos item debe corresponder a los totales colocados en la parte inicial. Aqui te pego el ejemplo de la dian que está en el comprimido de la caja de herramientas:
cac:PrepaidPayment>
-<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">2424.01</cbc:TaxAmount>
-<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">12600.06</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">2394.01</cbc:TaxAmount>
-<cac:TaxCategory>
<cbc:Percent>19.00</cbc:Percent>
-<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
-<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">187.50</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">30.00</cbc:TaxAmount>
-<cac:TaxCategory>
<cbc:Percent>16.00</cbc:Percent>
-<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
-<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">0.00</cbc:TaxAmount>
-<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">0.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">0.00</cbc:TaxAmount>
-<cac:TaxCategory>
<cbc:Percent>0.000</cbc:Percent>
-<cac:TaxScheme>
<cbc:ID>03</cbc:ID>
<cbc:Name>ICA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
-<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">0.00</cbc:TaxAmount>
-<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">0.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">0.00</cbc:TaxAmount>
-<cac:TaxCategory>
<cbc:Percent>0.00</cbc:Percent>
-<cac:TaxScheme>
<cbc:ID>04</cbc:ID>
<cbc:Name>INC</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
-<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="COP">12600.06</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="COP">12787.56</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="COP">15024.07</cbc:TaxInclusiveAmount>
<cbc:PrepaidAmount currencyID="COP">1000.00</cbc:PrepaidAmount>
<cbc:PayableAmount currencyID="COP">14024.07</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
-<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="EA">1.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="COP">12600.06</cbc:LineExtensionAmount>
<cbc:FreeOfChargeIndicator>false</cbc:FreeOfChargeIndicator>
-<cac:Delivery>
-<cac:DeliveryLocation>
<cbc:ID schemeName="EAN" schemeID="999">613124312412</cbc:ID>
</cac:DeliveryLocation>
</cac:Delivery>
-<cac:AllowanceCharge>
<cbc:ID>1</cbc:ID>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:AllowanceChargeReason>Descuento por cliente frecuente</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>33.33</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="COP">6299.94</cbc:Amount>
<cbc:BaseAmount currencyID="COP">18900.00</cbc:BaseAmount>
</cac:AllowanceCharge>
-<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">2394.01</cbc:TaxAmount>
-<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">12600.06</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">2394.01</cbc:TaxAmount>
-<cac:TaxCategory>
<cbc:Percent>19.00</cbc:Percent>
-<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
-<cac:Item>
<cbc:Description>AV OASYS -2.25 (8.4) LENTE DE CONTATO</cbc:Description>
-<cac:SellersItemIdentification>
<cbc:ID>AOHV84-225</cbc:ID>
</cac:SellersItemIdentification>
-<cac:AdditionalItemIdentification>
<cbc:ID schemeName="EAN13" schemeID="999">6543542313534</cbc:ID>
</cac:AdditionalItemIdentification>
</cac:Item>
-<cac:Price>
<cbc:PriceAmount currencyID="COP">18900.00</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="EA">1.000000</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
-<cac:InvoiceLine>
<cbc:ID>2</cbc:ID>
<cbc:InvoicedQuantity unitCode="NIU">1.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="COP">0.00</cbc:LineExtensionAmount>
<cbc:FreeOfChargeIndicator>true</cbc:FreeOfChargeIndicator>
-<cac:DocumentReference>
<cbc:ID>TST1543623</cbc:ID>
<cbc:IssueDate>2019-03-02</cbc:IssueDate>
<cbc:DocumentTypeCode>1001-A</cbc:DocumentTypeCode>
<cbc:DocumentType>Bienes Propios</cbc:DocumentType>
</cac:DocumentReference>
-<cac:DocumentReference>
<cbc:ID>GR8713461</cbc:ID>
<cbc:IssueDate>2019-03-02</cbc:IssueDate>
<cbc:DocumentTypeCode>AR</cbc:DocumentTypeCode>
</cac:DocumentReference>
-<cac:PricingReference>
-<cac:AlternativeConditionPrice>
<cbc:PriceAmount currencyID="COP">100.00</cbc:PriceAmount>
<cbc:PriceTypeCode>03</cbc:PriceTypeCode>
<cbc:PriceType>Otro valor</cbc:PriceType>
</cac:AlternativeConditionPrice>
</cac:PricingReference>
-<cac:Delivery>
-<cac:DeliveryLocation>
<cbc:ID schemeName="EAN" schemeID="999">613124312412</cbc:ID>
</cac:DeliveryLocation>
</cac:Delivery>
-<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">30.00</cbc:TaxAmount>
-<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">187.50</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">30.00</cbc:TaxAmount>
-<cac:TaxCategory>
<cbc:Percent>16.00</cbc:Percent>
-<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
-<cac:Item>
<cbc:Description>Bolsa</cbc:Description>
-<cac:SellersItemIdentification>
<cbc:ID>91412012412</cbc:ID>
</cac:SellersItemIdentification>
-<cac:StandardItemIdentification>
<cbc:ID schemeName="UNSPSC" schemeID="001" schemeAgencyID="10">18937100-7</cbc:ID>
</cac:StandardItemIdentification>
</cac:Item>
-<cac:Price>
<cbc:PriceAmount currencyID="COP">0.00</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="NIU">1.000000</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
</Invoice>