mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-12 04:21:30 +01:00
Uniformisation du code pour la gestion des numrotation et modules entre factures, propales, fichieinter, commandes, dons
This commit is contained in:
@@ -28,22 +28,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php');
|
||||||
|
if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"))
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php");
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
|
|
||||||
$user->getrights('propale');
|
$user->getrights('propale');
|
||||||
$user->getrights('fichinter');
|
$user->getrights('fichinter');
|
||||||
$user->getrights('commande');
|
$user->getrights('commande');
|
||||||
$user->getrights('projet');
|
$user->getrights('projet');
|
||||||
|
|
||||||
|
|
||||||
if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"))
|
|
||||||
{
|
|
||||||
require(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php");
|
|
||||||
}
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
@@ -171,7 +171,6 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
print '<td>Mod<6F>le</td>';
|
print '<td>Mod<6F>le</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php');
|
|
||||||
$model=new ModelePDFPropales();
|
$model=new ModelePDFPropales();
|
||||||
$liste=$model->liste_modeles($db);
|
$liste=$model->liste_modeles($db);
|
||||||
$form->select_array("modelpdf",$liste,$conf->global->PROPALE_ADDON_PDF);
|
$form->select_array("modelpdf",$liste,$conf->global->PROPALE_ADDON_PDF);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
||||||
|
|
||||||
$user->getrights('propale');
|
$user->getrights('propale');
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,6 +66,7 @@ if ($_POST["action"] == 'update')
|
|||||||
if ($don->update($user) > 0)
|
if ($don->update($user) > 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?rowid=".$don->id);
|
Header("Location: fiche.php?rowid=".$don->id);
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -80,7 +80,6 @@ if ($_POST["action"] == 'add')
|
|||||||
|
|
||||||
if ($_POST["amount"] > 0)
|
if ($_POST["amount"] > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$don = new Don($db);
|
$don = new Don($db);
|
||||||
|
|
||||||
$don->prenom = $_POST["prenom"];
|
$don->prenom = $_POST["prenom"];
|
||||||
@@ -102,6 +101,7 @@ if ($_POST["action"] == 'add')
|
|||||||
if ($don->create($user) > 0)
|
if ($don->create($user) > 0)
|
||||||
{
|
{
|
||||||
Header("Location: index.php");
|
Header("Location: index.php");
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -116,6 +116,7 @@ if ($_GET["action"] == 'delete')
|
|||||||
$don = new Don($db);
|
$don = new Don($db);
|
||||||
$don->delete($_GET["rowid"]);
|
$don->delete($_GET["rowid"]);
|
||||||
Header("Location: liste.php");
|
Header("Location: liste.php");
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
if ($_POST["action"] == 'commentaire')
|
if ($_POST["action"] == 'commentaire')
|
||||||
{
|
{
|
||||||
@@ -129,6 +130,7 @@ if ($_GET["action"] == 'valid_promesse')
|
|||||||
if ($don->valid_promesse($_GET["rowid"], $user->id))
|
if ($don->valid_promesse($_GET["rowid"], $user->id))
|
||||||
{
|
{
|
||||||
Header("Location: liste.php");
|
Header("Location: liste.php");
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($_GET["action"] == 'set_payed')
|
if ($_GET["action"] == 'set_payed')
|
||||||
@@ -137,6 +139,7 @@ if ($_GET["action"] == 'set_payed')
|
|||||||
if ($don->set_paye($_GET["rowid"], $modepaiement))
|
if ($don->set_paye($_GET["rowid"], $modepaiement))
|
||||||
{
|
{
|
||||||
Header("Location: liste.php");
|
Header("Location: liste.php");
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($_GET["action"] == 'set_encaisse')
|
if ($_GET["action"] == 'set_encaisse')
|
||||||
@@ -145,9 +148,19 @@ if ($_GET["action"] == 'set_encaisse')
|
|||||||
if ($don->set_encaisse($_GET["rowid"]))
|
if ($don->set_encaisse($_GET["rowid"]))
|
||||||
{
|
{
|
||||||
Header("Location: liste.php");
|
Header("Location: liste.php");
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* G<>n<EFBFBD>rer ou reg<65>n<EFBFBD>rer le document
|
||||||
|
*/
|
||||||
|
if ($_GET['action'] == 'build')
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/dons/modules_don.php");
|
||||||
|
don_create($db, $_GET['rowid']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
@@ -161,8 +174,8 @@ $html=new Form($db);
|
|||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
if ($_GET["action"] == 'create') {
|
if ($_GET["action"] == 'create')
|
||||||
|
{
|
||||||
print_titre($langs->trans("AddDonation"));
|
print_titre($langs->trans("AddDonation"));
|
||||||
|
|
||||||
print '<form action="fiche.php" method="post">';
|
print '<form action="fiche.php" method="post">';
|
||||||
@@ -174,7 +187,10 @@ if ($_GET["action"] == 'create') {
|
|||||||
$html->select_date();
|
$html->select_date();
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td rowspan="12" valign="top">'.$langs->trans("Comments").' :<br>';
|
$nbrows=11;
|
||||||
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
|
||||||
|
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
||||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\"></textarea></td></tr>";
|
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\"></textarea></td></tr>";
|
||||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
||||||
|
|
||||||
@@ -210,7 +226,6 @@ if ($_GET["action"] == 'create') {
|
|||||||
print "<tr>".'<td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
print "<tr>".'<td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -222,7 +237,6 @@ if ($_GET["action"] == 'create') {
|
|||||||
|
|
||||||
if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
||||||
{
|
{
|
||||||
|
|
||||||
$don = new Don($db);
|
$don = new Don($db);
|
||||||
$don->id = $_GET["rowid"];
|
$don->id = $_GET["rowid"];
|
||||||
$don->fetch($_GET["rowid"]);
|
$don->fetch($_GET["rowid"]);
|
||||||
@@ -245,13 +259,17 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
$html->select_date($don->date);
|
$html->select_date($don->date);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td rowspan="12" valign="top">'.$langs->trans("Comments").' :<br>';
|
$nbrows=12;
|
||||||
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
|
||||||
|
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
||||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\">$don->commentaire</textarea></td></tr>";
|
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\">$don->commentaire</textarea></td></tr>";
|
||||||
|
|
||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled)
|
||||||
{
|
{
|
||||||
print "<tr><td>".$langs->trans("Project")."</td><td><select name=\"projetid\">\n";
|
print "<tr><td>".$langs->trans("Project")."</td><td><select name=\"projetid\">\n";
|
||||||
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."don_projet ORDER BY rowid";
|
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."don_projet";
|
||||||
|
$sql.= " ORDER BY rowid";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
@@ -282,7 +300,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.$don->prenom.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.$don->prenom.'"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.$don->nom.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.$don->nom.'"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
||||||
print '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$don->adresse.'</textarea></td></tr>';
|
print '<textarea name="adresse" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->adresse.'</textarea></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" size="8" value="'.$don->cp.'"> <input type="text" name="ville" size="40" value="'.$don->ville.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" size="8" value="'.$don->cp.'"> <input type="text" name="ville" size="40" value="'.$don->ville.'"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" size="40" value="'.$don->pays.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" size="40" value="'.$don->pays.'"></td></tr>';
|
||||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
|
||||||
@@ -293,7 +311,9 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
$paiement->select("modepaiement","CRDT");
|
$paiement->select("modepaiement","CRDT");
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut().'</td></tr>';
|
||||||
|
|
||||||
|
print "<tr>".'<td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
@@ -310,7 +330,6 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
/* ************************************************************ */
|
/* ************************************************************ */
|
||||||
if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
||||||
{
|
{
|
||||||
|
|
||||||
$don = new Don($db);
|
$don = new Don($db);
|
||||||
$don->id = $_GET["rowid"];
|
$don->id = $_GET["rowid"];
|
||||||
$don->fetch($_GET["rowid"]);
|
$don->fetch($_GET["rowid"]);
|
||||||
@@ -331,10 +350,14 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
print dolibarr_print_date($don->date,"%d %B %Y");
|
print dolibarr_print_date($don->date,"%d %B %Y");
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td rowspan="12" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
$nbrows=12;
|
||||||
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
|
||||||
|
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
||||||
print nl2br($don->commentaire).'</td></tr>';
|
print nl2br($don->commentaire).'</td></tr>';
|
||||||
|
|
||||||
if ($conf->projet->enabled) {
|
if ($conf->projet->enabled)
|
||||||
|
{
|
||||||
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,6 +377,8 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
print $don->modepaiement;
|
print $don->modepaiement;
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut().'</td></tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
@@ -369,7 +394,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
|
|
||||||
if ($don->statut == 0)
|
if ($don->statut == 0)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("Valid").'</a>';
|
print '<a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// \todo G<>rer action <20>mettre paiement
|
// \todo G<>rer action <20>mettre paiement
|
||||||
@@ -385,7 +410,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
|
|
||||||
if ($don->statut == 2 || $don->statut == 3)
|
if ($don->statut == 2 || $don->statut == 3)
|
||||||
{
|
{
|
||||||
print "<a class=\"butAction\" href=\"formulaire/".DONS_FORM."?rowid=$don->id\">".$langs->trans("Form")."</a>";
|
print ' <a class="butAction" href="fiche.php?rowid='.$don->id.'&action=build">'.$langs->trans('BuildDoc').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($don->statut == 0)
|
if ($don->statut == 0)
|
||||||
@@ -401,5 +426,6 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -30,15 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require('./pre.inc.php');
|
require('./pre.inc.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
$user->getrights('facture');
|
|
||||||
$user->getrights('banque');
|
|
||||||
|
|
||||||
if (!$user->rights->facture->lire)
|
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
$langs->load('bills');
|
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
||||||
@@ -47,6 +39,13 @@ if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT.'/propal.class.php'
|
|||||||
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT.'/contrat/contrat.class.php');
|
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT.'/contrat/contrat.class.php');
|
||||||
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
||||||
|
|
||||||
|
$user->getrights('facture');
|
||||||
|
$user->getrights('banque');
|
||||||
|
|
||||||
|
if (!$user->rights->facture->lire)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
|
$langs->load('bills');
|
||||||
|
|
||||||
$sall=isset($_GET['sall'])?$_GET['sall']:$_POST['sall'];
|
$sall=isset($_GET['sall'])?$_GET['sall']:$_POST['sall'];
|
||||||
if (isset($_GET['msg'])) { $msg=urldecode($_GET['msg']); }
|
if (isset($_GET['msg'])) { $msg=urldecode($_GET['msg']); }
|
||||||
@@ -404,10 +403,7 @@ if ($_POST['action'] == 'confirm_canceled' && $_POST['confirm'] == 'yes')
|
|||||||
{
|
{
|
||||||
$fac = new Facture($db);
|
$fac = new Facture($db);
|
||||||
$fac->fetch($_GET['facid']);
|
$fac->fetch($_GET['facid']);
|
||||||
$result = $fac->set_canceled();
|
$result = $fac->set_canceled($user);
|
||||||
$_GET['facid'] = 0 ;
|
|
||||||
Header('Location: facture.php');
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,8 +548,6 @@ if ($_POST['action'] == 'send' || $_POST['action'] == 'relance')
|
|||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'pdf')
|
if ($_GET['action'] == 'pdf')
|
||||||
{
|
{
|
||||||
// Generation de la facture d<>finie dans /includes/modules/facture/modules_facture.php
|
|
||||||
// G<>n<EFBFBD>re <20>galement le fichier meta dans le meme r<>pertoire (pour faciliter les recherches et indexation)
|
|
||||||
facture_pdf_create($db, $_GET['facid']);
|
facture_pdf_create($db, $_GET['facid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2005 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,7 +18,6 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,26 +57,33 @@ class Don
|
|||||||
var $projet;
|
var $projet;
|
||||||
var $errorstr;
|
var $errorstr;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Statut du don
|
|
||||||
* 0 : promesse non valid<69>e
|
|
||||||
* 1 : promesse valid<69>e
|
|
||||||
* 2 : don valid<69>
|
|
||||||
* 3 : don pay<61>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* \brief Constructeur
|
* \brief Constructeur
|
||||||
* \param DB handler d'acc<63>s base
|
* \param DB handler d'acc<63>s base
|
||||||
* \param soc_idp id soci<63>t<EFBFBD>
|
* \param soc_idp id soci<63>t
|
||||||
*/
|
*/
|
||||||
function Don($DB, $soc_idp="")
|
function Don($DB, $soc_idp="")
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->modepaiementid = 0;
|
$this->modepaiementid = 0;
|
||||||
|
|
||||||
|
$langs->load("donations");
|
||||||
|
$this->labelstatut[0]=$langs->trans("DonationStatusPromessNotValidated");
|
||||||
|
$this->labelstatut[1]=$langs->trans("DonationStatusPromessValidated");
|
||||||
|
$this->labelstatut[2]=$langs->trans("DonationStatusValidated");
|
||||||
|
$this->labelstatut[3]=$langs->trans("DonationStatusPayed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retourne le libell<6C> du statut d'une propale (brouillon, valid<69>e, ...)
|
||||||
|
* \return string Libell<6C>
|
||||||
|
*/
|
||||||
|
function getLibStatut()
|
||||||
|
{
|
||||||
|
return $this->labelstatut[$this->statut];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -279,16 +285,18 @@ class Don
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Charge l'objet don en m<>moire depuis la base de donn<6E>e
|
* \brief Charge l'objet don en m<>moire depuis la base de donn<6E>e
|
||||||
* \param rowid id du don <20> charger
|
* \param rowid Id du don <20> charger
|
||||||
*
|
* \return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid, ".$this->db->pdate("d.datec")." as datec,";
|
$sql = "SELECT d.rowid, ".$this->db->pdate("d.datec")." as datec,";
|
||||||
$sql.= " ".$this->db->pdate("d.datedon")." as datedon,";
|
$sql.= " ".$this->db->pdate("d.datedon")." as datedon,";
|
||||||
$sql.= " d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet";
|
$sql.= " d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d, ".MAIN_DB_PREFIX."c_paiement as cp LEFT JOIN ".MAIN_DB_PREFIX."don_projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."don as d";
|
||||||
$sql.= " ON p.rowid = d.fk_don_projet WHERE cp.id = d.fk_paiement AND d.rowid = $rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."don_projet as p";
|
||||||
|
$sql.= " ON p.rowid = d.fk_don_projet";
|
||||||
|
$sql.= " WHERE cp.id = d.fk_paiement AND d.rowid = ".$rowid;
|
||||||
|
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
{
|
{
|
||||||
@@ -317,10 +325,12 @@ class Don
|
|||||||
$this->amount = $obj->amount;
|
$this->amount = $obj->amount;
|
||||||
$this->commentaire = stripslashes($obj->note);
|
$this->commentaire = stripslashes($obj->note);
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_print_error($this->db);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1376,7 +1376,7 @@ class Facture
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db,"modules_facture::getNextNumRef ".$obj->error);
|
dolibarr_print_error($db,"Facture::getNextNumRef ".$obj->error);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,24 @@ class ModeleNumRefCommandes
|
|||||||
return $langs->trans("NoExample");
|
return $langs->trans("NoExample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Test si les num<75>ros d<>j<EFBFBD> en vigueur dans la base ne provoquent pas de
|
||||||
|
* de conflits qui empechera cette num<75>rotation de fonctionner.
|
||||||
|
* \return boolean false si conflit, true si ok
|
||||||
|
*/
|
||||||
|
function canBeActivated()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Renvoi prochaine valeur attribu<62>e
|
||||||
|
* \return string Valeur
|
||||||
|
*/
|
||||||
|
function getNextValue()
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
return $langs->trans("NotAvailable");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class pdf_bernique
|
\class pdf_bernique
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class pdf_bigorneau
|
/** \class pdf_bigorneau
|
||||||
\brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Bigorneau
|
\brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Bigorneau
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class pdf_bulot
|
/** \class pdf_bulot
|
||||||
\brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Bulot
|
\brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Bulot
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class pdf_huitre
|
\class pdf_huitre
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class pdf_tourteau
|
/** \class pdf_tourteau
|
||||||
\brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Tourteau
|
\brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Tourteau
|
||||||
|
|||||||
@@ -116,6 +116,24 @@ class ModeleNumRefFicheinter
|
|||||||
return $langs->trans("NoExample");
|
return $langs->trans("NoExample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Test si les num<75>ros d<>j<EFBFBD> en vigueur dans la base ne provoquent pas de
|
||||||
|
* de conflits qui empechera cette num<75>rotation de fonctionner.
|
||||||
|
* \return boolean false si conflit, true si ok
|
||||||
|
*/
|
||||||
|
function canBeActivated()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Renvoi prochaine valeur attribu<62>e
|
||||||
|
* \return string Valeur
|
||||||
|
*/
|
||||||
|
function getNextValue()
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
return $langs->trans("NotAvailable");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2005 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
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,6 +118,15 @@ class ModeleNumRefPropales
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Renvoi prochaine valeur attribu<62>e
|
||||||
|
* \return string Valeur
|
||||||
|
*/
|
||||||
|
function getNextValue()
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
return $langs->trans("NotAvailable");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class pdf_propale_adytek
|
/** \class pdf_propale_adytek
|
||||||
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Adytek
|
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Adytek
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class pdf_propale_bleu
|
/** \class pdf_propale_bleu
|
||||||
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Bleu
|
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Bleu
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class pdf_propale_jaune
|
/** \class pdf_propale_jaune
|
||||||
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Jaune
|
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Jaune
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class pdf_propale_rouge
|
\class pdf_propale_rouge
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class pdf_propale_vert
|
/** \class pdf_propale_vert
|
||||||
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Vert
|
\brief Classe permettant de g<>n<EFBFBD>rer les propales au mod<6F>le Vert
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ Send=Send
|
|||||||
SendRemind=Send reminder
|
SendRemind=Send reminder
|
||||||
DoPaiement=Do payment
|
DoPaiement=Do payment
|
||||||
DoPayment=Do payment
|
DoPayment=Do payment
|
||||||
BuildPDF=Build PDF
|
|
||||||
RebuildPDF=Rebuild PDF
|
|
||||||
VAT=VAT
|
VAT=VAT
|
||||||
VATRate=VAT Rate
|
VATRate=VAT Rate
|
||||||
Amount=Amount
|
Amount=Amount
|
||||||
|
|||||||
@@ -285,6 +285,10 @@ Internals=Internal
|
|||||||
Externals=External
|
Externals=External
|
||||||
Warning=Warning
|
Warning=Warning
|
||||||
Warnings=Warnings
|
Warnings=Warnings
|
||||||
|
BuildPDF=Build PDF
|
||||||
|
RebuildPDF=Rebuild PDF
|
||||||
|
BuildDoc=Build Doc
|
||||||
|
RebuildDoc=Rebuild Doc
|
||||||
# Countries
|
# Countries
|
||||||
CountryFR=France
|
CountryFR=France
|
||||||
CountryBE=Belgium
|
CountryBE=Belgium
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ CreateBill=Cr
|
|||||||
Send=Envoyer
|
Send=Envoyer
|
||||||
SendRemind=Envoyer un rappel
|
SendRemind=Envoyer un rappel
|
||||||
DoPaiement=Emettre un paiement
|
DoPaiement=Emettre un paiement
|
||||||
BuildPDF=G<>n<EFBFBD>rer le PDF
|
|
||||||
RebuildPDF=Reg<65>n<EFBFBD>rer le PDF
|
|
||||||
VAT=TVA
|
VAT=TVA
|
||||||
VATRate=Taux TVA
|
VATRate=Taux TVA
|
||||||
Amount=Montant
|
Amount=Montant
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ Send=Envoyer
|
|||||||
SendRemind=Envoyer rappel
|
SendRemind=Envoyer rappel
|
||||||
DoPaiement=<3D>mettre paiement
|
DoPaiement=<3D>mettre paiement
|
||||||
DoPayment=<3D>mettre paiement
|
DoPayment=<3D>mettre paiement
|
||||||
BuildPDF=G<>n<EFBFBD>rer le PDF
|
|
||||||
RebuildPDF=Reg<65>n<EFBFBD>rer le PDF
|
|
||||||
VAT=TVA
|
VAT=TVA
|
||||||
VATRate=Taux TVA
|
VATRate=Taux TVA
|
||||||
Amount=Montant
|
Amount=Montant
|
||||||
|
|||||||
@@ -285,6 +285,10 @@ Internals=Internes
|
|||||||
Externals=Externes
|
Externals=Externes
|
||||||
Warning=Alerte
|
Warning=Alerte
|
||||||
Warnings=Alertes
|
Warnings=Alertes
|
||||||
|
BuildPDF=G<>n<EFBFBD>rer le PDF
|
||||||
|
RebuildPDF=Reg<65>n<EFBFBD>rer le PDF
|
||||||
|
BuildDoc=G<>n<EFBFBD>rer le doc
|
||||||
|
RebuildDoc=Reg<65>n<EFBFBD>rer le doc
|
||||||
# Countries
|
# Countries
|
||||||
CountryFR=France
|
CountryFR=France
|
||||||
CountryBE=Belgique
|
CountryBE=Belgique
|
||||||
|
|||||||
@@ -287,12 +287,18 @@ $conf->webcal->db->pass=defined('PHPWEBCALENDAR_PASS')?PHPWEBCALENDAR_PASS:'';
|
|||||||
$conf->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
|
$conf->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
|
||||||
|
|
||||||
$conf->facture->enabled=defined("MAIN_MODULE_FACTURE")?MAIN_MODULE_FACTURE:0;
|
$conf->facture->enabled=defined("MAIN_MODULE_FACTURE")?MAIN_MODULE_FACTURE:0;
|
||||||
if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
// \todo Ajouter la ligne
|
||||||
|
// require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
// dans le fichier facturation-emission.php du module telephonie afin de pouvoir
|
||||||
|
// supprimer celles qui suivent.
|
||||||
|
if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
}
|
||||||
$conf->facture->dir_output=DOL_DATA_ROOT."/facture";
|
$conf->facture->dir_output=DOL_DATA_ROOT."/facture";
|
||||||
$conf->facture->dir_images=DOL_DATA_ROOT."/facture/images";
|
$conf->facture->dir_images=DOL_DATA_ROOT."/facture/images";
|
||||||
if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $conf->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par d?faut
|
if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $conf->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par d?faut
|
||||||
$conf->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0;
|
$conf->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0;
|
||||||
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
|
|
||||||
if (!defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
|
if (!defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
|
||||||
$conf->propal->dir_output=DOL_DATA_ROOT."/propale";
|
$conf->propal->dir_output=DOL_DATA_ROOT."/propale";
|
||||||
$conf->propal->dir_images=DOL_DATA_ROOT."/propale/images";
|
$conf->propal->dir_images=DOL_DATA_ROOT."/propale/images";
|
||||||
|
|||||||
Reference in New Issue
Block a user