Jump to content

invoicepdf.tpl not accept function


Recommended Posts



I want to add below functions into invoicepdf.tpl :

function formatPageNumber($num) {
$strnum = strval($num);
$strnum = preg_replace_callback("/[0-9]/", create_function('$matches', '
$numarr = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹");
return $numarr[intval($matches[0])];'), $strnum);
return $strnum;
function formatDate($date) {
$strdate = explode('/',$date);
$strdate = formatPageNumber(gregorian_to_jalali($strdate[0],$strdate[1],$strdate[2],'/'));
return $strdate;

function gregorian_to_jalali($g_y,$g_m,$g_d,$mod=''){
$g_y=tr_num($g_y); $g_m=tr_num($g_m); $g_d=tr_num($g_d);/* <= :اين سطر ، جزء تابع اصلي نيست */
if($d_4==0 and $g_m>2)$doy_g++;
$a=($d_33==3 or $d_33<($d_4-1) or $d_4==0)?286:287;
$b=(($d_33==1 or $d_33==2) and ($d_33==$d_4 or $d_4==1))?78:(($d_33==3 and $d_4==0)?80:79);
 $jy=$g_y-621; $doy_j=$doy_g-$b;
 $jy=$g_y-622; $doy_j=$doy_g+$a;
 $jm=(int)(($doy_j-1)/31); $jd=$doy_j-(31*$jm++);
 $jm=(int)(($doy_j-187)/30); $jd=$doy_j-186-($jm*30); $jm+=7;


When I add them, cron job stop working but invoice create in new order or I can send email with Admin Area.


What should I Do?


Best Rigards,


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated