0) : for ($i = 0; $i < $cscVectorOfTheCustomerArrayLen; $i++) : if (existsEntry("job",array("csc_id_payer",$cscVectorOfTheCustomerArray[$i])) || existsEntry("job",array("csc_id_payer_cash",$cscVectorOfTheCustomerArray[$i]))) : if ($f_cmp_type != "0") : updateStmt("company","cmp_id",$companyId,array("cmp_type","0")); $f_cmp_type = "0"; $f_cmp_current_type = "0"; endif; $showCmpTypeSelection = false; break; endif; endfor; endif; endif; // Get title $typeTextArray = getColVectorFromDB2ArrayByClause("metatype", "mt_value", "mt_type = 'customer_type'", "", "mt_sort", ""); $pageTitel = getLngt("KUNDE"); if ($f_cmp_type == "1") : $pageTitel = getLngt("INTERESSENT"); elseif ($f_cmp_type == "2") : $pageTitel = getLngt("POTENTIALKUNDE"); elseif ($f_cmp_type == "3") : $pageTitel = getLngt("WUNSCHKUNDE"); endif; if ($f_cmp_type != "" && $typeTextArray[$f_cmp_type] != "") : $pageTitel = strtoupper($typeTextArray[$f_cmp_type]); endif; $deactivateMenuStatic = "1"; if ($generatePDF != "1") : include_once ("../geo/geocode.inc.php"); endif; include_once ("../admin/menu.php"); include_once ("../include/html.inc.php"); include_once ("../groupware/calendar.php"); $debug = false; include_once ("../include/inc_customer.inc.php"); getCurrentScript(__FILE__); // No operation if print version requested if ($printVersion == "1") : $f_act = ""; endif; $addressValidationErr = ""; $dbOperationCompleted = "0"; // Check for validation of the address assigned to the customer $noValidationOfAddress = FALSE; if ($f_noaddressvalidation != "") : if ($f_noaddressvalidation[0] == '1') : $noValidationOfAddress = TRUE; endif; endif; // Init parameters: // Tracking if (mcChkValOrArrCountIsEmpty($f_cs_tracking)) : $f_cs_tracking = "0"; else : if (is_array($f_cs_tracking)) : mcArrIsSet($f_cs_tracking, 0, 0); mcArrIsSet($f_cs_tracking, 1, 0); $f_cs_tracking = $f_cs_tracking[0] + $f_cs_tracking[1]; else : $f_cs_tracking = "0"; endif; endif; // Average charging time if ($f_cs_charging_time == "") : $f_cs_charging_time = "0"; endif; // Average charging time if ($f_cs_blur_markup_time == "") : $f_cs_blur_markup_time = "0"; endif; // Invoice mode if ($f_cmp_inv2hq == "" || count($f_cmp_inv2hq) == 0) : $f_cmp_inv2hq = "0"; else : mcArrIsSet($f_cmp_inv2hq, 0, 0); mcArrIsSet($f_cmp_inv2hq, 1, 0); $f_cmp_inv2hq = $f_cmp_inv2hq[0] + $f_cmp_inv2hq[1]; endif; // Only favoured couriers if ($f_cs_cr_fav_only == "" || count($f_cs_cr_fav_only) == 0) : $f_cs_cr_fav_only = "0"; else: $f_cs_cr_fav_only = "1"; endif; // Flag for "list customer" (jobbatch) if ($f_cs_jobbatch == "" || count($f_cs_jobbatch) == 0) : $f_cs_jobbatch = "0"; else: $f_cs_jobbatch = "1"; endif; // Flag for fixprice discount if ($f_cs_fixprice_discount == "" || count($f_cs_fixprice_discount) == 0) : $f_cs_fixprice_discount = "0"; else: $f_cs_fixprice_discount = "1"; endif; // Flag for invoice text mode if ($f_cs_invtext_mode == "" || count($f_cs_invtext_mode) == 0) : $f_cs_invtext_mode = "0"; else: $f_cs_invtext_mode = "1"; endif; // Flag for no longhaul if ($f_cmp_no_longhaul == "" || count($f_cmp_no_longhaul) == 0) : $f_cmp_no_longhaul = "0"; else: $f_cmp_no_longhaul = "1"; endif; // Flag for (fuel) markup if ($f_cs_markup == "" || count($f_cs_markup) == 0) : $f_cs_markup = "0"; else: $f_cs_markup = "1"; endif; // Flag for customer to create jobs if ($f_cs_jbedit == "" || count($f_cs_jbedit) == 0) : $f_cs_jbedit = "0"; else: $f_cs_jbedit = "1"; endif; // Flag for customer to create jobs if ($f_cs_ar == "" || count($f_cs_ar) == 0) : $f_cs_ar = "0"; else: $f_cs_ar = "1"; endif; // Flag for customer to check price has to blink in job list if it is uncomplete if ($f_cs_price_warn_uncomplete == "" || count($f_cs_price_warn_uncomplete) == 0) : $f_cs_price_warn_uncomplete = "0"; else: $f_cs_price_warn_uncomplete = "1"; endif; // Flag for customer to disable displaying in job lists if ($f_cs_joblist_disabled == "" || count($f_cs_joblist_disabled) == 0) : $f_cs_joblist_disabled = "0"; else: $f_cs_joblist_disabled = "1"; endif; // Flag for status mail extra fields if ($f_cs_jbstatusmail_field1 == "" || count($f_cs_jbstatusmail_field1) == 0) : $f_cs_jbstatusmail_field1 = "0"; else: $f_cs_jbstatusmail_field1 = "1"; endif; if ($f_cs_jbstatusmail_field2 == "" || count($f_cs_jbstatusmail_field2) == 0) : $f_cs_jbstatusmail_field2 = "0"; else: $f_cs_jbstatusmail_field2 = "1"; endif; if ($f_cs_jbstatusmail_field3 == "" || count($f_cs_jbstatusmail_field3) == 0) : $f_cs_jbstatusmail_field3 = getParameterValue("0", "CS_JBSTATUSMAIL_FIELD3_DEFAULT", $hq_id); else: $f_cs_jbstatusmail_field3 = "1"; endif; if ($f_cs_jbstatusmail_field4 == "" || count($f_cs_jbstatusmail_field4) == 0) : $f_cs_jbstatusmail_field4 = "0"; else: $f_cs_jbstatusmail_field4 = "1"; endif; if ($f_cs_jbstatusmail_field5 == "" || count($f_cs_jbstatusmail_field5) == 0) : $f_cs_jbstatusmail_field5 = "0"; else: $f_cs_jbstatusmail_field5 = "1"; endif; if ($f_cs_jbstatusmail_field6 == "" || count($f_cs_jbstatusmail_field6) == 0) : $f_cs_jbstatusmail_field6 = "0"; else: $f_cs_jbstatusmail_field6 = "1"; endif; if ($f_cs_jbstatusmail_field7 == "" || count($f_cs_jbstatusmail_field7) == 0) : $f_cs_jbstatusmail_field7 = "0"; else: $f_cs_jbstatusmail_field7 = "1"; endif; if ($f_cs_jbstatusmail_field8 == "" || count($f_cs_jbstatusmail_field8) == 0) : $f_cs_jbstatusmail_field8 = "0"; else: $f_cs_jbstatusmail_field8 = "1"; endif; if ($f_cs_jbstatusmail_field9 == "" || count($f_cs_jbstatusmail_field9) == 0) : $f_cs_jbstatusmail_field9 = getParameterValue("0", "CS_JBSTATUSMAIL_FIELD9_DEFAULT", $hq_id); else: $f_cs_jbstatusmail_field9 = "1"; endif; if ($f_cs_jbstatusmail_fieldA == "" || count($f_cs_jbstatusmail_fieldA) == 0) : $f_cs_jbstatusmail_fieldA = getParameterValue("0", "CS_JBSTATUSMAIL_FIELDA_DEFAULT", $hq_id); else: $f_cs_jbstatusmail_fieldA = "1"; endif; $f_cs_jbstatusmail_fields = $f_cs_jbstatusmail_field1 . $f_cs_jbstatusmail_field2 . $f_cs_jbstatusmail_field3 . $f_cs_jbstatusmail_field4 . $f_cs_jbstatusmail_field5 . $f_cs_jbstatusmail_field6 . $f_cs_jbstatusmail_field7 . $f_cs_jbstatusmail_field8 . $f_cs_jbstatusmail_field9 . $f_cs_jbstatusmail_fieldA; // Job jam waittime default value (in minutes) $parCsJbJamWaittimeAdHocDefault = getParameterValue("0", "CS_JB_JAM_WAITTIME_AD_HOC_DEFAULT", $hq_id); if ($parCsJbJamWaittimeAdHocDefault == "") : $parCsJbJamWaittimeAdHocDefault = getParameterValue("0", "CS_JB_JAM_WAITTIME_AD_HOC_DEFAULT", "0"); endif; $parCsJbJamWaittimeReservationDefault = getParameterValue("0", "CS_JB_JAM_WAITTIME_RESERVATION_DEFAULT", $hq_id); if ($parCsJbJamWaittimeReservationDefault == "") : $parCsJbJamWaittimeReservationDefault = getParameterValue("0", "CS_JB_JAM_WAITTIME_RESERVATION_DEFAULT", "0"); endif; // Customer job jam waittime if ($f_cs_jb_jam_waittime == "" || count($f_cs_jb_jam_waittime) == 0) : $f_cs_jb_jam_waittime = 0; else : if ($companyId != "") : $f_cs_jb_jam_waittime = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_jb_jam_waittime"); endif; if (!is_numeric($f_cs_jb_jam_waittime) || $f_cs_jb_jam_waittime == "0") : $f_cs_jb_jam_waittime = $parCsJbJamWaittimeAdHocDefault; endif; endif; // Init if ($f_cmp_sales_ranking_man == "") : $f_cmp_sales_ranking_man = "0"; endif; if ($f_cmp_proof_delivery == "") : $f_cmp_proof_delivery = "0"; endif; if ($f_cs_payment_term == "") : $f_cs_payment_term = "0"; endif; mcIsSet($cs_id_new); mcIsSet($cmpId); mcIsSet($eid); mcIsSet($usrName); mcIsSet($usrFirstname); mcIsSet($adStreet); mcIsSet($cmpHsno); mcIsSet($adZipcode); mcIsSet($adCity); mcIsSet($oldDpfChecksum); mcIsSet($phpCurrentNavigationInputHidden); mcIsSet($adCity); // Photos if ($f_cs_photo_disabled == "") : $f_cs_photo_disabled = "0"; else: $f_cs_photo_disabled = "1"; endif; if ($f_cs_photo_hq == "") : $f_cs_photo_hq = "0"; else: $f_cs_photo_hq = "1"; endif; if ($f_cs_photo_cs == "") : $f_cs_photo_cs = "0"; else: $f_cs_photo_cs = "1"; endif; if ($f_cs_photo_range_from == "") : $f_cs_photo_range_from = "0"; endif; if ($f_cs_photo_range_to == "") : $f_cs_photo_range_to = "0"; endif; // Init parameter for executing the personal embargo request $execEmbargoCheck = "0"; // Change costcenter addresses according to the main address $changeBeneficiaryAddress = FALSE; $changeInvoiceAddress = FALSE; $changePickUpAddress = FALSE; if ($f_adt_change != "") : if (!(array_search("1",$f_adt_change) === FALSE)) : $changeBeneficiaryAddress = TRUE; endif; if (!(array_search("2",$f_adt_change) === FALSE)) : $changeInvoiceAddress = TRUE; endif; if (!(array_search("4",$f_adt_change) === FALSE)) : $changePickUpAddress = TRUE; endif; endif; // Change costcenter company names according to the main name $changeBeneficiaryCompany = FALSE; $changeInvoiceCompany = FALSE; $changePickUpCompany = FALSE; if ($f_adt_change2 != "") : if (!(array_search("1",$f_adt_change2) === FALSE)) : $changeBeneficiaryCompany = TRUE; endif; if (!(array_search("2",$f_adt_change2) === FALSE)) : $changeInvoiceCompany = TRUE; endif; if (!(array_search("4",$f_adt_change2) === FALSE)) : $changePickUpCompany = TRUE; endif; endif; // Check for minimum length of phone numbers $parCsPhoneMinLength = getParameterValue("0", "CS_PHONE_MINIMUM_LENGTH", $hq_id); if ($parCsPhoneMinLength == "") : $parCsPhoneMinLength = getParameterValue("0", "CS_PHONE_MINIMUM_LENGTH", "0"); endif; // Get mask parameter regarding change behaviour of the tax field $parMaskCsTaxIdsChangeMsg = getParameterValue("0", "MASK_CS_SPECIAL_TAX_IDS_CHANGE_MSG", $hq_id); if ($parMaskCsTaxIdsChangeMsg == "") : $parMaskCsTaxIdsChangeMsg = getParameterValue("0", "MASK_CS_SPECIAL_TAX_IDS_CHANGE_MSG", "0"); endif; if ($parMaskCsTaxIdsChangeMsg != "") : $parMaskCsTaxIdsChangeMsg = "'" . implode("','", spliti(",", $parMaskCsTaxIdsChangeMsg)) . "'"; endif; // Get mandatory fields to be checked $parMaskMandatoryFields = getMandatoryFields("MASK_CS_MANDATORY_FIELDS"); $parMaskMandatoryFieldsLen = count($parMaskMandatoryFields); // Check tracking functionality enabled $parCsTracking = getParameterValue("0", "CS_TRACKING_ENABLED", $hq_id); if ($parCsTracking == "") : $parCsTracking = getParameterValue("0", "CS_TRACKING_ENABLED", "0"); endif; // Get EID prefix and reset EID only if equals prefix $constCsEidPrefix = getParameterValue("0", "CS_EID_PREFIX", $hq_id); if ($f_cs_eid == $constCsEidPrefix) : $f_cs_eid = ""; endif; // ONLY for transformation from "prospect'"' to "customer" !!! // *** if ($pt2cs != "") : // Get max-value of the EID of the current customer for inserting a new row // The constant value "CS_EID_GENERATION" contains the prefix of the SID [SPECIAL TREATMENT] $f_eid_maxval = ""; // $csEidGeneration = getParameterValue("0", "CS_EID_GENERATION"); if (CS_EID_GENERATION != "") : $f_eid_maxval = getMaxOfField("customer", "cs_eid", "cs_eid < '" . CS_EID_GENERATION . "'"); if (is_numeric($f_eid_maxval)) : ++$f_eid_maxval; // Increment because of the next free EID (Attention: Not TA-safe!) else : // Remove alphanumeric chars (e.g "HTHB123456" => "123456") $prefixChars = ereg_replace("[^[:alpha:]+]","",$f_eid_maxval); $f_eid_maxval = ereg_replace("[^[:digit:]+]","",$f_eid_maxval); ++$f_eid_maxval; $f_eid_maxval = $prefixChars . $f_eid_maxval; endif; $f_cs_eid = $f_eid_maxval; // !!! endif; endif; // ******* // ******************************** // * Operations for the customers * // ******************************** // Generate log string if ($f_act != "") : $f_cmp_comp = str_replace("'", "", $f_cmp_comp); $f_cmp_comp2 = str_replace("'", "", $f_cmp_comp2); $f_cmp_comp3 = str_replace("'", "", $f_cmp_comp3); $f_cmp_comp4 = str_replace("'", "", $f_cmp_comp4); $f_cmp_match = str_replace("'", "", $f_cmp_match); $f_cmp_match2 = str_replace("'", "", $f_cmp_match2); $f_cmp_remark = str_replace("'", "´", $f_cmp_remark); $f_cmp_remark2 = str_replace("'", "´", $f_cmp_remark2); $logString = makeLogString(array($f_cmp_authenticated,$f_cmp_comp,$f_cmp_comp2,$f_cs_eid,$f_usr_name, $f_usr_firstname,$f_usr_phone,$f_usr_phone2,$f_usr_fax,$f_usr_email,$f_cmp_iln, $f_cmp_tax_idno,$f_cs_invmode,$f_cmp_bank,$f_cmp_bankno,$f_cmp_bankacc, $f_cmp_bankmode,$f_cs_discount,$f_cmp_postage,$f_cmp_inv2hq,$f_usr_account, $f_cs_jbstatusmail,$f_cs_commission_no,$f_cs_cr_fav_only,$f_cs_jobbatch, $f_cmp_cashmode,$f_cmp_visible,$f_ad_changemode,$f_adt_change,$f_cmp_changemode, $f_adt_change2,$f_ad_street,$f_cmp_hsno,$f_ad_zipcode,$f_ad_city,$f_ad_country, $f_cmp_match,$f_cmp_match2,$g_cs_id,$g_csc_id,$g_tx_id,$g_br_id,$g2_cs_id, $f_cs_fixprice_discount,$f_cs_jbstatusmail2,$f_cs_jbstatusmail3, $f_cs_invtext_mode, $f_cs_prov, $f_cmp_remark,$f_cmp_remark2,$f_cs_markup, $f_cs_markup_prov, $f_cs_jbstatusmail2csc, $f_cs_jbedit, $f_cs_jbstatusmail_price, $f_cs_jbstatusmail_emp, $f_cs_jbstatusmail_pdf, $f_cs_jbstatusmail_fields, $f_cmp_stax_idno, $f_cmp_iban, $f_cmp_swift, $f_cmp_hqlino, $f_cmp_type, $f_cmp_newsletter, $f_cs_price_warn_uncomplete, $g_sales_emp_id, $f_cmp_sales_ranking_man,$f_cmp_comp3,$f_cmp_comp4, $f_cmp_proof_delivery, $f_cmp_pda_usage, $f_cs_tracking, $f_cmp_dsgvo, $f_cs_joblist_disabled, $f_cs_eid_old, $f_cs_jb_jam_waittime, $f_usr_inv_email, $f_cs_ar, $f_cs_charging_time, $f_cs_blur_markup_time, $f_cmp_sustainability_email, $f_cmp_sustainability_interval, $f_cs_photo_disabled, $f_cs_photo_hq, $f_cs_photo_cs, $f_cs_photo_range_from, $f_cs_photo_range_to, $f_cmp_no_longhaul, $f_cs_payment_term, $f_cs_par_email_arrivaltime, $f_cs_par_email_lng, $f_cs_jb_creator_discount, $f_cs_jb_incomplete, $f_cs_jb_jam_waittime_minutes, $f_usr_reminder_email, $f_cmp_gln), ";", "0"); endif; // Insert new customer if ($f_act == "newCustomer") : if ($f_cmp_comp != "" && $f_cs_eid != "" && $f_usr_phone != "" && $f_ad_street != "" && $f_ad_zipcode != "" && $f_ad_city != "" && $f_cmp_hsno != "" && ($csCurrIsCashPayer == "1" || ($f_usr_inv_email != "" && $f_usr_reminder_email != ""))) : // $f_usr_name != "" && $f_usr_firstname != "" && // Check unique account for all customers (all data) except the current one to be updated if ($f_usr_account != "" && $db->getOne("SELECT usr.usr_id FROM user AS usr WHERE usr.usr_account = '" . $f_usr_account . "' ")) : $statusMessage = getLngt("Der Benutzername existiert schon! Bitte wählen Sie einen anderen!"); elseif (FALSE && $db->getOne("SELECT cmp_comp FROM company WHERE cmp_comp = '" . $f_cmp_comp . "'")) : $statusMessage = getLngt("Der Firmenname ist bereits vorhanden! Bitte wählen Sie einen anderen!"); elseif ($db->getOne("SELECT cs_eid FROM customer WHERE cs_eid = '" . $f_cs_eid . "'")) : $statusMessage = getLngt("Die eindeutige Kundennummer (ExtID) ist bereits vergeben! Bitte wählen Sie eine andere"); // The account and password can be empty (only for customer) elseif ($f_usr_password == "" || checkPasswordValidation($f_usr_password,$f_usr_password2)) : // Check address for validation $addressValid = getGeoCoordinates($f_ad_street, $f_ad_zipcode, $f_ad_city, $f_cmp_hsno, $f_ad_country, ""); if ($addressValid != "") : // Check zipcode and city $addressValidityArray = checkCityZipcode($f_ad_zipcode, $f_ad_city, $f_ad_street); if ($noValidationOfAddress || $addressValidityArray[0] >= 1) : $currentTime = getDateTime("0"); // Execute INSERT operations $insertOk = insertCustomer(); if ($insertOk) : // Write into "servicepricehistory" insertStmt("servicepricehistory", array("srvprch_obj_type","cs", "srvprch_obj_id", $cs_id_new, "srvprch_fieldname", "cs_discount", "srvprch_price", $f_cs_discount, "srvprch_validfrom", $currentTime)); insertStmt("servicepricehistory", array("srvprch_obj_type","cs", "srvprch_obj_id", $cs_id_new, "srvprch_fieldname", "cs_prov", "srvprch_price", $f_cs_prov, "srvprch_validfrom", $currentTime)); insertStmt("servicepricehistory", array("srvprch_obj_type","cs", "srvprch_obj_id", $cs_id_new, "srvprch_fieldname", "cs_markup_prov", "srvprch_price", $f_cs_markup_prov, "srvprch_validfrom", $currentTime)); // ********** DPF ********** // Reset fields of form-parameters // clearParameters($httpVisualVars); // <= Moved to the end of the php-part of this script... $dbOperationCompleted = "1"; // Check according to personal embargo // (NOT included in transaction) $constDPFCustomerEnabled = getParameterValue("0", "DPF_CS_ENABLED", "0"); // "Meta-Global" <=> hq_id = 0 if ($constDPFCustomerEnabled == '1') : $execEmbargoCheck = "1"; $cmpId = $cmp_id_new; $eid = $f_cs_eid; $usrName = $f_usr_name; $usrFirstname = $f_usr_firstname; $adStreet = $f_ad_street; $cmpHsno = $f_cmp_hsno; $adZipcode = $f_ad_zipcode; $adCity = $f_ad_city; // = $f_ad_country; // Check for DPF checksum $oldDpfChecksum = ""; $newDpfChecksum = md5($usrFirstname . $usrName . $adStreet . $cmpHsno . $adZipcode . $adCity); updateStmt("company", "cmp_id", $cmp_id_new, array("cmp_dpf_checksum", $newDpfChecksum)); endif; // ********** HASH ********** // Check for execute functionality if ($GLOBAL_USAGE_HASH) : // Get current global number of THIS database instance $constGlobalDbInstNo = getParameterValue("0", "GLOBAL_UNIQUE_DB_INSTANCE_NO", "0", "0"); if ($constGlobalDbInstNo != "" && is_numeric($constGlobalDbInstNo)) : // Generate unique hash value e.g. for newsletter $tmpHash = makeMD5Hash($hq_id, $cs_id_new, $currentTime); // Get database instance connection data of metaobject $constExtDbInst = getExternalMetaDbInst(); $db_conn = getDbConnectionSpecial($constExtDbInst, $dbname, $dblogin, $dbpassword); $tmpSqlQuery = "INSERT meta_object.metaobject (mo_id_ref_db,mo_mnemonic,mo_name,mo_obj_type,mo_obj_id,mo_hash) VALUES ('" . $constGlobalDbInstNo . "','','','cs','" . $cs_id_new . "','" . $tmpHash . "') "; $result = $db_conn->dbQuery($tmpSqlQuery); $err = ""; if (DB::isError($result)) {$err = "ERR";}; if ($err == "ERR") : // Send info mail sendInternalMail("customer_hash_generation_failed_in_metaobjects: CS_ID=" . $cs_id_new . "|CS_EID=" . $f_cs_eid); endif; endif; endif; // ********** GDC ********** // Old EID $f_cs_eid_old = trim($f_cs_eid_old); if ($f_cs_eid_old != "") : insertStmt("genericdatacontainer", array("gdc_obj_type", "cs", "gdc_obj_id", $cs_id_new, "gdc_gen_fieldname", "eid_old", "gdc_content", $f_cs_eid_old, "gdc_context", $currentTime)); endif; // ********** PARAMETER ********** // Flag for configuration regarding "display station number" if (mcChkValOrArrCountIsEmpty($f_cs_par_tr_sort)) : $f_cs_par_tr_sort = "0"; else: $f_cs_par_tr_sort = "1"; endif; setParameterValue("JOBDETAILS_STATIONS_STATION_NUMBER_" . $cs_id_new, $f_cs_par_tr_sort); // Flag for color of the jobs in job lists if (mcChkValOrArrCountIsEmpty($f_cs_par_order_color)) : $f_cs_par_order_color = "FFFFFF"; endif; if ($f_cs_par_order_color != "FFFFFF") : setParameterValue("JOBLIST_CS_JB_COLOR_" . $cs_id_new, $f_cs_par_order_color); endif; // Flag for NOT displaying jobs in job lists if (mcChkValOrArrCountIsEmpty($f_cs_par_xxxxxxxx)) : $f_cs_par_xxxxxxxx = "0"; else: $f_cs_par_xxxxxxxx = "1"; endif; setParameterValue("CUSTOMER_MASK_JOBLIST_XXXXXXXXXX_" . $cs_id_new, $f_cs_par_xxxxxxxx); // Flag for job cancellation by customer if (mcChkValOrArrCountIsEmpty($f_cs_jb_storno)) : $f_cs_jb_storno = "0"; else: $f_cs_jb_storno = "1"; endif; setParameterValue("CUSTOMER_MASK_JOBLIST_CANCELLATION_ENABLED_" . $cs_id_new, $f_cs_jb_storno); // Flag for job disposition to favoured couriers by customer if (mcChkValOrArrCountIsEmpty($f_cs_jb_dispo)) : $f_cs_jb_dispo = "0"; else: $f_cs_jb_dispo = "1"; endif; setParameterValue("CUSTOMER_MASK_JOBLIST_DISPO_FAV_ENABLED_" . $cs_id_new, $f_cs_jb_dispo); // Flag for making standard price in customer login // if ($f_cs_par_dont_make == "" || count($f_cs_par_dont_make) == 0) : if (mcChkValOrArrCountIsEmpty($f_cs_par_dont_make)) : $f_cs_par_dont_make = "0"; else: $f_cs_par_dont_make = "1"; endif; setParameterValue("MASK_CS_DONT_MAKE_STANDARD_PRICE_" . $cs_id_new, $f_cs_par_dont_make); // Flag for calculator has to be a must for jobs of the customer // if ($f_cs_par_calc_usage == "" || count($f_cs_par_calc_usage) == 0) : if (mcChkValOrArrCountIsEmpty($f_cs_par_calc_usage)) : $f_cs_par_calc_usage = "0"; else: $f_cs_par_calc_usage = "1"; endif; setParameterValue("CUSTOMER_MASK_CALCULATOR_USAGE_ONLY_" . $cs_id_new, $f_cs_par_calc_usage); // Flag for not checking address in KAE if ($f_cs_par_cst_all_ad == "" || count($f_cs_par_cst_all_ad) == 0) : $f_cs_par_cst_all_ad = "0"; else: $f_cs_par_cst_all_ad = "1"; endif; setParameterValue("MASK_CUST_ALL_ADDR_ENABLED_" . $cs_id_new, $f_cs_par_cst_all_ad); // Flag for emails to avoid sending the footer if (mcChkValOrArrCountIsEmpty($f_cs_par_email_no_footer)) : $f_cs_par_email_no_footer = "0"; else: $f_cs_par_email_no_footer = "1"; endif; setParameterValue("JOBDETAILS_EMAIL_NO_FOOTER_" . $cs_id_new, $f_cs_par_email_no_footer); // Flag for customer to get a discount by self-creating jobs if (mcChkValOrArrCountIsEmpty($f_cs_jb_creator_discount)) : $f_cs_jb_creator_discount = "0"; else: $f_cs_jb_creator_discount = "1"; endif; setParameterValue("CUSTOMER_MASK_JB_CREATOR_DISCOUNT_" . $cs_id_new, $f_cs_jb_creator_discount); // Email arrival time if ($f_cs_par_email_arrivaltime != "" && is_numeric($f_cs_par_email_arrivaltime)) : // Check existence of parameter entry to avoid a parameter for each (new) customer if no arrivaltime will be displayed (!!!!) $tmpEmailArrTime = getParameterValue("0", "JOB_MAIL_STATION_ARRIVAL_TIME_" . $cs_id_new, "0"); if ($f_cs_par_email_arrivaltime != "0" || $tmpEmailArrTime != "") : setParameterValue("JOB_MAIL_STATION_ARRIVAL_TIME_" . $cs_id_new, $f_cs_par_email_arrivaltime); endif; endif; // Email language if ($f_cs_par_email_lng != "" && is_numeric($f_cs_par_email_lng)) : // Check existence of parameter entry to avoid a parameter for each (new) customer if language is default language (!!!!) $tmpEmailLng = getParameterValue("0", "JOBDETAILS_EMAIL_LANGUAGE_" . $cs_id_new, "0"); if ($f_cs_par_email_lng != "0" || $tmpEmailLng != "") : setParameterValue("JOBDETAILS_EMAIL_LANGUAGE_" . $cs_id_new, $f_cs_par_email_lng); endif; endif; // Flag for customer to set job being incomplete by creating or modifying a job if (mcChkValOrArrCountIsEmpty($f_cs_jb_incomplete)) : $f_cs_jb_incomplete = "0"; else: $f_cs_jb_incomplete = "1"; endif; setParameterValue("CUSTOMER_MASK_JB_INCOMPLETE_" . $cs_id_new, $f_cs_jb_incomplete); // Photos setCsPhotoConf($cs_id_new, $f_cs_photo_disabled, $f_cs_photo_hq, $f_cs_photo_cs, $f_cs_photo_range_from, $f_cs_photo_range_to); else : $statusMessage = getLngt("Der Kundendatensatz wurde nicht angelegt!"); endif; else : $statusMessage = getLngt("Die Postleitzahl bzw. Strasse passt nicht zu dem angegebenen Ort!"); $addressValidationErr = "1"; endif; else : $statusMessage = getLngt("Der Adress-Server kennt die eingebene Adresse nicht oder besitzt keine Geocodierung!"); endif; endif; else : $statusMessage = getLngt("Bitte geben Sie alle mit * gekennzeichneten Felder ein!"); endif; endif; // Modify customer if ($f_act == "modifyCustomer" && $companyId != "") : // Check customer to be modified is authenticated because of mandatory field $v_cmp_authenticated = getFieldValueFromId("company", "cmp_id", $companyId, "cmp_authenticated"); if ($f_cmp_comp != "" && $f_cs_eid != "" && $f_usr_phone != "" && $f_ad_street != "" && $f_ad_zipcode != "" && $f_ad_city != "" && $f_cmp_hsno != "" && ($v_cmp_authenticated != "1" || $csCurrIsCashPayer == "1" || ($f_usr_inv_email != "" && $f_usr_reminder_email != ""))) : // $f_usr_name != "" && $f_usr_firstname != "" && if ($f_usr_account != "" && $db->getOne("SELECT usr.usr_id FROM user AS usr " . " WHERE usr.usr_account = '" . $f_usr_account . "' AND " . " usr.usr_id != $f_usr_id")) : $statusMessage = getLngt("Der Benutzername existiert schon! Bitte wählen Sie einen anderen!"); else : if (trim($f_usr_account) == "" || $cpfs == "0" || ($cpfs == "1" && trim($f_usr_account) != "" && checkPasswordValidation($f_usr_password,$f_usr_password2))) : $sqlquery = "SELECT cs.cs_id, emp.emp_id, usr.usr_id, cs.csc_id" . " FROM user AS usr, employee AS emp, customer AS cs, company AS cmp" . " WHERE cmp.cmp_id = " . $companyId . " AND cs.cmp_id = cmp.cmp_id" . " AND emp.emp_id = cs.cs_admin" . " AND usr.usr_id = emp.usr_id"; $result = $db->dbQ($sqlquery); while ($row = $result->fetch_assoc()): $v_cs_id = $row["cs_id"]; $v_emp_id = $row["emp_id"]; $v_usr_id = $row["usr_id"]; $v_csc_id = $row["csc_id"]; endwhile; $result->free(); if ($v_cs_id != "" && $v_emp_id != "" && $v_usr_id != "" && $v_csc_id != "") : if ($db->getOne("SELECT cs_eid FROM customer WHERE cs_eid = '" . $f_cs_eid . "' AND " . " NOT (cs_id = '" . $v_cs_id . "')")) : $statusMessage = getLngt("Die eindeutige Kundennummer (ExtID) ist bereits vergeben! Bitte wählen Sie eine andere"); else : $addressValid = getGeoCoordinates($f_ad_street, $f_ad_zipcode, $f_ad_city, $f_cmp_hsno, $f_ad_country, ""); if ($addressValid != "") : // Check zipcode and city $addressValidityArray = checkCityZipcode($f_ad_zipcode, $f_ad_city, $f_ad_street); if ($noValidationOfAddress || $addressValidityArray[0] >= 1) : TA("B"); $currentTime = getDateTime("0"); // Get current price values from "servicepricehistory" $csPriceFieldsCurrent = getFieldsValueFromId("customer", "cs_id", $v_cs_id, array("cs_discount","cs_prov","cs_markup_prov")); // Get current state in cmp_modify_status because it is equal to "1" then do NOT change $modifyStatus = getFieldValueFromId("company", "cmp_id", $companyId, "cmp_modify_status"); if ($modifyStatus != "1") : $modifyStatus = "2"; endif; // Update company $f_cmp_postage = str_replace (",", ".", $f_cmp_postage); $defaultFields = array("cmp_type",$f_cmp_type,"cmp_comp",$f_cmp_comp,"cmp_comp2",$f_cmp_comp2,"cmp_comp3",$f_cmp_comp3,"cmp_comp4",$f_cmp_comp4,"cmp_hsno",$f_cmp_hsno,"cmp_iln",$f_cmp_iln, "cmp_tax_idno",$f_cmp_tax_idno,"cmp_stax_idno",$f_cmp_stax_idno,"tx_id",$g_tx_id,"br_id",$g_br_id, "emp_id_sales",$g_sales_emp_id,"cmp_sales_ranking_man",$f_cmp_sales_ranking_man, "cmp_bank",$f_cmp_bank,"cmp_bankno",$f_cmp_bankno,"cmp_bankacc",$f_cmp_bankacc,"cmp_bankmode",$f_cmp_bankmode, "cmp_iban",$f_cmp_iban,"cmp_swift",$f_cmp_swift,"cmp_hqlino",$f_cmp_hqlino,"cmp_gln",$f_cmp_gln,"cmp_postage",$f_cmp_postage,"cmp_inv2hq",$f_cmp_inv2hq,"cmp_no_longhaul",$f_cmp_no_longhaul, "cmp_match",$f_cmp_match,"cmp_match2",$f_cmp_match2,"cmp_sustainability_email",$f_cmp_sustainability_email, "cmp_sustainability_interval", $f_cmp_sustainability_interval, "cmp_remark",$f_cmp_remark,"cmp_remark2",$f_cmp_remark2, "cmp_dsgvo", $f_cmp_dsgvo, "cmp_newsletter",$f_cmp_newsletter,"cmp_proof_delivery",$f_cmp_proof_delivery,"cmp_pda_usage", $f_cmp_pda_usage,"cmp_modify_status", $modifyStatus); updateStmt("company","cmp_id",$companyId,$defaultFields); // Update customer $f_cs_discount = str_replace (",", ".", $f_cs_discount); $f_cs_prov = str_replace (",", ".", $f_cs_prov); $f_cs_markup_prov = str_replace (",", ".", $f_cs_markup_prov); $defaultFields = array("cs_eid",$f_cs_eid,"csc_id_payer",$g_csc_id,"cs_id_parent",$g2_cs_id,"cs_discount",$f_cs_discount,"cs_invmode",$f_cs_invmode,"cs_jbstatusmail2csc",$f_cs_jbstatusmail2csc,"cs_jbstatusmail_price", $f_cs_jbstatusmail_price,"cs_jbstatusmail_emp",$f_cs_jbstatusmail_emp,"cs_jbstatusmail_pdf",$f_cs_jbstatusmail_pdf,"cs_jbstatusmail_fields",$f_cs_jbstatusmail_fields,"cs_jbstatusmail",$f_cs_jbstatusmail,"cs_jbstatusmail2",$f_cs_jbstatusmail2,"cs_jbstatusmail3",$f_cs_jbstatusmail3,"cs_jb_jam_waittime",$f_cs_jb_jam_waittime,"cs_jb_jam_waittime_minutes",$f_cs_jb_jam_waittime_minutes,"cs_commission_no",$f_cs_commission_no,"cs_cr_fav_only",$f_cs_cr_fav_only,"cs_jobbatch",$f_cs_jobbatch,"cs_jbedit",$f_cs_jbedit,"cs_ar",$f_cs_ar,"cs_invtext_mode",$f_cs_invtext_mode,"cs_fixprice_discount",$f_cs_fixprice_discount,"cs_prov",$f_cs_prov,"cs_markup",$f_cs_markup, "cs_markup_prov", $f_cs_markup_prov, "cs_price_warn_uncomplete", $f_cs_price_warn_uncomplete, "cs_joblist_disabled", $f_cs_joblist_disabled, "cs_charging_time", $f_cs_charging_time, "cs_blur_markup_time", $f_cs_blur_markup_time, "cs_payment_term", $f_cs_payment_term); updateStmt("customer","cs_id",$v_cs_id,$defaultFields); // Update user $defaultFields = array("usr_name",$f_usr_name,"usr_firstname",$f_usr_firstname,"usr_email",$f_usr_email,"usr_inv_email",$f_usr_inv_email,"usr_reminder_email",$f_usr_reminder_email,"usr_phone",$f_usr_phone,"usr_phone2",$f_usr_phone2,"usr_fax",$f_usr_fax,"usr_account",$f_usr_account); updateStmt("user","usr_id",$v_usr_id,$defaultFields); // Update user, only password-field if ($cpfs == "1") : $sqlStmtPwd = "UPDATE user SET usr_password = PASSWORD('" . $f_usr_password . "'), usr_password_modify = '" . $currentTime . "' WHERE usr_id = '" . $v_usr_id . "'"; $res = $db->query($sqlStmtPwd); if (DB::isError($res)) : die ("$PHP_SELF: " . $res->getMessage()); endif; endif; if (trim($f_usr_account) == "") : $sqlStmtPwd = "UPDATE user SET usr_password = '' WHERE usr_id = '" . $v_usr_id . "'"; $res = $db->query($sqlStmtPwd); if (DB::isError($res)) : die ("$PHP_SELF: " . $res->getMessage()); endif; endif; // Insert address $tmpArray = insertAddress($f_ad_street, $f_ad_zipcode, $f_ad_city, "", $f_ad_country, $noValidationOfAddress); $ad_id_new = $tmpArray[0]; // Update (the new) company-entry with address-id updateStmt("company", "cmp_id", $companyId, array("ad_id", $ad_id_new)); // * Perhaps also change the name of the root-costcenter! But think of changing all // * path-entries, too!!! PRESENTLY IT IS NOT NECESSARY TO IMPLEMENT! // Update costcenter // $defaultFields = array("csc_name",$f_cmp_comp); // updateStmt("costcenter","csc_id",$v_csc_id,$defaultFields); // Update costcenter addresses if requested // Only root costcenter addresses if ($f_ad_changemode == "1") : if ($changeBeneficiaryAddress) : updateStmt("costcenteraddress","csc_id",$v_csc_id,array("ad_id", $ad_id_new, "cscad_hsno", $f_cmp_hsno),"adt_id = 1"); endif; if ($changeInvoiceAddress) : updateStmt("costcenteraddress","csc_id",$v_csc_id,array("ad_id", $ad_id_new, "cscad_hsno", $f_cmp_hsno),"adt_id = 2"); endif; if ($changePickUpAddress) : updateStmt("costcenteraddress","csc_id",$v_csc_id,array("ad_id", $ad_id_new, "cscad_hsno", $f_cmp_hsno),"adt_id = 4"); endif; endif; // ALL costcenter addresses if ($f_ad_changemode == "2") : // First get all costcenters of the current customer $sqlquery = "SELECT csc.csc_id FROM costcenter AS csc WHERE csc.cs_id = " . $v_cs_id; $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); $cscIdArray = array(); while ($row = $result->fetch_assoc()): $cscIdArray[] = $row["csc_id"]; endwhile; $result->free(); if (count($cscIdArray) > 0) : if ($changeBeneficiaryAddress) : $sqlStmtAdress = "UPDATE costcenteraddress SET ad_id = '" . $ad_id_new . "', cscad_hsno = '" . $f_cmp_hsno . "'" . " WHERE adt_id = '1' AND csc_id IN (" . implode($cscIdArray, ",") . ")"; $res = $db->query($sqlStmtAdress); if (DB::isError($res)) die ("$PHP_SELF:
$sqlStmt
" . $res->getMessage()); endif; if ($changeInvoiceAddress) : $sqlStmtAdress = "UPDATE costcenteraddress SET ad_id = '" . $ad_id_new . "', cscad_hsno = '" . $f_cmp_hsno . "'" . " WHERE adt_id = '2' AND csc_id IN (" . implode($cscIdArray, ",") . ")"; $res = $db->query($sqlStmtAdress); if (DB::isError($res)) die ("$PHP_SELF:
$sqlStmt
" . $res->getMessage()); endif; if ($changePickUpAddress) : $sqlStmtAdress = "UPDATE costcenteraddress SET ad_id = '" . $ad_id_new . "', cscad_hsno = '" . $f_cmp_hsno . "'" . " WHERE adt_id = '4' AND csc_id IN (" . implode($cscIdArray, ",") . ")"; $res = $db->query($sqlStmtAdress); if (DB::isError($res)) die ("$PHP_SELF:
$sqlStmt
" . $res->getMessage()); endif; endif; endif; // Update costcenter company names if requested // Only root costcenter company name if ($f_cmp_changemode == "1") : if ($changeBeneficiaryCompany) : updateStmt("costcenteraddress","csc_id",$v_csc_id,array("cscad_comp", $f_cmp_comp, "cscad_comp2", $f_cmp_comp2, "cscad_comp3", $f_cmp_comp3, "cscad_comp4", $f_cmp_comp4),"adt_id = 1"); endif; if ($changeInvoiceCompany) : updateStmt("costcenteraddress","csc_id",$v_csc_id,array("cscad_comp", $f_cmp_comp, "cscad_comp2", $f_cmp_comp2, "cscad_comp3", $f_cmp_comp3, "cscad_comp4", $f_cmp_comp4),"adt_id = 2"); endif; if ($changePickUpCompany) : updateStmt("costcenteraddress","csc_id",$v_csc_id,array("cscad_comp", $f_cmp_comp, "cscad_comp2", $f_cmp_comp2, "cscad_comp3", $f_cmp_comp3, "cscad_comp4", $f_cmp_comp4),"adt_id = 4"); endif; endif; // ALL costcenter addresses if ($f_cmp_changemode == "2") : // First get all costcenters of the current customer $sqlquery = "SELECT csc.csc_id FROM costcenter AS csc WHERE csc.cs_id = " . $v_cs_id; $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); $cscIdArray = array(); while ($row = $result->fetch_assoc()): $cscIdArray[] = $row["csc_id"]; endwhile; $result->free(); if (count($cscIdArray) > 0) : if ($changeBeneficiaryCompany) : $sqlStmtAdress = "UPDATE costcenteraddress SET cscad_comp = '" . $f_cmp_comp . "', cscad_comp2 = '" . $f_cmp_comp2 . "', cscad_comp3 = '" . $f_cmp_comp3 . "', cscad_comp4 = '" . $f_cmp_comp4 . "'" . " WHERE adt_id = '1' AND csc_id IN (" . implode($cscIdArray, ",") . ")"; $res = $db->query($sqlStmtAdress); if (DB::isError($res)) die ("$PHP_SELF:
$sqlStmt
" . $res->getMessage()); endif; if ($changeInvoiceCompany) : $sqlStmtAdress = "UPDATE costcenteraddress SET cscad_comp = '" . $f_cmp_comp . "', cscad_comp2 = '" . $f_cmp_comp2 . "', cscad_comp3 = '" . $f_cmp_comp3 . "', cscad_comp4 = '" . $f_cmp_comp4 . "'" . " WHERE adt_id = '2' AND csc_id IN (" . implode($cscIdArray, ",") . ")"; $res = $db->query($sqlStmtAdress); if (DB::isError($res)) die ("$PHP_SELF:
$sqlStmt
" . $res->getMessage()); endif; if ($changePickUpCompany) : $sqlStmtAdress = "UPDATE costcenteraddress SET cscad_comp = '" . $f_cmp_comp . "', cscad_comp2 = '" . $f_cmp_comp2 . "', cscad_comp3 = '" . $f_cmp_comp3 . "', cscad_comp4 = '" . $f_cmp_comp4 . "'" . " WHERE adt_id = '4' AND csc_id IN (" . implode($cscIdArray, ",") . ")"; $res = $db->query($sqlStmtAdress); if (DB::isError($res)) die ("$PHP_SELF:
$sqlStmt
" . $res->getMessage()); endif; endif; endif; // Write logdata into log database writeToLogDB("36",$hq_id,"",$usr_id,"","",$v_cs_id,"STATUS_MODIFIED=" . $logString); // Tracking if ($f_cmp_type != "0") : $f_cs_tracking = "0"; // Overwrite if state is changed endif; updateStmt("customer","cs_id",$v_cs_id,array("cs_tracking", $f_cs_tracking)); // Write to "servicepricehistory" if ($csPriceFieldsCurrent[0] != $f_cs_discount) : insertStmt("servicepricehistory", array("srvprch_obj_type","cs", "srvprch_obj_id", $v_cs_id, "srvprch_fieldname", "cs_discount", "srvprch_price", $f_cs_discount, "srvprch_validfrom", $currentTime)); endif; if ($csPriceFieldsCurrent[1] != $f_cs_prov) : insertStmt("servicepricehistory", array("srvprch_obj_type","cs", "srvprch_obj_id", $v_cs_id, "srvprch_fieldname", "cs_prov", "srvprch_price", $f_cs_prov, "srvprch_validfrom", $currentTime)); endif; if ($csPriceFieldsCurrent[2] != $f_cs_markup_prov) : insertStmt("servicepricehistory", array("srvprch_obj_type","cs", "srvprch_obj_id", $v_cs_id, "srvprch_fieldname", "cs_markup_prov", "srvprch_price", $f_cs_markup_prov, "srvprch_validfrom", $currentTime)); endif; // Generate report entry if ($f_cmp_current_type != $f_cmp_type) : // First get user id of the sales employee created this customer dataset $usr_id_type = $db->getOne("SELECT usr_id FROM phoenix_log.log WHERE logo_id = 95 AND cs_id = " . $v_cs_id . " AND logo_description LIKE '%|OLD=|%'"); $tmpReportText = getLngt("Änderung in") . " " . $pageTitel; $tmpRpReportType = getParameterValue("0", "CS_CMPTYPE2RPTYPE_MODIFY", "0"); if ($tmpRpReportType == "") : $tmpRpReportType = "1"; endif; if ($f_cmp_type == "0") : $tmpRpReportType = getParameterValue("0", "CS_CMPTYPE2RPTYPE_MODIFY_2", "0"); if ($tmpRpReportType == "") : $tmpRpReportType = "2"; endif; endif; insertStmt("phoenix_group.report_process", array("usr_id", $usr_id, "hq_id", $hq_id, "rp_reporttype", $tmpRpReportType, "rp_text", $tmpReportText, "rp_createtime", $currentTime, "rp_objId", $v_cs_id, "rp_objtype", "cs")); // Set special date if data row is set to "customer state" if ($f_cmp_type == "0") : $currentDate = getDateTime("3"); updateStmt("customer","cs_id",$v_cs_id,array("cs_become_cs_date", $currentDate)); endif; // Write SALES logdata into log database writeToLogDB("95",$hq_id,"",$usr_id_type,"","",$v_cs_id,"SRC=cs|OLD=" . $f_cmp_current_type . "|NEW=" . $f_cmp_type); endif; $f_cmp_current_type = $f_cmp_type; TA("C"); TA("E"); $dbOperationCompleted = "1"; // Check according to personal embargo // (NOT included in transaction) $constDPFCustomerEnabled = getParameterValue("0", "DPF_CS_ENABLED", "0"); // "Meta-Global" <=> hq_id = 0 if ($constDPFCustomerEnabled == '1') : $execEmbargoCheck = "1"; $cmpId = $companyId; $eid = $f_cs_eid; $usrName = $f_usr_name; $usrFirstname = $f_usr_firstname; $adStreet = $f_ad_street; $cmpHsno = $f_cmp_hsno; $adZipcode = $f_ad_zipcode; $adCity = $f_ad_city; // = $f_ad_country; // Check for DPF checksum $oldDpfChecksum = getFieldValueFromId("company", "cmp_id", $companyId, "cmp_dpf_checksum"); $newDpfChecksum = md5($usrFirstname . $usrName . $adStreet . $cmpHsno . $adZipcode . $adCity); if ($oldDpfChecksum == $newDpfChecksum) : $execEmbargoCheck = "0"; else : updateStmt("company", "cmp_id", $companyId, array("cmp_dpf_checksum", $newDpfChecksum)); endif; endif; // ********** GDC ********** // Old EID $tmpCsEidOld = getFieldValueFromClause("genericdatacontainer","gdc_content","gdc_obj_type = 'cs' AND gdc_gen_fieldname = 'eid_old' AND gdc_obj_id = '" . $v_cs_id . "'"); if ($tmpCsEidOld != "" || $f_cs_eid_old != "") : if (existsEntry("genericdatacontainer", array("gdc_obj_type", "cs", "gdc_gen_fieldname", "eid_old", "gdc_obj_id", $v_cs_id))) : updateStmt("genericdatacontainer","gdc_obj_type","cs",array("gdc_content", $f_cs_eid_old, "gdc_context", $currentTime),"gdc_obj_id = '" . $v_cs_id . "' AND gdc_gen_fieldname = 'eid_old'"); else : insertStmt("genericdatacontainer", array("gdc_obj_type", "cs", "gdc_obj_id", $v_cs_id, "gdc_gen_fieldname", "eid_old", "gdc_content", $f_cs_eid_old, "gdc_context", $currentTime)); endif; endif; // ********** PARAMETER ********** // Flag for configuration regarding "display station number" if (mcChkValOrArrCountIsEmpty($f_cs_par_tr_sort)) : $f_cs_par_tr_sort = "0"; else: $f_cs_par_tr_sort = "1"; endif; setParameterValue("JOBDETAILS_STATIONS_STATION_NUMBER_" . $v_cs_id, $f_cs_par_tr_sort); // Flag for color of the jobs in job lists if (mcChkValOrArrCountIsEmpty($f_cs_par_order_color)) : $f_cs_par_order_color = "FFFFFF"; endif; if ($f_cs_par_order_color != "FFFFFF" || ($f_cs_par_order_color == "FFFFFF" && existsEntry("parameter",array("par_key","JOBLIST_CS_JB_COLOR_" . $v_cs_id)))) : setParameterValue("JOBLIST_CS_JB_COLOR_" . $v_cs_id, $f_cs_par_order_color); endif; // Flag for NOT displaying jobs in job lists if (mcChkValOrArrCountIsEmpty($f_cs_par_xxxxxxxx)) : $f_cs_par_xxxxxxxx = "0"; else: $f_cs_par_xxxxxxxx = "1"; endif; setParameterValue("CUSTOMER_MASK_JOBLIST_XXXXXXXXXX_" . $v_cs_id, $f_cs_par_xxxxxxxx); // Flag for job cancellation by customer if (mcChkValOrArrCountIsEmpty($f_cs_jb_storno)) : $f_cs_jb_storno = "0"; else: $f_cs_jb_storno = "1"; endif; setParameterValue("CUSTOMER_MASK_JOBLIST_CANCELLATION_ENABLED_" . $v_cs_id, $f_cs_jb_storno); // Flag for job disposition to favoured couriers by customer if (mcChkValOrArrCountIsEmpty($f_cs_jb_dispo)) : $f_cs_jb_dispo = "0"; else: $f_cs_jb_dispo = "1"; endif; setParameterValue("CUSTOMER_MASK_JOBLIST_DISPO_FAV_ENABLED_" . $v_cs_id, $f_cs_jb_dispo); // Flag for making standard price in customer login if (mcChkValOrArrCountIsEmpty($f_cs_par_dont_make)) : $f_cs_par_dont_make = "0"; else: $f_cs_par_dont_make = "1"; endif; setParameterValue("MASK_CS_DONT_MAKE_STANDARD_PRICE_" . $v_cs_id, $f_cs_par_dont_make); // Flag for calculator has to be a must for jobs of the customer if (mcChkValOrArrCountIsEmpty($f_cs_par_calc_usage)) : $f_cs_par_calc_usage = "0"; else: $f_cs_par_calc_usage = "1"; endif; setParameterValue("CUSTOMER_MASK_CALCULATOR_USAGE_ONLY_" . $v_cs_id, $f_cs_par_calc_usage); // Flag for not checking address in KAE if ($f_cs_par_cst_all_ad == "" || count($f_cs_par_cst_all_ad) == 0) : $f_cs_par_cst_all_ad = "0"; else: $f_cs_par_cst_all_ad = "1"; endif; setParameterValue("MASK_CUST_ALL_ADDR_ENABLED_" . $v_cs_id, $f_cs_par_cst_all_ad); // Flag for emails to avoid sending the footer if (mcChkValOrArrCountIsEmpty($f_cs_par_email_no_footer)) : $f_cs_par_email_no_footer = "0"; else: $f_cs_par_email_no_footer = "1"; endif; setParameterValue("JOBDETAILS_EMAIL_NO_FOOTER_" . $v_cs_id, $f_cs_par_email_no_footer); // Flag for customer to get a discount by self-creating jobs if (mcChkValOrArrCountIsEmpty($f_cs_jb_creator_discount)) : $f_cs_jb_creator_discount = "0"; else: $f_cs_jb_creator_discount = "1"; endif; setParameterValue("CUSTOMER_MASK_JB_CREATOR_DISCOUNT_" . $v_cs_id, $f_cs_jb_creator_discount); // Email arrival time if ($f_cs_par_email_arrivaltime != "" && is_numeric($f_cs_par_email_arrivaltime)) : // Check existence of parameter entry to avoid a parameter for each (new) customer if no arrivaltime will be displayed (!!!!) $tmpEmailArrTime = getParameterValue("0", "JOB_MAIL_STATION_ARRIVAL_TIME_" . $v_cs_id, "0"); if ($f_cs_par_email_arrivaltime != "0" || $tmpEmailArrTime != "") : setParameterValue("JOB_MAIL_STATION_ARRIVAL_TIME_" . $v_cs_id, $f_cs_par_email_arrivaltime); endif; endif; // Email language if ($f_cs_par_email_lng != "" && is_numeric($f_cs_par_email_lng)) : // Check existence of parameter entry to avoid a parameter for each (new) if language is default language (!!!!) $tmpEmailLng = getParameterValue("0", "JOBDETAILS_EMAIL_LANGUAGE_" . $v_cs_id, "0"); if ($f_cs_par_email_lng != "0" || $tmpEmailLng != "") : setParameterValue("JOBDETAILS_EMAIL_LANGUAGE_" . $v_cs_id, $f_cs_par_email_lng); endif; endif; // Flag for customer to set job being incomplete by creating or modifying a job if (mcChkValOrArrCountIsEmpty($f_cs_jb_incomplete)) : $f_cs_jb_incomplete = "0"; else: $f_cs_jb_incomplete = "1"; endif; setParameterValue("CUSTOMER_MASK_JB_INCOMPLETE_" . $v_cs_id, $f_cs_jb_incomplete); // Photos setCsPhotoConf($v_cs_id, $f_cs_photo_disabled, $f_cs_photo_hq, $f_cs_photo_cs, $f_cs_photo_range_from, $f_cs_photo_range_to); else : $statusMessage = getLngt("Die Postleitzahl passt nicht zu dem angegebenen Ort!"); $addressValidationErr = "1"; endif; else : $statusMessage = getLngt("Der Adress-Server kennt die eingebene Adresse nicht oder besitzt keine Geocodierung!"); endif; endif; else : $statusMessage = getLngt("Datenfehler! Merken Sie sich bitte den Datensatz und kontaktieren uns!!!"); endif; endif; // account empty or not empty and checked by passwordcheck endif; else : $statusMessage = getLngt("Bitte geben Sie alle mit * gekennzeichneten Felder ein!"); endif; endif; // Delete customer if ($f_act == "removeCustomer" && $companyId != "") : if (!existsEntry("company",array("cmp_id",$companyId))) : // if (getDbFieldValues("employee",array("usr_id"),array("emp_id",$emp_id_act))) : // TA("B"); // deleteStmt("employee","emp_id = ".$emp_id_act); // deleteStmt("user","usr_id = ".$usr_id_new); // // Write logdata into log database // $v_cs_id = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); // writeToLogDB("42",$hq_id,"",$usr_id,"","",$v_cs_id,"STATUS_DELETED"); // TA("C"); // TA("E"); // else : // $statusMessage = "Datenfehler! Merken Sie sich bitte den Datensatz und kontaktieren uns!!!"; // endif; else : $statusMessage = getLngt("Der Kunde existiert nicht!"); endif; endif; // Set status of authentication of the customer if ($f_act == "setAuthentication") : // Check for company if ($companyId != "") : if (existsEntry("company",array("cmp_id",$companyId))) : // Check for existing jobs in the future $futureJobListStr = ""; if ($f_cmp_authenticated != "1") : $futureJobList = getColVectorFromDB2ArrayByClause("company AS cmp, customer AS cs, costcenter AS csc, job AS jb", "jb.jb_id", "cmp.cmp_id = '" . $companyId . "' AND cmp.cmp_id = cs.cmp_id AND cs.cs_id = csc.cs_id AND csc.csc_id = jb.csc_id_payer AND jb.jb_status != '2' AND jb.jb_finishtime > DATE_SUB(NOW(), INTERVAL 1 MONTH)"); if (count($futureJobList) > 0) : $futureJobListStr = implode(",", $futureJobList); endif; endif; if ($f_cmp_authenticated == "1" || $futureJobListStr == "") : // Check in case the courier shall be set free but he/she is noticeable according to embargo check $currentDPFState = getFieldValueFromId("company", "cmp_id", $companyId, "cmp_dpf_state"); if ($f_cmp_authenticated == "1" && $currentDPFState >= "1" && $currentDPFState <= "9") : // Update DPF state // Attention: Description of the states look for "dpf.php" $newDPFState = $currentDPFState + 10; updateStmt("company","cmp_id",$companyId,array("cmp_dpf_state",$newDPFState)); endif; // Update authentication-status updateStmt("company","cmp_id",$companyId,array("cmp_authenticated",$f_cmp_authenticated)); // Write logdata into log database $v_cs_id = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); writeToLogDB("38",$hq_id,"",$usr_id,"","",$v_cs_id,"STATUS_AUTHENTICATION=".$f_cmp_authenticated); else : $statusMessage = getLngt("Der spezifizierte Kunde kann noch nicht gesperrt werden. Es existieren noch die folgenden zukünftigen Aufträge: " . $futureJobListStr); endif; else : $statusMessage = getLngt("Der spezifizierte Kunde ist nicht im Datenbestand erhalten!"); endif; else : $statusMessage = getLngt("Sie haben keinen Kunden spezifiziert!"); endif; endif; // Set status of visibility of the customer if ($f_act == "setVisibility") : // Check for company if ($companyId != "") : if (existsEntry("company",array("cmp_id",$companyId))) : // Update authentication-status updateStmt("company","cmp_id",$companyId,array("cmp_visible",$f_cmp_visible)); // Write logdata into log database $v_cs_id = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); writeToLogDB("40",$hq_id,"",$usr_id,"","",$v_cs_id,"STATUS_VISIBILITY=".$f_cmp_visible); else : $statusMessage = getLngt("Der spezifizierte Kunde ist nicht im Datenbestand erhalten!"); endif; else : $statusMessage = getLngt("Sie haben keinen Kunden spezifiziert!"); endif; endif; // Set status of cash mode of the customer if ($f_act == "setCashmode") : // Check for company if ($companyId != "") : if (existsEntry("company",array("cmp_id",$companyId))) : // Update authentication-status updateStmt("company","cmp_id",$companyId,array("cmp_cashmode",$f_cmp_cashmode)); // Write logdata into log database $v_cs_id = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); writeToLogDB("44",$hq_id,"",$usr_id,"","",$v_cs_id,"STATUS_CASHMODE=".$f_cmp_cashmode); else : $statusMessage = getLngt("Der spezifizierte Kunde ist nicht im Datenbestand erhalten!"); endif; else : $statusMessage = getLngt("Sie haben keinen Kunden spezifiziert!"); endif; endif; // Set state of completition of all current jobs of the customer if ($f_act == "setJobCompleteMulti") : // Check for company if ($companyId != "") : if (existsEntry("company",array("cmp_id",$companyId))) : $v_cs_id = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); // Select all incomplete jobs of the customer to be set to state "complete" $jbSqlquery = "SELECT jb.jb_id" . " FROM customer AS cs, costcenter AS csc, job AS jb" . " WHERE cs.cs_id = '" . $v_cs_id . "' AND cs.cs_id = csc.cs_id AND csc.csc_id = jb.csc_id_payer AND" . " jb.jb_status = '2' AND jb.cr_sid != '' AND jb.cr_id != '' AND jb.jb_totalprice != 0 AND" . " vht_id != '0' AND jb.jb_incomplete = '1' AND " . " (ISNULL(jb.jb_storno) OR jb.jb_storno = '0') AND " . " jb.jb_finishtime > '" . getDateTime("date_plus_offset", array(-1,0,0), "Y-m-d") . " 00:00:00' AND" . " (ISNULL(jb.jb_export_time) OR jb.jb_export_time = '0000-00-00 00:00:00')"; $result = $db->query($jbSqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); $tmpJbArray = array(); while ($row = $result->fetch_assoc()): $tmpJbArray[] = $row["jb_id"]; endwhile; // Update completition state $tmpJbString = ""; $tmpJbArrayLen = count($tmpJbArray); if ($tmpJbArrayLen > 0) : $tmpJbString = implode(",",$tmpJbArray); updateStmt("job","","",array("jb_incomplete","0"),"jb_id IN (" . $tmpJbString . ")"); $statusMessage = getLngt("Anzahl der Aufträge: " . $tmpJbArrayLen); else : $statusMessage = getLngt("Es wurde kein Auftrag gegriffen und auf fertig gesetzt!"); endif; // Write logdata into log database writeToLogDB("94",$hq_id,"",$usr_id,"","",$v_cs_id,"JOBS=".$tmpJbString); else : $statusMessage = getLngt("Der spezifizierte Kunde ist nicht im Datenbestand erhalten!"); endif; else : $statusMessage = getLngt("Sie haben keinen Kunden spezifiziert!"); endif; endif; // Send sustainability report to the customer if ($f_act == "sendSustainabilityReport") : // Check for company if ($companyId != "") : if (existsEntry("company",array("cmp_id",$companyId))) : $v_cs_id = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); $csIsMeta = false; $tmpCsIdsSub = getColVectorFromDB2ArrayByClause("customer", "cs_id", "cs_id_parent = '" . $v_cs_id . "'"); if (count($tmpCsIdsSub) > 0) : $csIsMeta = true; endif; // Call script for (meta-)customer $path = getAbsoluteSystemPath(); $passwd = "acapella7890"; $cmd = "php " . $path . "/tools/auto_trigger_jobs_sustainability_customer_report.php " . $passwd . " " . ($csIsMeta ? "cs_meta" : "cs") . " " . $v_cs_id . " " . $f_cmp_sustainability_interval . " &"; $cmdOutput = null; exec($cmd, $cmdOutput); // print_r($cmdOutput); echo "\n\n"; // Write logdata into log database writeToLogDB("176",$hq_id,"",$usr_id,"","",$v_cs_id,"EMAIL SENT"); else : $statusMessage = getLngt("Der spezifizierte Kunde ist nicht im Datenbestand erhalten!"); endif; else : $statusMessage = getLngt("Sie haben keinen Kunden spezifiziert!"); endif; endif; // Reset 2-FA if ($f_act == "reset2FACustomer") : // Check for company if ($companyId != "") : if (existsEntry("company",array("cmp_id",$companyId))) : $v_cs_id = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); $retVal = user2FARemove($v_cs_id, "cs"); $statusMessage = $retVal[1]; else : $statusMessage = getLngt("Der spezifizierte Kunde ist nicht im Datenbestand erhalten!"); endif; else : $statusMessage = getLngt("Sie haben keinen Kunden spezifiziert!"); endif; endif; // ********************************** // * Selection of the customer data * // ********************************** // Gets ALL data from a special customer getCustomer($companyId); // Get max-value of the EID of the current customer for inserting a new row // The constant value "CS_EID_GENERATION" contains the prefix of the SID [SPECIAL TREATMENT] $f_eid_maxval = ""; // $csEidGeneration = getParameterValue("0", "CS_EID_GENERATION"); if (CS_EID_GENERATION != "") : $f_eid_maxval = getMaxOfField("customer", "cs_eid", "cs_eid < '" . CS_EID_GENERATION . "'"); if (is_numeric($f_eid_maxval)) : ++$f_eid_maxval; // Increment because of the next free EID (Attention: Not TA-safe!) else : // Remove alphanumeric chars (e.g "HTHB123456" => "123456") $prefixChars = ereg_replace("[^[:alpha:]+]","",$f_eid_maxval); $f_eid_maxval = ereg_replace("[^[:digit:]+]","",$f_eid_maxval); ++$f_eid_maxval; $f_eid_maxval = $prefixChars . $f_eid_maxval; endif; endif; // Get number of contacts of the current customer $numOfContacts = getCountOfTable("metafieldvalue AS mtfv, metafieldcategorykey AS mtfck, metafieldkey AS mtfk", "mtfv.mtfv_value = '" . $f_cs_id . "' AND mtfck.mtfc_id = '1' AND mtfv.mtfck_id = mtfck.mtfck_id AND mtfk.mtfk_id = mtfck.mtfk_id AND mtfk.mtfk_type = 'co2cs'"); // Check if a copy of the current customer is requested. // If it is then reset some values if ($copyCs == "1") : $companyId = ""; $f_cs_eid = ""; $statusMessage = getLngt("ACHTUNG: Aus Sicherheitsgründen werden ausschließlich Daten des Stammblatts kopiert! Filter, Services, Kostenstellen, etc. sind entsprechend nachträglich zuzuweisen!"); // Special case for third party payer $constCsCopyNoThirdParty = getParameterValue("0", "CS_COPY_NO_THIRD_PARTY", $hq_id); if ($constCsCopyNoThirdParty == "1") : $g_csc_id = ""; $g_cs_id = ""; $g_cscad_comp = ""; $statusMessage .= " " . getLngt("Der Drittzahler wurde ebenfalls entfernt!"); endif; endif; if ($companyId != "") : // YYYYYYYYYYYYYYYYYYYYYYYYYY endif; // Only for output $pageHeadline = getLngt("NEUER KUNDE"); $title = "
" . getLngt("Typ:") . "  
"; $title2 = $pageHeadline; $leftColWidth = "140px"; $buttonContacts = ""; $buttonAppointments = ""; $buttonDocuments = ""; $buttonCourier = ""; $buttonAuthentication = ""; $buttonVisibility = ""; $buttonCashmode = ""; $buttonGroup = ""; $buttonContact = ""; $buttonPage2 = ""; $buttonCopyCustomer = ""; $buttonJobComplete = ""; $displayTextAuthentication = ""; $displayTextVisibility = ""; $confirmTextAuthentication = ""; $confirmTextVisibility = ""; $confirmTextCashmode = ""; $serviceLink1 = ""; $serviceLink2 = ""; $serviceLink3 = ""; $serviceLink4 = ""; $buttonFilter = ""; $buttonService = ""; $buttonReport = ""; $buttonCostcenter = ""; $buttonCsHistory = ""; $buttonReset2FA = ""; if ($companyId != "") : $pageHeadline = ($f_cmp_type > "0" ? "" . $pageTitel . "" : "" . $pageTitel . "") . "     " . substr($f_cmp_comp . " " . $f_cmp_comp2, 0, 100); $title = ""; $title2 = substr($f_cmp_comp . " " . $f_cmp_comp2, 0, 100); // Show mandator if (authCheckEmployeeRights($emp_id, "10")) : // Name of the headquarter $hq_name = getFieldValueFromId("headquarters", "hq_id", $f_cs_hq_id, "hq_name"); $pageHeadline .= "    " . "[" . $hq_name . "]"; endif; // Type of the customer (customer, prospect, ...) // No job may be associated to the customer !!! if ($showCmpTypeSelection) : $title .= "
"; $title .= "" . getLngt("Typ:") . "  "; $title .= "      "; $title .= "
"; $pageHeadline .= "    " . "" . getLngt("Typ:") . "  "; endif; // Parent customer $title .= "
" . getLngt("Übergeordneter Kunde:") . "  " . " " . "  
" . defineButtonType08("...", "action_meta", "searchCsCsc('10000000000011','2','');", "30", "left", "2") . "
       
