Search with VAT : filter

This commit is contained in:
sparkyx 2023-07-29 11:44:07 +02:00
parent 3a1ebb55cf
commit 841ea8482d
4 changed files with 14 additions and 4 deletions

View file

@ -1440,7 +1440,7 @@ function manage_search_filter(p_obj) {
function save_filter(p_div,p_dossier) {
var elt=['ledger_type','nb_jrn','date_start','date_end',
'date_paid_start','date_paid_end','desc','amount_min','amount_max','qcode','accounting',
'operation_filter','tag_option','p_currency_code'];
'operation_filter','tag_option','p_currency_code','tva_id_search'];
var eltValue={};
var i =0;
eltValue['gDossier']=p_dossier;
@ -1507,10 +1507,9 @@ function load_filter(p_div,p_dossier,p_filter_id) {
onSuccess:function (req) {
try {
var answer=req.responseJSON;
console.log(answer);
var elt=['ledger_type','date_start','date_end','date_paid_start','date_paid_end',
'desc','amount_min','amount_max','qcode','accounting','operation_filter','tag_option'
,'p_currency_code'];
,'p_currency_code','tva_id_search'];
for (var i=0;i<elt.length;i++) {
var idx=elt[i];
$(p_div+idx).value=answer[elt[i]];
@ -1585,7 +1584,7 @@ function delete_filter (p_div,p_dossier,p_filter_id) {
*/
function reset_filter(p_div) {
// clean all the input fields but ledger_type remains
var elt=['date_start','date_end','date_paid_start','date_paid_end','desc','amount_min','amount_max','qcode','accounting'];
var elt=['date_start','date_end','date_paid_start','date_paid_end','desc','amount_min','amount_max','qcode','accounting','tva_id_search'];
for (var i=0;i<elt.length;i++) {
var idx=elt[i];
$(p_div+idx).value="";

View file

@ -61,6 +61,7 @@ if ($op=='save_filter')
$new->setp("operation_filter", $http->post("operation_filter", 'string', NULL));
$new->setp("filter_name", h($http->post("filter_name", 'string')));
$new->setp("uf_currency_code", h($http->post("p_currency_code", 'number',-1)));
$new->setp("tva_id_search", h($http->post("tva_id_search", 'number',null)));
$tag=$http->post("tag","string",'');
if (is_array($tag) )

View file

@ -62,6 +62,7 @@ class User_filter_SQL extends Table_Data_SQL
,'uf_tag'=>'uf_tag'
,'uf_tag_option'=>'uf_tag_option'
,'uf_currency_code'=>'uf_currency_code'
,'tva_id_search'=>'tva_id_search'
);
/*
@ -88,6 +89,7 @@ class User_filter_SQL extends Table_Data_SQL
,'uf_tag'=>'text'
,'uf_tag_option'=>'numeric'
,'uf_currency_code'=>'numeric'
,'tva_id_search'=>'numeric'
);

View file

@ -0,0 +1,8 @@
begin;
alter table public.user_filter add tva_id_search integer;
comment on column public.user_filter.tva_id_search is 'VAT id ';
insert into version (val,v_description) values (188,'Filter for VAT id');
commit;