1. Import

This commit is contained in:
2026-03-29 10:34:57 +02:00
parent b0e00c1259
commit a1129565af
4899 changed files with 3007593 additions and 0 deletions

View File

@@ -0,0 +1,952 @@
<?php
/*=======================================================================
*
* costcenter.php
*
* Autor: Marc Vollmann
*
=======================================================================*/
include_once ("../include/mcglobal.inc.php");
include_once ("../include/auth.inc.php");
include_once ("../include/inc_customer.inc.php");
include_once ("../geo/geocode.inc.php");
// Check HTTP-Parameters
// Costcenters
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual", "statusMessage", "deactivateMenu",
"deleteCostcenter", "nameCostcenter", "cscNameActual", "cscPathActual",
"cscVisibleActual", "f_show_invisible"));
// Settings
getSecHttpVars("1",array("f_csc_inv_interval", "f_csc_inv_type", "f_csc_inv_mode"));
// Addresses
getSecHttpVars("1",array("f_cscad_comp","f_cscad_comp2","f_cscad_comp3","f_cscad_comp4",
"v_adt_id", "f_ad_street", "f_ad_zipcode", "f_ad_city", "f_ad_country",
"f_cscad_hsno", "f_noaddressvalidation", "f_cscad_remark", "f_cscad_person",
"f_cscad_phone", "f_cscad_email", "f_cscad_gln"));
// Id of the actual 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;
$cmpId = getFieldValueFromId("customer","cs_id",$customerId,"cmp_id");
$cmpComp = getFieldValueFromId("company","cmp_id",$cmpId,"cmp_comp");
$cmpComp2 = getFieldValueFromId("company","cmp_id",$cmpId,"cmp_comp2");
// Get the rights of the employee logged in
$empRights = getRights($emp_id);
// Initialize actual node (costcenter) if not selected by the employee
if ($cscIdActual == ""): $cscIdActual = $cscIdRoot; endif;
getLanguage(__FILE__);
// Attention: Definition AFTER definitions of $customerId, $cscIdRoot and $cscIdActual
$pageTitel = getLngt("KOSTENSTELLEN");
include_once ("../admin/menu.php");
include_once ("../include/html.inc.php");
getCurrentScript(__FILE__);
// Check for authentication access and granted rights
$usrAccessArray["hq"] = "1"; $usrAccessArray["cs"] = "1";
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
// Flag for "show invisible costcenters"
if ($f_show_invisible == "" || count($f_show_invisible) == 0) :
$f_show_invisible = "0";
else:
$f_show_invisible = "1";
endif;
mcTrim($nameCostcenter);
// If empty then set invoicing-interval to daily per default
if ($f_csc_inv_interval == "") : $f_csc_inv_interval = "0"; endif;
// If empty then set invoicing-type of the current costcenter to root-association (not standalone)
if ($f_csc_inv_type == "") : $f_csc_inv_type = "0"; endif;
// If not numeric invoice mode then emty it
if (!isset($f_csc_inv_mode) || !is_numeric($f_csc_inv_mode)) : $f_csc_inv_mode = ""; endif;
// Insert new costcenter
if ($f_act == "newCostcenter" && $nameCostcenter != "") :
if (!isset($cscPathActual) || $cscPathActual == ""): $cscPathActual = "//"; endif;
// Check for double costcenter-names. They have to be unique for each customer
$tmpFields = array("cs_id",$customerId,"csc_name",$nameCostcenter);
if (!existsEntry("costcenter",$tmpFields)) :
TA("B");
// The new path is the concatenation of the path of the actual costcenter and id of the actual costcenter
$defaultFields = array("cs_id",$customerId,"csc_pre_id",$cscIdActual,"csc_name",$nameCostcenter,"csc_path",$cscPathActual.$cscNameActual."//","csc_visible","1");
insertStmt("costcenter",$defaultFields);
// Insert default values (addresses, invoice interval, etc.) of the root costcenter
// Get id of the new costcenter
$cscIdNew = getFieldValueFromClause("costcenter","csc_id","cs_id = '" . $customerId . "' AND csc_name = '" . $nameCostcenter . "'");
// Get id of the root costcenter of the current customer
$cscIdRootAddress = getFieldValueFromId("customer","cs_id",$customerId,"csc_id");
if ($cscIdNew != "" && $cscIdRootAddress != "") :
// Get addresses of the root costcenter
for ($i = 1; $i <= 4; $i++) :
getDbFieldValues("costcenteraddress",array("ad_id","cscad_hsno","cscad_comp","cscad_comp2","cscad_comp3","cscad_comp4"),array("csc_id",$cscIdRootAddress,"adt_id",$i));
insertStmt("costcenteraddress",array("csc_id", $cscIdNew, "cscad_comp", $cscad_comp, "cscad_comp2", $cscad_comp2, "cscad_comp3", $cscad_comp3, "cscad_comp4", $cscad_comp4, "ad_id", $ad_id, "adt_id", $i, "cscad_hsno", $cscad_hsno));
endfor;
// Get invoice values
$cscInvIntervalRoot = getFieldValueFromId("costcenter","csc_id",$cscIdRootAddress,"csc_inv_interval");
if ($cscInvIntervalRoot == "") : $cscInvIntervalRoot = "0"; endif;
updateStmt("costcenter", "csc_id", $cscIdNew, array("csc_inv_interval", $cscInvIntervalRoot));
endif;
// Write logdata into log database
writeToLogDB("45",$hq_id,"",$usr_id,"","",$customerId,"CSC_ID_NEW=".$cscIdNew."|CSC_ID_PARENT=".$cscIdActual."|CSC_NAME_NEW=".$nameCostcenter);
TA("C");
TA("E");
else :
$statusMessage = getLngt("Eine Kostenstelle mit demselben Namen") . " " .$nameCostcenter . " " . getLngt("existiert schon. Bitte umbenennen!");
endif;
endif;
// Delete selected costcenter
if ($f_act == "deleteCostcenter" && $deleteCostcenter != "") :
// First check for invoices or jobs! If invoices or jobs exist never remove
if (!existsEntry("job",array("csc_id",$deleteCostcenter)) && !existsEntry("job",array("csc_id_payer",$deleteCostcenter))) :
// !existsEntry("jobhistory",array("csc_id",$deleteCostcenter)) !existsEntry("jobhistory",array("csc_id",$deleteCostcenter))
// $fieldsLength = count($deleteCostcenter);
$fieldsLength = 1; // Presently implemented is single costcenter to be deleted
for ($i = 0; $i < $fieldsLength; $i++) :
$tmpFields = array("cs_id",$customerId,"csc_pre_id",$deleteCostcenter);
if (!existsEntry("costcenter",$tmpFields)) :
// Get the name of the costcenter (ONLY for logging!)
$cscNameToBeDeleted = getFieldValueFromId("costcenter","csc_id",$deleteCostcenter,"csc_name");
$whereClause = "csc_id = '$deleteCostcenter'";
deleteStmt("costcenter",$whereClause);
// Write logdata into log database
writeToLogDB("46",$hq_id,"",$usr_id,"","",$customerId,"CSC_ID=".$deleteCostcenter."|CSC_NAME=".$cscNameToBeDeleted);
else:
$statusMessage = getLngt("Eintrag kann nicht entfernt werden, da mindestens eine Unterkostenstelle existiert!");
endif;
endfor;
else :
$statusMessage = getLngt("Eintrag kann nicht entfernt werden, da mindestens ein Auftrag existiert!");
endif;
endif;
// Rename actual costcenter
if ($f_act == "renameCostcenter" && $nameCostcenter != "" && $cscIdActual != "" && $cscNameActual != "") :
// Check for double costcenter-names. They have to be unique for each customer
$tmpFields = array("cs_id",$customerId,"csc_name",$nameCostcenter);
if (!existsEntry("costcenter",$tmpFields)) :
// Select all rows where the csc_path contains the actual costcenter
TA("B");
$sqlStmt = "SELECT csc_id,csc_path FROM costcenter WHERE csc_path LIKE '%//$cscNameActual//%' AND cs_id = '".$customerId."'";
$result = $db->query($sqlStmt);
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
while ($row = $result->fetch_assoc()):
$csc_id = $row["csc_id"];
$csc_path = str_replace("//$cscNameActual//","//$nameCostcenter//",strWrapJs($row["csc_path"]));
updateStmt("costcenter","csc_id",$csc_id,array("csc_path",$csc_path));
endwhile;
$result->free();
updateStmt("costcenter","csc_id",$cscIdActual,array("csc_name",$nameCostcenter));
// Write logdata into log database
writeToLogDB("47",$hq_id,"",$usr_id,"","",$customerId,"CSC_ID=".$cscIdActual."|CSC_NAME=".$nameCostcenter);
TA("C");
TA("E");
else :
$statusMessage = getLngt("Eine Kostenstelle mit demselben Namen") . " " . $nameCostcenter . " " . getLngt("existiert schon. Bitte umbenennen!");
endif;
endif;
// Set status of visibility of the costcenter
if ($f_act == "setVisibility") :
// Check for existence
$tmpFields = array("cs_id",$customerId,"csc_id",$cscIdActual);
if (existsEntry("costcenter",$tmpFields)) :
// Update authentication-status
updateStmt("costcenter","csc_id",$cscIdActual,array("csc_visible",$cscVisibleActual));
// Write logdata into log database
writeToLogDB("51",$hq_id,"",$usr_id,"","",$customerId,"STATUS_VISIBILITY=".$cscVisibleActual);
else :
$statusMessage = getLngt("Die Kostenstelle wurde nicht geändert!");
endif;
endif;
$cscNameRoot = getFieldValueFromId("costcenter","csc_id",$cscIdRoot,"csc_name");
$tmpFields = getFieldsValueFromId("costcenter","csc_id",$cscIdActual,array("csc_path","csc_name","csc_visible"));
$cscPathActual = $tmpFields[0];
$cscNameActual = $tmpFields[1];
$cscVisibleActual = $tmpFields[2];
$cscVisibleActual2 = 0;
if ($cscVisibleActual != "1") :
$cscVisibleActual = 0;
$cscVisibleActual2 = 1;
endif;
// Selection of all CHILDREN of the actual costcenter
$whereClauseVisibility = " AND csc_visible = '1' ";
if ($f_show_invisible == "1") : $whereClauseVisibility = ""; endif;
$sqlquery = "SELECT csc_id, csc_name, csc_path FROM costcenter"
. " WHERE cs_id = '" . $customerId . "' AND csc_pre_id = '" . $cscIdActual . "'" . $whereClauseVisibility
. " ORDER BY csc_name";
$result = $db->query($sqlquery);
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
$listOfChildren = "";
while ($row = $result->fetch_assoc()):
$csc_id = $row["csc_id"];
$csc_name = $row["csc_name"];
$csc_path = $row["csc_path"];
// $listOfChildren .= ("<input type=\"checkbox\" name=\"deleteCostcenter[]\" value=\"$csc_id\"> "
// . "<a href=costcenter.php?customerId=$customerId&"
// . "cscIdRoot=$cscIdRoot&"
// . "cscIdActual=$csc_id>"
// . $csc_name . "</a> | \n");
if (strtoupper($csc_name) != "EXTERN") :
$listOfChildren .= "<option value=\"" . ec($csc_id) . "\">" . $csc_name . "</option>\n";
endif;
endwhile;
if ($listOfChildren != "") : $listOfChildren = "<option value=\"\">" . getLngt("Kostenstellen") . ":</option>\n" . $listOfChildren; endif;
$result->free();
// Output of the path-links for navigation in the costcenter-tree
$cscPathActualOut = "";
$fields = spliti("//",$cscPathActual);
$len = count($fields);
$pathDelimiter = "<img src=\"../images/arrow_right.jpg\" border=\"0\" height=\"10\" width=\"25\">";
$rootFlag = FALSE;
$maxPathLength = 4;
$pathPrefix = "";
$pathPrefixFlag = FALSE;
for ($i = 0; $i < $len; $i++) :
if ($fields[$i] != "") :
// Only show the subpath from the "actual root" of the employee
if ($fields[$i] == $cscNameRoot) : $rootFlag = TRUE; endif;
if ($rootFlag) :
// Only output of the last <maxPathLength> elements
if ($i > $len - $maxPathLength) :
$csc_id = getFieldValueFromClause("costcenter","csc_id","cs_id = '" . $customerId . "' AND csc_name = '" . strWrapJs($fields[$i]) . "'");
$cscPathActualOut .= "<a href=costcenter.php?currentNavigationItem=kostenstellen&deactivateMenu=" . ec($deactivateMenu) . "&customerId=" . ec($customerId)
. "&cscIdRoot=" . ec($cscIdRoot)
. "&cscIdActual=" . ec($csc_id) . ">"
. $fields[$i] . "</a>";
$cscPathActualOut .= $pathDelimiter;
else :
if (!$pathPrefixFlag && ($i > $len - $maxPathLength - 1)) :
$csc_id = getFieldValueFromClause("costcenter","csc_id","cs_id = '" . $customerId . "' AND csc_name = '" . strWrapJs($fields[$i]) . "'");
$pathPrefix = "<a href=costcenter.php?currentNavigationItem=kostenstellen&deactivateMenu=" . ec($deactivateMenu) . "&customerId=" . ec($customerId)
. "&cscIdRoot=" . ec($cscIdRoot)
. "&cscIdActual=" . ec($csc_id) . "><img src=\"../images/arrow_left.jpg\" border=\"0\" height=\"10\" width=\"25\"></a>"
. $pathDelimiter;
$pathPrefixFlag = TRUE;
endif;
endif;
endif;
endif;
endfor;
$cscPathActualOut = $pathPrefix . $cscPathActualOut . $cscNameActual;
// Check for costcenter being an external costcenter, because an external one
// has only access to addresses. Therefore the "empRights"-String has to be set
// according to the following scheme
if (strtoupper($cscNameActual) == "EXTERN" || !(strpos(strtoupper($cscPathActual), "//EXTERN//") === FALSE)) :
$empRights = "100100000000000";
endif;
// Check for the right to administrate the costcenters, only for output
$cscAdminDisabled = "";
$maskCostcenterCompanyFieldsEditDisabled = "";
if ($userTypeName == "cs") :
if (substr($empRights,1,1) != "1") : $cscAdminDisabled = "disabled"; endif;
$maskCostcenterCompanyFieldsEditDisabled = getParameterValue("0", "MASK_CSC_CMP_FIELDS_EDIT_DISABLED", "0");
if ($maskCostcenterCompanyFieldsEditDisabled != "") :
$maskCostcenterCompanyFieldsEditDisabled = "readonly";
endif;
else :
if (substr($empRights,0,1) != "1") : $cscAdminDisabled = "disabled"; endif;
endif;
// Definition of the select-fields, only for output
$selectFieldSelectCostcenter = "";
$selectFieldDeleteCostcenter = "";
if ($listOfChildren != "") :
// Check for the right to navigate in the subtree
if (substr($empRights,0,1) == "1") :
$selectFieldSelectCostcenter = "<span class=\"f8np1\">\n" .
"<select name=\"selectCostcenter\" onChange=\"xReload();\">\n" .
$listOfChildren . "\n" .
"</select>\n" .
"</span>\n";
endif;
$selectFieldDeleteCostcenter = "<div style=\"width:100%; height:3px;\"> </div>" .
"<div style=\"float:left\"><span class=\"f8np1\">\n" .
"<select name=\"deleteCostcenter\">\n" .
$listOfChildren . "\n" .
"</select>\n" .
"</span>&nbsp;&nbsp;</div>\n" .
defineButtonType10(getLngt("Löschen"), "action_remove", "cscFinishPage('" . ec("deleteCostcenter") . "');", "120", "left", "2");
endif;
// Check the status of the visibility of the current costcenter
$buttonVisibility = "";
$displayTextVisibility = "";
$confirmTextVisibility = "";
if ($cscIdRoot != $cscIdActual) : // NOT for the root costcenter !!! (Check $userTypeName == "hq" ???)
$buttonVisibility = defineButtonType10(getLngt("Ausblenden"), "action_invisible", "visibilityFinishPage();", "120", "left", "2");
$confirmTextVisibility = getLngt("Soll die aktuelle Kostenstelle wirklich ausgeblendet werden?");
if ($cscVisibleActual != "1") :
$buttonVisibility = defineButtonType10(getLngt("Einblenden"), "action_visible", "visibilityFinishPage();", "120", "left", "2");
$displayTextVisibility = getLngt("(ausgeblendet)");
$confirmTextVisibility = getLngt("Soll die aktuelle Kostenstelle wirklich eingeblendet werden?");
endif;
endif;
// Checkbox for displaying all costcenters
$showInvisibles = getLngt("Alle&nbsp;anz.") . "&nbsp;<input type=\"checkbox\" name=\"f_show_invisible[]\" value=\"1\" " . ($f_show_invisible == "1" ? "checked" : "") . " onChange=\"javascript:visibilityListFinishPage();\" tabindex=\"\">";
// Check for the right to make the costcenters (in)visible, only for output
if (($userTypeName == "cs" && substr($empRights,1,1) != "1") || ($userTypeName == "hq" && substr($empRights,0,1) != "1")) :
$buttonVisibility = "";
$showInvisibles = "";
endif;
// ************
// * SETTINGS *
// ************
// Currently ONLY for headquarters
if ($userTypeName == "hq" && substr($empRights,0,1) == "1") :
// Secure-check of the association between customer, costcenter and employee
$tmpFields = array("cs_id",$customerId,"csc_id",$cscIdActual);
if (existsEntry("costcenter",$tmpFields)) :
// Get the name of the current costcenter
$cscNameActual = getFieldValueFromId("costcenter","csc_id",$cscIdActual,"csc_name");
// *** Save the settings (Begin) ***
// Actually one addresstype is represented only one time per costcenter in costcenteraddress
if ($f_act == "saveSettings") :
// Update costcenter
updateStmt("costcenter", "csc_id", $cscIdActual, array("csc_inv_interval", $f_csc_inv_interval, "csc_inv_type", $f_csc_inv_type));
// Check existence of parameter for costcenter invoice mode
if ($f_csc_inv_mode != "" || ($f_csc_inv_mode == "" && existsEntry("parameter",array("par_key","COSTCENTER_INV_MODE_" . $cscIdActual)))) :
setParameterValue("COSTCENTER_INV_MODE_" . $cscIdActual, $f_csc_inv_mode);
endif;
// Write logdata into log database
writeToLogDB("49",$hq_id,"",$usr_id,"","",$customerId,"CSC_ID=".$cscIdActual."|CSC_NAME=".$cscNameActual."|INTERVAL=".$f_csc_inv_interval."|INVMODE=".$f_csc_inv_mode);
// Set modification status of the current customer if values of the ROOT-costcenter(!) are changed
if ($cscIdActual == $cscIdRoot) :
setModificationStatus($customerId);
endif;
endif;
// *** Save the settings (End) ***
// ******************************************************
// * Selection of the settings of the actual costcenter *
// ******************************************************
$sqlquery = "SELECT csc.csc_inv_interval,csc.csc_inv_type"
. " FROM costcenter AS csc"
. " WHERE csc.csc_id = '$cscIdActual'";
$result = $db->query($sqlquery);
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
while ($row = $result->fetch_assoc()):
$f_csc_inv_interval = $row["csc_inv_interval"];
$f_csc_inv_type = $row["csc_inv_type"];
endwhile;
$result->free();
// Get special costcenter invoice mode
$f_csc_inv_mode = getParameterValue("0", "COSTCENTER_INV_MODE_" . $cscIdActual, "0");
endif;
endif;
// *************
// * ADDRESSES *
// *************
// Set the default addresstype on "Abhol-/Lieferadresse"
if ($v_adt_id == "") : $v_adt_id = "4"; endif;
// Check for validation of the address assigned to the customer
$noValidationOfAddress = FALSE;
if ($f_noaddressvalidation != "") :
if ($f_noaddressvalidation[0] == '1') : $noValidationOfAddress = TRUE; endif;
endif;
$addressValidationErr = "";
// Secure-check of the association between customer and costcenter
$tmpFields = array("cs_id",$customerId,"csc_id",$cscIdActual);
if (existsEntry("costcenter",$tmpFields)) :
$cscNameActual = getFieldValueFromId("costcenter","csc_id",$cscIdActual,"csc_name");
// *** Save the adress (Begin) ***
// Actually one addresstype is represented only one time per costcenter in costcenteraddress
if ($f_act == "saveAddress") :
$f_cscad_comp = trim($f_cscad_comp);
$f_cscad_comp2 = trim($f_cscad_comp2);
$f_cscad_comp3 = trim($f_cscad_comp3);
$f_cscad_comp4 = trim($f_cscad_comp4);
$f_ad_street = trim($f_ad_street);
$f_ad_zipcode = trim($f_ad_zipcode);
$f_ad_city = trim($f_ad_city);
$f_ad_country = trim($f_ad_country);
$f_cscad_hsno = trim($f_cscad_hsno);
// Check for empty entry in the company-field
if ($f_cscad_comp != "") :
// Check for empty entries in address-fields
if ($f_ad_street != "" && $f_ad_zipcode != "" && $f_ad_city != "" && $f_ad_country != "") :
// Check validity according to the address-server
$addressValid = getGeoCoordinates($f_ad_street, $f_ad_zipcode, $f_ad_city, $f_cscad_hsno, $f_ad_country, "");
if ($addressValid != "") :
// Check zipcode and city
$addressValidityArray = checkCityZipcode($f_ad_zipcode, $f_ad_city, $f_ad_street);
if ($noValidationOfAddress || $addressValidityArray[0] >= 1) :
TA("B");
// Check for existing entry in address (because of redundance)
if ($f_ad_country == "") : $f_ad_country = "DE"; endif;
$tmpArray = insertAddress($f_ad_street, $f_ad_zipcode, $f_ad_city, "", $f_ad_country, $noValidationOfAddress);
$ad_id = $tmpArray[0];
// Check for addresstype-entry(!) in costcenteraddress
$cscadFields = array("csc_id",$cscIdActual,"adt_id",$v_adt_id);
if (existsEntry("costcenteraddress",$cscadFields)) :
// Update costcenteraddress
$sqlStmt = "UPDATE costcenteraddress SET ad_id = $ad_id, cscad_hsno = '$f_cscad_hsno', "
. "cscad_remark = '$f_cscad_remark', cscad_person = '$f_cscad_person', cscad_phone = '$f_cscad_phone', cscad_email = '$f_cscad_email', cscad_gln = '$f_cscad_gln', "
. "cscad_comp = '$f_cscad_comp', cscad_comp2 = '$f_cscad_comp2', cscad_comp3 = '$f_cscad_comp3', cscad_comp4 = '$f_cscad_comp4' "
. "WHERE csc_id = $cscIdActual AND adt_id = $v_adt_id";
// writeDbLog($sqlStmt);
$res = $db->query($sqlStmt);
else :
// Insert costcenteraddress
$sqlStmt = "INSERT INTO costcenteraddress (csc_id,adt_id,ad_id,cscad_hsno,cscad_remark,cscad_person,cscad_phone,cscad_comp,cscad_comp2,cscad_comp3,cscad_comp4,cscad_email,cscad_gln) "
. " VALUES ($cscIdActual,$v_adt_id,$ad_id,'$f_cscad_hsno','$f_cscad_remark','$f_cscad_person','$f_cscad_phone','$f_cscad_comp','$f_cscad_comp2','$f_cscad_comp3','$f_cscad_comp4','$f_cscad_email','$f_cscad_gln')";
// writeDbLog($sqlStmt);
$res = $db->query($sqlStmt);
endif;
// Write logdata into log database
writeToLogDB("48",$hq_id,"",$usr_id,"","",$customerId,"CSC_ID=".$cscIdActual."|AD_ID=".$ad_id."|ADT_ID=".$v_adt_id."|ADDRESS=".$f_cscad_comp.";".$f_cscad_comp2.";".$f_cscad_comp3.";".$f_cscad_comp4.";".$f_ad_street.";".$f_ad_zipcode.";".$f_ad_city.";".$f_ad_country.";".$f_cscad_hsno.";".$f_cscad_remark.";".$f_cscad_person.";".$f_cscad_phone.";".$f_cscad_email.";".$f_cscad_gln);
// Set modification status of the current customer if values of the ROOT-costcenter(!) are changed
if ($cscIdActual == $cscIdRoot) :
setModificationStatus($customerId);
endif;
TA("C");
TA("E");
else :
$statusMessage = getLngt("Die Postleitzahl passt nicht zu dem angegebenen Ort!");
$addressValidationErr = "1";
endif;
else :
$statusMessage = getLngt("Der Adress-Server kennt die eingebene Adresse nicht! Bitte korrekt erfassen!");
endif;
else :
$statusMessage = getLngt("Bitte geben Sie mindestens Straße, Hausnummer, Stadt und Land an!");
endif;
else :
$statusMessage = getLngt("Bitte geben Sie den Firmennamen oder übernehmen Sie den aus der übergeordneten Kostenstelle!");
endif;
endif;
// *** Save the adress (End) ***
// ***************************************************************************************
// * Selection of the address of the actual costcenter based on the selected addresstype *
// ***************************************************************************************
$sqlquery = "SELECT cscad.ad_id,cscad.cscad_comp,cscad.cscad_comp2,cscad.cscad_comp3,cscad.cscad_comp4,cscad.cscad_hsno,cscad.cscad_remark,cscad.cscad_person,cscad.cscad_phone,cscad.cscad_email,cscad.cscad_gln,ad.ad_street,ad.ad_zipcode,ad.ad_city,ad.ad_country"
. " FROM costcenteraddress AS cscad, address AS ad"
. " WHERE cscad.csc_id = '$cscIdActual' AND"
. " cscad.adt_id = '$v_adt_id' AND"
. " cscad.ad_id = ad.ad_id ";
$result = $db->query($sqlquery);
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
while ($row = $result->fetch_assoc()):
$v_ad_id = $row["ad_id"];
$v_ad_street = $row["ad_street"];
$v_ad_zipcode = $row["ad_zipcode"];
$v_ad_city = $row["ad_city"];
$v_ad_country = $row["ad_country"];
$v_cscad_comp = $row["cscad_comp"];
$v_cscad_comp2 = $row["cscad_comp2"];
$v_cscad_comp3 = $row["cscad_comp3"];
$v_cscad_comp4 = $row["cscad_comp4"];
$v_cscad_hsno = $row["cscad_hsno"];
$v_cscad_remark = $row["cscad_remark"];
$v_cscad_person = $row["cscad_person"];
$v_cscad_phone = $row["cscad_phone"];
$v_cscad_email = $row["cscad_email"];
$v_cscad_gln = $row["cscad_gln"];
endwhile;
$result->free();
endif;
// If company-name ("f_cscad_comp" and "f_cscad_comp2") in "costcenteraddress" empty,
// take the name from the parent-costcenter
if ($v_cscad_comp == "") :
$sqlquery = "SELECT cscad.cscad_comp,cscad.cscad_comp2,cscad.cscad_comp3,cscad.cscad_comp4"
. " FROM costcenteraddress AS cscad,costcenter AS csc, costcenter AS csc2"
. " WHERE csc.csc_id = '$cscIdActual' AND"
. " csc2.csc_id = csc.csc_pre_id AND"
. " csc2.csc_id = cscad.csc_id AND"
. " cscad.adt_id = '$v_adt_id'";
$result = $db->query($sqlquery);
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
while ($row = $result->fetch_assoc()):
$v_cscad_comp = $row["cscad_comp"];
$v_cscad_comp2 = $row["cscad_comp2"];
$v_cscad_comp3 = $row["cscad_comp3"];
$v_cscad_comp4 = $row["cscad_comp4"];
endwhile;
$result->free();
endif;
$v_cscad_comp = strWrapHtml($v_cscad_comp);
$v_cscad_comp2 = strWrapHtml($v_cscad_comp2);
$v_cscad_comp3 = strWrapHtml($v_cscad_comp3);
$v_cscad_comp4 = strWrapHtml($v_cscad_comp4);
$pageHeadline = ($deactivateMenu == "1" ? "<span class=\"f12bp1_blue\">" . strtoupper($pageTitel) . "</span>" . " &nbsp;&nbsp;&nbsp;&nbsp;" : "" ) . $cmpComp . ($cmpComp2 != "" ? " :: " . $cmpComp2 : "");
?>
<html>
<head>
<title><?php echo $pageTitel ?></title>
<style type="text/css">
<?php include_once ("../css/phoenix.css.php"); ?>
<?php include_once ("../css/navigation.css.php"); ?>
<?php include_once ("../css/mc.css.php"); ?>
</style>
<?php include_once ("../include/js_framework.inc.php"); ?>
<script src="../include/searchLists.js" type="text/javascript"></script>
<script src="../include/checkFormTags.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
// NAVIGATION
<?php echo $jsMenuOut; ?>
// Part for COSTCENTERS
function xReload() {
for(i=0;i<document.forms[0].selectCostcenter.length;++i) {
if (document.forms[0].selectCostcenter.options[i].selected == true) {
csc_id = document.forms[0].selectCostcenter.options[i].value;
document.location.href = "costcenter.php?currentNavigationItem=kostenstellen&deactivateMenu=<?php echo $deactivateMenu ?>&customerId=<?php echo $customerId ?>&cscIdRoot=<?php echo $cscIdRoot ?>&cscIdActual=" + csc_id;
}
}
};
function visibilityFinishPage() {
if (confirm('<?php echo $confirmTextVisibility ?>')) {
document.forms[0].cscVisibleActual.value='<?php echo ec($cscVisibleActual2) ?>';
document.forms[0].f_act.value='setVisibility';
document.forms[0].submit();
}
};
function visibilityListFinishPage() {
// document.forms[0].f_show_invisible.checked=true;
if (document.forms[0].currentNavigationItem) {
document.forms[0].currentNavigationItem.value='kostenstellen';
}
document.forms[0].submit();
};
function cscFinishPage(f_act) {
document.forms[0].f_act.value=f_act;
if (document.forms[0].currentNavigationItem) {
document.forms[0].currentNavigationItem.value='kostenstellen';
}
document.forms[0].submit();
}
// Part for SETTINGS
function settingsFinishPage() {
document.forms[0].f_act.value='saveSettings';
if (document.forms[0].currentNavigationItem) {
document.forms[0].currentNavigationItem.value='kostenstellen';
}
document.forms[0].submit();
};
// Part for ADDRESSES
function checkFields() {
var glnLen = 13;
frm = document.forms[0];
if (!frm.f_ad_street.value){
alert('<?php echo getLngt("Bitte geben Sie die Straße ein!") ?>');
frm.f_ad_street.focus();
return;
}
if (!frm.f_cscad_hsno.value){
alert('<?php echo getLngt("Bitte geben Sie die Hausnummer ein!") ?>');
frm.f_cscad_hsno.focus();
return;
}
if (!frm.f_ad_zipcode.value){
alert('<?php echo getLngt("Bitte tragen Sie die Postleitzahl ein!") ?>');
frm.f_ad_zipcode.focus();
return;
}
if (!frm.f_ad_city.value){
alert('<?php echo getLngt("Bitte geben Sie die Stadt ein!") ?>');
frm.f_ad_city.focus();
return;
}
if (frm.f_cscad_phone.value && !checkIsNaNIgnoreSpace(frm.f_cscad_phone.value, '<?php echo getLngt("Bitte tragen Sie eine Nummer bei Telefon ein!") ?>')){
frm.f_cscad_phone.focus();
return;
}
if (frm.f_cscad_email.value.length != 0) {
// if e-mail has content then check syntax
if (!checkMailAddress(frm.f_cscad_email, '<?php echo getLngt("Bitte tragen Sie eine gültige Email-Adresse ein!") ?>')) {return;};
}
if (frm.f_cscad_gln.value.length != 0 && frm.f_cscad_gln.value.length != 13) {
alert('<?php echo getLngt("Die geforderte Stelligkeit der GLN ist") ?>' + ' ' + glnLen);
frm.f_cscad_gln.focus();
return;
}
frm.f_act.value='saveAddress';
if (frm.currentNavigationItem) {
frm.currentNavigationItem.value='kostenstellen';
}
frm.submit();
};
-->
</script>
</head>
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>displayStatusMessage()">
<?php echo $phpMenuOut ?>
<?php echo $phpReducedMenuOut ?>
<?php echo $phpPageTitelOut ?>
<div class="mc_page-header">
<?php echo $pageHeadline ?>
</div>
<div class="maincontent mc_elem" name="maincontent" id="maincontent">
<form action="../customer/costcenter.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="cscIdActual" value="<?php echo ec($cscIdActual) ?>">
<input type="hidden" name="cscNameActual" value="<?php echo $cscNameActual ?>">
<input type="hidden" name="cscPathActual" value="<?php echo $cscPathActual ?>">
<input type="hidden" name="cscVisibleActual" value="<?php echo ec($cscVisibleActual) ?>">
<?php echo $phpCurrentNavigationInputHidden ?>
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
<input type="hidden" name="ad_id" value="<?php echo ec(mcIsSet($ad_id)) ?>">
<?php echo htmlDivLineSpacer("10px"); ?>
<div class="f10bp1_blue">
<div style="float:left">
<?php echo getLngt("Aktuelle Kostenstelle:") ?>&nbsp;
<span class="f10bp1_red"><?php echo $cscPathActualOut ?></span>
&nbsp;&nbsp;&nbsp;
<?php echo $selectFieldSelectCostcenter ?>
&nbsp;&nbsp;&nbsp;
</div>
<?php echo $buttonVisibility ?>
<div style="float:left">
<?php echo $showInvisibles ?>
</div>
</div>
<?php echo htmlDivLineSpacer("5px", "", "left"); ?>
<?php echo htmlDivLineSpacer("1px","100%","","1"); ?>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div style="float:left">
<?php echo htmlDivLineSpacer("3px"); ?>
<?php
if ($cscAdminDisabled == "disabled") :
$selectFieldDeleteCostcenter = "";
else :
echo "<div style=\"float:left\">";
echo "<input type=\"text\" name=\"nameCostcenter\" value=\"\" size=\"25\" maxlength=\"50\" class=\"input\">&nbsp;&nbsp;";
echo "</div>";
echo defineButtonType10(getLngt("Anlegen"), "action_new", "cscFinishPage('" . ec("newCostcenter") . "');", "120", "left", "2");
echo defineButtonType10(getLngt("Umbenennen"), "action_rename", "cscFinishPage('" . ec("renameCostcenter") . "');", "120", "left", "2");
endif;
?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<?php echo $selectFieldDeleteCostcenter ?>
</div>
<?php echo htmlDivLineSpacer("10px", "", "left"); ?>
<?php echo htmlDivLineSpacer("1px","100%","","1"); ?>
<?php echo htmlDivLineSpacer("10px"); ?>
<!-- *** SETTINGS *********************************************************************************** -->
<?php if ($userTypeName == "hq" && substr($empRights,0,1) == "1") : ?>
<div class="f10bp1_blue">
Einstellungen für: <?php echo $cscNameActual ?>
</div>
<?php echo htmlDivLineSpacer("10px"); ?>
<!--
<div>
Art der Rechnungsanlagedaten: &nbsp;&nbsp;&nbsp;
<select name="f_csc_inv_type">
<?php echo addOptionsFromTable("metatype","mt_sort","mt_value","mt_sort","mt_type = 'invoicetype'",$f_csc_inv_type); ?>
</select>
</div>
-->
<div>
<div>
<?php echo getLngt("Intervall zur Erzeugung der Rechnungsanlagedaten:") ?> &nbsp;&nbsp;&nbsp;
<select name="f_csc_inv_interval">
<?php echo addOptionsFromTable("metatype","mt_sort","mt_value","mt_sort","mt_type = 'invoiceinterval'",$f_csc_inv_interval); ?>
</select>
&nbsp;&nbsp;&nbsp;
</div>
<?php echo htmlDivLineSpacer("10px"); ?>
<div>
<?php echo getLngt("Abrechnungsmodus:") ?> &nbsp;&nbsp;&nbsp;
<select name="f_csc_inv_mode">
<option value="" <?php if ($f_csc_inv_mode == "") : echo "selected"; endif; ?>><?php echo getLngt("Modus wie Kundenstammblatt") ?></option>
<option value="0" <?php if ($f_csc_inv_mode == "0") : echo "selected"; endif; ?>><?php echo getLngt("Kilometer") ?></option>
<option value="1" <?php if ($f_csc_inv_mode == "1") : echo "selected"; endif; ?>><?php echo getLngt("PLZ") ?></option>
<option value="2" <?php if ($f_csc_inv_mode == "2") : echo "selected"; endif; ?>><?php echo getLngt("Bereich (= zusammengefasste PLZn)") ?></option>
<option value="3" <?php if ($f_csc_inv_mode == "3") : echo "selected"; endif; ?>><?php echo getLngt("Radius") ?></option>
</select>
&nbsp;&nbsp;&nbsp;
</div>
<?php echo htmlDivLineSpacer("10px"); ?>
<?php echo defineButtonType10(getLngt("Speichern"), "action_save_settings", "settingsFinishPage();", "120", "left", "2") ?>
</div>
<?php echo htmlDivLineSpacer("10px", "", "left"); ?>
<?php echo htmlDivLineSpacer("1px","100%","","1"); ?>
<?php echo htmlDivLineSpacer("10px"); ?>
<?php endif; ?>
<!-- *** ADDRESSES ********************************************************************************** -->
<?php if ($userTypeName == "hq" || ($userTypeName == "cs" && substr($empRights,3,1) == "1")) : ?>
<div class="f10bp1_blue">
<?php echo getLngt("Adressen der Kostenstelle") ?>: <?php echo $cscNameActual ?>
</div>
<?php echo htmlDivLineSpacer("10px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Typ") ?>:</div>
<div>
<select name="v_adt_id" onChange="submit();">
<?php echo addOptionsFromTable("metatype","mt_sort","mt_value","mt_sort","mt_type = 'addresstype'",$v_adt_id); ?>
</select>
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Firma") ?>:</div>
<div>
<input type="text" name="f_cscad_comp" value="<?php echo $v_cscad_comp ?>" <?php echo $maskCostcenterCompanyFieldsEditDisabled?>>
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>>&nbsp;</div>
<div>
<input type="text" name="f_cscad_comp2" value="<?php echo $v_cscad_comp2 ?>" <?php echo $maskCostcenterCompanyFieldsEditDisabled?>>
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>>&nbsp;</div>
<div>
<input type="text" name="f_cscad_comp3" value="<?php echo $v_cscad_comp3 ?>" <?php echo $maskCostcenterCompanyFieldsEditDisabled?>>
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>>&nbsp;</div>
<div>
<input type="text" name="f_cscad_comp4" value="<?php echo $v_cscad_comp4 ?>" <?php echo $maskCostcenterCompanyFieldsEditDisabled?>>
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<?php if ($v_adt_id == "1" || $v_adt_id == "2") : ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("GLN") ?>:</div>
<div>
<input type="text" name="f_cscad_gln" value="<?php echo $v_cscad_gln ?>">
</div>
</div>
<?php echo htmlDivLineSpacer("15px"); ?>
<?php else : ?>
<input type="hidden" name="f_cscad_gln" value="">
<?php endif; ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Strasse & Hsnr.") ?>:</div>
<div>
<input type="text" name="f_ad_street" value="<?php echo $v_ad_street ?>">&nbsp;
<input type="text" name="f_cscad_hsno" size="5" value="<?php echo $v_cscad_hsno ?>">
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("PLZ") ?>:</div>
<div style="float:left">
<input type="text" name="f_ad_zipcode" value="<?php echo $v_ad_zipcode ?>">&nbsp;&nbsp;
</div>
<?php echo defineButtonType10("...", "action_ad_search", "searchAddress('cs');", "23", "left"); ?>
</div>
<?php echo htmlDivLineSpacer("5px", "", "left"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Ort") ?>:</div>
<div>
<input type="text" name="f_ad_city" value="<?php echo $v_ad_city ?>">
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Land") ?>:</div>
<div>
<select class="f8np1" name="f_ad_country">
<?php echo getCountryCodesAsOptions($v_ad_country); ?>
</select>
<input type="checkbox" name="f_noaddressvalidation[]" value="1"><?php echo getLngt("Keine Prüfung") ?>
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Bemerkung") ?>:</div>
<div>
<input type="text" name="f_cscad_remark" value="<?php echo $v_cscad_remark ?>">
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Person") ?>:</div>
<div>
<input type="text" name="f_cscad_person" value="<?php echo $v_cscad_person ?>">
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Telefon") ?>:</div>
<div>
<input type="text" name="f_cscad_phone" value="<?php echo $v_cscad_phone ?>">
</div>
</div>
<?php echo htmlDivLineSpacer("5px"); ?>
<?php if ($v_adt_id == "2") : ?>
<div>
<div <?php echo setStyleHtmlDiv("110px","left"); ?>><?php echo getLngt("Email") ?>:</div>
<div>
<input type="text" name="f_cscad_email" value="<?php echo $v_cscad_email ?>">
</div>
</div>
<?php echo htmlDivLineSpacer("15px"); ?>
<?php else : ?>
<input type="hidden" name="f_cscad_email" value="">
<?php endif; ?>
<?php echo defineButtonType10(getLngt("Speichern"), "action_ad_save", "checkFields();", "120", "left", "2") ?>
<?php endif; ?>
</form>
</div>
</body>
</html>

411
html/customer/csc_list.php Normal file
View File

@@ -0,0 +1,411 @@
<?php
/*=======================================================================
*
* csc_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_mode", "companyId", "orderClause", "statusMessage", "f_cmp_authenticated", "f_searchmode", "f_cmp_match",
"f_cmp_comp", "f_cmp_comp2", "f_cs_eid", "f_usr_name", "f_usr_phone", "f_usr_email", "f_csc_name",
"f_street", "f_hsno", "f_zipcode", "f_city", "f_country", "f_remark", "f_person", "f_phone", "tourno",
"cscIdRoot","customerId","cscIdActual","csc_id"));
// Execution-Time for script
set_time_limit(120);
getLanguage(__FILE__);
getCurrentScript(__FILE__);
// Check for authentication access and granted rights
$usrAccessArray["cs"] = "1";
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
if (!(authCheckEmployeeRights($emp_id, "0") || authCheckEmployeeRights($emp_id, "7"))) : gotoReferer("1"); endif;
$numOfRows = 0;
$htmlClass01 = "class=\"smaller\""; // input,select
if ($f_searchmode == "") : $f_searchmode = "1"; endif;
$f_csc_name = trim($f_csc_name);
$f_street = trim($f_street);
$f_hsno = trim($f_hsno);
$f_zipcode = trim($f_zipcode);
$f_city = trim($f_city);
$f_country = trim($f_country);
// $f_remark = trim($f_remark);
$f_person = trim($f_person);
$f_phone = trim($f_phone);
// Generate search-resultset
// if ($f_act == "search" && $searchValues != "" && $customerId != "") :
if (TRUE) :
// *******************************************
// * Selection of the customers for the list *
// *******************************************
if ($f_searchmode == "1") : $prefix = "%"; else : $prefix = ""; endif;
$whereClause = "";
if ($whereClause != "" && $f_csc_name != "") : $whereClause .= " AND "; endif;
if ($f_csc_name != "") : $whereClause .= "csc.csc_name LIKE '" . $prefix . $f_csc_name . "%'"; endif;
if ($whereClause != "" && $f_street != "") : $whereClause .= " AND "; endif;
if ($f_street != "") : $whereClause .= "ad.ad_street LIKE '" . $prefix . $f_street . "%'"; endif;
if ($whereClause != "" && $f_hsno != "") : $whereClause .= " AND "; endif;
if ($f_hsno != "") : $whereClause .= "cscad.cscad_hsno LIKE '" . $prefix . $f_hsno . "%'"; endif;
if ($whereClause != "" && $f_zipcode != "") : $whereClause .= " AND "; endif;
if ($f_zipcode != "") : $whereClause .= "ad.ad_zipcode LIKE '" . $prefix . $f_zipcode . "%'"; endif;
if ($whereClause != "" && $f_city != "") : $whereClause .= " AND "; endif;
if ($f_city != "") : $whereClause .= "ad.ad_city LIKE '" . $prefix . $f_city . "%'"; endif;
if ($whereClause != "" && $f_country != "") : $whereClause .= " AND "; endif;
if ($f_country != "") : $whereClause .= "ad.ad_country LIKE '" . $prefix . $f_country . "%'"; endif;
// if ($whereClause != "" && $f_remark != "") : $whereClause .= " AND "; endif;
// if ($f_remark != "") : $whereClause .= "cscad.cscad_remark LIKE '" . $prefix . $f_remark . "%'"; endif;
if ($whereClause != "" && $f_person != "") : $whereClause .= " AND "; endif;
if ($f_person != "") : $whereClause .= "cscad.cscad_person LIKE '" . $prefix . $f_person . "%'"; endif;
if ($whereClause != "") : $whereClause .= " AND "; endif;
if ($orderClause == "") : $orderClause = "csc.csc_name"; endif;
$cscNameRoot = getFieldValueFromId("costcenter","csc_id",$cscIdRoot,"csc_name");
$cscIdsRoot = $cscIdRoot;
$customerIds = $customerId;
$cscNamesRoot = $cscNameRoot;
// check for existens of children
$sqlquery = "SELECT cs_id, csc_id FROM customer WHERE cs_id_parent = " . $customerId;
$result = $db->query($sqlquery);
if (DB::isError($result)) die ("$PHP_SELF: '$sqlquery': " . $result->getMessage());
while ($row = ($phpVersion >= "8.0" ? $result->fetch_assoc() : $result->fetchRow())):
$cscIdsRoot .= "," . $row["csc_id"];
$customerIds .= "," . $row["cs_id"];
$cscNamesRoot .= "//%' OR csc.csc_path LIKE '%//" . getFieldValueFromId("costcenter","csc_id",$row["csc_id"],"csc_name");
endwhile;
$result->free();
$whereClause2 .= "AND ((csc.csc_id IN (" . $cscIdsRoot . ")) OR " .
"(csc.csc_path LIKE '%//" . $cscNamesRoot . "//%')) AND " .
"csc.cs_id IN (" . $customerIds . ")";
$sqlquery = "SELECT csc.csc_id, csc.csc_name, cs.cs_id, cs.cs_eid, cs.csc_id_payer, cs.cs_commission_no, cs.cs_jobbatch, cs.cs_discount, cs.cs_fixprice_discount, cs.cs_filter, cs.cs_invmode,"
. " cmp.cmp_id, cmp.cmp_comp, cmp.cmp_comp2, cmp.cmp_authenticated, cmp.cmp_remark, cmp.cmp_match, cmp.cmp_cashmode,"
. " cmp.tx_id, cscad.ad_id, cscad.cscad_comp, cscad.cscad_comp2, cscad.cscad_hsno,"
. " cscad.cscad_remark, cscad.cscad_person, cscad.cscad_phone,"
. " ad.ad_street, ad.ad_zipcode, ad.ad_city, ad.ad_country, gdc_content AS tr_mediationarea_id"
. " FROM company AS cmp, customer AS cs, costcenter AS csc,"
. " costcenteraddress AS cscad, address AS ad"
. " LEFT JOIN genericdatacontainer ON gdc_obj_type = 'ad' AND gdc_obj_id = ad.ad_id AND gdc_gen_fieldname = 'tr_mediationarea_id'"
. " WHERE " .$whereClause
. " cs.hq_id = '$hq_id' AND"
. " cs.cs_id IN (" . $customerIds . ") AND"
. " cmp.cmp_id = cs.cmp_id AND"
. " cs.cs_id = csc.cs_id "
. " " . $whereClause2 . " AND"
. " csc.csc_is_extern = '0' AND"
. " csc.csc_visible = '1' AND"
. " csc.csc_id = cscad.csc_id AND"
. " cscad.adt_id = '4' AND"
. " cscad.ad_id = ad.ad_id"
. " ORDER BY " . $orderClause;
//echo $sqlquery;
$result = $db->query($sqlquery);
if (DB::isError($result)) die ("$PHP_SELF: '$sqlquery': " . $result->getMessage());
// Table with header
while ($row = ($phpVersion >= "8.0" ? $result->fetch_assoc() : $result->fetchRow())):
$numOfRows++;
$tableOfRows .= "<tr>";
if ($tourno == -1) {
$tableOfRows .= "<td>&nbsp;" . substr($row["cmp_comp"], 0, 30) . "</td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["cmp_comp2"], 0, 15) . "</td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["cs_eid"], 0, 11) . "</td>";
}
$csc_id_payer_comp = "";
if ($row["csc_id_payer"] != "" && $row["csc_id_payer"] != 0)
$csc_id_payer_comp = $db->getOne("SELECT cmp_comp FROM company, customer, costcenter WHERE company.cmp_id = customer.cmp_id AND customer.cs_id = costcenter.cs_id AND costcenter.csc_id = " . $row["csc_id_payer"]);
if (trim($row["cscad_comp"] == ""))
$row["cscad_comp"] = $row["cmp_comp"];
if (!isset($row["tr_mediationarea_id"]) || $row["tr_mediationarea_id"] == "")
$row["tr_mediationarea_id"] = 0;
$tableOfRows .= "<td>&nbsp;<a href=\"javascript:finishPage('" . $row["cs_id"] . "','" . $row["csc_id"] . "','" . my_str_check_js($row["csc_name"]) . "','" . my_str_check_js($row["cscad_comp"]) . "','" . my_str_check_js($row["cscad_comp2"]) . "','" . my_str_check_js($row["ad_street"]) . "','" . $row["cscad_hsno"] . "','" . $row["ad_zipcode"] . "','" . my_str_check_js($row["ad_city"]) . "','" . my_str_check_js($row["ad_country"]) . "','" . my_str_check_js($row["cscad_remark"]) . "','" . my_str_check_js($row["cscad_person"]) . "','" . $tourno . "','" . my_str_check_js($row["csc_id_payer"]) . "','" . my_str_check_js($csc_id_payer_comp) . "','" . $row["tx_id"] . "','" . $row["cs_eid"] . "','" . $row["cs_commission_no"] . "','" . $row["cmp_authenticated"] . "','" . my_str_check_js($row["cmp_remark"]) . "','" . $row["cs_jobbatch"] . "','" . $row["cs_discount"] . "','" . $row["cs_fixprice_discount"] . "','" . $row["cs_filter"] . "','" . my_str_check_js($row["cmp_comp"]) . "','" . my_str_check_js($row["cmp_comp2"]) . "'," . $row["tr_mediationarea_id"] . "," . $row["cs_invmode"] . ");\">" . my_str_check_html(substr($row["csc_name"], 0, 40)) . "</a></td>";
// $tableOfRows .= "<td>&nbsp;" . substr($row["cmp_match"], 0, 30) . "</td>";
// $authImgName = "circle_red.jpg";
// if ($row["cmp_authenticated"] == "1") : $authImgName = "circle_green.jpg"; endif;
// $tableOfRows .= "<td align=\"center\"><img src=\"../images/" . $authImgName . "\" border=\"1\" height=\"10\" width=\"25\"></td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["ad_street"], 0, 20) . "</td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["cscad_hsno"], 0, 5) . "</td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["ad_zipcode"], 0, 5) . "</td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["ad_city"], 0, 20) . "</td>";
// $tableOfRows .= "<td>&nbsp;" . substr($row["cscad_remark"], 0, 20) . "</td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["cscad_person"], 0, 20) . "</td>";
$tableOfRows .= "<td>&nbsp;" . substr($row["cscad_phone"], 0, 15) . "</td>";
$tableOfRows .= "</tr>";
endwhile;
$result->free();
// else :
// $statusMessage = getLngt("Bei Eingabe weniger als 3 Zeichen in mindestens einem Feld erfolgt keine Suche! Mind. ein Zeichen bei Kostenstelle reicht aus!");
// endif;
endif;
?>
<html>
<head>
<title><?php echo getLngt("KOSTENSTELLENLISTE") ?></title>
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
<script type="text/javascript">
<!--
var statusMessage = "<?php echo $statusMessage ?>";
function displayStatusMessage() {
if (statusMessage != "") {
alert(statusMessage);
}
};
function finishPage(cs_id,csc_id,name,comp,comp2,street,hsno,zipcode,city,country,remark,person,tourno,csc_id_payer,csc_id_payer_comp,tx_id,cs_eid,cs_commission_no,cmp_authenticated,cmp_remark,cs_jobbatch,cs_discount,cs_fixprice_discount,cs_filter,cmp_comp,cmp_comp2,tr_mediationarea_id,cs_invmode) {
if (tourno > -1)
{
opener.setJobList(tourno, opener.jl_csc_id, csc_id);
opener.setJobList(tourno, opener.jl_tr_comp, comp);
opener.setJobList(tourno, opener.jl_tr_person, person);
opener.setJobList(tourno, opener.jl_ad_street, street);
opener.setJobList(tourno, opener.jl_tr_hsno, hsno);
opener.setJobList(tourno, opener.jl_ad_zipcode, zipcode);
opener.setJobList(tourno, opener.jl_ad_city, city);
opener.setJobList(tourno, opener.jl_tr_remark, remark);
opener.setJobList(tourno, opener.jl_csc_id_payer, "false");
opener.setJobList(tourno, opener.jl_hide_tr_remark, "true");
opener.setJobList(tourno, opener.jl_tr_mediationarea_id, tr_mediationarea_id);
if (csc_id_payer != "" && csc_id_payer != 0)
{
opener.setCsc_id_payer(csc_id_payer, csc_id_payer_comp);
opener.parent.job_options.document.tourOptions.payer_is_default.value = "true";
}
/*
if (tx_id != "" && tx_id != 0)
{
opener.setSelectedOption("job_options", "tourOptions", "jb_sales_tax_rate_sign", tx_id);
opener.checkJb_sales_tax_rate_sign();
}
*/
<?php if (getParameterValue("0", "MASK_DONT_CHANGE_PAYER_" . $customerId, "0") != "1") : ?>
if (csc_id_payer_comp != "address_only")
opener.setCsc_id_payer(csc_id, comp);
<?php endif; ?>
} else {
opener.setCsc_id_payer(csc_id, cs_eid + " " + comp);
<?php if (MASK_CASH_PAYER_SELECT == "1") : ?>
// opener.parent.job_tour.document.tourForm.jb_costsplit.checked = true;
// opener.checkCostsplit(true);
<?php endif; ?>
}
if (cs_eid != "" && cs_eid != 0)
{
opener.add_cs_eid(csc_id, cs_eid, cs_commission_no, comp, cmp_authenticated, cmp_remark, cs_jobbatch, cs_discount, cs_filter);
var i=opener.cs_eid_list.length;
opener.cs_eid_list[i-1][12] = cs_id;
opener.cs_eid_list[i-1][24] = cs_invmode;
opener.cs_eid_list[i-1][13] = cs_fixprice_discount;
}
self.setTimeout("opener.refreshFormFields()", 100);
self.setTimeout("opener.resetSignificantPriceValues()", 150);
// opener.refreshFormFields();
self.setTimeout("opener.checkSendTour()", 200);
// opener.checkSendTour();
self.setTimeout("self.close()", 300);
// self.close();
};
function clearFields() {
// document.forms[0].f_cmp_comp.value = '';
// document.forms[0].f_cmp_comp2.value = '';
// document.forms[0].f_cmp_match.value = '';
// document.forms[0].f_cs_eid.value = '';
document.forms[0].f_csc_name.value = '';
document.forms[0].f_street.value = '';
document.forms[0].f_hsno.value = '';
document.forms[0].f_zipcode.value = '';
document.forms[0].f_city.value = '';
// document.forms[0].f_remark.value = '';
document.forms[0].f_person.value = '';
document.forms[0].f_phone.value = '';
};
function checkSearchParameters(field_from) {
if (field_from == 'cmp_comp') {
// Check for search value in cmp_name to be also searched in cmp_match
if (<?php echo SEARCH_CSCSCLIST_CMPCOMP_CMPMATCH ?> == 1) {
document.forms[0].f_cmp_match.value = document.forms[0].f_cmp_comp.value;
}
if (<?php echo SEARCH_CSCSCLIST_CMPCOMP_CSEID ?> == 1) {
document.forms[0].f_cs_eid.value = document.forms[0].f_cmp_comp.value;
}
if (<?php echo SEARCH_CSCSCLIST_CMPCOMP_CSCADPHONE ?> == 1) {
document.forms[0].f_phone.value = document.forms[0].f_cmp_comp.value;
}
}
};
function submitPage(orderClause) {
document.forms[0].orderClause.value = orderClause;
document.forms[0].f_act.value='search';
document.forms[0].submit();
};
-->
</script>
</head>
<body onLoad="displayStatusMessage();">
<form action="../customer/csc_list.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="orderClause" value="<?php echo $orderClause ?>">
<input type="hidden" name="tourno" value="<?php echo $tourno ?>">
<input type="hidden" name="generic" value="<?php echo $generic ?>">
<input type="hidden" name="f_cmp_authenticated" value="<?php echo $f_cmp_authenticated ?>">
<table border="0">
<tr>
<td>
<table border="0">
<tr>
<td class="f12bp1_red">
<?php echo getLngt("Kostenstellen") ?><br><br>
</td>
</tr>
<tr>
<td>
<a href="javascript:document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;<?php echo getLngt("Suchen") ?>&nbsp;</a>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
<a href="javascript:clearFields();"><?php echo getLngt("Felder zurücksetzen") ?></a>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
Option:&nbsp;&nbsp;
<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") ?>
<br><br>
<table class="f8np1" border="1" cellpadding="0">
<tr>
<?php if ($tourno != -1) echo "<!--"; ?>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_cmp_comp" value="<?php echo $f_cmp_comp ?>" size="30" onBlur="javascript:checkSearchParameters('cmp_comp');"></td>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_cmp_comp2" value="<?php echo $f_cmp_comp2 ?>" size="15"></td>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_cs_eid" value="<?php echo $f_cs_eid ?>" size="11"></td>
<?php if ($tourno != -1) echo "-->"; ?>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_csc_name" value="<?php echo $f_csc_name ?>" size="25"></td>
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_cmp_match" value="<?php echo $f_cmp_match ?>" size="30"></td> -->
<!-- <td><a href="javascript:document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Suchen&nbsp;</a></td> -->
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_usr_name" value="<?php echo $f_usr_name ?>" size="15"></td> -->
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_usr_phone" value="<?php echo $f_usr_phone ?>" size="20"></td> -->
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_usr_email" value="<?php echo $f_usr_email ?>" size="30"></td> -->
<td><input type="text" <?php echo $htmlClass01 ?> name="f_street" value="<?php echo $f_street ?>" size="25"></td>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_hsno" value="<?php echo $f_hsno ?>" size="5"></td>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_zipcode" value="<?php echo $f_zipcode ?>" size="5"></td>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_city" value="<?php echo $f_city ?>" size="20"></td>
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_remark" value="<?php echo $f_remark ?>" size="20"></td> -->
<td><input type="text" <?php echo $htmlClass01 ?> name="f_person" value="<?php echo $f_person ?>" size="20"></td>
<td><input type="text" <?php echo $htmlClass01 ?> name="f_phone" value="<?php echo $f_phone ?>" size="15"></td>
</tr>
<tr>
<?php if ($tourno != -1) echo "<!--"; ?>
<td><a href="javascript:document.forms[0].orderClause.value='cmp.cmp_comp';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Firma&nbsp;</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='cmp.cmp_comp2';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Firma2&nbsp;</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='cs.cs_eid';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;ExtID&nbsp;</a></td>
<?php if ($tourno != -1) echo "-->"; ?>
<!--
<td><a href="javascript:document.forms[0].orderClause.value='csc.csc_name';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Kostenstelle&nbsp;</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='cmp.cmp_match';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Freitext&nbsp;</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_street';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Straße</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_hsno';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Hausnr.</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_zipcode';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;PLZ</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_city';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Ort</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_remark';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Bemerkung</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_person';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Person</a></td>
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_phone';document.forms[0].f_act.value='search';document.forms[0].submit();">&nbsp;Telefon</a></td>
-->
<!-- <td><a href="javascript:submitPage('cmp.cmp_comp');">&nbsp;Firma&nbsp;</a></td> -->
<!-- <td><a href="javascript:submitPage('cmp.cmp_comp2');">&nbsp;Firma2&nbsp;</a></td> -->
<!-- <td><a href="javascript:submitPage('cs.cs_eid');">&nbsp;ExtID&nbsp;</a></td> -->
<td><a href="javascript:submitPage('csc.csc_name');">&nbsp;<?php echo getLngt("Kostenstelle") ?>&nbsp;</a></td>
<!-- <td><a href="javascript:submitPage('cmp.cmp_match');">&nbsp;Freitext&nbsp;</a></td> -->
<!-- <td>&nbsp;Freigabe&nbsp;</td> -->
<td><a href="javascript:submitPage('ad.ad_street');">&nbsp;<?php echo getLngt("Straße") ?></a></td>
<td><a href="javascript:submitPage('cscad.cscad_hsno');">&nbsp;<?php echo getLngt("Hausnr.") ?></a></td>
<td><a href="javascript:submitPage('ad.ad_zipcode');">&nbsp;<?php echo getLngt("PLZ") ?></a></td>
<td><a href="javascript:submitPage('ad.ad_city');">&nbsp;<?php echo getLngt("Ort") ?></a></td>
<!-- <td><a href="javascript:submitPage('cscad.cscad_remark');">&nbsp;Bemerkung</a></td> -->
<td><a href="javascript:submitPage('cscad.cscad_person');">&nbsp;<?php echo getLngt("Person") ?></a></td>
<td><a href="javascript:submitPage('cscad.cscad_phone');">&nbsp;<?php echo getLngt("Telefon") ?></a></td>
</tr>
<?php echo $tableOfRows ?>
</table>
<br><br>
<?php echo getLngt("Anzahl Einträge") ?>: <?php echo $numOfRows ?><?php if ($numOfRows == "0" && $f_act == "search" && $statusMessage == "") : echo " (Keine Einträge gefunden.)"; endif; ?>
</td>
</tr>
</table>
</td>
</table>
<?php
// Nur wenn eine csc_id übergeben und wenn ansonsten keine Einträge gefunden
if ($csc_id != "" && $f_act == "search" && $statusMessage == "" && $tourno > -1) {
$sqlquery = "SELECT jb_tourname, tr_sort, tr_comp, tr_person, tour.csc_id, ad_street, tr_hsno, ad_country, ad_zipcode, ad_city, tr_remark, tr_mediationarea_id" .
" FROM job, tour, address WHERE (csc_id_payer = " . $csc_id . " AND csc_id_payer_cash = '0') AND LENGTH(jb_tourname) > 0" .
" AND job.jb_id = tour.jb_id AND tour.ad_id = address.ad_id ORDER BY jb_tourname, tr_sort" ;
$res = $db->query($sqlquery);
if ($res->numRows() > 0) {
echo "<br><table border=\"0\"><tr><td><table border=\"0\"><tr><td class=\"f12bp1_red\">";
echo "Adressen aus gespeicherten Touren<br><br>";
echo "<table border=\"1\"><tr><td>&nbsp;Name&nbsp;</td><td>&nbsp;Station&nbsp;</td><td" .
">&nbsp;</td><td" .
">&nbsp;Firma&nbsp;</td><td>&nbsp;Person&nbsp;</td><td>&nbsp;Straße&nbsp;</td><td" .
">&nbsp;Nr.&nbsp;</td><td>&nbsp;PLZ&nbsp;</td><td>&nbsp;Ort&nbsp;</td><td" .
">&nbsp;Bemerkung&nbsp;</td></tr>";
}
if (DB::isError($res)) die ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
$lineToggler = 0;
while ($row = ($phpVersion >= "8.0" ? $res->fetch_assoc() : $res->fetchRow())):
if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif;
echo "<tr><td>&nbsp;" . $row["jb_tourname"] . "</td><td>&nbsp;" . $row["tr_sort"] . "</td><td>" .
"<a href=\"javascript:finishPage('','" . $row["csc_id"] . "','','" . my_str_check_js($row["tr_comp"]) . "','','" . my_str_check_js($row["ad_street"]) . "','" . $row["tr_hsno"] . "','" .
$row["ad_zipcode"] . "','" . my_str_check_js($row["ad_city"]) . "','" . my_str_check_js($row["ad_country"]) . "','" . my_str_check_js($row["tr_remark"]) . "','" .
my_str_check_js($row["tr_person"]) . "','" . $tourno . "','','address_only','','','','','','','','','',''," . $row["tr_mediationarea_id"] . ");\">" .
"<img src=\"../images/arrow_right.png\" border=\"0\" height=\"10\" width=\"25\">" . "</a>" . "</td><td" .
">&nbsp;" . $row["tr_comp"] . "</td><td>&nbsp;" . $row["tr_person"] . "</td><td" .
">&nbsp;" . $row["ad_street"] . "</td><td>&nbsp;" . $row["tr_hsno"] . "</td><td" .
">&nbsp;" . $row["ad_zipcode"] . "</td><td>&nbsp;" . $row["ad_city"] . "</td><td" .
">&nbsp;" . $row["tr_remark"] . "</td></tr>";
endwhile;
if ($res->numRows() > 0)
echo "</td></td></tr>";
echo "</tr></td></table></tr></td></table>";
$res->free();
}
?>
</body>
</html>