"; $importPath = ""; if (authCheckEmployeeRights($emp_id, "11")) : // Number of contacts if (is_numeric($numOfContacts)) : $buttonContacts = defineButtonType10(getLngt("Kontakte") . ": " . $numOfContacts, "action_co", "openContacts('" . ec($f_cs_id) . "');", "200", "left", "0"); endif; // Number of appointments $f_selUsrId = $usr_id; // Used variable for appointments $f_ap_visibility_search = array("1","2","3","4","5","6","7","8"); // Used variable for appointments $csAppointments = getAppointmentsFromDB(getDateTime("year"), getDateTime("month"), getDateTime("day"), getDateTime("year") + 1, "12", "31", $f_cs_id); $numOfAppointments = count($csAppointments); $buttonAppointments = defineLinkButtonType10(getLngt("Termine") . ": " . $numOfAppointments, "action_ap_cs", "../groupware/appointment.php?viewMode=" . ec(3) . "&csSpecial=" . ec($f_cs_id), "200", "left", "0"); // Get path for customer data (type "CS") if ($importPath == "") : $importPath = getFieldValueFromId("mandator","md_id",$md_id,"md_doc_path"); endif; $importPath = getPathForObjectData($importPath, "CS"); endif; // Get number of documents for the current customer $csNumOfFiles = getNumOfFilesByFilterInFolder($importPath, $f_cs_eid . "_", "1"); $buttonDocuments = defineLinkButtonType10(getLngt("Dokumente") . ": " . ($csNumOfFiles != "-1" ? $csNumOfFiles : "0"), "action_dt_cs", "../import/data_transfer.php?objType=cs&objId=" . ec($f_cs_id), "200", "left", "0"); $buttonCourier = defineButtonType10(getLngt("Transporteure"), "action_cr", "openCustomerCouriers();", "120", "left", "0"); $buttonFilter = defineButtonType10(getLngt("Filter"), "action_crf", "openCustomerFilters();", "120", "left", "0"); $buttonService = defineButtonType10(getLngt("Services"), "action_srv", "openCustomerServices();", "120", "left", "0"); $buttonReport = defineButtonType10(getLngt("Berichte"), "action_rp", "openCustomerReports('" . $f_cs_eid . "');", "120", "left", "0"); $buttonCopyCustomer = defineButtonType10(getLngt("Kopie"), "action_copy", "copyCustomer();", "120", "left", "0"); $buttonGroup = defineButtonType10(getLngt("Gruppen"), "action_grp", "openGroups('" . ec($f_cs_id) . "');", "120", "left", "0"); $buttonContact = defineButtonType10(getLngt("Kontakte"), "action_co", "openContacts('" . ec($f_cs_id) . "');", "120", "left", "0"); if (authCheckEmployeeRights($emp_id, "21")) : $buttonJobComplete = defineButtonType10(getLngt("Ausbuchen"), "action_jb", "jobCompleteFinishPage();", "120", "left", "0"); endif; $buttonPage2 = defineButtonType10(getLngt("2. Seite"), "action_2ndpage", "openMetaFieldSpecial('" . ec($f_cs_id) . "');", "120", "left", "0"); $buttonAuthentication = defineButtonType10(getLngt("Sperren"), "action_lock", "authenticationFinishPage();", "120", "left", "0"); $confirmTextAuthentication = getLngt("Soll der Kunde wirklich gesperrt werden?"); if ($f_cmp_authenticated != "1") : $buttonAuthentication = defineButtonType10(getLngt("Freischalten"), "action_lock", "authenticationFinishPage();", "120", "left", "0"); $displayTextAuthentication = getLngt("(gesperrt)"); $confirmTextAuthentication = getLngt("Soll der Kunde wirklich freigeschaltet werden?"); endif; $buttonVisibility = defineButtonType10(getLngt("Ausblenden"), "action_visible", "visibilityFinishPage();", "120", "left", "0"); $confirmTextVisibility = getLngt("Soll der Kunde wirklich ausgeblendet werden?"); if ($f_cmp_visible != "1") : $buttonVisibility = defineButtonType10(getLngt("Einblenden"), "action_visible", "visibilityFinishPage();", "120", "left", "0"); $displayTextVisibility = getLngt("(ausgeblendet)"); $confirmTextVisibility = getLngt("Soll der Kunde wirklich eingeblendet werden?"); endif; $buttonCashmode = defineButtonType10(getLngt("Rechnung"), "action_cashmode", "cashModeFinishPage();", "120", "left", "0"); $confirmTextCashmode = getLngt("Soll der Kunde zukünftig wieder Rechnungen erhalten?"); if ($f_cmp_cashmode != "1") : $buttonCashmode = defineButtonType10(getLngt("Nur bar"), "action_cashmode", "cashModeFinishPage();", "120", "left", "0"); $confirmTextCashmode = getLngt("Soll der Kunde zukünftig wirklich nur barzahlen?"); endif; $buttonCsHistory = defineButtonType10(getLngt("Änderungshistorie"), "action_cs_history", "openCsHistory('" . ec($f_cs_id) . "');", "190", "left", "0"); $buttonReset2FA = defineButtonType10(getLngt("2FA zurücksetzen"), "action_2fa", "reset2FACustomerFinishPage();", "190", "left", "0", "", "", "150px"); // IMPORTANT: Check if customer-admin-user-account exists, because in this case only the customer has to administrate the costcenters !!! if (true || $f_usr_account == "") : $buttonCostcenter = defineButtonType10(getLngt("Kostenstellen"), "action_csc", "openCostcenterAdmin();", "120", "left", "0"); endif; if (MASK_CUSTOMERDETAILS_TARGET == "1") : if (authCheckEmployeeRights($emp_id, "2")) : $serviceLink1 = "Service (Grundpreise, Kilometer, Radien, Zuschläge, Preis-/Leistungstypen): " . getLngt("Preise") . "/" . "" . getLngt("Rabatte") . "\n"; $serviceLink2 = "PLZ: " . getLngt("Preise") . "/" . "" . getLngt("Rabatte") . "\n"; $serviceLink3 = "Bereiche: " . getLngt("Preise") . "/" . "" . getLngt("Rabatte") . "\n"; $serviceLink4 = "\n"; else : $serviceLink1 = getLngt("Service: Preise/Rabatte") . "\n"; $serviceLink2 = getLngt("PLZ: Preise/Rabatte") . "\n"; $serviceLink3 = getLngt("PLZ-Bereiche: Preise/Rabatte") . "\n"; $serviceLink4 = "\n"; endif; else : if (authCheckEmployeeRights($emp_id, "2")) : $serviceLink1 = "Service: " . getLngt("Preise") . "/" . "" . getLngt("Rabatte") . "\n"; $serviceLink2 = "PLZ: " . getLngt("Preise") . "/" . "" . getLngt("Rabatte") . "\n"; $serviceLink3 = "PLZ-Bereiche: " . getLngt("Preise") . "/" . "" . getLngt("Rabatte") . "\n"; $serviceLink4 = "\n"; else : $serviceLink1 = "" . getLngt("Service: Preise/Rabatte") . "\n"; $serviceLink2 = "" . getLngt("PLZ: Preise/Rabatte") . "\n"; $serviceLink3 = "" . getLngt("PLZ-Bereiche: Preise/Rabatte") . "\n"; $serviceLink4 = "\n"; endif; endif; // Get current photo settings list($f_cs_photo_disabled, $f_cs_photo_hq, $f_cs_photo_cs, $f_cs_photo_range_from, $f_cs_photo_range_to) = getCsPhotoConf($f_cs_id); // echo "Fotos:
Fotofunktion deaktiviert: $f_cs_photo_disabled
Foto Zentrale: $f_cs_photo_hq
Foto KAE: $f_cs_photo_cs
Fotos mindestens: $f_cs_photo_range_from
Fotos höchstens: $f_cs_photo_range_to
"; endif; // Password-fields for entering a new customer (admin-user) $setPasswordForNewUserOutput = ""; $setPassword2ForNewUserOutput = ""; $cpfs = "0"; // checkPasswordForStoring if ($companyId == "" || $f_usr_account == "") : $setPasswordForNewUserOutput = "\n"; $setPassword2ForNewUserOutput = "\n"; $cpfs = "1"; endif; // Only for output: // Check for updating the list $javaScriptOut = "myhide('f_colorpicker');"; if ($statusMessage == "" && $f_act != "" && $dbOperationCompleted == "1" && MASK_CUSTOMER_SHOW_LIST == "1") : // $javaScriptOut .= "parent.admin_cs_list.finishPage('".$f_cmp_comp."','".$f_cmp_comp2."','".$f_ad_street."','".$f_ad_zipcode."','".$f_cmp_match."','".$f_cs_eid."','".$f_usr_phone."','".$f_usr_email."','".$f_cmp_comp3."','".$f_cmp_comp4."');"; $javaScriptOut .= "parent.admin_cs_list.finishPage('".strWrapJs($f_cmp_comp)."','".strWrapJs($f_cmp_comp2)."','".strWrapJs($f_ad_street)."','".$f_ad_zipcode."','".strWrapJs($f_cmp_match)."','".$f_cs_eid."','".$f_usr_phone."','".$f_usr_email."','".$f_cmp_comp3."','".$f_cmp_comp4."');"; endif; // Call embargo check if ($execEmbargoCheck == "1") : $javaScriptOut .= "openEmbargoCheck();"; endif; $maskCloseWindowAfterNewCs = getParameterValue("0", "MASK_CS_NEW_CLOSE_WINDOW", "0"); if ($f_act == "newCustomer" && $dbOperationCompleted == "1") : // Parameter to switch between closing window OR clearing form parameters after storing a new customer if ($maskCloseWindowAfterNewCs != "1" && $maskCloseWindowAfterNewCs != "2") : // Reset fields of form parameters clearParameters($httpVisualVars); // else : // Close window by javascript... endif; endif; // Initialize service-mode for invoicing with global default setting if ($f_cs_invmode == "") : // Get the general invmode for the headquarter $hq_invmode = getFieldValueFromId("headquarters", "hq_id", "$hq_id", "hq_invmode"); $f_cs_invmode = $hq_invmode; endif; // Main invoice address of the root costcenter // Display output only if it´s different to main address // Get the ID and housenumber of the current invoice address of the root costcenter $outAdditionalAddresses = ""; $outAdditionalCompanyNames = ""; if ($f_cs_id != "") : $adIdRootInvoice = getFieldValueFromClause("costcenteraddress","ad_id","adt_id = '2' AND csc_id = '" . $f_csc_id . "'"); $adHsnoRootInvoice = getFieldValueFromClause("costcenteraddress","cscad_hsno","adt_id = '2' AND csc_id = '" . $f_csc_id . "'"); if ($adIdRootInvoice != "" && ($adIdRootInvoice != $f_ad_id || $adHsnoRootInvoice != $f_cmp_hsno)) : $adInvoiceFields = getFieldsValueFromId("address", "ad_id", $adIdRootInvoice, array("ad_street","ad_zipcode","ad_city","ad_country")); $outAdditionalAddresses .= ""; $outAdditionalAddresses .= ""; $outAdditionalAddresses .= "
"; $outAdditionalAddresses .= ""; $outAdditionalAddresses .= ""; $outAdditionalAddresses .= ""; endif; $cmpCompRootInvoice = getFieldValueFromClause("costcenteraddress","cscad_comp","adt_id = '2' AND csc_id = '" . $f_csc_id . "'"); $cmpComp2RootInvoice = getFieldValueFromClause("costcenteraddress","cscad_comp2","adt_id = '2' AND csc_id = '" . $f_csc_id . "'"); $cmpComp3RootInvoice = getFieldValueFromClause("costcenteraddress","cscad_comp3","adt_id = '2' AND csc_id = '" . $f_csc_id . "'"); $cmpComp4RootInvoice = getFieldValueFromClause("costcenteraddress","cscad_comp4","adt_id = '2' AND csc_id = '" . $f_csc_id . "'"); if (($cmpCompRootInvoice != $f_cmp_comp || $cmpComp2RootInvoice != $f_cmp_comp2 || $cmpComp3RootInvoice != $f_cmp_comp3 || $cmpComp4RootInvoice != $f_cmp_comp4)) : $outAdditionalCompanyNames .= "
"; $outAdditionalCompanyNames .= "
"; $outAdditionalCompanyNames .= "
"; $outAdditionalCompanyNames .= "
"; endif; endif; // ****************************************************************************************************************** $f_cmp_comp = strWrapHtml($f_cmp_comp); $f_cmp_comp2 = strWrapHtml($f_cmp_comp2); $f_cmp_comp3 = strWrapHtml($f_cmp_comp3); $f_cmp_comp4 = strWrapHtml($f_cmp_comp4); $f_usr_firstname = strWrapHtml($f_usr_firstname); $f_usr_name = strWrapHtml($f_usr_name); $f_ad_street = strWrapHtml($f_ad_street); $f_ad_city = strWrapHtml($f_ad_city); $f_cmp_bank = strWrapHtml($f_cmp_bank); $f_cmp_remark = strWrapHtml($f_cmp_remark); $f_cmp_remark2 = strWrapHtml($f_cmp_remark2); $f_cmp_match = strWrapHtml($f_cmp_match); $f_cmp_match2 = strWrapHtml($f_cmp_match2); if ($companyId != "" || CS_EID_GENERATION == "") : $f_cs_eid_out = ""; else : if ($f_cs_eid == "") : $f_cs_eid = $constCsEidPrefix; endif; $f_cs_eid_out = "
 
