diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index feffbed15dd..84fdbf6bbe8 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -44,7 +44,7 @@ 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/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; -require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; @@ -384,7 +384,7 @@ $memberstatic = new Adherent($db); $paymentstatic = new Paiement($db); $paymentsupplierstatic = new PaiementFourn($db); $paymentvatstatic = new TVA($db); -$paymentsalstatic = new Salary($db); +$paymentsalstatic = new PaymentSalary($db); $paymentvariousstatic = new PaymentVarious($db); $donstatic = new Don($db); $paymentexpensereportstatic = new PaymentExpenseReport($db); @@ -1307,6 +1307,9 @@ if ($resql) elseif ($links[$key]['type'] == 'sc') { } + elseif ($links[$key]['type'] == 'salary') + { + } else { // Show link with label $links[$key]['label'] diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 644189052bf..0e2ba67675a 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -18,9 +18,9 @@ */ /** - * \file htdocs/compta/sociales/class/paymentsocialcontribution.class.php + * \file htdocs/salaries/class/paymentsalary.class.php * \ingroup facture - * \brief File of class to manage payment of social contributions + * \brief File of class to manage payment of salaries */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; /** - * Class to manage payments of social contributions + * Class to manage payments of salaries */ class PaymentSalary extends CommonObject { @@ -107,7 +107,7 @@ class PaymentSalary extends CommonObject } /** - * Create payment of social contribution into database. + * Create payment of salary into database. * Use this->amounts to have list of lines for the payment * * @param User $user User making payment @@ -127,7 +127,7 @@ class PaymentSalary extends CommonObject // Validate parametres if (!$this->datepaye) { - $this->error = 'ErrorBadValueForParameterCreatePaymentSocialContrib'; + $this->error = 'ErrorBadValueForParameterCreatePaymentSalary'; return -1; } @@ -207,7 +207,7 @@ class PaymentSalary extends CommonObject } } - $result = $this->call_trigger('PAYMENTSOCIALCONTRIBUTION_CREATE', $user); + $result = $this->call_trigger('PAYMENTSALARY_CREATE', $user); if ($result < 0) $error++; if ($totalamount != 0 && !$error) @@ -436,7 +436,7 @@ class PaymentSalary extends CommonObject { $error = 0; - $object = new PaymentSocialContribution($this->db); + $object = new PaymentSalary($this->db); $this->db->begin(); @@ -704,17 +704,31 @@ class PaymentSalary 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("SalaryPayment").''; + $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/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 42a59c7ed05..f1cf0990f27 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -542,7 +542,7 @@ class Salary extends CommonObject $result = ''; - $label = ''.$langs->trans("ShowSalaryPayment").''; + $label = ''.$langs->trans("Salary").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref;