altocompta/include/payment_middle.inc.php
Dany De Bontridder 8e1db97b25 Merged revisions 2171,2173-2176,2178-2179,2181-2187,2189,2191-2194,2196-2230,2232,2234-2244 via svnmerge from
svn+ssh://danydb@svn/svn/phpcompta/branches/rel420

........
  r2174 | danydb | 2008-09-16 21:34:23 +0200 (Tue, 16 Sep 2008) | 3 lines
  
  Removed merge tracking for "svnmerge" for 
  svn+ssh://danydb@svn/svn/phpcompta/branches/rel410-exp
........
  r2178 | danydb | 2008-09-16 21:43:31 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Update version
........
  r2191 | danydb | 2008-09-22 20:31:03 +0200 (Mon, 22 Sep 2008) | 1 line
  
  Add correct version
........
  r2196 | danydb | 2008-10-03 21:46:50 +0200 (Fri, 03 Oct 2008) | 1 line
  
  update index version
........
  r2234 | danydb | 2008-11-19 20:54:30 +0100 (Wed, 19 Nov 2008) | 1 line
  
  Add the payer, not yet finished
........
  r2235 | danydb | 2008-11-21 22:34:32 +0100 (Fri, 21 Nov 2008) | 1 line
  
  Add the form for setting the medium of payment
........
  r2236 | danydb | 2008-11-22 23:15:30 +0100 (Sat, 22 Nov 2008) | 1 line
  
  Improve add : payment (second operation) + generation of a note of fee
........
  r2237 | danydb | 2008-11-23 01:20:40 +0100 (Sun, 23 Nov 2008) | 1 line
  
  Improve Payment method
........
  r2238 | danydb | 2008-11-23 01:45:52 +0100 (Sun, 23 Nov 2008) | 1 line
  
  Get only the valid payment method
........
  r2239 | danydb | 2008-11-24 23:03:34 +0100 (Mon, 24 Nov 2008) | 1 line
  
  cosmetic remove debug info
........
  r2240 | danydb | 2008-11-24 23:04:07 +0100 (Mon, 24 Nov 2008) | 1 line
  
  Filter the search to the good frd_id
........
  r2241 | danydb | 2008-11-26 18:11:30 +0100 (Wed, 26 Nov 2008) | 2 lines
  
  BUG if no class base is given the flag create account is false
........
  r2242 | danydb | 2008-11-26 18:45:56 +0100 (Wed, 26 Nov 2008) | 1 line
  
  Create note of fee + database patch
........
2008-11-26 18:32:19 +00:00

125 lines
No EOL
3.9 KiB
PHP

<?php
/*
* This file is part of PhpCompta.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
require_once('class_acc_payment.php');
//---------------------------------------------------------------------------
// Common variable
$td='<TD>';$etd='</td>';$tr='<tr>';$etr='</tr>';$th='<th>';$eth='</th>';
/*!\file
* \brief payment mode
*/
echo '<div class="content">';
//----------------------------------------------------------------------
// 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 '<form method="post" action="parametre.php">';
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 '</form>';
exit();
}
//----------------------------------------------------------------------
// Save the change
//
if ( $sb=='save'){
$row=new Acc_Payment($cn,$_POST ['id']);
$row->from_array($_POST);
$row->update();
}
//----------------------------------------------------------------------
// LEDGER PURCHASE
//----------------------------------------------------------------------
echo '<fieldset>';
echo '<legend>Journaux d\' achat</legend>';
/* 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 '<table style="border: 2px outset blue; width: 100%;" >';
echo $tr.$th.'Libell&eacute;'.$eth.$th.'Type de fiche'
.$eth.$th.'enregistr&eacute; 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 '</table>';
}
echo '</fieldset>';
//----------------------------------------------------------------------
// LEDGER SOLD
//----------------------------------------------------------------------
echo '<fieldset>';
echo '<legend>Journaux de vente</legend>';
$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 '<table style="border: 2px outset blue; width: 100%;" >';
echo $tr.$th.'Libell&eacute;'.$eth.$th.'Type de fiche'
.$eth.$th.'enregistr&eacute; 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 '</table>';
}
echo '</fieldset>';
echo '</div>';
?>