noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 10/39: Task #1532 : detail payment


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 10/39: Task #1532 : detail payment
Date: Sat, 11 Jul 2020 13:20:37 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 577229bde99af14860cd294d865c1da795362570
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Sun May 24 21:46:34 2020 +0200

    Task #1532 : detail payment
---
 include/class/acc_ledger_purchase.class.php | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index 5b6fe18..4365cfd 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -48,10 +48,12 @@ require_once NOALYSS_INCLUDE.'/class/stock_goods.class.php';
  */
 class  Acc_Ledger_Purchase extends Acc_Ledger
 {
+    private $payment_operation; /*<! id of the payment , set in insert */
     function __construct ($p_cn,$p_init)
     {
         $this->ledger_type='ACH';
         parent::__construct($p_cn,$p_init);
+        $this->payment_operation=-1;
     }
     /*!\brief verify that the data are correct before inserting or confirming
      *\param an array (usually $_POST)
@@ -878,7 +880,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                 $acc_pay->grpt=$acseq;
                 $acc_pay->jrn=$mp->get_parameter('ledger_target');
                 $acc_pay->periode=$tperiode;
-               $acc_pay->type=($famount>=0)?'c':'d';
+                       $acc_pay->type=($famount>=0)?'c':'d';
                 $acc_pay->insert_jrnx();
 
                 /* Insert supplier  */
@@ -899,6 +901,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                 $acc_pay->desc=(!isset($e_comm_paiement) || 
strlen(trim($e_comm_paiement)) == 0) ?$e_comm:$e_comm_paiement;
                 
                 $mp_jr_id=$acc_pay->insert_jrn();
+                $this->payment_operation=$mp_jr_id;
                 $acjrn->grpt_id=$acseq;
                 $acjrn->update_internal_code($acinternal);
                 // add an automatic PJ if ODS
@@ -1700,19 +1703,30 @@ EOF;
          */
         if ( $e_mp!=0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) != 0 )
         {
+            $r.="<p>";
             $r.=HtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.$e_mp});
             $r.=HtmlInput::hidden('acompte',$acompte);
-           $r.=HtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
-           $r.=HtmlInput::hidden('mp_date',$mp_date);
+            $r.=HtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
+               $r.=HtmlInput::hidden('mp_date',$mp_date);
             /* needed for generating a invoice */
            $r.=HtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_mp});
                        $fname = new Fiche($this->db);
                        $fname->get_by_qcode(${'e_mp_qcode_' . $e_mp});
+            $detail_payment="";
+            // payment operation
+            if ($this->payment_operation != 1) {
+                $pay_internal=$this->db->get_value("select jr_internal from 
jrn where jr_id=$1",
+                    [$this->payment_operation]);
+                
$detail_payment=HtmlInput::detail_op($this->payment_operation,$pay_internal);
+            }
             $r.='<h2>' . _("Payé par")." " . ${'e_mp_qcode_' . $e_mp} .
-                    " " . $fname->getName() . '</h2> ' . '<p class="decale">' 
. _('Déduction acompte ') . h($acompte) . '</p>' .
+                " " . $fname->getName() .$detail_payment. '</h2> ' ;
+            $r.='<p class="decale">' . _('Déduction acompte ') . h($acompte) . 
'</p>' .
                     _('Libellé :') . h($e_comm_paiement) ;
             $r.='<br>';
             $r.='<br>';
+
+            $r.="</p>";
         }
         // check for upload piece
         /* 



reply via email to

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