Fix: Some errors on generating delivery and sending receipts
This commit is contained in:
parent
f92c05ec38
commit
22e20cea21
@ -67,10 +67,16 @@ if ($_GET["action"] == 'specimen')
|
|||||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf");
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||||
|
dolibarr_syslog($obj->error, LOG_ERR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
|
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
|
||||||
|
dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,10 +74,16 @@ if ($_GET["action"] == 'specimen')
|
|||||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||||
|
dolibarr_syslog($obj->error, LOG_ERR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
|
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
|
||||||
|
dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -218,7 +218,7 @@ if ($modulepart)
|
|||||||
{
|
{
|
||||||
$accessallowed=1;
|
$accessallowed=1;
|
||||||
}
|
}
|
||||||
$original_file=$conf->expedition->dir_output.'/'.$original_file;
|
$original_file=$conf->expedition_bon->dir_output.'/'.$original_file;
|
||||||
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'";
|
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ if ($modulepart)
|
|||||||
{
|
{
|
||||||
$accessallowed=1;
|
$accessallowed=1;
|
||||||
}
|
}
|
||||||
$original_file=$conf->livraison->dir_output.'/'.$original_file;
|
$original_file=$conf->livraison_bon->dir_output.'/'.$original_file;
|
||||||
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'";
|
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -662,6 +662,8 @@ class Expedition extends CommonObject
|
|||||||
{
|
{
|
||||||
global $user,$langs;
|
global $user,$langs;
|
||||||
|
|
||||||
|
dolibarr_syslog("Expedition::initAsSpecimen");
|
||||||
|
|
||||||
// Charge tableau des id de société socids
|
// Charge tableau des id de société socids
|
||||||
$socids = array();
|
$socids = array();
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1 LIMIT 10";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1 LIMIT 10";
|
||||||
|
|||||||
@ -684,7 +684,7 @@ else
|
|||||||
if ($conf->expedition_bon->enabled)
|
if ($conf->expedition_bon->enabled)
|
||||||
{
|
{
|
||||||
$expeditionref = sanitize_string($expedition->ref);
|
$expeditionref = sanitize_string($expedition->ref);
|
||||||
$filedir = $conf->expedition->dir_output . "/" .$expeditionref;
|
$filedir = $conf->expedition_bon->dir_output . "/" .$expeditionref;
|
||||||
|
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||||
|
|
||||||
|
|||||||
@ -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-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/expedition/mods/pdf/pdf_expedition_dorade.modules.php
|
\file htdocs/expedition/mods/pdf/pdf_expedition_merou.modules.php
|
||||||
\ingroup expedition
|
\ingroup expedition
|
||||||
\brief Fichier de la classe permettant de générer les bordereaux envoi au modèle Merou
|
\brief Fichier de la classe permettant de générer les bordereaux envoi au modèle Merou
|
||||||
\version $Id$
|
\version $Id$
|
||||||
@ -93,7 +93,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$this->expe = $obj;
|
$this->expe = $obj;
|
||||||
|
|
||||||
//Verification de la configuration
|
//Verification de la configuration
|
||||||
if ($conf->expedition->dir_output)
|
if ($conf->expedition_bon->dir_output)
|
||||||
{
|
{
|
||||||
//Creation du Client
|
//Creation du Client
|
||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
@ -117,13 +117,13 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
// Définition de $dir et $file
|
// Définition de $dir et $file
|
||||||
if ($this->expe->specimen)
|
if ($this->expe->specimen)
|
||||||
{
|
{
|
||||||
$dir = $conf->expedition->dir_output;
|
$dir = $conf->expedition_bon->dir_output;
|
||||||
$file = $dir . "/SPECIMEN.pdf";
|
$file = $dir . "/SPECIMEN.pdf";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$expref = sanitize_string($this->expe->ref);
|
$expref = sanitize_string($this->expe->ref);
|
||||||
$dir = $conf->expedition->dir_output . "/" . $expref;
|
$dir = $conf->expedition_bon->dir_output . "/" . $expref;
|
||||||
$file = $dir . "/" . $expref . ".pdf";
|
$file = $dir . "/" . $expref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* 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
|
||||||
@ -130,20 +130,20 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
$outputlangs->setPhpLang();
|
$outputlangs->setPhpLang();
|
||||||
|
|
||||||
if ($conf->expedition->dir_output)
|
if ($conf->expedition_bon->dir_output)
|
||||||
{
|
{
|
||||||
$this->expe = $obj;
|
$this->expe = $obj;
|
||||||
|
|
||||||
// Définition de $dir et $file
|
// Définition de $dir et $file
|
||||||
if ($this->expe->specimen)
|
if ($this->expe->specimen)
|
||||||
{
|
{
|
||||||
$dir = $conf->expedition->dir_output;
|
$dir = $conf->expedition_bon->dir_output;
|
||||||
$file = $dir . "/SPECIMEN.pdf";
|
$file = $dir . "/SPECIMEN.pdf";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$expref = sanitize_string($this->expe->ref);
|
$expref = sanitize_string($this->expe->ref);
|
||||||
$dir = $conf->expedition->dir_output . "/" . $expref;
|
$dir = $conf->expedition_bon->dir_output . "/" . $expref;
|
||||||
$file = $dir . "/" . $expref . ".pdf";
|
$file = $dir . "/" . $expref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -552,7 +552,7 @@ else
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$livraisonref = sanitize_string($livraison->ref);
|
$livraisonref = sanitize_string($livraison->ref);
|
||||||
$filedir = $conf->livraison->dir_output . '/' . $livraisonref;
|
$filedir = $conf->livraison_bon->dir_output . '/' . $livraisonref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$livraison->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$livraison->id;
|
||||||
|
|
||||||
$genallowed=$user->rights->expedition->livraison->creer;
|
$genallowed=$user->rights->expedition->livraison->creer;
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
|
|
||||||
|
|
||||||
/** \brief Renvoi dernière erreur
|
/** \brief Renvoi dernière erreur
|
||||||
\return string Dernière erreur
|
* \return string Dernière erreur
|
||||||
*/
|
*/
|
||||||
function pdferror()
|
function pdferror()
|
||||||
{
|
{
|
||||||
@ -69,9 +69,10 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
/**
|
/**
|
||||||
\brief Fonction générant le bon de livraison sur le disque
|
\brief Fonction générant le bon de livraison sur le disque
|
||||||
\param delivery Object livraison à générer
|
\param delivery Object livraison à générer
|
||||||
\return int 1=ok, 0=ko
|
\param outputlangs Output language
|
||||||
|
\return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($delivery)
|
function write_file($delivery,$outputlangs='')
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs;
|
global $user,$conf,$langs;
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
$deliveryref = sanitize_string($delivery->ref);
|
$deliveryref = sanitize_string($delivery->ref);
|
||||||
$dir = $conf->livraison->dir_output;
|
$dir = $conf->livraison_bon->dir_output;
|
||||||
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
||||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
$file = $dir . "/" . $deliveryref . ".pdf";
|
||||||
|
|
||||||
@ -108,14 +109,6 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
|
||||||
|
|
||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
@ -257,8 +250,14 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Affiche la grille des lignes de propales
|
* \brief Affiche la grille des lignes de propales
|
||||||
* \param pdf objet PDF
|
* \param pdf objet PDF
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -87,8 +87,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoi dernière erreur
|
* \brief Renvoi dernière erreur
|
||||||
\return string Dernière erreur
|
* \return string Dernière erreur
|
||||||
*/
|
*/
|
||||||
function pdferror()
|
function pdferror()
|
||||||
{
|
{
|
||||||
@ -96,9 +96,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Fonction générant la commande sur le disque
|
\brief Fonction générant le bon de livraison sur le disque
|
||||||
\param delivery Object livraison à générer
|
\param delivery Object livraison à générer
|
||||||
\return int 1=ok, 0=ko
|
\param outputlangs Output language
|
||||||
|
\return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($delivery,$outputlangs='')
|
function write_file($delivery,$outputlangs='')
|
||||||
{
|
{
|
||||||
@ -127,7 +128,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$nblignes = sizeof($delivery->lignes);
|
$nblignes = sizeof($delivery->lignes);
|
||||||
|
|
||||||
$deliveryref = sanitize_string($delivery->ref);
|
$deliveryref = sanitize_string($delivery->ref);
|
||||||
$dir = $conf->livraison->dir_output;
|
$dir = $conf->livraison_bon->dir_output;
|
||||||
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
||||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
$file = $dir . "/" . $deliveryref . ".pdf";
|
||||||
|
|
||||||
@ -426,14 +427,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
|
$this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$this->error=$langs->transnoentities("ErrorUnknown");
|
|
||||||
return 0; // Erreur par defaut
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Affiche le total à payer
|
* \brief Affiche le total à payer
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user