noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 302/323: Bug #0001562: Achat mémoriser égale


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 302/323: Bug #0001562: Achat mémoriser également 3 champs
Date: Wed, 14 Mar 2018 17:39:08 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit c8709f2d5c4955e2a01eb8999553174147088cc4
Author: Dany De Bontridder <address@hidden>
Date:   Mon Mar 5 23:08:08 2018 +0100

    Bug #0001562: Achat mémoriser également 3 champs
---
 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 6cb8dba..f6254b1 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.='<div id="payment"> ';
-        $r.='<h2> '._('Payement').' </h2>';
+        $r.='<h2> '._('Paiement').' </h2>';
         $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.='</div>';
         return $r;
     }
diff --git a/include/class/acc_payment.class.php 
b/include/class/acc_payment.class.php
index b24b006..4a655aa 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.='<p>';
             $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 c44e185..825d8b3 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -256,6 +256,10 @@ echo '<p class="notice">'.$p_msg.'</p>';
 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 "<FORM class=\"print\"NAME=\"form_detail\" METHOD=\"POST\" >";
     /* 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 '<div class="content">';
-        echo $Ledger->input_paid($payment);
+        echo 
$Ledger->input_paid($payment,$acompte,$date_payment,$comm_payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index dbde101..d5109ea 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -276,7 +276,10 @@ echo '<p class="notice">'.$p_msg.'</p>';
 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 "<FORM class=\"print\" NAME=\"form_detail\" METHOD=\"POST\" >";
     /* request for a predefined operation */
     if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct']) && ! 
isset($correct))
@@ -304,7 +307,7 @@ try
         echo HtmlInput::hidden("sa", "p");
         echo $Ledger->input($array);
         echo '<div class="content">';
-        echo $Ledger->input_paid($payment);
+        echo 
$Ledger->input_paid($payment,$acompte,$date_payment,$comm_payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';
@@ -318,7 +321,7 @@ try
 
         echo $Ledger->input($array);
         echo '<div class="content">';
-        echo $Ledger->input_paid($payment);
+        echo 
$Ledger->input_paid($payment,$acompte,$date_payment,$comm_payment);
         echo '</div>';
         echo '<script>';
         echo 'compute_all_ledger();';



reply via email to

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