[Vtigercrm-developers] Did anybody work on PDFMaker custom function?

IT-Solutions4You info at its4you.sk
Thu Sep 8 07:15:13 GMT 2016


Hi,

 > $listprice = $row['listprice'];

must be inside

 > 	for($j=0;$j<count($row);$j++){
 > 	
 > 	$loop1 = $loop1."<td>$listprice";
 > 	
 > 	}

otherway you define $listprice only one time from first row.


Matus


Dňa 8. 9. 2016 o 6:14 kiran napísal(a):
> @Matus.
>
> I have done like this
>
> <?php
> 	global $log;
> if (!function_exists('product_custom')) {
>
>     function product_custom($entityid) {
> 	$adb = PearDatabase::getInstance();
> 	$row = $adb->fetchByAssoc($adb->pquery("SELECT listprice FROM
> vtiger_inventoryproductrel WHERE id=?", array($entityid)));
> 	$listprice = $row['listprice'];
> 	$f = "
>
> 	
>
> 			
> 		Name
> 		
> 	";
> 	$start = "
> ";
> 	for($j=0;$j<count($row);$j++){
> 	
> 	$loop1 = $loop1."<td>$listprice";
> 	
> 	}
> 	$end = "";
> 	$e = "
> ";
>
> 	
>         return $f.$start.$loop1.$end.$e;
>     }
> }
>
> Here $entityid is purchaseorderid when doing this it is working with
> purchase order have only one line item. I have tried this with purchase
> order with multiple line items, but nothing is returning. Can you have any
> idea where should i have mistaken?
>
> Thanks & Regards
>
>
>
> --
> View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-Did-anybody-work-on-PDFMaker-custom-function-tp19780p19790.html
> Sent from the vtigercrm-developers mailing list archive at Nabble.com.
> _______________________________________________
> http://www.vtiger.com/
>




More information about the vtigercrm-developers mailing list