removed nocheckservice
authorKilian Saffran <ksaffran@dks.lu>
Tue, 5 Mar 2019 07:57:23 +0000 (08:57 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Tue, 5 Mar 2019 07:57:23 +0000 (08:57 +0100)
app_v3/chrome/content/modules/accounting/accounting.html
app_v3/chrome/content/modules/accounting/accountingchild.html
app_v3/chrome/content/modules/accounting/accountingopeninvoice.html
app_v3/chrome/content/modules/accounting/js/accounting.js
app_v3/chrome/content/modules/accounting/js/accountingchild.js
app_v3/chrome/content/modules/accounting/js/accountingopeninvoice.js

index cb8f923..8aacdb1 100644 (file)
                   <input type="hidden" value="0" id="uuid" />
                   <input type="hidden" value="" id="action" />
                   <input type="hidden" value="" id="childuuid" />
-                  <!-- <div class="form-group">
-                    <div class="checkbox" >
-                      <input type="checkbox" value="1" id="nocheckservice">
-                      <label for="nocheckservice">facture NON Check-Service</label>
-                    </div>
-                    </div> -->
                     <div class="form-group">
                       <label for="name">Enfant</label>
                       <input type="text" value="" id="childname"  nullable="true" readonly="true" class="form-control">
index 67910aa..989bb4f 100644 (file)
                   <input type="hidden" value="" id="uuid" />
                   <input type="hidden" value="" id="action" />
                   <input type="hidden" value="" id="childuuid" />
-                  
-                  <!-- <div class="form-group">
-                  <div class="checkbox" >
-                    <input type="checkbox" value="1" id="nocheckservice">
-                    <label for="nocheckservice">facture NON Check-Service</label>
-                  </div>
-                  </div> -->
                   <div class="form-group">
                     <label for="name">Enfant</label>
                     <input type="text" value="" id="childname"  nullable="true" readonly="true" class="form-control">
index 7239857..2b8876b 100644 (file)
                   <input type="hidden" value="" id="uuid" />
                   <input type="hidden" value="" id="action" />
                   <input type="hidden" value="" id="childuuid" />
-                  <!-- <div class="form-group">
-                  <div class="checkbox" >
-                    <input type="checkbox" value="1" id="nocheckservice">
-                    <label for="nocheckservice">facture NON Check-Service</label>
-                  </div>
-                  </div> -->
                   <div class="form-group">
                     <label for="name">Enfant</label>
                     <input type="text" value="" id="childname"  nullable="true" readonly="true" class="form-control">
index 5514028..788d60f 100644 (file)
@@ -186,7 +186,7 @@ function delete_accounting() {
 function dlg_accounting(myuuid){
   
   //alert("TEST");
-  var acc1sql = "SELECT acc.uuid,acc.accmonth,ch.uuid as childuuid,COALESCE( ch.prename, '' ) || ' ' || COALESCE( ch.surname, '' ) || '(' || ch.checkservicenumber || ')' AS childname,case when acc.invoicedate is not null then strftime('%d.%m.%Y',acc.invoicedate) else null end as invoicedate, case when acc.payeddate is not null then strftime('%d.%m.%Y',acc.payeddate) else null end as payeddate, payedamount, invoiceamount,benefitamount, replace(acc.reference,'NOCHECKSERVICE:','') as reference, instr(acc.reference,'NOCHECKSERVICE:') as ischeckservice, case when acc.reminderdate1 is not null then strftime('%d.%m.%Y',acc.reminderdate1) else null end as reminderdate1, case when acc.reminderdate2 is not null then strftime('%d.%m.%Y',acc.reminderdate2) else null end as reminderdate2, case when acc.reminderdate3 is not null then strftime('%d.%m.%Y',acc.reminderdate3) else null end as reminderdate3, case when acc.invoicefile is not null and acc.invoicefile != '' then '"+ importpath.path + system.sep() +"' || acc.invoicefile else null end as invoicefile,'upd' as action FROM accounting acc join childs ch on (ch.uuid=acc.childuuid) where acc.uuid = '"+ myuuid+"';";
+  var acc1sql = "SELECT acc.uuid,acc.accmonth,ch.uuid as childuuid,COALESCE( ch.prename, '' ) || ' ' || COALESCE( ch.surname, '' ) || '(' || ch.checkservicenumber || ')' AS childname,case when acc.invoicedate is not null then strftime('%d.%m.%Y',acc.invoicedate) else null end as invoicedate, case when acc.payeddate is not null then strftime('%d.%m.%Y',acc.payeddate) else null end as payeddate, payedamount, invoiceamount,benefitamount, case when acc.reminderdate1 is not null then strftime('%d.%m.%Y',acc.reminderdate1) else null end as reminderdate1, case when acc.reminderdate2 is not null then strftime('%d.%m.%Y',acc.reminderdate2) else null end as reminderdate2, case when acc.reminderdate3 is not null then strftime('%d.%m.%Y',acc.reminderdate3) else null end as reminderdate3, case when acc.invoicefile is not null and acc.invoicefile != '' then '"+ importpath.path + system.sep() +"' || acc.invoicefile else null end as invoicefile,'upd' as action FROM accounting acc join childs ch on (ch.uuid=acc.childuuid) where acc.uuid = '"+ myuuid+"';";
  
   jsdump("ACC1SQL" + acc1sql);
   var acc1data = appdb.dbquery(acc1sql);
@@ -197,11 +197,6 @@ function dlg_accounting(myuuid){
   }
   acc1data = acc1data.sqldata[0];
   $("#frmeditaccounting #uuid").val(acc1data.uuid);
-  if (acc1data.ischeckservice > 0){
-    $("#frmeditaccounting #nocheckservice").prop("checked",true);
-  } else {
-    $("#frmeditaccounting #nocheckservice").prop("checked",false);
-  }
   for (var a in acc1data){
 
     if ($("#frmeditaccounting #" +a)) {
@@ -221,7 +216,7 @@ function save_accounting(){
     var input = $(this);
     if (input.attr("id") ){
 
-        if ((input.attr("type") != 'hidden')  && (input.attr("id") != 'childname') && (input.attr("id") != 'ischeckservice'))  {
+        if ((input.attr("type") != 'hidden')  && (input.attr("id") != 'childname'))  {
           if (input.attr("type") == "file") {
             if (system.getDirectory(input.val()) != importpath.path) {
               var newlocation= importpath.path + system.sep() + system.getFileName(input.val());
@@ -229,9 +224,7 @@ function save_accounting(){
             }
           }
           var ival = input.val();
-          if ((input.attr("id") == 'reference') && $("#frmeditaccounting #ischeckservice").is(":checked")){
-            ival = "NOCHECKSERVICE:" + ival;
-          }
+
           
           var ival = encodeparam(ival,input.attr('type'));
           if (input.attr("id") == 'invoicedate'){
index 0712cdd..641702b 100644 (file)
@@ -140,21 +140,17 @@ function dlg_accounting(myuuid){
   $("#head_invoice").html("Editer facture");
   $("#frmeditaccounting #childname").val($("#accchild  option:selected").text());
   
-  var acc1sql = "SELECT uuid,accmonth,childuuid,case when invoicedate is not null then strftime('%d.%m.%Y',invoicedate) else null end as invoicedate, case when payeddate is not null then strftime('%d.%m.%Y',payeddate) else null end as payeddate, payedamount, benefitamount,invoiceamount, reference, nocheckservice, case when reminderdate1 is not null then strftime('%d.%m.%Y',reminderdate1) else null end as reminderdate1, case when reminderdate2 is not null then strftime('%d.%m.%Y',reminderdate2) else null end as reminderdate2, case when reminderdate3 is not null then strftime('%d.%m.%Y',reminderdate3) else null end as reminderdate3,case when invoicefile is not null  and invoicefile != '' then '"+ importpath.path + system.sep() +"' || invoicefile else null end as invoicefile,'upd' as action FROM accounting where uuid='" + myuuid +"';";
+  var acc1sql = "SELECT uuid,accmonth,childuuid,case when invoicedate is not null then strftime('%d.%m.%Y',invoicedate) else null end as invoicedate, case when payeddate is not null then strftime('%d.%m.%Y',payeddate) else null end as payeddate, payedamount, benefitamount,invoiceamount, reference, case when reminderdate1 is not null then strftime('%d.%m.%Y',reminderdate1) else null end as reminderdate1, case when reminderdate2 is not null then strftime('%d.%m.%Y',reminderdate2) else null end as reminderdate2, case when reminderdate3 is not null then strftime('%d.%m.%Y',reminderdate3) else null end as reminderdate3,case when invoicefile is not null  and invoicefile != '' then '"+ importpath.path + system.sep() +"' || invoicefile else null end as invoicefile,'upd' as action FROM accounting where uuid='" + myuuid +"';";
   
   var acc1data = appdb.dbquery(acc1sql);
   
   if (acc1data.sqldata.length == 0) {
  
-    acc1sql = "SELECT '0' as uuid,"+ accmonth.substring(3) + "-" + accmonth.substring(0,2) +"-01' as accmonth,'"+ pconfig.accchild+"' as childuuid, null as invoicedate, null as payeddate, null as payedamount, null as invoiceamount,1 as ischeckservice, null as reference, null as reminderdate1, null as reminderdate2, null as reminderdate3,null as benefitamount ,null as invoicefile, 'ins' as action;";
+    acc1sql = "SELECT '0' as uuid,"+ accmonth.substring(3) + "-" + accmonth.substring(0,2) +"-01' as accmonth,'"+ pconfig.accchild+"' as childuuid, null as invoicedate, null as payeddate, null as payedamount, null as invoiceamount, null as reference, null as reminderdate1, null as reminderdate2, null as reminderdate3,null as benefitamount ,null as invoicefile, 'ins' as action;";
     acc1data = appdb.dbquery(acc1sql);
   }
   acc1data = acc1data.sqldata[0];
-  if (acc1data.nocheckservice == 1){
-    $("#frmeditaccounting #nocheckservice").prop("checked",true);
-  } else {
-    $("#frmeditaccounting #nocheckservice").prop("checked",false);
-  }
+
   for (var a in acc1data){
   
     if ($("#frmeditaccounting #" +a)) {
@@ -175,7 +171,6 @@ function newinvoice(){
     var input = $(this);
     input.val("");
   });
-  $("#frmeditaccounting #nocheckservice").prop("checked",true);
   $("#frmeditaccounting #action").val("ins");
   $("#frmeditaccounting #uuid").val("0");
   $("#frmeditaccounting #childuuid").val($("#accchild").val());
@@ -200,7 +195,7 @@ function save_accounting(){
         $("#frmeditaccounting :input").each(function(){
           var input = $(this);
           if (input.attr("id") ){
-            if ((type == 'ins') && (input.attr("type") != 'hidden') && (input.attr("id") != 'accmonth') && (input.attr("id") != 'childname')  && (input.attr("id") != 'ischeckservice')) {
+            if ((type == 'ins') && (input.attr("type") != 'hidden') && (input.attr("id") != 'accmonth') && (input.attr("id") != 'childname')) {
               
               sql1.push('"' + input.attr("id") + '"');
               if (input.attr("type") == "file") {
@@ -211,10 +206,7 @@ function save_accounting(){
                 OS.File.copy(input.val(), newlocation);
               }
               var ival = input.val();
-              if ((input.attr("id") == 'reference') && $("#frmeditaccounting #ischeckservice").is(":checked")){
-                sql1.push("nocheckservice");
-                sql2.push("'1'");
-              }
+              
               var ival = encodeparam(input.val(),input.attr('type'));
               sql2.push(ival);
               if (input.attr("id") == 'invoicedate'){
@@ -227,7 +219,7 @@ function save_accounting(){
                 sql2.push('\'' + newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7) +"-01'");
               }
             }else {
-              if ((input.attr("type") != 'hidden') &&  (input.attr("id") != 'childname')  && (input.attr("id") != 'ischeckservice')) {
+              if ((input.attr("type") != 'hidden') &&  (input.attr("id") != 'childname')) {
                 if (input.attr("type") == "file") {
                   if (system.getDirectory(input.val()) != importpath.path) {
                     var newlocation= importpath.path + system.sep() + system.getFileName(input.val());
@@ -235,9 +227,7 @@ function save_accounting(){
                   }
                 }
                 var ival = input.val();
-                if ((input.attr("id") == 'reference') && $("#frmeditaccounting #ischeckservice").is(":checked")){
-                  sql2.push("nocheckservice='1'");
-                }
+
                 var ival = encodeparam(ival,input.attr('type'));
                 sql2.push('"' + input.attr("id") +'"='+ ival);
                 if (input.attr("id") == 'invoicedate'){
index 6cd9097..c5070e7 100644 (file)
@@ -107,13 +107,7 @@ function dlg_accounting(myuuid){
   acc1data = acc1data.sqldata[0];
   
   for (var a in acc1data){
-    // if (a == "nocheckservice"){
-    //   if (acc1data[a] == 1){
-    //     $("#frmeditaccounting #nocheckservice").prop("checked",true);
-    //   } else {
-    //     $("#frmeditaccounting #nocheckservice").prop("checked",false);
-    //   }
-    // }
+
     if ($("#frmeditaccounting #" +a)) {
 
       $("#frmeditaccounting #"+a).val(acc1data[a]);
@@ -137,7 +131,7 @@ function save_accounting(){
   $("#frmeditaccounting :input").each(function(){
     var input = $(this);
     if (input.attr("id") ){
-      if ((type == 'ins') && (input.attr("type") != 'hidden') && (input.attr("id") != 'accmonth') && (input.attr("id") != 'childname')  && (input.attr("id") != 'ischeckservice')) {
+      if ((type == 'ins') && (input.attr("type") != 'hidden') && (input.attr("id") != 'accmonth') && (input.attr("id") != 'childname')) {
         
         sql1.push('"' + input.attr("id") + '"');
         if (input.attr("type") == "file") {
@@ -148,10 +142,7 @@ function save_accounting(){
           OS.File.copy(input.val(), newlocation);
         }
         var ival = input.val();
-        if ((input.attr("id") == 'reference') && $("#frmeditaccounting #ischeckservice").is(":checked")){
-          sql1.push("nocheckservice");
-          sql2.push("'1'");
-        }
+
         var ival = encodeparam(input.val(),input.attr('type'));
         sql2.push(ival);
         if (input.attr("id") == 'invoicedate'){
@@ -164,7 +155,7 @@ function save_accounting(){
           sql2.push('\'' + newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7) +"-01'");
         }
       }else {
-        if ((input.attr("type") != 'hidden') &&  (input.attr("id") != 'childname')  && (input.attr("id") != 'ischeckservice')) {
+        if ((input.attr("type") != 'hidden') &&  (input.attr("id") != 'childname')) {
           if (input.attr("type") == "file") {
             if (system.getDirectory(input.val()) != importpath.path) {
               var newlocation= importpath.path + system.sep() + system.getFileName(input.val());
@@ -172,9 +163,7 @@ function save_accounting(){
             }
           }
           var ival = input.val();
-          if ((input.attr("id") == 'reference') && $("#frmeditaccounting #ischeckservice").is(":checked")){
-            sql2.push("nocheckservice='1'");
-          }
+
           var ival = encodeparam(ival,input.attr('type'));
           sql2.push('"' + input.attr("id") +'"='+ ival);
           if (input.attr("id") == 'invoicedate'){