noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/10: Search with VAT : filter


From: dwm
Subject: [Noalyss-commit] [noalyss] 01/10: Search with VAT : filter
Date: Wed, 9 Aug 2023 09:20:22 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 841ea8482d550b1f8d9d09382b4f14c6950c7d6c
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Jul 29 11:44:07 2023 +0200

    Search with VAT : filter
---
 html/js/acc_ledger.js                      | 7 +++----
 include/ajax/ajax_search_filter.php        | 1 +
 include/database/user_filter_sql.class.php | 2 ++
 include/sql/patch/upgrade187.sql           | 8 ++++++++
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 2e70ac942..7cb77c916 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -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="";
diff --git a/include/ajax/ajax_search_filter.php 
b/include/ajax/ajax_search_filter.php
index 7642cebea..7020e9bae 100644
--- a/include/ajax/ajax_search_filter.php
+++ b/include/ajax/ajax_search_filter.php
@@ -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) ) 
diff --git a/include/database/user_filter_sql.class.php 
b/include/database/user_filter_sql.class.php
index 71b724e83..5dd6560b7 100644
--- a/include/database/user_filter_sql.class.php
+++ b/include/database/user_filter_sql.class.php
@@ -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'
         );
 
 
diff --git a/include/sql/patch/upgrade187.sql b/include/sql/patch/upgrade187.sql
new file mode 100644
index 000000000..10544e551
--- /dev/null
+++ b/include/sql/patch/upgrade187.sql
@@ -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;
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]