18
html/customer/index.html Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="de">
<head>
<title>votian</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="votian"> <meta name="keywords" content="votian">
<meta http-equiv="refresh" content="0; URL=../index.php">
<link rel="stylesheet" type="text/css" href="css/phoenix.css">
</head>
<body bgcolor="#FFFFFA" leftmargin="1" topmargin="1" marginwidth="0" marginheight="0" link="#990000" vlink="#990000" alink="#990000">
<a href="../index.php">Bitte hier klicken, wenn Sie nicht automatisch weitergeleitet werden...</a>
</body>
</html>

403
html/customer/jb_detail.php Normal file
View File

@@ -0,0 +1,403 @@
<?php
/*=======================================================================
*
* jb_detail.php
*
* Autor: Marc Vollmann
*
=======================================================================*/
include_once ("../include/mcglobal.inc.php");
include_once ("../include/auth.inc.php");
include_once ("../include/image.inc.php");
// Check HTTP-Parameters
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual", "empIdMaster", "job_id", "dbhistory"));
getLanguage(__FILE__);
$deactivateMenuStatic = "1";
$pageTitel = getLngt("KUNDENAUFTRAGSDETAILS");
include_once ("../admin/menu.php");
include_once ("../include/html.inc.php");
include_once ("../include/services_func.inc.php");
include_once ("../include/inc_job.inc.php");
include_once ("../include/inc_file.inc.php");
include_once ("../include/jb_detail_history.inc.php");
getCurrentScript(__FILE__);
// Check for authentication access and granted rights
// authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
if ($userType != "2") : gotoReferer("1"); endif;
$userTypeName = "cs";
// Decision to use the archive or normal tables
// Check existence of the job in history table space
$dbhistory = checkHistoryLevel($dbhistory, "jb", $job_id);
$dbhistory = getDBNames($dbhistory);
// Secure-check of the association between customer, costcenter and employee
// $tmpFields = array("cs_id",$customerId,"csc_id",$cscIdActual);
// if (existsEntry("costcenter",$tmpFields)) :
// Get the array for formatting the database-values for the output according to the defined type
$outputFormatField = defineOutputFormats();
// Get the pathname of the actual costcenter
// $tmpFields = getFieldsValueFromId("costcenter","csc_id",$cscIdActual,array("csc_path","csc_name"));
// $cscPathActual = $tmpFields[0];
// $cscNameActual = $tmpFields[1];
// Check for mode of system usage
$globalParUseRelatedCustomer = getParameterValue("0", "GLOBAL_USE_RELATED_CUSTOMER", "0");
// If job ($job_id) is exported, then look for existing content in history field in table "job2"
$takeRealJobData = checkForTakingRealOrHistoricJobData("2");
// Get CASH PAYER ID from table "parameter" of the current HQ_ID
$currentCashPayerId = getParameterValue("0", "CSC_ID_PAYER_CASH", $hq_id);
if ($currentCashPayerId == "") : $currentCashPayerId = "0"; endif;
// Get current snapshot of job data (JOB, TOUR, COURIER, COSTS, EMPLOYEES)
if ($takeRealJobData) :
$currentJobParameterState = getJobSnapshot($job_id);
endif;
// Display articles
// ATTENTION: Presently same parameter MASK_JOBDETAILS_JBP_BOOKING_ENABLED like for payment !!!!
$constJbpBookingEnabled = getParameterValue("0", "MASK_JOBDETAILS_JBP_BOOKING_ENABLED", $hq_id); // [= "1"] <=> Enabled
$outputTourarticle = "";
if ($constJbpBookingEnabled == "1" && $job_id != "") :
$outputTourarticle = getOutputJobTratArticleData($job_id);
endif;
// Display jobcalculator entries
// ATTENTION: Presently same parameter MASK_JOBDETAILS_JBP_BOOKING_ENABLED like for payment !!!!
$constJbpBookingEnabled = getParameterValue("0", "MASK_JOBDETAILS_JBP_BOOKING_ENABLED", $hq_id); // [= "1"] <=> Enabled
$outputJobcalculator = "";
if ($constJbpBookingEnabled == "1" && $job_id != "") :
$outputJobcalculator = getOutputJobCalculatorData($job_id);
endif;
// --- INVOICE TEXT ---------------
/*
if ($job_id != "") :
if ($f_act == "changeInvoiceText") :
updateStmt($dbh_jb, "jb_id", $job_id, array("jb_invtext", $f_jb_invtext_new), "(hq_id = '" . $hq_id . "')");
endif;
endif;
*/
$f_jb_invtext = getFieldValueFromId($dbh_jb, "jb_id", $job_id, "jb_invtext");
$jbStatus = getFieldValueFromId($dbh_jb, "jb_id", $job_id, "jb_status");
$jobinvoicetext = "<br><br>" . getLngt("(Vorläufiger) Rechnungstext") . ":<br>";
$jobinvoicetext .= "<textarea name=\"f_jb_invtext_new\" cols=\"70\" rows=\"15\" readonly>" . $f_jb_invtext . "</textarea><br>\n";
// $jobinvoicetext .= "<input type=\"button\" value=\"Rechnungstext speichern\" onClick=\"javascript:changeInvoiceText();\">\n";
// --- DISPLAY PHOTOS FROM MOBILE ---------------
$outputPhotos = "";
if ($globalParUseRelatedCustomer == "1" && $job_id != "") :
// [1] B2B
$filenameArray = getImagesFromB2bObjects($job_id, "../temp/photos/", "jb");
$filenameArrayLen = count($filenameArray);
// [2] GDC
$tmpPhotoFilenames = getFieldValueFromClause("genericdatacontainer", "gdc_content", "gdc_obj_type = 'jb' AND gdc_obj_id = '" . $job_id . "' AND gdc_gen_fieldname = 'mobile_photos'");
// Display photos
if ($tmpPhotoFilenames != "" || $filenameArrayLen > 0) :
$tmpArrayLen = 0;
if ($tmpPhotoFilenames != "") :
$tmpPhotoFilenames = str_replace("|", "-,-", $tmpPhotoFilenames);
if (!(strpos($tmpPhotoFilenames, "-,-") === FALSE)) :
$tmpArray = spliti("-,-",$tmpPhotoFilenames);
else :
$tmpArray = array($tmpPhotoFilenames);
endif;
$tmpArrayLen = count($tmpArray);
endif;
if ($tmpArrayLen > 0 || $filenameArrayLen > 0) :
$systemPath = "..";
$tmpImgHeight = 100;
$tmpImgWidth = 133;
$outputPhotos .= "<table>";
// $outputPhotos .= "<tr><td class=\"f10bp1\" colspan=\"4\">" . getLngt("Fotos der Endgeräte des Abnahmeprotokolls") . "<br></td></tr>\n";
$outputPhotos .= "<tr><td class=\"f10bp1\" colspan=\"4\">" . getLngt("Fotos der Endgeräte") . "<br></td></tr>\n";
$outputPhotos .= "<tr>";
// GDC
for ($i = 0; $i < $tmpArrayLen; $i++) {
$outputPhotos .= "<td height=\"130\" width=\"160\" align=\"center\">";
$outputPhotos .= "<a href=\"javascript:openImageViewer('" . $tmpArray[$i] . "','" . intval($tmpImgWidth * 8) . "','" . intval($tmpImgHeight * 8) . "','');\"><img src=\"" . $systemPath . "/documents/photos/" . $tmpArray[$i] . "\" border=\"" . "0" . "\" height=\"" . $tmpImgHeight . "\" width=\"" . $tmpImgWidth . "\"></a>";
$outputPhotos .= "</td>";
if ((($i + 1) % 4) == 0 && $i < ($tmpArrayLen - 1)) :
$outputPhotos .= "</tr><tr>";
endif;
}
// B2B
for ($i = 0; $i < $filenameArrayLen; $i++) {
$outputPhotos .= "<td height=\"130\" width=\"160\" align=\"center\">";
$outputPhotos .= "<a href=\"javascript:openImageViewer('" . $filenameArray[$i] . "','" . intval($tmpImgWidth * 8) . "','" . intval($tmpImgHeight * 8) . "','../temp/photos/');\"><img src=\"" . $systemPath . "/temp/photos/" . $filenameArray[$i] . "\" border=\"" . "0" . "\" height=\"" . $tmpImgHeight . "\" width=\"" . $tmpImgWidth . "\"></a>";
$outputPhotos .= "</td>";
if ((($i + 1) % 4) == 0 && $i < ($tmpArrayLen - 1)) :
$outputPhotos .= "</tr><tr>";
endif;
}
$outputPhotos .= "</tr>";
$outputPhotos .= "<table><br><br>";
endif;
endif;
endif;
// Check for documents associated to the job
if ($job_id != "") :
// Get path for courier documents (type "JB")
if (mcIsSet($importPath) == "") : $importPath = getFieldValueFromId("mandator","md_id",$md_id,"md_doc_path"); endif;
$importPath = getPathForObjectData($importPath, "JB");
// Get number of documents for the current customer
$jbNumOfFiles = getNumOfFilesByFilterInFolder($importPath, $job_id . "_", "1");
endif;
?>
<html>
<head>
<title><?php echo getLngt("AUFTRAG") . ": " . $job_id; ?></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">
function openJob2pdf() {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/pdf_generic.php?f_act=generatePDFJob&jbId=<?php echo ec($job_id) ?>&dbhistory=<?php echo ec($dbhistory) ?>&customerId=<?php echo ec($customerId) ?>&cscIdRoot=<?php echo ec($cscIdRoot) ?>&cscIdActual=<?php echo ec($cscIdActual) ?>","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJob2Waybill() {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/metafield_special_cron.php?category=<?php echo ec(305) ?>&objId=<?php echo ec($job_id) ?>&cascadingObjType=jb&dbhistory=<?php echo ec($dbhistory) ?>&specialPageTitle=<?php echo getLngt("Abnahmeprotokoll") ?>&sendToClientFileDownload=1&customerId=<?php echo ec($customerId) ?>&cscIdRoot=<?php echo ec($cscIdRoot) ?>&cscIdActual=<?php echo ec($cscIdActual) ?>","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJob2AcceptanceProtocol() {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/metafield_special_cron.php?category=<?php echo ec(300) ?>&objId=<?php echo ec($job_id) ?>&cascadingObjType=jb&dbhistory=<?php echo ec($dbhistory) ?>&specialPageTitle=<?php echo getLngt("Abnahmeprotokoll") ?>&sendToClientFileDownload=1&customerId=<?php echo ec($customerId) ?>&cscIdRoot=<?php echo ec($cscIdRoot) ?>&cscIdActual=<?php echo ec($cscIdActual) ?>","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openImageViewer(f_fileName, f_width, f_height, f_path) {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../include/image_viewer.php?customerId=<?php echo ec($customerId) ?>&cscIdRoot=<?php echo ec($cscIdRoot) ?>&cscIdActual=<?php echo ec($cscIdActual) ?>&f_fileName=" + f_fileName + "&f_width=" + f_width + "&f_height=" + f_height + "&f_path=" + f_path,"","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJob2Docs() {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../import/data_transfer.php?objType=jb&objId=<?php echo ec($job_id) ?>&dbhistory=<?php echo ec($dbhistory) ?>&customerId=<?php echo ec($customerId) ?>&cscIdRoot=<?php echo ec($cscIdRoot) ?>&cscIdActual=<?php echo ec($cscIdActual) ?>","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJobStation(jbId, trSort) {
var widthPopupWin = 1200;
var heightPopupWin = 800;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/pdf_generic_function.php?customerId=<?php echo ec($customerId) ?>&cscIdRoot=<?php echo ec($cscIdRoot) ?>&cscIdActual=<?php echo ec($cscIdActual) ?>&functionName=getStationData&par_01=" + jbId + "&par_02=" + trSort,"","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJob2Invoice(category, pageTitle, parString) {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/metafield_special_cron.php?category=" + category + "&objId=<?php echo ec($job_id) ?>&cascadingObjType=jb&dbhistory=<?php echo ec($dbhistory) ?>&specialPageTitle=" + pageTitle + ">&sendToClientFileDownload=1&customerId=<?php echo ec($customerId) ?>&cscIdRoot=<?php echo ec($cscIdRoot) ?>&cscIdActual=<?php echo ec($cscIdActual) ?>" + parString,"","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
</script>
<script type="text/javascript">
<!--
// NAVIGATION
<?php echo $jsMenuOut; ?>
-->
</script>
<noscript>
<center>
<b><br><?php echo getLngt("JavaScript ist nicht verf&uuml;gbar. Bitte aktivieren Sie JavaScript<br><br>in Ihrem Browser, damit diese Seite ordnungsgem&auml;&szlig; funktioniert!")?></b><br><br>
</center>
</noscript>
</head>
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>this.moveTo((screen.width * 0.5)-(document.body.offsetWidth * 0.5),(screen.height * 0.5)-(document.body.offsetHeight * 0.5));">
<?php echo $phpMenuOut ?>
<?php echo $phpReducedMenuOut ?>
<?php echo $phpPageTitelOut ?>
<div class="maincontent" name="maincontent" id="maincontent">
<form action="../customer/jb_list.php" method="post" target="frame_content">
<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="empIdMaster" value="<?php echo $empIdMaster ?>">
<input type="hidden" name="dbhistory" value="<?php echo $dbhistory ?>">
<?php echo $phpCurrentNavigationInputHidden ?>
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
<?php echo htmlDivLineSpacer("5px"); ?>
<?php
// Additional output of the "invoice" job no. (Parent ID of the job)
$parGlobalUseJbParentIdForInvoice = getParameterValue("0", "GLOBAL_USE_JB_PARENT_ID_FOR_INVOICE_NO", "0");
$outJobNo = $job_id;
if ($parGlobalUseJbParentIdForInvoice == "1") :
$outJobNo = getJobIdOutput($job_id);
endif;
?>
<div class="f12bp1_blue">
<?php echo getLngt("Auftrag") ?> <?php echo $outJobNo ?>
</div>
<?php echo htmlDivLineSpacer("10px"); ?>
<div>
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<tr>
<td valign="top">
<!-- JOB-DATA -->
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<tr><td><?php echo getLngt("AUFTRAG") ?>:</td></tr>
<?php echo $jobentry ?>
</table>
</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<td valign="top">
<!-- COURIER-DATA -->
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<?php echo $courierentry ?>
</table>
</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<td valign="top">
<!-- JOB-COSTS -->
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<?php echo $jobcosts ?>
</table>
<br><br>
<!-- EMPLOYEE-DATA -->
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<?php echo $employeeentry ?>
</table>
</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<td align="right" valign="top">
<br>
<?php
echo defineButtonType10(getLngt("Aktualisieren"), "action_show", "location.reload();", "170");
echo "<br>";
$maskJobLabelSize = getParameterValue("0", "MASK_JB_LABEL_SIZE", $hq_id);
if ($maskJobLabelSize == "") : $maskJobLabelSize = getParameterValue("0", "MASK_JB_LABEL_SIZE", "0"); endif;
if ($maskJobLabelSize == "") : $maskJobLabelSize = "label60x40"; endif;
echo defineButtonType10(getLngt("Etiketten"), "label", "openJob2Invoice('302','','&pdfPageSize=" . $maskJobLabelSize . "');", "170");
echo defineButtonType10(getLngt("Etiketten Retoure"), "label", "openJob2Invoice('303','','&pdfPageSize=" . $maskJobLabelSize . "');", "170");
?>
<br>
<?php if ($jbStatus == "2") : ?>
<?php echo defineButtonType10(getLngt("PDF"), "action_pdf", "openJob2pdf();", "170") ?>
<br>
<?php
// echo defineButtonType10(getLngt("Dokumente") . ($jbNumOfFiles != "-1" ? ":&nbsp;" . $jbNumOfFiles : ""), "action_dt_jb", "openJob2Docs();", "170")
?>
<?php endif; ?>
<br>
<?php
if ($globalParUseRelatedCustomer == 1) :
$constMaskButtonAcceptanceProtocol = getParameterValue("0", "MASK_JOBDETAILS_BUTTON_ACCEPTANCE_PROTOCOL", $hq_id);
if ($constMaskButtonAcceptanceProtocol == "") : $constMaskButtonAcceptanceProtocol = getParameterValue("0", "MASK_JOBDETAILS_BUTTON_ACCEPTANCE_PROTOCOL", "0"); endif;
if ($constMaskButtonAcceptanceProtocol == "1") :
// echo defineButtonType10(getLngt("Frachtbrief"), "action_waybill", "openJob2Waybill();", "170");
// echo "<br>";
echo defineButtonType10(getLngt("Abnahmeprotokoll"), "action_acceptance protocol", "openJob2AcceptanceProtocol();", "170");
echo "<br>";
endif;
endif;
?>
<?php echo defineButtonType10(getLngt("Schließen"), "action_close", "window.close();", "170") ?>
</td>
</tr>
</table>
</div>
<?php echo htmlDivLineSpacer("20px"); ?>
<!-- TOUR-DATA -->
<div>
TOUR:<br>
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<tr>
<?php echo $tourentry ?>
</tr>
</table>
</div>
<?php echo htmlDivLineSpacer("20px"); ?>
<div>
<?php echo $outputTourarticle ?>
</div>
<div>
<?php echo $outputJobcalculator ?>
</div>
<div>
<?php echo $outputPhotos ?>
</div>
<div>
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<tr>
<td>
<?php echo $jobinvoicetext ?>
</td>
</tr>
</table>
</div>
</form>
</div>
</body>
</html>

954
html/customer/jb_list.php Normal file
View File

@@ -0,0 +1,954 @@
<?php
/*=======================================================================
*
* jb_list.php (../customer/)
*
* Autor: Marc Vollmann
*
=======================================================================*/
include_once ("../include/mcglobal.inc.php");
include_once ("../include/auth.inc.php");
include_once ("../include/caglobal.inc.php"); // For courier-list only
include_once ("../include/copy_job.inc.php"); // E.g. for "Storno"
include_once ("../include/ranking.inc.php"); // Checks ranking to be lost or not
// Check HTTP-Parameters
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual", "numOfStationSearchs",
"jb_status", "jb_costcenter", "jb_sort", "jb_sel_cs",
"day_from", "month_from", "year_from", "day_to", "month_to", "year_to",
"f_search", "f_stationBasedSearch", "jb_id_storno", "f_jb_id", "f_cr_sid", "dbhistory", "deactivateMenu"));
getLanguage(__FILE__);
$pageTitel = getLngt("AUFTRAGSLISTEN");
include_once ("../admin/menu.php");
include_once ("../include/html.inc.php");
include_once ("../include/inc_job.inc.php");
getCurrentScript(__FILE__);
// Check for authentication access and granted rights
$usrAccessArray["cs"] = "1";
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
// Check GLOBAL parameter to use "related customer" or "normal payer" (!!!!)
$globalParUseRelatedCustomer = getParameterValue("0", "GLOBAL_USE_RELATED_CUSTOMER", "0");
$costcenterPayerOrRelatedClause = "jb.csc_id_payer";
$doCscSubst = true;
if ($doCscSubst) :
// WITH CASH PAYER
$costcenterPayerOrRelatedClause = "<SUBST_CSC>";
endif;
if ($globalParUseRelatedCustomer == "1") :
$costcenterPayerOrRelatedClause = "jb.csc_id_related";
endif;
// Get tax value
$globalParSalesTaxRate = getParameterValue("0", "GLOBAL_SALES_TAX", "0");
if ($globalParSalesTaxRate == "" || !is_numeric($globalParSalesTaxRate)) : $globalParSalesTaxRate = 19; endif;
if ($numOfStationSearchs == "" || !is_numeric($numOfStationSearchs)) :
$numOfStationSearchs = 0;
endif;
// Search value
$f_search = trim($f_search);
$f_job_search = $f_search;
if ($globalParUseRelatedCustomer == "1" && $f_job_search != "" && !is_numeric($f_job_search)) :
$f_job_search = getJobIdSearchOutput($f_job_search);
endif;
if ($jb_status == "") :
$jb_status = "0";
$tmpJbStateDefault = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_JBSTATUS_DEFAULT", "0"));
if ($tmpJbStateDefault != "" && is_numeric($tmpJbStateDefault)) :
$jb_status = $tmpJbStateDefault;
endif;
endif;
// Attention: Parameter also used for meta customer !!!
if ($jb_costcenter == "") :
$jb_costcenter = "1";
$tmpCscDefault = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_CSC_DEFAULT", "0"));
if ($tmpCscDefault != "" && is_numeric($tmpCscDefault)) :
$jb_costcenter = $tmpCscDefault;
endif;
endif;
// Flag for station based search
if ($f_stationBasedSearch == "" || count($f_stationBasedSearch) == 0) :
$f_stationBasedSearch = false;
else:
$f_stationBasedSearch = true;
endif;
// Check range of date. All fields have to be set
if ($day_from == "" || $month_from == "" || $year_from == "" ||
$day_to == "" || $month_to == "" || $year_to == "") :
// Initialize date-ranges to the current date
$fromDateRange = getDateTime("3") . " 00:00:00";
$toDateRange = getDateTime("3") . " 23:59:59";
$day_from = getDateTime("day");
$month_from = getDateTime("month");
$year_from = getDateTime("year");
$day_to = getDateTime("day");
$month_to = getDateTime("month");
$year_to = getDateTime("year");
else :
$fromDateRange = $year_from . "-" . pad($month_from,2) . "-" . pad($day_from,2) . " 00:00:00";
$toDateRange = $year_to . "-" . pad($month_to,2) . "-" . pad($day_to,2) . " 23:59:59";
endif;
// Init
$empIdMaster = "";
$cr_id_order_list = "";
$cr_id_order_list2 = "";
$vht_id_str_js = "";
// Decision to use the archive or normal tables
getDBNames($dbhistory, $year_from);
// All open jobs in the future have to be displayed
// if ($jb_status == "0" || $jb_status == "9") : $toDateRange = ""; endif;
// Map jobs
// if ($jb_status == "8" || $jb_status == "9") : $jb_status == "0"; endif;
// Secure-check of the association between customer, costcenter and employee
$tmpFields = array("cs_id",$customerId,"csc_id",$cscIdActual);
if (existsEntry("costcenter",$tmpFields)) :
// *** Save job-informations (Begin) ***
if ($f_act == "storno" && $jb_id_storno != "") :
// Check job is generated by customer
$jbStornoCscId = getFieldValueFromId("job","jb_id",$jb_id_storno,"csc_id");
$jbStornoUsrId = getFieldValueFromId("job","jb_id",$jb_id_storno,"emp_id"); // "emp_id" contains the "usr_id"
$jbStornoEmpUsrType = getFieldValueFromId("user","usr_id",$jbStornoUsrId,"usr_type");
// Set the current timestamp to store the data
$currentTime = getDateTime("0");
if ($jbStornoCscId > 0 || $jbStornoEmpUsrType == "2") :
TA("B");
// Get current jb_status and cr_id of the storno job
$jbStatus = getFieldValueFromId("job","jb_id",$jb_id_storno,"jb_status");
$jb_storno_costs = "2";
// Update the job-entry:
// jb_storno = 1 (costs because of cs-storno), jb_status = 2 (finished), jb_finishtime = NOW()
$res = updateStmt("job", "jb_id", $jb_id_storno,
array("jb_storno", $jb_storno_costs, "usr_id_storno", $usr_id, "jb_status", "2", "jb_finishtime", $currentTime, "jb_freetext_3", getLngt("Storno durch Kunde im Kundenzugang!")),
"(jb_status = '9' OR jb_status = '8') AND (isnull(jb_storno) OR jb_storno = '0')");
if ($db->affected_rows > 0) :
// Check for storno-job has a standing order
/*
$jbPermanent = getFieldValueFromId("job","jb_id",$jb_id_storno,"jb_permanent");
if ($jbPermanent != "" && $jbPermanent > "0") :
// Check for the continued existence of the standing order rule
if ($jb_storno_rhythm == "2") :
// Update row for termnination of the standing order
updateStmt("job", "jb_id", $jb_id_storno, array("jb_permanent", "0"));
endif;
endif;
*/
// Call for generation of a new job with negative invoice data
if ($globalParUseRelatedCustomer != "1") :
copy_job($jb_id_storno, $jb_storno_costs, $jbStatus, true);
else :
// Remove commission no.
updateStmt("tour", "jb_id", $jb_id_storno, array("tr_commission_no", ""));
endif;
updateStmt("tour", "jb_id", $jb_id_storno, array("tr_commission_no", ""));
// Write logdata into log database
writeToLogDB("10",$hq_id,$jb_id_storno,$usr_id,"","","","COSTS=NO|JBP_REMOVAL=NO|FDS_REMOVAL=NO|CUSTOMER_STORNO=YES");
$statusMessage = getLngt("Der Auftrag") . " " . $jb_id_storno . " " . getLngt("wurde storniert");
endif;
TA("C");
TA("E");
else :
// MELDUNG: STORNO NICHT MÖGLICH!
endif;
endif;
// *** Save job-informations (End) ***
if ($f_act == "setCourier" && $f_cr_sid != "" && $f_jb_id != "") :
// Get current cr_id of the job before changing the courier
$crIdCurrent = getFieldValueFromId("job","jb_id",$f_jb_id,"cr_id");
$crIdOrderCurrent = getFieldValueFromId("job","jb_id",$f_jb_id,"cr_id_order");
$jbHqId = getFieldValueFromId("job","jb_id",$f_jb_id,"hq_id_dispo");
if ($jbHqId == "" || !is_numeric($jbHqId) || $jbHqId == "0") : $jbHqId = $hq_id; endif;
if ($f_cr_availabletime_reset != "1") : $f_cr_availabletime_reset = "0"; endif;
// getDbFieldValues("courier",array("cr_id","cr_occupied"),array("cr_sid",$f_cr_sid));
$cr_id = getFieldValueFromClause("courier","cr_id","cr_sid = '" . $f_cr_sid . "' ORDER BY cr_logintime");
$jb_status_new = "0";
$cr_id_new = "";
if ($cr_id == ""): // Offline-Dispo
$cr_id = getFieldValueFromClause("couriervehicle","cr_id","crvh_sid = '" . $f_cr_sid . "' ORDER BY crvh_export_time DESC");
if ($cr_id != "")
$jb_status_new = "1";
$cr_id_new = $cr_id;
endif;
if ($cr_id != "") :
// RANKING
// Special treatment according to vehicletype ("BUS" or greater will NOT be revoked if job-order is "PKW")
// Get cr.vht_id and jb.vht_id
/*
$arLooseRanking = "1"; // Init: Loose ranking "yes"
$courierVhtId = getFieldValueFromId("courier","cr_id",$cr_id,"vht_id");
$jobVhtId = getFieldValueFromId("job","jb_id",$f_jb_id,"vht_id");
if ($courierVhtId != "" && $jobVhtId != "" && $courierVhtId >= getVhtId("5", "transporter_01") && $jobVhtId <= getVhtId("3", "car_02")) :
$arLooseRanking = "0"; // Loose ranking "no"
endif;
*/
// Special treatment according areas
$jbAdressIdStart = getFieldValueFromClause("tour", "ad_id", "jb_id = '" . $f_jb_id . "' AND tr_sort = '1'");
$jbZipcodeStart = getFieldValueFromId("address", "ad_id", $jbAdressIdStart, "ad_zipcode");
// 29.01.2018: No check for looseRanking if the job is in the future
$sqlStmt = "SELECT jb_ordertime, srvpt_traveltime, job.hq_id_dispo, DATE_SUB(jb_ordertime, INTERVAL GREATEST(srvpt_traveltime, 30) MINUTE) AS datesub, UNIX_TIMESTAMP(DATE_SUB(jb_ordertime, INTERVAL GREATEST(srvpt_traveltime, 30) MINUTE)) AS unixtimestamp" .
" FROM serviceplz, serviceplztraveltime, job" .
" WHERE serviceplz.srvp_id = serviceplztraveltime.srvp_id AND srvp_plz = '" . $jbZipcodeStart . "' AND serviceplztraveltime.hq_id = job.hq_id_dispo AND jb_id = " . $f_jb_id;
// writeLog_("../log/jb_list_", $sqlStmt);
$res = $db->query($sqlStmt);
if ($row = $res->fetch_assoc()):
// writeLog_("../log/jb_list_", "jb_id = " . $f_jb_id . ", jbZipcodeStart = " . $jbZipcodeStart . ", srvpt_traveltime = " . $row['srvpt_traveltime'] . ", hq_id = " . $row["hq_id_dispo"] . ", jb_ordertime = " . $row['jb_ordertime'] . ", datesub = " . $row['datesub'] . ", unixtimestamp = " . $row['unixtimestamp']);
$unixtimestamp = $row['unixtimestamp'];
endif;
$res->free();
$arLooseRanking = "0";
if ($unixtimestamp < time()):
// writeLog_("../log/jb_list_", "looseRanking will be checked\n");
$arLooseRanking = looseRanking($cr_id, $jbZipcodeStart, $jbHqId);
else:
// writeLog_("../log/jb_list_", "looseRanking will _not_ be checked\n");
endif;
// Check first that courier is NOT occupied
// $cr_occupied = getFieldValueFromId("courier", "cr_id", $cr_id, "cr_occupied");
// if ($cr_occupied == "0") :
// if (getCountOfTable("job","cr_id_order = '" . $cr_id . "' AND (jb_status = '1' OR jb_status = '0') AND (isnull(jb_globaljob) or jb_globaljob = '0')") == 0) :
$currentTime = getDateTime("0");
TA("B");
// Update job
// According to be TA-safe the WHERE-Clause depends on the current list the user is in
$jbStatusString = " (jb_status = '8' OR jb_status = '9' OR jb_status = '0' OR jb_status = '1') ";
// if (is_numeric($jb_status)) : $jbStatusString = "jb_status = '" . $jb_status . "'"; endif;
$res = updateStmt("job", "jb_id", $f_jb_id, array("cr_id", $cr_id_new, "cr_id_order", $cr_id, "jb_status", $jb_status_new, "cr_sid", $f_cr_sid, "jb_globaljob", "0", "jb_autoranking", "0"), $jbStatusString);
if ($db->affected_rows > 0) :
// Set current assigning time for revoking a job if not taken by the courier
if (existsEntry("autoranking",array("jb_id",$f_jb_id,"cr_id",$cr_id))) :
updateStmt("autoranking", "jb_id", $f_jb_id, array("ar_challenge", "0", "ar_lastassigntime", $currentTime, "ar_looseranking", $arLooseRanking, "ar_locating", "0"),"cr_id = '" . $cr_id . "'");
else :
insertStmt("autoranking", array("jb_id", $f_jb_id, "cr_id", $cr_id, "ar_challenge", "0", "ar_lastassigntime", $currentTime, "ar_looseranking", $arLooseRanking, "ar_locating", "0"));
endif;
// Insert PDA command to remove job (take cr_id/cr_id_order before changing)
$currentTimePDA = getDateTime("datetime_plus_offset", array(0,0,30,0,0,0), $formatStr = "Y-m-d H:i:s");
if ($crIdCurrent != "" && $crIdCurrent != "0") :
insertPDACommand($jbHqId, $crIdCurrent, "4", "1", $f_jb_id, $currentTimePDA, "");
endif;
if ($crIdOrderCurrent != "" && $crIdOrderCurrent != "0" && $crIdOrderCurrent != $crIdCurrent) :
insertPDACommand($jbHqId, $crIdOrderCurrent, "4", "1", $f_jb_id, $currentTimePDA, "");
endif;
// Reset availabletime of the OLD courier if requested by the disposition manually
if ($f_cr_availabletime_reset == "1") :
updateStmt("courier", "cr_id", $crIdCurrent, array("cr_availabletime", $currentTime));
endif;
// Write logdata into log database
writeToLogDB("7",$jbHqId,$f_jb_id,$usr_id,$cr_id,$f_cr_sid,"","LOST_RANKING=" . ($arLooseRanking == "1" ? "YES" : "NO"));
// Survey
checkJobForSurvey($f_jb_id);
endif;
TA("C");
TA("E");
// else :
// $statusMessage = getLngt("Dem Fahrzeug") . " " . $f_cr_sid . " " . getLngt("wurde zwischenzeitlich ein Auftrag zugewiesen! Bitte ein anderes Fahrzeug wählen.");
// endif;
endif;
endif;
// Get the array for formatting the database-values for the output according to the defined type
$outputFormatField = defineOutputFormats();
// Get the pathname of the actual costcenter
$tmpFields = getFieldsValueFromId("costcenter","csc_id",$cscIdActual,array("csc_path","csc_name"));
$cscPathActual = $tmpFields[0];
$cscNameActual = $tmpFields[1];
// Get status of the customer according to being meta customer
$isMetaCs = "0";
if (existsEntry("customer",array("cs_id_parent",$customerId))) :
$isMetaCs = "1";
endif;
// --- JOB -------------------
// Enable special customer to make cancellation
$parCancellationEnabled = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_CANCELLATION_ENABLED_" . $customerId, "0");
// Enable current headquarters to display cancelled jobs
$parDisplayCancelledJobsEnabled = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_DISPLAY_CANCELLED_JOBS", $hq_id);
// Enable current headquarters to display cancelled jobs
$parCscIdPayerCash = getParameterValue("0", "CSC_ID_PAYER_CASH", $hq_id);
// Get state of customer to be abled to place jobs to favoured couriers
$parDispoFavEnabled = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_DISPO_FAV_ENABLED_" . $customerId, "0");
// Enable special customer to be able to search in field "tr_remark"
// $parSearchByRemarkEnabled = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_SEARCH_BY_REMARK_ENABLED_" . $customerId, "0");
$parSearchByRemarkEnabled = "1";
// Enable special customer for "tr_remark" being displayed
// $parDisplayTourRemarkEnabled = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_DISPLAY_TOUR_REMARK_ENABLED_" . $customerId, "0");
$parDisplayTourRemarkEnabled = "1";
// Enable special customer to be able to search in address fields
$parSearchByAddressEnabled = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_SEARCH_BY_ADDRESS_ENABLED_" . $customerId, "0");
if ($f_stationBasedSearch) :
$titles = getLngt("Nr.").",".getLngt("Kommissionsnr.").",".getLngt("Kostenstelle").",".getLngt("Firma").",,".getLngt("Straße und Hausnr.").",".getLngt("PLZ").",".getLngt("Ort").",".getLngt("Fahrz.").",".getLngt("Auftragszeit").",".getLngt("Kurier");
$titles .= ($parDisplayTourRemarkEnabled == "1" ? ",".getLngt("Bemerkung") : ""); // Tour remark
$titles .= ($jb_status != "2" ? ",".getLngt("Bearbeiten") : ""); // Edit job
$fields = "jb_id,tr_commission_no,csc_name,tr_comp,tr_comp2,streethsno,ad_zipcode,ad_city,vht_value,jb_ordertime,cr_sid";
$fields .= ($parDisplayTourRemarkEnabled == "1" ? ",tr_remark" : "");
$fields .= ($jb_status != "2" ? ",jb_edit" : "");
$aligns = "r,l,l,l,l,l,c,l,c,c,c";
$aligns .= ($parDisplayTourRemarkEnabled == "1" ? ",l" : "");
$aligns .= ($jb_status != "2" ? ",r" : "");
else :
// Initialize
$titles = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_TITLES", "0"));
if ($titles == "") : $titles = trim(getParameterValue("0", "CUSTOMER_MASK_JOBLIST_TITLES_" . $customerId, "0")); endif;
$fields = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_FIELDS", "0"));
if ($fields == "") : $fields = trim(getParameterValue("0", "CUSTOMER_MASK_JOBLIST_FIELDS_" . $customerId, "0")); endif;
$aligns = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_ALIGNS", "0"));
if ($aligns == "") : $aligns = trim(getParameterValue("0", "CUSTOMER_MASK_JOBLIST_ALIGNS_" . $customerId, "0")); endif;
// if ($jb_costcenter == "2" && $isMetaCs == "0") :
if ($titles == "" || $fields == "" || $aligns == "") :
$titles = getLngt("Nr.").",".getLngt("Preis").",".getLngt("Kommissionsnr.").",".getLngt("Referenznr.").",".getLngt("Kostenstelle").",".getLngt("Firma").",,".getLngt("Kunde").",".getLngt("Startadresse").",,".getLngt("Zieladresse").",".getLngt("Fahrz.").",".getLngt("Auftragszeit").",".getLngt("Kurier");
$titles .= ($jb_status != "2" && $parDispoFavEnabled == "1" ? ",".getLngt("Annahme") : ""); // Taketime
$titles .= ($jb_status != "2" ? ",".getLngt("Bearbeiten") : ""); // Edit job
$titles .= (($parDisplayCancelledJobsEnabled == "1" && $jb_status == "2") || ($parCancellationEnabled == "1" && $jb_status != "2") ? ",".getLngt("Storno") : ""); // Cancel job
$fields = "jb_id,business_volume_with_toll,tr_commission_no,tr2_commission_no,csc_name,tr_comp,tr_comp2,tr2_comp,streethsno,ad_zipcode,target_address,vht_value,jb_ordertime,cr_sid";
$fields .= ($jb_status != "2" && $parDispoFavEnabled == "1" ? ",jb_taketime" : "");
$fields .= ($jb_status != "2" ? ",jb_edit" : "");
$fields .= (($parDisplayCancelledJobsEnabled == "1" && $jb_status == "2") || ($parCancellationEnabled == "1" && $jb_status != "2") ? ",jb_storno" : "");
$aligns = "r,r,l,l,l,l,l,l,l,c,l,c,c,c";
$aligns .= ($jb_status != "2" && $parDispoFavEnabled == "1" ? ",c" : "");
$aligns .= ($jb_status != "2" ? ",r" : "");
$aligns .= (($parDisplayCancelledJobsEnabled == "1" && $jb_status == "2") || ($parCancellationEnabled == "1" && $jb_status != "2") ? ",r" : "");
endif;
// else :
// ........ was the same !!!! ........
// endif;
endif;
$addOnTitles = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_ADD_ON_TITLES", "0"));
if ($addOnTitles != "") :
if ($titles != "") : $titles .= ","; endif;
$titles .= $addOnTitles;
endif;
$addOnfields = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_ADD_ON_FIELDS", "0"));
if ($addOnfields != "") :
if ($fields != "") : $fields .= ","; endif;
$fields .= $addOnfields;
endif;
$addOnaligns = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_ADD_ON_ALIGNS", "0"));
if ($addOnaligns != "") :
if ($aligns != "") : $aligns .= ","; endif;
$aligns .= $addOnaligns;
endif;
// Init dummies
$valigns = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,";
$cellTextPre = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,";
$titlesArray = spliti(",",$titles);
$fieldsArray = spliti(",",$fields);
$fieldsLength = count($fieldsArray);
$alignsArray = spliti(",",$aligns);
$valignsArray = spliti(",",$valigns);
$cellTextPreArray = spliti(",",$cellTextPre);
$fieldClause = getDBFields("job") . ", jb.hq_id AS jb_hq_id, " . "jb.hq_id_exec AS jb_hq_id_exec" . "," . "jb.hq_id_dispo AS jb_hq_id_dispo" . "," . "jb.hq_id_sales AS jb_hq_id_sales" . "," . getDBFields("jb_tourzipcodes") . "," . getDBFields("jb_tourcities") . "," . getDBFields("jb_edit") . "," . getDBFields("tour") . "," . getDBFields("address") . "," .
getDBFields("vehicletype") . "," . getDBFields("ad_street_hsno") . "," . getDBFields("jb_latesttaketime") . ", jb.csc_id AS jb_csc_id";
if (!$f_stationBasedSearch) :
$fieldClause .= ", tr2.tr_commission_no AS tr2_commission_no, tr2.tr_comp AS tr2_comp";
// $fieldClause .= ", IFNULL(trs.jb_id,tr.jb_id) AS jb_id_group, SUM(trs.trs_price * ((100 - trs.trs_discount) / 100)) AS business_volume ";
// Toll fields
$fieldClause .= ", jb.jb_totalprice AS business_volume ";
$fieldClause .= ", gdc_toll.gdc_content AS gdc_toll_content ";
$fieldClause .= "," . "(jb.jb_totalprice + IF (gdc_toll.gdc_content != '', gdc_toll.gdc_content, 0)) AS business_volume_with_toll ";
$fieldClause .= "," . "(jb.jb_cr_price + IF (gdc_toll.gdc_content != '', gdc_toll.gdc_content, 0)) AS jb_cr_price_with_toll ";
$fieldClause .= "," . "(jb.jb_cr_subprice + IF (gdc_toll.gdc_content != '', gdc_toll.gdc_content, 0)) AS jb_cr_subprice_with_toll ";
$fieldClause .= "," . "(jb.jb_totalprice * (1 + (" . $globalParSalesTaxRate . " / 100)) + IF (gdc_toll.gdc_content != '', gdc_toll.gdc_content, 0)) AS business_volume_gross_with_toll ";
$fieldClause .= "," . "(jb.jb_cr_price * (1 + (" . $globalParSalesTaxRate . " / 100)) + IF (gdc_toll.gdc_content != '', gdc_toll.gdc_content, 0)) AS jb_cr_price_gross_with_toll ";
// Extra fields defined according to parameters
$parFieldClause = trim(getParameterValue($emp_id, "CUSTOMER_MASK_JOBLIST_FIELDCLAUSE", "0"));
if ($parFieldClause != "") : $fieldClause .= "," . $parFieldClause; endif;
// Target address (only 2nd stop)
// $fieldClause .= "," . " ad2.ad_street AS ad2_street, ad2.ad_zipcode AS ad2_zipcode, ad2.ad_city AS ad2_city, tr2.tr_hsno AS tr2_hsno ";
$fieldClause .= "," . " CONCAT(ad2.ad_street,' ',tr2.tr_hsno,', ',ad2.ad_zipcode) AS target_address ";
$fieldClause .= "," . " CONCAT(ad2.ad_street,' ',tr2.tr_hsno,', ',ad2.ad_zipcode,', ',ad2.ad_city) AS target_address2 ";
$fieldClause .= "," . " tr2.tr_finishtime AS tr2_finishtime, tr2.tr_person AS tr2_person, tr2.tr_signname AS tr2_signname ";
endif;
$fromClause = $dbh_tr . " AS tr, address AS ad, metatype AS vht";
$whereClause = "";
$orderByClause = "jb_ordertime";
if ($f_stationBasedSearch) :
$orderByClause .= ", tr_sort";
endif;
if ($jb_sort != "") : $orderByClause = $fieldsArray[$jb_sort]; endif;
// ASCending or DESCending
if ($orderByClause == "jb_ordertime") : $orderByClause = "jb_ordertime ASC"; endif;
// Check for being meta customer
if ($isMetaCs == "0") :
// Only this cutomer
if ($jb_costcenter == "1") :
$whereClause .= " " . $costcenterPayerOrRelatedClause . " = " . $cscIdActual . " AND ";
endif;
if ($jb_costcenter == "2") :
$fieldClause .= "," . getDBFields("costcenter");
$fromClause .= ", costcenter AS csc ";
/*
$whereClause .= "((" . $costcenterPayerOrRelatedClause . " = " . $cscIdActual . " AND " . $costcenterPayerOrRelatedClause . " = csc.csc_id) OR " .
"(" . $costcenterPayerOrRelatedClause . " = csc.csc_id AND csc.csc_path LIKE '%//" . $cscNameActual . "//%')) AND " .
"csc.cs_id = " . $customerId . " AND ";
*/
$whereClause .= "(" . $costcenterPayerOrRelatedClause . " = " . $cscIdActual . " OR csc.csc_path LIKE '%//" . $cscNameActual . "//%') AND " .
$costcenterPayerOrRelatedClause . " = csc.csc_id AND " .
"csc.cs_id = " . $customerId . " AND ";
endif;
else :
// Customer is meta customer
$fieldClause .= "," . getDBFields("costcenter");
$fromClause .= ", costcenter AS csc, customer AS cs ";
$whereClause .= "<SUBST_01>";
$whereClause1 = "cs.cs_id = '" . $customerId . "'";
$whereClause2 = "cs.cs_id_parent = '" . $customerId . "'";
$whereClause .= " AND cs.cs_id = csc.cs_id AND " . $costcenterPayerOrRelatedClause . " = csc.csc_id AND ";
// Selection for individual cuatomer
if ($jb_sel_cs != "") :
$whereClause .= " cs.cs_id = " . $jb_sel_cs . " AND ";
endif;
endif;
$fromClause .= ", " . $dbh_jb . " AS jb";
if (!$f_stationBasedSearch) :
// Price
// $fromClause .= " LEFT JOIN " . $dbh_trs . " AS trs ON trs.jb_id = jb.jb_id ";
// Target address (only 2nd stop)
$fromClause .= " LEFT JOIN " . $dbh_tr . " AS tr2 ON tr2.jb_id = jb.jb_id AND tr2.tr_sort = '2' ";
$fromClause .= " LEFT JOIN address AS ad2 ON ad2.ad_id = tr2.ad_id ";
$fromClause .= " LEFT JOIN genericdatacontainer AS gdc_toll ON gdc_toll.gdc_obj_type = 'jb' AND gdc_toll.gdc_obj_id = jb.jb_id AND gdc_toll.gdc_gen_fieldname = 'jb_toll' ";
endif;
$fromClause .= " LEFT JOIN genericdatacontainer AS gdc_search ON gdc_search.gdc_obj_type = 'jb' AND gdc_search.gdc_obj_id = jb.jb_id AND gdc_search.gdc_gen_fieldname = 'search' ";
// Separate list for each status
// if ($jb_status != "") : $whereClause .= "jb.jb_status = " . $jb_status . " AND "; endif;
// Aggregated list for different status displayed in ONE list
if ($jb_status != "2") :
$whereClause .= "(jb.jb_status IN (8,9,0,1)) AND ";
else :
$whereClause .= "jb.jb_status = " . $jb_status . " AND ";
endif;
if (!(($parDisplayCancelledJobsEnabled == "1" && $jb_status == "2") || ($parCancellationEnabled == "1" && $jb_status != "2"))) :
$whereClause .= "(isnull(jb.jb_storno) || jb.jb_storno = '0') AND ";
endif;
$whereClause .= "(jb.vht_id = vht.mt_sort AND vht.mt_type = 'vehicletype') AND ";
if ($f_search == "") :
if ($fromDateRange != "") :
$whereClause .= "jb.jb_ordertime >= '$fromDateRange' AND ";
endif;
if ($toDateRange != "") :
$whereClause .= "jb.jb_ordertime <= '$toDateRange' AND ";
endif;
else :
// Job ID
$whereClauseJobId = "";
if (is_numeric($f_job_search)) :
$whereClauseJobId = " jb.jb_id = '" . $f_job_search . "' OR ";
// Job parent ID
if ($globalParUseRelatedCustomer == "1") :
// Check parent
$whereClauseJobId .= " jb.jb_id_parent = '" . $f_job_search . "' OR ";
// Check GDC
$tmpArray = getColVectorFromDB2ArrayByClause("genericdatacontainer", "gdc_obj_id", "gdc_obj_type = 'jb' AND gdc_gen_fieldname = 'info_0' AND gdc_content = '" . $f_search . "'", "", "", "");
if (count($tmpArray) > 0) :
$whereClauseJobId .= " jb.jb_id IN (" . implode(",", $tmpArray) . ") OR ";
endif;
endif;
endif;
// Check GDC.search
// $tmpArray = getColVectorFromDB2ArrayByClause("genericdatacontainer", "gdc_obj_id", "gdc_obj_type = 'jb' AND gdc_gen_fieldname = 'search' AND gdc_content LIKE '%," . $f_search . ",%'", "", "", "");
$tmpArray = getColVectorFromDB2ArrayByClause("genericdatacontainer", "gdc_obj_id", "gdc_obj_type = 'jb' AND gdc_gen_fieldname = 'search' AND gdc_content = '" . $f_search . "'", "", "", "");
if (count($tmpArray) > 0) :
$whereClauseJobId .= " jb.jb_id IN (" . implode(",", $tmpArray) . ") OR ";
endif;
$whereClauseExtended = "";
if ($f_stationBasedSearch && ($parSearchByRemarkEnabled == "1" || $parSearchByAddressEnabled == "1")) :
if ($parSearchByRemarkEnabled == "1") :
$whereClauseExtended .= " OR tr.tr_remark LIKE '%" . $f_search . "%' ";
endif;
if ($parSearchByAddressEnabled == "1") :
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$whereClauseExtended .= " OR ad.ad_street LIKE '%" . $f_search . "%'";
$whereClauseExtended .= " OR ad.ad_zipcode LIKE '%" . $f_search . "%'";
$whereClauseExtended .= " OR ad.ad_city LIKE '%" . $f_search . "%' ";
endif;
// if (!is_numeric($f_search)) :
if ($fromDateRange != "") :
$whereClause .= "jb.jb_ordertime >= '$fromDateRange' AND ";
endif;
if ($toDateRange != "") :
$whereClause .= "jb.jb_ordertime <= '$toDateRange' AND ";
endif;
$numOfStationSearchs++;
if ($numOfStationSearchs == 1) :
$statusMessage = getLngt("Bitte beachten: Die Suche ist eingeschränkt auf den angegebenen Zeitraum!");
endif;
// endif;
endif;
if ($f_stationBasedSearch) :
$whereClause .= "( " . $whereClauseJobId . " tr.tr_commission_no LIKE '%" . $f_search . "%' OR tr.tr_comp LIKE '%" . $f_search . "%'" . $whereClauseExtended . ") AND ";
else :
$whereClause .= "( " . $whereClauseJobId . " tr.tr_commission_no LIKE '%" . $f_search . "%' OR tr.tr_comp LIKE '%" . $f_search . "%' OR tr2.tr_commission_no LIKE '%" . $f_search . "%' OR tr2.tr_comp LIKE '%" . $f_search . "%'" . $whereClauseExtended . ") AND ";
endif;
endif;
if ($f_stationBasedSearch) :
$whereClause .= "jb.jb_id = tr.jb_id AND tr.ad_id = ad.ad_id ";
else :
$whereClause .= "jb.jb_id = tr.jb_id AND tr.tr_sort = 1 AND tr.ad_id = ad.ad_id ";
endif;
// Price
// $whereClause .= " GROUP BY trs.jb_id ";
// $groupByClause = " GROUP BY trs.jb_id ";
// $groupByClause = " GROUP BY jb_id_group ";
$groupByClause = "";
if ($isMetaCs == "0") :
if ($doCscSubst) :
$whereClause1 = str_replace("<SUBST_CSC>", "jb.csc_id_payer", $whereClause);
$whereClause2 = " jb.csc_id_payer = '" . $parCscIdPayerCash . "' AND " . str_replace("<SUBST_CSC>", "jb.csc_id", $whereClause);
$sqlquery = "(". generateStatement($fieldClause,$fromClause,$whereClause1 . $groupByClause,"") . ") UNION (" . generateStatement($fieldClause,$fromClause,$whereClause2 . $groupByClause,"") . ") ORDER BY " . $orderByClause;
else :
$sqlquery = generateStatement($fieldClause,$fromClause,$whereClause . $groupByClause,$orderByClause);
endif;
else :
$whereClause1 = str_replace("<SUBST_01>", $whereClause1, $whereClause);
if ($doCscSubst) :
$whereClause1a = str_replace("<SUBST_CSC>", "jb.csc_id_payer", $whereClause1);
$whereClause1b = " jb.csc_id_payer = '" . $parCscIdPayerCash . "' AND " . str_replace("<SUBST_CSC>", "jb.csc_id", $whereClause1);
endif;
if ($jb_costcenter == "1") :
if ($doCscSubst) :
$sqlquery = "(". generateStatement($fieldClause,$fromClause,$whereClause1a . $groupByClause,"") . ") UNION (" . generateStatement($fieldClause,$fromClause,$whereClause1b . $groupByClause,"") . ") ORDER BY " . $orderByClause;
else :
$sqlquery = generateStatement($fieldClause,$fromClause,$whereClause1 . $groupByClause,$orderByClause);
endif;
else :
$whereClause2 = str_replace("<SUBST_01>", $whereClause2, $whereClause);
if ($doCscSubst) :
$whereClause2a = str_replace("<SUBST_CSC>", "jb.csc_id_payer", $whereClause2);
$whereClause2b = " jb.csc_id_payer = '" . $parCscIdPayerCash . "' AND " . str_replace("<SUBST_CSC>", "jb.csc_id", $whereClause2);
$sqlquery = "(" . generateStatement($fieldClause,$fromClause,$whereClause1a . $groupByClause,"") . ")"
. " UNION (" . generateStatement($fieldClause,$fromClause,$whereClause1b . $groupByClause,"") . ")"
. " UNION (" . generateStatement($fieldClause,$fromClause,$whereClause2a . $groupByClause,"") . ")"
. " UNION (" . generateStatement($fieldClause,$fromClause,$whereClause2b . $groupByClause,"") . ")"
. " ORDER BY " . $orderByClause;
else :
$sqlquery = "(". generateStatement($fieldClause,$fromClause,$whereClause1 . $groupByClause,"") . ") UNION (" . generateStatement($fieldClause,$fromClause,$whereClause2 . $groupByClause,"") . ") ORDER BY " . $orderByClause;
endif;
endif;
endif;
// echo $sqlquery . "<br>";
// FILTER-DEFINITIONS
// $filter_status = addOptionsFromTable("metatype","mt_sort","mt_value","mt_sort","mt_type = 'job_status'",$jb_status);
$listStatusSelected_0 = "";
$listStatusSelected_1 = "";
$listStatusSelected_2 = "";
$listStatusSelected_9 = "";
if ($jb_status == "0") : $listStatusSelected_0 = "selected"; endif;
if ($jb_status == "1") : $listStatusSelected_1 = "selected"; endif;
if ($jb_status == "2") : $listStatusSelected_2 = "selected"; endif;
// if ($jb_status == "9") : $listStatusSelected_9 = "selected"; endif;
$filter_status = "";
// $filter_status .= "<option value=\"0\" " . $listStatusSelected_0 . ">Offene Auftr&auml;ge</option>";
// $filter_status .= "<option value=\"9\" " . $listStatusSelected_9 . ">" . getLngt("Zuzuweisende Auftr&auml;ge") . "</option>";
$filter_status .= "<option value=\"1\" " . $listStatusSelected_1 . ">" . getLngt("Laufende Auftr&auml;ge") . "</option>";
$filter_status .= "<option value=\"2\" " . $listStatusSelected_2 . ">" . getLngt("Erledigte Auftr&auml;ge") . "</option>";
$filter_cs_special = "";
if ($isMetaCs == "0") :
$filter_costcenter = addOptionsFromTable("metatype","mt_sort","mt_value","mt_sort","mt_type = 'job_costcenter'",$jb_costcenter);
else :
$filter_costcenter = addOptionsFromTable("metatype","mt_sort","mt_value","mt_sort","mt_type = 'job_cs_meta'",$jb_costcenter);
$filter_cs_special = addOptionsFromTable("customer", "cs_id", "cs_eid", "cs_eid", "cs_id_parent = '" . $customerId . "'", $jb_sel_cs, "");
endif;
// Searchfield
if ($globalParUseRelatedCustomer == "1") :
$filter_searchfield = getLngt("Auftrag/Komm.Nr./Firma/Kunde") . ($f_stationBasedSearch && $parSearchByRemarkEnabled == "1" ? getLngt("/Bemerkung") : "") . ($f_stationBasedSearch && $parSearchByAddressEnabled == "1" ? getLngt("/Adresse") : "") . ":\n";
else :
$filter_searchfield = getLngt("Auftrag") . ($f_stationBasedSearch && $parSearchByRemarkEnabled == "1" ? getLngt("/Bemerkung") : "") . ($f_stationBasedSearch && $parSearchByAddressEnabled == "1" ? getLngt("/Firma/Kunde/Komm.Nr./Adresse") : "") . ":\n";
endif;
$filter_searchfield .= "<input class=\"f8np1\" type=\"text\" name=\"f_search\" value=\"" . $f_search . "\" size=\"15\">\n";
$filter_searchfield .= "&nbsp;&nbsp;\n";
// Date-ranges
$filter_dateranges = "&nbsp;&nbsp;&nbsp;&nbsp;" . getLngt("von") . ":\n";
$filter_dateranges .= "<select name=\"day_from\" class=\"f8np1\" onchange=\"fillDateFieldsCheck(0, 'maincontent', 'jb_list', 'day_from', 'day_from', 'month_from', 'year_from', '', '', '', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
$filter_dateranges .= "<select name=\"month_from\" class=\"f8np1\" onchange=\"fillDateFieldsCheck(0, 'maincontent', 'jb_list', 'month_from', 'day_from', 'month_from', 'year_from', '', '', '', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
$filter_dateranges .= "<select name=\"year_from\" class=\"f8np1\" onchange=\"fillDateFieldsCheck(0, 'maincontent', 'jb_list', 'year_from', 'day_from', 'month_from', 'year_from', '', '', '', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
$filter_dateranges .= "&nbsp;&nbsp;" . getLngt("bis") . ":\n";
$filter_dateranges .= "<select name=\"day_to\" class=\"f8np1\" onchange=\"fillDateFieldsCheck(0, 'maincontent', 'jb_list', 'day_to', 'day_from', 'month_from', 'year_from', '', '', '', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
$filter_dateranges .= "<select name=\"month_to\" class=\"f8np1\" onchange=\"fillDateFieldsCheck(0, 'maincontent', 'jb_list', 'month_to', 'day_from', 'month_from', 'year_from', '', '', '', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
$filter_dateranges .= "<select name=\"year_to\" class=\"f8np1\" onchange=\"fillDateFieldsCheck(0, 'maincontent', 'jb_list', 'year_to', 'day_from', 'month_from', 'year_from', '', '', '', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
$filter_dateranges .= "&nbsp;&nbsp;&nbsp";
// Javascript-function as template only for
$js_date = "<script type=\"text/javascript\">\n";
$js_date .= "<!--\n";
$js_date .= "function initForm() {\n";
$js_date .= " fillDateFields(1,\"maincontent\",\"jb_list\",\"\",\"day_from\",\"month_from\",\"year_from\",\"\",\"\",\"\");\n";
$js_date .= " setDateTimeFields(\"maincontent\",\"jb_list\",".$day_from.",".$month_from.",".$year_from.", \"\", \"\", \"day_from\", \"month_from\", \"year_from\", \"\", \"\", \"\");\n";
$js_date .= " fillDateFields(1,\"maincontent\",\"jb_list\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
$js_date .= " setDateTimeFields(\"maincontent\",\"jb_list\",".$day_to.",".$month_to.",".$year_to.", \"\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
$js_date .= "}\n";
$js_date .= "-->\n";
$js_date .= "</script>\n";
// Send request to database
if ($jb_status == "2") :
getDb2Connection(); // Try to connect request server because of performance
$result = $db2->query($sqlquery);
else :
$result = $db->query($sqlquery);
endif;
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
// Header and entries of the list
$targetPath = "customer"; // used in following include-file
$jobEditPath = "jobs2";
if ($jb_status == "2") :
// $summationField = "business_volume";
$summationField = "business_volume_with_toll";
endif;
$jobEditParameter = "&customerId=" . $customerId . "&cscIdRoot=" . $cscIdRoot . "&cscIdActual=" . $cscIdActual;
include_once ("../include/jb_list_defineoutput.inc.php");
if ($jb_status == "2" && $sumOfSummationField != 0) :
$tableBody .= "<tr><td class=\"f8np1_red\">" . getLngt("EINTRÄGE:") . "</td><td class=\"f8np1_red\" align=\"left\" colspan=\"" . (count($fieldsArray) - 1) . "\">" . $rowCounter . "</td></tr>\n";
$tableBody .= "<tr><td class=\"f8np1_red\">" . getLngt("GESAMTSUMME:") . "</td><td class=\"f8np1_red\" align=\"left\" colspan=\"" . (count($fieldsArray) - 1) . "\">" . number_format(round($sumOfSummationField,2), 2, ",", ".") . "</td></tr>\n";
endif;
$result->free();
$reload_status = "1";
if ($jb_status == "2" || $jb_status == "10" || $jb_status == "ALL") :
$reload_status = "0";
endif;
endif;
// wenn MASK_AUTO_REFRESH == 0, dann wird die Kurierliste dynamisch (bei Aufruf) aufgebaut
// wenn MASK_AUTO_REFRESH == 1, dann wird die Kurierliste statisch (hier) aufgebaut
if (MASK_AUTO_REFRESH == "1"):
include_once("../jobs/job_courier.inc.php");
endif;
$auto_refresh = MASK_AUTO_REFRESH;
$cr_id_order_list_out = "var cs_jbedit_cr = 1;\n var MASK_COURIER_SORT_BY_OCCUPIED = \"\";\n" . $cr_id_order_list . $cr_id_order_list2 . $vht_id_str_js . getCustomerCouriers($db, $customerId) . "when = \"" . date("H:i") . "\";\n";
?>
<html>
<head>
<title><?php echo $pageTitel ?></title>
<link rel="stylesheet" type="text/css" href="../css/reset.css">
<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/lib_courier.8.js" type="text/javascript"></script>
<?php echo $js_date ?>
<script type="text/javascript">
<!--
// NAVIGATION
<?php echo $jsMenuOut; ?>
var checkReloadCnt = 0;
var refreshStatus = <?php echo $reload_status ?>;
function setRefreshStatus() {
if (document.forms[0].refreshStatusCheckbox.checked == true) {
refreshStatus = 1;
startTimeout();
} else {
refreshStatus = 0;
}
}
var auto_refresh = "<?php echo $auto_refresh ?>";
function startTimeout()
{
self.setTimeout("startReload()", 60000);
}
function startReload()
{
if (refreshStatus == 1) {
checkReload();
// self.location.reload();
finishPage();
}
}
function checkReload()
{
if (++checkReloadCnt == 300)
{
// alert("Der Server antwortet nicht. Bitte überprüfen Sie\n" +
// "ob Sie noch mit dem Internet verbunden sind!");
// self.close();
}
else
self.setTimeout("checkReload()", 100);
}
// Opens a new (popup-)window with specified parameters
function popupWindow(url,title,config) {
popup = window.open(url,title,config);
}
function finishPage() {
for(i=0;i<document.forms[0].jb_costcenter_select.length;++i) {
if (document.forms[0].jb_costcenter_select.options[i].selected == true) {
document.forms[0].jb_costcenter.value=document.forms[0].jb_costcenter_select.options[i].value;
}
};
for(i=0;i<document.forms[0].jb_status_select.length;++i) {
if (document.forms[0].jb_status_select.options[i].selected == true) {
document.forms[0].jb_status.value=document.forms[0].jb_status_select.options[i].value;
}
};
document.forms[0].submit();
};
function makeStorno(jb_id,jb_permanent,cr_id,jbp_id) {
// if (jbStornoCscId > 0 || jbStornoEmpUsrType == "2") {
if (true) {
if (confirm('<?php echo getLngt("Auftrag") ?> ' + jb_id + ' <?php echo getLngt("wirklich stornieren?") ?>')) {
document.forms[0].jb_id_storno.value = jb_id;
document.forms[0].f_act.value = 'storno';
finishPage();
};
} else {
alert('<?php echo getLngt("Dieser Auftrag kann nicht storniert werden!") ?>');
};
};
// *** Courier-List ***
function setCourier(jb_id,cr_sid,cr_availabletime_reset) {
document.forms[0].f_jb_id.value = jb_id;
document.forms[0].f_cr_sid.value = cr_sid;
if (cr_availabletime_reset != '1') {cr_availabletime_reset = '0';};
document.forms[0].f_cr_availabletime_reset.value = cr_availabletime_reset;
document.forms[0].f_act.value = 'setCourier';
finishPage();
};
var cr_id_order_list = new Array();
<?php echo $cr_id_order_list_out ?>
-->
</script>
<noscript>
<center>
<b><br><?php echo getLngt("JavaScript ist nicht verf&uuml;gbar. Bitte aktivieren Sie JavaScript<br><br>in Ihrem Browser, damit diese Seite ordnungsgem&auml;&szlig; funktioniert!") ?></b><br><br>
</center>
</noscript>
</head>
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>initForm();startTimeout();displayStatusMessage()">
<?php echo $phpMenuOut ?>
<?php echo $phpReducedMenuOut ?>
<?php echo $phpPageTitelOut ?>
<div class="maincontent" name="maincontent" id="maincontent">
<form name="jb_list" action="../customer/jb_list.php" method="post">
<input type="hidden" name="customerId" value="<?php echo ec($customerId) ?>">
<input type="hidden" name="cscIdRoot" value="<?php echo ec($cscIdRoot) ?>">
<input type="hidden" name="cscIdActual" value="<?php echo ec($cscIdActual) ?>">
<input type="hidden" name="empIdMaster" value="<?php echo ec($empIdMaster) ?>">
<input type="hidden" name="dbhistory" value="<?php echo ec($dbhistory) ?>">
<input type="hidden" name="jb_costcenter" value="1">
<input type="hidden" name="jb_status" value="">
<input type="hidden" name="jb_sort" value="<?php echo $jb_sort ?>">
<input type="hidden" name="f_cr_availabletime_reset" value="">
<input type="hidden" name="numOfStationSearchs" value="<?php echo $numOfStationSearchs ?>">
<?php echo $phpCurrentNavigationInputHidden ?>
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
<?php echo htmlDivLineSpacer("10px"); ?>
<div class="f12bp1_blue">
<?php echo getLngt("Aufträge der Kostenstelle") ?>: <?php echo $cscNameActual ?>
</div>
<?php echo htmlDivLineSpacer("10px"); ?>
<!-- SELECTION-FILTERS -->
<!-- Refresh status of the list -->
<div style="float:left;">
<input type="checkbox" name="refreshStatusCheckbox" value="<?php echo $reload_status ?>" onClick="javascript:setRefreshStatus();"> <?php echo getLngt("Refresh") ?>&nbsp;
<script type="text/javascript">
if (refreshStatus == 1) {
document.forms[0].refreshStatusCheckbox.checked = true;
} else {
document.forms[0].refreshStatusCheckbox.checked = false;
}
</script>
&nbsp;&nbsp;
</div>
<!-- Costcenter -->
<div style="float:left;">
<select class="f8np1" name="jb_costcenter_select">
<?php echo $filter_costcenter ?>
</select>
&nbsp;
</div>
<!-- Customer selection if current customer is a meta customer -->
<?php if ($isMetaCs == "1") : ?>
<div style="float:left;">
<select class="f8np1" name="jb_sel_cs">
<option value="">---</option>
<?php echo $filter_cs_special ?>
</select>
&nbsp;
</div>
<?php endif; ?>
<!-- Job-status -->
<div style="float:left;">
<select class="f8np1" name="jb_status_select">
<?php echo $filter_status ?>
</select>
</div>
<div style="float:left;">
<?php echo $filter_dateranges ?>
</div>
<div style="float:left;">
<?php echo $filter_searchfield ?>
</div>
<!-- Search-Button -->
<?php echo defineButtonType10(getLngt("Anzeigen"), "action_show", "finishPage();", "80", "left", "2") ?>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;<?php echo getLngt("Etappenliste") ?>&nbsp;<input type="checkbox" name="f_stationBasedSearch[]" value="1" <?php if ($f_stationBasedSearch) : echo "checked"; endif; ?>>
</div>
<?php echo htmlDivLineSpacer("10px", "", "left"); ?>
<!-- TABLE OF JOBS -->
<div>
<table width="95%" align="left" cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<tr>
<td>
&nbsp;
</td>
</tr>
<?php echo $tableHeader ?>
<?php echo $tableBody ?>
<tr>
<td>
&nbsp;
</td>
<tr>
</table>
</div>
<input type="hidden" name="jb_id_storno" value="">
<input type="hidden" name="f_cr_sid" value="">
<input type="hidden" name="f_jb_id" value="2">
<input type="hidden" name="f_act" value="">
</form>
</div>
</body>
</html>