noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 20/27: Task #0001731: Moyen de paiement , bug


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 20/27: Task #0001731: Moyen de paiement , bug in ajax , if ledger==ODS a category of card is mandatory
Date: Wed, 4 Sep 2019 15:24:57 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 9c74020bb50500f070551f463630093a5b1d6cb2
Author: Dany De Bontridder <address@hidden>
Date:   Fri Aug 30 02:08:04 2019 +0200

    Task #0001731: Moyen de paiement , bug in ajax , if ledger==ODS
    a category of card is mandatory
---
 include/class/payment_method_mtable.class.php | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/class/payment_method_mtable.class.php 
b/include/class/payment_method_mtable.class.php
index f67b602..ab655a7 100644
--- a/include/class/payment_method_mtable.class.php
+++ b/include/class/payment_method_mtable.class.php
@@ -26,6 +26,7 @@
  * @see ajax_payment_method.php
  */
 require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
+require_once NOALYSS_INCLUDE."/database/jrn_def_sql.class.php";
 
 class Payment_Method_MTable extends Manage_Table_SQL
 {
@@ -92,11 +93,15 @@ class Payment_Method_MTable extends Manage_Table_SQL
             $this->set_error("mp_lib", _("Un libellé est obligatoire"));
             $has_error++;
         }
-        if (trim ($table->mp_qcode) != "" &&  $a_row['jrn_def_type'] != 'FIN') 
{
-            $fiche=new Fiche($cn);
-            if ( $fiche->get_by_qcode($table->mp_qcode,FALSE) == 1) {
-                $this->set_error("mp_qcode",_("Fiche inexistante"));
-                $has_error++;
+        
+        if (trim ($table->mp_qcode) != "") {
+            $ledger=new Jrn_def_SQL($cn , $table->jrn_def_id);
+            if ( $ledger->get('jrn_def_type') == 'FIN'){
+                $fiche=new Fiche($cn);
+                if ( $fiche->get_by_qcode($table->mp_qcode,FALSE) == 1) {
+                    $this->set_error("mp_qcode",_("Fiche inexistante"));
+                    $has_error++;
+                }
             }
         }
         // get the type of the ledger



reply via email to

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