Some fix in standingorder module

This commit is contained in:
Laurent Destailleur 2009-03-28 19:59:12 +00:00
parent 5c57487b4c
commit c5d655afc2
6 changed files with 831 additions and 800 deletions

View File

@ -135,7 +135,7 @@ class BonPrelevement extends CommonObject
if ($concat == 1) if ($concat == 1)
{ {
/* /*
* On aggr<EFBFBD>ge les lignes * On aggrege les lignes
*/ */
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes";
$sql .= " WHERE fk_prelevement_bons".$this->id; $sql .= " WHERE fk_prelevement_bons".$this->id;
@ -156,7 +156,7 @@ class BonPrelevement extends CommonObject
else else
{ {
/* /*
* Pas de d'agr<EFBFBD>gation * Pas de d'agregation
*/ */
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes (fk_prelevement_bons"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes (fk_prelevement_bons";
$sql .= " , fk_soc , client_nom "; $sql .= " , fk_soc , client_nom ";

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,24 +18,22 @@
*/ */
/** /**
\file htdocs/compta/prelevement/fiche.php * \file htdocs/compta/prelevement/fiche.php
\ingroup prelevement * \ingroup prelevement
\brief Fiche prelevement * \brief Fiche prelevement
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->rights->prelevement->bons->lire) if (!$user->rights->prelevement->bons->lire)
accessforbidden(); accessforbidden();
$langs->load("bills"); $langs->load("bills");
$langs->load("withdrawals"); $langs->load("withdrawals");
/* // Security check
* Sécurité accés client
*/
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
@ -50,6 +48,7 @@ if ($_POST["action"] == 'confirm_credite' && $_POST["confirm"] == yes)
$bon->set_credite(); $bon->set_credite();
Header("Location: fiche.php?id=".$_GET["id"]); Header("Location: fiche.php?id=".$_GET["id"]);
exit;
} }
if ($_POST["action"] == 'infotrans') if ($_POST["action"] == 'infotrans')
@ -95,6 +94,10 @@ if ($_POST["action"] == 'infocredit')
} }
} }
/*
* View
*/
llxHeader('',$langs->trans("WithdrawalReceipt")); llxHeader('',$langs->trans("WithdrawalReceipt"));
$h = 0; $h = 0;
@ -231,6 +234,7 @@ if ($_GET["id"])
} }
} }
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* Barre d'action */ /* Barre d'action */

View File

