The SimpleInvoices forum has moved to Google Plus - this forum is now read-only

tecjam

  • santosh
    santosh
    Can you please let me know how you are sending both PDF and Text in email for Invoice ?
    October 2012
  • ishaan
    ishaan
    Hi:

    I am getting blank page when I use your function: Function: due_date
    Can you assist me to to fix this issue.
    March 2012
  • dumnew
    dumnew
    i copy your code to si/templates/invoices/default/plugins folder
    and name it function.due_date.php
    <?php<br />
    //function smarty_function_due_date($params, &$smarty)
    /**
    * Function: due_date
    *
    * Calculates the due date by adding the amount of days to the unix timestamp.
    *
    * Arguments:
    *
    * date - the default date output - in this format: eg: 25 May 2011
    * days - amount of days to due date - eg: 14
    *
    * How to add to template:
    *
    * Paste this where you wish the due date to appear:
    *
    * {due_date date=$invoice.date days=14}
    *
    **/

    function smarty_function_due_date($params, &$smarty)
    {
    if ($params['date'] != null AND $params['days'] != null) {

    $today = htmlsafe($params[date]);
    $days_to_add = htmlsafe($params[days]);

    $timestamp = strtotime($today);
    $due_date_stamp = strtotime($days_to_add.' day', $timestamp);
    echo date('d M Y', $due_date_stamp);
    }
    }
    ?>

    then I put this line in si/templates/invoice/default/template.tpl

    result : blank page, what did i do wrong?
    September 2011
  • tecjam
    tecjam joined.
    Welcome Aboard!
    May 2011

About

Username
tecjam
Joined
May 2011
Visits
5
Last Active
June 2011
Roles
Member