6 units per 10 minutes <=> one hour) // $hourTimeUnits = getParameterValue("0", "DISPOSITION_HOUR_TIME_UNITS", $hq_id); // if ($hourTimeUnits == "" || !is_numeric($hourTimeUnits)) : $hourTimeUnits = getParameterValue("0", "DISPOSITION_HOUR_TIME_UNITS", "0"); if ($hourTimeUnits == "" || !is_numeric($hourTimeUnits)) : $hourTimeUnits = 6; endif; // endif; // Get root stock where all service units belong to $rootStockSU = getParameterValue("0", "SU_STK_ROOT", $hq_id); if ($rootStockSU != "" && is_numeric($rootStockSU)) : // Get db-parameter for the number of lists (frames) to be displayed of the current employee // This is important for the call of job lists only !!! $empMaskMultiJoblist = getParameterValue($emp_id, "MASK_MULTI_JOBLIST"); if ($empMaskMultiJoblist == "") : $empMaskMultiJoblist = "3"; endif; // Get vector of all message codes being critical $criticalMessageArray = getColVectorFromDB2ArrayByClause("phoenix.articlemessage", "atm_code", "atm_critical = '1'", "", "atm_code", "1"); // Get vector of all message being displayed (containing critical !!!!) $tmpMessageArray = getColVectorFromDB2ArrayByClause("phoenix.articlemessage", "CONCAT(at_id2,'_',atm_code) AS atm_key", "atm_critical != '0'", "", "atm_key", "1"); $tmpMessageArrayLen = count($tmpMessageArray); $displayMessageArray = array(); for ($j = 0; $j < $tmpMessageArrayLen; $j++) : $tmpAtmArr = explode("_", $tmpMessageArray[$j]); // "_" => $atmAtId2 = $tmpAtmArr[0]; $atmAtCode = $tmpAtmArr[1]; $atmAtMatch = getFieldValueFromId("phoenix.article", "at_id", $atmAtId2, "at_match"); $displayMessageArray[] = array($atmAtId2, $atmAtCode, $atmAtMatch); endfor; $displayMessageArrayLen = count($displayMessageArray); $maxNumOfTours = getParameterValue("0", "MAX_NUM_OF_SU_TOURS", $hq_id); if ($maxNumOfTours == "" || !is_numeric($maxNumOfTours)) : $maxNumOfTours = "4"; endif; // Number of data fields in "articleitem" (ati_data_01, ati_data_02, ...) $maxNumOfAtiDataFields = getParameterValue("0", "MAX_NUM_OF_ATI_DATA_FIELDS", $hq_id); if ($maxNumOfAtiDataFields == "" || !is_numeric($maxNumOfAtiDataFields)) : $maxNumOfAtiDataFields = "30"; endif; // Max. length of the card roll serial numbers $maxLenOfCdrSrNo = getParameterValue("0", "MAX_LEN_OF_CDR_SERIAL_NO", $hq_id); if ($maxLenOfCdrSrNo == "" || !is_numeric($maxLenOfCdrSrNo)) : $maxLenOfCdrSrNo = "6"; endif; // Get vehicles to map... (e.g. 1 <=> HHA101, 2 <=> HHA102, 3 <=> HHA103) $mappedCourierArray = array(); // => Example: $mappedCourierArray <=> array("0" => "", "1" => "9322", "2" => "9323", "3" => "9324", ....); $mappedCourierArray[0] = ""; // Init because vehicle #0 does not exist in tour planning but #1, #2, #3, etc. do $crCrvhArray = getColVectorFromDB2ArrayByClause("phoenix.couriervehicle AS crvh, phoenix.courier AS cr", "crvh.crvh_sid", "crvh.cr_id = cr.cr_id", "cr.cr_id", "", ""); $crIdArray = array_keys($crCrvhArray); $crIdArrayLen = count($crIdArray); for ($j = 0; $j < $crIdArrayLen; $j++) : $currentSid = $crCrvhArray[$crIdArray[$j]]; $currentSidSuffixNum = intval(substr($currentSid, -2)); $mappedCourierArray[$currentSidSuffixNum] = $crIdArray[$j]; // E.g. $mappedCourierArray[3] = $crIdArray[$j]; endfor; $mappedCourierArrayLen = count($mappedCourierArray); // Get GROUP numbers for items // Ticket machine (here "service unit" ("su")) $suGroupId = getParameterValue("0", "SU_TICKET_MACHINE_GROUP_ID", $hq_id); if ($suGroupId == "") : $suGroupId = "1"; endif; // "Cash box" ("cb") $cbGroupId = getParameterValue("0", "SU_CASH_BOX_GROUP_ID", $hq_id); if ($cbGroupId == "") : $cbGroupId = "2"; endif; // Get vector of article(type) IDs ("at_id") of service units // $suAtIdArray = getColVectorFromDB2ArrayByClause("phoenix.article", "at_id", "at_group = '," . $suGroupId . ",'", "", "at_id"); $suAtIdString = getParameterValue("0", "SU_AT_TYPES_FOR_TV", $hq_id); $suAtIdArray = explode(",", $suAtIdString); $suAtIdArrayLen = count($suAtIdArray); // Get new threshold values by frontend for ($a = 0; $a < $suAtIdArrayLen; $a++) : $atId = $suAtIdArray[$a]; for ($t = 0; $t < $maxNumOfAtiDataFields; $t++) : getSecHttpVars("1",array("f_tv_" . $atId . "_" . pad(($t + 1),2))); $f_tv[$atId][($t + 1)] = ${("f_tv_" . $atId . "_" . pad(($t + 1),2))}; endfor; endfor; // There could be defined a special stock being parent stock for all service unit (article item) stocks. // Otherwise every service unit will be associated to a special root stock (!!!!) $suStockIdParentDefault = getParameterValue("0", "SERVICEUNIT_STOCK_PARENT_ID", $hq_id); if ($suStockIdParentDefault == "" || !is_numeric($suStockIdParentDefault)) : $suStockIdParentDefault = getParameterValue("0", "SERVICEUNIT_STOCK_PARENT_ID", "0"); if ($suStockIdParentDefault == "" || !is_numeric($suStockIdParentDefault)) : $suStockIdParentDefault = "0"; endif; endif; // There could be defined a special stock being parent stock for all service unit (article item) stocks. // Otherwise every service unit will be associated to a special root stock (!!!!) $cbStockIdParentDefault = getParameterValue("0", "CASHBOX_STOCK_PARENT_ID", $hq_id); if ($cbStockIdParentDefault == "" || !is_numeric($cbStockIdParentDefault)) : $cbStockIdParentDefault = getParameterValue("0", "CASHBOX_STOCK_PARENT_ID", "0"); if ($cbStockIdParentDefault == "" || !is_numeric($cbStockIdParentDefault)) : $cbStockIdParentDefault = "0"; endif; endif; // Service time default value $suServiceAndWayTimeDefault = getParameterValue("0", "SERVICEUNIT_TIME_DEFAULT", $hq_id); if ($suServiceAndWayTimeDefault == "" || !is_numeric($suServiceAndWayTimeDefault)) : $suServiceAndWayTimeDefault = getParameterValue("0", "SERVICEUNIT_TIME_DEFAULT", "0"); if ($suServiceAndWayTimeDefault == "" || !is_numeric($suServiceAndWayTimeDefault)) : $suServiceAndWayTimeDefault = 10; endif; endif; if ($f_su_admin_ati_data_24 == "") : $f_su_admin_ati_data_24 = $suServiceAndWayTimeDefault; endif; // Check for activation of critical behaviour by default vehicle ONLY $suServiceIsCriticalByDefaultVehicleOnly = getParameterValue("0", "SERVICEUNIT_CRITICAL_BY_VEHICLE_ONLY", $hq_id); if ($suServiceIsCriticalByDefaultVehicleOnly == "") : $suServiceIsCriticalByDefaultVehicleOnly = getParameterValue("0", "SERVICEUNIT_CRITICAL_BY_VEHICLE_ONLY", "0"); endif; // Check for activation of critical behaviour if state is semi critical AND default vehicle is set $suServiceIsCriticalByStateSemiCriticalAndDefaultVehicle = getParameterValue("0", "SERVICEUNIT_CRITICAL_ADDED_BY_VEHICLE", $hq_id); if ($suServiceIsCriticalByStateSemiCriticalAndDefaultVehicle == "") : $suServiceIsCriticalByStateSemiCriticalAndDefaultVehicle = getParameterValue("0", "SERVICEUNIT_CRITICAL_ADDED_BY_VEHICLE", "0"); endif; // Disable sawtooth regarding activated prediction date for service units without current amount data $suSawtoothIsDisabled = getParameterValue("0", "SERVICEUNIT_SAWTOOTH_DISABLED", $hq_id); if ($suSawtoothIsDisabled == "") : $suSawtoothIsDisabled = getParameterValue("0", "SERVICEUNIT_SAWTOOTH_DISABLED", "0"); endif; // Init association between vehicle and customer regarding "customervehicle" if ($f_tour_crvh_assoc == "") : $f_tour_crvh_assoc = array(); for ($j = 0; $j <= $maxNumOfTours; $j++) : $f_tour_crvh_assoc[$j] = $j; endfor; else : $f_tour_crvh_assoc = explode(",", $f_tour_crvh_assoc); array_unshift($f_tour_crvh_assoc, "0"); endif; $jsExecBodyOnLoadArray = array("0","0","0","0","0"); // If one component is set to "1" then execute a special JS function according to "body onLoad" $suRoutePlanningArray = array(); for ($j = 0; $j <= $maxNumOfTours; $j++) : $suRoutePlanningArray[$j] = array(); endfor; $suRouteOptimizedArray = array(); $outEventStatesArray = array(); $outJobArray = array(); $outLogArray = array(); $outMessageArray = array(); $constLngOutputTourChars = getLngt("T"); // Constant because there will be a search in the database $colArray = array(); $colArray["bg"] = $constBackground; $colArray["blue"] = "#0000FF"; $colArray["green"] = "#00FF00"; $colArray["red"] = "#FF0000"; $colArray["white"] = "#FFFFFF"; $colArray["yellow"] = "#FFFF00"; $colArray["black"] = "#000000"; $colArray["gray"] = "#DDDDDD"; $colArray["gold"] = "#969325"; $colArray["beige"] = "#EFE4B0"; $colArray["light_red"] = "#FF8888"; $colArray["light_green"] = "#88FF88"; $colArray["light_blue"] = "#8888FF"; $colArray["light_yellow"] = "#FFFF88"; $colArray["light_gray"] = "#EEEEEE"; // Initialize filter parameter, if only one type does exist. // Card roll types. $cdrTypeArr = getColVectorFromDB2ArrayByClause("article", "at_id", "at_group LIKE '%,5,%'"); if (count($cdrTypeArr) == 1) : if ($f_cdr_admin_at_id == "") : $f_cdr_admin_at_id = $cdrTypeArr[0]; endif; if ($f_cdr_admin_filter_2 == "") : $f_cdr_admin_filter_2 = $cdrTypeArr[0]; endif; endif; $atiColsTypesArray = array(); // Represents the fields ati_data_01, ati_data_02, ..., ati_data_xx only! $atiColsTypes = getParameterValue("0", "STK_ATI_COLUMN_TYPES", $hq_id); if ($atiColsTypes != "") : $atiColsTypesArray = spliti(",", $atiColsTypes); else : // Default $atiColsTypesArray = array("varchar","number","number","date","integer","float2","integer","float2","integer","","","","","","","","","","integer","integer"); endif; // SERVICEJOBS: Check ranges of time. All fields have to be set if ($f_showDateAndTime_jb == "") : $f_showDateAndTime_jb = "0"; endif; // Show the clock time fields [default "NO"] if ($f_showDateAndTime_jb == "0" || $hour_from_jb == "" || $minute_from_jb == "" || $hour_to_jb == "" || $minute_to_jb == "") : $hour_from_jb = "00"; $minute_from_jb = "00"; $hour_to_jb = "23"; $minute_to_jb = "59"; $f_showDateAndTime_jb == "0"; endif; $hour_from_jb = pad($hour_from_jb,2); $minute_from_jb = pad($minute_from_jb,2); $hour_to_jb = pad($hour_to_jb,2); $minute_to_jb = pad($minute_to_jb,2); // Time range $fromTimeRange = " " . $hour_from_jb . ":" . $minute_from_jb . ":00"; $toTimeRange = " " . $hour_to_jb . ":" . $minute_to_jb . ":59"; // Check ranges of date. All fields have to be set if ($day_from_jb == "" || $month_from_jb == "" || $year_from_jb == "" || $day_to_jb == "" || $month_to_jb == "" || $year_to_jb == "") : // Initialize date-ranges to the current date $fromDateRange_jb = getDateTime("3") . $fromTimeRange; $toDateRange_jb = getDateTime("3") . $toTimeRange; $day_from_jb = getDateTime("day"); $month_from_jb = getDateTime("month"); $year_from_jb = getDateTime("year"); $day_to_jb = getDateTime("day"); $month_to_jb = getDateTime("month"); $year_to_jb = getDateTime("year"); else : $fromDateRange_jb = $year_from_jb . "-" . pad($month_from_jb,2) . "-" . pad($day_from_jb,2) . $fromTimeRange; $toDateRange_jb = $year_to_jb . "-" . pad($month_to_jb,2) . "-" . pad($day_to_jb,2) . $toTimeRange; endif; // Init prediction date if ($day_prediction == "" || $month_prediction == "" || $year_prediction == "") : $day_prediction = getDateTime("day"); $month_prediction = getDateTime("month"); $year_prediction = getDateTime("year"); endif; $predictionDate = $year_prediction . "-" . $month_prediction . "-" . $day_prediction; $currentDate = getDateTime("3"); $predictionDays = 0; if ($predictionDate > $currentDate) : $predictionDays = mcDateDiff($currentDate, $predictionDate); if ($predictionDays < 0) : $predictionDays = 0; endif; $outReportArray[] = getLngt("Das eingestellte Datum liegt in der Zukunft!"); else : $day_prediction = getDateTime("day"); $month_prediction = getDateTime("month"); $year_prediction = getDateTime("year"); endif; // Public holidays of the next days $phToDate = date('Y-m-d', strtotime($predictionDate . ' + 7 days')); $phWhereClause = "CONCAT(ph_year,'-',LPAD(ph_month,2,'0'),'-',LPAD(ph_day,2,'0')) > '" . $predictionDate . "' AND " . "CONCAT(ph_year,'-',LPAD(ph_month,2,'0'),'-',LPAD(ph_day,2,'0')) <= '" . $phToDate . "'"; $publicHolidaysArray = getPublicHolidays(getDateTime(substr($predictionDate,0,4)), "", "", $phWhereClause); $phDateArray = convertPublicHolidayArrayToDateArray($publicHolidaysArray); // Check map button being displayed after at least one optimization if ($f_map_is_active == "") : $f_map_is_active = "1"; endif; $f_search = trim($f_search); $numOfRowsSU = 0; $numOfRowsJB = 0; $numOfRowsLOG = 0; // Selected service units (checkboxes) if ($f_su_chkbx == "") : $f_su_chkbx = array(); endif; $f_su_chkbx_len = count($f_su_chkbx); // Selected tour if ($f_su_tour_no == "") : $f_su_tour_no = array(); endif; $f_su_tour_no_len = count($f_su_tour_no); // State array for (critical) messages if ($f_su_atm_chkbx == "") : $f_su_atm_chkbx = array(); endif; $f_su_atm_chkbx_len = count($f_su_atm_chkbx); // State array for cash boxes being critical [CB1 : $f_su_cb_chkbx_nn[$row["ati_serialno"]]["0"] = "1", CB2 : $f_su_cb_chkbx_nn[$row["ati_serialno"]]["1"], ....] // The length of all array are identical to $f_su_chkbx_len (!!!!) if ($f_su_cb_chkbx_00 == "") : $f_su_cb_chkbx_00 = array(); endif; if ($f_su_cb_chkbx_01 == "") : $f_su_cb_chkbx_01 = array(); endif; if ($f_su_cb_chkbx_02 == "") : $f_su_cb_chkbx_02 = array(); endif; if ($f_su_cb_chkbx_03 == "") : $f_su_cb_chkbx_03 = array(); endif; if ($f_su_cb_chkbx_04 == "") : $f_su_cb_chkbx_04 = array(); endif; // Sum of initial cash box values $tourSumArray = array(); $tourWeightArray = array(); $tourCountArray = array(); for ($i = 0; $i <= $maxNumOfTours; $i++) : $tourSumArray[$i] = 0; $tourWeightArray[$i] = 0; $tourCountArray[$i] = 0; endfor; // Get global threshold values $thresholdValuesArray = getThresholdValues($suAtIdArray); // Check default threshold values with frontend values $tmpDisplayMsg = false; for ($a = 0; $a < $suAtIdArrayLen; $a++) : $atId = $suAtIdArray[$a]; $tvDiffersFromDefault = false; for ($t = 0; $t < $maxNumOfAtiDataFields; $t++) : if ($f_tv[$atId][($t + 1)] != $thresholdValuesArray[$atId][$t]) : $tvDiffersFromDefault = true; endif; endfor; if ($tvDiffersFromDefault) : // Store new threshold values for the current "at_id" if requested AND at least one of them differs from current persistent state !!!! if ($f_act == "tv_store") : setThresholdValues($atId); endif; // At least one threshold value differs from the default value $tmpAtMatch = getFieldValueFromId("phoenix.article", "at_id", $atId, "at_match"); $outReportArray[] = getLngt("Mindestens ein Schwellwert differiert von den gespeicherten Werten beim Automatentyp " . $tmpAtMatch . "!"); $tmpDisplayMsg = true; endif; endfor; if ($tmpDisplayMsg) : $outReportArray[] = getLngt("[Die initialen Standardwerte können über den gleichnamigen Button geladen werden!"); $outReportArray[] = getLngt("ACHTUNG: Sollen die Standardwerte dann wieder stetig bei initialem Seitenaufruf geladen werden,"); $outReportArray[] = getLngt("dann geladene - nicht veränderbare - Standardkonfiguration nochmal speichern für zu ladende Startwerte!]"); endif; // Displayed DIV container by default $maskDisplay00Switch = "0"; // Only generate output if there is at least one system message if ($maskDisplay01Switch == "") : $maskDisplay01Switch = "0"; endif; if ($maskDisplay02Switch == "") : $maskDisplay02Switch = "1"; endif; if ($maskDisplay03Switch == "") : $maskDisplay03Switch = "0"; endif; if ($maskDisplay04Switch == "") : $maskDisplay04Switch = "0"; endif; if ($maskDisplay05Switch == "") : $maskDisplay05Switch = "0"; endif; if ($maskDisplay06Switch == "") : $maskDisplay06Switch = "0"; endif; if ($maskDisplay07Switch == "") : $maskDisplay07Switch = "1"; endif; if ($maskDisplay08Switch == "") : $maskDisplay08Switch = "1"; endif; if ($maskDisplay09Switch == "") : $maskDisplay09Switch = "0"; endif; if ($f_suLoadStates == "") : $f_suLoadStates = "0"; endif; if ($initialPageCall == "") : $f_suLoadStates = "1"; endif; // If page is called initially then set all checkboxes of critical items if ($f_pt_filter_1 == "") : $f_pt_filter_1 = "0"; endif; if ($f_jb_filter_1 == "") : $f_jb_filter_1 = "0"; endif; if ($f_jb_filter_2 == "") : $f_jb_filter_2 = ""; endif; if ($f_jb_filter_3 == "") : $f_jb_filter_3 = ""; endif; if ($f_log_filter_1 == "") : $f_log_filter_1 = "0"; endif; if ($f_su_admin_filter_1 == "") : $f_su_admin_filter_1 = ""; endif; if ($f_cb_admin_filter_1 == "") : $f_cb_admin_filter_1 = ""; endif; if ($f_cb_admin_filter_2 == "") : $f_cb_admin_filter_2 = ""; endif; if ($f_cdr_admin_filter_1 == "") : $f_cdr_admin_filter_1 = ""; endif; if ($f_cdr_admin_filter_2 == "") : $f_cdr_admin_filter_2 = ""; endif; if ($f_su_admin_stk_id == "") : $f_su_admin_stk_id = ""; endif; if ($f_pt_filter_01_01 == "") : $f_pt_filter_01_01 = "1"; endif; if ($f_pt_filter_01_02 == "") : $f_pt_filter_01_02 = "0"; endif; if ($f_pt_filter_01_03 == "") : $f_pt_filter_01_03 = "0"; endif; if ($f_crvh_selection_00 == "") : $f_crvh_selection_00 = "1"; endif; if ($f_crvh_selection_01 == "") : $f_crvh_selection_01 = "1"; endif; if ($f_crvh_selection_02 == "") : $f_crvh_selection_02 = "1"; endif; if ($f_crvh_selection_03 == "") : $f_crvh_selection_03 = "1"; endif; if ($f_crvh_selection_04 == "") : $f_crvh_selection_04 = "1"; endif; if ($f_col_sel_00 == "") : $f_col_sel_00 = "1"; endif; // FA if ($f_col_sel_01 == "") : $f_col_sel_01 = "1"; endif; // Standort if ($f_col_sel_02 == "") : $f_col_sel_02 = "1"; endif; // Opt. if ($f_col_sel_03 == "") : $f_col_sel_03 = "1"; endif; // Tour if ($f_col_sel_04 == "") : $f_col_sel_04 = "1"; endif; // Sort. if ($f_col_sel_05 == "") : $f_col_sel_05 = "1"; endif; // XXX if ($f_col_sel_06 == "") : $f_col_sel_06 = "1"; endif; // PLZ if ($f_col_sel_07 == "") : $f_col_sel_07 = "0"; endif; // Geog. Breite if ($f_col_sel_08 == "") : $f_col_sel_08 = "0"; endif; // Geog. Länge if ($f_col_sel_09 == "") : $f_col_sel_09 = "1"; endif; // BEK if ($f_col_sel_10 == "") : $f_col_sel_10 = "1"; endif; // MEK if ($f_col_sel_11 == "") : $f_col_sel_11 = "1"; endif; // H1 if ($f_col_sel_12 == "") : $f_col_sel_12 = "1"; endif; // H2 if ($f_col_sel_13 == "") : $f_col_sel_13 = "1"; endif; // Dispenser if ($f_col_sel_14 == "") : $f_col_sel_14 = "1"; endif; // Messzeitpunkt if ($f_col_sel_15 == "") : $f_col_sel_15 = "1"; endif; // Meldungen if ($f_col_sel_16 == "") : $f_col_sel_16 = "0"; endif; // SW if ($f_col_sel_17 == "") : $f_col_sel_17 = "0"; endif; // Status if ($f_col_sel_18 == "") : $f_col_sel_18 = "1"; endif; // N(otiz) if ($f_col_sel_19 == "") : $f_col_sel_19 = "0"; endif; // Schwellwert-Offset else : $outReportArray[] = getLngt("Es wurden keine Serviceeinheiten aufgefunden!"); $generateOutput = false; endif; // Check for $rootStockSU is defined // ************* // * Functions * // ************* // Initialisations /* if ($selYear == "") : $selYear = date("Y"); endif; if ($selMonth == "") : $selMonth = date("m"); endif; if ($selDay == "") : $selDay = date("d"); endif; include_once ("../include/inc_calendar.inc.php"); */ include_once ("../groupware/calendar.php"); // Check for $rootStockSU is defined if ($generateOutput) : // ******************************************* // * Store form data for a service unit item * // ******************************************* if ($f_act == "storeDataServiceunit") : $f_su_admin_ati_serialno = trim($f_su_admin_ati_serialno); $f_su_admin_ati_data_01 = trim($f_su_admin_ati_data_01); $f_su_admin_ati_data_02 = trim($f_su_admin_ati_data_02); $f_su_admin_ati_data_03 = trim($f_su_admin_ati_data_03); $f_su_admin_ati_data_22 = trim($f_su_admin_ati_data_22); $f_su_admin_ati_data_23 = trim($f_su_admin_ati_data_23); $f_su_admin_ati_data_24 = trim($f_su_admin_ati_data_24); $f_su_admin_ati_data_28_00 = trim($f_su_admin_ati_data_28_00); $f_su_admin_ati_data_28_01 = trim($f_su_admin_ati_data_28_01); $f_su_admin_ati_data_28_02 = trim($f_su_admin_ati_data_28_02); $f_su_admin_ati_data_28_03 = trim($f_su_admin_ati_data_28_03); $f_su_admin_ati_data_28_04 = trim($f_su_admin_ati_data_28_04); if ($f_su_admin_ati_data_28_00 == "" || !(is_numeric($f_su_admin_ati_data_28_00))) : $f_su_admin_ati_data_28_00 = "0"; endif; if ($f_su_admin_ati_data_28_01 == "" || !(is_numeric($f_su_admin_ati_data_28_01))) : $f_su_admin_ati_data_28_01 = "0"; endif; if ($f_su_admin_ati_data_28_02 == "" || !(is_numeric($f_su_admin_ati_data_28_02))) : $f_su_admin_ati_data_28_02 = "0"; endif; if ($f_su_admin_ati_data_28_03 == "" || !(is_numeric($f_su_admin_ati_data_28_03))) : $f_su_admin_ati_data_28_03 = "0"; endif; if ($f_su_admin_ati_data_28_04 == "" || !(is_numeric($f_su_admin_ati_data_28_04))) : $f_su_admin_ati_data_28_04 = "0"; endif; $f_su_admin_ati_data_28 = $f_su_admin_ati_data_28_00 . "," . $f_su_admin_ati_data_28_01 . "," . $f_su_admin_ati_data_28_02 . "," . $f_su_admin_ati_data_28_03 . "," . $f_su_admin_ati_data_28_04; $currAtId = getFieldValueFromClause("phoenix.articleitem", "at_id", "ati_serialno = '" . $f_su_admin_ati_serialno . "'"); $currStkId = getFieldValueFromClause("phoenix.articleitem", "stk_id", "ati_serialno = '" . $f_su_admin_ati_serialno . "'"); // Offset check $currAtiData28 = getFieldValueFromClause("phoenix.articleitem", "ati_data_28", "ati_serialno = '" . $f_su_admin_ati_serialno . "'"); $suCheckedByNewOffset = false; $currentTime = getDateTime("0"); if ($f_su_admin_at_id != "" && is_numeric($f_su_admin_at_id)) : if ($f_su_admin_stk_id != "" && is_numeric($f_su_admin_stk_id)) : $doModifyStockarticle = false; // Vector of predefined vehicles of days of the week $f_su_admin_ati_data_21 = $f_su_admin_ati_data_21_1 . "," . $f_su_admin_ati_data_21_2 . "," . $f_su_admin_ati_data_21_3 . "," . $f_su_admin_ati_data_21_4 . "," . $f_su_admin_ati_data_21_5 . "," . $f_su_admin_ati_data_21_6 . "," . $f_su_admin_ati_data_21_7; // There could be defined a special stock being parent stock for all service unit (article item) stocks. // Otherwise every service unit will be associated to a special root stock (!!!!) /* $suStockIdParent = getParameterValue("0", "SERVICEUNIT_STOCK_PARENT_ID", $hq_id); if ($suStockIdParent == "" || !is_numeric($suStockIdParent)) : $suStockIdParent = getParameterValue("0", "SERVICEUNIT_STOCK_PARENT_ID", "0"); if ($suStockIdParent == "" || !is_numeric($suStockIdParent)) : $suStockIdParent = "0"; endif; endif; */ $suStockIdParent = $suStockIdParentDefault; // Check for selection of a service unit item if ($f_su_admin_filter_1 == "") : // * INSERT * if (!existsEntry("phoenix.articleitem",array("ati_serialno",$f_su_admin_ati_serialno))) : $atiLastInsertId = dbInsert("phoenix.articleitem", array("at_id", $f_su_admin_at_id, "stk_id", $f_su_admin_stk_id, "ati_serialno", $f_su_admin_ati_serialno, "ati_data_01", $f_su_admin_ati_data_01, "ati_data_02", $f_su_admin_ati_data_02, "ati_data_03", $f_su_admin_ati_data_03, "ati_data_04", $currentTime, "ati_data_21", $f_su_admin_ati_data_21, "ati_data_22", $f_su_admin_ati_data_22, "ati_data_23", $f_su_admin_ati_data_23, "ati_data_24", $f_su_admin_ati_data_24, "ati_data_28", $f_su_admin_ati_data_28)); if ($atiLastInsertId != "" && is_numeric($atiLastInsertId) && $atiLastInsertId > 0) : $outReportArray[] = getLngt("Die neuen Automatendaten wurden angelegt!"); $doModifyStockarticle = true; // Item is a service unit. Insert stock associated to this item if does not exist $opVal = objectInsertStock("ati", $atiLastInsertId, $suStockIdParent, "SYSTEM-SERVICEUNIT", getLngt("FA") . $f_su_admin_ati_serialno, $dbConnection); if ($opVal == "-1") : $outReportArray[] = getLngt("Es wurde kein spezielles Objekt bzw. dessen Typ spezifiziert!"); elseif ($opVal == "-2") : $outReportArray[] = getLngt("ACHTUNG! Es existiert kein notwendiges Hauptlager! Bitte den Administrator kontaktieren!"); elseif ($opVal == "-3") : $outReportArray[] = getLngt("ACHTUNG! Die Anlage des Lagerortes konnte nicht durchgeführt werden! Bitte wiederholen bzw. den Administrator kontaktieren!"); endif; // New offset data are stored, check for displayed checkboxes to be changed if ($f_su_admin_ati_data_28 != $currAtiData28) : $suCheckedByNewOffset = true; endif; else : $outReportArray[] = getLngt("ACHTUNG! Die Anlage des Automats hat nicht geklappt! Bitte wiederholen bzw. den Administrator kontaktieren!"); endif; else : $outReportArray[] = getLngt("Dieser Automat existiert schon! Schauen Sie bitte in der Auswahl nach!"); endif; else : // * UPDATE * // Get articleitem ID $atiId = getFieldValueFromId("phoenix.articleitem","ati_serialno",$f_su_admin_ati_serialno,"ati_id"); if ($atiId != "" && is_numeric($atiId) && $atiId > 0) : updateStmt("phoenix.articleitem", "ati_id", $atiId, array("at_id", $f_su_admin_at_id, "stk_id", $f_su_admin_stk_id, "ati_data_01", $f_su_admin_ati_data_01, "ati_data_02", $f_su_admin_ati_data_02, "ati_data_03", $f_su_admin_ati_data_03, "ati_data_04", $currentTime, "ati_data_21", $f_su_admin_ati_data_21, "ati_data_22", $f_su_admin_ati_data_22, "ati_data_23", $f_su_admin_ati_data_23, "ati_data_24", $f_su_admin_ati_data_24, "ati_data_28", $f_su_admin_ati_data_28), ""); $doModifyStockarticle = true; // Item is a service unit. Insert stock associated to this item if does not exist $opVal = objectInsertStock("ati", $atiId, $suStockIdParent, "SYSTEM-SERVICEUNIT", getLngt("FA") . $f_su_admin_ati_serialno, $dbConnection); if ($opVal == "-1") : $outReportArray[] = getLngt("Es wurde kein spezielles Objekt bzw. dessen Typ spezifiziert!"); elseif ($opVal == "-2") : $outReportArray[] = getLngt("ACHTUNG! Es existiert kein notwendiges Hauptlager! Bitte den Administrator kontaktieren!"); elseif ($opVal == "-3") : $outReportArray[] = getLngt("ACHTUNG! Die Anlage des Lagerortes konnte nicht durchgeführt werden! Bitte wiederholen bzw. den Administrator kontaktieren!"); endif; // Check for updating stockarticle. Do NOT update the quantities if article item will NEITHER be changed by the article id NOR the stock id! if ($currStkId == $f_su_admin_stk_id && $currAtId == $f_su_admin_at_id) : $doModifyStockarticle = false; endif; $outReportArray[] = getLngt("Die Automatendaten wurden aktualisiert!"); // New offset data are stored, check for displayed checkboxes to be changed if ($f_su_admin_ati_data_28 != $currAtiData28) : $suCheckedByNewOffset = true; endif; else : $outReportArray[] = getLngt("Die Automatendaten wurden NICHT aktualisiert, da der Automat nicht mehr existiert!"); endif; endif; if ($doModifyStockarticle) : // *** Update stock quantity from source stock *** if ($currStkId > "0") : // Get current item quantity of the specified article and source stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $currStkId . "' AND at_id = '" . $currAtId . "'"); if ($stkatItemQuantity > 0) : $stkatItemQuantity = $stkatItemQuantity - 1; if ($stkatItemQuantity > 0) : updateStmt("phoenix.stockarticle","stk_id",$currStkId,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$currAtId."'"); else : deleteStmt("phoenix.stockarticle"," stk_id = '".$currStkId."' AND at_id = '".$currAtId."' "); endif; endif; endif; // *** Update stock quantity from target stock *** if ($f_su_admin_stk_id > "0") : // Get current item quantity of the specified article and target stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $f_su_admin_stk_id . "' AND at_id = '" . $f_su_admin_at_id . "'"); if ($stkatItemQuantity != "") : $stkatItemQuantity = $stkatItemQuantity + 1; endif; if (existsEntry("phoenix.stockarticle",array("stk_id",$f_su_admin_stk_id,"at_id",$f_su_admin_at_id))) : updateStmt("phoenix.stockarticle","stk_id",$f_su_admin_stk_id,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$f_su_admin_at_id."'"); else : insertStmt("phoenix.stockarticle",array("stk_id",$f_su_admin_stk_id,"at_id",$f_su_admin_at_id,"stkat_quantity","1","stkat_itemquantity","1")); endif; endif; endif; if ($suCheckedByNewOffset) : $singleUnitCriticalState = false; // For setting optimization checkbox if at least one cashbox is critical with included threshold offset $singleUnitCriticalArray = getCBsToBeChangedByCriticalState($f_su_admin_ati_serialno, "1"); // $f_su_cb_chkbx_00 if ($singleUnitCriticalArray[0] == 1) : if (!in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_00)) : array_push($f_su_cb_chkbx_00, $f_su_admin_ati_serialno); $singleUnitCriticalState = true; endif; else : if (in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_00)) : $tmpKey = array_search($f_su_admin_ati_serialno, $f_su_cb_chkbx_00); unset($f_su_cb_chkbx_00[$tmpKey]); endif; endif; // $f_su_cb_chkbx_01 if ($singleUnitCriticalArray[1] == 1) : if (!in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_01)) : array_push($f_su_cb_chkbx_01, $f_su_admin_ati_serialno); $singleUnitCriticalState = true; endif; else : if (in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_01)) : $tmpKey = array_search($f_su_admin_ati_serialno, $f_su_cb_chkbx_01); unset($f_su_cb_chkbx_01[$tmpKey]); endif; endif; // $f_su_cb_chkbx_02 if ($singleUnitCriticalArray[2] == 1) : if (!in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_02)) : array_push($f_su_cb_chkbx_02, $f_su_admin_ati_serialno); $singleUnitCriticalState = true; endif; else : if (in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_02)) : $tmpKey = array_search($f_su_admin_ati_serialno, $f_su_cb_chkbx_02); unset($f_su_cb_chkbx_02[$tmpKey]); endif; endif; // $f_su_cb_chkbx_03 if ($singleUnitCriticalArray[3] == 1) : if (!in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_03)) : array_push($f_su_cb_chkbx_03, $f_su_admin_ati_serialno); $singleUnitCriticalState = true; endif; else : if (in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_03)) : $tmpKey = array_search($f_su_admin_ati_serialno, $f_su_cb_chkbx_03); unset($f_su_cb_chkbx_03[$tmpKey]); endif; endif; // $f_su_cb_chkbx_04 if ($singleUnitCriticalArray[4] == 1) : if (!in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_04)) : array_push($f_su_cb_chkbx_04, $f_su_admin_ati_serialno); $singleUnitCriticalState = true; endif; else : if (in_array($f_su_admin_ati_serialno, $f_su_cb_chkbx_04)) : $tmpKey = array_search($f_su_admin_ati_serialno, $f_su_cb_chkbx_04); unset($f_su_cb_chkbx_04[$tmpKey]); endif; endif; // $f_su_chkbx [optimization checkbox] if ($singleUnitCriticalState) : if (!in_array($f_su_admin_ati_serialno, $f_su_chkbx)) : array_push($f_su_chkbx, $f_su_admin_ati_serialno); endif; else : if (in_array($f_su_admin_ati_serialno, $f_su_chkbx)) : $tmpKey = array_search($f_su_admin_ati_serialno, $f_su_chkbx); unset($f_su_chkbx[$tmpKey]); endif; endif; endif; else : $outReportArray[] = getLngt("Es wurde bei der Erfassung kein Standort zugewiesen!"); endif; else : $outReportArray[] = getLngt("Es wurde bei der Erfassung kein Automatentypen selektiert!"); endif; endif; // *************************************** // * Remove data for a service unit item * // *************************************** if ($f_act == "removeDataServiceunit") : $f_su_admin_ati_serialno = trim($f_su_admin_ati_serialno); $currAtiId = getFieldValueFromClause("phoenix.articleitem", "ati_id", "ati_serialno = '" . $f_su_admin_ati_serialno . "'"); $currAtId = getFieldValueFromClause("phoenix.articleitem", "at_id", "ati_serialno = '" . $f_su_admin_ati_serialno . "'"); $currStkId = getFieldValueFromClause("phoenix.articleitem", "stk_id", "ati_serialno = '" . $f_su_admin_ati_serialno . "'"); if ($currAtiId != "") : // Remove existing stocks for service unit $doRemoveSU = true; $stkRemoveArray = getColVectorFromDB2ArrayByClause("phoenix.stock", "stk_id", "stk_obj_type = 'ati' AND stk_obj_id = '" . $currAtiId . "'", "", "", "", $dbConnection); $stkRemoveArrayLen = count($stkRemoveArray); for ($i = 0; $i < $stkRemoveArrayLen; $i++) : // Get children $suStkChildren = getStockChildren($stkRemoveArray[$i], "1"); $suStkChildrenKeys = array_keys($suStkChildren); $suStkChildrenKeysLen = count($suStkChildrenKeys); for ($j = 0; $j < $suStkChildrenKeysLen; $j++) : if (checkStockExistingStockarticle($suStkChildrenKeys[$j], $dbConnection)) : $doRemoveSU = false; break 2; endif; endfor; endfor; if ($doRemoveSU) : // Remove stores (they will be updated by renaming and setting to invisible !!!!) for ($i = 0; $i < $stkRemoveArrayLen; $i++) : deleteStock($stkRemoveArray[$i], $dbConnection); endfor; // Remove item physically deleteStmt("phoenix.articleitem"," ati_id = '" . $currAtiId . "'"); // Modify "stockarticle" regarding "$currStkId" if ($currStkId > "0" && $currAtId > "0") : // Get current item quantity of the specified article and source stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $currStkId . "' AND at_id = '" . $currAtId . "'"); if ($stkatItemQuantity > 0) : $stkatItemQuantity = $stkatItemQuantity - 1; if ($stkatItemQuantity > 0) : updateStmt("phoenix.stockarticle","stk_id",$currStkId,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$currAtId."'"); else : deleteStmt("phoenix.stockarticle"," stk_id = '".$currStkId."' AND at_id = '".$currAtId."' "); endif; endif; endif; $outReportArray[] = getLngt("Der Automat wurde gelöscht!"); else : $outReportArray[] = getLngt("Mindestens ein assoziierter Lagerort zu dem Automat ist nicht leer! Eine Löschung darf in diesem Fall nicht erfolgen!"); endif; else : $outReportArray[] = getLngt("Der zu löschende Automat wurde nicht gefunden!"); endif; endif; // *********************************************** // * Store form data for stock (service station) * // *********************************************** if ($f_act == "storeDataStock") : $f_su_admin_stk_name = trim($f_su_admin_stk_name); $f_su_admin_stk_barcode = trim($f_su_admin_stk_barcode); $f_su_admin_ad_street = trim($f_su_admin_ad_street); $f_su_admin_ad_zipcode = trim($f_su_admin_ad_zipcode); $f_su_admin_ad_city = trim($f_su_admin_ad_city); $f_su_admin_stk_hsno = trim($f_su_admin_stk_hsno); if ($f_su_admin_stk_hsno == "") : $f_su_admin_stk_hsno = "."; endif; if ($f_su_admin_ad_country == "") : $f_su_admin_ad_country = "DE"; endif; // Check for empty entries in address-fields if ($f_su_admin_ad_street != "" && $f_su_admin_ad_zipcode != "" && $f_su_admin_ad_city != "" && $f_su_admin_ad_country != "") : // Check zipcode and city // $addressValidityArray = checkCityZipcode($f_su_admin_ad_zipcode, $f_su_admin_ad_city, $f_su_admin_ad_street); // if ($noValidationOfAddress || $addressValidityArray[0] >= 1) : if (true) : TA("B"); if ($f_su_admin_stk_name != "") : // Check for existing entry in address (because of redundance) $tmpArray = insertAddress($f_su_admin_ad_street, $f_su_admin_ad_zipcode, $f_su_admin_ad_city, "", $f_su_admin_ad_country, true); $ad_id_new = $tmpArray[0]; if ($ad_id_new != "" && is_numeric($ad_id_new) ) : // Get current timestamp $currentTime = getDateTime("0"); // Check for selection of a service unit item if ($f_su_admin_stk_id != "" && is_numeric($f_su_admin_stk_id)) : // Check for existence of the stock name $stkIdToCheck = getFieldValueFromId("stock","stk_name",$f_su_admin_stk_name,"stk_id"); if ($stkIdToCheck == "" || $f_su_admin_stk_id == $stkIdToCheck) : // Check barcode information still existing $stkBarcodeToCheck = getFieldValueFromClause("phoenix.stock", "stk_barcode", "stk_barcode = '" . $f_su_admin_stk_barcode . "' AND stk_id != '" . $f_su_admin_stk_id . "'"); if ($f_su_admin_stk_barcode != "" && $f_su_admin_stk_barcode == $stkBarcodeToCheck) : // Generate info only $outReportArray[] = getLngt("Nur zur Information: Die Standortinfo existiert schon!"); endif; // * UPDATE * updateStmt("phoenix.stock", "stk_id", $f_su_admin_stk_id, array("ad_id", $ad_id_new, "stk_name", $f_su_admin_stk_name, "stk_hsno", $f_su_admin_stk_hsno, "stk_barcode", $f_su_admin_stk_barcode), ""); $outReportArray[] = getLngt("Die Standortdaten wurden aktualisiert!"); else : $outReportArray[] = getLngt("Die neue Standortbezeichnung existiert schon! vergeben Sie bitte einen anderen Namen!"); endif; else : if (!existsEntry("phoenix.stock",array("stk_name",$f_su_admin_stk_name))) : // Get complete path of $rootStockSU. $rootStockSU can have a parent which can be a sub stock, too $newStkPath = "//" . $rootStockSU . "//"; $tmpStkPath = getFieldValueFromId("stock", "stk_id", $rootStockSU, "stk_path"); if ($tmpStkPath != "") : $newStkPath = substr($tmpStkPath,0,-2) . $newStkPath; endif; // * INSERT * insertStmt("phoenix.stock", array("hq_id", $hq_id, "stk_name",$f_su_admin_stk_name, "stk_pre_id", $rootStockSU, "stk_path", $newStkPath, "ad_id", $ad_id_new,"stk_barcode",$f_su_admin_stk_barcode,"stk_modifytime", $currentTime, "stk_visible", "1")); $outReportArray[] = getLngt("Der neue Standort wurde angelegt!"); else : $outReportArray[] = getLngt("Dieser Standort existiert schon! Schauen Sie bitte in der Auswahl!"); endif; endif; else : $outReportArray[] = getLngt("Die Generierung der Adresse hat nicht funktioniert!"); endif; else : $outReportArray[] = getLngt("Die Standortangabe ist leer!"); endif; TA("C"); TA("E"); else : $outReportArray[] = getLngt("Die Postleitzahl passt nicht zu dem angegebenen Ort!"); endif; else : $outReportArray[] = getLngt("Bitte geben Sie die Addressdaten vollständig an!"); endif; endif; // ********************************** // * Store data for a cash box item * // ********************************** if ($f_act == "storeDataCashBox") : $f_cb_admin_ati_serialno = trim($f_cb_admin_ati_serialno); $f_cb_admin_ati_data_01 = trim($f_cb_admin_ati_data_01); $f_cb_admin_ati_data_02 = trim($f_cb_admin_ati_data_02); $currAtId = getFieldValueFromClause("phoenix.articleitem", "at_id", "ati_serialno = '" . $f_cb_admin_ati_serialno . "'"); $currStkId = getFieldValueFromClause("phoenix.articleitem", "stk_id", "ati_serialno = '" . $f_cb_admin_ati_serialno . "'"); $currentTime = getDateTime("0"); if ($f_cb_admin_at_id != "" && is_numeric($f_cb_admin_at_id)) : if ($f_cb_admin_stk_id != "" && is_numeric($f_cb_admin_stk_id)) : $doModifyStockarticle = false; // There could be defined a special stock being parent stock for all service unit (article item) stocks. // Otherwise every service unit will be associated to a special root stock (!!!!) /* $cbStockIdParent = getParameterValue("0", "CASHBOX_STOCK_PARENT_ID", $hq_id); if ($cbStockIdParent == "" || !is_numeric($cbStockIdParent)) : $cbStockIdParent = getParameterValue("0", "CASHBOX_STOCK_PARENT_ID", "0"); if ($cbStockIdParent == "" || !is_numeric($cbStockIdParent)) : $cbStockIdParent = "0"; endif; endif; */ $cbStockIdParent = $cbStockIdParentDefault; // Check for selection of a service unit item if ($f_cb_admin_filter_1 == "") : // * INSERT * if (!existsEntry("phoenix.articleitem",array("ati_serialno",$f_cb_admin_ati_serialno))) : $atiLastInsertId = dbInsert("phoenix.articleitem", array("at_id", $f_cb_admin_at_id, "stk_id", $f_cb_admin_stk_id, "ati_serialno", $f_cb_admin_ati_serialno, "ati_data_01", $f_cb_admin_ati_data_01, "ati_data_02", $f_cb_admin_ati_data_02, "ati_data_03", $f_cb_admin_ati_data_03, "ati_data_04", $currentTime)); if ($atiLastInsertId != "" && is_numeric($atiLastInsertId) && $atiLastInsertId > 0) : $outReportArray[] = getLngt("Die neue Geldkassette wurde eingefügt!"); $doModifyStockarticle = true; // Item is a service unit. Insert stock associated to this item if does not exist $opVal = objectInsertStock("ati", $atiLastInsertId, $cbStockIdParent, "SYSTEM-CASHBOX", getLngt("GK") . $f_cb_admin_ati_serialno, $dbConnection); if ($opVal == "-1") : $outReportArray[] = getLngt("Es wurde kein spezielles Objekt bzw. dessen Typ spezifiziert!"); elseif ($opVal == "-2") : $outReportArray[] = getLngt("ACHTUNG! Es existiert kein notwendiges Hauptlager! Bitte den Administrator kontaktieren!"); elseif ($opVal == "-3") : $outReportArray[] = getLngt("ACHTUNG! Die Anlage des Lagerortes konnte nicht durchgeführt werden! Bitte wiederholen bzw. den Administrator kontaktieren!"); endif; else : $outReportArray[] = getLngt("ACHTUNG! Die Anlage des Automats hat nicht geklappt! Bitte wiederholen bzw. den Administrator kontaktieren!"); endif; else : $outReportArray[] = getLngt("Diese Geldkassette existiert schon! Schauen Sie bitte in der Auswahl nach!"); endif; else : // * UPDATE * // Get articleitem ID $atiId = getFieldValueFromId("phoenix.articleitem","ati_serialno",$f_cb_admin_ati_serialno,"ati_id"); if ($atiId != "" && is_numeric($atiId) && $atiId > 0) : updateStmt("phoenix.articleitem", "ati_id", $atiId, array("at_id", $f_cb_admin_at_id, "stk_id", $f_cb_admin_stk_id, "ati_data_01", $f_cb_admin_ati_data_01, "ati_data_02", $f_cb_admin_ati_data_02, "ati_data_03", $f_cb_admin_ati_data_03, "ati_data_04", $currentTime), ""); $doModifyStockarticle = true; // Item is a service unit. Insert stock associated to this item if does not exist $opVal = objectInsertStock("ati", $atiId, $cbStockIdParent, "SYSTEM-SERVICEUNIT", getLngt("FA") . $f_cb_admin_ati_serialno, $dbConnection); if ($opVal == "-1") : $outReportArray[] = getLngt("Es wurde kein spezielles Objekt bzw. dessen Typ spezifiziert!"); elseif ($opVal == "-2") : $outReportArray[] = getLngt("ACHTUNG! Es existiert kein notwendiges Hauptlager! Bitte den Administrator kontaktieren!"); elseif ($opVal == "-3") : $outReportArray[] = getLngt("ACHTUNG! Die Anlage des Lagerortes konnte nicht durchgeführt werden! Bitte wiederholen bzw. den Administrator kontaktieren!"); endif; // Check for updating stockarticle. Do NOT update the quantities if article item will NEITHER be changed by the article id NOR the stock id! if ($currStkId == $f_cb_admin_stk_id && $currAtId == $f_cb_admin_at_id) : $doModifyStockarticle = false; endif; $outReportArray[] = getLngt("Die Kassettendaten wurden aktualisiert!"); else : $outReportArray[] = getLngt("Die Kassettendaten wurden NICHT aktualisiert, da die Kassette nicht mehr existiert!"); endif; endif; if ($doModifyStockarticle) : // *** Update stock quantity from source stock *** if ($currStkId > "0") : // Get current item quantity of the specified article and source stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $currStkId . "' AND at_id = '" . $currAtId . "'"); if ($stkatItemQuantity > 0) : $stkatItemQuantity = $stkatItemQuantity - 1; if ($stkatItemQuantity > 0) : updateStmt("phoenix.stockarticle","stk_id",$currStkId,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$currAtId."'"); else : deleteStmt("phoenix.stockarticle"," stk_id = '".$currStkId."' AND at_id = '".$currAtId."' "); endif; endif; endif; // *** Update stock quantity from target stock *** if ($f_cb_admin_stk_id > "0") : // Get current item quantity of the specified article and target stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $f_cb_admin_stk_id . "' AND at_id = '" . $f_cb_admin_at_id . "'"); if ($stkatItemQuantity != "") : $stkatItemQuantity = $stkatItemQuantity + 1; endif; if (existsEntry("phoenix.stockarticle",array("stk_id",$f_cb_admin_stk_id,"at_id",$f_cb_admin_at_id))) : updateStmt("phoenix.stockarticle","stk_id",$f_cb_admin_stk_id,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$f_cb_admin_at_id."'"); else : insertStmt("phoenix.stockarticle",array("stk_id",$f_cb_admin_stk_id,"at_id",$f_cb_admin_at_id,"stkat_quantity","1","stkat_itemquantity","1")); endif; endif; endif; else : $outReportArray[] = getLngt("Es wurde bei der Erfassung kein Standort zugewiesen!"); endif; else : $outReportArray[] = getLngt("Es wurde bei der Erfassung kein Automatentypen selektiert!"); endif; endif; // *************************************** // * Remove data for a cash box item * // *************************************** if ($f_act == "removeDataCashBox") : $f_cb_admin_ati_serialno = trim($f_cb_admin_ati_serialno); $currAtiId = getFieldValueFromClause("phoenix.articleitem", "ati_id", "ati_serialno = '" . $f_cb_admin_ati_serialno . "'"); $currAtId = getFieldValueFromClause("phoenix.articleitem", "at_id", "ati_serialno = '" . $f_cb_admin_ati_serialno . "'"); $currStkId = getFieldValueFromClause("phoenix.articleitem", "stk_id", "ati_serialno = '" . $f_cb_admin_ati_serialno . "'"); if ($currAtiId != "") : // Remove existing stocks for service unit $doRemoveCB = true; $stkRemoveArray = getColVectorFromDB2ArrayByClause("phoenix.stock", "stk_id", "stk_obj_type = 'ati' AND stk_obj_id = '" . $currAtiId . "'", "", "", "", $dbConnection); $stkRemoveArrayLen = count($stkRemoveArray); for ($i = 0; $i < $stkRemoveArrayLen; $i++) : // Get children $cbStkChildren = getStockChildren($stkRemoveArray[$i], "1"); $cbStkChildrenKeys = array_keys($cbStkChildren); $cbStkChildrenKeysLen = count($cbStkChildrenKeys); for ($j = 0; $j < $cbStkChildrenKeysLen; $j++) : if (checkStockExistingStockarticle($cbStkChildrenKeys[$j], $dbConnection)) : $doRemoveCB = false; break 2; endif; endfor; endfor; if ($doRemoveCB) : // Remove stores (they will be updated by renaming and setting to invisible !!!!) for ($i = 0; $i < $stkRemoveArrayLen; $i++) : deleteStock($stkRemoveArray[$i], $dbConnection); endfor; // Remove item physically deleteStmt("phoenix.articleitem"," ati_id = '" . $currAtiId . "'"); // Modify "stockarticle" regarding "$currStkId" if ($currStkId > "0" && $currAtId > "0") : // Get current item quantity of the specified article and source stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $currStkId . "' AND at_id = '" . $currAtId . "'"); if ($stkatItemQuantity > 0) : $stkatItemQuantity = $stkatItemQuantity - 1; if ($stkatItemQuantity > 0) : updateStmt("phoenix.stockarticle","stk_id",$currStkId,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$currAtId."'"); else : deleteStmt("phoenix.stockarticle"," stk_id = '".$currStkId."' AND at_id = '".$currAtId."' "); endif; endif; endif; $outReportArray[] = getLngt("Die Geldkassette wurde gelöscht!"); else : $outReportArray[] = getLngt("Mindestens ein assoziierter Lagerort zu der Geldkassette ist nicht leer! Eine Löschung darf in diesem Fall nicht erfolgen!"); endif; else : $outReportArray[] = getLngt("Die zu löschende Geldkassette wurde nicht gefunden!"); endif; endif; // ********************************** // * Store data for a cash box item * // ********************************** if ($f_act == "storeDataCardrolls") : $f_cdr_admin_ati_serialno_from = trim($f_cdr_admin_ati_serialno_from); $f_cdr_admin_ati_serialno_to = trim($f_cdr_admin_ati_serialno_to); if ($f_cdr_admin_ati_serialno_from != "" && is_numeric($f_cdr_admin_ati_serialno_from) && $f_cdr_admin_ati_serialno_to != "" && is_numeric($f_cdr_admin_ati_serialno_to) && $f_cdr_admin_ati_serialno_to >= $f_cdr_admin_ati_serialno_from) : if (($f_cdr_admin_ati_serialno_to - $f_cdr_admin_ati_serialno_from) <= 300) : if ($f_cdr_admin_palette != "" && is_numeric($f_cdr_admin_palette)) : $currentTime = getDateTime("0"); if ($f_cdr_admin_at_id != "" && is_numeric($f_cdr_admin_at_id)) : if ($f_cdr_admin_stk_id != "" && is_numeric($f_cdr_admin_stk_id)) : // Missing serial numbers $f_cdr_admin_ati_serialno_missing = trim($f_cdr_admin_ati_serialno_missing); // $f_cdr_admin_ati_serialno_missing = preg_replace("/[^0-9]/", "," , $f_cdr_admin_ati_serialno_missing); // $f_cdr_admin_ati_serialno_missing = preg_replace("/,+/", ";" , $f_cdr_admin_ati_serialno_missing); $atiSerialnoMissingArray = explode(";", $f_cdr_admin_ati_serialno_missing); $atiSerialnoMissingArrayLen = count($atiSerialnoMissingArray); $countInsertesCardrolls = 0; // if ($f_cdr_admin_filter_1 == "") : // * INSERT * for ($i = $f_cdr_admin_ati_serialno_from; $i <= $f_cdr_admin_ati_serialno_to; $i++) : if ($atiSerialnoMissingArrayLen == 0 || !in_array($i, $atiSerialnoMissingArray)) : if (!existsEntry("phoenix_log.articleitemhistory",array("atih_serialno", $i, "at_id", $f_cdr_admin_at_id))) : $atihLastInsertId = dbInsert("phoenix_log.articleitemhistory", array("at_id", $f_cdr_admin_at_id, "stk_id", $f_cdr_admin_stk_id, "atih_createtime", $currentTime, "atih_serialno", $i, "atih_data_01", $f_cdr_admin_palette, "atih_data_02", $f_cdr_admin_ati_data_02, "atih_data_03", $f_cdr_admin_ati_data_03, "atih_data_04", $currentTime)); if ($atihLastInsertId != "" && is_numeric($atihLastInsertId) && $atihLastInsertId > 0) : $countInsertesCardrolls++; // $outReportArray[] = getLngt("Die folgende Kartenrolle wurde eingefügt!") . " [" . $i . "]"; else : $outReportArray[] = getLngt("ACHTUNG! Die Anlage der folgenden Kartenrolle hat nicht geklappt! Bitte wiederholen bzw. den Administrator kontaktieren!") . " [" . $i . "]"; endif; else : $outReportArray[] = getLngt("Die folgende Kartenrolle existiert schon! Schauen Sie bitte in der Auswahl nach!") . " [" . $i . "]"; endif; endif; endfor; // endif; /* if ($countInsertesCardrolls > 0) : // *** Update stock quantity from source stock *** if ($f_cdr_admin_stk_id > "0") : // Get current item quantity of the specified article and source stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $currStkId . "' AND at_id = '" . $currAtId . "'"); if ($stkatItemQuantity > 0) : $stkatItemQuantity = $stkatItemQuantity - 1; if ($stkatItemQuantity > 0) : updateStmt("phoenix.stockarticle","stk_id",$currStkId,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$currAtId."'"); else : deleteStmt("phoenix.stockarticle"," stk_id = '".$currStkId."' AND at_id = '".$currAtId."' "); endif; endif; endif; // *** Update stock quantity from target stock *** if ($f_cb_admin_stk_id > "0") : // Get current item quantity of the specified article and target stock $stkatItemQuantity = getFieldValueFromClause("stockarticle", "stkat_itemquantity", "stk_id = '" . $f_cb_admin_stk_id . "' AND at_id = '" . $f_cb_admin_at_id . "'"); if ($stkatItemQuantity != "") : $stkatItemQuantity = $stkatItemQuantity + 1; endif; if (existsEntry("phoenix.stockarticle",array("stk_id",$f_cb_admin_stk_id,"at_id",$f_cb_admin_at_id))) : updateStmt("phoenix.stockarticle","stk_id",$f_cb_admin_stk_id,array("stkat_quantity",$stkatItemQuantity,"stkat_itemquantity",$stkatItemQuantity),"at_id = '".$f_cb_admin_at_id."'"); else : insertStmt("phoenix.stockarticle",array("stk_id",$f_cb_admin_stk_id,"at_id",$f_cb_admin_at_id,"stkat_quantity","1","stkat_itemquantity","1")); endif; endif; endif; */ else : $outReportArray[] = getLngt("Es wurde bei der Erfassung kein Standort selektiert!"); endif; else : $outReportArray[] = getLngt("Es wurde bei der Erfassung kein Kartenrollentype selektiert!"); endif; else : $outReportArray[] = getLngt("Die Gebindeangabe ist nicht numerisch!"); endif; else : $outReportArray[] = getLngt("Die Maximalgröße von 300 wurde überschritten!"); endif; endif; endif; // Set the global master array and get special array for geo-coordinates of the current selected service units (selected by checkboxes) // This has to be called after storing the form data (!!!) getPersistentStates("2"); // *************************************************** // * Process specified action for a specified object * // *************************************************** // if ($f_act == "processAction") : if ($f_actionObjType != "" && $f_actionObjId != "" && $f_actionID != "") : if ($f_actionObjType = "ati_serialno") : if ($f_actionID == "101") : // Get position on map // ... elseif ($f_actionID == "102") : // Get log events // getLogData("log.logo_id = '1000' AND log.id_01 = '" . $f_actionObjId . "'"); getSuHistoryData("0", "AND stk.stk_pre_id = '" . $rootStockSU . "' AND atih.atih_serialno = '" . $f_actionObjId . "'"); if ($f_act == "processAction") : $maskDisplay01Switch = "0"; $maskDisplay02Switch = "0"; $maskDisplay03Switch = "0"; $maskDisplay04Switch = "1"; $maskDisplay05Switch = "0"; $maskDisplay06Switch = "0"; $maskDisplay07Switch = "0"; $maskDisplay08Switch = "0"; $maskDisplay09Switch = "0"; endif; elseif ($f_actionID == "103") : // Get service jobs $f_jb_filter_2 = $f_actionObjId; // Set filter for service jobs regarding the serialnumber of the service unit // getServiceJoblist(); // Will be called later including this filter !!! if ($f_act == "processAction") : $maskDisplay01Switch = "0"; $maskDisplay02Switch = "0"; $maskDisplay03Switch = "1"; $maskDisplay04Switch = "0"; $maskDisplay05Switch = "0"; $maskDisplay06Switch = "0"; $maskDisplay07Switch = "0"; $maskDisplay08Switch = "0"; $maskDisplay09Switch = "0"; endif; resetActionParameters(); elseif ($f_actionID == "104") : getSuMessageData($f_actionObjId); if ($f_act == "processAction") : $maskDisplay01Switch = "0"; $maskDisplay02Switch = "0"; $maskDisplay03Switch = "0"; $maskDisplay04Switch = "0"; $maskDisplay05Switch = "1"; $maskDisplay06Switch = "0"; $maskDisplay07Switch = "0"; $maskDisplay08Switch = "0"; $maskDisplay09Switch = "0"; endif; elseif ($f_actionID == "105") : // Set form fields for the administration $f_su_admin_filter_1 = $f_actionObjId; // Set filter for administration of the service unit $jsExecBodyOnLoadArray[2] = "1"; // Set service unit form data according to $f_actionObjId if ($f_act == "processAction") : $jsExecBodyOnLoadArray[0] = "1"; // Set form by "body onLoad" $maskDisplay01Switch = "0"; $maskDisplay02Switch = "0"; $maskDisplay03Switch = "0"; $maskDisplay04Switch = "0"; $maskDisplay05Switch = "0"; $maskDisplay06Switch = "1"; $maskDisplay07Switch = "0"; $maskDisplay08Switch = "0"; $maskDisplay09Switch = "0"; endif; resetActionParameters(); endif; endif; // else : // $outReportArray[] = getLngt("Die gewählte Aktion konnte nicht ausgeführt werden, da nicht alle Angaben gesetzt wurden!"); endif; // $f_act = ""; // Init // endif; // ***************************************** // * Save state of the selected checkboxes * // ***************************************** if ($f_act == "savePT" || $f_act == "optimizePT") : // Remove existing persistent states // ONLY do this if ALL service units are displayed (!!!) // OTHERWISE it is NOT necessary because the delta if ($f_pt_filter_1 == "0") : $sqlStmt = "UPDATE phoenix.articleitem SET ati_data_20 = '0' WHERE stk_id IN (SELECT stk_id FROM stock WHERE stk_pre_id = '" . $rootStockSU . "')"; $res = $db->query($sqlStmt); if (DB::isError($res)) : die ("$PHP_SELF: " . $res->getMessage()); endif; endif; // Update checked service unit checkboxes and cashbox checkboxes and article message checkboxes if ($f_su_chkbx_len > 0) : for ($i = 0; $i < $f_su_chkbx_len; $i++) : // Service unit (important vector for optimization) updateStmt("phoenix.articleitem", "ati_serialno", decodeSpecialChars($f_su_chkbx[$i]), array("ati_data_20", "1")); // All cashbox checkboxes of the specified service unit $tmpSuCbChkbxArr = array((in_array($f_su_chkbx[$i], $f_su_cb_chkbx_00) ? "1" : ""), (in_array($f_su_chkbx[$i], $f_su_cb_chkbx_01) ? "1" : ""), (in_array($f_su_chkbx[$i], $f_su_cb_chkbx_02) ? "1" : ""), (in_array($f_su_chkbx[$i], $f_su_cb_chkbx_03) ? "1" : ""), (in_array($f_su_chkbx[$i], $f_su_cb_chkbx_04) ? "1" : "")); updateStmt("phoenix.articleitem", "ati_serialno", decodeSpecialChars($f_su_chkbx[$i]), array("ati_data_27", implode(",", $tmpSuCbChkbxArr))); // Message checkboxes of the specified service unit $atiData29Val = ""; if (in_array($f_su_chkbx[$i], $f_su_atm_chkbx)) : // updateStmt("phoenix.articleitem", "ati_serialno", $f_su_atm_chkbx[$i], array("ati_data_29", "1")); $atiData29Val = "1"; endif; updateStmt("phoenix.articleitem", "ati_serialno", decodeSpecialChars($f_su_chkbx[$i]), array("ati_data_29", $atiData29Val)); endfor; endif; endif; // ********************** // * Optimize tour data * // ********************** if ($f_act == "optimizePT") : $optimizationDisabled = getParameterValue("0", "OPTIMIZATION_DISABLED", $hq_id); if ($optimizationDisabled == "") : $optimizationDisabled = getParameterValue("0", "OPTIMIZATION_DISABLED", "0"); endif; if ($optimizationDisabled != "1") : // Presently no restrictions regarding to the optimization !!!!!!!!!!!! // * Optimization process by server * $usedVehicleNumberArray = array(); for ($j = 1; $j <= $maxNumOfTours; $j++) : if (count($suRoutePlanningArray[$j]) > 0) : $usedVehicleNumberArray[] = $j; // E.g. ONE vehicle only, but it is the vehicle "3" endif; endfor; // Get potential coordinates of the start and/or end of all tours // Start coordinates $coordinatesStart = getParameterValue("0", "OPTIMIZATION_COORDINATES_START", $hq_id); $coordinatesStartArray = array(); if ($coordinatesStart != "") : $coordinatesStartArray = explode(",", $coordinatesStart); endif; $coordinatesStartArrayLen = count($coordinatesStartArray); // End coordinates $coordinatesEnd = getParameterValue("0", "OPTIMIZATION_COORDINATES_END", $hq_id); $coordinatesEndArray = array(); if ($coordinatesEnd != "") : $coordinatesEndArray = explode(",", $coordinatesEnd); endif; $coordinatesEndArrayLen = count($coordinatesEndArray); // Iterate tours to be created for each vehicle (vehicle #1, vehicle #2, ...) $usedVehicleNumberArrayLen = count($usedVehicleNumberArray); // Remove old persistent optimization states in "ati.ati_data_19" if ($usedVehicleNumberArrayLen > 0) : $sqlStmt = "UPDATE phoenix.articleitem SET ati_data_19 = '' WHERE stk_id IN (SELECT stk_id FROM stock WHERE stk_pre_id = '" . $rootStockSU . "')"; $res = $db->query($sqlStmt); if (DB::isError($res)) : die ("$PHP_SELF: " . $res->getMessage()); endif; endif; // Iterate all selected vehicles for ($j = 0; $j < $usedVehicleNumberArrayLen; $j++) : $tmpVehicleNum = $usedVehicleNumberArray[$j]; $suRoutePlanningArrayLen = count($suRoutePlanningArray[$tmpVehicleNum]); if ($suRoutePlanningArrayLen > 0) : // Add start and/or end coordinates if exist $tmpLen = 0; if ($coordinatesStartArrayLen > 0) : $suRoutePlanningArray[$tmpVehicleNum] = array_merge(array($coordinatesStartArray), $suRoutePlanningArray[$tmpVehicleNum]); endif; if ($coordinatesEndArrayLen > 0) : $suRoutePlanningArray[$tmpVehicleNum] = array_merge($suRoutePlanningArray[$tmpVehicleNum], array($coordinatesEndArray)); $tmpLen = 1; endif; // Trigger optimization process // Data structure in "$suRoutePlanningArray[$tmpVehicleNum]": array(array("92845", "10.241763", "53.661418"), array("92730", "10.064445", "53.586847"), ...) // Set last element of the list to be optimized as target address // $tmpLen = count($suRoutePlanningArray[$tmpVehicleNum]); if ($optimizationDisabled != "1") : $suRouteOptimizedArray[$tmpVehicleNum] = XSplanTourId($suRoutePlanningArray[$tmpVehicleNum], $tmpLen); // print_r($suRoutePlanningArray[$tmpVehicleNum]); echo "    " . $tmpLen; echo "
\n"; else : $suRouteOptimizedArray = $suRoutePlanningArray; endif; // print_r($suRoutePlanningArray[$tmpVehicleNum]); echo "    " . $tmpLen; echo "
\n"; $suRouteOptimizedArrayLen = count($suRouteOptimizedArray[$tmpVehicleNum]); if ($suRouteOptimizedArrayLen > 0) : // Store optimization sort in table "articleitem" if ($suRouteOptimizedArrayLen > 0) : for ($i = 0; $i < $suRouteOptimizedArrayLen; $i++) : if (!( ($i == 0 && $coordinatesStartArrayLen > 0) || ($i == $suRouteOptimizedArrayLen && $coordinatesEndArrayLen > 0) )) : updateStmt("phoenix.articleitem", "ati_serialno", decodeSpecialChars($suRouteOptimizedArray[$tmpVehicleNum][$i][0]), array("ati_data_19", $constLngOutputTourChars . pad($tmpVehicleNum, 2, "0") . "-" . pad($i, 2, "0"))); endif; endfor; endif; else : $outReportArray[] = getLngt("Tour") . " " . $tmpVehicleNum . ": " . getLngt("Die Optimierung schlug fehl! Der Rückgabevektor ist leer!"); endif; else : $outReportArray[] = getLngt("Tour") . " " . $tmpVehicleNum . ": " . getLngt("Die Optimierung wurde mangels Geo-Koordinaten nicht durchgeführt!"); endif; endfor; // After at least one optimization the button for displaying the (currrent optimized) tours will be enabled $f_map_is_active = "1"; endif; endif; // Get current persistent states of the service units getPersistentStates(); // ************************************************ // * Make job from persistent optimization vector * // ************************************************ if ($f_act == "makeJobPT") : // Get current timestamp $currentTime = getDateTime("0"); $currentDate = getDateTime("3"); // Init fix values for all jobs $cscIdPayer = getParameterValue("0", "CSC_ID_PAYER_DEFAULT", $hq_id); if ($cscIdPayer != "" && is_numeric($cscIdPayer)) : $cscId = "0"; $jbOrdertime = $currentTime; $jbCrFilter = ""; $jbStatus = "9"; $jbType = ""; $jbTourname = ""; $fixprice = "0"; $cmpPostage = "0"; $csInvmode = ""; $jbCrvhWeight = ""; $jbCrvhLength = ""; $jbCrvhWidth = ""; $jbCrvhHeight = ""; $jbCrvhPosition = ""; $jbTourdata = ""; $cscIdExternal = getParameterValue("0", "CSC_ID_PAYER_EXTERN", $hq_id); // $txValue = getFieldValueFromId("tax","tx_id","1","tx_value"); // $txSign = getFieldValueFromId("tax","tx_id","1","tx_sign"); $txValue = "1"; $txSign = "0"; // Get required vehicles from the persistent state of the optimized tours $usedVehicleNumberArray = array(); $tmpOptimizedTourArray = getColVectorFromDB2ArrayByClause("phoenix.articleitem", "ati_data_19", "ati_data_19 != ''", "", "", ""); $tmpOptimizedTourArrayLen = count($tmpOptimizedTourArray); for ($j = 0; $j < $tmpOptimizedTourArrayLen; $j++) : $tmpArray = spliti("-", $tmpOptimizedTourArray[$j]); $tmpTourNo = $tmpArray[0]; $tmpTourNo = substr($tmpTourNo, strlen($constLngOutputTourChars)); $x = array_search($tmpTourNo, $usedVehicleNumberArray); if ($x === FALSE) : $usedVehicleNumberArray[] = $tmpTourNo; endif; endfor; sort($usedVehicleNumberArray); // The array e.g. contains ("01", "02", "03") [<=> tour numbers] $usedVehicleNumberArrayLen = count($usedVehicleNumberArray); // Iterate all vehicles to get a job for their tour if ($usedVehicleNumberArrayLen > 0) : // **** RESET CURRENT DAY (START) **** TA("B"); // Reset vehicledisposition for the current day updateStmt("phoenix.vehicledisposition","","",array("jb_id","0"),"LEFT(vhd_timeslot,10) = '" . $currentDate . "' AND jb_id != '0'"); // Get default customer ID (cs_id) for disposition in FDS regarding customer vehicle relation in "customervehicle" $csId = getParameterValue("0", "FDS_CS_CRVH_RELATION_DEFAULT_CUSTOMER", "0"); if ($csId == "") : $csId = "829067"; endif; // Get the vehicles for the current customer $crvhList = array(); $sqlquery = getStmtCustomerVehicleRelation("", $csId); $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); while ($row = $result->fetch_assoc()): $crvhList[] = $row["crvh_id"]; endwhile; $result->free(); $crvhListLen = count($crvhList); // Check for each vehicle displayed the existence of entries in "vehicledisposition", "vehicleavailability" and "vehicleavailabilitytimeunits". // If it does not exist then generate it to handle the drag and dropping the jobs etc. for ($v = 0; $v < $crvhListLen; $v++) : updateAllCsVehicleAvailability($crvhList[$v], $csId, $currentDate, $hourTimeUnits); endfor; // Storno $res = updateStmt("job", "", "", array("jb_storno", "2", "usr_id_storno", $usr_id, "jb_status" , "2", "jb_finishtime", $currentTime), "(LEFT(jb_ordertime, 10) = '" . $currentDate . "' AND (jb_status = '8' OR jb_status = '9' OR jb_status = '0' OR jb_status = '1') AND (isnull(jb_storno) OR jb_storno = '0'))"); if ($db->affected_rows > 0) : // Write logdata into log database // writeToLogDB("10",$hq_id,"",$usr_id,"","","",""); endif; TA("C"); TA("E"); // **** RESET CURRENT DAY (END) **** for ($j = 0; $j < $usedVehicleNumberArrayLen; $j++) : $tmpVehicleNum = $usedVehicleNumberArray[$j]; // It is a pad value like "01", "02", "03", ... !!! // Get persistent optimized vector of service unit data $tmpStrLen = strlen($constLngOutputTourChars) + strlen($tmpVehicleNum); $sqlStmt = getStmtGenericStockArticleItems("0", $rootStockSU, "", "1", "ati.ati_data_19 != '' AND LEFT(ati.ati_data_19, " . $tmpStrLen . ") = '" . $constLngOutputTourChars . $tmpVehicleNum . "'", "", "ati.ati_data_19", ""); if ($sqlStmt != "") : $result = $db->query($sqlStmt); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); if ($result->numRows() > 0) : TA("B"); $crId = $mappedCourierArray[$f_tour_crvh_assoc[intval($tmpVehicleNum)]]; // $f_tour_crvh_assoc contains manuel mapping (tour.no => vehicle.no) by user (!!!!) if ($crId != "") : $crIdOrder = $crId; $crvhId = getFieldValueFromId("couriervehicle","cr_id",$crId,"crvh_id"); $vhtId = getFieldValueFromId("couriervehicle","crvh_id",$crvhId,"vht_id"); $crSid = getFieldValueFromId("couriervehicle","crvh_id",$crvhId,"crvh_sid"); $jbRemark = ""; if ($globalParUseRelatedCustomer == "1") : // **** One separate job for each service unit **** // Remove existing cartage note of the vehicle of the day to write new jobs to a new cartage note if ($csId != "" && is_numeric($csId)) : // ....... !!!!!!!!!!!!!!! ....... // $retBool = removeAssocCrvhJb($jbId, $csId, $hourTimeUnits); endif; // Create job data $counter = 0; while ($row = $result->fetch_assoc()): // $checkTime = getDateTime("datetime_plus_offset", array(0,0,0,0,-($constAmStarttimeInDays),0), "Y-m-d") . " 00:00:00"; // $retVal = date($formatStr, mktime(date("H")+$dateTimeArray[0],date("i")+$dateTimeArray[1],date("s")+$dateTimeArray[2],date("m")+$dateTimeArray[3],date("d")+$dateTimeArray[4],date("Y")+$dateTimeArray[5])); $timeslots = 4; /* $hour = (1 + $counter); $hourUnit = 0; $jbOrdertime = $currentDate . " " . pad(strval($hour),2) . ":" . pad(strval($hourUnit),2) . ":00"; */ $minutesPerJob = $timeslots * floor(60 / $hourTimeUnits); $startTimeMinutes = ($minutesPerJob * $counter); $hour = floor($startTimeMinutes / 60); $minutesRest = $startTimeMinutes - ($hour * 60); $hourUnit = strval(ceil($minutesRest * ($hourTimeUnits / 60))); // Convert minute to time unit $hour++; $jbOrdertime = $currentDate . " " . pad(strval($hour),2) . ":" . pad(strval($minutesRest),2) . ":00"; $jbDispoinfo = $row["ati_data_25"]; // Create general job data insertStmt("job", array("hq_id", $hq_id, "csc_id", $cscId, "vht_id", $vhtId, "csc_id_payer", $cscIdPayer, "csc_id_related", $cscIdPayer, "jb_payment", "0", "jb_ordertime", $jbOrdertime, "cr_id", $crId, "cr_sid", $crSid, "cr_id_order", $crIdOrder, "jb_cr_filter", $jbCrFilter, "jb_cr_filter_opt", "", "jb_waitstorno", "0", "jb_taketime", "", "jb_status", $jbStatus, "jb_autoranking", "0", "jb_type", $jbType, "jb_incomplete", "0", "jb_globaljob", "0", "jb_tourname", $jbTourname, "jb_finishtime", "", "emp_id", $usr_id, "jb_fixprice", $fixprice, "jb_totalprice", $fixprice, "jb_postage", $cmpPostage, "jb_invmode", $csInvmode, "jb_freetext_1", "", "jb_weight", $jbCrvhWeight, "jb_crvh_length", $jbCrvhLength, "jb_crvh_width", $jbCrvhWidth, "jb_crvh_height", $jbCrvhHeight, "jb_crvh_position", $jbCrvhPosition, "jb_invtext", $jbRemark, "jb_tourdata", $jbTourdata, "jb_lockuser", "0", "jb_id_parent", "0", "jb_dispoinfo", $jbDispoinfo, "jb_sales_tax_rate", $txValue, "jb_timeunits", $timeslots, "jb_service", "1", "jb_sales_tax_rate_sign", $txSign, "jb_booktime", "")); $jbIdNew = getLastInsertId(); // echo "counter = " . $counter . " | " . "minutesPerJob = " . $minutesPerJob . " | " . "startTimeMinutes = " . $startTimeMinutes . " | " . "hour = " . $hour . " | " . "minutesRest = " . $minutesRest . " | " . "hourUnit = " . $hourUnit . " | " . "jbIdNew = " . $jbIdNew . " | " . "jbOrdertime = " . $jbOrdertime . "
\n"; // Insert tour data for station 1 (it will be the same for every job (!!!!)) insertStmt("tour", array("jb_id", $jbIdNew, "ad_id", $adId, "tr_sort", "1", "tr_comp", "", "tr_comp2", "", "tr_hsno", ".", "csc_id", $cscIdPayer, "tr_status", "0", "tr_commission_no", "", "tr_ware_from_to", "", "tr_person", "", "tr_phone", "", "tr_remark", "")); // Get state of the service unit $tmpAtiSerialno = $row["ati_serialno"]; $tmpAtiArray = getFieldsValueFromId("articleitem","ati_serialno",$row["ati_serialno"],array("at_id","ati_data_17","ati_data_05","ati_data_06","ati_data_07","ati_data_08","ati_data_09","ati_data_29","ati_data_26","ati_data_04")); $tmpAtId = $tmpAtiArray[0]; $tmpAtimCodes = $tmpAtiArray[1]; $tmpAtiData05 = $tmpAtiArray[2]; $tmpAtiData06 = $tmpAtiArray[3]; $tmpAtiData07 = $tmpAtiArray[4]; $tmpAtiData08 = $tmpAtiArray[5]; $tmpAtiData09 = $tmpAtiArray[6]; $tmpAtiData29 = $tmpAtiArray[7]; $tmpAtiData26 = $tmpAtiArray[8]; // Get amount increase values $tmpAtiData04 = $tmpAtiArray[9]; // Import date with existimg data // **** Check for old date or prediction state [START] **** $atGroup = getFieldValueFromId("phoenix.article", "at_id", $tmpAtId, "at_group"); // Check days having access regarding special costcenter (!!!!) $executeRegardingCscNoBookingDay = checkEcecutionStateRegardingCscNoBookingDay($atGroup); // Increase amounts for array ($dataSU[5], $dataSU[6], $dataSU[7], $dataSU[8], $dataSU[9], ....) $amountIncreaseArray = explode(",", $tmpAtiData26); // Check data missing by service. The timestamp would not be the current date if ($executeRegardingCscNoBookingDay && is_array($f_tv[$atId]) && count($f_tv[$atId]) > 0) : $tmpDataSU4 = substr($tmpAtiData04,0,10); $importDaysDiff = mcDateDiff($tmpDataSU4, $currentDate); if ($tmpDataSU4 != "" && $importDaysDiff > 0) : $tmpAtiData05 = cbIncreaseAmountByInterval($tmpAtiData05, $tmpDataSU4, $amountIncreaseArray[0], $f_tv[$tmpAtId][4], $tmpAtiSerialno); $tmpAtiData06 = cbIncreaseAmountByInterval($tmpAtiData06, $tmpDataSU4, $amountIncreaseArray[1], $f_tv[$tmpAtId][2], $tmpAtiSerialno); $tmpAtiData07 = cbDecreaseAmountByInterval($tmpAtiData07, $tmpDataSU4, $amountIncreaseArray[2], $f_tv[$tmpAtId][5], $tmpAtiSerialno); $tmpAtiData08 = cbDecreaseAmountByInterval($tmpAtiData08, $tmpDataSU4, $amountIncreaseArray[3], $f_tv[$tmpAtId][6], $tmpAtiSerialno); $tmpAtiData09 = cbDecreaseAmountByInterval($tmpAtiData09, $tmpDataSU4, $amountIncreaseArray[4], $f_tv[$tmpAtId][7], $tmpAtiSerialno); endif; endif; // Check for requested prediction and compute future values if ($executeRegardingCscNoBookingDay && $predictionDays > 0 && is_array($f_tv[$atId]) && count($f_tv[$atId]) > 0) : $tmpAtiData05 = cbIncreaseAmountByInterval($tmpAtiData05, $predictionDate, $amountIncreaseArray[0], $f_tv[$tmpAtId][4], $tmpAtiSerialno); $tmpAtiData06 = cbIncreaseAmountByInterval($tmpAtiData06, $predictionDate, $amountIncreaseArray[1], $f_tv[$tmpAtId][2], $tmpAtiSerialno); $tmpAtiData07 = cbDecreaseAmountByInterval($tmpAtiData07, $predictionDate, $amountIncreaseArray[2], $f_tv[$tmpAtId][5], $tmpAtiSerialno); $tmpAtiData08 = cbDecreaseAmountByInterval($tmpAtiData08, $predictionDate, $amountIncreaseArray[3], $f_tv[$tmpAtId][6], $tmpAtiSerialno); $tmpAtiData09 = cbDecreaseAmountByInterval($tmpAtiData09, $predictionDate, $amountIncreaseArray[4], $f_tv[$tmpAtId][7], $tmpAtiSerialno); endif; // **** Check for old date or prediction state [END] **** // Get names of each CB type regarding the current SU type // Each CB type contains the reference $tmpCbTypeIDs = getParameterValue("0", "SU_CB_TYPES_" . $tmpAtId, $hq_id); $tmpCbTypeIDArr = explode(",", $tmpCbTypeIDs); $tmpCbTypeIDArrLen = count($tmpCbTypeIDArr); $tmpCbTypeNameArr = array("","","","","","","","","",""); for ($cb = 0; $cb < $tmpCbTypeIDArrLen; $cb++) : if (is_numeric($tmpCbTypeIDArr[$cb])) : $tmpCbTypeNameArr[$cb] = getFieldValueFromId("phoenix.article", "at_id", $tmpCbTypeIDArr[$cb], "at_match"); endif; endfor; $trPerson = ""; $trRemark = ""; $trRemark .= ($tmpCbTypeNameArr[0] != "" ? $tmpCbTypeNameArr[0] : getLngt("BEK")) . ": " . number_format($tmpAtiData05, 2, ",", ".") . "|"; $trRemark .= ($tmpCbTypeNameArr[1] != "" ? $tmpCbTypeNameArr[1] : getLngt("MEK")) . ": " . number_format($tmpAtiData06, 2, ",", ".") . "|"; $trRemark .= ($tmpCbTypeNameArr[2] != "" ? $tmpCbTypeNameArr[2] : getLngt("H1")) . ": " . number_format($tmpAtiData07, 2, ",", ".") . "|"; $trRemark .= ($tmpCbTypeNameArr[3] != "" ? $tmpCbTypeNameArr[3] : getLngt("H2")) . ": " . number_format($tmpAtiData08, 2, ",", ".") . "|"; $trRemark .= ($tmpCbTypeNameArr[4] != "" ? $tmpCbTypeNameArr[4] : getLngt("Dispenser")) . ": " . number_format($tmpAtiData09, 0, ",", "."); $trSort = "2"; // Get elements of a specified service unit to be critical // $trPerson = getCBsToBeChangedByCriticalState($row["ati_serialno"]); $tmpMarkerArray = getCBsToBeChangedByMarker($row["ati_serialno"]); $tmpMarkerArrayLen = count($tmpMarkerArray); $serviceByCriticalMsg = array(); if ($tmpAtId != "" && $tmpAtimCodes != "") : $tmpAtimCodesArray = explode(",", $tmpAtimCodes); $tmpAtimCodesArrayLen = count($tmpAtimCodesArray); for ($k = 0; $k < $tmpAtimCodesArrayLen; $k++) : $tmpAtimCode = $tmpAtimCodesArray[$k]; $tmpAtimDesc = getFieldValueFromClause("articlemessage","atm_desc","at_id = '" . $tmpAtId . "' AND atm_code = '" . $tmpAtimCode . "'"); $tmpAtimShorttext = getFieldValueFromClause("articlemessage","atm_shorttext","at_id = '" . $tmpAtId . "' AND atm_code = '" . $tmpAtimCode . "'"); $tmpAtimText = getFieldValueFromClause("articlemessage","atm_text","at_id = '" . $tmpAtId . "' AND atm_code = '" . $tmpAtimCode . "'"); if ($trRemark != "") : $trRemark .= "|"; endif; // $trRemark .= "[" . ($k + 1) . ".] " . $tmpAtimCode . ": " . $tmpAtimDesc . " | => " . $tmpAtimText; $trRemark .= "[" . ($k + 1) . ".] " . $tmpAtimText; if (in_array($tmpAtimCode, $criticalMessageArray)) : $serviceByCriticalMsg[] = $tmpAtimShorttext; endif; if ($tmpAtiData29 == "1") : for ($d = 0; $d < $displayMessageArrayLen; $d++) : if ($displayMessageArray[$d][1] == $tmpAtimCode) : array_push($tmpMarkerArray, $displayMessageArray[$d][2] . "=1"); // E.g. "H1=1" break 1; endif; endfor; $tmpMarkerArrayLen = count($tmpMarkerArray); endif; endfor; endif; // Set "jb_service" $serviceByCriticalMsgLen = count($serviceByCriticalMsg); if ($serviceByCriticalMsgLen > 0) : $jbService = "1"; if ($tmpMarkerArrayLen > 0) : $jbService = "3"; else : $jbService = "2"; endif; updateStmt("job", "jb_id", $jbIdNew, array("jb_service", $jbService), ""); endif; $trPerson = implode("|", $tmpMarkerArray); $trCsFreetext = implode(",", $serviceByCriticalMsg); // Fix text depending on "at_id" => "parameter" (!!!!) if ($tmpAtId == "4327") : $trRemark = "[TEXT]B+R Anlage überprüfen"; endif; // Insert tour data for station insertStmt("tour", array("jb_id", $jbIdNew, "ad_id", $row["ad_id"], "tr_sort", $trSort, "tr_comp", $row["ati_serialno"], "tr_comp2", $row["ati_data_01"], "tr_hsno", $row["stk_hsno"], "csc_id", $cscIdExternal, "tr_status", "0", "tr_commission_no", $row["ati_serialno"], "tr_ware_from_to", "", "tr_person", $trPerson, "tr_phone", "", "tr_remark", $trRemark, "tr_mediationarea_id", $row["stk_id"], "tr_mediationarea_name", $row["stk_name"], "tr_cs_freetext", $trCsFreetext)); $trIdNew = getLastInsertId(); if ($trIdNew != "" && is_numeric($trIdNew)) : // Insert tourservice data $tmpSuSingleChargingLevels = ""; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_00)) : $tmpSuSingleChargingLevels .= ($tmpCbTypeNameArr[0] != "" ? $tmpCbTypeNameArr[0] : getLngt("BEK")) . number_format($row["ati_data_05"], 0, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_01)) : $tmpSuSingleChargingLevels .= ($tmpCbTypeNameArr[1] != "" ? $tmpCbTypeNameArr[1] : getLngt("MEK")) . number_format($row["ati_data_06"], 2, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_02)) : $tmpSuSingleChargingLevels .= ($tmpCbTypeNameArr[2] != "" ? $tmpCbTypeNameArr[2] : getLngt("H1")) . number_format($row["ati_data_07"], 0, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_03)) : $tmpSuSingleChargingLevels .= ($tmpCbTypeNameArr[3] != "" ? $tmpCbTypeNameArr[3] : getLngt("H2")) . number_format($row["ati_data_08"], 2, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_04)) : $tmpSuSingleChargingLevels .= ($tmpCbTypeNameArr[4] != "" ? $tmpCbTypeNameArr[4] : getLngt("Dispenser")) . number_format($row["ati_data_09"], 0, ",", "."); endif; $tmpSuChargingLevelSum = 0; $tmpSuWeightOfChargingLevelSum = 0; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_00) && $row["ati_data_05"] != "" && is_numeric($row["ati_data_05"])) : $tmpSuChargingLevelSum += $row["ati_data_05"]; if (!(strpos($row["at_group"], ",6,") === FALSE)) : // Check for being safebag $tmpSuWeightOfChargingLevelSum += 1; else : $tmpSuWeightOfChargingLevelSum += ($row["ati_data_05"] / $cbWeightFactors[0]); endif; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_01) && $row["ati_data_06"] != "" && is_numeric($row["ati_data_06"])) : $tmpSuChargingLevelSum += $row["ati_data_06"]; if (!(strpos($row["at_group"], ",6,") === FALSE)) : // Check for being safebag $tmpSuWeightOfChargingLevelSum += 1; else : $tmpSuWeightOfChargingLevelSum += ($row["ati_data_06"] / $cbWeightFactors[1]); endif; endif; // if (in_array($row["ati_serialno"], $f_su_cb_chkbx_02) && $row["ati_data_07"] != "" && is_numeric($row["ati_data_07"])) : $tmpSuChargingLevelSum += $row["ati_data_07"]; endif; // if (in_array($row["ati_serialno"], $f_su_cb_chkbx_03) && $row["ati_data_08"] != "" && is_numeric($row["ati_data_08"])) : $tmpSuChargingLevelSum += $row["ati_data_08"]; endif; // if (in_array($row["ati_serialno"], $f_su_cb_chkbx_04) && $row["ati_data_09"] != "" && is_numeric($row["ati_data_09"])) : $tmpSuChargingLevelSum += $row["ati_data_09"]; endif; insertStmt("tourservice", array("jb_id", $jbIdNew, "csc_id", $cscIdPayer, "tr_sort", $trSort, "srv_id", "0", "trs_srv_name", getLngt("Geldbestand"), "srvt_id", "0", "trs_srvt_name", "", "trs_price", $tmpSuChargingLevelSum)); // Insert tourarticle insertStmt("tourarticle", array("jb_id", $jbIdNew, "tr_id", $trIdNew, "tr_sort", $trSort, "trat_name", $row["ati_serialno"], "trat_serialno", $row["ati_serialno"], "trat_weight", $tmpSuWeightOfChargingLevelSum, "trat_createtime", $currentTime)); $tratIdNew = getLastInsertId(); // Insert tourarticleprocess // Store snapshot of the current data in articleitem of the current service unit /* if ($tratIdNew != "" && is_numeric($tratIdNew)) : // [tratp_type == "5" <=> ati_data_05 <=> e.g. BEK, tratp_type == "6" <=> ati_data_06 <=> e.g. MEK, etc.] // for ($k = 1; $k <= $maxNumOfAtiDataFields; $k++) : for ($k = 5; $k <= 9; $k++) : insertStmt("tourarticleprocess", array("trat_id", $tratIdNew, "tratp_type", $k, "tratp_state", "0", "tratp_remark", $row["ati_data_" . pad($k, 2, "0")], "tratp_createtime", $currentTime)); endfor; endif; */ // TO BE CHECKED BY SEMANTIC VIEW !!!!!!!!!!!!!!!!!!!!!!! // Update total price with price value of the service unit (ALL cashboxes and hoppers added!) updateStmt("phoenix.job", "jb_id", $jbIdNew, array("jb_totalprice", $tmpSuChargingLevelSum), ""); endif; // Store job into FDS if ($csId != "" && is_numeric($csId)) : $retBool = setAssocCrvhJb($jbIdNew, $crvhId, $csId, $currentDate, $hour, $hourUnit, $timeslots); else : $outReportArray[] = getLngt("KRITISCHER FEHLER: Der Auftrag mit der Nummer") . " " . $jbIdNew . " " . getLngt("wurde NICHT in die FDS eingetragen, weil die Kundenzuordnung fehlt!"); endif; $counter++; endwhile; else : // **** One separate job for ALL service units of one vehicle for one day (one job for one cartage note) **** // Create general job data insertStmt("job", array("hq_id", $hq_id, "csc_id", $cscId, "vht_id", $vhtId, "csc_id_payer", $cscIdPayer, "csc_id_related", $cscIdPayer, "jb_payment", "0", "jb_ordertime", $jbOrdertime, "cr_id", $crId, "cr_sid", $crSid, "cr_id_order", $crIdOrder, "jb_cr_filter", $jbCrFilter, "jb_cr_filter_opt", "", "jb_waitstorno", "0", "jb_taketime", "", "jb_status", $jbStatus, "jb_autoranking", "0", "jb_type", $jbType, "jb_incomplete", "0", "jb_globaljob", "0", "jb_tourname", $jbTourname, "jb_finishtime", "", "emp_id", $usr_id, "jb_fixprice", $fixprice, "jb_totalprice", $fixprice, "jb_postage", $cmpPostage, "jb_invmode", $csInvmode, "jb_freetext_1", "", "jb_weight", $jbCrvhWeight, "jb_crvh_length", $jbCrvhLength, "jb_crvh_width", $jbCrvhWidth, "jb_crvh_height", $jbCrvhHeight, "jb_crvh_position", $jbCrvhPosition, "jb_invtext", $jbRemark, "jb_tourdata", $jbTourdata, "jb_lockuser", "0", "jb_id_parent", "0", "jb_dispoinfo", "", "jb_sales_tax_rate", $txValue, "jb_sales_tax_rate_sign", $txSign, "jb_booktime", "")); $jbIdNew = getLastInsertId(); if (true || $jbIdNew != "") : // Could be true regarding TA handling // Create tour data $i = 0; while ($row = $result->fetch_assoc()): $trSort = $i + 1; // Get state of the service unit $trRemark = ""; $tmpAtiArray = getFieldsValueFromId("articleitem","ati_serialno",$row["ati_serialno"],array("at_id","ati_data_17")); $tmpAtId = $tmpAtiArray[0]; $tmpAtimCodes = $tmpAtiArray[1]; if ($tmpAtId != "" && $tmpAtimCodes != "") : $tmpAtimCodesArray = spliti(",", $tmpAtimCodes); $tmpAtimCodesArrayLen = count($tmpAtimCodesArray); for ($k = 0; $k < $tmpAtimCodesArrayLen; $k++) : $tmpAtimCode = $tmpAtimCodesArray[$k]; $tmpAtimDesc = getFieldValueFromClause("articlemessage","atm_desc","at_id = '" . $tmpAtId . "' AND atm_code = '" . $tmpAtimCode . "'"); $tmpAtimText = getFieldValueFromClause("articlemessage","atm_text","at_id = '" . $tmpAtId . "' AND atm_code = '" . $tmpAtimCode . "'"); if ($trRemark != "") : $trRemark .= " | "; endif; $trRemark .= "[" . ($k + 1) . ".] " . $tmpAtimCode . ": " . $tmpAtimDesc . " | => " . $tmpAtimText; endfor; endif; // Insert tour data for station insertStmt("tour", array("jb_id", $jbIdNew, "ad_id", $row["ad_id"], "tr_sort", $trSort, "tr_comp", $row["ati_serialno"], "tr_comp2", "", "tr_hsno", $row["stk_hsno"], "csc_id", $cscIdExternal, "tr_status", "0", "tr_commission_no", $row["ati_serialno"], "tr_ware_from_to", "", "tr_person", "", "tr_phone", "", "tr_remark", $trRemark)); // Insert tourservice data $tmpSuSingleChargingLevels = ""; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_00)) : $tmpSuSingleChargingLevels .= getLngt("BEK:") . number_format($row["ati_data_05"], 0, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_01)) : $tmpSuSingleChargingLevels .= getLngt("MEK:") . number_format($row["ati_data_06"], 2, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_02)) : $tmpSuSingleChargingLevels .= getLngt("H1:") . number_format($row["ati_data_07"], 0, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_03)) : $tmpSuSingleChargingLevels .= getLngt("H2:") . number_format($row["ati_data_08"], 2, ",", ".") . ","; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_04)) : $tmpSuSingleChargingLevels .= getLngt("Dispenser:") . number_format($row["ati_data_09"], 0, ",", "."); endif; $tmpSuChargingLevelSum = 0; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_00) && $row["ati_data_05"] != "" && is_numeric($row["ati_data_05"])) : $tmpSuChargingLevelSum += $row["ati_data_05"]; endif; if (in_array($row["ati_serialno"], $f_su_cb_chkbx_01) && $row["ati_data_06"] != "" && is_numeric($row["ati_data_06"])) : $tmpSuChargingLevelSum += $row["ati_data_06"]; endif; // if (in_array($row["ati_serialno"], $f_su_cb_chkbx_02) && $row["ati_data_07"] != "" && is_numeric($row["ati_data_07"])) : $tmpSuChargingLevelSum += $row["ati_data_07"]; endif; // if (in_array($row["ati_serialno"], $f_su_cb_chkbx_03) && $row["ati_data_08"] != "" && is_numeric($row["ati_data_08"])) : $tmpSuChargingLevelSum += $row["ati_data_08"]; endif; // if (in_array($row["ati_serialno"], $f_su_cb_chkbx_04) && $row["ati_data_09"] != "" && is_numeric($row["ati_data_09"])) : $tmpSuChargingLevelSum += $row["ati_data_09"]; endif; insertStmt("tourservice", array("jb_id", $jbIdNew, "csc_id", $cscIdPayer, "tr_sort", $trSort, "srv_id", "0", "trs_srv_name", $tmpSuSingleChargingLevels, "srvt_id", "0", "trs_srvt_name", "", "trs_price", $tmpSuChargingLevelSum)); // Insert tourarticle insertStmt("tourarticle", array("jb_id", $jbIdNew, "tr_sort", $trSort, "trat_serialno", $row["ati_serialno"], "trat_createtime", $currentTime)); $tratIdNew = getLastInsertId(); // Insert tourarticleprocess // Store snapshot of the current data in articleitem of the current service unit if ($tratIdNew != "" && is_numeric($tratIdNew)) : // [tratp_type == "5" <=> ati_data_05 <=> e.g. BEK, tratp_type == "6" <=> ati_data_06 <=> e.g. MEK, etc.] // for ($k = 1; $k <= $maxNumOfAtiDataFields; $k++) : for ($k = 5; $k <= 9; $k++) : insertStmt("tourarticleprocess", array("trat_id", $tratIdNew, "tratp_type", $k, "tratp_state", "0", "tratp_remark", $row["ati_data_" . pad($k, 2, "0")], "tratp_createtime", $currentTime)); endfor; endif; $i++; endwhile; endif; if (existsEntry("job", array("jb_id", $jbIdNew))) : $outReportArray[] = getLngt("Der Auftrag mit der Nummer") . " " . $jbIdNew . " " . getLngt("wurde erzeugt!"); else : $outReportArray[] = getLngt("Es wurde leider kein Auftrag erzeugt!"); endif; endif; endif; // Check $cr_id TA("C"); TA("E"); endif; $result->free(); endif; endfor; endif; else : $outReportArray[] = getLngt("Es existiert kein Default-Bezahler für die Tour. Der Auftrag wurde NICHT angelegt! Bitte der Systemadministration melden!"); endif; endif; // Get service jobs getServiceJoblist(); endif; // Check for $rootStockSU is defined // ********** // * Output * // ********** // Output threshold values $outThresholdValues = ""; if ($generateOutput) : for ($a = 0; $a < $suAtIdArrayLen; $a++) : $atId = $suAtIdArray[$a]; $tmpAtMatch = getFieldValueFromId("phoenix.article", "at_id", $atId, "at_match"); $tmpAtGroup = getFieldValueFromId("phoenix.article", "at_id", $atId, "at_group"); $dummyLowerRange = 0; $dummyUpperRange = 99999; if (!(strpos($tmpAtGroup, ",6,") === FALSE)) : for ($t = 1; $t <= 2; $t++) : $outThresholdValues .= ""; endfor; $outThresholdValues .= ""; $outThresholdValues .= "" . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "
" . getLngt("VERKAUFSSTELLE") . " " . $tmpAtMatch . "
" . getLngt("TYP") . "" . getLngt("EINHEIT") . "" . " " . "
" . getLngt("Safebag") . "" . getLngt("gelb") . "" . "" . "
" . getLngt("Safebag") . "" . getLngt("rot") . "" . "" . "
"; // Prepare for remaining threshold values. Use hidden parameters $startValueForRemainingFields = 5; for ($t = $startValueForRemainingFields; $t <= $maxNumOfAtiDataFields; $t++) : $outThresholdValues .= ""; endfor; else : $outThresholdValues .= ""; $outThresholdValues .= "" . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "" . " " . " " . ""; $outThresholdValues .= "
" . getLngt("AUTOMATENTYP") . " " . $tmpAtMatch . "
" . getLngt("KASSETTENTYP") . "" . getLngt("ART") . "" . getLngt("BETRAG") . "
" . getLngt("Münzkassette (MEK)") . "" . getLngt("MEK gelb") . "" . "" . "
" . getLngt("Münzkassette (MEK)") . "" . getLngt("MEK rot") . "" . "" . "
" . getLngt("Banknotenkassetten (BEK)") . "" . getLngt("BEK gelb") . "" . "" . "
" . getLngt("Banknotenkassetten (BEK)") . "" . getLngt("BEK rot") . "" . "" . "
" . getLngt("Wechselgeldspeicher (Kassetten)") . "" . getLngt("Hopper 1 (2 EUR) gelb") . "" . "" . "
" . getLngt("Wechselgeldspeicher (Kassetten)") . "" . getLngt("Hopper 2 (10 ct) gelb") . "" . "" . "
" . getLngt("Wechselgeldspeicher (Kassetten)") . "" . getLngt("Hopper 3 (5 ct) gelb") . "" . "" . "
" . getLngt("Wechselgeldspeicher (Kassetten)") . "" . getLngt("Hopper 1 (2 EUR) rot") . "" . "" . "
" . getLngt("Wechselgeldspeicher (Kassetten)") . "" . getLngt("Hopper 2 (10 ct) rot") . "" . "" . "
" . getLngt("Wechselgeldspeicher (Kassetten)") . "" . getLngt("Hopper 3 (5 ct) rot") . "" . "" . "
"; // Prepare for remaining threshold values. Use hidden parameters $startValueForRemainingFields = 11; for ($t = $startValueForRemainingFields; $t <= $maxNumOfAtiDataFields; $t++) : $outThresholdValues .= ""; endfor; endif; endfor; endif; // Output current states of service units $outEventStates = ""; if ($generateOutput) : $outEventStatesArrayLen = count($outEventStatesArray); if ($outEventStatesArrayLen > 0) : $outEventStates .= ""; $outEventStates .= ""; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; // $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; $outEventStates .= " "; // $outEventStates .= " "; // $outEventStates .= " "; $outEventStates .= ""; for ($j = 0; $j < $outEventStatesArrayLen; $j++) : $outEventStates .= $outEventStatesArray[$j]; endfor; $outEventStates .= "
" . getLngt("FA") . "" . getLngt("SW-Offset") . "" . getLngt("N") . "" . getLngt("Standort") . "" . getLngt("Opt.") . "" . getLngt("Tour") . "" . getLngt("Sort.") . "" . getLngt("XXX") . "" . getLngt("PLZ") . "" . getLngt("Geog. Breite") . "" . getLngt("Geog. Länge") . "" . getLngt("BEK") . "" . getLngt("MEK") . "" . getLngt("H1") . "" . getLngt("H2") . "" . getLngt("Dispenser") . "" . getLngt("Messzeitpunkt") . "" . getLngt("Meldungen") . "" . getLngt("SW") . "" . getLngt("Status") . "
"; endif; endif; // Output service jobs $outServiceJobs = ""; $outServiceJobJsDate = ""; $jbDateFilter = ""; if ($generateOutput) : $outJobArrayLen = count($outJobArray); if ($outJobArrayLen > 0) : $outServiceJobs .= ""; $outServiceJobs .= ""; $outServiceJobs .= " "; $outServiceJobs .= " "; $outServiceJobs .= " "; $outServiceJobs .= " "; $outServiceJobs .= " "; $outServiceJobs .= " "; $outServiceJobs .= " "; // $outServiceJobs .= " "; // $outServiceJobs .= " "; // $outServiceJobs .= " "; $outServiceJobs .= " "; $outServiceJobs .= ""; for ($j = 0; $j < $outJobArrayLen; $j++) : $outServiceJobs .= $outJobArray[$j]; endfor; $outServiceJobs .= "
" . getLngt("Auftrag") . "" . getLngt("Fahrzeug") . "" . getLngt("Station") . "" . getLngt("Erledigungszeit") . "" . getLngt("Automat") . "" . getLngt("Standort") . "" . getLngt("PLZ") . "" . getLngt("Auftragsbeginn") . "" . getLngt("Annahmezeit") . "" . getLngt("Auftragsende") . "" . getLngt("Wartungsarbeiten") . "
"; endif; $outServiceJobJsDate .= "\n"; $outServiceJobJsDate .= "\n"; $outServiceJobJsDate .= "\n"; // Date ranges $jbDateFilter = "von:\n"; $jbDateFilter .= "\n"; $jbDateFilter .= "\n"; $jbDateFilter .= "\n"; $jbDateFilter .= "  bis:\n"; $jbDateFilter .= "\n"; $jbDateFilter .= "\n"; $jbDateFilter .= "\n"; $jbDateFilter .= " "; // Time ranges /* $jbTimeFilter = "["; $jbTimeFilter .= "Ohne|"; $jbTimeFilter .= "Mit"; $jbTimeFilter .= "Einschränkung auf Zeitintervall von:\n"; $jbTimeFilter .= "\n"; $jbTimeFilter .= "\n"; $jbTimeFilter .= "Uhr  bis:\n"; $jbTimeFilter .= "\n"; $jbTimeFilter .= "\n"; $jbTimeFilter .= "Uhr]\n"; */ // Prediction date $jbDatePrediction = "\n"; $jbDatePrediction .= "\n"; $jbDatePrediction .= "\n"; endif; // Output log data $outLogData = ""; if ($generateOutput) : $outLogArrayLen = count($outLogArray); if ($outLogArrayLen > 0) : $outLogData .= ""; $outLogData .= ""; $outLogData .= "" . " " . " " . " " . " " . " " . ""; for ($j = 0; $j < $outLogArrayLen; $j++) : $outLogData .= $outLogArray[$j]; endfor; $outLogData .= "
" . $f_actionObjId . "
" . getLngt("Zeitpunkt") . "" . getLngt("BEK") . "" . getLngt("MEK") . "" . getLngt("H1") . "" . getLngt("H2") . "" . getLngt("Dispenser") . "
"; endif; endif; // Output message data $outMessageData = ""; if ($generateOutput) : $outMessageArrayLen = count($outMessageArray); if ($outMessageArrayLen > 0) : $outMessageData .= ""; $outMessageData .= ""; $outMessageData .= "" . " " . " " . ""; for ($j = 0; $j < $outMessageArrayLen; $j++) : $outMessageData .= $outMessageArray[$j]; endfor; $outMessageData .= "
" . $f_actionObjId . "
" . getLngt("Code") . "" . getLngt("Beschreibung") . "" . getLngt("Text") . "
"; endif; endif; $outSuFormData = ""; $outCbFormData = ""; $outCdrFormData = ""; if ($generateOutput) : $tmpCol_bg_01 = $colArray["bg"]; $tmpCol_bg_02 = $colArray["green"]; $tmpCol_bg_03 = $colArray["blue"]; $tmpCol_fg_01 = $colArray["black"]; $tmpCol_fg_02 = $colArray["black"]; $tmpCol_fg_03 = $colArray["black"]; $tmpCol_fg_04 = $colArray["beige"]; $tmpCol_fg_05 = $colArray["light_blue"]; $outSuFormData .= ""; // Service unit data $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; // Stock data (service stations) $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= ""; $outSuFormData .= " "; $outSuFormData .= " "; $outSuFormData .= ""; $outSuFormData .= "
" . getLngt("Automaten mit Standort") . "
"; $outSuFormData .= " " . getLngt("Automatennummer") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Automatentyp") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Bemerkung") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Schwellwert-Offset") . "[€] : "; $outSuFormData .= "  "; $outSuFormData .= " " . getLngt("BEK") . ":"; $outSuFormData .= " " . getLngt("MEK") . ":"; $outSuFormData .= " " . getLngt("H1") . ":"; $outSuFormData .= " " . getLngt("H2") . ":"; $outSuFormData .= " " . getLngt("Dispenser") . ":"; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Geographische Breite Automat") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Geographische Länge Automat") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Wegezeit und Servicezeit [Min.]") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Geographische Breite Parkplatz") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Geographische Länge Parkplatz") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Präselektion für Tourenoptimierung [Tourennummer]") . " : "; $outSuFormData .= "  "; for ($j = 1; $j <= 7; $j++) : $tmpAtiFieldValue = ${("f_su_admin_ati_data_21_" . $j)}; $outSuFormData .= substr($calWeekDays[($j - 1)], 0, 2) . " "; $outSuFormData .= "      "; endfor; $outSuFormData .= " " . getLngt("ALLE") . "  "; $outSuFormData .= "     "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Aktionen") . " : "; $outSuFormData .= "  "; $outSuFormData .= " " . defineButtonType08("Automatendaten speichern", "action_store_form_serviceunit", "finishFormServiceUnitStore();", "200", "left", "2"); $outSuFormData .= " " . defineButtonType08("Automatendaten entfernen", "action_remove_form_serviceunit", "finishFormServiceUnitRemove();", "200", "left", "2"); $outSuFormData .= "
" . getLngt("Standorte, Haltestellen") . "
"; $outSuFormData .= " " . getLngt("Standort") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Info") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Strasse, Hausnr.") . " : "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("PLZ, Ort") . " : "; $outSuFormData .= "  "; $outSuFormData .= "  "; $outSuFormData .= " "; $outSuFormData .= "
"; $outSuFormData .= " " . getLngt("Aktionen") . " : "; $outSuFormData .= "  "; $outSuFormData .= " " . defineButtonType08("Standortdaten speichern", "action_store_form_stock", "finishFormStock();", "200", "left", "2"); $outSuFormData .= "
"; // Cash boxes $outCbFormData .= ""; $outCbFormData .= ""; $outCbFormData .= " "; $outCbFormData .= ""; $outCbFormData .= ""; $outCbFormData .= " "; $outCbFormData .= " "; $outCbFormData .= ""; $outCbFormData .= ""; $outCbFormData .= " "; $outCbFormData .= " "; $outCbFormData .= ""; $outCbFormData .= ""; $outCbFormData .= " "; $outCbFormData .= " "; $outCbFormData .= ""; $outCbFormData .= ""; $outCbFormData .= " "; $outCbFormData .= " "; $outCbFormData .= ""; $outCbFormData .= "
" . getLngt("Geldkassetten") . "
"; $outCbFormData .= " " . getLngt("Nummer") . " : "; $outCbFormData .= "  "; $outCbFormData .= " "; $outCbFormData .= "
"; $outCbFormData .= " " . getLngt("Kassettentyp") . " : "; $outCbFormData .= "  "; $outCbFormData .= " "; $outCbFormData .= "
"; $outCbFormData .= " " . getLngt("Aktueller Standort") . " : "; $outCbFormData .= "  "; $outCbFormData .= " "; $outCbFormData .= "
"; $outCbFormData .= " " . getLngt("Aktionen") . " : "; $outCbFormData .= "  "; $outCbFormData .= " " . defineButtonType08("Kassettendaten speichern", "action_store_form_cb", "finishFormCashBoxStore();", "200", "left", "2"); $outCbFormData .= " " . defineButtonType08("Kassettendaten entfernen", "action_remove_form_cb", "finishFormCashBoxRemove();", "200", "left", "2"); $outCbFormData .= "
"; // Card rolls $outCdrFormData .= ""; $outCdrFormData .= ""; $outCdrFormData .= " "; $outCdrFormData .= ""; $outCdrFormData .= ""; $outCdrFormData .= " "; $outCdrFormData .= " "; $outCdrFormData .= ""; $outCdrFormData .= ""; $outCdrFormData .= " "; $outCdrFormData .= " "; $outCdrFormData .= ""; $outCdrFormData .= ""; $outCdrFormData .= " "; $outCdrFormData .= " "; $outCdrFormData .= ""; $outCdrFormData .= ""; $outCdrFormData .= " "; $outCdrFormData .= " "; $outCdrFormData .= ""; $outCdrFormData .= ""; $outCdrFormData .= " "; $outCdrFormData .= " "; $outCdrFormData .= ""; $outCdrFormData .= ""; $outCdrFormData .= " "; $outCdrFormData .= " "; $outCdrFormData .= ""; $outCdrFormData .= "
" . getLngt("Kartenrollen") . "
"; $outCdrFormData .= " " . getLngt("Nummernkreis") . " : "; $outCdrFormData .= "  "; $outCdrFormData .= " "; $outCdrFormData .= "  - "; $outCdrFormData .= " "; $outCdrFormData .= "
"; $outCdrFormData .= " " . getLngt("Kartenrollentyp") . " : "; $outCdrFormData .= "  "; $outCdrFormData .= " "; $outCdrFormData .= "
"; $outCdrFormData .= " " . getLngt("Aktueller Standort") . " : "; $outCdrFormData .= "  "; $outCdrFormData .= " "; $outCdrFormData .= "
"; $outCdrFormData .= " " . getLngt("Palette") . " : "; $outCdrFormData .= "  "; $outCdrFormData .= " "; $outCdrFormData .= "
"; $outCdrFormData .= " " . getLngt("Fehlende Kartenrollen") . " : "; $outCdrFormData .= "  "; $outCdrFormData .= " "; // onblur=\"javascript:checkCdrSerialNoMissing();\" $outCdrFormData .= "
"; $outCdrFormData .= " " . getLngt("Aktionen") . " : "; $outCdrFormData .= "  "; $outCdrFormData .= " " . defineButtonType08("Kartenrollendatendaten speichern", "action_store_form_cdr", "finishFormCardrollsStore();", "200", "left", "2"); // $outCdrFormData .= " " . defineButtonType08("Kartenrollendatendaten entfernen", "action_remove_form_cdr", "finishFormCardrollsRemove();", "200", "left", "2"); $outCdrFormData .= "
"; endif; // Output report entries and system messages $outReport = ""; $outReportArrayLen = count($outReportArray); if ($outReportArrayLen > 0) : $maskDisplay00Switch = "1"; // Activate output if there is at least one message to be displayed $outReport .= ""; for ($j = 0; $j < $outReportArrayLen; $j++) : $outReport .= ""; endfor; $outReport .= "
" . $outReportArray[$j] . "
"; endif; // $xTest = getServiceUnits(); // print_r($xTest); // echo "f_map_is_active = " . $f_map_is_active . "
"; ?> <?php echo $pageTitel ?>
    

