diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index e62a1dafbf7..920644bbdd9 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -837,7 +837,7 @@ class CommonObject function update_price() { include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php'); - + $err=0; // List lines to sum @@ -855,7 +855,7 @@ class CommonObject $this->total_ht = 0; $this->total_tva = 0; $this->total_ttc = 0; - + $num = $this->db->num_rows($resql); $i = 0; while ($i < $num) @@ -878,7 +878,7 @@ class CommonObject if ($this->element == 'facture_fourn') $fieldtva='total_tva'; $fieldttc='total_ttc'; if ($this->element == 'propal') $fieldttc='total'; - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET'; $sql .= " ".$fieldht."='".price2num($this->total_ht)."',"; $sql .= " ".$fieldtva."='".price2num($this->total_tva)."',"; @@ -905,7 +905,7 @@ class CommonObject dolibarr_syslog("CommonObject::update_price error=".$this->error,LOG_ERR); return -1; } - } + } } ?> diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php index fa25801157a..3217d80a36c 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php @@ -71,7 +71,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Gere choix mode reglement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER $this->option_codeproduitservice = 1; // Affiche code produit-service if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') $this->franchise=1; diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index b2f0651b398..1dd50833f75 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -501,7 +501,7 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('Arial','B',8); - $pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$outputlangs->convToOutputCharset($account->proprio)).':',0,'L',0); + $pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0); $posy=$pdf->GetY()+1; $pdf->SetXY($this->marge_gauche, $posy); @@ -828,17 +828,24 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetXY($this->marge_gauche+2,$posy+3); - // Customer name + // Sender name $pdf->SetTextColor(0,0,60); $pdf->SetFont('Arial','B',11); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->nom), 0, 'L'); + $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->nom), 0, 'L'); - // Customer properties + // Sended properties $carac_emetteur = ''; $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->adresse); $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->cp).' '.$outputlangs->convToOutputCharset($this->emetteur->ville); $carac_emetteur .= "\n"; - // Tel + // Add internal contact of proposal if defined + $arrayidcontact=$object->getIdContact('internal','SALESREPFOLL'); + if (sizeof($arrayidcontact) > 0) + { + $object->fetch_user($arrayidcontact[0]); + $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->fullname); + } + // Tel if ($this->emetteur->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($this->emetteur->tel); // Fax if ($this->emetteur->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($this->emetteur->fax); @@ -849,14 +856,14 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetFont('Arial','',9); $pdf->SetXY($this->marge_gauche+2,$posy+8); - $pdf->MultiCell(80,4, $carac_emetteur); + $pdf->MultiCell(80,3, $carac_emetteur); // Client destinataire $posy=42; $pdf->SetTextColor(0,0,0); $pdf->SetFont('Arial','',8); $pdf->SetXY(102,$posy-5); - $pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":"); + $pdf->MultiCell(80,4, $outputlangs->transnoentities("BillTo").":"); $object->fetch_client(); // Cadre client destinataire diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index 9049635f464..1cd5acee787 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2008 Raphael Bertrand (Resultic) * * This program is free software; you can redistribute it and/or modify @@ -172,7 +172,7 @@ class pdf_propale_jaune extends ModelePDFPropales // New page $pdf->AddPage(); $pagenb++; - $this->_pagehead($pdf, $propale, $outputlangs); + $this->_pagehead($pdf, $propale, 1, $outputlangs); $pdf->SetFont('Arial','', 9); $pdf->MultiCell(0, 4, '', 0, 'J'); // Set interline to 3 $pdf->SetTextColor(0,0,0); @@ -246,7 +246,7 @@ class pdf_propale_jaune extends ModelePDFPropales // New page $pdf->AddPage(); $pagenb++; - $this->_pagehead($pdf, $propale, $outputlangs); + $this->_pagehead($pdf, $propale, 0, $outputlangs); $pdf->SetFont('Arial','', 9); $pdf->MultiCell(0, 4, '', 0, 'J'); // Set interline to 3 $pdf->SetTextColor(0,0,0); @@ -343,12 +343,12 @@ class pdf_propale_jaune extends ModelePDFPropales } - function _pagehead(&$pdf, $propale, $outputlangs) + function _pagehead(&$pdf, $object, $showadress=1, $outputlangs) { global $conf,$langs; //Affiche le filigrane brouillon - Print Draft Watermark - if($propale->statut==0 && defined("PROPALE_DRAFT_WATERMARK") ) + if($object->statut==0 && defined("PROPALE_DRAFT_WATERMARK") ) { $watermark_angle=deg2rad(55); $watermark_x=5; @@ -365,13 +365,27 @@ class pdf_propale_jaune extends ModelePDFPropales $pdf->_out('Q'); } - $pdf->SetTextColor(0,0,0); + $posy=42; - // Caracteristiques emetteur + $pdf->SetXY($this->marge_gauche+2,$posy); + + // Sender name + $pdf->SetTextColor(0,0,00); + $pdf->SetFont('Arial','B',11); + $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->nom), 0, 'L'); + + // Sender properties $carac_emetteur = ''; $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->adresse); $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->cp).' '.$outputlangs->convToOutputCharset($this->emetteur->ville); $carac_emetteur .= "\n"; + // Add internal contact of proposal if defined + $arrayidcontact=$object->getIdContact('internal','SALESREPFOLL'); + if (sizeof($arrayidcontact) > 0) + { + $object->fetch_user($arrayidcontact[0]); + $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->fullname); + } // Tel if ($this->emetteur->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($this->emetteur->tel); // Fax @@ -382,7 +396,7 @@ class pdf_propale_jaune extends ModelePDFPropales if ($this->emetteur->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($this->emetteur->url); $pdf->SetFont('Arial','',9); - $pdf->SetXY(12,42); + $pdf->SetXY($this->marge_gauche+2,$posy+4); $pdf->MultiCell(80,3, $carac_emetteur); @@ -403,14 +417,13 @@ class pdf_propale_jaune extends ModelePDFPropales $pdf->rect(110, 90, 90, 10); $pdf->SetXY(10,90); - $pdf->MultiCell(110, 10, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($propale->ref)); + $pdf->MultiCell(110, 10, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref)); $pdf->SetXY(110,90); - $pdf->MultiCell(100, 10, $outputlangs->transnoentities("Date")." : " . dol_print_date($propale->date,'day',false,$outputlangs,true)); + $pdf->MultiCell(100, 10, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs,true)); $posy=39; - $object=$propale; $object->fetch_client(); diff --git a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php index 1a3c1a55410..f0a0c4aebe5 100644 --- a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -357,60 +357,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetTextColor(0,0,0); } - /* - * Propose mode r�glement par CHQ - */ - /* - if (defined("FACTURE_CHQ_NUMBER")) - { - if (FACTURE_CHQ_NUMBER > 0) - { - $account = new Account($this->db); - $account->fetch(FACTURE_CHQ_NUMBER); - - $pdf->SetXY ($this->marge_gauche, 227); - $pdf->SetFont('Arial','B',8); - $pdf->MultiCell(90, 3, "R�glement par ch�que � l'ordre de ".$account->proprio." envoy� �:",0,'L',0); - $pdf->SetXY ($this->marge_gauche, 231); - $pdf->SetFont('Arial','',8); - $pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0); - } - } - */ - - /* - * Propose mode reglement par RIB - */ - /* - if (defined("FACTURE_RIB_NUMBER")) - { - if (FACTURE_RIB_NUMBER > 0) - { - $account = new Account($this->db); - $account->fetch(FACTURE_RIB_NUMBER); - - $curx=$this->marge_gauche; - $cury=242; - - pdf_bank($pdf,$outputlangs,$curx,$cury,$account); - } - } - */ - - /* - * Conditions de r�glements - */ - /* Pour l'instant les conditions de r�glement ne sont pas g�r�es sur les propales */ - /* - $pdf->SetFont('Arial','B',10); - $pdf->SetXY($this->marge_gauche, 217); - $titre = "Conditions de r�glement:"; - $pdf->MultiCell(80, 5, $titre, 0, 'L'); - $pdf->SetFont('Arial','',10); - $pdf->SetXY(54, 217); - $pdf->MultiCell(80, 5, $prop->cond_reglement_facture,0,'L'); - */ - /* * Pied de page */