From fd9a5d0ca86fca6dabedd4f86df9dbfc9b53975a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 15 Nov 2011 13:39:20 +0000 Subject: [PATCH] Mode de paiement --- include/class_acc_payment.php | 9 ++++----- include/payment_middle.inc.php | 35 +--------------------------------- 2 files changed, 5 insertions(+), 39 deletions(-) diff --git a/include/class_acc_payment.php b/include/class_acc_payment.php index ef30e93bb..81dbeac71 100644 --- a/include/class_acc_payment.php +++ b/include/class_acc_payment.php @@ -177,16 +177,15 @@ class Acc_Payment $sql="delete from mod_payment where mp_id=$1"; $this->cn->exec_sql($sql,array($this->mp_id)); } - /*!\brief retrieve all the data for a certain ledger + /*!\brief retrieve all the data for all ledgers *\param non *\return an array of row */ public function get_all() { - $sql='select mp_id '. - ' from mod_payment '. - ' where jrn_def_id=$1'; - $array=$this->cn->get_array($sql,array($this->jrn_def_id)); + $sql='select mp_id,mp_lib '. + ' from mod_payment order by mp_lib'; + $array=$this->cn->get_array($sql); $ret=array(); if ( !empty($array) ) { diff --git a/include/payment_middle.inc.php b/include/payment_middle.inc.php index 0ef054bc7..c84b0b437 100644 --- a/include/payment_middle.inc.php +++ b/include/payment_middle.inc.php @@ -114,10 +114,9 @@ if ( $sb=='insert') //---------------------------------------------------------------------- echo '
'; -echo 'Journaux d\' achat'; +echo 'Journaux '; /* Get the data from database */ $mp=new Acc_Payment($cn); -$mp->set_parameter('type','ACH'); $array=$mp->get_all(); /* if there are data show them in a table */ if ( ! empty ($array)) @@ -138,37 +137,5 @@ if ( ! empty ($array)) echo ''; } echo '
'; - -//---------------------------------------------------------------------- -// LEDGER SOLD -//---------------------------------------------------------------------- - -echo '
'; -echo 'Journaux de vente'; -$mp=new Acc_Payment($cn); -$mp->set_parameter('type','VEN'); -$array=$mp->get_all(); -/* if there are data show them in a table */ -if ( ! empty ($array)) -{ - echo ''; - echo $tr.$th.'Libellé'.$eth.$th.'Type de fiche' - .$eth.$th.'enregistré dans le journal'.$eth. - $th.' Avec la fiche'.$eth.$th.'Action'.$eth.$etr; - foreach ($array as $row) - { - echo $tr; - echo $row->row(); - echo $td.HtmlInput::button_anchor('Modifie','?p_action=divers&sa=mp&sb=change&'.dossier::get(). - '&id='.$row->get_parameter('id')); - echo $etr; - - } - echo '
'; -} -echo '
'; -// Button to insert new one -echo HtmlInput::button_anchor(_('Ajout'),'?p_action=divers&sa=mp&sb=ins&'.dossier::get()); - echo ''; ?>