forked from science-ation/science-ation
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:
parent
016f104a5d
commit
8efb3f2bcf
@ -419,7 +419,7 @@ foreach($report_stock as $n=>$v) {
|
|||||||
ORDER BY `ord`");
|
ORDER BY `ord`");
|
||||||
print(mysql_error());
|
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)) {
|
while($a = mysql_fetch_assoc($q)) {
|
||||||
$f = $a['field'];
|
$f = $a['field'];
|
||||||
@ -429,14 +429,13 @@ foreach($report_stock as $n=>$v) {
|
|||||||
/* We dont' care about order, just construct
|
/* We dont' care about order, just construct
|
||||||
* ['option'][name] = value; */
|
* ['option'][name] = value; */
|
||||||
if(!in_array($f, $allow_options)) {
|
if(!in_array($f, $allow_options)) {
|
||||||
print("Type[$type] Field[$f] not allowed.\n");
|
// print("Type[$type] Field[$f] not allowed.\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$report['option'][$f] = $a['value'];
|
$report['option'][$f] = $a['value'];
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if(!in_array($f, $allow_fields)) {
|
if(!in_array($f, $allow_fields)) {
|
||||||
print("Type[$type] Field[$f] not allowed.\n");
|
// print("Type[$type] Field[$f] not allowed.\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Pull out all the data */
|
/* Pull out all the data */
|
||||||
@ -896,11 +895,25 @@ foreach($report_stock as $n=>$v) {
|
|||||||
if($f == 'static_text') $v = $d['value'];
|
if($f == 'static_text') $v = $d['value'];
|
||||||
|
|
||||||
$v = iconv("ISO-8859-1//TRANSLIT", "UTF-8", $v);
|
$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']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user