Skip to content

Commit 3c8467b

Browse files
committed
Fixes #4160
1 parent 4fc5a8a commit 3c8467b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

interface/web/client/client_edit.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,12 @@ function onShowEnd() {
204204
$reseller = $app->db->queryOneRecord("SELECT client.client_id, client.customer_no_template, client.customer_no_counter, client.customer_no_start FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ?", $client_group_id);
205205

206206
if($reseller['customer_no_template'] != '') {
207-
//* Set customer no default
208-
$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
209-
$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
207+
if(isset($this->dataRecord['customer_no'])&& $this->dataRecord['customer_no']!='') $customer_no_string = $this->dataRecord['customer_no'];
208+
else {
209+
//* Set customer no default
210+
$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
211+
$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
212+
}
210213
$app->tpl->setVar('customer_no',$customer_no_string);
211214
}
212215
}

0 commit comments

Comments
 (0)