"; echo getLngt("BEK:") . " " . number_format($outGlobalStateArray["ati_data_05"], 0, ",", ".") . " €    "; echo getLngt("MEK:") . " " . number_format($outGlobalStateArray["ati_data_06"], 2, ",", ".") . " €    "; echo getLngt("H1:") . " " . number_format($outGlobalStateArray["ati_data_07"], 0, ",", ".") . " €    "; echo getLngt("H2:") . " " . number_format($outGlobalStateArray["ati_data_08"], 2, ",", ".") . " €    "; echo getLngt("Dispenser:") . " " . number_format($outGlobalStateArray["ati_data_09"], 2, ",", ".") . " €    "; $outGlobalSum = $outGlobalStateArray["ati_data_05"] + $outGlobalStateArray["ati_data_06"] + $outGlobalStateArray["ati_data_07"] + $outGlobalStateArray["ati_data_08"] + $outGlobalStateArray["ati_data_09"]; echo getLngt("Summe:") . " " . number_format( $outGlobalSum, 2, ",", ".") . " €"; */ ?>
    
" . getLngt("Import Stammdaten") . "" . "    "; // echo "" . getLngt("Import Statusdaten") . "" . "    "; // echo "" . getLngt("Manueller Import") . "" . "    "; ?>
    
" . $tmpCmpComp . " " . $tmpCmpComp2 . "
"; // Get all costcenters of each customer being a sales points, etc. (No root costcenters !!!!) $cscIdArray = getColVectorFromDB2ArrayByClause("costcenter AS csc", "csc_id", "csc.cs_id = '" . $csIdArray[$c] . "' AND (NOT ISNULL(csc.csc_pre_id)) AND csc.csc_pre_id != ''", "", "", ""); $cscIdArrayLen = count($cscIdArray); for ($d = 0; $d < $cscIdArrayLen; $d++) : $tmpCscName = getFieldValueFromId("costcenter","csc_id",$cscIdArray[$d],"csc_name"); $outCargoList .= "

