From 45067e7d4d2cad0d01cbdf10dabd84713bc19a89 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Jan 2010 19:38:41 +0000 Subject: [PATCH] Fix: We must use the long label for payment condition on PDF documents --- htdocs/commande/commande.class.php | 8 ++++---- htdocs/compta/facture/facture-rec.class.php | 8 ++++---- htdocs/facture.class.php | 4 ++-- htdocs/includes/modules/commande/pdf_einstein.modules.php | 2 +- htdocs/includes/modules/facture/pdf_crabe.modules.php | 2 +- htdocs/includes/modules/facture/pdf_oursin.modules.php | 2 +- .../includes/modules/propale/pdf_propale_azur.modules.php | 2 +- htdocs/propal.class.php | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 8bd76831d12..97b738d9b34 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -939,7 +939,7 @@ class Commande extends CommonObject $sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as facturee'; $sql.= ', c.note, c.note_public, c.ref_client, c.model_pdf, c.fk_adresse_livraison'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; - $sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_facture'; + $sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', el.fk_source'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'cond_reglement as cr ON (c.fk_cond_reglement = cr.rowid)'; @@ -983,7 +983,7 @@ class Commande extends CommonObject $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; $this->cond_reglement = $obj->cond_reglement_libelle; - $this->cond_reglement_facture = $obj->cond_reglement_libelle_facture; + $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->date_livraison = $obj->date_livraison; $this->adresse_livraison_id = $obj->fk_adresse_livraison; // TODO deprecated $this->fk_delivery_address = $obj->fk_adresse_livraison; @@ -1276,9 +1276,9 @@ class Commande extends CommonObject function livraison_array($filtre_statut=-1) { $delivery = new Livraison($this->db); - + $deliveryArray = $delivery->livraison_array($filtre_statut); - + return $deliveryArray; } diff --git a/htdocs/compta/facture/facture-rec.class.php b/htdocs/compta/facture/facture-rec.class.php index 43ff8484195..e95d71eb639 100644 --- a/htdocs/compta/facture/facture-rec.class.php +++ b/htdocs/compta/facture/facture-rec.class.php @@ -127,7 +127,7 @@ class FactureRec extends Facture $sql.= ", '".$facsrc->cond_reglement_id."'"; $sql.= ", '".$facsrc->mode_reglement_id."'"; $sql.= ")"; - + if ( $this->db->query($sql) ) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."facture_rec"); @@ -194,7 +194,7 @@ class FactureRec extends Facture $sql.= ', f.note, f.note_public, f.fk_user_author'; $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; - $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_facture'; + $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', el.fk_source'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'cond_reglement as c ON f.fk_cond_reglement = c.rowid'; @@ -202,7 +202,7 @@ class FactureRec extends Facture $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'"; // TODO remplacer par une fonction $sql.= ' WHERE f.rowid='.$rowid; if ($socid > 0) $sql.= ' AND f.fk_soc = '.$socid; - + $result = $this->db->query($sql); if ($result) @@ -237,7 +237,7 @@ class FactureRec extends Facture $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; $this->cond_reglement = $obj->cond_reglement_libelle; - $this->cond_reglement_facture = $obj->cond_reglement_libelle_facture; + $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->projetid = $obj->fk_projet; $this->fk_facture_source = $obj->fk_facture_source; $this->note = $obj->note; diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 5a694e210e1..db7f01c028d 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -554,7 +554,7 @@ class Facture extends CommonObject $sql.= ', f.fk_facture_source'; $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; - $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_facture'; + $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', el.fk_source'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'cond_reglement as c ON f.fk_cond_reglement = c.rowid'; @@ -599,7 +599,7 @@ class Facture extends CommonObject $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; $this->cond_reglement = $obj->cond_reglement_libelle; - $this->cond_reglement_facture = $obj->cond_reglement_libelle_facture; + $this->cond_reglement_facture = $obj->cond_reglement_libelle_doc; $this->projetid = $obj->fk_projet; $this->fk_facture_source = $obj->fk_facture_source; $this->note = $obj->note; diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index a4fe6e8fbb1..569041639d6 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -430,7 +430,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('Arial','',8); $pdf->SetXY(50, $posy); - $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement); + $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index bb5d038031c..d96629b42b0 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -571,7 +571,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('Arial','',8); $pdf->SetXY(50, $posy); - $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement); + $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index f80752feca6..1a3a6abe663 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -481,7 +481,7 @@ class pdf_oursin extends ModelePDFFactures $pdf->SetFont('Arial','',8); $pdf->SetXY(50, $posy); - $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement); + $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 24c313a7a74..cd7c3be0891 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -450,7 +450,7 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetFont('Arial','',8); $pdf->SetXY(50, $posy); - $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement); + $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index a5510470117..98eaa7d3ad5 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -802,7 +802,7 @@ class Propal extends CommonObject $sql.= ", p.fk_cond_reglement"; $sql.= ", p.fk_mode_reglement"; $sql.= ", c.label as statut_label"; - $sql.= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture"; + $sql.= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc"; $sql.= ", cp.code as mode_reglement_code, cp.libelle as mode_reglement"; $sql.= " FROM ".MAIN_DB_PREFIX."c_propalst as c, ".MAIN_DB_PREFIX."propal as p"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_mode_reglement = cp.id'; @@ -854,7 +854,7 @@ class Propal extends CommonObject $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; $this->cond_reglement = $obj->cond_reglement; - $this->cond_reglement_document = $obj->libelle_facture; + $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->user_author_id = $obj->fk_user_author;