diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index edfea0d278c..12c48775d7f 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -658,9 +658,9 @@ class FormMail extends Form continue; } if (is_array($val)) $val = implode(', ', $val); // key __MULTICURRENCY_CODE__ is an array and crashes dolGetFirstLineOfText function which accept only text - $helpforsubstitution .= $key.' -> '.$langs->trans(dol_string_nohtmltag(dolGetFirstLineOfText($val))).'
'; - $helpforsubstitution .= ''; + $helpforsubstitution .= $key.' -> '.$langs->trans(dol_string_nohtmltag(dolGetFirstLineOfText((string) $val))).'
'; } + $helpforsubstitution .= ''; } /* diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8c68f4f7c48..96c74f8d3ca 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3485,6 +3485,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->hasRight('fournisseur', 'facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } + $original_file = preg_replace("/payment\//", "", $original_file); // Because the $conf->fournisseur->payment->dir_output already contains the "payment/" $original_file = $conf->fournisseur->payment->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."paiementfournisseur WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif ($modulepart == 'payment') { diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 3571167be9e..678831556ad 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -294,7 +294,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt } //dol_syslog("price.lib::calcul_price_total $qty, $pu, $remise_percent_ligne, $txtva, $price_base_type $info_bits"); - if ($price_base_type == 'HT') { + if ($price_base_type != 'TTC') { // We work to define prices using the price without tax $result[6] = price2num($tot_sans_remise, 'MT'); $result[8] = price2num($tot_sans_remise * (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)) + $localtaxes[0], 'MT'); // Selon TVA NPR ou non @@ -386,7 +386,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // If rounding is not using base 10 (rare) if (getDolGlobalString('MAIN_ROUNDING_RULE_TOT')) { - if ($price_base_type == 'HT') { + if ($price_base_type != 'TTC') { $result[0] = price2num(round((float) $result[0] / getDolGlobalFloat('MAIN_ROUNDING_RULE_TOT'), 0) * getDolGlobalFloat('MAIN_ROUNDING_RULE_TOT'), 'MT'); $result[1] = price2num(round((float) $result[1] / getDolGlobalFloat('MAIN_ROUNDING_RULE_TOT'), 0) * getDolGlobalFloat('MAIN_ROUNDING_RULE_TOT'), 'MT'); $result[9] = price2num(round((float) $result[9] / getDolGlobalFloat('MAIN_ROUNDING_RULE_TOT'), 0) * getDolGlobalFloat('MAIN_ROUNDING_RULE_TOT'), 'MT'); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 22cc0e91436..8d7e318dce8 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -31,13 +31,6 @@ // Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; - - /** * @var Conf $conf * @var DoliDB $db @@ -45,6 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; * @var Translate $langs * @var User $user */ +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'bills', 'companies', 'suppliers')); @@ -195,8 +193,9 @@ if ($result > 0) { $linkback = ''.$langs->trans("BackToList").''; + $morehtmlref = ''; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref'); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); print '
'; print '
'; @@ -279,7 +278,9 @@ if ($result > 0) { print '
'; - print '
'; + + print '

'; + /** * List of seller's invoices diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 5f10fd31a0c..4d6785074f1 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -121,43 +121,7 @@ if ($object->id > 0 && $upload_dir !== null) { // Supplier order card $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; - - // Date of payment - $morehtmlref .= $form->editfieldkey("Date", 'datep', $object->date, $object, (int) ($object->statut == 0 && ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer"))), 'datehourpicker', '', 0, 3).': '; - $morehtmlref .= $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer")), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); - - // Payment mode - $morehtmlref .= '
'.$langs->trans('PaymentMode').' : '; - $morehtmlref .= $langs->trans("PaymentType".$object->type_code) != "PaymentType".$object->type_code ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; - $morehtmlref .= $object->num_payment ? ' - '.$object->num_payment : ''; - - // Thirdparty - $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); - - // Amount - $morehtmlref .= '
'.$langs->trans('Amount').' : '. price($object->amount, 0, $langs, 0, 0, -1, $conf->currency); - - $allow_delete = 1; - // Bank account - if (isModEnabled("bank")) { - if ($object->fk_account) { - $bankline = new AccountLine($db); - $bankline->fetch($object->bank_line); - if ($bankline->rappro) { - $allow_delete = 0; - $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment")); - } - - $morehtmlref .= '
'.$langs->trans('BankAccount').' : '; - $accountstatic = new Account($db); - $accountstatic->fetch($bankline->fk_account); - $morehtmlref .= $accountstatic->getNomUrl(1); - - $morehtmlref .= '
'.$langs->trans('BankTransactionLine').' : '; - $morehtmlref .= $bankline->getNomUrl(1, 0, 'showconciliated'); - } - } + $morehtmlref = ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);