"; $f_cs_eid_out .= defineButtonType08("...", "action_eid", "searchMaxEID();", "20", "left", "2"); endif; // Generate Output if ($companyId != "") : $f_actText = "modifyCustomer"; else : $f_actText = "newCustomer"; endif; // Identification-parameters $f_cmp_id = $companyId; // Use costcenter mail address if activated $f_cs_jbstatusmail2csc_0 = ""; $f_cs_jbstatusmail2csc_1 = ""; if ($f_cs_jbstatusmail2csc == "0" || $f_cs_jbstatusmail2csc == "") : $f_cs_jbstatusmail2csc_0 = "checked"; endif; if ($f_cs_jbstatusmail2csc == "1") : $f_cs_jbstatusmail2csc_1 = "checked"; endif; // Show price information in mail $f_cs_jbstatusmail_price_0 = ""; $f_cs_jbstatusmail_price_1 = ""; if ($f_cs_jbstatusmail_price == "0") : $f_cs_jbstatusmail_price_0 = "checked"; endif; if ($f_cs_jbstatusmail_price == "1" || $f_cs_jbstatusmail_price == "") : $f_cs_jbstatusmail_price_1 = "checked"; endif; // Show employee information in mail with question of contentment $f_cs_jbstatusmail_emp_0 = ""; $f_cs_jbstatusmail_emp_1 = ""; if ($f_cs_jbstatusmail_emp == "0" || $f_cs_jbstatusmail_emp == "") : $f_cs_jbstatusmail_emp_0 = "checked"; endif; if ($f_cs_jbstatusmail_emp == "1") : $f_cs_jbstatusmail_emp_1 = "checked"; endif; // Send PDF document as attachment $f_cs_jbstatusmail_pdf_0 = ""; $f_cs_jbstatusmail_pdf_1 = ""; if ($f_cs_jbstatusmail_pdf == "0" || $f_cs_jbstatusmail_pdf == "") : $f_cs_jbstatusmail_pdf_0 = "checked"; endif; if ($f_cs_jbstatusmail_pdf == "1") : $f_cs_jbstatusmail_pdf_1 = "checked"; endif; // Send newsletter $f_cmp_newsletter_0 = ""; $f_cmp_newsletter_1 = ""; if ($f_cmp_newsletter == "0" || $f_cmp_newsletter == "") : $f_cmp_newsletter_0 = "checked"; endif; if ($f_cmp_newsletter == "1") : $f_cmp_newsletter_1 = "checked"; endif; // State DSGVO $f_cmp_dsgvo_0 = "disabled"; $f_cmp_dsgvo_1 = "disabled"; if (authCheckEmployeeRights($emp_id, "33")) : $f_cmp_dsgvo_0 = ""; $f_cmp_dsgvo_1 = ""; endif; if ($f_cmp_dsgvo == "0") : $f_cmp_dsgvo_0 = "checked"; endif; if ($f_cmp_dsgvo == "1" || $f_cmp_dsgvo == "") : $f_cmp_dsgvo_1 = "checked"; endif; // Proof of delivery (photo) $f_cmp_proof_delivery_0 = ""; $f_cmp_proof_delivery_1 = ""; if ($f_cmp_proof_delivery == "0") : $f_cmp_proof_delivery_0 = "checked"; endif; if ($f_cmp_proof_delivery == "1" || $f_cmp_proof_delivery == "") : $f_cmp_proof_delivery_1 = "checked"; endif; // PDA usage (e.g. relevant for statistics) $f_cmp_pda_usage_0 = "disabled"; $f_cmp_pda_usage_1 = "disabled"; if (authCheckEmployeeRights($emp_id, "32")) : $f_cmp_pda_usage_0 = ""; $f_cmp_pda_usage_1 = ""; endif; if ($f_cmp_pda_usage == "0") : $f_cmp_pda_usage_0 = "checked"; endif; if ($f_cmp_pda_usage == "1" || $f_cmp_pda_usage == "") : $f_cmp_pda_usage_1 = "checked"; endif; // Show extra fields in mail // 1. tr.tr_remark $f_cs_jbstatusmail_field1 = "0"; if (substr($f_cs_jbstatusmail_fields,0,1) == "1") : $f_cs_jbstatusmail_field1 = "1"; endif; // 2. cr_mobile_pda $f_cs_jbstatusmail_field2 = "0"; if (substr($f_cs_jbstatusmail_fields,1,1) == "1") : $f_cs_jbstatusmail_field2 = "1"; endif; // 3. jb_invtext $f_cs_jbstatusmail_field3 = "0"; if (substr($f_cs_jbstatusmail_fields,2,1) == "1") : $f_cs_jbstatusmail_field3 = "1"; endif; // 4. Enables the question in job_edit to send an extra mail after changing a finished job $f_cs_jbstatusmail_field4 = "0"; if (substr($f_cs_jbstatusmail_fields,3,1) == "1") : $f_cs_jbstatusmail_field4 = "1"; endif; // 5. Enables the station based delivery mail $f_cs_jbstatusmail_field5 = "0"; if (substr($f_cs_jbstatusmail_fields,4,1) == "1") : $f_cs_jbstatusmail_field5 = "1"; endif; // 6. Enables photos as attachement $f_cs_jbstatusmail_field6 = "0"; if (substr($f_cs_jbstatusmail_fields,5,1) == "1") : $f_cs_jbstatusmail_field6 = "1"; endif; // 7. Enables vehicle sign $f_cs_jbstatusmail_field7 = "0"; if (substr($f_cs_jbstatusmail_fields,6,1) == "1") : $f_cs_jbstatusmail_field7 = "1"; endif; // 8. Enables mail after cancellation $f_cs_jbstatusmail_field8 = "0"; if (substr($f_cs_jbstatusmail_fields,7,1) == "1") : $f_cs_jbstatusmail_field8 = "1"; endif; // 9. Enables events $f_cs_jbstatusmail_field9 = "0"; if (substr($f_cs_jbstatusmail_fields,8,1) == "1") : $f_cs_jbstatusmail_field9 = "1"; endif; // A. Enables "Bemerkung Innendienst" $f_cs_jbstatusmail_fieldA = "0"; if (substr($f_cs_jbstatusmail_fields,9,1) == "1") : $f_cs_jbstatusmail_fieldA = "1"; endif; // Check for some email state fields having default values by creating a new customer if ($companyId == "" && $copyCs != "1") : $csJbStatusMailFieldsEnabled = getParameterValue("0", "CS_JBSTATUSMAIL_FIELDS_ENABLED", $hq_id); $csJbStatusMailFieldsEnabledArr = explode("|", $csJbStatusMailFieldsEnabled); $f_cs_jbstatusmail = $csJbStatusMailFieldsEnabledArr[0]; $f_cs_jbstatusmail2 = $csJbStatusMailFieldsEnabledArr[1]; $f_cs_jbstatusmail3 = $csJbStatusMailFieldsEnabledArr[2]; endif; // Email job finished $f_cs_jbstatusmail_0 = ""; $f_cs_jbstatusmail_1 = ""; if ($f_cs_jbstatusmail == "0" || $f_cs_jbstatusmail == "") : $f_cs_jbstatusmail_0 = "checked"; endif; if ($f_cs_jbstatusmail == "1") : $f_cs_jbstatusmail_1 = "checked"; endif; // Email job pickup 1. station $f_cs_jbstatusmail2_0 = ""; $f_cs_jbstatusmail2_1 = ""; if ($f_cs_jbstatusmail2 == "0" || $f_cs_jbstatusmail2 == "") : $f_cs_jbstatusmail2_0 = "checked"; endif; if ($f_cs_jbstatusmail2 == "1") : $f_cs_jbstatusmail2_1 = "checked"; endif; // Email job created $f_cs_jbstatusmail3_0 = ""; $f_cs_jbstatusmail3_1 = ""; if ($f_cs_jbstatusmail3 == "0" || $f_cs_jbstatusmail3 == "") : $f_cs_jbstatusmail3_0 = "checked"; endif; if ($f_cs_jbstatusmail3 == "1") : $f_cs_jbstatusmail3_1 = "checked"; endif; $f_cs_invmode_0 = ""; $f_cs_invmode_1 = ""; $f_cs_invmode_2 = ""; $f_cs_invmode_3 = ""; $f_cs_invmode_9 = ""; if ($f_cs_invmode == "0" || $f_cs_invmode == "") : $f_cs_invmode_0 = "checked"; endif; if ($f_cs_invmode == "1") : $f_cs_invmode_1 = "checked"; endif; if ($f_cs_invmode == "2") : $f_cs_invmode_2 = "checked"; endif; if ($f_cs_invmode == "3") : $f_cs_invmode_3 = "checked"; endif; if ($f_cs_invmode == "9") : $f_cs_invmode_9 = "checked"; endif; $f_cmp_bankmode_0 = ""; $f_cmp_bankmode_1 = ""; if ($f_cmp_bankmode == "0" || $f_cmp_bankmode == "") : $f_cmp_bankmode_0 = "checked"; endif; if ($f_cmp_bankmode == "1") : $f_cmp_bankmode_1 = "checked"; endif; $f_cs_jobbatch_0 = ""; if ($f_cs_jobbatch == "1") : $f_cs_jobbatch_0 = "checked"; endif; $f_cs_jbedit_0 = ""; if ($f_cs_jbedit == "1") : $f_cs_jbedit_0 = "checked"; endif; if ($companyId == "") : $f_cs_ar = "1"; $f_maskManDisp = getParameterValue("0", "MASK_MANUAL_DISPOSITION", $hq_id); if ($f_maskManDisp == "1") : $f_cs_ar = "0"; else : $f_maskManDispCsMand = getParameterValue("0", "MASK_MANUAL_DISPOSITION_CUSTOMER_MANDATORY", $hq_id); if ($f_maskManDispCsMand == "1") : $f_cs_ar = "0"; endif; endif; endif; $f_cs_ar_0 = ""; if ($f_cs_ar == "1") : $f_cs_ar_0 = "checked"; endif; $f_cs_fixprice_discount_0 = ""; if ($f_cs_fixprice_discount == "1") : $f_cs_fixprice_discount_0 = "checked"; endif; $f_cs_markup_0 = ""; if ($f_cs_markup == "1") : $f_cs_markup_0 = "checked"; endif; $f_cs_price_warn_uncomplete_0 = ""; if ($f_cs_price_warn_uncomplete == "1") : $f_cs_price_warn_uncomplete_0 = "checked"; endif; $f_cs_joblist_disabled_0 = ""; if ($f_cs_joblist_disabled == "1") : $f_cs_joblist_disabled_0 = "checked"; endif; $f_cs_invtext_mode_0 = ""; if ($f_cs_invtext_mode == "1") : $f_cs_invtext_mode_0 = "checked"; endif; $f_cmp_no_longhaul_0 = ""; if ($f_cmp_no_longhaul == "1") : $f_cmp_no_longhaul_0 = "checked"; endif; $f_cs_tracking_0 = ""; $f_cs_tracking_1 = ""; if ($f_cs_tracking == "1" || $f_cs_tracking == "3") : $f_cs_tracking_0 = "checked"; endif; if ($f_cs_tracking == "2" || $f_cs_tracking == "3") : $f_cs_tracking_1 = "checked"; endif; $f_cmp_inv2hq_0 = ""; $f_cmp_inv2hq_1 = ""; if ($f_cmp_inv2hq == "1" || $f_cmp_inv2hq == "3") : $f_cmp_inv2hq_0 = "checked"; endif; if ($f_cmp_inv2hq == "2" || $f_cmp_inv2hq == "3") : $f_cmp_inv2hq_1 = "checked"; endif; $f_cs_commission_no_0 = ""; $f_cs_commission_no_1 = ""; if ($f_cs_commission_no == "0" || $f_cs_commission_no == "") : $f_cs_commission_no_0 = "checked"; endif; if ($f_cs_commission_no == "1") : $f_cs_commission_no_1 = "checked"; endif; $f_cs_cr_fav_only_0 = ""; if ($f_cs_cr_fav_only == "1") : $f_cs_cr_fav_only_0 = "checked"; endif; // Parameter to initiate a similarity search $maskCsNewSimilaritySearch = getParameterValue("0", "MASK_CS_NEW_SIMILARITY_SEARCH", $hq_id); if ($maskCsNewSimilaritySearch == "") : $maskCsNewSimilaritySearch = getParameterValue("0", "MASK_CS_NEW_SIMILARITY_SEARCH", "0"); endif; // Parameter to check for being a potential INTERNAL customer as "booking account" $maskCsCheckInternalBookingAccounts = getParameterValue("0", "MASK_CS_CHECK_INTERNAL_BOOKING_ACCOUNT", $hq_id); if ($maskCsCheckInternalBookingAccounts == "") : $maskCsCheckInternalBookingAccounts = getParameterValue("0", "MASK_CS_CHECK_INTERNAL_BOOKING_ACCOUNT", "0"); endif; // Output to PDF if ($generatePDF == "1" && $companyId != "") : $includePDFGeneric = "1"; $f_act = "generatePDFCustomer"; $csId = getFieldValueFromId("customer", "cmp_id", $companyId, "cs_id"); // include_once ("../admin/pdf_generic.php"); include ("../admin/pdf_generic.php"); die(); endif; // Check for customized range of provision value // Lower Range $parCsProvRangeLower = getParameterValue("0", "MASK_CS_PROV_RANGE_LOWER", $hq_id); if ($parCsProvRangeLower == "") : $parCsProvRangeLower = getParameterValue("0", "MASK_CS_PROV_RANGE_LOWER", "0"); endif; // Upper Range $parCsProvRangeUpper = getParameterValue("0", "MASK_CS_PROV_RANGE_UPPER", $hq_id); if ($parCsProvRangeUpper == "") : $parCsProvRangeUpper = getParameterValue("0", "MASK_CS_PROV_RANGE_UPPER", "0"); endif; // Parameter to show last job $maskCsShowLastJob = ""; if ($f_cmp_type == "0") : $maskCsShowLastJob = getParameterValue("0", "MASK_CS_SHOW_LAST_JOB", $hq_id); if ($maskCsShowLastJob == "") : $maskCsShowLastJob = getParameterValue("0", "MASK_CS_SHOW_LAST_JOB", "0"); endif; if ($maskCsShowLastJob == "1") : include ("../include/inc_job.inc.php"); endif; endif; // Flag for configuration regarding "display station number" $f_cs_par_tr_sort_0 = "checked"; $f_cs_par_tr_sort = getParameterValue("0", "JOBDETAILS_STATIONS_STATION_NUMBER_" . $f_cs_id, "0"); if ($f_cs_par_tr_sort != "1") : $f_cs_par_tr_sort = "0"; $f_cs_par_tr_sort_0 = ""; endif; // Flag for color of the jobs in job lists $f_cs_par_order_color = getParameterValue("0", "JOBLIST_CS_JB_COLOR_" . $f_cs_id, "0"); if ($f_cs_par_order_color == "") : $f_cs_par_order_color = "FFFFFF"; endif; // Flag for ........ $f_cs_par_xxxxxxxx_0 = "checked"; $f_cs_par_xxxxxxxx = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_XXXXXXXXXX_" . $f_cs_id, "0"); if ($f_cs_par_xxxxxxxx != "1") : $f_cs_par_xxxxxxxx = "0"; $f_cs_par_xxxxxxxx_0 = ""; endif; // Flag for job cancellation by customer $f_cs_jb_storno_0 = "checked"; $f_cs_jb_storno = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_CANCELLATION_ENABLED_" . $f_cs_id, "0"); if ($f_cs_jb_storno != "1") : $f_cs_jb_storno = "0"; $f_cs_jb_storno_0 = ""; endif; // Flag for job disposition to favoured couriers by customer $f_cs_jb_dispo_0 = "checked"; $f_cs_jb_dispo = getParameterValue("0", "CUSTOMER_MASK_JOBLIST_DISPO_FAV_ENABLED_" . $f_cs_id, "0"); if ($f_cs_jb_dispo != "1") : $f_cs_jb_dispo = "0"; $f_cs_jb_dispo_0 = ""; endif; $f_cs_jb_dispo_disabled = "disabled"; if (authCheckEmployeeRights($emp_id, "41")) : $f_cs_jb_dispo_disabled = ""; endif; // Flag for making standard price in customer login $f_cs_par_dont_make_0 = "checked"; $f_cs_par_dont_make = getParameterValue("0", "MASK_CS_DONT_MAKE_STANDARD_PRICE_" . $f_cs_id, "0"); if ($f_cs_par_dont_make != "1") : $f_cs_par_dont_make = "0"; $f_cs_par_dont_make_0 = ""; endif; // Flag for calculator has to be a must for jobs of the customer $f_cs_par_calc_usage_0 = "checked"; $f_cs_par_calc_usage = getParameterValue("0", "CUSTOMER_MASK_CALCULATOR_USAGE_ONLY_" . $f_cs_id, "0"); if ($f_cs_par_calc_usage != "1") : $f_cs_par_calc_usage = "0"; $f_cs_par_calc_usage_0 = ""; endif; // Flag for not checking address in KAE $f_cs_par_cst_all_ad_0 = "checked"; $f_cs_par_cst_all_ad = getParameterValue("0", "MASK_CUST_ALL_ADDR_ENABLED_" . $f_cs_id, "0"); if ($f_cs_par_cst_all_ad != "1") : $f_cs_par_cst_all_ad = "0"; $f_cs_par_cst_all_ad_0 = ""; endif; // Flag for emails to avoid sending the footer $f_cs_par_email_no_footer_0 = "checked"; $f_cs_par_email_no_footer = getParameterValue("0", "JOBDETAILS_EMAIL_NO_FOOTER_" . $f_cs_id, "0"); if ($f_cs_par_email_no_footer != "1") : $f_cs_par_email_no_footer = "0"; $f_cs_par_email_no_footer_0 = ""; endif; // Flag for customer to get a discount by self-creating jobs $f_cs_jb_creator_discount_0 = "checked"; $f_cs_jb_creator_discount = getParameterValue("0", "CUSTOMER_MASK_JB_CREATOR_DISCOUNT_" . $f_cs_id, "0"); if ($f_cs_jb_creator_discount != "1") : $f_cs_jb_creator_discount = "0"; $f_cs_jb_creator_discount_0 = ""; endif; // Language of the email $f_cs_par_email_arrivaltime = getParameterValue("0", "JOB_MAIL_STATION_ARRIVAL_TIME_" . $f_cs_id, "0"); if ($f_cs_par_email_arrivaltime == "") : $f_cs_par_email_arrivaltime = "0"; endif; // Language of the email $f_cs_par_email_lng = getParameterValue("0", "JOBDETAILS_EMAIL_LANGUAGE_" . $f_cs_id, "0"); if ($f_cs_par_email_lng == "") : $f_cs_par_email_lng = "0"; endif; // Flag for customer to set job being incomplete by creating or modifying a job $f_cs_jb_incomplete_0 = "checked"; $f_cs_jb_incomplete = getParameterValue("0", "CUSTOMER_MASK_JB_INCOMPLETE_" . $f_cs_id, "0"); if ($f_cs_jb_incomplete != "1") : $f_cs_jb_incomplete = "0"; $f_cs_jb_incomplete_0 = ""; endif; ?> <?php echo $title2 ?>
   
