X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep409.php;h=60f58b049be4341e66ab62dfea0c80068254afe7;hb=1d8bbcbf6bf6c663d83283be329758a936f863fa;hp=f454c41f431f668f07aa3d5179e521ebea7f9aac;hpb=31a87119c319b95241389111765b40a3faadf4f6;p=fa-stable.git diff --git a/reporting/rep409.php b/reporting/rep409.php index f454c41f..60f58b04 100644 --- a/reporting/rep409.php +++ b/reporting/rep409.php @@ -9,14 +9,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -$page_security = 2; -// ---------------------------------------------------------------- -// $ Revision: 2.0 $ -// Creator: Janusz Dobrwolski -// date_: 2008-01-14 -// Title: Print Workorders -// draft version! +$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ? + 'SA_MANUFTRANSVIEW' : 'SA_MANUFBULKREP'; // ---------------------------------------------------------------- +// Title: Work Orders $path_to_root=".."; include_once($path_to_root . "/includes/session.inc"); @@ -32,7 +28,7 @@ print_workorders(); function print_workorders() { - global $path_to_root; + global $path_to_root, $SysPrefs, $dflt_lang; include_once($path_to_root . "/reporting/includes/pdf_report.inc"); @@ -62,6 +58,7 @@ function print_workorders() if ($email == 0) { $rep = new FrontReport(_('WORK ORDER'), "WorkOrderBulk", user_pagesize()); + $rep->SetHeaderType('Header2'); $rep->currency = $cur; $rep->Font(); $rep->Info($params, $cols, null, $aligns); @@ -72,19 +69,25 @@ function print_workorders() $myrow = get_work_order($i); if ($myrow === false) continue; - $date_ = sql2date($myrow["date_"]); + $date_ = sql2date($myrow["date_"]); if ($email == 1) { $rep = new FrontReport("", "", user_pagesize()); + $rep->SetHeaderType('Header2'); $rep->currency = $cur; $rep->Font(); $rep->title = _('WORK ORDER'); - $rep->filename = "WorkOrder" . $myrow['reference'] . ".pdf"; + $rep->filename = "WorkOrder" . $myrow['wo_ref'] . ".pdf"; $rep->Info($params, $cols, null, $aligns); } else $rep->title = _('WORK ORDER'); - $rep->Header2($myrow, null, null, '', 26); + + $contact[] = array('email' =>$myrow['email'],'lang' => $dflt_lang, + 'name' => $myrow['contact'], 'name2' => '', 'contact'); + + $rep->SetCommonData($myrow, null, null, '', 26, $contact); + $rep->NewPage(); $result = get_wo_requirements($i); $rep->TextCol(0, 5,_("Work Order Requirements"), -2); @@ -102,7 +105,7 @@ function print_workorders() $qoh = get_qoh_on_date($myrow2["stock_id"], $myrow2["loc_code"], $date_); if ($show_qoh && ($myrow2["units_req"] * $myrow["units_issued"] > $qoh) && - !sys_prefs::allow_negative_stock()) + !$SysPrefs->allow_negative_stock()) { // oops, we don't have enough of one of the component items $has_marked = true; @@ -125,18 +128,24 @@ function print_workorders() $rep->AmountCol(6, 7, $myrow2['units_issued'], $dec, -2); $rep->NewLine(1); if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight)) - $rep->Header2($myrow, null, null,'',26); + $rep->NewPage(); } $rep->NewLine(1); $rep->TextCol(0, 5," *** = "._("Insufficient stock"), -2); - $comments = get_comments(26, $i); + $comments = get_comments(ST_WORKORDER, $i); if ($comments && db_num_rows($comments)) { $rep->NewLine(); while ($comment=db_fetch($comments)) $rep->TextColLines(0, 6, $comment['memo_'], -2); } + if ($email == 1) + { + $myrow['DebtorName'] = $myrow['contact']; + $myrow['reference'] = $myrow['wo_ref']; + $rep->End($email, _("Work Order No.") . " " . $myrow['wo_ref'], $myrow); + } } if ($email == 0) $rep->End();