FIX : getNomUrl()

This commit is contained in:
Gauthier PC portable 024 2021-01-19 13:32:08 +01:00
parent c35a13bad0
commit ae6e1db652
5 changed files with 62 additions and 27 deletions

View File

@ -41,6 +41,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
@ -382,6 +384,8 @@ $loanstatic = new Loan($db);
$memberstatic = new Adherent($db); $memberstatic = new Adherent($db);
$paymentstatic = new Paiement($db); $paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db); $paymentsupplierstatic = new PaiementFourn($db);
$paymentscstatic = new PaymentSocialContribution($db);
$paymentvatstatic = new PaymentVAT($db);
$paymentsalstatic = new PaymentSalary($db); $paymentsalstatic = new PaymentSalary($db);
$paymentvariousstatic = new PaymentVarious($db); $paymentvariousstatic = new PaymentVarious($db);
$donstatic = new Don($db); $donstatic = new Don($db);
@ -1221,16 +1225,16 @@ if ($resql)
} }
elseif ($links[$key]['type'] == 'payment_sc') elseif ($links[$key]['type'] == 'payment_sc')
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">'; $paymentscstatic->id = $links[$key]['url_id'];
print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; $paymentscstatic->ref = $links[$key]['url_id'];
//print $langs->trans("SocialContributionPayment"); $paymentscstatic->label = $links[$key]['label'];
print '</a>'; print ' '.$paymentscstatic->getNomUrl(2);
} }
elseif ($links[$key]['type'] == 'payment_vat') elseif ($links[$key]['type'] == 'payment_vat')
{ {
print '<a href="'.DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$links[$key]['url_id'].'">'; $paymentvatstatic->id = $links[$key]['url_id'];
print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; $paymentvatstatic->ref = $links[$key]['url_id'];
print '</a>'; print ' '.$paymentvatstatic->getNomUrl(2);
} }
elseif ($links[$key]['type'] == 'payment_salary') elseif ($links[$key]['type'] == 'payment_salary')
{ {

View File

@ -702,7 +702,21 @@ class PaymentSocialContribution extends CommonObject
$result = ''; $result = '';
if (empty($this->ref)) $this->ref = $this->lib; if (empty($this->ref)) $this->ref = $this->lib;
$label = $langs->trans("ShowPayment").': '.$this->ref;
$label = img_picto('', $this->picto).' <u>'.$langs->trans("SocialContributionPayment").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->label)) {
$labeltoshow = $this->label;
$reg = array();
if (preg_match('/^\((.*)\)$/i', $this->label, $reg))
{
// Label generique car entre parentheses. On l'affiche en le traduisant
if ($reg[1] == 'paiement') $reg[1] = 'Payment';
$labeltoshow = $langs->trans($reg[1]);
}
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
}
if ($this->datep) $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
if (!empty($this->id)) { if (!empty($this->id)) {
$link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@ -703,7 +703,21 @@ class PaymentVAT extends CommonObject
$result = ''; $result = '';
if (empty($this->ref)) $this->ref = $this->lib; if (empty($this->ref)) $this->ref = $this->lib;
$label = $langs->trans("ShowPayment").': '.$this->ref;
$label = img_picto('', $this->picto).' <u>'.$langs->trans("VATPayment").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->label)) {
$labeltoshow = $this->label;
$reg = array();
if (preg_match('/^\((.*)\)$/i', $this->label, $reg))
{
// Label generique car entre parentheses. On l'affiche en le traduisant
if ($reg[1] == 'paiement') $reg[1] = 'Payment';
$labeltoshow = $langs->trans($reg[1]);
}
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
}
if ($this->datep) $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
if (!empty($this->id)) { if (!empty($this->id)) {
$link = '<a href="'.DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $link = '<a href="'.DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@ -739,6 +739,8 @@ class Tva extends CommonObject
$label = '<u>'.$langs->trans("ShowVatPayment").'</u>'; $label = '<u>'.$langs->trans("ShowVatPayment").'</u>';
$label .= '<br>'; $label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->label))
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
$url = DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id; $url = DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id;

View File

@ -259,6 +259,7 @@ if ($result)
$tva_static->id = $obj->rowid; $tva_static->id = $obj->rowid;
$tva_static->ref = $obj->rowid; $tva_static->ref = $obj->rowid;
$tva_static->label = $obj->label;
// Ref // Ref
print "<td>".$tva_static->getNomUrl(1)."</td>\n"; print "<td>".$tva_static->getNomUrl(1)."</td>\n";