noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 01/01: #1184 : remet le paiement par défaut


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/01: #1184 : remet le paiement par défaut si correction demandée
Date: Fri, 06 Nov 2015 18:29:57 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 24c93c135ec855fc6c9bfb9c38732c16d96c344d
Author: Dany De Bontridder <address@hidden>
Date:   Fri Nov 6 19:22:23 2015 +0100

    #1184 : remet le paiement par défaut si correction demandée
---
 include/class/class_acc_ledger.php  |    4 ++--
 include/class/class_acc_payment.php |   14 +++++++++-----
 include/compta_ach.inc.php          |    5 +++--
 include/compta_ven.inc.php          |    8 +++++---
 4 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/include/class/class_acc_ledger.php 
b/include/class/class_acc_ledger.php
index 274f575..318feab 100644
--- a/include/class/class_acc_ledger.php
+++ b/include/class/class_acc_ledger.php
@@ -3621,14 +3621,14 @@ class Acc_Ledger extends jrn_def_sql
                }
        }
 
-       function input_paid()
+       function input_paid($p_selected)
        {
                $r = '';
                $r.='<div id="payment"> ';
                $r.='<h2> ' . _('Payé par') . ' </h2>';
                $mp = new Acc_Payment($this->db);
                $mp->set_parameter('ledger_source', $this->id);
-               $r.=$mp->select();
+               $r.=$mp->select($p_selected);
                $r.='</div>';
                return $r;
        }
diff --git a/include/class/class_acc_payment.php 
b/include/class/class_acc_payment.php
index fea26da..3700fd9 100644
--- a/include/class/class_acc_payment.php
+++ b/include/class/class_acc_payment.php
@@ -275,10 +275,10 @@ class Acc_Payment
     }
     /*!\brief show several lines with radio button to select the payment
      *method we want to use, the $_POST['e_mp'] will be set
-     *\param none
+     *\param $p_selected if the id choose
      *\return html string
      */
-    public function select()
+    public function select($p_select)
     {
         $r='';
         $array=$this->get_valide();
@@ -313,17 +313,20 @@ class Acc_Payment
                 {
                     $a=new ICard();
                     $a->jrn=$row->mp_jrn_def_id;
-                                       
$a->set_attribute('typecard',$row->mp_fd_id);
+                    $a->set_attribute('typecard',$row->mp_fd_id);
                     $a->name='e_mp_qcode_'.$row->mp_id;
                     $a->set_dblclick("fill_ipopcard(this);");
                     $a->set_callback('filter_card');
                     $a->set_function('fill_data');
                     $a->set_attribute('ipopup','ipopcard');
                     $a->set_attribute('label',$a->name.'_label');
-
+                    if ( $p_select == $row->mp_id ) {
+                        
$a->value=HtmlInput::default_value_request("e_mp_qcode_".$p_select, "");
+                    }
                     $s=new ISpan();
                     $s->name=$a->name.'_label';
                     $f=_(" paiement par ").$a->input().$s->input();
+                    
                 }
                 else
                 {
@@ -336,7 +339,8 @@ class Acc_Payment
 
                     //   $f.=$fiche->strAttribut(ATTR_DEF_NAME);
                 }
-                $r.='<li><input type="radio" name="e_mp" 
value="'.$row->mp_id.'">';
+                $check=( $p_select == $row->mp_id)?" checked " : "unchecked";
+                $r.='<li><input type="radio" name="e_mp" 
value="'.$row->mp_id.'" '.$check.'>';
                 $r.=$row->mp_lib.'  '.$f;
 
             }
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index 6e321a9..240e85d 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -251,6 +251,7 @@ else
 echo '<p class="notice">'.$p_msg.'</p>';
 try
 {
+    $payment=HtmlInput::default_value_request("e_mp", 0);
     echo "<FORM class=\"print\"NAME=\"form_detail\" METHOD=\"POST\" >";
     /* request for a predefined operation */
     if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct']))
@@ -264,7 +265,7 @@ try
         $p_post['p_jrn']=$Ledger->id;
         echo $Ledger->input($p_post);
         echo '<div class="content">';
-        echo $Ledger->input_paid();
+        echo $Ledger->input_paid($payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';
@@ -276,7 +277,7 @@ try
         echo HtmlInput::hidden("p_action", "ach");
         echo HtmlInput::hidden("sa", "p");
         echo '<div class="content">';
-        echo $Ledger->input_paid();
+        echo $Ledger->input_paid($payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index 825127c..68877f1 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -265,6 +265,8 @@ echo '<div class="content">';
 echo '<p class="notice">'.$p_msg.'</p>';
 try
 {
+    $payment=HtmlInput::default_value_request("e_mp", 0);
+
     echo "<FORM class=\"print\" NAME=\"form_detail\" METHOD=\"POST\" >";
     /* request for a predefined operation */
     if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct']))
@@ -278,7 +280,7 @@ try
 
         echo $Ledger->input($p_post);
         echo '<div class="content">';
-        echo $Ledger->input_paid();
+        echo $Ledger->input_paid($payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';
@@ -292,7 +294,7 @@ try
         echo HtmlInput::hidden("sa", "p");
         echo $Ledger->input($array);
         echo '<div class="content">';
-        echo $Ledger->input_paid();
+        echo $Ledger->input_paid($payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';
@@ -306,7 +308,7 @@ try
 
         echo $Ledger->input($array);
         echo '<div class="content">';
-        echo $Ledger->input_paid();
+        echo $Ledger->input_paid($payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';



reply via email to

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