FIX : correction of payment salaries list on employee tab of user card
This commit is contained in:
parent
bc1d06e5cc
commit
a767bffc3a
@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.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/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
@ -146,7 +146,7 @@ $bankaccountstatic = new Account($db);
|
||||
$chargestatic = new ChargeSociales($db);
|
||||
$paymentdonstatic = new PaymentDonation($db);
|
||||
$paymentvatstatic = new TVA($db);
|
||||
$paymentsalstatic = new Salary($db);
|
||||
$paymentsalstatic = new PaymentSalary($db);
|
||||
$paymentexpensereportstatic = new PaymentExpenseReport($db);
|
||||
$paymentvariousstatic = new PaymentVarious($db);
|
||||
$paymentloanstatic = new PaymentLoan($db);
|
||||
|
||||
@ -8,6 +8,7 @@ NewSalaryPayment=New salary card
|
||||
AddSalaryPayment=Add salary payment
|
||||
SalaryPayment=Salary payment
|
||||
SalariesPayments=Salaries payments
|
||||
SalariesPaymentsOf=Salaries payments of %s
|
||||
ShowSalaryPayment=Show salary payment
|
||||
THM=Average hourly rate
|
||||
TJM=Average daily rate
|
||||
|
||||
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
|
||||
if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('bills', 'banks', 'companies'));
|
||||
$langs->loadLangs(array('bills', 'banks', 'companies', 'salaries'));
|
||||
|
||||
// Security check
|
||||
$id = GETPOST("id", 'int');
|
||||
|
||||
@ -30,10 +30,11 @@
|
||||
require '../main.inc.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.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('compta', 'bills'));
|
||||
$langs->loadLangs(array('compta', 'bills', 'salaries'));
|
||||
|
||||
// Security check
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
@ -43,6 +44,7 @@ $mode = GETPOST("mode", 'alpha');
|
||||
$year = GETPOST("year", 'int');
|
||||
$filtre = GETPOST("filtre", 'alpha');
|
||||
if (!$year && $mode != 'sconly') { $year = date("Y", time()); }
|
||||
$search_user = GETPOST("search_user", 'int');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
@ -66,7 +68,11 @@ $sal_static = new Salary($db);
|
||||
llxHeader('', $langs->trans("SalariesArea"));
|
||||
|
||||
$title = $langs->trans("SalariesPayments");
|
||||
if ($mode == 'sconly') $title = $langs->trans("PaymentsSalaries");
|
||||
if (!empty($search_user)) {
|
||||
$u = new user($db);
|
||||
$u->fetch($search_user);
|
||||
$title = $langs->trans("SalariesPaymentsOf", $u->getNomUrl());
|
||||
}
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
||||
@ -124,6 +130,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON (u.rowid = s.fk_user)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ps.fk_typepayment = pct.id";
|
||||
$sql .= " WHERE s.entity IN (".getEntity('user').")";
|
||||
if(!empty($search_user)) $sql .= " AND u.rowid = ".$search_user;
|
||||
/* if ($year > 0)
|
||||
{
|
||||
$sql .= " AND (s.datesp between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
|
||||
|
||||
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php';
|
||||
if (!empty($conf->holiday->enabled)) require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
if (!empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
if (!empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
|
||||
if (!empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array('companies', 'commercial', 'banks', 'bills', 'trips', 'holiday', 'salaries'));
|
||||
@ -244,11 +244,12 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id)
|
||||
)
|
||||
{
|
||||
$salary = new Salary($db);
|
||||
$payment_salary = new PaymentSalary($db);
|
||||
|
||||
$sql = "SELECT ps.rowid, ps.datesp, ps.dateep, ps.amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as ps";
|
||||
$sql .= " WHERE ps.fk_user = ".$object->id;
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON (s.rowid = ps.fk_salary)";
|
||||
$sql .= " WHERE s.fk_user = ".$object->id;
|
||||
$sql .= " AND ps.entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY ps.datesp DESC";
|
||||
|
||||
@ -260,7 +261,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/salaries/list.php?search_user='.$object->login.'">'.$langs->trans("AllSalaries").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/salaries/payments.php?search_user='.$object->id.'">'.$langs->trans("AllSalaries").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -271,10 +272,10 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
$salary->id = $objp->rowid;
|
||||
$salary->ref = $objp->rowid;
|
||||
$payment_salary->id = $objp->rowid;
|
||||
$payment_salary->ref = $objp->rowid;
|
||||
|
||||
print $salary->getNomUrl(1);
|
||||
print $payment_salary->getNomUrl(1);
|
||||
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->datesp), 'day')."</td>\n";
|
||||
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dateep), 'day')."</td>\n";
|
||||
print '<td class="right" style="min-width: 60px">'.price($objp->amount).'</td></tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user