نمایش نتایج: از شماره 1 تا 3 , از مجموع 3

موضوع: آموزش راستچین کردن pdf ها

  1. #1
    عضو انجمن xmasoud آواتار ها
    تاریخ عضویت
    Jan 2012
    محل سکونت
    AhWaZ
    نوشته ها
    219
    تشکر تشکر کرده 
    51
    تشکر تشکر شده 
    234
    تشکر شده در
    163 پست

    8 آموزش راستچین کردن pdf ها

    با سلام خدمت همکاران عزیز

    امروز خواستم این آموزش رو بذارم که خیلی ها مشکل داشتن فقط تشکر یادتون نره

    ببینید بعد از عوض کردن فونت بروید داخل روت قالب انتخابی که در حال نمایش است و بعد فایل invoicepdf.tpl کد زیر را جایگزین کنید که مشکل حل شه






    کد:
    <?php
    
    # Logo
    if (file_exists(ROOTDIR.'/images/logo.png')) $pdf->Image(ROOTDIR.'/images/logo.png',20,25,75,0,'','', $align='R');
    elseif (file_exists(ROOTDIR.'/images/logo.jpg')) $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25,75,0,'','','','','','R' );
    else $pdf->Image(ROOTDIR.'/images/placeholder.png',20,25,75,0,'','','','','','R');
    
    # Company Details
    $pdf->SetFont('freesans','',13);
    $pdf->Cell(0,6,trim($companyaddress[0]),0,1,'L');
    $pdf->SetFont('freesans','',9);
    for ( $i = 1; $i <= ((count($companyaddress)>6) ? count($companyaddress) : 6); $i += 1) {
        $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R');
    }
    $pdf->Ln(5);
    
    # Header Bar
    $invoiceprefix = $_LANG["invoicenumber"];
    /*
    ** This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice **
    if ($status!="Paid") {
        $invoiceprefix = $_LANG["proformainvoicenumber"];
    }
    */
    $pdf->SetFont('freesans','B',15);
    $pdf->SetFillColor(239);
    $pdf->Cell(0,8,$invoiceprefix.$invoicenum,0,1,'R','1');
    $pdf->SetFont('freesans','',10);
    $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.$datecreated.'',0,1,'R','1');
    $pdf->Cell(0,6,$_LANG["invoicesdatedue"].': '.$duedate.'',0,1,'R','1');
    $pdf->Ln(10);
    
    $startpage = $pdf->GetPage();
    
    # Clients Details
    $addressypos = $pdf->GetY();
    $pdf->SetFont('freesans','B',10);
    $pdf->Cell(0,4,$_LANG["invoicesinvoicedto"],0,1,'R');
    $pdf->SetFont('freesans','',9);
    if ($clientsdetails["companyname"]) {
        $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'R');
        $pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'R');
    } else {
        $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'R');
    }
    $pdf->Cell(0,4,$clientsdetails["address1"],0,1,'R');
    if ($clientsdetails["address2"]) {
        $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'R');
    }
    $pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'R');
    $pdf->Cell(0,4,$clientsdetails["country"],0,1,'R');
    if ($customfields) {
        $pdf->Ln();
        foreach ($customfields AS $customfield) {
            $pdf->Cell(0,4,$customfield['fieldname'].': '.$customfield['value'],0,1,'R');
        }
    }
    $pdf->Ln(10);
    
    # Invoice Items
    $tblhtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0">
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;">
            <td width="20%" align="center" >'.$_LANG['quotelinetotal'].'</td>
            <td width="80%">'.$_LANG['invoicesdescription'].'</td>
            
        </tr>';
    foreach ($invoiceitems AS $item) {
        $tblhtml .= '
        <tr bgcolor="#fff">
            <td align="center">'.$item['amount'].'</td>
            <td align="right">'.nl2br($item['description']).'<br /></td>
        </tr>';
    }
    $tblhtml .= '
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
            <td align="center">'.$subtotal.'</td>
            <td align="right">'.$_LANG['invoicessubtotal'].'</td>
        </tr>';
    if ($taxname) $tblhtml .= '
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
            <td align="center">'.$tax.'</td>
            <td align="right">'.$taxrate.'% '.$taxname.'</td>
        </tr>';
    if ($taxname2) $tblhtml .= '
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
            <td align="right">'.$taxrate2.'% '.$taxname2.'</td>
            <td align="center">'.$tax2.'</td>
        </tr>';
    $tblhtml .= '
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
            <td align="center">'.$credit.'</td>
            <td align="right">'.$_LANG['invoicescredit'].'</td>
        </tr>
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
            <td align="center">'.$total.'</td>
            <td align="right">'.$_LANG['invoicestotal'].'</td>
        </tr>
    </table>';
    
    $pdf->writeHTML($tblhtml, true, false, false, false, '');
    
    $pdf->Ln(5);
    
    # Transactions
    $pdf->SetFont('freesans','B',12);
    $pdf->Cell(0,4,$_LANG["invoicestransactions"],0,1,'R');
    
    $pdf->Ln(0);
    
    $pdf->SetFont('freesans','',9);
    
    $tblhtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0">
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;">
            <td width="25%">'.$_LANG['invoicestransdate'].'</td>
            <td width="25%">'.$_LANG['invoicestransgateway'].'</td>
            <td width="30%">'.$_LANG['invoicestransid'].'</td>
            <td width="20%">'.$_LANG['invoicestransamount'].'</td>
        </tr>';
    
    if (!count($transactions)) {
        $tblhtml .= '
        <tr bgcolor="#fff">
            <td colspan="4" align="center">'.$_LANG['invoicestransnonefound'].'</td>
        </tr>';
    } else {
        foreach ($transactions AS $trans) {
            $tblhtml .= '
            <tr bgcolor="#fff">
                <td align="center">'.$trans['date'].'</td>
                <td align="center">'.$trans['gateway'].'</td>
                <td align="center">'.$trans['transid'].'</td>
                <td align="center">'.$trans['amount'].'</td>
            </tr>';
        }
    }
    $tblhtml .= '
        <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
            <td colspan="3" align="center">'.$_LANG['invoicesbalance'].'</td>
            <td align="center">'.$balance.'</td>
        </tr>
    </table>';
    
    $pdf->writeHTML($tblhtml, true, false, false, false, '');
    
    # Notes
    if ($notes) {
        $pdf->Ln(5);
        $pdf->SetFont('freesans','',8);
        $pdf->MultiCell(170,5,$_LANG["invoicesnotes"].": $notes");
    }
    
    # Generation Date
    $pdf->SetFont('freesans','',8);
    $pdf->Ln(5);
    $pdf->Cell(180,4,$_LANG['invoicepdfgenerated'].' '.getTodaysDate(),'','','C');
    
    # Payment Status
    $endpage = $pdf->GetPage();
    $pdf->setPage($startpage);
    $pdf->SetXY(85,$addressypos);
    if ($status=="Cancelled") {
        $statustext = $_LANG["invoicescancelled"];
        $pdf->SetTextColor(245,245,245);
    } elseif ($status=="Unpaid") {
        $statustext = $_LANG["invoicesunpaid"];
        $pdf->SetTextColor(204,0,0);
    } elseif ($status=="Paid") {
        $statustext = $_LANG["invoicespaid"];
        $pdf->SetTextColor(153,204,0);
    } elseif ($status=="Refunded") {
        $statustext = $_LANG["invoicesrefunded"];
        $pdf->SetTextColor(34,68,136);
    } elseif ($status=="Collections") {
        $statustext = $_LANG["invoicescollections"];
        $pdf->SetTextColor(255,204,0);
    }
    $pdf->SetFont('freesans','B',40);
    $pdf->Cell(80,20,strtoupper($statustext),0,0,'L');
    $pdf->setPage($endpage);
    
    ?>




    موفق باشید

    در آزادی که هزاران کرکس در کمینند ، پس زنده باد قفس !!



    پــارس ســرور


  2. تعداد تشکر ها ازxmasoud به دلیل پست مفید


  3. # ADS




     

  4. #2
    عضو جدید
    تاریخ عضویت
    May 2009
    نوشته ها
    20
    تشکر تشکر کرده 
    4
    تشکر تشکر شده 
    18
    تشکر شده در
    15 پست

    پیش فرض پاسخ : آموزش راستچین کردن pdf ها

    سلام
    ممنون دوست عزیز

  5. #3
    عضو انجمن tejarathost آواتار ها
    تاریخ عضویت
    Jan 2012
    محل سکونت
    Hormozgan , Dubai
    نوشته ها
    185
    تشکر تشکر کرده 
    385
    تشکر تشکر شده 
    143
    تشکر شده در
    105 پست

    پیش فرض پاسخ : آموزش راستچین کردن pdf ها

    مسعود خان انشالله که همیشه در کارت موفق باشی
    فروش سرور مجازی از آلمان|آمریکا|فرانسه|کانفیگ های رایگان|میزبانی وبCPanel از ایران|آلمان
    میزبانی وب و سرور مجازی تجارت هاست www.TejaratHost.net
    تلفن : 4277 34 44 076 - 7994 995 0917

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. پاسخ ها: 2
    آخرين نوشته: February 13th, 2017, 16:16
  2. آموزش ایجاد بسته ی نصبی جوملا
    توسط whdesign در انجمن Joomla-Mambo
    پاسخ ها: 0
    آخرين نوشته: December 14th, 2016, 11:29
  3. آموزش ساخت بسته نصبی برای جوملا 3
    توسط ali09366 در انجمن Joomla-Mambo
    پاسخ ها: 1
    آخرين نوشته: May 25th, 2015, 01:19
  4. پاسخ ها: 17
    آخرين نوشته: July 27th, 2013, 10:21
  5. پاسخ ها: 3
    آخرين نوشته: January 21st, 2012, 19:06

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •