Thursday 30 August 2012

Check Print for multiple invoices


Generally in one check print one invoice information is very easy. But problem arises when a supplier pays multiple invoices in one check. 20-30 invoice still can be managed. But if it is more than 40 invoices then in a single check it can not be managed. Either it has o be restricted or Dummy check has to be printed in new page. Restriction also possible from payment profile or it has to be controlled in the rtf.

Assuming maximum 40 lines will be printed. If 3 invoices paid in one check that means 37 dummy lines has to be printed. So that gap can be maintained.

Solution 1:


<?for-each:OutboundPayment?>

--Set a variable with 0
<?xdoxslt:set_variable($_XDOCTX, 'y', 0)?>

       <?for-each:DocumentPayable?>
        ---print the Invoice, payment information 

        -- before the end of group increment with one
       <?xdoxslt:set_variable($_XDOCTX, 'y', xdoxslt:get_variable($_XDOCTX, 'y')+1)?> 
        <?End for-each?> 

        ---print 37 dummy lines
        <?for-each:xdoxslt:foreach_number($_XDOCTX,1,40-xdoxslt:get_variable($_XDOCTX, 'y'),1)?> 
         ----Dummy lines
        <?End for-each?>

<?End for-each?>


Solution 2: ---If more than 40 lines and dummy check has to be printed in new page

<?for-each:OutboundPayment?>

--Set a variable with 0
<?xdoxslt:set_variable($_XDOCTX, 'y', 0)?>

       <?for-each:DocumentPayable?>
       <?if:xdoxslt:get_variable($_XDOCTX, 'x') < 41?>
        ---print the Invoice, payment information 

       
       <?end if?>
         -- before the end of group increment with one
        <?xdoxslt:set_variable($_XDOCTX, 'y', xdoxslt:get_variable($_XDOCTX, 'y')+1)?> 
        <?End for-each?> 

        ---print 37 dummy lines
        <?for-each:xdoxslt:foreach_number($_XDOCTX,1,40-xdoxslt:get_variable($_XDOCTX, 'y'),1)?> 
         ----Dummy lines
        <?End for-each?>

<?End for-each?>




***In the new page****
<?for-each:DocumentPayable?>

<?if:xdoxslt:get_variable($_XDOCTX, 'y') > 40?>

  ---print the Invoice, payment information 

?end if?>
 -- before the end of group increment with one
 <?xdoxslt:set_variable($_XDOCTX, 'y', xdoxslt:get_variable($_XDOCTX, 'y')+1)?> 
  <?End for-each?> 




No comments:

Post a Comment