diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php
index 6cb8dba8d..f6254b13a 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -2396,15 +2396,22 @@ class Acc_Ledger extends jrn_def_sql
$Res=$this->db->alter_seq("s_jrn_pj".$p_jrn, $jrn_def_pj_seq);
}
}
-
- function input_paid($p_selected)
+ /**
+ * Create the section payment
+ * @param int $p_selected
+ * @param number $p_amount
+ * @param date $p_date or empty string
+ * @param string $p_comm or empty comm
+ * @return string
+ */
+ function input_paid($p_selected,$p_amount=0,$p_date="",$p_comm="")
{
$r='';
$r.='
';
- $r.='
'._('Payement').'
';
+ $r.=' '._('Paiement').'
';
$mp=new Acc_Payment($this->db);
$mp->set_parameter('ledger_source', $this->id);
- $r.=$mp->select($p_selected);
+ $r.=$mp->select($p_selected,$p_amount,$p_date,$p_comm);
$r.='';
return $r;
}
diff --git a/include/class/acc_payment.class.php b/include/class/acc_payment.class.php
index b24b006e0..4a655aa40 100644
--- a/include/class/acc_payment.class.php
+++ b/include/class/acc_payment.class.php
@@ -280,9 +280,12 @@ class Acc_Payment
* \todo this class is used only for storage of the defined payment method, not the payment itself,
* it must be moved to another class 'Operation_Payment'
*\param $p_selected if the id choose
+ *\param $p_date date of payment
+ *\param $p_amount amount already paid
+ *\param $p_comm label of payment
*\return html string
*/
- public function select($p_select)
+ public function select($p_select,$p_amount,$p_date,$p_comm)
{
$r='';
$array=$this->get_valide();
@@ -290,15 +293,16 @@ class Acc_Payment
if ( empty($array)==false ) {
$date_pay=new IDate('mp_date');
-
+ $date_pay->value=$p_date;
$r.=sprintf(_("Date %s"),
$date_pay->input());
$acompte=new INum('acompte');
- $acompte->value=0;
+ $acompte->value=$p_amount;
$r.=_(" Acompte à déduire");
$r.=$acompte->input();
$r.='';
$e_comm_paiement=new IText('e_comm_paiement');
+ $e_comm_paiement->value=$p_comm;
$e_comm_paiement->table = 0;
$e_comm_paiement->setReadOnly(false);
$e_comm_paiement->size = 60;
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index c44e18549..825d8b391 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -256,6 +256,10 @@ echo '
'.$p_msg.'
';
try
{
$payment=$http->request("e_mp", "string",0);
+ $date_payment=$http->request("mp_date", "string","");
+ $comm_payment=$http->request("e_comm_paiement", "string","");
+ $acompte=$http->request("acompte", "string",0);
+
echo "