noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 18/24: Additional tax : remains when correct


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 18/24: Additional tax : remains when correct operation Cosmetic
Date: Tue, 12 Jul 2022 07:05:34 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit a4c1c3c1200e2a23e2c08cef86c00e98d91b4b80
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue May 31 19:12:00 2022 +0200

    Additional tax : remains when correct operation
    Cosmetic
---
 html/js/acc_ledger.js                   |  1 -
 include/class/acc_ledger.class.php      |  5 ++++-
 include/template/form_ledger_detail.php | 12 ++++++------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 1887952a7..0ebebe666 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -506,7 +506,6 @@ function compute_ledger(p_ctl_nb)
     let other_tax=g("other_tax");
     let other_tax_id=(other_tax && other_tax.checked)?other_tax.value:-1;
 
-    console.debug(`other tax is ${other_tax_id}`);
     var querystring = { gDossier : dossier , c : qcode ,t :tva_id,p : price , 
q:quantity,n:p_ctl_nb,'other_tax_id':other_tax_id};
     var action = new Ajax.Request(
             "compute.php",
diff --git a/include/class/acc_ledger.class.php 
b/include/class/acc_ledger.class.php
index 01e82fc6a..5c1f6790c 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -3197,6 +3197,7 @@ class Acc_Ledger  extends jrn_def_sql
         $http=new HttpInput();
         $nb=$http->post("nb_item", "number", 0);
         echo HtmlInput::post_to_hidden(['p_currency_rate','p_currency_code']);
+        echo HtmlInput::post_to_hidden(['other_tax','other_tax_amount']);
         for ($i=0; $i<$nb; $i++)
         {
             echo HtmlInput::post_to_hidden(
@@ -3360,15 +3361,17 @@ class Acc_Ledger  extends jrn_def_sql
      */
     function input_additional_tax()
     {
-
+        $http=new HttpInput();
         if ($this->has_other_tax() == false ) { return "";}
         $amount=new INum("other_tax_amount",0);
+        $amount->value=$http->request("other_tax_amount","number",0);
 
         
$amount->javascript='onchange="format_number(this,2);refresh_ledger();"';
         $msg=_("Montant");
         $row=$this->cn->get_row("select ac_id,ac_label,ac_rate from 
acc_other_tax where $1 = any (ajrn_def_id)",
             [$this->id]);
         $checkbox=new ICheckBox("other_tax",$row['ac_id']);
+        $checkbox->set_check($http->request("other_tax","number",-1));
         $checkbox->javascript=<<<EOF
 onchange='if (! this.checked) {  
$("other_tax_amount").value=0;}compute_all_ledger();'
 EOF;
diff --git a/include/template/form_ledger_detail.php 
b/include/template/form_ledger_detail.php
index 2685b6fcf..d3b536b56 100644
--- a/include/template/form_ledger_detail.php
+++ b/include/template/form_ledger_detail.php
@@ -133,11 +133,11 @@ echo '</tr>';
     <td class="visible_gt800 visible_gt1155"> </td>
     <td> </td>
     <td> </td>
-    <td class="num visible_gt800">  <span id="htva">0.0</span></td>
+    <td style="text-align:center" class="visible_gt800">  <span 
id="htva">0.0</span></td>
  <?php if ( $flag_tva=='Y' )  : ?>    
     <td> </td>
-    <td class="num visible_gt800">  <span id="tva">0.0</span> </td>
-    <td class="num">  <span id="tvac" >0.0</span> </td>
+    <td style="text-align:center" class="visible_gt800">  <span 
id="tva">0.0</span> </td>
+    <td style="text-align:center">  <span id="tvac" >0.0</span> </td>
   <?php    endif;     ?>  
     </tr>
     
@@ -147,14 +147,14 @@ echo '</tr>';
     </td>
         <td class="num visible_gt800"></td>
 <?php if ($flag_tva=='Y')  {?>
-        <td class="num visible_gt800 visible_gt1155"></td>
+        <td style="text-align:center" class="visible_gt800 
visible_gt1155"></td>
         <td></td>
-        <td class="num visible_gt800"></td>
+        <td class="visible_gt800"></td>
 <?php }         ?>
         <td></td>
         <td></td>
         <td></td>
-        <td class="num">
+        <td style="text-align:center">
             <span id="p_currency_euro"></span>
         </td>
     </tr>



reply via email to

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