Fix: Restore error message, but only when required.
This commit is contained in:
parent
c7aadfcf65
commit
486920958c
@ -692,11 +692,26 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
// Check a payment mode is defined
|
||||
if (empty($object->mode_reglement_code)
|
||||
&& ! $conf->global->FACTURE_CHQ_NUMBER
|
||||
&& ! $conf->global->FACTURE_RIB_NUMBER)
|
||||
&& empty($conf->global->FACTURE_CHQ_NUMBER)
|
||||
&& empty($conf->global->FACTURE_RIB_NUMBER))
|
||||
{
|
||||
$this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured");
|
||||
}
|
||||
// Avoid having any valid PDF with setup that is not complete
|
||||
elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||
|| ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER)))
|
||||
{
|
||||
$outputlangs->load("errors");
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup",$object->mode_reglement_code);
|
||||
$pdf->MultiCell(80, 3, $this->error,0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$posy=$pdf->GetY()+1;
|
||||
}
|
||||
|
||||
// Show payment mode
|
||||
if ($object->mode_reglement_code
|
||||
|
||||
@ -124,6 +124,7 @@ ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit
|
||||
ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check Mysql server is running (in most cases, you can launch it from command line with 'sudo /etc/init.d/mysql start').
|
||||
ErrorFailedToAddContact=Failed to add contact
|
||||
ErrorDateMustBeBeforeToday=The date can not be greater than today
|
||||
ErrorPaymentModeDefinedToWithoutSetup=A payment mode was set to type %s but setup of module Invoice was not completed to define information to show for this payment mode.
|
||||
|
||||
# Warnings
|
||||
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined
|
||||
|
||||
@ -125,6 +125,7 @@ ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe
|
||||
ErrorToConnectToMysqlCheckInstance=Echec de la connection au serveur de base de donnée. Vérifier que Mysql est bien lancé (dans la plupart des cas, vous pouvez le lancer depuis la ligne de commande par la commande 'sudo /etc/init.d/mysql start').
|
||||
ErrorFailedToAddContact=Echec à l'ajout du contact
|
||||
ErrorDateMustBeBeforeToday=La date ne peut pas être supérieure à aujourd'hui
|
||||
ErrorPaymentModeDefinedToWithoutSetup=Un mode de paiement a été défini de type %s mais la configuration du module Facture n'a pas été complété pour définir les informations afficher pour ce mode de paiment.
|
||||
|
||||
# Warnings
|
||||
WarningMandatorySetupNotComplete=Les informations de configuration obligatoire doivent être renseignées
|
||||
|
||||
Loading…
Reference in New Issue
Block a user