Trad: Traduction des conditions de paiements

New: Ajout date fin validité sur propal azur
Fix: Les conditions de paiements n'apparaissaient pas sur les factures ni propales
This commit is contained in:
Laurent Destailleur 2006-04-22 00:56:55 +00:00
parent 6627adc2a0
commit b9dc296811
5 changed files with 108 additions and 78 deletions

View File

@ -810,7 +810,7 @@ class Form
if (sizeof($this->cache_conditions_paiements_code)) return 0; // Cache déja chargé
dolibarr_syslog('html.form.class.php::load_cache_conditions_paiements');
$sql = "SELECT rowid, libelle";
$sql = "SELECT rowid, code, libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."cond_reglement";
$sql.= " WHERE active=1";
$sql.= " ORDER BY sortorder";
@ -824,7 +824,7 @@ class Form
$obj = $this->db->fetch_object($resql);
// Si traduction existe, on l'utilise, sinon on prend le libellé par défaut
$libelle=($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->libelle!='-'?$obj->libelle:''));
$libelle=($langs->trans("PaymentConditionShort".$obj->code)!=("PaymentConditionShort".$obj->code)?$langs->trans("PaymentConditionShort".$obj->code):($obj->libelle!='-'?$obj->libelle:''));
$this->cache_conditions_paiements_code[$obj->rowid]=$obj->code;
$this->cache_conditions_paiements_libelle[$obj->rowid]=$libelle;
$i++;

View File

@ -414,7 +414,7 @@ class pdf_crabe extends ModelePDFFactures
/*
* Conditions de règlements
*/
if ($fac->cond_reglement_facture)
if ($fac->cond_reglement_code)
{
$pdf->SetFont('Arial','B',8);
$pdf->SetXY($this->marge_gauche, 217);
@ -422,7 +422,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('Arial','',8);
$pdf->SetXY(50, 217);
$pdf->MultiCell(80, 5, $fac->cond_reglement_facture,0,'L');
$lib_condition_paiement=$langs->trans("PaymentCondition".$fac->cond_reglement_code)?$langs->trans("PaymentCondition".$fac->cond_reglement_code):$fac->cond_reglement;
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
}
/*

View File

@ -1,5 +1,5 @@
<?php
/* 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
* it under the terms of the GNU General Public License as published by
@ -427,15 +427,16 @@ class pdf_propale_azur extends ModelePDFPropales
/*
* Conditions de règlements
*/
if ($prop->cond_reglement_facture)
if ($prop->cond_reglement_code)
{
$pdf->SetFont('Arial','B',8);
$pdf->SetXY($this->marge_gauche, 217);
$titre = "Conditions de réglement:";
$titre = $langs->trans("PaymentConditions").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('Arial','',8);
$pdf->SetXY(50, 217);
$pdf->MultiCell(80, 5, $prop->cond_reglement_facture,0,'L');
$lib_condition_paiement=$langs->trans("PaymentCondition".$prop->cond_reglement_code)?$langs->trans("PaymentCondition".$prop->cond_reglement_code):$prop->cond_reglement;
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
}
/*
@ -700,6 +701,11 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("Date")." : " . dolibarr_print_date($prop->date,"%d %b %Y"), '', 'R');
$posy+=6;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("DateEndPropal")." : " . dolibarr_print_date($prop->fin_validite,"%d %b %Y"), '', 'R');
if ($showadress)
{
// Emetteur

View File

@ -123,3 +123,15 @@ AddGlobalDiscount=Add discount
DiscountOfferedBy=Granted by
DiscountStillRemaining=Discount still remaining
DiscountAlreadyCounted=Discount already counted
# PaymentConditions
PaymentConditionShortRECEP=After reception
PaymentConditionRECEP=After invoice reception
PaymentConditionShort30D=30 days
PaymentCondition30D=Payment after 30 days
PaymentConditionShort30DENDMONTH=30 days end of month
PaymentCondition30DENDMONTH=Payment after 30 days end of month
PaymentConditionShort60D=60 days
PaymentCondition60D=Payment after 60 days
PaymentConditionShort60DENDMONTH=60 days end of month
PaymentCondition60DENDMONTH=Payment after 60 days end of month

View File

@ -123,3 +123,14 @@ AddGlobalDiscount=Ajouter avoir
DiscountOfferedBy=Accordé par
DiscountStillRemaining=Avoirs restant en cours
DiscountAlreadyCounted=Remises déjà appliquées
# PaymentConditions
PaymentConditionShortRECEP=A réception
PaymentConditionRECEP=A réception de facture
PaymentConditionShort30D=30 jours
PaymentCondition30D=Réglement à 30 jours
PaymentConditionShort30DENDMONTH=30 jours fin de mois
PaymentCondition30DENDMONTH=Réglement à 30 jours fin de mois
PaymentConditionShort60D=60 jours
PaymentCondition60D=Réglement à 60 jours
PaymentConditionShort60DENDMONTH=60 jours fin de mois
PaymentCondition60DENDMONTH=Réglement à 60 jours fin de mois