Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
90abe5cd
Commit
90abe5cd
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
NEW: Add current salary on list of payment
parent
39192163
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/compta/salaries/index.php
+16
-6
16 additions, 6 deletions
htdocs/compta/salaries/index.php
htdocs/langs/en_US/salaries.lang
+1
-0
1 addition, 0 deletions
htdocs/langs/en_US/salaries.lang
with
17 additions
and
6 deletions
htdocs/compta/salaries/index.php
+
16
−
6
View file @
90abe5cd
<?php
/* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
/* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -82,7 +83,7 @@ $form = new Form($db);
$salstatic
=
new
PaymentSalary
(
$db
);
$userstatic
=
new
User
(
$db
);
$sql
=
"SELECT u.rowid as uid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev as dm, s.fk_typepayment as type, s.num_payment,"
;
$sql
=
"SELECT u.rowid as uid, u.lastname, u.firstname,
u.salary,
s.rowid, s.fk_user, s.amount, s.label, s.datev as dm, s.fk_typepayment as type, s.num_payment,"
;
$sql
.
=
" pst.code as payment_code"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"payment_salary as s"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"c_paiement as pst ON s.fk_typepayment = pst.id,"
;
...
...
@@ -93,7 +94,7 @@ $sql.= " AND s.entity = ".$conf->entity;
// Search criteria
if
(
$search_ref
)
$sql
.
=
" AND s.rowid="
.
$search_ref
;
if
(
$search_label
)
$sql
.
=
" AND s.label LIKE '%"
.
$db
->
escape
(
$search_label
)
.
"%'"
;
if
(
$search_amount
)
$sql
.
=
" AND s.amount='"
.
$db
->
escape
(
price2num
(
trim
(
$search_amount
)))
.
"'"
;
if
(
$search_amount
)
$sql
.
=
natural_search
(
"s.amount"
,
$search_amount
,
1
)
;
if
(
$filtre
)
{
$filtre
=
str_replace
(
":"
,
"="
,
$filtre
);
$sql
.
=
" AND "
.
$filtre
;
...
...
@@ -124,9 +125,10 @@ if ($result)
print
'<tr class="liste_titre">'
;
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
$_SERVER
[
"PHP_SELF"
],
"s.rowid"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Person"
),
$_SERVER
[
"PHP_SELF"
],
"u.rowid"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"CurrentSalary"
),
$_SERVER
[
"PHP_SELF"
],
"u.salary"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Label"
),
$_SERVER
[
"PHP_SELF"
],
"s.label"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"DatePayment"
),
$_SERVER
[
"PHP_SELF"
],
"s.datev"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"
Typ
e"
),
$_SERVER
[
"PHP_SELF"
],
"type"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"
PaymentMod
e"
),
$_SERVER
[
"PHP_SELF"
],
"type"
,
""
,
$param
,
'align="left"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"PayedByThisPayment"
),
$_SERVER
[
"PHP_SELF"
],
"s.amount"
,
""
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
""
);
print
"</tr>
\n
"
;
...
...
@@ -136,6 +138,9 @@ if ($result)
print
'<td class="liste_titre" align="left">'
;
print
'<input class="flat" type="text" size="3" name="search_ref" value="'
.
$search_ref
.
'">'
;
print
'</td>'
;
// People
print
'<td class="liste_titre"> </td>'
;
// Current salary
print
'<td class="liste_titre"> </td>'
;
// Label
print
'<td class="liste_titre"><input type="text" class="flat" size="14" name="search_label" value="'
.
$search_label
.
'"></td>'
;
...
...
@@ -161,8 +166,13 @@ if ($result)
$userstatic
->
firstname
=
$obj
->
firstname
;
$salstatic
->
id
=
$obj
->
rowid
;
$salstatic
->
ref
=
$obj
->
rowid
;
print
"<td>"
.
$salstatic
->
getNomUrl
(
1
)
.
"</td>
\n
"
;
// Ref
print
"<td>"
.
$salstatic
->
getNomUrl
(
1
)
.
"</td>
\n
"
;
// User name
print
"<td>"
.
$userstatic
->
getNomUrl
(
1
)
.
"</td>
\n
"
;
// Current salary
print
"<td>"
.
(
$obj
->
salary
?
price
(
$obj
->
salary
)
:
''
)
.
"</td>
\n
"
;
// Label payment
print
"<td>"
.
dol_trunc
(
$obj
->
label
,
40
)
.
"</td>
\n
"
;
print
'<td align="left">'
.
dol_print_date
(
$db
->
jdate
(
$obj
->
dm
),
'day'
)
.
"</td>
\n
"
;
// Type
...
...
@@ -176,7 +186,7 @@ if ($result)
$i
++
;
}
print
'<tr class="liste_total"><td colspan="
5
" class="liste_total">'
.
$langs
->
trans
(
"Total"
)
.
'</td>'
;
print
'<tr class="liste_total"><td colspan="
6
" class="liste_total">'
.
$langs
->
trans
(
"Total"
)
.
'</td>'
;
print
'<td class="liste_total" align="right">'
.
price
(
$total
,
0
,
$outputlangs
,
1
,
-
1
,
-
1
,
$conf
->
currency
)
.
"</td>"
;
print
"<td> </td></tr>"
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/langs/en_US/salaries.lang
+
1
−
0
View file @
90abe5cd
...
...
@@ -10,3 +10,4 @@ SalariesPayments=Salaries payments
ShowSalaryPayment=Show salary payment
THM=Average hourly price
TJM=Average daily price
CurrentSalary=Current salary
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment