Add projectbarcode (only works with tcpdf)

IF report has no items, still return the empty shell of the report (fix typo,. was returning $ret, instead of  $report)
This commit is contained in:
james 2011-03-17 22:20:45 +00:00
parent 016f104a5d
commit 8efb3f2bcf

View File

@ -419,7 +419,7 @@ foreach($report_stock as $n=>$v) {
ORDER BY `ord`");
print(mysql_error());
if(mysql_num_rows($q) == 0) return $ret;
if(mysql_num_rows($q) == 0) return $report;
while($a = mysql_fetch_assoc($q)) {
$f = $a['field'];
@ -429,14 +429,13 @@ foreach($report_stock as $n=>$v) {
/* We dont' care about order, just construct
* ['option'][name] = value; */
if(!in_array($f, $allow_options)) {
print("Type[$type] Field[$f] not allowed.\n");
// print("Type[$type] Field[$f] not allowed.\n");
continue;
}
$report['option'][$f] = $a['value'];
break;
default:
if(!in_array($f, $allow_fields)) {
print("Type[$type] Field[$f] not allowed.\n");
// print("Type[$type] Field[$f] not allowed.\n");
continue;
}
/* Pull out all the data */
@ -896,11 +895,25 @@ foreach($report_stock as $n=>$v) {
if($f == 'static_text') $v = $d['value'];
$v = iconv("ISO-8859-1//TRANSLIT", "UTF-8", $v);
if($f=="projectbarcode") {
$style = array(
'border' => 2,
'vpadding' => 'auto',
'hpadding' => 'auto',
'fgcolor' => array(0,0,0),
'bgcolor' => false, //array(255,255,255)
'module_width' => 2, // width of a single module in points
'module_height' => 2 // height of a single module in points
);
$rep->barcode($v, 'QRCODE,H', $d['x'], $d['y'], $d['w'], $d['h'], $style, 'N');
}
else {
$rep->label_text($d['x'], $d['y'], $d['w'], $d['h'],
$v, $show_box, $d['align'], $d['valign'],
$d['fontname'],$d['fontstyle'],$d['fontsize'],
$d['on_overflow']);
}
$rep->label_text($d['x'], $d['y'], $d['w'], $d['h'],
$v, $show_box, $d['align'], $d['valign'],
$d['fontname'],$d['fontstyle'],$d['fontsize'],
$d['on_overflow']);
}
}