Browse Source

change the Billing when you change the Tenant name

luis daniel lucio quiroz 10 năm trước cách đây
mục cha
commit
c63affd1e9

+ 12 - 1
core/domain_settings/domain_edit.php

@@ -22,6 +22,7 @@
 
  Contributor(s):
  Mark J Crane <[email protected]>
+ Luis Daniel Lucio Quiroz <[email protected]>
 */
 require_once "root.php";
 require_once "resources/require.php";
@@ -182,6 +183,16 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 						$db->exec(check_sql($sql));
 						unset($sql);
 
+					// update billing, if installed
+						if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
+							$sql = "update v_billings set ";
+							$sql .= "type_value = '".$domain_name."' ";
+							$sql .= "where type_value = '".$original_domain_name."' ";
+							$sql .= "and domain_uuid = '".$domain_uuid."' ";
+							$db->exec(check_sql($sql));
+							unset($sql);
+						}
+
 					// rename switch/storage/voicemail/default/[domain] (folder)
 						if ( isset($_SESSION['switch']['voicemail']['dir']) && file_exists($_SESSION['switch']['voicemail']['dir']."/default/".$original_domain_name) ) {
 							@rename($_SESSION['switch']['voicemail']['dir']."/default/".$original_domain_name, $_SESSION['switch']['voicemail']['dir']."/default/".$domain_name); // folder
@@ -702,4 +713,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 
 //include the footer
 	require_once "resources/footer.php";
-?>
+?>

+ 1 - 1
core/domain_settings/domain_settings.php

@@ -306,4 +306,4 @@ if (sizeof($_REQUEST) > 1) {
 
 //include the footer
 	//require_once "resources/footer.php";
-?>
+?>