>:
$f_cs_modify) : $tmpModifyDate = $f_cmp_modify; endif; echo getLngt("Letzte Modifikation") . ": " . substr($tmpModifyDate,8,2) . "." . substr($tmpModifyDate,5,2) . "." . substr($tmpModifyDate,0,4) . "     "; ?> "; echo "
"; echo defineButtonType08("...", "action_cscsc", "searchCsCsc('0000000000001','','f_cs_eid_old');", "30", "left", "2"); echo "
"; echo ""; echo "     "; endif; ?> " . $lastJbId . ""; echo "     "; endif; endif; ?>
>, :
      ExtID*: 
"; echo defineButtonType08("...", "action_cscsc", "searchCsCsc('0000000000001','','f_cs_eid_old');", "30", "left", "2"); echo "
"; echo ""; echo "     "; ?>
>:
       :               
>, , :
>, :
>:
     tabindex="90"> tabindex="94">     tabindex="98"> tabindex="100">     tabindex="102"> tabindex="104">
   tabindex="106">    tabindex="107">
    tabindex="108"> tabindex="109">       tabindex="110"> tabindex="111">       tabindex="111"> tabindex="112">
  tabindex="113">     tabindex="114">     tabindex="115">     tabindex="115">     tabindex="115">     tabindex="115">     tabindex="115">
