1. Import
This commit is contained in:
136
html/stock/ajaxReqScanExecution.php
Normal file
136
html/stock/ajaxReqScanExecution.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
include_once ("../include/global.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
|
||||
// Check HTTP-Parameters
|
||||
// Stocks
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdCurrent", "statusMessage", "deactivateMenu",
|
||||
"mode", "scanCode", "stkIdRoot"));
|
||||
|
||||
if ($mode != "") :
|
||||
header("Content-Type: text/html; charset=ISO-8859-1\n");
|
||||
endif;
|
||||
|
||||
// echo "alert('" . $mode . " ' + '" . $scanCode . " ');";
|
||||
|
||||
if ($mode == "0") :
|
||||
echo "scanCodeIsSerialNo = false;";
|
||||
echo "scanCodeIsArticleBarcode = false;";
|
||||
echo "scanCodeIsStockBarcode = false;";
|
||||
|
||||
elseif ($mode == "1") :
|
||||
// Check scan code is a serial no.
|
||||
$whereClause = "stkmv.stkmv_serialno = '" . $scanCode . "' AND stkmv.stk_id_to != '0'"; // Get the "outgoing good" entry of the journal with this special serial number
|
||||
// $orderByClause = "stkmv.stkmv_timestamp DESC"; // Get the youngest entry (current place), e.g. this article was put from stoch A to stock B ...
|
||||
|
||||
$sqlStmt = getStmtStockJournal($whereClause, $orderByClause);
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$count = 0;
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$tmpStkMvData = "";
|
||||
$tmpStkMvData .= "'" . $row["stkmv_id"] . "',";
|
||||
$tmpStkMvData .= ($row["stk_id_from"] == "" ? "'0'," : "'" . $row["stk_id_from"] . "',");
|
||||
$tmpStkMvData .= "'" . $row["at_id"] . "',";
|
||||
$tmpStkMvData .= ($row["stk_id_to"] == "" ? "'0'," : "'" . $row["stk_id_to"] . "',");
|
||||
$tmpStkMvData .= "'" . $row["stkmv_tan"] . "',";
|
||||
$tmpStkMvData .= "'" . $row["stkmv_serialno"] . "'";
|
||||
$count++;
|
||||
endwhile;
|
||||
$result->free();
|
||||
if ($count > 0) :
|
||||
echo "scanCodeIsSerialNo = true;";
|
||||
echo "stkMvData = new Array (" . $tmpStkMvData . ");";
|
||||
endif;
|
||||
|
||||
elseif ($mode == "2") :
|
||||
// Check scan code is an article barcode
|
||||
|
||||
$whereClause = "at.at_barcode = '" . $scanCode . "'"; // Get the "outgoing good" entry of the journal with this special serial number
|
||||
// $orderByClause = "stkmv.stkmv_timestamp DESC"; // Get the youngest entry (current place), e.g. this article was put from stoch A to stock B ...
|
||||
|
||||
$sqlStmt = getStmtArticle($whereClause, $orderByClause);
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$count = 0;
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$tmpStkMvData = "";
|
||||
$tmpStkMvData .= "'" . $row["at_id"] . "',";
|
||||
$tmpStkMvData .= "'" . $row["at_eid"] . "',";
|
||||
$tmpStkMvData .= "'" . $row["at_name"] . "',";
|
||||
$tmpStkMvData .= "'" . $row["at_match"] . "'";
|
||||
$count++;
|
||||
endwhile;
|
||||
$result->free();
|
||||
if ($count > 0) :
|
||||
echo "scanCodeIsArticleBarcode = true;";
|
||||
echo "stkMvArticleData = new Array (" . $tmpStkMvData . ");";
|
||||
endif;
|
||||
|
||||
elseif ($mode == "3") :
|
||||
// Check scan code is a stock barcode
|
||||
|
||||
if ($stkIdRoot != "" && is_numeric($stkIdRoot)) :
|
||||
$whereClause = "stk.stk_barcode = '" . $scanCode . "'"; // Get the stock entry according to the specified serial number
|
||||
|
||||
$sqlStmt = getStmtAllStocksByStkId($stkIdRoot, $whereClause);
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$count = 0;
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$tmpStkMvData = "";
|
||||
$tmpStkMvData .= "'" . $row["stk_id"] . "',";
|
||||
$tmpStkMvData .= "'" . $row["stk_name"] . "',";
|
||||
$tmpStkMvData .= "'" . $row["stk_barcode"] . "'";
|
||||
$count++;
|
||||
endwhile;
|
||||
$result->free();
|
||||
if ($count > 0) :
|
||||
echo "scanCodeIsStockBarcode = true;";
|
||||
echo "stkMvStockData = new Array (" . $tmpStkMvData . ");";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
elseif ($mode == "9") :
|
||||
// Get all stocks of the current root stock
|
||||
$output = "";
|
||||
if ($stkIdRoot != "" && is_numeric($stkIdRoot)) :
|
||||
|
||||
$sqlStmt = getStmtAllStocksByStkId($stkIdRoot);
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$stkIdArray = array();
|
||||
$stkNameArray = array();
|
||||
$stkBarcodeArray = array();
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$stkIdArray[] = strtoupper($row["stk_id"]);
|
||||
$stkNameArray[] = strtoupper($row["stk_name"]);
|
||||
$stkBarcodeArray[] = strtoupper($row["stk_barcode"]);
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
$stkIdArrayLen = count($stkIdArray);
|
||||
$tmpListStkId = "";
|
||||
$tmpListStkName = "";
|
||||
$tmpListStkBarcode = "";
|
||||
for ($j = 0; $j < $stkIdArrayLen; $j++) :
|
||||
$tmpListStkId .= "\"" . $stkIdArray[$j] . "\"";
|
||||
$tmpListStkName .= "\"" . $stkNameArray[$j] . "\"";
|
||||
$tmpListStkBarcode .= "\"" . $stkBarcodeArray[$j] . "\"";
|
||||
if ($j < ($stkIdArrayLen - 1)) :
|
||||
$tmpListStkId .= ",";
|
||||
$tmpListStkName .= ",";
|
||||
$tmpListStkBarcode .= ",";
|
||||
endif;
|
||||
endfor;
|
||||
echo "listLenth = " . $stkIdArrayLen . ";";
|
||||
echo "stkIdList = new Array (" . $tmpListStkId . ");";
|
||||
echo "stkNameList = new Array (" . $tmpListStkName . ");";
|
||||
echo "stkBarcodeList = new Array (" . $tmpListStkBarcode . ");";
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
43
html/stock/ajaxReqStock.php
Normal file
43
html/stock/ajaxReqStock.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
include_once ("../include/global.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
include_once ("../include/inc_article.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
// Stocks
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdCurrent", "statusMessage", "deactivateMenu",
|
||||
"mode", "scanCode", "stkIdRoot", "atId"));
|
||||
|
||||
if ($mode != "") :
|
||||
header("Content-Type: text/html; charset=ISO-8859-1\n");
|
||||
endif;
|
||||
|
||||
// echo "alert('" . $mode . " ' + '" . $atId . " ');";
|
||||
|
||||
if ($mode == "0") :
|
||||
// Check article is a bundled article
|
||||
|
||||
if ($atId != "" && is_numeric($atId)) :
|
||||
$isBundledArticle = isBundledArticle($atId);
|
||||
|
||||
if ($isBundledArticle) :
|
||||
echo "isBundledArticle = '1';";
|
||||
else :
|
||||
echo "isBundledArticle = '0';";
|
||||
endif;
|
||||
else :
|
||||
echo "isBundledArticle = '0';";
|
||||
endif;
|
||||
|
||||
elseif ($mode == "1") :
|
||||
//
|
||||
|
||||
elseif ($mode == "2") :
|
||||
//
|
||||
|
||||
elseif ($mode == "3") :
|
||||
//
|
||||
|
||||
endif;
|
||||
?>
|
||||
308
html/stock/article_item.php
Normal file
308
html/stock/article_item.php
Normal file
@@ -0,0 +1,308 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* article_item.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual", "deactivateMenu",
|
||||
"stkIdRoot", "stkIdCurrent", "stkId", "atId", "searchField", "f_stkat_export"));
|
||||
|
||||
|
||||
// Check authentication verifying emmployee an his/her costcenter- and customer-association
|
||||
if ( !( ($userType == "1") || ($userType == "4") || authCheck($hq_id,$usr_id,$emp_id,$cscIdRoot,$customerId,$cscIdActual) ) ) :
|
||||
gotoReferer("1");
|
||||
endif;
|
||||
|
||||
getLanguage(__FILE__);
|
||||
|
||||
$deactivateMenuStatic = "1";
|
||||
$pageTitel = getLngt("SERIENNUMMERN");
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
getCurrentScript(__FILE__);
|
||||
|
||||
|
||||
function postParseStockArticleItems ($textToParse) {
|
||||
global $f_stkmv_export;
|
||||
$textToParse = trim($textToParse);
|
||||
|
||||
if ($textToParse != "") :
|
||||
|
||||
// Iterate ALL occurrences of "<postparser>...</postparser>"
|
||||
while (!(strpos($textToParse, "<postparser>") === FALSE)) {
|
||||
|
||||
$beginTagPosBegin = strpos($textToParse, "<postparser>");
|
||||
$beginTagPosEnd = $beginTagPosBegin + 12;
|
||||
$endTagPosBegin = strpos($textToParse, "</postparser>");
|
||||
$endTagPosEnd = $endTagPosBegin + 13;
|
||||
|
||||
if ($beginTagPosEnd < $endTagPosBegin) :
|
||||
$tagContent = substr($textToParse, $beginTagPosEnd, $endTagPosBegin - $beginTagPosEnd);
|
||||
$tagContent = trim($tagContent);
|
||||
|
||||
if ($tagContent != "" && !(strpos($tagContent, "|") === FALSE)) :
|
||||
$tagContent = str_replace("|", "-,-", $tagContent);
|
||||
$parseArray = spliti("-,-", $tagContent); // (stk.stk_id,'0',at.at_id,'',ati.ati_serialno,ati.ati_data_01,ati.ati_data_02,ati.ati_data_03,ati.ati_data_04, ..., ati.ati_data_15)
|
||||
// Special treatment
|
||||
if ($f_stkmv_export != "1") :
|
||||
$tagContent = "<br><a href=\"javascript:finishPageArticleItemAction('" . $parseArray[0] . "', '" . $parseArray[1] . "', '" . $parseArray[2] . "', '" . $parseArray[3] . "', '" . $parseArray[4] . "', '" . $parseArray[5] . "', '" . $parseArray[6] . "', '" . $parseArray[7] . "', '" . $parseArray[8] . "', '" . $parseArray[9] . "', '" . $parseArray[10] . "', '" . $parseArray[11] . "', '" . $parseArray[12] . "', '" . $parseArray[13] . "', '" . $parseArray[14] . "', '" . $parseArray[15] . "', '" . $parseArray[16] . "', '" . $parseArray[17] . "', '" . $parseArray[18] . "', '" . $parseArray[19] . "')\">" . getLngt("Disponieren") . "</a>";
|
||||
else :
|
||||
$tagContent = "";
|
||||
endif;
|
||||
|
||||
// Remove last "<br>"
|
||||
// $tagContent = substr($tagContent, 0, -4);
|
||||
endif;
|
||||
|
||||
// Substitute text fragment
|
||||
$textToParse = substr_replace($textToParse, $tagContent, $beginTagPosBegin, $endTagPosEnd - $beginTagPosBegin);
|
||||
endif;
|
||||
}
|
||||
endif;
|
||||
return $textToParse;
|
||||
}
|
||||
|
||||
|
||||
$numOfRows = 0;
|
||||
$output = "";
|
||||
|
||||
if ($atId != "") :
|
||||
|
||||
$atEid = getFieldValueFromId("article","at_id",$atId,"at_eid");
|
||||
|
||||
$searchField = trim($searchField);
|
||||
$tmpWhereClause = "";
|
||||
if ($searchField != "") :
|
||||
$tmpWhereClause = "(at.at_eid LIKE '%" . $searchField . "%' OR at.at_name LIKE '%" . $searchField . "%' OR "
|
||||
. "at.at_match LIKE '%" . $searchField . "%' OR at.at_description LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_serialno LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_01 LIKE '%" . $searchField . "%' OR ati.ati_data_02 LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_03 LIKE '%" . $searchField . "%' OR ati.ati_data_04 LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_05 LIKE '%" . $searchField . "%' OR ati.ati_data_06 LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_07 LIKE '%" . $searchField . "%' OR ati.ati_data_08 LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_09 LIKE '%" . $searchField . "%' OR ati.ati_data_10 LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_11 LIKE '%" . $searchField . "%' OR ati.ati_data_12 LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_13 LIKE '%" . $searchField . "%' OR ati.ati_data_14 LIKE '%" . $searchField . "%' OR "
|
||||
. "ati.ati_data_15 LIKE '%" . $searchField . "%')";
|
||||
endif;
|
||||
|
||||
$tmpFieldClause = ", CONCAT(IFNULL(stk.stk_id,''),'|','0','|',at.at_id,'|','','|',ati.ati_serialno,'|',ati.ati_data_01,'|',ati.ati_data_02,'|',ati.ati_data_03,'|',ati.ati_data_04,'|',ati.ati_data_05,'|',ati.ati_data_06,'|',ati.ati_data_07,'|',ati.ati_data_08,'|',ati.ati_data_09,'|',ati.ati_data_10,'|',ati.ati_data_11,'|',ati.ati_data_12,'|',ati.ati_data_13,'|',ati.ati_data_14,'|',ati.ati_data_15) AS ati_x";
|
||||
$sqlStmt = getStmtStockArticleItems($atId, $stkId, $tmpWhereClause, $tmpFieldClause);
|
||||
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
|
||||
// Get the root stock
|
||||
if ($stkIdRoot == "") :
|
||||
$stkIdRoot = getStkPathId($stkId);
|
||||
endif;
|
||||
// Get the headlines if exist
|
||||
$tmpHeadlines = getParameterValue("0", "MASK_STK_DATAFIELDHEADLINES_" . $stkIdRoot, "0");
|
||||
if ($tmpHeadlines != "") :
|
||||
$titleArray = array(getLngt("Disponieren "), getLngt("Lagerort "), getLngt("Artikel "), getLngt("Seriennummer "));
|
||||
$tmpHeadlinesArray = spliti(",", $tmpHeadlines);
|
||||
$tmpHeadlinesArrayLen = count($tmpHeadlinesArray);
|
||||
for ($i = 0; $i < $tmpHeadlinesArrayLen; $i++) :
|
||||
if ($tmpHeadlinesArray[$i] != "") :
|
||||
$titleArray[] = $tmpHeadlinesArray[$i];
|
||||
else :
|
||||
$titleArray[] = "";
|
||||
endif;
|
||||
endfor;
|
||||
else :
|
||||
$titleArray = array(getLngt("Disponieren "), getLngt("Lagerort "), getLngt("Artikel "), getLngt("Seriennummer "),
|
||||
getLngt("Datenfeld 01 "), getLngt("Datenfeld 02 "), getLngt("Datenfeld 03 "), getLngt("Datenfeld 04 "), getLngt("Datenfeld 05 "),
|
||||
getLngt("Datenfeld 06 "), getLngt("Datenfeld 07 "), getLngt("Datenfeld 08 "), getLngt("Datenfeld 09 "), getLngt("Datenfeld 10 "),
|
||||
getLngt("Datenfeld 11 "), getLngt("Datenfeld 12 "), getLngt("Datenfeld 13 "), getLngt("Datenfeld 14 "), getLngt("Datenfeld 15 "));
|
||||
endif;
|
||||
$aligns = "l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l";
|
||||
$fieldArray = array("ati_x", "stk_name", "at_eid", "ati_serialno", "ati_data_01", "ati_data_02", "ati_data_03", "ati_data_04", "ati_data_05", "ati_data_06", "ati_data_07", "ati_data_08", "ati_data_09", "ati_data_10", "ati_data_11", "ati_data_12", "ati_data_13", "ati_data_14", "ati_data_15");
|
||||
$postParserField = "ati_x";
|
||||
|
||||
$alignArray = spliti(",",$aligns);
|
||||
$alignTitles = "left";
|
||||
$widths = "100";
|
||||
$widthArray = spliti(",",$widths);
|
||||
$summationField = "";
|
||||
$mode = "1"; // Output from DB-RESULT
|
||||
$javaScriptFunctionNameForSort = "";
|
||||
$sortDBField = ""; // Used in following include-file for sorting per column;
|
||||
// $fieldSortArray = array("YES","YES","YES","YES","YES","YES");
|
||||
include ("../include/inc_list_defineoutput.inc.php");
|
||||
// Post parsing if necessary
|
||||
if ($postParserField != "") :
|
||||
$tableBody = postParseStockArticleItems($tableBody);
|
||||
endif;
|
||||
|
||||
$output .= "<table>\n";
|
||||
$output .= $tableHeader . $tableBody;
|
||||
$output .= "</table>\n";
|
||||
|
||||
$result->free();
|
||||
|
||||
$numOfRows = $rowCounter;
|
||||
|
||||
// Optional output to file
|
||||
if ($f_stkat_export == "1") :
|
||||
array_shift($titleArray);
|
||||
array_shift($fieldArray);
|
||||
stockFilesOutputCSV($sqlStmt, $titleArray, $fieldArray, $aligns, getLngt("EINZELARTIKEL"), "", "postParseStockArticleItems");
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?php echo $pageTitel ?></title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
// Set page parameters according to the requested journal entry to move the article again
|
||||
function finishPageArticleItemAction(stk_id, stk2_id, at_id, stkmv_tan, stkmv_serialno, stkmv_data_01, stkmv_data_02, stkmv_data_03, stkmv_data_04, stkmv_data_05, stkmv_data_06, stkmv_data_07, stkmv_data_08, stkmv_data_09, stkmv_data_10, stkmv_data_11, stkmv_data_12, stkmv_data_13, stkmv_data_14, stkmv_data_15) {
|
||||
|
||||
frm = opener.document.forms[0];
|
||||
|
||||
// * Prepare for outgoing disposition *
|
||||
opener.clearArticleMoveFields();
|
||||
|
||||
if (frm.f_mv_stk_from) {frm.f_mv_stk_from.value = stk_id};
|
||||
// if (frm.f_mv_stk_to) {frm.f_mv_stk_to.value = '0'};
|
||||
<?php
|
||||
// Get parameter to set the "stock to" equal to "stock from" if link "Disposition" has been selected
|
||||
$tmpStkIdRoot = getStkPathId($stkIdRoot); // Makes it safe to have a real root stock
|
||||
$maskStkatShowPermanent = getParameterValue("0", "MASK_LINK_DISPOSITION_STKTO_EQ_STKFROM_" . $tmpStkIdRoot, "0");
|
||||
if ($maskStkatShowPermanent == "1") :
|
||||
echo "if (frm.f_mv_stk_to) {frm.f_mv_stk_to.value = stk_id};";
|
||||
endif;
|
||||
?>
|
||||
|
||||
// if (frm.f_mv_at) {frm.f_mv_at.value = at_id};
|
||||
for(i=0;i<frm.f_mv_at.length;++i) {
|
||||
if (frm.f_mv_at.options[i].value == at_id) {
|
||||
frm.f_mv_at.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
// if (frm.f_mv_stk_itemquantity) {frm.f_mv_stk_itemquantity.value = 0};
|
||||
// if (frm.f_mv_tan) {frm.f_mv_tan.value = stkmv_tan};
|
||||
// if (frm.f_mv_remark) {frm.f_mv_remark.value = ''};
|
||||
if (frm.f_mv_serialno) {
|
||||
frm.f_mv_serialno.value = stkmv_serialno;
|
||||
if (stkmv_serialno != '') {
|
||||
if (frm.f_mv_stk_itemquantity) {frm.f_mv_stk_itemquantity.value = '1'};
|
||||
};
|
||||
if (frm.f_mv_serialno_old) {
|
||||
frm.f_mv_serialno_old.value = stkmv_serialno;
|
||||
};
|
||||
};
|
||||
|
||||
// Fill extra data fields if they are set
|
||||
frm.f_mv_datafield_01.value = stkmv_data_01;
|
||||
frm.f_mv_datafield_02.value = stkmv_data_02;
|
||||
frm.f_mv_datafield_03.value = stkmv_data_03;
|
||||
frm.f_mv_datafield_04.value = stkmv_data_04;
|
||||
frm.f_mv_datafield_05.value = stkmv_data_05;
|
||||
frm.f_mv_datafield_06.value = stkmv_data_06;
|
||||
frm.f_mv_datafield_07.value = stkmv_data_07;
|
||||
frm.f_mv_datafield_08.value = stkmv_data_08;
|
||||
frm.f_mv_datafield_09.value = stkmv_data_09;
|
||||
frm.f_mv_datafield_10.value = stkmv_data_10;
|
||||
frm.f_mv_datafield_11.value = stkmv_data_11;
|
||||
frm.f_mv_datafield_12.value = stkmv_data_12;
|
||||
frm.f_mv_datafield_13.value = stkmv_data_13;
|
||||
frm.f_mv_datafield_14.value = stkmv_data_14;
|
||||
frm.f_mv_datafield_15.value = stkmv_data_15;
|
||||
|
||||
opener.checkSerialno(); // Serial number field has to be set before call
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
function downloadStockFile() {
|
||||
var widthPopupWin = 850;
|
||||
var heightPopupWin = 600;
|
||||
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
|
||||
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
|
||||
var popupWin;
|
||||
|
||||
popupWin = window.open("../include/data_download.php?f_path=../temp/download/&f_fileName=<?php echo $f_secretFileName ?>", "","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
|
||||
};
|
||||
|
||||
function exportFinishPage() {
|
||||
// document.forms[0].f_act.value = '';
|
||||
document.forms[0].f_stkat_export.value = '1';
|
||||
document.forms[0].submit();
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?><?php if ($f_stkat_export) : echo "downloadStockFile();"; endif; ?>displayStatusMessage();">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<form action="../stock/article_item.php" method="post">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="customerId" value="<?php echo $customerId ?>">
|
||||
<input type="hidden" name="cscIdRoot" value="<?php echo $cscIdRoot ?>">
|
||||
<input type="hidden" name="cscIdActual" value="<?php echo $cscIdActual ?>">
|
||||
|
||||
<input type="hidden" name="stkIdRoot" value="<?php echo ec($stkIdRoot) ?>">
|
||||
<input type="hidden" name="stkIdCurrent" value="<?php echo ec($stkIdCurrent) ?>">
|
||||
<input type="hidden" name="stkId" value="<?php echo ec($stkId) ?>">
|
||||
<input type="hidden" name="atId" value="<?php echo ec($atId) ?>">
|
||||
<input type="hidden" name="searchField" value="<?php echo ec($searchField) ?>">
|
||||
<input type="hidden" name="f_stkat_export" value="">
|
||||
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("20px"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("300px","left"); ?>><?php echo getLngt("Artikel") . ": " . $atEid ?></div>
|
||||
<?php echo defineButtonType10(getLngt("Export"), "action_move", "exportFinishPage();", "150", "left", "2") ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<?php echo $output ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("15px"); ?>
|
||||
|
||||
<div>
|
||||
<?php echo getLngt("Anzahl Einträge:") ?> <?php echo $numOfRows ?><?php if ($numOfRows == "0" && $f_act == "search" && $statusMessage == "") : echo " " . getLngt("(Keine Einträge gefunden.)"); endif; ?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
412
html/stock/article_list.php
Normal file
412
html/stock/article_list.php
Normal file
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* article_list.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../include/inc_wording_wrapper.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "f_mode", "orderClause", "statusMessage", "f_at_eid", "f_at_name", "f_at_match", "f_at_description",
|
||||
"f_at_barcode", "f_at_authenticated", "f_searchmode", "f_show_invisible", "f_hq_id", "deactivateMenu", "objecttypemode"));
|
||||
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
$userTypeName = getUserTypeName($userType);
|
||||
|
||||
if ($userTypeName == "stk") :
|
||||
$maskStkArticleAccess = getParameterValue($emp_id, "MASK_STK_ARTICLE_ACCESS");
|
||||
if ($maskStkArticleAccess != "1") :
|
||||
gotoReferer("1");
|
||||
endif;
|
||||
else :
|
||||
$usrAccessArray["hq"] = "1";
|
||||
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
|
||||
authCheckEmployeeRights($emp_id, "14", "1");
|
||||
endif;
|
||||
|
||||
getLanguage(__FILE__);
|
||||
|
||||
$pageTitel = getLngt(wrapPhrase("ARTIKELLISTE", $objecttypemode));
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
getCurrentScript(__FILE__);
|
||||
|
||||
$htmlClass01 = "class=\"smaller\""; // input,select
|
||||
$htmlClass02 = "class=\"f7np1\""; // write
|
||||
$numOfRows = 0;
|
||||
$tableOfRows = "";
|
||||
|
||||
// Flag for "show invisible customers"
|
||||
if ($f_show_invisible == "" || count($f_show_invisible) == 0) :
|
||||
$f_show_invisible = "0";
|
||||
else:
|
||||
$f_show_invisible = "1";
|
||||
endif;
|
||||
|
||||
// Mandator filter
|
||||
if ($f_hq_id == "") : $f_hq_id = array(); endif;
|
||||
if (count($f_hq_id) == 0) : array_push($f_hq_id, $hq_id); endif;
|
||||
|
||||
// Get the parameter to set the order of the columns to be displayed
|
||||
$displayedListCols = getParameterValue($emp_id, "MASK_AT_LIST_COLS");
|
||||
if ($displayedListCols == "") :
|
||||
$displayedListCols = getParameterValue("0", "MASK_AT_LIST_COLS", $hqId);
|
||||
if ($displayedListCols == "") :
|
||||
// Default settings
|
||||
$displayedListCols = "at_eid,at_name,at_serialno,at_mountable,at_match,at_barcode,at_createtime,at_id_history,at_id_edit,atg_data,at_description";
|
||||
endif;
|
||||
endif;
|
||||
$displayedListColsArray = spliti(",",$displayedListCols);
|
||||
$displayedListColsArrayLen = count($displayedListColsArray);
|
||||
|
||||
|
||||
// OUTPUT: Table header search fields
|
||||
$tableHeaderSearchFields = "";
|
||||
if (TRUE) :
|
||||
$dspColHeaderSearchFieldArray = array();
|
||||
$dspColHeaderSearchFieldArray["at_eid"] = "<input type=\"text\" " . $htmlClass01 . " name=\"f_at_eid\" value=\"" . $f_at_eid . "\">";
|
||||
$dspColHeaderSearchFieldArray["at_name"] = "<input type=\"text\" " . $htmlClass01 . " name=\"f_at_name\" value=\"" . $f_at_name . "\">";
|
||||
$dspColHeaderSearchFieldArray["at_serialno"] = "";
|
||||
$dspColHeaderSearchFieldArray["at_mountable"] = "";
|
||||
$dspColHeaderSearchFieldArray["at_match"] = "<input type=\"text\" " . $htmlClass01 . " name=\"f_at_match\" value=\"" . $f_at_match . "\">";
|
||||
$dspColHeaderSearchFieldArray["at_barcode"] = "<input type=\"text\" " . $htmlClass01 . " name=\"f_at_barcode\" value=\"" . $f_at_barcode . "\">";
|
||||
$dspColHeaderSearchFieldArray["at_createtime"] = "";
|
||||
$dspColHeaderSearchFieldArray["at_description"] = "<input type=\"text\" " . $htmlClass01 . " name=\"f_at_description\" value=\"" . $f_at_description . "\">";
|
||||
|
||||
$dspColHeaderSearchFieldArray["at_id_history"] = " ";
|
||||
// $dspColHeaderSearchFieldArray["at_id_report"] = " ";
|
||||
$dspColHeaderSearchFieldArray["at_id_edit"] = " ";
|
||||
$dspColHeaderSearchFieldArray["atg_data"] = " ";
|
||||
|
||||
$tmpKeys = array_keys($dspColHeaderSearchFieldArray);
|
||||
for ($i = 0; $i < $displayedListColsArrayLen; $i++) {
|
||||
// Search for the value "$displayedListColsArray" in "$dspColArray" and get the key (index)
|
||||
$j = array_search($displayedListColsArray[$i], $tmpKeys);
|
||||
if (!($j === FALSE)) :
|
||||
$cellColor = getListColor(1, 1);
|
||||
$tableHeaderSearchFields .= "<td bgcolor=\"" . $cellColor . "\">" . $dspColHeaderSearchFieldArray[$tmpKeys[$j]] . "</td>";
|
||||
endif;
|
||||
}
|
||||
endif;
|
||||
|
||||
// OUTPUT: Table header column links
|
||||
$tableHeaderLinks = "";
|
||||
if (TRUE) :
|
||||
$dspColHeaderLinksArray = array();
|
||||
$dspColHeaderLinksArray["at_eid"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_eid';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt(wrapPhrase("Artikelnr.", $objecttypemode)) . " </a>";
|
||||
$dspColHeaderLinksArray["at_name"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_name';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt("Bezeichnung") . " </a>";
|
||||
$dspColHeaderLinksArray["at_serialno"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_serialno';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt("Seriennr.") . " </a>";
|
||||
$dspColHeaderLinksArray["at_mountable"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_mountable';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt("Montierbar") . " </a>";
|
||||
$dspColHeaderLinksArray["at_match"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_match';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt("Zusatz") . " </a>";
|
||||
$dspColHeaderLinksArray["at_barcode"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_barcode';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt("Barcode") . " </a>";
|
||||
$dspColHeaderLinksArray["at_createtime"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_createtime';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt("Neuanlagedatum") . " </a>";
|
||||
$dspColHeaderLinksArray["at_description"] = "<a href=\"javascript:document.forms[0].orderClause.value='at.at_description';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt("Beschreibung") . " </a>";
|
||||
$dspColHeaderLinksArray["at_id_history"] = " " . getLngt("Historie");
|
||||
// $dspColHeaderLinksArray["at_id_report"] = " " . getLngt("Berichte");
|
||||
$dspColHeaderLinksArray["at_id_edit"] = " " . getLngt("Bearbeiten") . " ";
|
||||
$dspColHeaderLinksArray["atg_data"] = "<a href=\"javascript:document.forms[0].orderClause.value='atg_data';document.forms[0].f_act.value='search';document.forms[0].submit();\"> " . getLngt(wrapPhrase("Warengruppe", $objecttypemode)) . " </a>";
|
||||
|
||||
$tmpKeys = array_keys($dspColHeaderLinksArray);
|
||||
for ($i = 0; $i < $displayedListColsArrayLen; $i++) {
|
||||
// Search for the value "$displayedListColsArray" in "$dspColArray" and get the key (index)
|
||||
$j = array_search($displayedListColsArray[$i], $tmpKeys);
|
||||
if (!($j === FALSE)) :
|
||||
$cellColor = getListColor(0, 0);
|
||||
$tableHeaderLinks .= "<td bgcolor=\"" . $cellColor . "\">" . $dspColHeaderLinksArray[$tmpKeys[$j]] . "</td>";
|
||||
endif;
|
||||
}
|
||||
endif;
|
||||
|
||||
|
||||
if ($f_searchmode == "") : $f_searchmode = "1"; endif;
|
||||
|
||||
// Generate search-resultset
|
||||
if ($f_act == "search") :
|
||||
|
||||
$f_at_eid = trim($f_at_eid);
|
||||
$f_at_name = trim($f_at_name);
|
||||
$f_at_match = trim($f_at_match);
|
||||
$f_at_barcode = trim($f_at_barcode);
|
||||
$f_at_description = trim($f_at_description);
|
||||
|
||||
$doSearch = FALSE;
|
||||
if (strlen($f_at_eid . $f_at_name . $f_at_match . $f_at_description . $f_at_barcode) == 0) :
|
||||
|
||||
if (getCountOfTable("article") <= MAX_CARDINALITY) :
|
||||
|
||||
$doSearch = TRUE;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
if ($doSearch || strlen($f_at_eid) > 1 || strlen($f_at_name) > 1 || strlen($f_at_match) > 1 || strlen($f_at_description) > 1 || strlen($f_at_barcode) > 2) :
|
||||
|
||||
|
||||
// *******************************************
|
||||
// * Selection of the customers for the list *
|
||||
// *******************************************
|
||||
if ($f_searchmode == "1") : $prefix = "%"; else : $prefix = ""; endif;
|
||||
$whereClause = "";
|
||||
if ($f_at_eid != "") : $whereClause .= "at.at_eid LIKE '" . $prefix . $f_at_eid . "%'"; endif;
|
||||
if ($whereClause != "" && $f_at_name != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_at_name != "") : $whereClause .= "at.at_name LIKE '" . $prefix . $f_at_name . "%'"; endif;
|
||||
if ($whereClause != "" && $f_at_match != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_at_match != "") : $whereClause .= "at.at_match LIKE '" . $prefix . $f_at_match . "%'"; endif;
|
||||
if ($whereClause != "" && $f_at_barcode != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_at_barcode != "") : $whereClause .= "at.at_barcode LIKE '" . $prefix . $f_at_barcode . "%'"; endif;
|
||||
if ($whereClause != "" && $f_at_description != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_at_description != "") : $whereClause .= "at.at_description LIKE '" . $prefix . $f_at_description . "%'"; endif;
|
||||
|
||||
|
||||
// if ($whereClause != "" && $f_cs_eid != "") : $whereClause .= " AND "; endif;
|
||||
// if ($f_cs_eid != "") : $whereClause .= "cs.cs_eid LIKE '" . $prefix . $f_cs_eid . "%'"; endif;
|
||||
|
||||
// Check authentication
|
||||
// if ($whereClause != "" && $f_at_authenticated == "1") : $whereClause .= " AND "; endif;
|
||||
// if ($f_at_authenticated == "1") : $whereClause .= "at.at_authenticated LIKE '" . $f_at_authenticated . "%'"; endif;
|
||||
|
||||
// Check visibles
|
||||
$whereClauseVisibility = " at.at_visible = '1' ";
|
||||
if ($f_show_invisible == "1") : $whereClauseVisibility = ""; endif;
|
||||
|
||||
if ($whereClause != "" && $whereClauseVisibility != "") : $whereClauseVisibility = " AND " . $whereClauseVisibility; endif;
|
||||
$whereClause .= $whereClauseVisibility;
|
||||
|
||||
if ($whereClause != "") : $whereClause .= " AND "; endif;
|
||||
$whereClause .= " at.hq_id IN " . getSQLMandatorArray($f_hq_id);
|
||||
|
||||
if ($orderClause == "") : $orderClause = "at.at_eid"; endif;
|
||||
|
||||
$sqlquery = "SELECT at.at_id, at.hq_id, at.at_eid, at.at_name, at.at_match, at.at_description, at.at_barcode,"
|
||||
. " at.at_serialno, at.at_mountable, at.at_authenticated, at.at_visible, at.at_createtime, CONCAT(atg.atg_key,' ',atg.atg_name) AS atg_data"
|
||||
. " FROM article AS at LEFT JOIN articlegroupitem AS atgi ON atgi.md_id = '" . $md_id . "' AND atgi.hq_id IN ('0','" . $hq_id . "') AND atgi.at_id = at.at_id"
|
||||
. " LEFT JOIN articlegroup AS atg ON atg.md_id = '" . $md_id . "' AND atg.atg_id = atgi.atg_id"
|
||||
. " WHERE " . $whereClause
|
||||
. " ORDER BY " . $orderClause;
|
||||
// echo $sqlquery . "<br>";
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
|
||||
// Table with header
|
||||
$rowCounter = 0;
|
||||
$lineToggler = 0;
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$numOfRows++;
|
||||
$dspColArray = array();
|
||||
|
||||
// Only for focussing the first element (link) of the list
|
||||
// Look in tag <body ... onLoad=...>
|
||||
$elementName = "";
|
||||
if ($numOfRows == "1") : $elementName = " name=\"at2focus\" "; endif;
|
||||
|
||||
$tableOfRows .= "<tr>";
|
||||
|
||||
// Link refers to customer details
|
||||
// $dspColArray["at_eid"] = "<td ".$htmlClass02."__BGCOL__> <a href=\"javascript:openArticleSpecial('" . ec($row["at_id"]) . "');\" " . $elementName . ">"
|
||||
// . $row["at_eid"] . "</a>" . "</td>";
|
||||
$dspColArray["at_eid"] = "<td ".$htmlClass02."__BGCOL__> <a href=\"../stock/article_special.php?objecttypemode=" . ec($objecttypemode) . "&articleId=" . ec($row["at_id"]) . "\" " . $elementName . "target=\"_blank\">"
|
||||
. $row["at_eid"] . "</a>" . "</td>";
|
||||
|
||||
$dspColArray["at_name"] = "<td ".$htmlClass02."__BGCOL__> " . $row["at_name"] . "</td>";
|
||||
$dspColArray["at_serialno"] = "<td ".$htmlClass02." align=\"center\"__BGCOL__> " . ($row["at_serialno"] == "1" ? "<img src=\"../images/circle_blue.png\" border=\"0\" height=\"8\" width=\"8\">" : "") . "</td>";
|
||||
$dspColArray["at_mountable"] = "<td ".$htmlClass02." align=\"center\"__BGCOL__> " . ($row["at_mountable"] == "1" ? "<img src=\"../images/circle_blue.png\" border=\"0\" height=\"8\" width=\"8\">" : "") . "</td>";
|
||||
$dspColArray["at_match"] = "<td ".$htmlClass02."__BGCOL__> " . $row["at_match"] . "</td>";
|
||||
$dspColArray["at_barcode"] = "<td ".$htmlClass02."__BGCOL__> " . $row["at_barcode"] . "</td>";
|
||||
$dspColArray["at_createtime"] = "<td ".$htmlClass02."__BGCOL__> " . $row["at_createtime"] . "</td>";
|
||||
|
||||
$dspColArray["at_id_history"] = "<td ".$htmlClass02." align=\"center\"__BGCOL__><a href=\"../admin/history.php?history_mode=" . ec(3) . "&at_id=" . ec($row["at_id"]) . "&op=0\" target=\"_blank\">"
|
||||
. "<img src=\"../images/arrow_right.png\" border=\"0\" height=\"10\" width=\"25\">"
|
||||
. "</a></td>";
|
||||
|
||||
// $dspColArray["at_id_report"] = "<td ".$htmlClass02." align=\"center\"__BGCOL__><a href=\"../groupware/cs_report.php?g_cs_eid=" . ec($row["cs_eid"]) . "\" target=\"_blank\">"
|
||||
// . "<img src=\"../images/arrow_right.png\" border=\"0\" height=\"10\" width=\"25\">"
|
||||
// . "</a></td>";
|
||||
|
||||
// $dspColArray["at_id_remove"] = "<td__BGCOL__> " . "<a href=\"javascript:removeArticle(" . ec($row["at_id"]) . ");\">"
|
||||
// . "<img src=\"../images/trash.jpg\" border=\"0\" height=\"13\" width=\"8\">"
|
||||
// . "</a>" . "</td>";
|
||||
$authImgName = "circle_red.png";
|
||||
if ($row["at_authenticated"] == "1") : $authImgName = "circle_green.png"; endif;
|
||||
$dspColArray["at_authenticated_img"] = "<td ".$htmlClass02." align=\"center\"__BGCOL__><img src=\"../images/" . $authImgName . "\" border=\"0\" height=\"10\" width=\"25\"></td>";
|
||||
|
||||
// $dspColArray["at_id_edit"] = "<td ".$htmlClass02." align=\"center\"__BGCOL__><a href=\"javascript:openArticleSpecial('" . ec($row["at_id"]) . "');\">"
|
||||
// . "<img src=\"../images/arrow_right.png\" border=\"0\" height=\"10\" width=\"25\">"
|
||||
// . "</a>" . "</td>";
|
||||
$dspColArray["at_id_edit"] = "<td ".$htmlClass02." align=\"center\"__BGCOL__><a href=\"../stock/article_special.php?objecttypemode=" . ec($objecttypemode) . "&articleId=" . ec($row["at_id"]) . "\" target=\"_blank\">"
|
||||
. "<img src=\"../images/arrow_right.png\" border=\"0\" height=\"10\" width=\"25\">"
|
||||
. "</a>" . "</td>";
|
||||
$dspColArray["atg_data"] = "<td ".$htmlClass02."__BGCOL__> " . $row["atg_data"] . "</td>";
|
||||
$dspColArray["at_description"] = "<td ".$htmlClass02."__BGCOL__> " . $row["at_description"] . "</td>";
|
||||
|
||||
|
||||
// Generate list
|
||||
$rowCounter++;
|
||||
$tmpKeys = array_keys($dspColArray);
|
||||
for ($i = 0; $i < $displayedListColsArrayLen; $i++) {
|
||||
// Search for the value "$displayedListColsArray" in "$dspColArray" and get the key (index)
|
||||
$j = array_search($displayedListColsArray[$i], $tmpKeys);
|
||||
if (!($j === FALSE)) :
|
||||
if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif;
|
||||
$cellColor = getListColor($rowCounter, $lineToggler);
|
||||
$dspColArray[$tmpKeys[$j]] = str_replace("__BGCOL__", " bgcolor=\"" . $cellColor ."\"", $dspColArray[$tmpKeys[$j]]);
|
||||
$tableOfRows .= $dspColArray[$tmpKeys[$j]];
|
||||
endif;
|
||||
}
|
||||
|
||||
$tableOfRows .= "</tr>";
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
else :
|
||||
$statusMessage = getLngt("Bei Eingabe weniger als 2 Zeichen in mindestens einem Feld erfolgt keine Suche!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Link to enter a new article or to switch "visibility output"
|
||||
$headerOps = "";
|
||||
$headerOps .= " | ";
|
||||
$headerOps .= "<a href=\"javascript:openArticleSpecial('');\">" . getLngt(wrapPhrase("Neuer Artikel", $objecttypemode)) . "</a>";
|
||||
$headerOps .= " | ";
|
||||
$headerOps .= getLngt("Ausgeblendete anzeigen") . " <input type=\"checkbox\" name=\"f_show_invisible[]\" value=\"1\" " . ($f_show_invisible == "1" ? "checked" : "") . " tabindex=\"\">";
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?php echo $pageTitel ?></title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
function setFocus() {
|
||||
var numOfRows = <?php echo $numOfRows ?>;
|
||||
if (numOfRows > 0) {
|
||||
numOfLinks = document.links.length;
|
||||
for (i=0; i<numOfLinks; ++i) {
|
||||
if (document.links[i].name == 'at2focus') {
|
||||
document.links[i].focus();
|
||||
};
|
||||
};
|
||||
} else {
|
||||
document.forms[0].f_at_eid.focus();
|
||||
};
|
||||
};
|
||||
|
||||
function removeArticle(at_id) {
|
||||
if (confirm('<?php echo getLngt(wrapPhrase("Artikel", $objecttypemode) . " wirklich entfernen?"); ?>')) {
|
||||
document.forms[0].f_act.value = '<?php echo ec("removeArticle") ?>';
|
||||
document.forms[0].articleId.value = cmp_id;
|
||||
document.forms[0].submit();
|
||||
};
|
||||
};
|
||||
|
||||
function finishPage(eid,name,match,description,barcode) {
|
||||
document.forms[0].f_at_eid.value=eid;
|
||||
document.forms[0].f_at_name.value=name;
|
||||
document.forms[0].f_at_match.value=match;
|
||||
document.forms[0].f_at_description.value=description;
|
||||
document.forms[0].f_at_barcode.value=barcode;
|
||||
|
||||
document.forms[0].f_act.value='<?php echo ec("search") ?>';
|
||||
document.forms[0].submit();
|
||||
};
|
||||
|
||||
function clearFields() {
|
||||
if (document.forms[0].f_at_eid) {document.forms[0].f_at_eid.value = ''};
|
||||
if (document.forms[0].f_at_name) {document.forms[0].f_at_name.value = ''};
|
||||
if (document.forms[0].f_at_match) {document.forms[0].f_at_match.value = ''};
|
||||
if (document.forms[0].f_at_description) {document.forms[0].f_at_description.value = ''};
|
||||
if (document.forms[0].f_at_barcode) {document.forms[0].f_at_barcode.value = ''};
|
||||
};
|
||||
|
||||
function openArticleSpecial(atId) {
|
||||
var widthPopupWin = 900;
|
||||
var heightPopupWin = 700;
|
||||
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
|
||||
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
|
||||
var popupWin;
|
||||
popupWin = window.open("../stock/article_special.php?objecttypemode=<?php echo ec($objecttypemode) ?>&articleId=" + atId ,"","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
|
||||
};
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>displayStatusMessage();setFocus();">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<form action="../stock/article_list.php" method="post" target="">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="orderClause" value="<?php echo $orderClause ?>">
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
<input type="hidden" name="objecttypemode" value="<?php echo ec($objecttypemode) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<!-- Headquarters checkboxes -->
|
||||
<?php if ($userTypeName == "hq" && authCheckEmployeeRights($emp_id, "10")) : ?>
|
||||
<?php echo getHeadquartersCheckboxes($f_hq_id); ?>
|
||||
<?php echo htmlDivLineSpacer("10px", "", "left"); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div>
|
||||
<a href="javascript:document.forms[0].f_act.value='search';document.forms[0].submit();"> <?php echo getLngt("Suchen") ?> </a>
|
||||
|
|
||||
<a href="javascript:clearFields();"><?php echo getLngt("Felder zurücksetzen") ?></a>
|
||||
|
|
||||
Option:
|
||||
<input type="radio" name="f_searchmode" value="0" <?php if ($f_searchmode == "0") : echo "checked"; endif; ?>> <?php echo getLngt("Präfix") ?>
|
||||
<input type="radio" name="f_searchmode" value="1" <?php if ($f_searchmode == "1") : echo "checked"; endif; ?>> <?php echo getLngt("Teilwort") ?>
|
||||
<?php echo $headerOps ?>
|
||||
</div>
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<div>
|
||||
<table class="f8np1" border="0" cellpadding="0">
|
||||
<tr>
|
||||
<?php echo $tableHeaderSearchFields ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php echo $tableHeaderLinks ?>
|
||||
</tr>
|
||||
<?php echo $tableOfRows ?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<div>
|
||||
<?php echo getLngt("Anzahl Einträge:") ?> <?php echo $numOfRows ?><?php if ($numOfRows == "0" && $f_act == "search" && $statusMessage == "") : echo " " . getLngt("(Keine Einträge gefunden.)"); endif; ?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
931
html/stock/article_special.php
Normal file
931
html/stock/article_special.php
Normal file
@@ -0,0 +1,931 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* article_special.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../include/inc_wording_wrapper.inc.php");
|
||||
|
||||
|
||||
$httpVars = array("f_act", "articleId", "orderClause", "statusMessage", "printVersion");
|
||||
|
||||
$httpVisualVars = array("f_at_eid", "f_at_name", "f_at_match", "f_at_description", "f_at_barcode", "f_searchmode",
|
||||
"f_show_invisible", "f_at_authenticated", "f_at_visible", "f_at_bundlequantity", "f_at_bundlecode",
|
||||
"f_bundlearticle_remove", "f_at_eid_new", "f_atb_bundlequantity_new", "f_at_serialno", "f_at_mountable",
|
||||
"f_at_stk_itemquantity", "f_at_stk_areaquantity", "g_atg_id", "deactivateMenu", "objecttypemode");
|
||||
|
||||
$httpVarsArray = array_merge ($httpVars, $httpVisualVars);
|
||||
|
||||
getSecHttpVars("1", $httpVarsArray);
|
||||
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
$userTypeName = getUserTypeName($userType);
|
||||
|
||||
if ($userTypeName == "stk") :
|
||||
$maskStkArticleAccess = getParameterValue($emp_id, "MASK_STK_ARTICLE_ACCESS");
|
||||
if ($maskStkArticleAccess != "1") :
|
||||
gotoReferer("1");
|
||||
endif;
|
||||
else :
|
||||
$usrAccessArray["hq"] = "1";
|
||||
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
|
||||
authCheckEmployeeRights($emp_id, "14", "1");
|
||||
endif;
|
||||
|
||||
getLanguage(__FILE__);
|
||||
|
||||
$deactivateMenuStatic = "1";
|
||||
$pageTitel = getLngt(wrapPhrase("ARTIKEL", $objecttypemode));
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
include_once ("../include/inc_article.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
getCurrentScript(__FILE__);
|
||||
|
||||
// No operation if print version requested
|
||||
if ($printVersion == "1") : $f_act = ""; endif;
|
||||
|
||||
$dbOperationCompleted = "0";
|
||||
|
||||
// Init parameters:
|
||||
// Single Checkbox => Flag
|
||||
if ($f_at_serialno == "" || count($f_at_serialno) == 0) :
|
||||
$f_at_serialno = "0";
|
||||
else:
|
||||
$f_at_serialno = "1";
|
||||
endif;
|
||||
if ($f_at_mountable == "" || count($f_at_mountable) == 0) :
|
||||
$f_at_mountable = "0";
|
||||
else:
|
||||
$f_at_mountable = "1";
|
||||
endif;
|
||||
|
||||
// Init package factor if empty
|
||||
if ($f_at_stk_itemquantity == "") : $f_at_stk_itemquantity = "1"; endif;
|
||||
if ($f_at_stk_areaquantity == "") : $f_at_stk_areaquantity = "1"; endif;
|
||||
|
||||
// Get EID prefix and reset EID only if equals prefix
|
||||
$constAtEidPrefix = getParameterValue("0", "AT_EID_PREFIX", $hq_id);
|
||||
if ($f_at_eid == $constAtEidPrefix) : $f_at_eid = ""; endif;
|
||||
|
||||
|
||||
// *******************************
|
||||
// * Operations for the articles *
|
||||
// *******************************
|
||||
|
||||
// Generate log string
|
||||
if ($f_act != "") :
|
||||
$logString = makeLogString(array($f_at_eid,$f_at_name,$f_at_authenticated,$f_at_visible,$g_atg_id,$f_at_match,$f_at_description,$f_at_barcode,$f_at_bundlequantity,$f_at_bundlecode,$f_at_stk_itemquantity,$f_at_stk_areaquantity,$f_at_serialno,$f_at_mountable), ";", "0");
|
||||
endif;
|
||||
|
||||
// Insert new article
|
||||
if ($f_act == "newArticle") :
|
||||
|
||||
if ($f_at_eid != "" && $f_at_name != "") :
|
||||
|
||||
// Check existence of the article (all data)
|
||||
if ($db->getOne("SELECT at_eid FROM article WHERE at_eid = '" . $f_at_eid . "'")) :
|
||||
$statusMessage = getLngt("Die eindeutige " . wrapPhrase("Artikelnummer", $objecttypemode) . " (ExtID) ist bereits vergeben! Bitte wählen Sie eine andere");
|
||||
|
||||
elseif ($f_at_barcode != "" && $db->getOne("SELECT at_barcode FROM article WHERE at_barcode = '" . $f_at_barcode . "'")) :
|
||||
$statusMessage = getLngt("Der eindeutige Barcode ist bereits vergeben! Bitte prüfen Sie, ob der " . wrapPhrase("Artikel", $objecttypemode) . " schon existiert! Es erfolgte keine Änderung!");
|
||||
|
||||
elseif ($db->getOne("SELECT at_name FROM article WHERE at_name = '" . $f_at_name . "'")) :
|
||||
$statusMessage = getLngt("Die " . wrapPhrase("Artikelbezeichnung", $objecttypemode) . " existiert schon! Eine Identität scheint sehr wahrscheinlich, deshalb wird der Artikel unter dieser Bezeichnung nicht angelegt!");
|
||||
|
||||
else:
|
||||
TA("B");
|
||||
|
||||
$currentTime = getDateTime("0");
|
||||
|
||||
// Insert article
|
||||
// $f_at_discount = str_replace (",", ".", $f_at_discount);
|
||||
// $f_at_prov = str_replace (",", ".", $f_at_prov);
|
||||
insertStmt("article", array("at_eid", $f_at_eid, "at_name", $f_at_name, "hq_id", $hq_id, "at_match", $f_at_match, "at_description", $f_at_description, "at_barcode", $f_at_barcode, "at_createtime", $currentTime,
|
||||
"atg_id", $g_atg_id, "at_bundlequantity", $f_at_bundlequantity, "at_bundlecode", $f_at_bundlecode, "at_stk_itemquantity", $f_at_stk_itemquantity, "at_stk_areaquantity", $f_at_stk_areaquantity, "at_serialno", $f_at_serialno, "at_mountable", $f_at_mountable));
|
||||
$at_id_new = getLastInsertId();
|
||||
|
||||
// Set special article group like a customer relation et al.
|
||||
if ($g_atg_id != "" && is_numeric($g_atg_id) && $g_atg_id > "0") :
|
||||
if (existsEntry("articlegroupitem",array("md_id", $md_id, "hq_id", "0", "at_id", $g_atg_id))) :
|
||||
insertStmt("articlegroupitem", array("md_id", $md_id, "hq_id", '0', "atg_id", $g_atg_id, "at_id", $at_id_new));
|
||||
else :
|
||||
insertStmt("articlegroupitem", array("md_id", $md_id, "hq_id", $hq_id, "atg_id", $g_atg_id, "at_id", $at_id_new));
|
||||
endif;
|
||||
$g_atg_id = "";
|
||||
endif;
|
||||
|
||||
// Write logdata into log database
|
||||
writeToLogDB("61",$hq_id,"",$usr_id,"","","","STATUS_NEW=" . $logString,$at_id_new);
|
||||
|
||||
TA("C");
|
||||
TA("E");
|
||||
|
||||
// Reset fields of form-parameters
|
||||
// clearParameters($httpVisualVars); // <= Moved to the end of the php-part of this script...
|
||||
$dbOperationCompleted = "1";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Bitte geben Sie alle mit * gekennzeichneten Felder ein!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Modify article
|
||||
if ($f_act == "modifyArticle" && $articleId != "") :
|
||||
|
||||
if ($f_at_eid != "" && $f_at_name != "") :
|
||||
|
||||
if ($db->getOne("SELECT at_eid FROM article WHERE at_eid = '" . $f_at_eid . "' AND NOT (at_id = '" . $articleId . "')")) :
|
||||
$statusMessage = getLngt("Die eindeutige " . wrapPhrase("Artikelnummer", $objecttypemode) . " (ExtID) ist bereits vergeben! Bitte wählen Sie eine andere!");
|
||||
|
||||
elseif ($f_at_barcode != "" && $db->getOne("SELECT at_barcode FROM article WHERE at_barcode = '" . $f_at_barcode . "' AND NOT (at_id = '" . $articleId . "')")) :
|
||||
$statusMessage = getLngt("Der eindeutige Barcode ist bereits vergeben! Bitte prüfen Sie, ob " . wrapPhrase("der Artikel", $objecttypemode) . " schon existiert! Es erfolgte keine Änderung!");
|
||||
|
||||
else :
|
||||
// Get current state of the serial number
|
||||
$currAtSerialno = getFieldValueFromId("article", "at_id", $articleId, "at_serialno");
|
||||
|
||||
// Only check if state of the serial number will be changed !!!
|
||||
if ($currAtSerialno != $f_at_serialno) :
|
||||
|
||||
// Check for switched flag for serial number ...
|
||||
if ($f_at_serialno == "1") :
|
||||
// 1. Check for existing quantity on any stockarticle
|
||||
if (quantityOfSpecialStockArticleOnAnyStock($articleId) > 0) :
|
||||
$f_at_serialno = "0";
|
||||
$statusMessage = getLngt(wrapPhrase("Dieser Artikel", $objecttypemode) . " weist Lagerbestände aus (evtl. auch in einer anderen Niederlassung)! Das Kennzeichen kann deshalb zur Zeit leider nicht gesetzt werden!");
|
||||
endif;
|
||||
// 2. Check for article being a bundle
|
||||
if (isBundledArticle($articleId)) :
|
||||
$f_at_serialno = "0";
|
||||
$statusMessage = getLngt("Solange " . wrapPhrase("dieser Artikel", $objecttypemode) . " ein Gebinde ist, kann keine Seriennummer geführt werden!");
|
||||
endif;
|
||||
// 3. Check for article being in any bundle
|
||||
if (existsEntry("articlebundle",array("at_id2",$articleId))) :
|
||||
$f_at_serialno = "0";
|
||||
$statusMessage = getLngt("Solange " . wrapPhrase("dieser Artikel", $objecttypemode) . " Bestandteil eines Gebindes ist (evtl. auch in einer anderen Niederlassung), kann keine Seriennummer geführt werden!");
|
||||
endif;
|
||||
else :
|
||||
// Check for existence of serial numbers
|
||||
if (existsEntry("articleitem",array("at_id",$articleId))) :
|
||||
$f_at_serialno = "1";
|
||||
$statusMessage = getLngt(wrapPhrase("Dieser Artikel", $objecttypemode) . " besitzt noch eine eingetragene Seriennummern! Der Status bzgl. Seriennummer wurde nicht verändert!");
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
TA("B");
|
||||
|
||||
// Get current state in at_modify_status because it is equal to "1" then do NOT change
|
||||
$modifyStatus = getFieldValueFromId("article", "at_id", $articleId, "at_modify_status");
|
||||
if ($modifyStatus != "1") : $modifyStatus = "2"; endif;
|
||||
|
||||
// Update article
|
||||
// $f_at_discount = str_replace (",", ".", $f_at_discount);
|
||||
// $f_at_prov = str_replace (",", ".", $f_at_prov);
|
||||
$defaultFields = array("at_eid", $f_at_eid, "at_name", $f_at_name, "at_match", $f_at_match, "at_description", $f_at_description, "at_barcode", $f_at_barcode, "at_bundlequantity", $f_at_bundlequantity, "at_bundlecode", $f_at_bundlecode, "at_stk_itemquantity", $f_at_stk_itemquantity, "at_stk_areaquantity", $f_at_stk_areaquantity, "at_serialno", $f_at_serialno, "at_mountable", $f_at_mountable);
|
||||
updateStmt("article","at_id",$articleId,$defaultFields);
|
||||
|
||||
// Set special article group like a customer relation et al.
|
||||
if ($g_atg_id != "" && is_numeric($g_atg_id) && $g_atg_id > "0") :
|
||||
if (existsEntry("articlegroupitem",array("md_id", $md_id, "hq_id", "0", "at_id", $articleId))) :
|
||||
updateStmt("articlegroupitem","at_id",$articleId,array("atg_id",$g_atg_id), "md_id = '" . $md_id . "' AND hq_id = '0'");
|
||||
elseif (existsEntry("articlegroupitem",array("hq_id",$hq_id,"at_id",$articleId))) :
|
||||
updateStmt("articlegroupitem","at_id",$articleId,array("atg_id",$g_atg_id), "md_id = '" . $md_id . "' AND hq_id = '" . $hq_id . "'");
|
||||
else :
|
||||
insertStmt("articlegroupitem", array("md_id", $md_id, "hq_id", $hq_id, "atg_id", $g_atg_id, "at_id", $articleId));
|
||||
endif;
|
||||
else :
|
||||
deleteStmt("articlegroupitem","md_id = '" . $md_id . "' AND hq_id = '" . $hq_id . "' AND at_id = '" . $articleId . "'");
|
||||
endif;
|
||||
|
||||
// Write logdata into log database
|
||||
writeToLogDB("62",$hq_id,"",$usr_id,"","","","STATUS_MODIFIED=" . $logString, $articleId);
|
||||
|
||||
TA("C");
|
||||
TA("E");
|
||||
|
||||
$dbOperationCompleted = "1";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Bitte geben Sie alle mit * gekennzeichneten Felder ein!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Delete article
|
||||
if ($f_act == "removeArticle" && $articleId != "") :
|
||||
if (existsEntry("article",array("at_id",$articleId))) :
|
||||
// TA("B");
|
||||
// deleteStmt("article","at_id = '".$articleId."'");
|
||||
|
||||
// Write logdata into log database
|
||||
// writeToLogDB("65",$hq_id,"",$usr_id,"","","","STATUS_DELETED",$articleId);
|
||||
|
||||
// TA("C");
|
||||
// TA("E");
|
||||
else :
|
||||
$statusMessage = getLngt(wrapPhrase("Der Artikel", $objecttypemode) . " kann nicht entfernt werden!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Set status of authentication of the article
|
||||
if ($f_act == "setAuthentication") :
|
||||
|
||||
// Check for company
|
||||
if ($articleId != "") :
|
||||
|
||||
if (existsEntry("article",array("at_id",$articleId))) :
|
||||
|
||||
// Update authentication-status
|
||||
updateStmt("article","at_id",$articleId,array("at_authenticated",$f_at_authenticated));
|
||||
|
||||
// Write logdata into log database
|
||||
writeToLogDB("63",$hq_id,"",$usr_id,"","","","STATUS_AUTHENTICATION=".$f_at_authenticated,$articleId);
|
||||
else :
|
||||
$statusMessage = getLngt(wrapPhrase("Der spezifizierte Artikel", $objecttypemode) . " ist nicht im Datenbestand erhalten!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Sie haben " . wrapPhrase("keinen Artikel", $objecttypemode) . " spezifiziert!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Set status of visibility of the article
|
||||
if ($f_act == "setVisibility") :
|
||||
|
||||
// Check for company
|
||||
if ($articleId != "") :
|
||||
|
||||
if (existsEntry("article",array("at_id",$articleId))) :
|
||||
|
||||
// Update authentication-status
|
||||
updateStmt("article","at_id",$articleId,array("at_visible",$f_at_visible));
|
||||
|
||||
// Write logdata into log database
|
||||
writeToLogDB("64",$hq_id,"",$usr_id,"","","","STATUS_VISIBILITY=".$f_at_visible,$articleId);
|
||||
else :
|
||||
$statusMessage = getLngt(wrapPhrase("Der spezifizierte Artikel", $objecttypemode) . " ist nicht im Datenbestand erhalten!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Sie haben " . wrapPhrase("keinen Artikel", $objecttypemode) . " spezifiziert!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Remove bundle article
|
||||
if ($f_act == "removeBundleArticle") :
|
||||
|
||||
// Check for company
|
||||
if ($articleId != "") :
|
||||
|
||||
// Check for existence of a subarticle of the article to be removed
|
||||
if (!isBundledArticle($f_bundlearticle_remove)) :
|
||||
|
||||
if (existsEntry("articlebundle",array("at_id",$articleId, "at_id2", $f_bundlearticle_remove))) :
|
||||
|
||||
// Delete bundle article out of the bundle
|
||||
deleteStmt("articlebundle","at_id = '".$articleId."' AND at_id2 = '" . $f_bundlearticle_remove . "'");
|
||||
|
||||
// Write logdata into log database
|
||||
// writeToLogDB("64",$hq_id,"",$usr_id,"","","","STATUS_VISIBILITY=".$f_at_visible,$articleId);
|
||||
else :
|
||||
$statusMessage = getLngt(wrapPhrase("Der zu löschende Artikel") . " ist nicht im Gebinde erhalten!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt(wrapPhrase("Der zu löschende Artikel") . " ist ein Gebindeartikel! Bitte zuerst die ihm zugeordneten " . wrapPhrase("Artikel", $objecttypemode) . " entfernen!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Sie haben " . wrapPhrase("keinen Artikel", $objecttypemode) . " spezifiziert!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// New bundle article
|
||||
if ($f_act == "newBundleArticle") :
|
||||
|
||||
// Check for company
|
||||
if ($articleId != "") :
|
||||
|
||||
if (existsEntry("article",array("at_id",$articleId)) && existsEntry("article",array("at_eid", $f_at_eid_new))) :
|
||||
|
||||
// Perhaps it is possible to check existing item quantity on any stock before changing to bundled article ...?!
|
||||
// $tmpArticleItemQuantity = getStockArticleQuantitySubtree ($stkIdRoot, "0", stkat.stkat_itemquantity, "at.at_id = " . $tmpAtId . "'");
|
||||
|
||||
if ($f_atb_bundlequantity_new > 0) :
|
||||
|
||||
// Get at_id of the EID in f_at_eid_new
|
||||
$atIdTmp = getFieldValueFromId("article", "at_eid", $f_at_eid_new, "at_id");
|
||||
|
||||
if ($atIdTmp != "") :
|
||||
$storeArticle = true;
|
||||
|
||||
// Check for switch for serial numbers for the CURRENT article
|
||||
$tmpAtSerialNo = getFieldValueFromId("article", "at_id", $articleId, "at_serialno");
|
||||
if ($storeArticle && $tmpAtSerialNo == "1") :
|
||||
$storeArticle = false;
|
||||
$statusMessage = getLngt(wrapPhrase("Dem Artikel", $objecttypemode) . " dürfen " . wrapPhrase("keine Artikel", $objecttypemode) . " oder Gebinde zugefügt werden, da " . wrapPhrase("für diesen Artikel", $objecttypemode) . " Seriennummern erfasst werden müssen!");
|
||||
endif;
|
||||
|
||||
// Check for switch for serial numbers for the CURRENT article
|
||||
$tmpAtSerialNo = getFieldValueFromId("article", "at_id", $atIdTmp, "at_serialno");
|
||||
if ($storeArticle && $tmpAtSerialNo == "1") :
|
||||
$storeArticle = false;
|
||||
$statusMessage = getLngt(wrapPhrase("Der Artikel", $objecttypemode) . " darf nicht als Gebindebestandteil zugefügt werden, da " . wrapPhrase("für diesen Artikel", $objecttypemode) . " Seriennummern erfasst werden müssen!");
|
||||
endif;
|
||||
|
||||
// Check for identity
|
||||
if ($storeArticle && $articleId == $atIdTmp) :
|
||||
$storeArticle = false;
|
||||
$statusMessage = getLngt(wrapPhrase("Ein Artikel", $objecttypemode) . " darf nicht sich selbst zugefügt werden, also ein Gebinde kann nicht aus sich selbst bestehen!");
|
||||
endif;
|
||||
|
||||
// Check for cycle if article is a bundeled article
|
||||
if ($storeArticle && isBundledArticle($atIdTmp)) :
|
||||
$noCycle = true;
|
||||
$recurseCount = "0";
|
||||
checkForCycle($articleId, $atIdTmp);
|
||||
if (!$noCycle) :
|
||||
// Cycle detected
|
||||
$storeArticle = false;
|
||||
$statusMessage = getLngt(wrapPhrase("Der Gebindeartikel", $objecttypemode) . " kann nicht zugefügt werden, da nach der Ausführung eine zyklische Abhängigkeit bestünde!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// If current article in $articleId is NOT a bundle and shall become a bundle by association of an article in $atIdTmp
|
||||
// then check whether $articleId has currently a quantity on any stock!
|
||||
// Do NOT execute transformation from "item article" to "bundle article" if at least one item does exist on any stock!
|
||||
// ATTENTION: This has to be done on ALL stocks and therefore on all root stocks, too. The administration of articles is independent of a specisal headquarters!!!
|
||||
if ($storeArticle && !isBundledArticle($articleId)) :
|
||||
// Check for quantity on any stock
|
||||
if (quantityOfSpecialStockArticleOnAnyStock($articleId) > 0) :
|
||||
$storeArticle = false;
|
||||
$statusMessage = getLngt("Bitte buchen Sie vor der Umwandlung " . wrapPhrase("in einen Gebindeartikel", $objecttypemode) . " die bestehenden Stückmengen aus!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Insert new bundled article or update quantity of an existing bundled article
|
||||
if ($storeArticle) :
|
||||
// Check existence of a parent-child pair
|
||||
if (existsEntry("articlebundle",array("at_id",$articleId, "at_id2",$atIdTmp))) :
|
||||
updateQuantityOfExistingBundledArticle($articleId, $atIdTmp, $f_atb_bundlequantity_new);
|
||||
else :
|
||||
insertStmt("articlebundle", array("at_id", $articleId, "at_id2", $atIdTmp, "atb_bundlequantity", $f_atb_bundlequantity_new));
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Write logdata into log database
|
||||
// writeToLogDB("64",$hq_id,"",$usr_id,"","","","STATUS_VISIBILITY=".$f_at_visible,$articleId);
|
||||
else :
|
||||
$statusMessage = getLngt(wrapPhrase("Der Artikel", $objecttypemode) . " ist nicht bekannt!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Die Gebindemenge muss größer Null sein!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt(wrapPhrase("Der Artikel", $objecttypemode) . " existiert nicht!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Sie haben " . wrapPhrase("keinen Artikel", $objecttypemode) . " spezifiziert!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
// *********************************
|
||||
// * Selection of the article-data *
|
||||
// *********************************
|
||||
if ($articleId != "") :
|
||||
$sqlquery = "SELECT at.at_id, at.hq_id, at.at_eid, at.at_name, atgi.atg_id, at.at_match, at.at_description,"
|
||||
. " at.at_barcode, at.at_authenticated, at.at_visible, at.at_serialno, at.at_mountable,"
|
||||
. " at.at_bundlequantity, at.at_bundlecode, at.at_stk_itemquantity, at.at_stk_areaquantity"
|
||||
. " FROM article AS at LEFT JOIN articlegroupitem AS atgi ON at.at_id = atgi.at_id AND atgi.md_id = '" . $md_id . "' AND atgi.hq_id IN ('0','" . $hq_id . "')"
|
||||
. " WHERE at.at_id = '" . $articleId . "'"
|
||||
. getSQLMandatorPhrase($emp_id, " AND at.hq_id = '" . $hq_id . "' ");
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$f_articleId = $row["at_id"];
|
||||
$f_at_eid = $row["at_eid"];
|
||||
$f_at_name = $row["at_name"];
|
||||
$f_at_match = $row["at_match"];
|
||||
$f_at_description = $row["at_description"];
|
||||
$f_at_barcode = $row["at_barcode"];
|
||||
$f_at_hq_id = $row["hq_id"];
|
||||
|
||||
$f_at_authenticated = $row["at_authenticated"];
|
||||
$f_at_authenticated2 = 0;
|
||||
if ($f_at_authenticated != "1") :
|
||||
$f_at_authenticated = 0;
|
||||
$f_at_authenticated2 = 1;
|
||||
endif;
|
||||
$f_at_visible = $row["at_visible"];
|
||||
$f_at_visible2 = 0;
|
||||
if ($f_at_visible != "1") :
|
||||
$f_at_visible = 0;
|
||||
$f_at_visible2 = 1;
|
||||
endif;
|
||||
|
||||
$f_at_bundlequantity = $row["at_bundlequantity"];
|
||||
$f_at_bundlecode = $row["at_bundlecode"];
|
||||
$f_at_stk_itemquantity = $row["at_stk_itemquantity"];
|
||||
$f_at_stk_areaquantity = $row["at_stk_areaquantity"];
|
||||
$f_at_serialno = $row["at_serialno"];
|
||||
$f_at_mountable = $row["at_mountable"];
|
||||
|
||||
$g_atg_id = $row["atg_id"];
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
|
||||
// *** BUNDLE ***
|
||||
|
||||
// If the currrent article represents a bundle, there are one or more associated articles belonging to this bundle
|
||||
// The bundle is an article by itself !!!
|
||||
$sqlquery = "SELECT atb.at_id, atb.at_id2, at.at_eid, at.at_name, at2.at_eid AS at_eid2, at2.at_name AS at_name2,"
|
||||
. " atb.atb_bundlequantity"
|
||||
. " FROM articlebundle AS atb, article AS at, article AS at2"
|
||||
. " WHERE atb.at_id = '" . $articleId . "' AND"
|
||||
. " atb.at_id = at.at_id AND"
|
||||
. " atb.at_id2 = at2.at_id";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$f_articlebundle = "";
|
||||
$atCount = 0;
|
||||
$f_articlebundle .= "<div style=\"float:left\">";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$atCount++;
|
||||
$f_articlebundle .= "<div>";
|
||||
$f_articlebundle .= " <br>";
|
||||
$f_articlebundle .= " <input class=\"smaller\" type=\"text\" name=\"f_at_eid_" . $count . "\" value=\"" . $row["at_eid2"] . "\" size=\"10\" maxlength=\"10\" readonly> ";
|
||||
$f_articlebundle .= " <input class=\"smaller\" type=\"text\" name=\"f_at_name_" . $count . "\" value=\"" . $row["at_name2"] . "\" size=\"20\" maxlength=\"50\" readonly> ";
|
||||
$f_articlebundle .= " <input class=\"smaller\" type=\"text\" name=\"f_atb_bundlequantity_" . $count . "\" value=\"" . $row["atb_bundlequantity"] . "\" size=\"3\" maxlength=\"5\" readonly> ";
|
||||
$f_articlebundle .= " <a href=\"javascript:clearBundleArticle('" . $row["at_id2"] . "');\"><img src=\"../images/waste.png\" border=\"0\" height=\"15\" width=\"12\"></a>";
|
||||
$f_articlebundle .= "</div>";
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
if ($atCount == 0) :
|
||||
$f_articlebundle .= "<div style=\"width:20; height:10;\"></div>";
|
||||
$f_articlebundle .= "<div>";
|
||||
$f_articlebundle .= getLngt("- Zur Zeit sind noch keine Gebindebestandteile eingetragen -");
|
||||
$f_articlebundle .= "</div>";
|
||||
endif;
|
||||
|
||||
$f_articlebundle .= "<div style=\"width:20; height:15;\"></div>";
|
||||
$f_articlebundle .= "<div style=\"float:left\">";
|
||||
$f_articlebundle .= getLngt("EID:") . " <input class=\"smaller\" type=\"text\" name=\"f_at_eid_new\" value=\"\" size=\"10\" maxlength=\"10\"> ";
|
||||
// $f_articlebundle .= " <input class=\"smaller\" type=\"text\" name=\"f_at_name_new\" value=\"\" size=\"20\" maxlength=\"50\" readonly> ";
|
||||
$f_articlebundle .= getLngt("Menge:") . " <input class=\"smaller\" type=\"text\" name=\"f_atb_bundlequantity_new\" value=\"\" size=\"3\" maxlength=\"5\"> ";
|
||||
$f_articlebundle .= "</div>";
|
||||
$f_articlebundle .= defineButtonType08(getLngt("Hinzufügen"), "action_new_bundlearticle", "newBundleArticle();", "90", "left", "3");
|
||||
endif;
|
||||
|
||||
// Get the data of the article group
|
||||
if ($g_atg_id != "") :
|
||||
// $g_atg_key = getFieldValueFromId("articlegroup", "atg_id", "$g_atg_id", "atg_key");
|
||||
// $g_atg_name = getFieldValueFromId("articlegroup", "atg_id", "$g_atg_id", "atg_name");
|
||||
$g_atg_key = getFieldValueFromClause("articlegroup","atg_key","md_id = '" . $md_id . "' AND atg_id = '" . $g_atg_id . "'");
|
||||
$g_atg_name = getFieldValueFromClause("articlegroup","atg_name","md_id = '" . $md_id . "' AND atg_id = '" . $g_atg_id . "'");
|
||||
endif;
|
||||
|
||||
// Get max-value of the EID of the current article for inserting a new row
|
||||
// The constant value "AT_EID_GENERATION" contains the prefix of the SID [SPECIAL TREATMENT]
|
||||
$f_eid_maxval = "";
|
||||
// $atEidGeneration = getParameterValue("0", "AT_EID_GENERATION");
|
||||
if (AT_EID_GENERATION != "") :
|
||||
$f_eid_maxval = getMaxOfField("article", "at_eid", "at_eid < '" . AT_EID_GENERATION . "'");
|
||||
// Check existence of at least one EID with requested prefix
|
||||
if (substr($f_eid_maxval, 0, strlen(AT_EID_PREFIX)) != AT_EID_PREFIX) :
|
||||
$f_eid_maxval = AT_EID_PREFIX . "100000";
|
||||
endif;
|
||||
if (is_numeric($f_eid_maxval)) :
|
||||
++$f_eid_maxval; // Increment because of the next free EID (Attention: Not TA-safe!)
|
||||
else :
|
||||
// Remove alphanumeric chars (e.g "HTHB123456" => "123456")
|
||||
$prefixChars = ereg_replace("[^[:alpha:]+]","",$f_eid_maxval);
|
||||
$f_eid_maxval = ereg_replace("[^[:digit:]+]","",$f_eid_maxval);
|
||||
++$f_eid_maxval;
|
||||
$f_eid_maxval = $prefixChars . $f_eid_maxval;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Only for output
|
||||
$title = getLngt(wrapPhrase("NEUER ARTIKEL", $objecttypemode));
|
||||
$buttonAuthentication = "";
|
||||
$buttonVisibility = "";
|
||||
$displayTextAuthentication = "";
|
||||
$displayTextVisibility = "";
|
||||
$confirmTextAuthentication = "";
|
||||
$confirmTextVisibility = "";
|
||||
|
||||
if ($articleId != "") :
|
||||
$title = getLngt(wrapPhrase("ARTIKEL", $objecttypemode)) . ": " . substr($f_at_name, 0, 100);
|
||||
|
||||
// Check for being a bundled article
|
||||
if (isBundledArticle($articleId)) :
|
||||
$title .= " <span class=\"f10bp1_red\">[" . getLngt("GEBINDE") . "]</span> ";
|
||||
endif;
|
||||
|
||||
// Show mandator
|
||||
/*
|
||||
if (authCheckEmployeeRights($emp_id, "10")) :
|
||||
|
||||
// Name of the headquarter
|
||||
$hq_name = getFieldValueFromId("headquarters", "hq_id", $f_at_hq_id, "hq_name");
|
||||
$title .= " ";
|
||||
$title .= "[" . $hq_name . "]";
|
||||
|
||||
$title .= " ";
|
||||
endif;
|
||||
*/
|
||||
|
||||
$buttonAuthentication = defineButtonType08(getLngt("Sperren"), "action_lock", "authenticationFinishPage();", "90", "left", "3");
|
||||
$confirmTextAuthentication = getLngt("Möchten Sie den Eintrag wirklich sperren?");
|
||||
if ($f_at_authenticated != "1") :
|
||||
$buttonAuthentication = defineButtonType08(getLngt("Freischalten"), "action_lock", "authenticationFinishPage();", "90", "left", "3");
|
||||
$displayTextAuthentication = getLngt("(gesperrt)");
|
||||
$confirmTextAuthentication = getLngt("Möchten Sie den Eintrag wirklich freischalten?");
|
||||
endif;
|
||||
|
||||
$buttonVisibility = defineButtonType08(getLngt("Ausblenden"), "action_visible", "visibilityFinishPage();", "90", "left", "3");
|
||||
$confirmTextVisibility = getLngt("Möchten Sie den Eintrag wirklich ausblenden?");
|
||||
if ($f_at_visible != "1") :
|
||||
$buttonVisibility = defineButtonType08(getLngt("Einblenden"), "action_visible", "visibilityFinishPage();", "90", "left", "3");
|
||||
$displayTextVisibility = getLngt("(ausgeblendet)");
|
||||
$confirmTextVisibility = getLngt("Möchten Sie den Eintrag wirklich einblenden?");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Only for output:
|
||||
// Check for updating the list
|
||||
$javaScriptOut = "";
|
||||
if ($statusMessage == "" && $f_act != "" && $dbOperationCompleted == "1" && MASK_ARTICLE_SHOW_LIST == "1") :
|
||||
$javaScriptOut .= "opener.finishPage('".strWrapJs($f_at_eid)."','".strWrapJs($f_at_name)."','".strWrapJs($f_at_match)."','".strWrapJs($f_at_description)."','".strWrapJs($f_at_barcode)."');";
|
||||
endif;
|
||||
if ($f_act == "newArticle" && $dbOperationCompleted == "1") :
|
||||
// Reset fields of form-parameters
|
||||
clearParameters($httpVisualVars);
|
||||
// Init package factor
|
||||
if ($f_at_stk_itemquantity == "") : $f_at_stk_itemquantity = "1"; endif;
|
||||
if ($f_at_stk_areaquantity == "") : $f_at_stk_areaquantity = "1"; endif;
|
||||
endif;
|
||||
|
||||
|
||||
// ******************************************************************************************************************
|
||||
|
||||
|
||||
$f_at_eid = strWrapHtml($f_at_eid);
|
||||
$f_at_name = strWrapHtml($f_at_name);
|
||||
$f_at_match = strWrapHtml($f_at_match);
|
||||
$f_at_description = strWrapHtml($f_at_description);
|
||||
|
||||
if ($articleId != "" || AT_EID_GENERATION == "") :
|
||||
$f_at_eid_out = "<input class=\"smaller\" type=\"text\" name=\"f_at_eid\" value=\"" . $f_at_eid . "\" tabindex=\"30\" size=\"10\" maxlength=\"10\" " . (AT_EID_EDITABLE != "1" ? "readonly" : "") . ">";
|
||||
else :
|
||||
if ($f_at_eid == "") :
|
||||
$f_at_eid = $constAtEidPrefix;
|
||||
endif;
|
||||
|
||||
$f_at_eid_out = "<div style=\"float:left\"><input class=\"smaller\" type=\"text\" name=\"f_at_eid\" value=\"" . $f_at_eid . "\" tabindex=\"30\" size=\"10\" maxlength=\"10\"> </div>";
|
||||
$f_at_eid_out .= defineButtonType08("...", "action_eid", "searchMaxEID();", "20", "left", "2");
|
||||
endif;
|
||||
|
||||
// Generate Output
|
||||
if ($articleId != "") :
|
||||
$f_actText = "modifyArticle";
|
||||
else :
|
||||
$f_actText = "newArticle";
|
||||
endif;
|
||||
|
||||
$f_at_id = $articleId;
|
||||
|
||||
// Serial number
|
||||
$f_at_serialno_0 = "";
|
||||
if ($f_at_serialno == "1") :
|
||||
$f_at_serialno_0 = "checked";
|
||||
endif;
|
||||
// Article mountable
|
||||
$f_at_mountable_0 = "";
|
||||
if ($f_at_mountable == "1") :
|
||||
$f_at_mountable_0 = "checked";
|
||||
endif;
|
||||
|
||||
|
||||
/*
|
||||
$f_at_fixprice_discount_0 = "";
|
||||
if ($f_at_fixprice_discount == "1") : $f_at_fixprice_discount_0 = "checked"; endif;
|
||||
|
||||
$f_at_xxx_0 = "";
|
||||
$f_at_xxx_1 = "";
|
||||
if ($f_at_xxx == "1" || $f_at_xxx == "3") : $f_at_xxx_0 = "checked"; endif;
|
||||
if ($f_at_xxx == "2" || $f_at_xxx == "3") : $f_at_xxx_1 = "checked"; endif;
|
||||
|
||||
$f_at_commission_no_0 = "";
|
||||
$f_at_commission_no_1 = "";
|
||||
if ($f_at_commission_no == "0" || $f_at_commission_no == "") : $f_at_commission_no_0 = "checked"; endif;
|
||||
if ($f_at_commission_no == "1") : $f_at_commission_no_1 = "checked"; endif;
|
||||
*/
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?php echo $pageTitel . " " . $f_at_name ?></title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script src="../include/checkFormTags.js" type="text/javascript"></script>
|
||||
<script src="../include/searchLists.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
var f_at_id = '<?php echo $f_at_id ?>';
|
||||
|
||||
function clearAllFields() {
|
||||
document.location.href = "article_special.php";
|
||||
};
|
||||
|
||||
function authenticationFinishPage() {
|
||||
if (confirm('<?php echo $confirmTextAuthentication ?>')) {
|
||||
document.forms[0].f_at_authenticated.value='<?php echo $f_at_authenticated2 ?>';
|
||||
document.forms[0].f_act.value='setAuthentication';
|
||||
document.forms[0].submit();
|
||||
}
|
||||
};
|
||||
|
||||
function visibilityFinishPage() {
|
||||
if (confirm('<?php echo $confirmTextVisibility ?>')) {
|
||||
document.forms[0].f_at_visible.value='<?php echo $f_at_visible2 ?>';
|
||||
document.forms[0].f_act.value='setVisibility';
|
||||
document.forms[0].submit();
|
||||
}
|
||||
};
|
||||
|
||||
function finishPage() {
|
||||
var ok = true;
|
||||
/*
|
||||
if (!checkIsNaNIgnoreSpace(document.forms[0].f_at_bundlequantity.value, '<?php echo getLngt("Bitte tragen Sie eine Zahl bei der Verpackungsmenge ein!") ?>')) {ok = false;};
|
||||
*/
|
||||
if (!checkIsNaNIgnoreSpace(document.forms[0].f_at_stk_itemquantity.value, '<?php echo getLngt("Bitte tragen Sie eine Zahl bei der Lagerartikelmenge ein!") ?>')) {ok = false;};
|
||||
if (!checkIsNaNIgnoreSpace(document.forms[0].f_at_stk_areaquantity.value, '<?php echo getLngt("Bitte tragen Sie eine Zahl bei der Lagerstellplatzbedarfsmenge ein!") ?>')) {ok = false;};
|
||||
|
||||
if (ok) {
|
||||
document.forms[0].submit();
|
||||
}
|
||||
};
|
||||
|
||||
function clearParent() {
|
||||
document.forms[0].g2_at_id.value='';
|
||||
document.forms[0].g2_at_name.value='';
|
||||
};
|
||||
|
||||
function searchAtg() {
|
||||
var f_act = 'search';
|
||||
|
||||
var widthPopupWin = 500;
|
||||
var heightPopupWin = 700;
|
||||
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
|
||||
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
|
||||
var popupWin;
|
||||
popupWin = window.open("../stock/atg_list.php?f_act=" + f_act + "&generic=1111",
|
||||
"","dependent=yes,width=" + widthPopupWin + ",height=" +
|
||||
heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin +
|
||||
",scrollbars=yes");
|
||||
};
|
||||
|
||||
function clearAtg() {
|
||||
document.forms[0].g_atg_id.value='';
|
||||
document.forms[0].g_atg_key.value='';
|
||||
document.forms[0].g_atg_name.value='';
|
||||
};
|
||||
|
||||
function searchMaxEID() {
|
||||
var maxvalue = document.forms[0].f_eid_maxval.value;
|
||||
if (confirm('<?php echo getLngt("Soll der Wert") ?> ' + maxvalue + ' <?php echo getLngt("übernommen werden?") ?>')) {
|
||||
document.forms[0].f_at_eid.value = maxvalue;
|
||||
};
|
||||
};
|
||||
|
||||
function openPrintLayout() {
|
||||
var widthPopupWin = 800;
|
||||
var heightPopupWin = 700;
|
||||
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
|
||||
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
|
||||
var popupWin;
|
||||
popupWin = window.open("../stock/article_special.php?articleId=" + f_at_id + "&printVersion=1","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
|
||||
};
|
||||
|
||||
function openGroups(articleId) {
|
||||
var widthPopupWin = 800;
|
||||
var heightPopupWin = 700;
|
||||
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
|
||||
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
|
||||
var popupWin;
|
||||
popupWin = window.open("../admin/groupmembers.php?itemType=at&itemId=" + articleId,"","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
|
||||
};
|
||||
|
||||
function clearBundleArticle(atId) {
|
||||
document.forms[0].f_bundlearticle_remove.value = atId;
|
||||
document.forms[0].f_act.value = 'removeBundleArticle';
|
||||
document.forms[0].submit();
|
||||
};
|
||||
|
||||
function newBundleArticle(atId) {
|
||||
document.forms[0].f_act.value = 'newBundleArticle';
|
||||
document.forms[0].submit();
|
||||
};
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="menu_bgcol" onLoad="<?php echo $phpCurrentNavigationOnLoad ?><?php echo $javaScriptOut ?>displayStatusMessage();">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent2" name="maincontent" id="maincontent">
|
||||
|
||||
<form action="../stock/article_special.php" method="post">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="articleId" value="<?php echo $articleId ?>">
|
||||
<input type="hidden" name="f_at_authenticated" value="<?php echo $f_at_authenticated ?>">
|
||||
<input type="hidden" name="f_at_visible" value="<?php echo $f_at_visible ?>">
|
||||
<input type="hidden" name="g_atg_id" value="<?php echo $g_atg_id ?>">
|
||||
<input type="hidden" name="f_eid_maxval" value="<?php echo $f_eid_maxval ?>">
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
<input type="hidden" name="f_bundlearticle_remove" value="">
|
||||
<input type="hidden" name="objecttypemode" value="<?php echo ec($objecttypemode) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<div class="f10bp1_blue">
|
||||
<?php echo $title ?> <span class="f10bp1_red"><?php echo $displayTextAuthentication ?></span>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Bezeichnung") ?>*:</div>
|
||||
<div>
|
||||
<div style="float:left">
|
||||
<input class="smaller" type="text" name="f_at_name" value="<?php echo $f_at_name ?>" maxlength="35" size="50" tabindex="10">
|
||||
<!-- <input class="smaller" type="text" name="f_at_name2" value="..." maxlength="35" size="50" tabindex="20"> -->
|
||||
|
||||
<?php echo getLngt("ExtID") ?>*:
|
||||
</div>
|
||||
<?php echo $f_at_eid_out ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("5px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Zusatz:") ?></div>
|
||||
<div>
|
||||
<input class="smaller" type="text" name="f_at_match" value="<?php echo $f_at_match ?>" maxlength="100" size="50" tabindex="10">
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("5px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Beschreibung:") ?></div>
|
||||
<div>
|
||||
<textarea class="smaller" name="f_at_description" cols="90" rows="1" tabindex="420"><?php echo $f_at_description ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("5px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt(wrapPhrase("Warengruppe:", $objecttypemode)); ?></div>
|
||||
<div>
|
||||
<div style="float:left">
|
||||
<input class="smaller" type="text" name="g_atg_key" value="<?php echo $g_atg_key ?>" size="4" disabled >
|
||||
<input class="smaller" type="text" name="g_atg_name" value="<?php echo $g_atg_name ?>" size="15" disabled >
|
||||
|
||||
</div>
|
||||
<?php echo defineButtonType08("...", "action_atg", "searchAtg();", "20", "left"); ?>
|
||||
<div style="float:left">
|
||||
|
||||
<a href="javascript:clearAtg();" tabindex="330"><img src="../images/waste.png" border="0" height="15" width="12"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Barcode:") ?></div>
|
||||
<div>
|
||||
<div style="float:left">
|
||||
<input class="smaller" type="text" name="f_at_barcode" value="<?php echo $f_at_barcode ?>" size="50">
|
||||
</div>
|
||||
<div>
|
||||
<?php if ($f_at_barcode != "") : ?>
|
||||
<img src="../include/barcode_BCGcode39.php?text=<?php echo $f_at_barcode ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Seriennummern:") ?></div>
|
||||
<div>
|
||||
<div>
|
||||
<input class="f8np1" type="checkbox" name="f_at_serialno[]" value="1" <?php echo $f_at_serialno_0 ?>>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Montierbar:") ?></div>
|
||||
<div>
|
||||
<div>
|
||||
<input class="f8np1" type="checkbox" name="f_at_mountable[]" value="1" <?php echo $f_at_mountable_0 ?>>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Gebinde:") ?></div>
|
||||
<div>
|
||||
<div>
|
||||
<?php echo getLngt("Anzahl Verpackungsstücke:") ?>
|
||||
<input class="smaller" type="text" name="f_at_bundlequantity" value="<?php echo $f_at_bundlequantity ?>" size="4" >
|
||||
|
||||
<?php /*
|
||||
<?php echo getLngt("Gebindecode:") ?>
|
||||
<input class="smaller" type="text" name="f_at_bundlecode" value="<?php echo $f_at_bundlecode ?>" size="30" >
|
||||
*/ ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("5px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>> </div>
|
||||
<div>
|
||||
<?php echo $f_articlebundle ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Lagereinheit:") ?></div>
|
||||
<div>
|
||||
<div style="float:left">
|
||||
<?php getLngt(wrapPhrase("Anzahl Artikelstücke", $objecttypemode)); ?>*
|
||||
<input class="smaller" type="text" name="f_at_stk_itemquantity" value="<?php echo $f_at_stk_itemquantity ?>" size="4" >
|
||||
|
||||
<?php if (false) : ?>
|
||||
<?php if ($f_at_bundlequantity > 1) : ?>
|
||||
(<?php echo round(($f_at_stk_itemquantity / $f_at_bundlequantity), 2); ?> <?php echo getLngt("Gebinde") ?>)
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php echo getLngt("benötigen Lagerplätze") ?>*
|
||||
|
||||
<input class="smaller" type="text" name="f_at_stk_areaquantity" value="<?php echo $f_at_stk_areaquantity ?>" size="4" >
|
||||
<?php echo getLngt("(Stückzahl pro Lagerplätze)") ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<?php echo defineButtonType08(getLngt("Speichern"), "action_save", "document.forms[0].f_act.value='" . $f_actText . "';finishPage();", "90", "left", "3"); ?>
|
||||
<?php echo defineButtonType08(getLngt("Zurücksetzen"), "action_reset", "clearAllFields();", "90", "left", "3"); ?>
|
||||
<?php echo defineButtonType08(getLngt("Schließen"), "action_close", "window.close();", "90", "left", "3"); ?>
|
||||
<?php echo $buttonAuthentication ?>
|
||||
<?php echo $buttonVisibility ?>
|
||||
<?php echo defineButtonType08(getLngt("Gruppen"), "action_grp", "openGroups('" . ec($f_at_id) . "');", "90", "left", "3"); ?>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
220
html/stock/atg_list.php
Normal file
220
html/stock/atg_list.php
Normal file
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* atg_list.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "generic", "f_atg_key", "f_atg_name", "f_hq_visibility", "deactivateMenu"));
|
||||
|
||||
getLanguage(__FILE__);
|
||||
|
||||
$deactivateMenuStatic = "1";
|
||||
$pageTitel = "SPEZIELLE ARTIKELGRUPPE";
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
getCurrentScript(__FILE__);
|
||||
|
||||
$usrAccessArray["hq"] = "1";
|
||||
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
|
||||
if (!(authCheckEmployeeRights($emp_id, "14") || authCheckEmployeeRights($emp_id, "7"))) : gotoReferer("1"); endif;
|
||||
|
||||
|
||||
// Initialize value
|
||||
if ($generic == "") : $generic = "1111"; endif;
|
||||
$f_atg_key = trim($f_atg_key);
|
||||
$f_atg_name = trim($f_atg_name);
|
||||
|
||||
|
||||
$hqIdToBeStored = $hq_id;
|
||||
if ($f_hq_visibility == "" || count($f_hq_visibility) == 0) :
|
||||
$f_hq_visibility = "0";
|
||||
else:
|
||||
$f_hq_visibility = "1";
|
||||
$hqIdToBeStored = "0";
|
||||
endif;
|
||||
|
||||
// *** Actions ***
|
||||
if ($f_act == "saveAtGroupNew") :
|
||||
if ($f_atg_key != "" && $f_atg_name != "") :
|
||||
if (!existsEntry("articlegroup",array("md_id", $md_id, "atg_key", $f_atg_key))) :
|
||||
|
||||
insertStmt("articlegroup", array("md_id", $md_id, "atg_key", $f_atg_key, "atg_name", $f_atg_name, "hq_id", $hqIdToBeStored));
|
||||
|
||||
$f_atg_key = "";
|
||||
$f_atg_name = "";
|
||||
else :
|
||||
$statusMessage = getLngt("Der eingegebene Schlüssel existiert schon!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Geben Sie bitte einen Schlüssel und eine Artikelbezeichnung ein!");
|
||||
endif;
|
||||
endif;
|
||||
if ($f_act == "saveAtGroupModified") :
|
||||
if ($f_atg_key != "" && $f_atg_name != "") :
|
||||
if (existsEntry("articlegroup",array("md_id", $md_id, "atg_key", $f_atg_key))) :
|
||||
|
||||
updateStmt("articlegroup", "atg_key", $f_atg_key, array("atg_name", $f_atg_name, "hq_id", $hqIdToBeStored), "md_id = '" . $md_id . "'");
|
||||
|
||||
$f_atg_key = "";
|
||||
$f_atg_name = "";
|
||||
else :
|
||||
$statusMessage = getLngt("Der eingegebene Schlüssel existiert nicht!");
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = getLngt("Geben Sie bitte einen Schlüssel und eine Artikelbezeichnung ein!");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// Statement for article groups
|
||||
$sqlquery = "SELECT atg.atg_id, atg.hq_id, hq.hq_mnemonic, atg.atg_key, atg.atg_name"
|
||||
. " FROM articlegroup AS atg LEFT JOIN headquarters AS hq ON atg.hq_id = hq.hq_id"
|
||||
. " WHERE atg.md_id = '" . $md_id . "' AND (atg.hq_id = '0' OR atg.hq_id = '" . $hq_id . "')"
|
||||
. " ORDER BY atg.hq_id, atg.atg_key";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
// Table with header
|
||||
$numOfRows = 1;
|
||||
$lineToggler = 0;
|
||||
$tableOfRows = "<tr><td align=\"center\">" . getLngt("Zentrale") . "</td><td align=\"center\">" . getLngt("Schlüssel") . "</td><td align=\"center\">" . getLngt("Artikelgruppe") . "</td><td align=\"center\">" . getLngt("Bearbeiten") . "</td></tr>";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$numOfRows++;
|
||||
|
||||
if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif;
|
||||
$cellColor = getListColor($numOfRows, $lineToggler);
|
||||
|
||||
$tableOfRows .= "<tr>";
|
||||
if ($row["hq_id"] == "0") :
|
||||
$tableOfRows .= "<td align=\"left\" bgcolor=\"" . $cellColor ."\"> " . getLngt("Alle") . "</td>";
|
||||
else :
|
||||
$tableOfRows .= "<td align=\"left\" bgcolor=\"" . $cellColor ."\"> " . $row["hq_mnemonic"] . "</td>";
|
||||
endif;
|
||||
$tableOfRows .= "<td align=\"center\" bgcolor=\"" . $cellColor ."\"> <a href=\"javascript:finishPage('" . $row["atg_id"] . "','" . $row["atg_key"] . "','" . $row["atg_name"] . "');\">" . $row["atg_key"] . "</a></td>";
|
||||
$tableOfRows .= "<td align=\"left\" bgcolor=\"" . $cellColor ."\"> " . $row["atg_name"] . "</td>";
|
||||
$tableOfRows .= "<td align=\"center\" bgcolor=\"" . $cellColor ."\"> <a href=\"javascript:editAtg('" . $row["atg_key"] . "','" . $row["atg_name"] . "','" . $row["hq_id"] . "');\"><img src=\"../images/arrow_right.png\" border=\"0\" height=\"10\" width=\"25\"></a></td>";
|
||||
$tableOfRows .= "</tr>";
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?php echo $pageTitel ?></title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
// GENERIC function
|
||||
function finishPage(atg_id,atg_key,atg_name) {
|
||||
|
||||
<?php if (substr($generic, 0,1) == "1") : ?> opener.document.forms[0].g_atg_id.value = atg_id; <?php endif; ?>
|
||||
<?php if (substr($generic, 1,1) == "1") : ?> opener.document.forms[0].g_atg_key.value = atg_key; <?php endif; ?>
|
||||
<?php if (substr($generic, 2,1) == "1") : ?> opener.document.forms[0].g_atg_name.value = atg_name; <?php endif; ?>
|
||||
self.close();
|
||||
};
|
||||
|
||||
function finishPage2(f_act) {
|
||||
document.forms[0].f_act.value = f_act;
|
||||
document.forms[0].submit();
|
||||
};
|
||||
|
||||
function editAtg(atg_key, atg_name, hq_id) {
|
||||
document.forms[0].f_atg_key.value = atg_key;
|
||||
document.forms[0].f_atg_name.value = atg_name;
|
||||
if (hq_id == '0') {
|
||||
document.getElementsByName('f_hq_visibility[]')[0].checked = true;
|
||||
} else {
|
||||
document.getElementsByName('f_hq_visibility[]')[0].checked = false;
|
||||
}
|
||||
};
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>displayStatusMessage();">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent2" name="maincontent" id="maincontent">
|
||||
|
||||
<form action="../stock/atg_list.php" method="post">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="generic" value="<?php echo $generic ?>">
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<div class="f10bp1_blue">
|
||||
<?php echo $pageTitel ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px"); ?>
|
||||
|
||||
<div>
|
||||
<table class="f8np1" border="0" cellpadding="0">
|
||||
<?php echo $tableOfRows ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px"); ?>
|
||||
|
||||
<div>
|
||||
<?php echo getLngt("(Neue) Artikelgruppe:") ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("200px","left"); ?>><?php echo getLngt("Schlüssel:") ?></div>
|
||||
<div>
|
||||
<input type="text" name="f_atg_key" value="<?php echo $f_atg_key ?>" maxlength="10" size="10">
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("5px"); ?>
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("200px","left"); ?>><?php echo getLngt("Bezeichnung:") ?></div>
|
||||
<div>
|
||||
<input type="text" name="f_atg_name" value="<?php echo $f_atg_name ?>" maxlength="100" size="30">
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("5px"); ?>
|
||||
<div>
|
||||
<div <?php echo setStyleHtmlDiv("200px","left"); ?>><?php echo getLngt("Für alle Zentralen sichtbar:") ?></div>
|
||||
<div>
|
||||
<input type="checkbox" name="f_hq_visibility[]" value="1">
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<?php echo defineButtonType08(getLngt("Hinzufügen"), "action_new", "finishPage2('saveAtGroupNew');", "90", "left", "3"); ?>
|
||||
<?php echo defineButtonType08(getLngt("Überschreiben"), "action_reset", "finishPage2('saveAtGroupModified');", "90", "left", "3"); ?>
|
||||
<?php echo defineButtonType08(getLngt("Schließen"), "action_close", "window.close();", "90", "left", "3"); ?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
2939
html/stock/stock.php
Normal file
2939
html/stock/stock.php
Normal file
File diff suppressed because it is too large
Load Diff
134
html/stock/stock_barcodelist.php
Normal file
134
html/stock/stock_barcodelist.php
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* stock_barcodelist.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../include/inc_dbfields2array.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
// Stocks
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "statusMessage", "deactivateMenu",
|
||||
"stkIdRoot", "stkIdCurrent"));
|
||||
|
||||
// Id of the current employee and the costcenter (individual root-node) logged in
|
||||
if ($cscIdRoot == ""): $cscIdRoot = getFieldValueFromId("employee","emp_id",$emp_id,"csc_id"); endif;
|
||||
if ($customerId == ""): $customerId = getFieldValueFromId("costcenter","csc_id",$cscIdRoot,"cs_id"); endif;
|
||||
|
||||
// Get the rights of the employee logged in
|
||||
$empRights = getRights($emp_id);
|
||||
|
||||
// Init
|
||||
if ($cscIdCurrent == ""): $cscIdCurrent = $cscIdRoot; endif;
|
||||
if ($hqId == ""): $hqId = $hq_id; endif;
|
||||
if ($customerId == ""): $customerId = "0"; endif;
|
||||
|
||||
// Attention: Definition AFTER definitions of $customerId, $cscIdRoot and $cscIdCurrent
|
||||
$pageTitel = "LÄGER";
|
||||
$deactivateMenuStatic = "1";
|
||||
if ($generatePDF != "1") :
|
||||
include_once ("../geo/geocode.inc.php");
|
||||
endif;
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
// authCheckEmployeeRights($emp_id, "14", "1");
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
$userTypeName = getUserTypeName($userType);
|
||||
|
||||
// Parameters have to exist for both: customer and headquarter
|
||||
if (($userTypeName != "stk") && ($customerId == "" || $cscIdRoot == "" || $cscIdCurrent == "")) :
|
||||
gotoReferer("1"); // Parameter missing
|
||||
endif;
|
||||
|
||||
// Check authentication verifying emmployee an his/her costcenter- and customer-association
|
||||
if ( !( ($userType == "1") || ($userType == "4") || authCheck($hq_id,$usr_id,$emp_id,$cscIdRoot,$customerId,$cscIdActual) ) ) :
|
||||
gotoReferer("1");
|
||||
endif;
|
||||
|
||||
if ($stkIdCurrent == "" || !is_numeric($stkIdCurrent) && isStkChild($stkIdRoot, $stkIdCurrent, "1")) :
|
||||
$stkIdCurrent = $stkIdRoot;
|
||||
endif;
|
||||
|
||||
// Get all stocks of the current root stock
|
||||
$output = "";
|
||||
$tableSpacer = "150";
|
||||
if ($stkIdCurrent != "" && is_numeric($stkIdCurrent)) :
|
||||
|
||||
$sqlStmt = getStmtAllStocksByStkId($stkIdCurrent);
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$orientation = "0";
|
||||
$output .= "<table>\n";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
if ($orientation == "0") :
|
||||
$output .= " <tr>\n";
|
||||
endif;
|
||||
$output .= " <td>\n";
|
||||
$output .= " <span class=\"f14bp1\">" . $row["stk_name"] . "</span>";
|
||||
$output .= " </td>\n";
|
||||
$output .= " <td> </td>";
|
||||
$output .= " <td>\n";
|
||||
$tmpStkBarcode = trim($row["stk_barcode"]);
|
||||
if ($tmpStkBarcode != "") :
|
||||
$output .= " <img src=\"../include/barcode_BCGcode39.php?scale=1&text=" . $tmpStkBarcode . "\">";
|
||||
$output .= " <br><br>";
|
||||
endif;
|
||||
$output .= " </td>\n";
|
||||
|
||||
if ($orientation == "0") :
|
||||
$output .= " <td width=\"" . $tableSpacer . "\">\n";
|
||||
$output .= " ";
|
||||
$output .= " </td>\n";
|
||||
endif;
|
||||
|
||||
if ($orientation == "1") :
|
||||
$output .= " </tr>\n";
|
||||
endif;
|
||||
|
||||
if ($orientation == "0") :
|
||||
$orientation = "1";
|
||||
else :
|
||||
$orientation = "0";
|
||||
endif;
|
||||
endwhile;
|
||||
$result->free();
|
||||
$output .= "</table>\n";
|
||||
endif;
|
||||
?>
|
||||
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>BARCODES DER LAGERORTE</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<?php echo $output ?>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
134
html/stock/stock_jobs.php
Normal file
134
html/stock/stock_jobs.php
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* stock_jobs.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
|
||||
// Check HTTP-Parameters
|
||||
// Stocks
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdCurrent", "statusMessage", "deactivateMenu",
|
||||
"stkIdRoot", "f_sort"));
|
||||
|
||||
getLanguage(__FILE__);
|
||||
|
||||
$deactivateMenuStatic = "1";
|
||||
$pageTitel = getLngt("LAGERAUFTRÄGE");
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
getCurrentScript(__FILE__);
|
||||
|
||||
// Get the array for formatting the database-values for the output according to the defined type
|
||||
$outputFormatField = defineOutputFormats();
|
||||
|
||||
$numOfJobEntries = 0;
|
||||
|
||||
// Get all stocks of the current root stock
|
||||
$jobListOut = "";
|
||||
if ($stkIdRoot != "" && is_numeric($stkIdRoot)) :
|
||||
|
||||
$sqlStmt = getStmtAllStocksByStkId($stkIdRoot);
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$stkIdArray = array();
|
||||
$stkAdIdArray = array();
|
||||
$stkHsnoArray = array();
|
||||
while ($row = $result->fetch_assoc()):
|
||||
if ($row["ad_id"] != "0") :
|
||||
$stkIdArray[] = $row["stk_id"];
|
||||
$stkAddressArray[] = $row["ad_id"] . "-" . $row["stk_hsno"];
|
||||
endif;
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
$stkIdArrayLen = count($stkIdArray);
|
||||
|
||||
// Initialize date-ranges to the current date
|
||||
// $fromDateRange = getDateTime("3") . " 00:00:00";
|
||||
$fromDateRange = getDateTime("date_plus_offset", array(0,-3,0), "Y-m-d") . " 00:00:00";
|
||||
$toDateRange = getDateTime("3") . " 23:59:59";
|
||||
|
||||
if (count($stkAddressArray) > 0) :
|
||||
$jobListOut = getStockJobs("jb.jb_ordertime >= '" . $fromDateRange . "' AND jb.jb_ordertime <= '" . $toDateRange . "' AND CONCAT(ad.ad_id,'-',tr.tr_hsno) IN ('" . implode("','", $stkAddressArray) . "')", $f_sort);
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?php echo $pageTitel ?></title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
function finishPageJobAction(jobId) {
|
||||
opener.document.forms[0].f_mv_jb_id.value = jobId;
|
||||
this.close();
|
||||
};
|
||||
|
||||
function finishPageSortStockJobs(num) {
|
||||
var sortVal = '';
|
||||
if (num == '0') {sortVal = 'jb.jb_id';};
|
||||
if (num == '1') {sortVal = 'jb.jb_ordertime';};
|
||||
if (num == '2') {sortVal = 'jb.jb_totalprice';};
|
||||
if (num == '3') {sortVal = 'comp_1';};
|
||||
if (num == '4') {sortVal = 'address_1';};
|
||||
if (num == '5') {sortVal = 'comp_2';};
|
||||
if (num == '6') {sortVal = 'address_2';};
|
||||
if (num == '7') {sortVal = '';};
|
||||
document.forms[0].f_sort.value = sortVal;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<form name="stock_jobs" action="../stock/stock_jobs.php" method="post">
|
||||
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
<input type="hidden" name="f_sort" value="">
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<div class="f10bp1_blue">
|
||||
<?php echo getLngt("LAGERAUFTRÄGE"); ?>
|
||||
</div>
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<table>
|
||||
<?php echo $jobListOut ?>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
814
html/stock/stock_move.php
Normal file
814
html/stock/stock_move.php
Normal file
@@ -0,0 +1,814 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* stock_move.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdCurrent", "statusMessage", "deactivateMenu",
|
||||
"stkIdRoot", "stkIdCurrent", "f_mv_at", "f_mv_stk_itemquantity",
|
||||
"f_mv_stk_from", "f_mv_stk_to", "f_mv_tan", "f_mv_remark",
|
||||
"f_mv_serialno", "f_mv_jb_id",
|
||||
"f_count", "f_count2",
|
||||
"f_mv_search_stk_name_from", "f_mv_search_stk_name_to"));
|
||||
|
||||
// Id of the current employee and the costcenter (individual root-node) logged in
|
||||
if ($cscIdRoot == ""): $cscIdRoot = getFieldValueFromId("employee","emp_id",$emp_id,"csc_id"); endif;
|
||||
if ($customerId == ""): $customerId = getFieldValueFromId("costcenter","csc_id",$cscIdRoot,"cs_id"); endif;
|
||||
|
||||
// Get the rights of the employee logged in
|
||||
$empRights = getRights($emp_id);
|
||||
|
||||
// Init
|
||||
if ($cscIdCurrent == ""): $cscIdCurrent = $cscIdRoot; endif;
|
||||
if ($hqId == ""): $hqId = $hq_id; endif;
|
||||
if ($customerId == ""): $customerId = "0"; endif;
|
||||
|
||||
getLanguage(__FILE__);
|
||||
|
||||
// Attention: Definition AFTER definitions of $customerId, $cscIdRoot and $cscIdCurrent
|
||||
$pageTitel = getLngt("GESAMMELTE LAGERBEWEGUNG");
|
||||
$deactivateMenuStatic = "1";
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
include_once ("../include/inc_article.inc.php");
|
||||
getCurrentScript(__FILE__);
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
$userTypeName = getUserTypeName($userType);
|
||||
|
||||
// Parameters have to exist for both: customer and headquarter
|
||||
if (($userTypeName != "stk") && ($customerId == "" || $cscIdRoot == "" || $cscIdCurrent == "")) :
|
||||
die ("$PHP_SELF: Parameter fehlen!");
|
||||
endif;
|
||||
|
||||
// Check authentication verifying emmployee an his/her costcenter- and customer-association
|
||||
if ( !( ($userType == "1") || ($userType == "4") || authCheck($hq_id,$usr_id,$emp_id,$cscIdRoot,$customerId,$cscIdActual) ) ) :
|
||||
gotoReferer("1");
|
||||
endif;
|
||||
|
||||
|
||||
// Get right status of the current employee
|
||||
$stockRight = false;
|
||||
if ($userTypeName == "hq") :
|
||||
if (substr($empRights,14,1) == "1") : $stockRight = true; endif;
|
||||
endif;
|
||||
|
||||
// Display area configuration for planning the stock capacities
|
||||
if ($f_stk_planning == "" || count($f_stk_planning) == 0) :
|
||||
$f_stk_planning = "0";
|
||||
else:
|
||||
$f_stk_planning = "1";
|
||||
endif;
|
||||
|
||||
// Enter the max quantity of the current stock
|
||||
if ($f_stk_maxquantity == "") : $f_stk_maxquantity = "0"; endif;
|
||||
|
||||
// Name of the root stock
|
||||
$stkNameRoot = getFieldValueFromId("stock","stk_id",$stkIdRoot,"stk_name");
|
||||
|
||||
// Name of the current bundle article
|
||||
$atNameBundle = getFieldValueFromId("article","at_id",$f_mv_at,"at_name");
|
||||
|
||||
// Quantity of the bundle article (equals to the factor of each article bundled ...)
|
||||
if ($f_mv_stk_itemquantity == "") :
|
||||
$f_mv_stk_itemquantity = 0;
|
||||
endif;
|
||||
|
||||
// Check for incoming goods according to capacities if stock planning is active
|
||||
$incoming = false;
|
||||
$f_stk_planning = getFieldValueFromId("stock","stk_id",$stkIdRoot,"stk_planning");
|
||||
if ($f_stk_planning == "1" && $f_mv_stk_to != "0") :
|
||||
$incoming = true;
|
||||
endif;
|
||||
|
||||
// Check for outgoing goods according to existing quantities
|
||||
$outgoing = false;
|
||||
if ($f_mv_stk_from != "0") :
|
||||
$outgoing = true;
|
||||
endif;
|
||||
|
||||
// Close current window automatically
|
||||
$autoClose = "0";
|
||||
|
||||
/*
|
||||
echo "customerId: " . $customerId . "<br><br>" . "stkIdRoot: " . $stkIdRoot . "<br>" . "stkIdCurrent: " . $stkIdCurrent . "<br>";
|
||||
echo "stkNameCurrent: " . $stkNameCurrent . "<br>" . "stkPathCurrent: " . $stkPathCurrent . "<br>" . "nameStock: " . $nameStock . "<br><br>";
|
||||
echo "Date range: " . $fromDateRange . " - " . $toDateRange . "<br>";
|
||||
echo "f_act: " . $f_act . "<br>";
|
||||
*/
|
||||
|
||||
if (true) :
|
||||
|
||||
// Only it is possible to enable/disable the stock area planning for the whole tree
|
||||
$f_stk_planning = getFieldValueFromId("stock","stk_id",$stkIdRoot,"stk_planning");
|
||||
|
||||
// *** Save the stock article movement (Begin) ***
|
||||
if ($f_act == "moveArticle") :
|
||||
|
||||
if ($f_count > 0 && $f_count2 >= 0) :
|
||||
|
||||
TA("B");
|
||||
$currentTime = getDateTime("0");
|
||||
$statusMessage = "";
|
||||
|
||||
for ($i = 0; $i <= $f_count; $i++) :
|
||||
for ($j = 0; $j <= $f_count2; $j++) :
|
||||
getSecHttpVars("1",array("f_mv_stk_from_" . $i . "_" . $j, "f_mv_at_id_" . $i . "_" . $j, "f_mv_stk_itemquantity_" . $i . "_" . $j, "f_mv_stk_to_" . $i . "_" . $j, "f_mv_tan_" . $i . "_" . $j, "f_mv_remark_" . $i . "_" . $j, "f_mv_serialno_" . $i . "_" . $j, "f_mv_jb_id_" . $i . "_" . $j));
|
||||
|
||||
$tmpQuantity = ${("f_mv_stk_itemquantity_" . $i . "_" . $j)};
|
||||
if ($tmpQuantity > 0) :
|
||||
$tmpStkFrom = ${("f_mv_stk_from_" . $i . "_" . $j)};
|
||||
$tmpAtId = ${("f_mv_at_id_" . $i . "_" . $j)};
|
||||
$tmpStkTo = ${("f_mv_stk_to_" . $i . "_" . $j)};
|
||||
$tmpTan = ${("f_mv_tan_" . $i . "_" . $j)};
|
||||
$tmpRemark = ${("f_mv_remark_" . $i . "_" . $j)};
|
||||
$tmpSerialNo = ${("f_mv_serialno_" . $i . "_" . $j)};
|
||||
$tmpJbId = ${("f_mv_jb_id_" . $i . "_" . $j)};
|
||||
|
||||
$moveResult = stockMoveTA ($tmpStkFrom, $tmpStkTo, $tmpAtId, $tmpQuantity, $tmpTan, $tmpRemark, $tmpSerialNo, $tmpJbId, $usr_id, $f_mv_at, $currentTime);
|
||||
|
||||
if ($moveResult[0]) :
|
||||
// TA executed
|
||||
$f_mv_stk_itemquantity = 0; // Reset quantity value (only for display)
|
||||
$f_mv_tan = "";
|
||||
$f_mv_remark = "";
|
||||
$f_mv_serialno = "";
|
||||
endif;
|
||||
if (trim($moveResult[1]) != "") :
|
||||
$tmpAtEid = getFieldValueFromId("article","at_id",$tmpAtId,"at_eid");
|
||||
if ($statusMessage != "") : $statusMessage .= " / "; endif;
|
||||
$statusMessage .= $tmpAtEid . ": " . $moveResult[1] . " ";
|
||||
endif;
|
||||
endif;
|
||||
endfor;
|
||||
endfor;
|
||||
|
||||
$autoClose = "1";
|
||||
|
||||
TA("C");
|
||||
TA("E");
|
||||
endif;
|
||||
endif;
|
||||
// *** Save the stock article movement (End) ***
|
||||
|
||||
|
||||
if ($autoClose == "0") :
|
||||
|
||||
// **************************************************
|
||||
// * Get all articles of the current bundle article *
|
||||
// **************************************************
|
||||
|
||||
// Get all articles by top-down recursion
|
||||
getTreeOfBundledArticles($f_mv_at, 0, 1);
|
||||
|
||||
// --- DEBUG START --------------------------------------------------------------------------------
|
||||
if (false) :
|
||||
echo "<br>";
|
||||
echo "recurseCount: " . $recurseCount . "<br><br>";
|
||||
|
||||
echo "atArray:<br>";
|
||||
$keys = array_keys($atArray);
|
||||
$keysLen = count($keys);
|
||||
for ($i = 0; $i < $keysLen; $i++) :
|
||||
$tmpAtId = $keys[$i];
|
||||
echo $tmpAtId . " : " . $atArray[$tmpAtId] . "<br>";
|
||||
endfor;
|
||||
|
||||
echo "----------------<br>";
|
||||
endif;
|
||||
// --- DEBUG END -----------------------------------------------------------------------------------
|
||||
|
||||
// Iterate all item articles beeing in the bundle
|
||||
$stockArticles = array();
|
||||
$out = "";
|
||||
$count = 0;
|
||||
$count2 = 0;
|
||||
$quantityStockSumNeeded = 0;
|
||||
$displayBacklog = false;
|
||||
$keys = array_keys($atArray);
|
||||
$keysLen = count($keys);
|
||||
for ($i = 0; $i < $keysLen; $i++) :
|
||||
$tmpAtId = $keys[$i];
|
||||
$tmpQuantityOneBundle = $atArray[$tmpAtId];
|
||||
|
||||
// ATTENTION: Multiply quantity of 1 bundled article by quantity of the whole bundle
|
||||
$tmpQuantity = $tmpQuantityOneBundle * $f_mv_stk_itemquantity;
|
||||
|
||||
$atEid = getFieldValueFromId("article","at_id",$tmpAtId,"at_eid");
|
||||
$atName = getFieldValueFromId("article","at_id",$tmpAtId,"at_name");
|
||||
|
||||
$tmpStockArticles = showStockArticles($stkIdCurrent, "1", "at.at_id = '" . $tmpAtId . "'", "stkat.stkat_itemquantity DESC");
|
||||
$stockArticles[] = $tmpStockArticles;
|
||||
|
||||
$out .= "<div>\n";
|
||||
$out .= $tmpStockArticles;
|
||||
$out .= "</div>\n";
|
||||
$out .= "<div style=\"width:100%; height:5px;\"> </div>";
|
||||
$out .= "<div>\n";
|
||||
|
||||
$stmtStockArticles = getStmtStockArticles ($stkIdCurrent, "1", "at.at_id ='" . $tmpAtId . "'", "stkat.stkat_itemquantity DESC") ;
|
||||
$result = $db->query($stmtStockArticles);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
// Only if the current article has to go out of the stock then split per stocks and check for quantities !!!
|
||||
$tmpCount = 0; // Count number of stock areas the current article will be found
|
||||
if ($outgoing) :
|
||||
// Iterate all stocks having this current article of the whole bundle
|
||||
// $tmpAtLeastOneStockHasEnoughQuantityOfRequestedQuantity = false;
|
||||
// $tmpSumOfStkatItemQuantity = 0;
|
||||
$tmpStockArticleArray = array();
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$tmpStockArticleArray["stk_id"][$tmpCount] = $row["stk_id"];
|
||||
$tmpStockArticleArray["stk_name"][$tmpCount] = $row["stk_name"];
|
||||
$tmpStockArticleArray["stkat_itemquantity"][$tmpCount] = $row["stkat_itemquantity"];
|
||||
|
||||
// $tmpSumOfStkatItemQuantity += $row["stkat_itemquantity"];
|
||||
|
||||
// if (!$tmpAtLeastOneStockHasEnoughQuantityOfRequestedQuantity && $row["stkat_itemquantity"] >= $tmpQuantity) :
|
||||
// $tmpAtLeastOneStockHasEnoughQuantityOfRequestedQuantity = true;
|
||||
// endif;
|
||||
|
||||
$tmpCount++;
|
||||
endwhile;
|
||||
$result->free();
|
||||
endif;
|
||||
|
||||
if ($incoming) :
|
||||
// Get the free places of the target stock according to the current article
|
||||
$stkQuantityFree = getFreeStkQuantity ($f_mv_stk_to, $tmpAtId, 0, "1");
|
||||
|
||||
// Number of articles matching number of stock areas
|
||||
$atStkItemQuantity = getFieldValueFromId("article", "at_id", $tmpAtId, "at_stk_itemquantity");
|
||||
$atStkAreaQuantity = getFieldValueFromId("article", "at_id", $tmpAtId, "at_stk_areaquantity");
|
||||
endif;
|
||||
|
||||
// Iterate until the whole requested quantity can be disposed
|
||||
$restOfItemQuantity = $tmpQuantity;
|
||||
$count2 = max($count2, $tmpCount);
|
||||
for ($j = 0; $j <= $tmpCount; $j++) :
|
||||
|
||||
$tmpStockFromForDispose = $f_mv_stk_from;
|
||||
if ($outgoing) :
|
||||
$tmpStockFromForDispose = $tmpStockArticleArray["stk_id"][$j];
|
||||
endif;
|
||||
|
||||
$out .= "<div>\n";
|
||||
|
||||
$out .= "<select name=\"f_mv_stk_from_" . $i . "_" . $j . "\">";
|
||||
$out .= " <option value=\"0\">" . getLngt("Eingangslieferung") . "</option>";
|
||||
$out .= addOptionsFromTable("stock","stk_id","stk_name","stk_name","stk_id = '" . $stkIdRoot . "' OR stk_path LIKE '%//" . $stkIdRoot . "//%'",$tmpStockFromForDispose);
|
||||
$out .= "</select> ";
|
||||
|
||||
$out .= "<select name=\"f_mv_stk_to_" . $i . "_" . $j . "\">";
|
||||
$out .= " <option value=\"0\">" . getLngt("Ausgangslager") . "</option>";
|
||||
$out .= addOptionsFromTable("stock","stk_id","stk_name","stk_name","stk_id = '" . $stkIdRoot . "' OR stk_path LIKE '%//" . $stkIdRoot . "//%'",$f_mv_stk_to);
|
||||
$out .= "</select> ";
|
||||
|
||||
$out .= "<input type=\"hidden\" name=\"f_mv_at_id_" . $i . "_" . $j . "\" value=\"" . $tmpAtId . "\"> ";
|
||||
// $out .= "<input type=\"text\" name=\"f_mv_at_eid_" . $i . "\" value=\"" . $atEid . "\" size=\"10\" readonly disabled> ";
|
||||
$out .= "<input type=\"text\" name=\"f_mv_at_name_" . $i . "_" . $j . "\" value=\"" . $atName . "\" size=\"20\" readonly disabled> ";
|
||||
|
||||
$quantityToBeDisposed = $tmpQuantity;
|
||||
if ($outgoing):
|
||||
$quantityToBeDisposed = $tmpStockArticleArray["stkat_itemquantity"][$j];
|
||||
if ($j < $tmpCount):
|
||||
$quantityToBeDisposed = min($restOfItemQuantity, $tmpStockArticleArray["stkat_itemquantity"][$j]);
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ($incoming) :
|
||||
// Get the free places of the target stock according to the current article
|
||||
$stkItemQuantityFree = getFreeStkQuantity($f_mv_stk_to, $tmpAtId, $quantityToBeDisposed, "2");
|
||||
|
||||
$stkQuantityNeeded = ceil(($quantityToBeDisposed * $atStkAreaQuantity) / $atStkItemQuantity);
|
||||
|
||||
// Sum up all quantities
|
||||
$quantityStockSumNeeded += $stkQuantityNeeded;
|
||||
|
||||
if ($stkQuantityFree < $quantityStockSumNeeded) :
|
||||
$quantityToBeDisposed = 0;
|
||||
$displayBacklog = true;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ($quantityToBeDisposed == "") : $quantityToBeDisposed = 0; endif;
|
||||
$out .= "<input type=\"text\" name=\"f_mv_stk_itemquantity_" . $i . "_" . $j . "\" value=\"" . $quantityToBeDisposed . "\" size=\"5\"> ";
|
||||
|
||||
$restOfItemQuantity = $restOfItemQuantity - $tmpStockArticleArray["stkat_itemquantity"][$j];
|
||||
|
||||
// If stock movement is an outgoing transaction then display available quantity (sum of stocks)
|
||||
if ($outgoing && $j == $tmpCount) :
|
||||
if ($restOfItemQuantity > 0) :
|
||||
$out .= "<span class=\"f8np1_red\">" . getLngt("nicht verfügbar:") . " " . $restOfItemQuantity . "</span> ";
|
||||
$out .= "<span class=\"f8np1_red\">" . getLngt("von:") . " " . $tmpQuantity . "</span> ";
|
||||
$out .= "<span class=\"f8np1_red\">(" . $tmpQuantityOneBundle . " x " . $f_mv_stk_itemquantity . ")</span> ";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ($incoming && $displayBacklog) :
|
||||
$out .= "<span class=\"f8np1_red\">" . getLngt("Überhang auf dem Ziellager:") . " " . abs($stkQuantityFree - $quantityStockSumNeeded) . " " . getLngt("Stellplätze") . "</span> ";
|
||||
endif;
|
||||
|
||||
$out .= "</div>\n";
|
||||
$out .= "<div style=\"width:100%; height:15px;\"> </div>";
|
||||
|
||||
if ($restOfItemQuantity <= 0) :
|
||||
break;
|
||||
endif;
|
||||
endfor;
|
||||
$out .= "<div style=\"width:100%; height:20px;\"> </div>";
|
||||
|
||||
$count++;
|
||||
endfor;
|
||||
endif; // $autoClose == "0"
|
||||
endif;
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?php echo $pageTitel ?></title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script src="../include/lib_global.js" type="text/javascript"></script>
|
||||
<script src="../include/searchLists.js" type="text/javascript"></script>
|
||||
<script src="../include/checkFormTags.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var autoClose = '<?php echo $autoClose ?>';
|
||||
if (autoClose == '1') {
|
||||
opener.document.forms[0].statusMessage.value = '<?php echo $statusMessage ?>';
|
||||
opener.stkFinishPage('journalSearch');
|
||||
this.window.close();
|
||||
};
|
||||
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
function stkFinishPage(f_act) {
|
||||
document.forms[0].f_act.value=f_act;
|
||||
if (document.forms[0].currentNavigationItem) {
|
||||
document.forms[0].currentNavigationItem.value='lager';
|
||||
}
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
function articleMoveFinishPage() {
|
||||
stkFinishPage('moveArticle');
|
||||
}
|
||||
|
||||
|
||||
// ********
|
||||
// * AJAX *
|
||||
// ********
|
||||
|
||||
// Init
|
||||
var stkIdRoot = '<?php echo $stkIdRoot ?>';
|
||||
var listLenth;
|
||||
var stkIdList;
|
||||
var stkNameList;
|
||||
var stkBarcodeList;
|
||||
var scanCodeIsSerialNo = false;
|
||||
var scanCodeIsArticleBarcode = false;
|
||||
var scanCodeIsStockBarcode = false;
|
||||
var stkMvData = new textlist ();
|
||||
var stkMvArticleData = new textlist ();
|
||||
var stkMvStockData = new textlist ();
|
||||
|
||||
// Init global JS-parameters
|
||||
function initGlobals () {
|
||||
scanCodeIsSerialNo = false;
|
||||
scanCodeIsArticleBarcode = false;
|
||||
scanCodeIsStockBarcode = false;
|
||||
stkMvData = new textlist ();
|
||||
stkMvArticleData = new textlist ();
|
||||
stkMvStockData = new textlist ();
|
||||
}
|
||||
|
||||
function scan_request(specificURL, parms) {
|
||||
var myAjax = new Ajax.Request(
|
||||
specificURL,
|
||||
{method: 'get', asynchronous: false, parameters: parms}
|
||||
);
|
||||
eval(myAjax.transport.responseText);
|
||||
}
|
||||
|
||||
function executeScanCode() {
|
||||
frm = document.forms[0];
|
||||
var elem = document.forms[0].f_scan;
|
||||
var ev = elem.value;
|
||||
|
||||
// Init Ajax call ...
|
||||
scan_request('../stock/ajaxReqScanExecution.php', 'mode=0');
|
||||
|
||||
// Check command
|
||||
if (ev == '') {
|
||||
return;
|
||||
} else if (ev == 'MV-IN') {
|
||||
// Incoming goods
|
||||
frm.f_stkat_scanmode[0].checked = true;
|
||||
} else if (ev == 'MV-OUT') {
|
||||
// Outgoing goods
|
||||
frm.f_stkat_scanmode[1].checked = true;
|
||||
} else if (ev == 'MV-DISPOSAL') {
|
||||
// Disposal
|
||||
articleMoveFinishPage();
|
||||
} else if (ev == 'MV-QUANTITY') {
|
||||
// Set quantity field (source f_store)
|
||||
frm.f_mv_stk_itemquantity.value = frm.f_store.value;
|
||||
frm.f_store.value = '';
|
||||
} else if (ev == 'MV-TAN') {
|
||||
// Set tan field (source f_store)
|
||||
frm.f_mv_tan.value = frm.f_store.value;
|
||||
frm.f_store.value = '';
|
||||
} else if (ev == 'MV-REMARK') {
|
||||
// Set remark field (source f_store)
|
||||
frm.f_mv_remark.value = frm.f_store.value;
|
||||
frm.f_store.value = '';
|
||||
} else if (ev == 'MV-SERNO') {
|
||||
// Set serial number field (source f_store)
|
||||
frm.f_mv_serialno.value = frm.f_store.value;
|
||||
frm.f_store.value = '';
|
||||
} else if (ev == 'MV-JOB') {
|
||||
// Set serial number field (source f_store)
|
||||
frm.f_mv_jb_id.value = frm.f_store.value;
|
||||
frm.f_store.value = '';
|
||||
if (frm.f_mv_jb_id.value.length > 0) {
|
||||
$('mvJobId').setStyle({borderColor: '#FF0000', borderWidth: '2px', borderStyle: 'solid', padding: '4px'});
|
||||
};
|
||||
} else if (ev == 'MV-OPENJOBS') {
|
||||
frm.f_store.value = '';
|
||||
openCurrentListOfStockJobs();
|
||||
} else if (ev == '-0-' || ev == '-1-' || ev == '-2-' || ev == '-3-' || ev == '-4-' ||
|
||||
ev == '-5-' || ev == '-6-' || ev == '-7-' || ev == '-8-' || ev == '-9-') {
|
||||
// Number
|
||||
var numCmd = ev.substr(1, 1);
|
||||
frm.f_store.value = frm.f_store.value + numCmd;
|
||||
} else if (ev == '-BACK-') {
|
||||
// Remove last character
|
||||
var tmpLen = frm.f_store.value.length;
|
||||
tmpLen = tmpLen - 1;
|
||||
frm.f_store.value = frm.f_store.value.substr(0, tmpLen);
|
||||
} else if (ev == '-CLR-') {
|
||||
// Remove last character
|
||||
frm.f_store.value = '';
|
||||
} else {
|
||||
|
||||
// **********************
|
||||
// *** INCOMING GOODS ***
|
||||
// **********************
|
||||
|
||||
if (frm.f_stkat_scanmode[0].checked == true) {
|
||||
// First check scan value is an article barcode
|
||||
scan_request('../stock/ajaxReqScanExecution.php', 'mode=2&scanCode=' + ev);
|
||||
|
||||
if (!scanCodeIsArticleBarcode) {
|
||||
// Check scan value is a stock barcode.
|
||||
scan_request('../stock/ajaxReqScanExecution.php', 'mode=3&scanCode=' + ev + '&stkIdRoot=' + stkIdRoot);
|
||||
}
|
||||
|
||||
if (!scanCodeIsArticleBarcode && !scanCodeIsStockBarcode) {
|
||||
// Check scan value is a serial no.
|
||||
scan_request('../stock/ajaxReqScanExecution.php', 'mode=1&scanCode=' + ev);
|
||||
}
|
||||
|
||||
if (!scanCodeIsArticleBarcode && !scanCodeIsStockBarcode && !scanCodeIsSerialNo) {
|
||||
// Store unknown scanned barcode to storage
|
||||
frm.f_store.value = frm.f_scan.value;
|
||||
}
|
||||
|
||||
// Execute if an article does exist according to the barcode
|
||||
if (scanCodeIsArticleBarcode) {
|
||||
// Prepare article search in all stocks
|
||||
// Execute after reload
|
||||
frm.js_execute_cmd.value = '2';
|
||||
frm.js_execute_data.value = stkMvArticleData[0]; // Article ID
|
||||
|
||||
// Display the stock articles, filtered accorting to this specified article
|
||||
frm.maskDisplayArticleSwitch.value = '1';
|
||||
|
||||
// Set current stock to root stock (top level)
|
||||
frm.stkIdCurrent.value = stkIdRoot;
|
||||
|
||||
// Show ALL stocks (whole tree)
|
||||
for(i=0;i<frm.f_displayModeStockArticle.length;++i) {
|
||||
if (frm.f_displayModeStockArticle.options[i].value == '1') {
|
||||
frm.f_displayModeStockArticle.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (stkMvArticleData[0]!= '') {
|
||||
for(i=0;i<frm.f_mv_at.length;++i) {
|
||||
if (frm.f_mv_at.options[i].value == stkMvArticleData[0]) {
|
||||
frm.f_mv_at.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reload page
|
||||
stkFinishPage('');
|
||||
}
|
||||
|
||||
// Execute if a stock does exist according to the barcode
|
||||
if (scanCodeIsStockBarcode) {
|
||||
// Prepare stock search
|
||||
// Execute after reload
|
||||
frm.js_execute_cmd.value = '3';
|
||||
frm.js_execute_data.value = stkMvArticleData[0]; // Stock ID
|
||||
|
||||
if (stkMvStockData[0]!= '') {
|
||||
for(i=0;i<frm.f_mv_stk_to.length;++i) {
|
||||
if (frm.f_mv_stk_to.options[i].value == stkMvStockData[0]) {
|
||||
frm.f_mv_stk_to.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set current stock to the selected stock
|
||||
frm.stkIdCurrent.value = stkMvStockData[0];
|
||||
|
||||
// Show ONLY current stock
|
||||
for(i=0;i<frm.f_displayModeStockArticle.length;++i) {
|
||||
if (frm.f_displayModeStockArticle.options[i].value == '0') {
|
||||
frm.f_displayModeStockArticle.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Reload page
|
||||
stkFinishPage('');
|
||||
}
|
||||
}
|
||||
|
||||
// **********************
|
||||
// *** OUTGOING GOODS ***
|
||||
// **********************
|
||||
|
||||
if (frm.f_stkat_scanmode[1].checked == true) {
|
||||
// First check scan value is a serial no.
|
||||
scan_request('../stock/ajaxReqScanExecution.php', 'mode=1&scanCode=' + ev);
|
||||
|
||||
if (!scanCodeIsSerialNo) {
|
||||
// Check scan value is an article barcode
|
||||
scan_request('../stock/ajaxReqScanExecution.php', 'mode=2&scanCode=' + ev);
|
||||
}
|
||||
|
||||
if (!scanCodeIsSerialNo && !scanCodeIsArticleBarcode) {
|
||||
// Check scan value is a serial no.
|
||||
scan_request('../stock/ajaxReqScanExecution.php', 'mode=3&scanCode=' + ev + '&stkIdRoot=' + stkIdRoot);
|
||||
}
|
||||
|
||||
if (!scanCodeIsArticleBarcode && !scanCodeIsStockBarcode && !scanCodeIsSerialNo) {
|
||||
// Store unknown scanned barcode to storage
|
||||
frm.f_store.value = frm.f_scan.value;
|
||||
}
|
||||
|
||||
// Execute if a serial number does exist
|
||||
if (scanCodeIsSerialNo) {
|
||||
// *** Fill fields for the article movement ***
|
||||
|
||||
// Execute after reload
|
||||
frm.js_execute_cmd.value = '1';
|
||||
frm.js_execute_data.value = stkMvData[5]; // Serial number
|
||||
|
||||
// Switch incoming journal stock (stk_to) to the outgoing stock of the new movement (stk_from)
|
||||
if (stkMvData[3]!= '') {
|
||||
for(i=0;i<frm.f_mv_stk_from.length;++i) {
|
||||
if (frm.f_mv_stk_from.options[i].value == stkMvData[3]) {
|
||||
frm.f_mv_stk_from.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stkMvData[2]!= '') {
|
||||
for(i=0;i<frm.f_mv_at.length;++i) {
|
||||
if (frm.f_mv_at.options[i].value == stkMvData[2]) {
|
||||
frm.f_mv_at.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (stkMvData[3]!= '') {
|
||||
for(i=0;i<frm.f_mv_stk_to.length;++i) {
|
||||
if (frm.f_mv_stk_to.options[i].value == '0') {
|
||||
frm.f_mv_stk_to.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
// }
|
||||
// frm.f_mv_stk_itemquantity.value = '';
|
||||
frm.f_mv_tan.value = stkMvData[4];
|
||||
// frm.f_mv_remark.value = '';
|
||||
frm.f_mv_serialno.value = stkMvData[5];
|
||||
|
||||
// Reload page
|
||||
stkFinishPage('');
|
||||
}
|
||||
|
||||
// Execute if an article does exist according to the barcode
|
||||
if (scanCodeIsArticleBarcode) {
|
||||
// Prepare article search in all stocks
|
||||
// Execute after reload
|
||||
frm.js_execute_cmd.value = '2';
|
||||
frm.js_execute_data.value = stkMvArticleData[0]; // Article ID
|
||||
|
||||
// Display the stock articles, filtered accorting to this specified article
|
||||
frm.maskDisplayArticleSwitch.value = '1';
|
||||
|
||||
// Set current stock to root stock (top level)
|
||||
frm.stkIdCurrent.value = stkIdRoot;
|
||||
|
||||
// Show ALL stocks (whole tree)
|
||||
for(i=0;i<frm.f_displayModeStockArticle.length;++i) {
|
||||
if (frm.f_displayModeStockArticle.options[i].value == '1') {
|
||||
frm.f_displayModeStockArticle.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Set outgoing stock of the new movement (stk_from = '0')
|
||||
// if () {
|
||||
for(i=0;i<frm.f_mv_stk_to.length;++i) {
|
||||
if (frm.f_mv_stk_to.options[i].value == '0') {
|
||||
frm.f_mv_stk_to.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
if (stkMvArticleData[0]!= '') {
|
||||
for(i=0;i<frm.f_mv_at.length;++i) {
|
||||
if (frm.f_mv_at.options[i].value == stkMvArticleData[0]) {
|
||||
frm.f_mv_at.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reload page
|
||||
stkFinishPage('');
|
||||
}
|
||||
|
||||
// Execute if a stock does exist according to the barcode
|
||||
if (scanCodeIsStockBarcode) {
|
||||
// Prepare stock search
|
||||
// Execute after reload
|
||||
frm.js_execute_cmd.value = '3';
|
||||
frm.js_execute_data.value = stkMvArticleData[0]; // Stock ID
|
||||
|
||||
if (stkMvStockData[0]!= '') {
|
||||
for(i=0;i<frm.f_mv_stk_from.length;++i) {
|
||||
if (frm.f_mv_stk_from.options[i].value == stkMvStockData[0]) {
|
||||
frm.f_mv_stk_from.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set current stock to the selected stock
|
||||
frm.stkIdCurrent.value = stkMvStockData[0];
|
||||
|
||||
// Show ONLY current stock
|
||||
for(i=0;i<frm.f_displayModeStockArticle.length;++i) {
|
||||
if (frm.f_displayModeStockArticle.options[i].value == '0') {
|
||||
frm.f_displayModeStockArticle.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Reload page
|
||||
stkFinishPage('');
|
||||
}
|
||||
}
|
||||
/*
|
||||
} else if (stkIdRoot != '') {
|
||||
evuc = ev.toUpperCase();
|
||||
scan_request('../stock/ajaxReqScanExecution.php?stkIdRoot=' + stkIdRoot, '');
|
||||
if (listLenth && listLenth > 0) {
|
||||
for(i=0; i<listLenth; ++i) {
|
||||
if (evuc == stkBarcodeList[i]) {
|
||||
frm.f_stk_id.value = stkIdList[i];
|
||||
frm.f_stk_name.value = stkNameList[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
// Init global JS
|
||||
initGlobals();
|
||||
|
||||
elem.value = '';
|
||||
$('f_scan').focus();
|
||||
}
|
||||
|
||||
function setScanFocus() {
|
||||
if ($('f_scan')) {
|
||||
$('f_scan').focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// *** Handling of jobs ***
|
||||
|
||||
function openCurrentListOfStockJobs() {
|
||||
var widthPopupWin = 900;
|
||||
var heightPopupWin = 700;
|
||||
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
|
||||
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
|
||||
var popupWin;
|
||||
popupWin = window.open("../stock/stock_jobs.php?stkIdRoot=" + stkIdRoot + "&deactivateMenu=1",
|
||||
"","dependent=yes,width=" + widthPopupWin + ",height=" +
|
||||
heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin +
|
||||
",scrollbars=yes");
|
||||
};
|
||||
|
||||
function clearJob() {
|
||||
document.forms[0].f_mv_jb_id.value='';
|
||||
};
|
||||
-->
|
||||
</script>
|
||||
|
||||
<?php echo $js_date ?>
|
||||
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>displayStatusMessage();setScanFocus();">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<form name="stock" action="../stock/stock_move.php" method="post">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="customerId" value="<?php echo ec($customerId) ?>">
|
||||
<input type="hidden" name="cscIdRoot" value="<?php echo ec($cscIdRoot) ?>">
|
||||
<input type="hidden" name="cscIdCurrent" value="<?php echo ec($cscIdCurrent) ?>">
|
||||
<input type="hidden" name="cscNameCurrent" value="<?php echo $cscNameCurrent ?>">
|
||||
<input type="hidden" name="stkIdRoot" value="<?php echo ec($stkIdRoot) ?>">
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
<input type="hidden" name="js_execute_cmd" value="">
|
||||
<input type="hidden" name="js_execute_data" value="">
|
||||
<input type="hidden" name="f_mv_at" value="<?php echo ec($f_mv_at) ?>">
|
||||
<input type="hidden" name="f_count" value="<?php echo ec($count) ?>">
|
||||
<input type="hidden" name="f_count2" value="<?php echo ec($count2) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
<div class="f10bp1_blue">
|
||||
<div style="float:left">
|
||||
<?php echo getLngt("Aktuelles Lager:") ?> <span class="f10bp1_red"><?php echo $stkNameRoot ?></span>
|
||||
|
||||
<?php echo getLngt("Aktueller Gebindeartikel:") ?> <span class="f10bp1_red"><?php echo $atNameBundle ?></span>
|
||||
|
||||
<?php echo getLngt("Angeforderte Gebindebuchungsmenge:") ?> <span class="f10bp1_red"><?php echo $f_mv_stk_itemquantity ?></span>
|
||||
</div>
|
||||
|
||||
<?php echo htmlDivLineSpacer("5px", "", "left"); ?>
|
||||
<?php echo htmlDivLineSpacer("1px","100%","","1"); ?>
|
||||
<?php echo htmlDivLineSpacer("5px"); ?>
|
||||
|
||||
<?php echo htmlDivLineSpacer("10px"); ?>
|
||||
|
||||
|
||||
<!-- STOCK ARTICLES AND STOCKMOVES -->
|
||||
|
||||
<?php echo $out; ?>
|
||||
|
||||
<?php echo htmlDivLineSpacer("20px"); ?>
|
||||
|
||||
<?php echo defineButtonType10(getLngt("Disponieren"), "action_move", "articleMoveFinishPage();", "150", "left", "10") ?>
|
||||
|
||||
<?php echo defineButtonType10(getLngt("Schließen"), "action_close", "window.close();", "155"); ?>
|
||||
|
||||
<?php echo htmlDivLineSpacer("20px"); ?>
|
||||
|
||||
<!-- BARCODE SCAN -->
|
||||
<?php echo htmlDivLineSpacer("20px", "", "left"); ?>
|
||||
<div style="width:600px; border: 3px;border-color:#FF0000; border-style:solid; padding: 10px; margin: 0px;">
|
||||
<div class="f10bp1_blue" style="float:left; vertical-align:middle;" valign="center">
|
||||
<?php echo getLngt("BARCODE-SCAN:") ?> <input type="text" id="f_scan" name="f_scan" value="" size="20" onblur="javascript:executeScanCode();" border="2">
|
||||
</div>
|
||||
<div class="f10bp1" style="vertical-align:middle;" valign="center">
|
||||
<?php echo getLngt("Zwischenspeicher:") ?> <input type="text" id="f_store" name="f_store" value="" size="20" onfocus="javascript:setScanFocus();">
|
||||
</div>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("10px", "", "left"); ?>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
197
html/stock/stock_scancommandlist.php
Normal file
197
html/stock/stock_scancommandlist.php
Normal file
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* stock_scancommandlist.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../include/inc_dbfields2array.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
// Stocks
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "statusMessage", "deactivateMenu",
|
||||
"stkIdRoot"));
|
||||
|
||||
// Id of the current employee and the costcenter (individual root-node) logged in
|
||||
if ($cscIdRoot == ""): $cscIdRoot = getFieldValueFromId("employee","emp_id",$emp_id,"csc_id"); endif;
|
||||
if ($customerId == ""): $customerId = getFieldValueFromId("costcenter","csc_id",$cscIdRoot,"cs_id"); endif;
|
||||
|
||||
// Get the rights of the employee logged in
|
||||
$empRights = getRights($emp_id);
|
||||
|
||||
// Init
|
||||
if ($cscIdCurrent == ""): $cscIdCurrent = $cscIdRoot; endif;
|
||||
if ($hqId == ""): $hqId = $hq_id; endif;
|
||||
if ($customerId == ""): $customerId = "0"; endif;
|
||||
|
||||
// Attention: Definition AFTER definitions of $customerId, $cscIdRoot and $cscIdCurrent
|
||||
$pageTitel = "LÄGER";
|
||||
$deactivateMenuStatic = "1";
|
||||
if ($generatePDF != "1") :
|
||||
include_once ("../geo/geocode.inc.php");
|
||||
endif;
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
include_once ("../include/inc_stock.inc.php");
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
// authCheckEmployeeRights($emp_id, "14", "1");
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
$userTypeName = getUserTypeName($userType);
|
||||
|
||||
// Parameters have to exist for both: customer and headquarter
|
||||
if (($userTypeName != "stk") && ($customerId == "" || $cscIdRoot == "" || $cscIdCurrent == "")) :
|
||||
gotoReferer("1"); // Parameter missing
|
||||
endif;
|
||||
|
||||
// Check authentication verifying emmployee an his/her costcenter- and customer-association
|
||||
if ( !( ($userType == "1") || ($userType == "4") || authCheck($hq_id,$usr_id,$emp_id,$cscIdRoot,$customerId,$cscIdActual) ) ) :
|
||||
gotoReferer("1");
|
||||
endif;
|
||||
|
||||
|
||||
// *** SCAN COMMANDS ***
|
||||
|
||||
$scanCmdNameArray = array("MV-RESET", "MV-DISPOSAL", "MV-IN", "MV-OUT", "MV-QUANTITY", "MV-TAN", "MV-REMARK", "MV-SERNO", "MV-JOB");
|
||||
$scanCmdDescriptionArray = array("RESET", "DISPONIEREN", "WARENEINGANG", "WARENAUSGANG", "MENGE EINTRAGEN", "TAN EINTRAGEN", "BEMERKUNG EINTRAGEN", "SERIENNR. EINTRAGEN", "AUFTRAG EINTRAGEN");
|
||||
$tmpLen = count($scanCmdNameArray);
|
||||
|
||||
$output .= "<table>\n";
|
||||
for ($i = 0; $i < $tmpLen; $i++) :
|
||||
$output .= " <tr>\n";
|
||||
$output .= " <td>\n";
|
||||
$output .= " <span class=\"f10bp1\" style=\"text-align: center;\">" . $scanCmdDescriptionArray[$i] . "</span>";
|
||||
$output .= " </td>\n";
|
||||
$output .= " </tr>\n";
|
||||
$output .= " <tr>\n";
|
||||
$output .= " <td>\n";
|
||||
$output .= " <img src=\"../include/barcode_BCGcode39.php?scale=1&text=" . $scanCmdNameArray[$i] . "\">";
|
||||
$output .= " <br><br>";
|
||||
$output .= " </td>\n";
|
||||
$output .= " </tr>\n";
|
||||
endfor;
|
||||
$output .= "</table>\n";
|
||||
|
||||
|
||||
// *** NUMBERS ***
|
||||
|
||||
$tableSpacer = "50";
|
||||
|
||||
// 0 .. 9
|
||||
$output2 .= "<table>\n";
|
||||
for ($i = 0; $i < 5; $i++) :
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <span class=\"f10bp1\">" . " " . "</span>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " <td width=\"" . $tableSpacer . "\">\n";
|
||||
$output2 .= " ";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <span class=\"f10bp1\">" . " " . "</span>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <img src=\"../include/barcode_BCGcode39.php?scale=1&text=-" . $i . "-\">";
|
||||
$output2 .= " <br><br>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " <td width=\"" . $tableSpacer . "\">\n";
|
||||
$output2 .= " ";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <img src=\"../include/barcode_BCGcode39.php?scale=1&text=-" . ($i + 5) . "-\">";
|
||||
$output2 .= " <br><br>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
endfor;
|
||||
|
||||
$scanCmdNameArray = array("-CLR-", "-BACK-");
|
||||
$scanCmdDescriptionArray = array("FELD LÖSCHEN", "LETZTES ZEICHEN ENTFERNEN");
|
||||
$tmpLen = count($scanCmdNameArray);
|
||||
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td colspan=\"3\">\n";
|
||||
$output2 .= " <br><br><br>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
|
||||
for ($i = 0; $i < $tmpLen; $i++) :
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <span class=\"f10bp1\" style=\"text-align: center;\">" . $scanCmdDescriptionArray[$i] . "</span>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <img src=\"../include/barcode_BCGcode39.php?scale=1&text=" . $scanCmdNameArray[$i] . "\">";
|
||||
$output2 .= " <br><br>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
endfor;
|
||||
|
||||
// Further commands
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td colspan=\"3\">\n";
|
||||
$output2 .= " <br><br>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <span class=\"f10bp1\" style=\"text-align: center;\">" . "AUFTRAG SUCHEN" . "</span>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
$output2 .= " <tr>\n";
|
||||
$output2 .= " <td>\n";
|
||||
$output2 .= " <img src=\"../include/barcode_BCGcode39.php?scale=1&text=" . "MV-OPENJOBS" . "\">";
|
||||
$output2 .= " <br><br>";
|
||||
$output2 .= " </td>\n";
|
||||
$output2 .= " </tr>\n";
|
||||
|
||||
$output2 .= "</table>\n";
|
||||
?>
|
||||
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>BARCODES DER SCAN COMMANDS</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<?php echo $output ?>
|
||||
</td>
|
||||
<td style="width: 150px;">
|
||||
|
||||
</td>
|
||||
<td style="vertical-align: top;">
|
||||
<?php echo $output2 ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user