From c8709f2d5c4955e2a01eb8999553174147088cc4 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 5 Mar 2018 23:08:08 +0100 Subject: [PATCH] =?UTF-8?q?Bug=20#0001562:=20Achat=20m=C3=A9moriser=20?= =?UTF-8?q?=C3=A9galement=203=20champs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class/acc_ledger.class.php | 15 +++++++++++---- include/class/acc_payment.class.php | 10 +++++++--- include/compta_ach.inc.php | 6 +++++- include/compta_ven.inc.php | 9 ++++++--- 4 files changed, 29 insertions(+), 11 deletions(-) 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 "
"; /* request for a predefined operation */ if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct']) && ! isset($correct) ) @@ -282,7 +286,7 @@ try echo HtmlInput::hidden("p_action", "ach"); echo HtmlInput::hidden("sa", "p"); echo '
'; - echo $Ledger->input_paid($payment); + echo $Ledger->input_paid($payment,$acompte,$date_payment,$comm_payment); echo '
'; echo '