Tuesday, August 10, 2010

Check Printing Oracle Payables

Check Printing: Tags to be used

Group:OutboundPayment

<?for-each:OutboundPayment?>

SortByCheckNumber

<?sort:PaymentNumber/CheckNumber?>

Variablesetr

<?xdoxslt:set_variable($_XDOCTX, 'V_GROSS_AMT', PaymentAmount/Value)?>

Variablesetr2

<?xdoxslt:set_variable($_XDOCTX, 'V_DIS_AMT_TOT', DiscountTaken/Amount/Value)?>

Variablesetr3

<?xdoxslt:set_variable($_XDOCTX, 'V_PAID_AMT_TOT',(xdoxslt:get_variable($_XDOCTX,'V_GROSS_AMT')-xdoxslt:get_variable($_XDOCTX,'V_DIS_AMT_TOT')) )?>

BankName

<?BankName?>

AlternateBankAccountName

<?AlternateBankAccountName?>

CheckNumber

<?CheckNumber?>

PaymentDate

<?format-date:PaymentDate;'DD-MON-YYYY'?>

PaymentAmt

*****<?format-number:PaymentAmount/Value;'999G999D99'?>*****

Check Amount in words

*****<?xdofx:upper(PaymentAmountText)?>*****

Choose

<?choose:?>

When Void by Overflow

<?when:PaymentStatus/Code='VOID_BY_OVERFLOW'?>

End when

<?end when?>

Otherwise

<?otherwise:?>

If

<?if@inlines:sum(./PaymentAmount/Value) < 5000?>

eiif

<?end if?>

End otherwise

<?end otherwise?>

End Choose

<?end choose?>

Payee Name

<?Payee/Name ?>

Address Line 1

<?Payee/Address/AddressLine1?>

C

<?if:AddressLine2!=NULL?>

Address Line 2

<?Payee/Address/AddressLine2?>

EC

<?end if?>

C

<?if:AddressLine3!=NULL?>

Address Line 3

<?Payee/Address/AddressLine3?>

EC

<?end if?>

C

<?if:concat(Payee/Address/City,',',Payee/Address/State,' ',Payee/Address/PostalCode)!=', '?>

City, State Zip

<?value-of:concat(Payee/Address/City,',',Payee/Address/State,' ',Payee/Address/PostalCode)?>

EC

<?end if?>

Country

<?Payee/Address/CountryName?>

CheckNumber

<?xdofx:lpad(CheckNumber,8,'0' )?>

BranchNumber

<?BranchNumber?>

BankAccountNumber

<?BankAccountNumber?>

LinesPerPageVariable

<xsl:variable name="lpp" select="number(10)"/>

LinesTreeVariable

<xsl:variable xdofo:ctx="incontext" name="invLines" select=".//DocumentPayable"/>

FE invLines

<?for-each:$invLines?> <?if:(position()-1) mod $lpp=0?> <xsl:variable name="start" xdofo:ctx="incontext" select="position()"/>

CDATE

<?format-date:xdoxslt:get_variable($_XDOCTX,'V_PAY_DATE');' DD-MON-YYYY'?>

Vendor Number

<?xdoxslt:get_variable($_XDOCTX,'V_SUP_NO')?>

ChecklNumber

<?xdoxslt:get_variable($_XDOCTX,'V_CHK_NO')?>

FE

<?for-each:$invLines?><?if:position()>=$start and position()<$start+$lpp?>

Invoice Number

<?DocumentNumber/ReferenceNumber?>

Invoice Date

<?format-date:DocumentDate;'DD-MON-YYYY'?>

TotalDocumentAmount

<?format-number:TotalDocumentAmount/Value;'999G999D99'?>

Discount Amt

<?format-number:DiscountTaken/Amount/Value;'999G999D99'?>

0.00

<?xdofx:TotalDocumentAmount/Value-DiscountTaken/Amount/Value?>

EFE

<?end if?><?end for-each?><?end if?><?end for-each?>

CheckNumber

<?xdoxslt:get_variable($_XDOCTX,'V_CHK_NO')?>

Payment Date

<?format-date:xdoxslt:get_variable($_XDOCTX,'V_PAY_DATE');' DD-MON-YYYY'?>

if

<?if:count($invLines)<$start+$lpp?>

0.00

<?xdoxslt:get_variable($_XDOCTX,'V_GROSS_AMT')?>

Enif

<?end if?>

If

<?if:count($invLines)<$start+$lpp?>

0.00

<?xdoxslt:get_variable($_XDOCTX,'V_DIS_AMT_TOT')?>

Enif

<?end if?>

if

<?if:count($invLines)<$start+$lpp?>

0.00

<?xdoxslt:get_variable($_XDOCTX,'V_PAID_AMT_TOT')?>

Enif

<?end if?>

End Group: OutboundPayments

<?End for-each?>

For-each:xdoxslt:foreach_number($_XDOCTX,1,3,1) à This will loop 3 times

Printing labels in Avery template

How to create label using Avery template? What is need?

A scenario where we have to print the employee visiting cards in which user needs 3x3 = 9(9 emp inf labels in one page) 4x20 = 80 (80 emp inf labels in one page).For the data need to be repeated across the sheet use the below logic.

Here it is use the following xml

<ADDRESSES>
<ADDRESS>
<COMPANY>1 Oracle Street</COMPANY>
<NAME>Redwood Shores</NAME>
<ADD1>CA</ADD1>
<ADD2>94065</ADD2>
</ADDRESS>
<ADDRESS>
<COMPANY>2 Oracle Street</COMPANY>
<NAME>Redwood Shores</NAME>
<ADD1>CA</ADD1>
<ADD2>94065</ADD2>
</ADDRESS>
<ADDRESS>
...
...
</ADDRESSES>


Use the following code in Template.

For 3 Columns Avery template design in RTF for 3x3 = 9 Fields

In the first shape add this

<?for-each@shape:/Root/Row[(position() mod 3) = 1]?><?Code?><?shape-offset-y:(position()-1)*72?><?end-for-each?>


In the second column shape add this
<?for-each@shape:/Root/Row[(position() mod 3) = 2]?><?Code?><?shape-offset-y:(position()-1)*72?><?end-for-each?>

In the third column shape add this
<?for-each@shape:/Root/Row[(position() mod 3) = 0]?><?Code?><?shape-offset-y:(position()-1)*72?><?end-for-each?>

For 4Columns Avery template design in RTF for 4x20 = 80 Fields

In the first shape add this

<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 1]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>

In the second column shape add this
<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 2]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>


In the third column shape add this
<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 3]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>


In the fourth column shape add this

<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 0]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>



Demo repeating frame for the data to repeat in avery labels


ForLoopOutside

___________________________________

ForLoopInside

Company

Name

Add1

Add2
InsideEnd

___________________________________
OutsideEnd


Tags defined for 4x20 = 80 Repeatation of data in an avery label.


ForLoopOutside = <?for-each:DATA_RECORD[position() mod 4=1]?>

ForLoopInside = mailto:?for-each@column:.%20%20following-sibling::DATA_RECORD[position()%3c4]?

Company =<??>

Name =<??>

Add1 =<??>

Add2 =<??>

InsideEnd = <?end for-each?>

OutsideEnd= <?end for?><?split-by-page-break:?>


Template for Avery tables to print