tabindex="116">    
tabindex="116">    
tabindex="117">    
tabindex="117">    
"0" ? "checked" : "") ?> tabindex="117">      :   
tabindex="118"> tabindex="119">
tabindex="118"> tabindex="119">
>
"0" ? "checked" : "") ?> onChange="csSetPhoto('cs_photo_disabled');" tabindex="120">        "0" ? "checked" : "") ?> onChange="csSetPhoto('cs_photo_hq');" tabindex="120">      "0" ? "checked" : "") ?> onChange="csSetPhoto('cs_photo_cs');" tabindex="120">            
>:
     :  
>:
     :     
>:
  tabindex="350">      tabindex="360">   tabindex="350">      :         :   
>:
  tabindex="120"> tabindex="121">
>:
  tabindex="120"> tabindex="121">
>:
  tabindex="120"> tabindex="121">
>:
  tabindex="120"> tabindex="121">
>, , :
       tabindex="140"> tabindex="150">
>, :
   
>, :
  
    
>, :
>:
       :               
>, :
 
>, :
>:
tabindex="260">      tabindex="261">      tabindex="262">
tabindex="">
tabindex="" disabled>
tabindex="">
tabindex="">
tabindex="">
tabindex="">
tabindex="">
>, :
% €        tabindex="285">          %         
>:
  tabindex="292">        %
>, :
  
           
>:
  
>:
:        
>:
  
       tabindex="350">      tabindex="360">        tabindex="370"> tabindex="380">     
          
       
tabindex="387">
>:
tabindex="390">        tabindex="400">      tabindex="402">      tabindex="402">     
>:
>:
>:
>, :
           
>:
tabindex=""> PZM tabindex=""> PLZ tabindex=""> Bereich (= zusammengefasste PLZn) disabled tabindex=""> Radius tabindex=""> Keine Preisberechnung
>:
tabindex="">
tabindex="">
>Firmenname
Hauptkostenst.") ?>
 
 
>Rechnungsadr.
Hauptkostenst.") ?>