@ -1,5 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -14,9 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* */
* $Id$
* $Source$ /**
* \file htdocs/compta/prelevement/ligne.php
* \ingroup prelevement
* \brief card of withdraw line
* \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -24,7 +29,7 @@ require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/ligne-prelevement.class.php"
require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php");
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
// Sécurité accés client // Security check
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
@ -47,27 +52,33 @@ if ($_POST["action"] == 'confirm_rejet')
$rej->create($user, $_GET["id"], $_POST["motif"], $daterej, $lipre->bon_rowid, $_POST["facturer"]); $rej->create($user, $_GET["id"], $_POST["motif"], $daterej, $lipre->bon_rowid, $_POST["facturer"]);
Header("Location: ligne.php?id=".$_GET["id"]); Header("Location: ligne.php?id=".$_GET["id"]);
exit;
} }
else else
{ {
dol_syslog("Motif : ".$_POST["motif"]); dol_syslog("Motif : ".$_POST["motif"]);
dol_syslog("$daterej $time "); dol_syslog("$daterej $time ");
Header("Location: ligne.php?id=".$_GET["id"]."&action=rejet"); Header("Location: ligne.php?id=".$_GET["id"]."&action=rejet");
exit;
} }
} }
} }
else else
{ {
Header("Location: ligne.php?id=".$_GET["id"]); Header("Location: ligne.php?id=".$_GET["id"]);
exit;
} }
} }
/*
* View
*/
llxHeader('','Prélèvement'); llxHeader('',$langs->trans("StandingOrder"));
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$_GET["id"]; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$_GET["id"];
$head[$h][1] = $langs->trans("Fiche"); $head[$h][1] = $langs->trans("Card");
$hselected = $h; $hselected = $h;
$h++; $h++;
@ -80,14 +91,14 @@ if ($_GET["id"])
$bon = new BonPrelevement($db); $bon = new BonPrelevement($db);
$bon->fetch($lipre->bon_rowid); $bon->fetch($lipre->bon_rowid);
dol_fiche_head($head, $hselected, 'Prélèvement : '. $lipre->bon_ref); dol_fiche_head($head, $hselected, $langs->trans("StandingOrder"));
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="20%">Bons de prélèvement</td><td>'; print '<tr><td width="20%">'.$langs->trans("WithdrawalReceipt").'</td><td>';
print '<a href="fiche.php?id='.$lipre->bon_rowid.'">'.$lipre->bon_ref.'</a></td></tr>'; print '<a href="fiche.php?id='.$lipre->bon_rowid.'">'.$lipre->bon_ref.'</a></td></tr>';
print '<tr><td width="20%">Montant</td><td>'.price($lipre->amount).'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($lipre->amount).'</td></tr>';
print '<tr><td width="20%">Statut</td><td>'; print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>';
print '<img src="./statut'.$lipre->statut.'.png">&nbsp;'; print '<img src="./statut'.$lipre->statut.'.png">&nbsp;';
print $lipre->statuts[$lipre->statut].'</td></tr>'; print $lipre->statuts[$lipre->statut].'</td></tr>';
@ -102,7 +113,7 @@ if ($_GET["id"])
if ($rej->date_rejet == 0) if ($rej->date_rejet == 0)
{ {
/* Historique pour certaines install */ /* Historique pour certaines install */
print "Inconnue"; print $langs->trans("Unknown");
} }
else else
{ {
@ -223,17 +234,19 @@ if ($_GET["id"])
$urladd = "&amp;id=".$_GET["id"]; $urladd = "&amp;id=".$_GET["id"];
print_barre_liste("Factures", $page, "factures.php", $urladd, $sortfield, $sortorder, '', $num); print_barre_liste("Factures", $page, "factures.php", $urladd, $sortfield, $sortorder, '', $num, 0, '');
print"\n<!-- debut table -->\n"; print"\n<!-- debut table -->\n";
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>Facture</td><td>Société</td>Montant</td>'; print '<td>'.$langs->trans("Invoice").'</td><td>'.$langs->trans("Company").'</td><td align="right">'.$langs->trans("Amount").'</td>';
print '<td>&nbsp;</td></tr>'; print '</tr>';
$var=True; $var=True;
$total = 0; $total = 0;
$var=false;
while ($i < min($num,$conf->liste_limit)) while ($i < min($num,$conf->liste_limit))
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
@ -249,7 +262,7 @@ if ($_GET["id"])
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'; print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">';
print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n"; print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n";
print '<td align="center">'.price($obj->total_ttc)."</td>\n"; print '<td align="right">'.price($obj->total_ttc)."</td>\n";
print "</tr>\n"; print "</tr>\n";

View File

@ -23,7 +23,7 @@
\ingroup commercial \ingroup commercial
\brief Fichier de generation de PDF pour les rapports d'actions \brief Fichier de generation de PDF pour les rapports d'actions
\version $Id$ \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php'); require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
@ -32,7 +32,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
/** /**
\class CommActionRapport \class CommActionRapport
\brief Classe permettant la generation des rapports d'actions \brief Classe permettant la generation des rapports d'actions
*/ */
class CommActionRapport class CommActionRapport
{ {
var $db; var $db;

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,19 +21,26 @@
*/ */
/** /**
\file scripts/prelevement/prelevement-verif.php * \file scripts/prelevement/prelevement-verif.php
\ingroup prelevement * \ingroup prelevement
\brief Vérifie que les sociétés qui doivent être prélevées ont bien un RIB correct * \brief Vérifie que les sociétés qui doivent être prélevées ont bien un RIB correct
*/ */
// Test si mode batch // Test si mode CLI
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
$script_file=__FILE__;
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer $script_file en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n";
exit; exit;
} }
require_once("../../htdocs/master.inc.php"); // Recupere env dolibarr
$version='$Revision$';
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
require_once($path."../../htdocs/master.inc.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); require_once(DOL_DOCUMENT_ROOT."/societe.class.php");

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,20 +21,27 @@
*/ */
/** /**
\file scripts/prelevement/prelevement.php * \file scripts/prelevement/prelevement.php
\ingroup prelevement * \ingroup prelevement
\brief Script de prelevement * \brief Script de prelevement
*/ */
// Test si mode batch // Test si mode CLI
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
$script_file=__FILE__;
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer $script_file en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n";
exit; exit;
} }
require_once("../../htdocs/master.inc.php"); // Recupere env dolibarr
require_once(DOL_DOCUMENT_ROOT."/bon-prelevement.class.php"); $version='$Revision$';
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
require_once($path."../../htdocs/master.inc.php");
require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/bon-prelevement.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
@ -162,7 +169,7 @@ if (!$error)
*/ */
dol_syslog(sizeof($factures_prev)." factures seront prélevées"); dol_syslog(sizeof($factures_prev)." factures seront prélevées");
print 'eeee'.$factures_prev;
if (sizeof($factures_prev) > 0) if (sizeof($factures_prev) > 0)
{ {
/* /*