Fix: Problème sur génération document reçu don
This commit is contained in:
parent
c216bb30f8
commit
504a8e1b54
@ -35,16 +35,13 @@ if (!$user->admin)
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
$dons_addon_var = DON_ADDON;
|
|
||||||
|
|
||||||
|
|
||||||
$typeconst=array('yesno','texte','chaine');
|
$typeconst=array('yesno','texte','chaine');
|
||||||
|
|
||||||
|
|
||||||
if ($_GET["action"] == 'setmodelbon')
|
if ($_GET["action"] == 'setmodelbon')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "DON_ADDON",$_GET["value"]))
|
dolibarr_set_const($db, "DON_ADDON_MODEL",$_GET["value"]))
|
||||||
$don_addon_var = $_GET["value"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -91,7 +88,7 @@ while (($file = readdir($handle))!==false)
|
|||||||
echo "$file";
|
echo "$file";
|
||||||
print '</td><td> </td><td align="center">';
|
print '</td><td> </td><td align="center">';
|
||||||
|
|
||||||
if ($dons_addon_var == "$name")
|
if ($conf->global->DON_ADDON_MODEL == $name)
|
||||||
{
|
{
|
||||||
print img_tick();
|
print img_tick();
|
||||||
print '</td><td align="center">';
|
print '</td><td align="center">';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 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
|
||||||
@ -160,10 +160,10 @@ if ($_GET["action"] == 'set_encaisse')
|
|||||||
/*
|
/*
|
||||||
* Générer ou regénérer le document
|
* Générer ou regénérer le document
|
||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'build')
|
if ($_GET['action'] == 'builddoc')
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/dons/modules_don.php");
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/dons/modules_don.php");
|
||||||
don_create($db, $_GET['rowid']);
|
$result=don_create($db, $_GET['rowid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
|||||||
$form->select_types_paiements('', 'modepaiement', 'CRDT', 0);
|
$form->select_types_paiements('', 'modepaiement', 'CRDT', 0);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut().'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
print "<tr>".'<td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ 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 "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
@ -412,7 +412,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="fiche.php?rowid='.$don->id.'&action=build">'.$langs->trans('BuildDonationReceipt').'</a>';
|
print ' <a class="butAction" href="fiche.php?rowid='.$don->id.'&action=builddoc">'.$langs->trans('BuildDonationReceipt').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($don->statut == 0)
|
if ($don->statut == 0)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 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$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,26 +41,26 @@ $libelle[3] = $langs->trans("DonationsReceived");
|
|||||||
|
|
||||||
function llxHeader($head = "")
|
function llxHeader($head = "")
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
|
|
||||||
$langs->load("donations");
|
$langs->load("donations");
|
||||||
|
|
||||||
top_menu($head);
|
top_menu($head);
|
||||||
|
|
||||||
$menu = new Menu();
|
$menu = new Menu();
|
||||||
|
|
||||||
$menu->add(DOL_URL_ROOT."/compta/dons/",$langs->trans("Donations"));
|
$menu->add(DOL_URL_ROOT."/compta/dons/",$langs->trans("Donations"));
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/compta/dons/fiche.php?action=create",$langs->trans("NewDonation"));
|
$menu->add_submenu(DOL_URL_ROOT."/compta/dons/fiche.php?action=create",$langs->trans("NewDonation"));
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/compta/dons/liste.php",$langs->trans("List"));
|
$menu->add_submenu(DOL_URL_ROOT."/compta/dons/liste.php",$langs->trans("List"));
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/compta/dons/stats.php",$langs->trans("Statistics"));
|
$menu->add_submenu(DOL_URL_ROOT."/compta/dons/stats.php",$langs->trans("Statistics"));
|
||||||
|
|
||||||
if ($conf->banque->enabled) {
|
if ($conf->banque->enabled)
|
||||||
$langs->load("banks");
|
{
|
||||||
$menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("Bank"));
|
$langs->load("banks");
|
||||||
}
|
$menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("Bank"));
|
||||||
|
}
|
||||||
left_menu($menu->liste);
|
|
||||||
|
left_menu($menu->liste);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2006 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,29 +21,26 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/includes/dons/html_cerfafr.php
|
\file htdocs/includes/dons/html_cerfafr.modules.php
|
||||||
\ingroup don
|
\ingroup don
|
||||||
\brief Formulaire de don
|
\brief Formulaire de don
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/master.inc.php");
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/projetdon.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/projetdon.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/don.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/don.class.php");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class html_cerfafr
|
\class html_cerfafr
|
||||||
\brief Classe permettant de générer les propales au modèle Azur
|
\brief Classe permettant de générer les propales au modèle Azur
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class html_cerfafr extends ModeleDon
|
class html_cerfafr extends ModeleDon
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
\brief Constructeur
|
\brief Constructeur
|
||||||
\param db Handler accès base de donnée
|
\param db Handler accès base de donnée
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function html_cerfafr($db)
|
function html_cerfafr($db)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@ -60,7 +57,7 @@ class html_cerfafr extends ModeleDon
|
|||||||
*/
|
*/
|
||||||
function pdferror()
|
function pdferror()
|
||||||
{
|
{
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -118,6 +115,8 @@ class html_cerfafr extends ModeleDon
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -148,22 +148,19 @@ function don_create($db, $id, $message='', $modele='', $outputlangs='')
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
// todo forcé ici
|
|
||||||
$conf->global->DON_ADDON='html_cerfafr';
|
|
||||||
|
|
||||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/dons/";
|
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/dons/";
|
||||||
|
|
||||||
// Positionne modele sur le nom du modele à utiliser
|
// Positionne modele sur le nom du modele à utiliser
|
||||||
if (! strlen($modele))
|
if (! strlen($modele))
|
||||||
{
|
{
|
||||||
if ($conf->global->DON_ADDON_PDF)
|
if ($conf->global->DON_ADDON_MODEL)
|
||||||
{
|
{
|
||||||
$modele = $conf->global->DON_ADDON_PDF;
|
$modele = $conf->global->DON_ADDON_MODEL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("Error")." ".$langs->trans("Error_DON_ADDON_PDF_NotDefined");
|
print $langs->trans("Error")." ".$langs->trans("Error_DON_ADDON_MODEL_NotDefined");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -173,6 +170,7 @@ function don_create($db, $id, $message='', $modele='', $outputlangs='')
|
|||||||
if (file_exists($dir.$file))
|
if (file_exists($dir.$file))
|
||||||
{
|
{
|
||||||
$classname = $modele;
|
$classname = $modele;
|
||||||
|
|
||||||
require_once($dir.$file);
|
require_once($dir.$file);
|
||||||
|
|
||||||
$obj = new $classname($db);
|
$obj = new $classname($db);
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class ModeleDon
|
\class ModeleThirdPartyCode
|
||||||
\brief Classe mère des modèles de numérotation des codes tiers
|
\brief Classe mère des modèles de numérotation des codes tiers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -279,7 +279,7 @@ if (! $user->societe_id) // Si utilisateur interne
|
|||||||
{
|
{
|
||||||
$conf->top_menu=$conf->global->MAIN_MENU_BARRETOP;
|
$conf->top_menu=$conf->global->MAIN_MENU_BARRETOP;
|
||||||
$conf->left_menu=$conf->global->MAIN_MENU_BARRELEFT;
|
$conf->left_menu=$conf->global->MAIN_MENU_BARRELEFT;
|
||||||
// Pour compatibilite if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_backoffice.php';
|
// Pour compatibilite
|
||||||
if ($conf->left_menu == 'eldy.php') $conf->left_menu='eldy_backoffice.php';
|
if ($conf->left_menu == 'eldy.php') $conf->left_menu='eldy_backoffice.php';
|
||||||
}
|
}
|
||||||
else // Si utilisateur externe
|
else // Si utilisateur externe
|
||||||
|
|||||||
@ -161,7 +161,7 @@ insert into llx_const (name, value, type) values ('OSC_CATALOG_URL','http://osc.
|
|||||||
--
|
--
|
||||||
-- Modeles de numerotation et generation document
|
-- Modeles de numerotation et generation document
|
||||||
--
|
--
|
||||||
insert into llx_const (name, value, type, visible) values ('DON_ADDON', 'html_cerfafr','chaine',0);
|
insert into llx_const (name, value, type, visible) values ('DON_ADDON_MODEL', 'html_cerfafr','chaine',0);
|
||||||
insert into llx_const (name, value, type, visible) values ('PROPALE_ADDON', 'mod_propale_marbre','chaine',0);
|
insert into llx_const (name, value, type, visible) values ('PROPALE_ADDON', 'mod_propale_marbre','chaine',0);
|
||||||
insert into llx_const (name, value, type, visible) values ('PROPALE_ADDON_PDF', 'azur','chaine',0);
|
insert into llx_const (name, value, type, visible) values ('PROPALE_ADDON_PDF', 'azur','chaine',0);
|
||||||
insert into llx_const (name, value, type, visible) values ('COMMANDE_ADDON', 'mod_commande_ivoire','chaine',0);
|
insert into llx_const (name, value, type, visible) values ('COMMANDE_ADDON', 'mod_commande_ivoire','chaine',0);
|
||||||
|
|||||||
@ -204,6 +204,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (29
|
|||||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (292, 29, '0','0','VAT Rate 0',1);
|
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (292, 29, '0','0','VAT Rate 0',1);
|
||||||
|
|
||||||
|
|
||||||
|
update llx_const set name='DON_ADDON_MODEL' where name='DON_ADDON';
|
||||||
update llx_const set value='neptune' where value='pluton' and name = 'FACTURE_ADDON';
|
update llx_const set value='neptune' where value='pluton' and name = 'FACTURE_ADDON';
|
||||||
update llx_const set value='azur' where value='orange' and name = 'PROPALE_ADDON';
|
update llx_const set value='azur' where value='orange' and name = 'PROPALE_ADDON';
|
||||||
update llx_const set value='mod_commande_diamant' where value='mod_commande_jade' and name ='COMMANDE_ADDON';
|
update llx_const set value='mod_commande_diamant' where value='mod_commande_jade' and name ='COMMANDE_ADDON';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user