= '$from' AND ".TB_PREF."bom.parent <= '$to' ORDER BY ".TB_PREF."bom.parent, ".TB_PREF."bom.component"; return db_query($sql,"No transactions were returned"); } //---------------------------------------------------------------------------------------------------- function print_bill_of_material() { global $path_to_root; include_once($path_to_root . "reporting/includes/pdf_report.inc"); $frompart = $_POST['PARAM_0']; $topart = $_POST['PARAM_1']; $comments = $_POST['PARAM_2']; $cols = array(0, 50, 305, 375, 445, 515); $headers = array(_('Component'), _('Description'), _('Loc'), _('Wrk Ctr'), _('Quantity')); $aligns = array('left', 'left', 'left', 'left', 'right'); $params = array( 0 => $comments, 1 => array('text' => _('Component'), 'from' => $frompart, 'to' => $topart)); $rep = new FrontReport(_('Bill of Material Listing'), "BillOfMaterial.pdf", user_pagesize()); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); $rep->Header(); $res = getTransactions($frompart, $topart); $parent = ''; while ($trans=db_fetch($res)) { if ($parent != $trans['parent']) { if ($parent != '') { $rep->Line($rep->row - 2); $rep->NewLine(2, 3); } $rep->TextCol(0, 1, $trans['parent']); $desc = get_item($trans['parent']); $rep->TextCol(1, 2, $desc['description']); $parent = $trans['parent']; $rep->NewLine(); } $rep->NewLine(); $dec = get_qty_dec($trans['component']); $rep->TextCol(0, 1, $trans['component']); $rep->TextCol(1, 2, $trans['CompDescription']); //$rep->TextCol(2, 3, $trans['loc_code']); //$rep->TextCol(3, 4, $trans['workcentre_added']); $wc = get_work_centre($trans['workcentre_added']); $rep->TextCol(2, 3, get_location_name($trans['loc_code'])); $rep->TextCol(3, 4, $wc['name']); $rep->TextCol(4, 5, number_format2($trans['quantity'], $dec)); } $rep->Line($rep->row - 4); $rep->End(); } ?>