';$etd='';$tr='';$etr='';$th='';$eth=''; /*!\file * \brief payment mode */ echo '
'; //---------------------------------------------------------------------- // change if ( $sb=='change') { echo JS_SEARCH_CARD; echo JS_AJAX_FICHE; echo JS_PROTOTYPE; if ( !isset($_GET['id'])) exit; $row=new Acc_Payment($cn,$_GET['id']); $row->load(); echo '
'; echo dossier::hidden(); echo widget::hidden('p_jrn',0); echo widget::hidden('p_action','divers'); echo widget::hidden('sa','mp'); echo widget::hidden('sb','save'); echo widget::hidden('mp_type',$row->get_parameter('type')); echo widget::hidden('mp_lib',$row->get_parameter('lib')); echo $row->form(); echo widget::submit('save','Sauve'); echo widget::button_href('Retour sans sauvez', '?p_action=divers&sa=mp&'.dossier::get() ); echo '
'; exit(); } //---------------------------------------------------------------------- // Save the change // if ( $sb=='save'){ $row=new Acc_Payment($cn,$_POST ['id']); $row->from_array($_POST); $row->update(); } //---------------------------------------------------------------------- // LEDGER PURCHASE //---------------------------------------------------------------------- echo '
'; echo 'Journaux d\' achat'; /* 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)) { echo ''; echo $tr.$th.'Libellé'.$eth.$th.'Type de fiche' .$eth.$th.'enregistré dans le journal'.$eth. $th.' Avec la fiche'.$eth.$th.'Aciotn'.$eth.$etr; foreach ($array as $row) { echo $tr; echo $row->row(); echo $td.widget::button_href('Modifie','?p_action=divers&sa=mp&sb=change&'.dossier::get(). '&id='.$row->get_parameter('id')); echo $etr; } 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.'Aciotn'.$eth.$etr; foreach ($array as $row) { echo $tr; echo $row->row(); echo $td.widget::button_href('Modifie','?p_action=divers&sa=mp&sb=change&'.dossier::get(). '&id='.$row->get_parameter('id')); echo $etr; } echo '
'; } echo '
'; echo '
'; ?>