diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 3bd1e16b27d..149eef20bee 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -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.'/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/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; @@ -382,6 +384,8 @@ $loanstatic = new Loan($db); $memberstatic = new Adherent($db); $paymentstatic = new Paiement($db); $paymentsupplierstatic = new PaiementFourn($db); +$paymentscstatic = new PaymentSocialContribution($db); +$paymentvatstatic = new PaymentVAT($db); $paymentsalstatic = new PaymentSalary($db); $paymentvariousstatic = new PaymentVarious($db); $donstatic = new Don($db); @@ -1221,16 +1225,16 @@ if ($resql) } elseif ($links[$key]['type'] == 'payment_sc') { - print ''; - print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; - //print $langs->trans("SocialContributionPayment"); - print ''; + $paymentscstatic->id = $links[$key]['url_id']; + $paymentscstatic->ref = $links[$key]['url_id']; + $paymentscstatic->label = $links[$key]['label']; + print ' '.$paymentscstatic->getNomUrl(2); } elseif ($links[$key]['type'] == 'payment_vat') { - print ''; - print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; - print ''; + $paymentvatstatic->id = $links[$key]['url_id']; + $paymentvatstatic->ref = $links[$key]['url_id']; + print ' '.$paymentvatstatic->getNomUrl(2); } elseif ($links[$key]['type'] == 'payment_salary') { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index c771a664d5f..2f4fb89e7de 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -702,17 +702,31 @@ class PaymentSocialContribution extends CommonObject $result = ''; if (empty($this->ref)) $this->ref = $this->lib; - $label = $langs->trans("ShowPayment").': '.$this->ref; - if (!empty($this->id)) { - $link = ''; - $linkend = ''; + $label = img_picto('', $this->picto).' '.$langs->trans("SocialContributionPayment").''; + $label .= '
'.$langs->trans('Ref').': '.$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 .= '
'.$langs->trans('Label').': '.$labeltoshow; + } + if ($this->datep) $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->datep, 'day'); - if ($withpicto) $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); - if ($withpicto && $withpicto != 2) $result .= ' '; - if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; - } + if (!empty($this->id)) { + $link = ''; + $linkend = ''; - return $result; - } + if ($withpicto) $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); + if ($withpicto && $withpicto != 2) $result .= ' '; + if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; + } + + return $result; + } } diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index f5a34decebc..7165fef7f4c 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -703,17 +703,31 @@ class PaymentVAT extends CommonObject $result = ''; if (empty($this->ref)) $this->ref = $this->lib; - $label = $langs->trans("ShowPayment").': '.$this->ref; - if (!empty($this->id)) { - $link = ''; - $linkend = ''; + $label = img_picto('', $this->picto).' '.$langs->trans("VATPayment").''; + $label .= '
'.$langs->trans('Ref').': '.$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 .= '
'.$langs->trans('Label').': '.$labeltoshow; + } + if ($this->datep) $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->datep, 'day'); - if ($withpicto) $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); - if ($withpicto && $withpicto != 2) $result .= ' '; - if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; - } + if (!empty($this->id)) { + $link = ''; + $linkend = ''; - return $result; - } + if ($withpicto) $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' '); + if ($withpicto && $withpicto != 2) $result .= ' '; + if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; + } + + return $result; + } } diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index c9ed4bd5671..e1f25d992a8 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -739,6 +739,8 @@ class Tva extends CommonObject $label = ''.$langs->trans("ShowVatPayment").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; + if (!empty($this->label)) + $label .= '
'.$langs->trans('Label').': '.$this->label; $url = DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index e2dca56dddc..7616b0b53a6 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -259,6 +259,7 @@ if ($result) $tva_static->id = $obj->rowid; $tva_static->ref = $obj->rowid; + $tva_static->label = $obj->label; // Ref print "".$tva_static->getNomUrl(1)."\n";