Card can be disable if not used anymore
This commit is contained in:
parent
30688bda9d
commit
8033b9f7ca
5 changed files with 37 additions and 6 deletions
|
|
@ -118,13 +118,15 @@ else
|
|||
}
|
||||
}
|
||||
}
|
||||
// filter only enable card
|
||||
$filter_enable_card=" and f_id in (select f_id from fiche_detail where ad_value = '1' and ad_id=54) ";
|
||||
|
||||
$sql_str="select distinct f_id
|
||||
from fiche
|
||||
join fiche_detail using (f_id)
|
||||
where
|
||||
ad_id in (9,1,23)
|
||||
and ad_value ilike '%'||$1||'%' ".$filter_card.' limit '.$limit;
|
||||
and ad_value ilike '%'||$1||'%' ".$filter_enable_card.$filter_card.' limit '.$limit;
|
||||
|
||||
|
||||
$fid=$http->request("FID");
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ function search_card(obj)
|
|||
var price=obj.price;
|
||||
var tvaid=obj.tvaid;
|
||||
var jrn=obj.jrn;
|
||||
var inactive_card=0;
|
||||
if ( obj.inactive_card) {inactive_card=obj.inactive_card.value;}
|
||||
var amount_from_type=0;
|
||||
if ( obj.amount_from_type) {
|
||||
amount_from_type=obj.amount_from_type;
|
||||
|
|
@ -104,7 +106,8 @@ function search_card(obj)
|
|||
'ctl':'search_card','op2':'fs','jrn':jrn,
|
||||
'typecard':typecard,'query':string_to_search,'op':'card',
|
||||
'accvis':accvis,
|
||||
'amount_from_type':amount_from_type
|
||||
'amount_from_type':amount_from_type,
|
||||
'inactive_card':inactive_card
|
||||
});
|
||||
if ( $('search_card') ) {
|
||||
removeDiv('search_card');
|
||||
|
|
@ -184,6 +187,7 @@ function action_concerned_search_card(obj)
|
|||
var inp="";
|
||||
var ag_id=0;
|
||||
var search_in=-1;
|
||||
var inactive_card=0;
|
||||
|
||||
if (obj.dossier) {
|
||||
dossier = obj.dossier; /* From the button */
|
||||
|
|
@ -208,6 +212,9 @@ function action_concerned_search_card(obj)
|
|||
if (obj.elements['search_in']) {
|
||||
search_in = obj.elements['search_in'].value;
|
||||
}
|
||||
if ( obj.inactive_card) {
|
||||
inactive_card=obj.elements['inactive_card'].value;
|
||||
}
|
||||
}
|
||||
if (dossier == 0) {
|
||||
throw "obj.dossier not found";
|
||||
|
|
@ -223,7 +230,8 @@ function action_concerned_search_card(obj)
|
|||
'ag_id' : ag_id,
|
||||
'op':'card',
|
||||
'accvis':0,
|
||||
'search_in':search_in
|
||||
'search_in':search_in,
|
||||
'inactive_card':inactive_card
|
||||
});
|
||||
|
||||
waiting_box();
|
||||
|
|
@ -336,6 +344,9 @@ function search_get_card(obj)
|
|||
if (obj.elements['page_card']) {
|
||||
queryString+="&page_card="+obj.elements["page_card"].value;
|
||||
}
|
||||
if ( obj.elements["inactive_card"]) {
|
||||
queryString+="&inactive_card="+obj.elements["inactive_card"].value;
|
||||
}
|
||||
|
||||
queryString=encodeURI(queryString);
|
||||
$('asearch').innerHTML=loading();
|
||||
|
|
|
|||
|
|
@ -423,6 +423,11 @@ case 'fs':
|
|||
|
||||
// to navigate
|
||||
$page_card=$http->get("page_card","number",0);
|
||||
$inactive=$http->get("inactive_card","string",0);
|
||||
if ($inactive=="undefined" || $inactive == "") $inactive=0;
|
||||
$is=new InputSwitch("inactive_card",$inactive);
|
||||
$is->value=$inactive;
|
||||
$r.=_("Toutes les fiches").$is->input();
|
||||
|
||||
// save previous info
|
||||
$hidden="";
|
||||
|
|
@ -439,6 +444,7 @@ case 'fs':
|
|||
$r.="</form>";
|
||||
|
||||
$sql_array["query"]=$query;
|
||||
$sql_array["inactive_card"]=$inactive;
|
||||
/* what is the type of the ledger */
|
||||
$type="GL";
|
||||
if (isset($jrn) && $jrn > 1)
|
||||
|
|
@ -465,8 +471,15 @@ case 'fs':
|
|||
$html.=HtmlInput::button_close("search_card");
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* if inactive == 0 , then only active card
|
||||
*/
|
||||
if ( $inactive == 0 ) {
|
||||
$sql.=" and f_id in (select f_id from fiche_detail where ad_id=54 and ad_value='1') ";
|
||||
}
|
||||
|
||||
/* We limit the search to MAX_SEARCH_CARD records */
|
||||
$sql=$sql.' order by vw_name ';
|
||||
$sql=$sql.' order by vw_name ';
|
||||
$total_card=$cn->get_value("select count(*) from ($sql) as c");
|
||||
|
||||
$record_start=$page_card*MAX_SEARCH_CARD;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
echo '<form method="GET" onsubmit="this.ctl=\'ipop_card\';search_get_card(this);return false;">';
|
||||
$url=$sql_array;
|
||||
$url["page_card"]=$page_card-1;
|
||||
echo HtmlInput::array_to_hidden(array('accvis','inp','jrn','label','typecard','price','tvaid','amount_from_type','page_card','query'), $url);
|
||||
echo HtmlInput::array_to_hidden(array('accvis','inp','jrn','label','typecard','price','tvaid','amount_from_type','page_card','query','inactive_card'), $url);
|
||||
echo HtmlInput::submit("previous","<");
|
||||
echo '</form>';
|
||||
echo '</li>';
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
echo '<form method="GET" onsubmit="this.ctl=\'ipop_card\';search_get_card(this);return false;">';
|
||||
$url=$sql_array;
|
||||
$url["page_card"]=$page_card+1;
|
||||
echo HtmlInput::array_to_hidden(array('accvis','inp','jrn','label','typecard','price','tvaid','amount_from_type','page_card','query'), $url);
|
||||
echo HtmlInput::array_to_hidden(array('accvis','inp','jrn','label','typecard','price','tvaid','amount_from_type','page_card','query','inactive_card'), $url);
|
||||
|
||||
echo HtmlInput::submit("next",">");
|
||||
echo '</form>';
|
||||
|
|
|
|||
|
|
@ -16,3 +16,8 @@ contact_option_ref_id bigint references contact_option_ref(cor_id) on delete cas
|
|||
);
|
||||
ALTER TABLE public.jnt_document_option_contact ADD CONSTRAINT jnt_document_option_contact_un UNIQUE (document_type_id,contact_option_ref_id);
|
||||
ALTER TABLE public.jnt_document_option_contact ADD CONSTRAINT jnt_document_option_contact_check CHECK (jdoc_enable in (0,1));
|
||||
|
||||
insert into attr_def(ad_id,ad_text,ad_type,ad_size) values (54,'Actif','check','1');
|
||||
insert into attr_min(frd_id,ad_id) select frd_id , 54 from fiche_def_ref ;
|
||||
insert into jnt_fic_attr (fd_id,ad_id,jnt_order) select fd_id,54,30 from fiche_def;
|
||||
insert into fiche_detail (f_id,ad_id,ad_value) select f_id, 54,1 from fiche_detail where ad_id=1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue