From a98e57c596a12d11c7599ea2dbf4f3a6af3348d0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Apr 2012 12:04:14 +0200 Subject: [PATCH 1/6] Fix: missing company logo and invert from to ! --- .../pdf/pdf_muscadet.modules.php | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index d94c5129335..ff5b81a5dd5 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -902,7 +902,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($this->marge_gauche,$posy); // Logo - /* $logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; if ($mysoc->logo) { @@ -920,10 +919,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } } else - {*/ + { $text=$this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); - //} + } $pdf->SetFont('', 'B', $default_font_size + 3); $pdf->SetXY($posx,$posy); @@ -959,7 +958,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs,$mysoc); // Show sender $posy=42; @@ -980,10 +979,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Show sender name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($mysoc->name), 0, 'L'); // Show sender information - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($this->emetteur->name,44)*4)); + $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($mysoc->name,44)*4)); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); @@ -991,7 +990,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // If BILLING contact defined on order, we use it $usecontact=false; - $arrayidcontact=$object->getIdContact('internal','BILLING'); + $arrayidcontact=$object->getIdContact('external','BILLING'); if (count($arrayidcontact) > 0) { $usecontact=true; @@ -1003,15 +1002,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { // On peut utiliser le nom de la societe du contact if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; - else $socname = $mysoc->nom; + else $socname = $this->emetteur->name; $carac_client_name=$outputlangs->convToOutputCharset($socname); } else { - $carac_client_name=$outputlangs->convToOutputCharset($mysoc->nom); + $carac_client_name=$outputlangs->convToOutputCharset($this->emetteur->name); } - - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,$object->contact,$usecontact,'target'); + + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); // Show recipient $posy=42; From 8f32a35faa087d2758ea63a62d269e87156972cb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Apr 2012 12:34:02 +0200 Subject: [PATCH 2/6] Fix: invert emetteur and problem with long phone number --- htdocs/core/lib/pdf.lib.php | 2 +- .../supplier_order/pdf/pdf_muscadet.modules.php | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index eac6ff70dc8..80018d53d5b 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -221,7 +221,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Tel if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel); // Fax - if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? ($sourcecompany->tel ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); + if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); // EMail if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email); // Web diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index ff5b81a5dd5..a999e435111 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -98,8 +98,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->franchise=!$mysoc->tva_assuj; // Get source company - if (! is_object($object->thirdparty)) $object->fetch_thirdparty(); - $this->emetteur=$object->thirdparty; + $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined // Defini position des colonnes @@ -902,8 +901,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($this->marge_gauche,$posy); // Logo - $logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; - if ($mysoc->logo) + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + if ($this->emetteur->logo) { if (is_readable($logo)) { @@ -958,7 +957,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$mysoc); + $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); // Show sender $posy=42; @@ -979,10 +978,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Show sender name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($mysoc->name), 0, 'L'); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); // Show sender information - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($mysoc->name,44)*4)); + $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($this->emetteur->name,44)*4)); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); @@ -1002,12 +1001,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { // On peut utiliser le nom de la societe du contact if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; - else $socname = $this->emetteur->name; + else $socname = $object->client->name; $carac_client_name=$outputlangs->convToOutputCharset($socname); } else { - $carac_client_name=$outputlangs->convToOutputCharset($this->emetteur->name); + $carac_client_name=$outputlangs->convToOutputCharset($object->client->name); } $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); From 231fd6b2ae44b718286d30705c93f0b319d95b6c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Apr 2012 12:37:53 +0200 Subject: [PATCH 3/6] Fix: Removed warning --- htdocs/core/class/conf.class.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 8b220b58800..bd0f026aab7 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -94,7 +94,7 @@ class Conf $this->syslog = (object) array(); $this->browser = (object) array(); $this->multicompany = (object) array(); - + // First level object $this->expedition_bon = (object) array(); $this->livraison_bon = (object) array(); @@ -111,7 +111,7 @@ class Conf $this->bank = (object) array(); $this->notification = (object) array(); $this->mailing = (object) array(); - + //! Charset for HTML output and for storing data in memory $this->file->character_set_client='UTF-8'; // UTF-8, ISO-8859-1 } @@ -207,12 +207,12 @@ class Conf } $i++; } - + $db->free($resql); } //var_dump($this->modules); //var_dump($this->modules_parts); - + // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { @@ -220,7 +220,7 @@ class Conf $ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); if ($ret) $mc = new ActionsMulticompany($db); } - + // Second or others levels object $this->propal->cloture = (object) array(); $this->propal->facturation = (object) array(); @@ -289,7 +289,7 @@ class Conf // For backward compatibility $this->user->dir_output=$rootforuser."/users"; $this->user->dir_temp=$rootforuser."/users/temp"; - + // For propal storage $this->propal->dir_output=$rootforuser."/propale"; $this->propal->dir_temp=$rootforuser."/propale/temp"; @@ -307,7 +307,7 @@ class Conf $this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp"; $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; - + // Module product/service $this->product->multidir_output=array($this->entity => $rootfordata."/produit"); $this->product->multidir_temp =array($this->entity => $rootfordata."/produit/temp"); @@ -318,7 +318,7 @@ class Conf $this->product->dir_temp =$rootfordata."/produit/temp"; $this->service->dir_output=$rootfordata."/produit"; $this->service->dir_temp =$rootfordata."/produit/temp"; - + // Module contrat $this->contrat->dir_output=$rootfordata."/contracts"; $this->contrat->dir_temp =$rootfordata."/contracts/temp"; @@ -414,11 +414,11 @@ class Conf $this->bank->cheque->warning_delay=(isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT)?$this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT:0)*24*60*60; // For backward compatibility - $this->produit=$this->product; - $this->invoice=$this->facture; - $this->order=$this->commande; - $this->contract=$this->contrat; - $this->category=$this->categorie; + if (isset($this->product)) $this->produit=$this->product; + if (isset($this->facture)) $this->invoice=$this->facture; + if (isset($this->commande)) $this->order=$this->commande; + if (isset($this->contrat)) $this->contract=$this->contrat; + if (isset($this->categorie)) $this->category=$this->categorie; // Define menu manager in setup @@ -435,7 +435,7 @@ class Conf // For backward compatibility if ($this->top_menu == 'eldy.php') $this->top_menu='eldy_backoffice.php'; elseif ($this->top_menu == 'rodolphe.php') $this->top_menu='eldy_backoffice.php'; - + // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { From 62ecc497faf2b8085e3986a1a15eaa6f8d5adb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 26 Apr 2012 15:32:34 +0200 Subject: [PATCH 4/6] Fix: typo in unset --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b2f625d972e..814ca85636f 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1112,7 +1112,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- unset($_POST['qty']); unset($_POST['type']); unset($_POST['idprod']); - unset($_POST['remmise_percent']); + unset($_POST['remise_percent']); unset($_POST['dp_desc']); unset($_POST['np_desc']); unset($_POST['np_price']); From dfcfb48057c886d073d02c77b33b8150a940c65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 26 Apr 2012 15:47:21 +0200 Subject: [PATCH 5/6] =?UTF-8?q?Typo:=20instantan=C3=A9e=20ne=20prend=20qu'?= =?UTF-8?q?un=20n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/langs/fr_FR/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 81484ba7c2e..7102d977e92 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -603,7 +603,7 @@ Before=Avant After=Après IPAddress=Adresse IP Frequency=Fréquence -IM=Messagerie instantannée +IM=Messagerie instantanée NewAttribute=Nouvel attribut AttributeCode=Code de l'attribut OptionalFieldsSetup=Configuration des attributs complémentaires From 43f1fbed01457a914b3c1686d190150192577ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 16 May 2012 17:00:09 +0200 Subject: [PATCH 6/6] Trim payment amounts This allows to ignore trailing characters that may triggers a warning because the payment looks greater than what's required --- htdocs/compta/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 7d8caf6e69c..b66c4b09ecf 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -75,7 +75,7 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye if (substr($key,0,7) == 'amount_') { $cursorfacid = substr($key,7); - $amounts[$cursorfacid] = price2num($_POST[$key]); + $amounts[$cursorfacid] = price2num(trim($_POST[$key])); $totalpaiement = $totalpaiement + $amounts[$cursorfacid]; $tmpfacture=new Facture($db); $tmpfacture->fetch($cursorfacid);