" . "  " . $tmpCscName . "

"; for ($a = 0; $a < $numOfAllArticleTypes; $a++) : $tmpDate = substr($predictionDate,0,4) . substr($predictionDate,5,2) . substr($predictionDate,8,2); $outCargoArray = getSpecialAnnouncements($cscIdArray[$d], $articleTypeArray[$a], $tmpDate, "2"); if (count($outCargoArray[0]) > 0) : $tmpAtDescription = getFieldValueFromId("article","at_id",$articleTypeArray[$a],"at_description"); $outCargoList .= "" . $tmpAtDescription . ""; $outCargoList .= "
"; $outCargoList .= getSpecialAnnouncements($cscIdArray[$d], $articleTypeArray[$a], $tmpDate, "2"); else : $outCargoList .= " : " . getLngt("Keine") . "
"; endif; $outCargoList .= "
"; endfor; endfor; $outCargoList .= "

"; endfor; echo $outCargoList; ?>
    
     
  
         
    
>
  " . getLngt("Anzeige der Tourenvorbelegung:") . "

  "; ?>                \n"; $outTourCrvhAssoc .= "  " . getLngt("TOUR => FAHRZEUG") . "

\n"; for ($j = 1; $j <= $maxNumOfTours; $j++) : $outTourCrvhAssoc .= "  " . pad($j, 2) . "  =>  "; $outTourCrvhAssoc .= "
\n"; endfor; echo $outTourCrvhAssoc; ?>
" onClick="callVehicleSelection();">
>
  " . getLngt("Anzeige der Spalten:") . "

  "; ?>
" onClick="callTableColSelection();">
>
 
>