From 24c93c135ec855fc6c9bfb9c38732c16d96c344d Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 6 Nov 2015 19:22:23 +0100 Subject: [PATCH] =?UTF-8?q?#1184=20:=20remet=20le=20paiement=20par=20d?= =?UTF-8?q?=C3=A9faut=20si=20correction=20demand=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 274f57592..318feaba2 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.='
'; $r.='

' . _('PayƩ par') . '

'; $mp = new Acc_Payment($this->db); $mp->set_parameter('ledger_source', $this->id); - $r.=$mp->select(); + $r.=$mp->select($p_selected); $r.='
'; return $r; } diff --git a/include/class/class_acc_payment.php b/include/class/class_acc_payment.php index fea26dad5..3700fd973 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.='
  • '; + $check=( $p_select == $row->mp_id)?" checked " : "unchecked"; + $r.='
  • '; $r.=$row->mp_lib.' '.$f; } diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index 6e321a9af..240e85dfd 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -251,6 +251,7 @@ else echo '

    '.$p_msg.'

    '; try { + $payment=HtmlInput::default_value_request("e_mp", 0); echo "
    "; /* 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 '
    '; - echo $Ledger->input_paid(); + echo $Ledger->input_paid($payment); echo '
    '; echo '