Fixed CLI update_agent adding duplicate agent address references
This commit is contained in:
parent
10a7420928
commit
34b361e21a
|
@ -3095,11 +3095,17 @@ sub cli_agent_update() {
|
|||
# Add the address to the agent
|
||||
if (defined $use_alias and $use_alias eq 'use_alias') {
|
||||
foreach my $id (@id_agents) {
|
||||
my $ag_addr_id = get_agent_addr_id($dbh, $address_id, $id->{'id_agente'});
|
||||
if($ag_addr_id == -1) {
|
||||
add_new_address_agent ($dbh, $address_id, $id->{'id_agente'});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
my $ag_addr_id = get_agent_addr_id($dbh, $address_id, $id_agent);
|
||||
if($ag_addr_id == -1) {
|
||||
add_new_address_agent ($dbh, $address_id, $id_agent);
|
||||
}
|
||||
}
|
||||
|
||||
$field = 'direccion';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue