diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 67e6fb1d17a8c0fc548dd2439fd1346f6ea28324..b5f50a54e93dae4da44ed734559e757e2308d394 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -381,7 +381,7 @@ if ($id > 0) print '<td colspan="3">'; $amount_discount=$object->getAvailableDiscounts(); if ($amount_discount < 0) dol_print_error($db,$object->error); - if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount).'</a> '.$langs->trans("Currency".$conf->currency); + if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>'; else print $langs->trans("DiscountNone"); print '</td>'; print '</tr>'; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a388ce8bc0770227c04368f6b69c2d5b4e30081f..361ccf13c22872d6374e3f113b9be3834aa67ceb 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -8,7 +8,7 @@ * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> - * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> + * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * * 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 @@ -1681,28 +1681,22 @@ else if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; - $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); - $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); - $absolute_discount=price2num($absolute_discount,'MT'); - $absolute_creditnote=price2num($absolute_creditnote,'MT'); - if ($absolute_discount) - { - if ($object->statut > 0) - { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - - } - else - { + $absolute_discount = $soc->getAvailableDiscounts('', 'fk_facture_source IS NULL'); + $absolute_creditnote = $soc->getAvailableDiscounts('', 'fk_facture_source IS NOT NULL'); + $absolute_discount = price2num($absolute_discount, 'MT'); + $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + if ($absolute_discount) { + if ($object->statut > 0) { + print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount, 0, $langs, 0, 0, -1, $conf->currency)); + } else { // Remise dispo de type non avoir $filter='fk_facture_source IS NULL'; print '<br>'; $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); } } - if ($absolute_creditnote) - { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; + if ($absolute_creditnote) { + print $langs->trans("CompanyHasCreditNote", price($absolute_creditnote, 0, $langs, 0, 0, -1, $conf->currency)) . '. '; } if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; print '</td></tr>'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5943d451b9c348318747579665986a1ce375931b..3d175f49770cc96b0db31fd07b3e952c12b27ef1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3058,13 +3058,13 @@ class Form print '<tr><td class="nowrap">'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice - else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': '; + if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; } else { - if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': '; - else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': '; + if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; } $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles if ($filter) $newfilter.=' AND ('.$filter.')'; diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index 17ba4b11f4f6bdd165b3a6bb56d320c0bcebc774..77318bee7958ae345e9bd0d808cc3e41dc6ad0da 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -142,7 +142,7 @@ class InterfaceMailmanSpipsynchro dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // We add subscription if we change category (new category may means more mailing-list to subscribe) - if ($object->linkto->add_to_abo() < 0) + if (is_object($object->linkto) && method_exists($object->linkto, 'add_to_abo') && $object->linkto->add_to_abo() < 0) { $this->error=$object->linkto->error; $this->errors=$object->linkto->errors; @@ -160,7 +160,7 @@ class InterfaceMailmanSpipsynchro dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // We remove subscription if we change category (lessw category may means less mailing-list to subscribe) - if ($object->unlinkoff->del_to_abo() < 0) + if (is_object($object->unlinkoff) && method_exists($object->unlinkoff, 'del_to_abo') && $object->unlinkoff->del_to_abo() < 0) { $this->error=$object->unlinkoff->error; $this->errors=$object->unlinkoff->errors; diff --git a/test/.gitignore b/test/.gitignore index a5719aecc872ae1f05e9d983d4d14f3b7e0f489e..3e708fa593a6f9cdb3c1b0a643b4b7a56da83b8c 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1 +1,2 @@ /report +/test.xml