Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

JAVA UDF

$
0
0

Hi Guys,

 

Can somebody please let me know how to achieve the following through UDF.

 

I have a requirement where Tax information is coming in the source under Tax tag and I need to combine all the similar type of Tax code into one tag of target.

 

Example

  <ProductTax>

   <TypeCode>VAT</TypeCode>

   <TypeDescription languageCode="en">Standard rated input VAT:20%</TypeDescription>

   <BaseAmount currencyCode="GBP">1000.0</BaseAmount>

   <Percent>20.0</Percent>

   <Amount currencyCode="GBP">200.0</Amount>

   <BusinessTransactionDocumentItemGroupID>VG</BusinessTransactionDocumentItemGroupID>

  </ProductTax>

  <ProductTax>

   <TypeCode>VAT</TypeCode>

   <TypeDescription languageCode="en">Standard rated input VAT:20% Exempt from Input VAT</TypeDescription>

   <BaseAmount currencyCode="GBP">300.0</BaseAmount>

   <Amount currencyCode="GBP">0.0</Amount>

   <BusinessTransactionDocumentItemGroupID>V0</BusinessTransactionDocumentItemGroupID>

  </ProductTax>

  <ProductTax>

   <TypeCode>VAT</TypeCode>

   <TypeDescription languageCode="en">Standard rated input VAT:20%</TypeDescription>

   <BaseAmount currencyCode="GBP">1000.0</BaseAmount>

   <Percent>20.0</Percent>

   <Amount currencyCode="GBP">200.0</Amount>

   <BusinessTransactionDocumentItemGroupID>VG</BusinessTransactionDocumentItemGroupID>

  </ProductTax>

  <ProductTax>

   <TypeCode>VAT</TypeCode>

   <TypeDescription languageCode="en">Standard rated input VAT:20% Exempt from Input VAT</TypeDescription>

   <BaseAmount currencyCode="GBP">300.0</BaseAmount>

   <Amount currencyCode="GBP">0.0</Amount>

   <BusinessTransactionDocumentItemGroupID>V0</BusinessTransactionDocumentItemGroupID>

  </ProductTax>

 

So I need to check if the value of BusinessTransactionDocumentItemGroupID = VG then count how many VG are there and pass it to target segment and also calculate the BaseAmount & Amount and pass it across.

 

Output

<TaxSubTotal>

      <TaxRate Code="VG">20.0</TaxRate>

      <NumberOfLinesAtRate>2</NumberOfLinesAtRate>

      <TotalValueAtRate>2000.0</TotalValueAtRate>

      <TaxableValueAtRate>2000.0</TaxableValueAtRate>

      <TaxAtRate>400.0</TaxAtRate>

   </TaxSubTotal>

   <TaxSubTotal>

      <TaxRate Code="V0">0.0</TaxRate>

      <NumberOfLinesAtRate>2</NumberOfLinesAtRate>

      <TotalValueAtRate>600.0</TotalValueAtRate>

      <TaxableValueAtRate>600.0</TaxableValueAtRate>

      <TaxAtRate>0.0</TaxAtRate>

   </TaxSubTotal>

 

Many Thanks,

Asif


Viewing all articles
Browse latest Browse all 7030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>