Payment data processor
FOLIO payment voucher document
Transform
Format
Download
KFS payment voucher document
Download
Transformation stylesheet
<?xml version="1.0" encoding="UTF-8"?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.kuali.org/kfs/pdp/payment" xmlns:php="http://php.net/xsl" version="1.0"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/batchVoucher"> <pdp_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kuali.org/kfs/pdp/payment http://localhost:8080/kuali-dev/static/xsd/pdp/payment.xsd" version="1.0"> <header> <chart>EL</chart> <unit>KUAL</unit> <sub_unit>LIAB</sub_unit> <creation_date> <xsl:call-template name="format_date_mdy"> <xsl:with-param name="date" select="created" /> </xsl:call-template> </creation_date> </header> <xsl:apply-templates select="batchedVouchers/batchedVoucher" /> <trailer> <detail_count> <xsl:value-of select="count(batchedVouchers/batchedVoucher/ batchedVoucherLines/ batchedVoucherLine)" /> </detail_count> <detail_tot_amt> <xsl:value-of select="sum(batchedVouchers/batchedVoucher/amount)" /> </detail_tot_amt> </trailer> </pdp_file> </xsl:template> <xsl:template match="batchedVouchers/batchedVoucher"> <group> <payee_name> <xsl:value-of select="php:function('App\Utils\XSLTFunctions::safeString', string(vendorName))" /> </payee_name> <payee_id id_type="V"> <xsl:value-of select="php:function('App\Utils\XSLTFunctions::hashName', string(vendorName), string(accountNo))" /> </payee_id> <xsl:if test="vendorAddress/addressLine1"> <address1> <xsl:value-of select="php:function('App\Utils\XSLTFunctions::safeString', string(vendorAddress/addressLine1))" /> </address1> </xsl:if> <xsl:if test="vendorAddress/addressLine2"> <address2> <xsl:value-of select="php:function('App\Utils\XSLTFunctions::safeString', string(vendorAddress/addressLine2))" /> </address2> </xsl:if> <xsl:if test="vendorAddress/city"> <city> <xsl:value-of select="php:function('App\Utils\XSLTFunctions::safeString', string(vendorAddress/city))" /> </city> </xsl:if> <xsl:if test="vendorAddress/stateRegion"> <state> <xsl:value-of select="php:function('App\Utils\XSLTFunctions::safeString', string(vendorAddress/stateRegion))" /> </state> </xsl:if> <xsl:if test="vendorAddress/zipCode"> <zip> <xsl:value-of select="php:function('App\Utils\XSLTFunctions::safeString', string(vendorAddress/zipCode))" /> </zip> </xsl:if> <xsl:if test="vendorAddress/country"> <country> <xsl:value-of select="php:function( 'App\Utils\XSLTFunctions::getCountryNameFromCode', string(vendorAddress/country))" /> </country> </xsl:if> <payment_date> <!-- Should this be from disbursementDate or voucherDate? --> <xsl:call-template name="format_date_mdy"> <xsl:with-param name="date" select="voucherDate" /> </xsl:call-template> </payment_date> <xsl:apply-templates select="batchedVoucherLines/batchedVoucherLine" /> </group> </xsl:template> <!-- TODO: With the parent selectors, this probably should not be a template. --> <xsl:template match="batchedVoucherLines/batchedVoucherLine"> <detail> <source_doc_nbr>LIBRARIES</source_doc_nbr> <invoice_nbr> <xsl:value-of select="../../vendorInvoiceNo" /> </invoice_nbr> <fs_origin_cd>01</fs_origin_cd> <accounting> <coa_cd>MS</coa_cd> <account_nbr> <xsl:value-of select="substring-before(externalAccountNumber, '-')" /> </account_nbr> <object_cd> <xsl:value-of select="substring-after(externalAccountNumber, '-')" /> </object_cd> <amount> <xsl:value-of select="amount" /> </amount> </accounting> <payment_text> <xsl:value-of select="../../accountNo" /> </payment_text> </detail> </xsl:template> <!-- It turns out that mdy format is not preferred. --> <xsl:template name="format_date_mdy"> <xsl:param name="date" /> <xsl:variable name="year"> <xsl:value-of select="substring($date, 1, 4)" /> </xsl:variable> <xsl:variable name="month"> <xsl:value-of select="substring($date, 6, 2)" /> </xsl:variable> <xsl:variable name="monthday"> <xsl:value-of select="substring($date, 9, 2)" /> </xsl:variable> <xsl:value-of select="concat($month, '/', $monthday, '/', $year)" /> </xsl:template> </xsl:transform>
Download
Reset
Check all