[Vtigercrm-developers] Hi, about insert product picture in quote PDF.

Yoinier Hernandez Nieves ynieves at ynieves.net
Thu Feb 21 09:26:57 PST 2013


El 2/11/2013 2:06 AM, Chaitanya Paneri escribió:
> Dear Yoinier,
>
> you can add to the product master and get it in PDF , we are using it.
>
> Chaitanya
>
(...)
Hi, this is my new function...

File include/InventoryPDFController.php.
Function buildFooterModel.

with that modifications i can show the route of pictures at description 
section of the pdf, but how i can insert the picture in PDF file??

any body can help me??
-- 
_____.___.      .__
\__  |   | ____ |__| _______  __ ____   ______
  /   |   |/    \|  |/ __ \  \/ // __ \ /  ___/
  \____   |   |  \  \  ___/\   /\  ___/ \___ \
  / ______|___|  /__|\___  >\_/  \___  >____  >
  \/           \/        \/          \/     \/
     .___      __   _______          __
   __| _/_____/  |_ \      \   _____/  |_
  / __ |/  _ \   __\/   |   \_/ __ \   __\
/ /_/ (  <_> )  | /    |    \  ___/|  |
\____ |\____/|__| \____|__  /\___  >__|
      \/                   \/     \/
-------------- next part --------------
// File include/InventoryPDFController.php
(...)
include_once 'data/CRMEntity.php';

class Vtiger_InventoryPDFController {
(...)
        function buildFooterModel() {
                global $adb;
                $footerModel = new Vtiger_PDF_Model();
                $associated_products = $this->associated_products;
                $data = '';
                foreach($associated_products as $productLineItem) {
                        ++$productLineItemIndex;
                        $productid = $productLineItem["hdnProductId{$productLineItemIndex}"];
                        $results = $adb->pquery("SELECT vts.crmid, vta.* FROM vtiger_seattachmentsrel vts, vtiger_attachments vta WHERE vts.crmid = '$productid' AND vts.attachmentsid = vta.attachmentsid LIMIT 1;", array());
                        $num_rows = $adb->num_rows($results);
                        if($num_rows) {
                            $product = $adb->fetch_array($results);
                            $data .= $product["path"].$product["attachmentsid"]."_".$product["name"];
                        }
                }
                $footerModel->set(Vtiger_PDF_InventoryFooterViewer::$DESCRIPTION_DATA_KEY, from_html($this->focusColumnValue('description'). $data));
                $footerModel->set(Vtiger_PDF_InventoryFooterViewer::$TERMSANDCONDITION_DATA_KEY, from_html($this->focusColumnValue('terms_conditions')));
                return $footerModel;
        }
(...)
}


More information about the vtigercrm-developers mailing list