Fix bug : follow up option contact are not remove when document type changed

This commit is contained in:
Dany De Bontridder 2020-10-12 13:33:08 +02:00
parent ed50fc802d
commit f2ae91ed7c
2 changed files with 17 additions and 3 deletions

View file

@ -146,9 +146,10 @@ class Card_Multiple
// delete disable
$cn->exec_sql("delete
from action_person_option apo
where contact_option_ref_id in
(select contact_option_ref_id from jnt_document_option_contact jdoc join action_gestion on (ag_type=document_type_id)
where ag_id=$1 and jdoc_enable=0)",[$ag_id]);
where contact_option_ref_id not in
(select contact_option_ref_id from jnt_document_option_contact jdoc join action_gestion on
(ag_type=document_type_id)
where ag_id=$1 and jdoc_enable=1)",[$ag_id]);
// First select the option
$sql="select ap_id,cor_id,ap_value,cor_type ,cor_label,cor_value_select